<?php
/**
 * @file
 * Auto Generated Code - DO NOT EDIT
 *
 * See http://51degrees.mobi/Support/Documentation/PHP#AutoGeneratedSourceCode for more details.*
 */

/**
 * This Source Code Form is subject to the terms of the Mozilla Public License,
 * v. 2.0.
 *
 * If a copy of the MPL was not distributed with this file, You can obtain one
 * at http://mozilla.org/MPL/2.0/.
 *
 * This Source Code Form is "Incompatible With Secondary Licenses", as defined
 * by the Mozilla Public License, v. 2.0.
 */

/**
 * Calculates the edit distance between the two strings.
 *
 * &$target string
 *   The string we're trying to find the closest value to.
 * $test string
 *   The string that we're testing against.
 * $ls integer
 *   The lowest score we've found so far.
 * return integer
 *   The edit distance between the two strings.
 */
function E21($target, $test, $ls) {
  return fiftyone_degrees_edit_distance($target, $test, $ls);
}

/**
 * Returns the details of the devices that are closest to the useragent string provided.
 *
 * $useragent string
 *   The useragent we're trying to find.
 * return array
 *   An array of device details for the closest devices.
 */
function _H21($useragent) {
  $ls = PHP_INT_MAX;
  $dl = array();
  $ua = 'Apple+iPhone+OS+v3.1.2+CoreMedia+v1.0.0.7D11';
  $ns = E21($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(12280,17779,17470,18092, $ua);
  }
  $ua = 'Apple iPhone v1.1.4 CoreMedia v1.0.0.4A102';
  $ns = E21($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(12280,17779,17470,18092, $ua);
  }
  $ua = 'Apple iPhone v1.1.5 CoreMedia v1.0.0.4B1';
  $ns = E21($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(12280,17779,17470,18092, $ua);
  }
  $ua = 'Apple Mac OS X v10.6.2 CoreMedia v1.0.0.10C540';
  $ns = E21($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(17595,17017,17470,18092, $ua);
  }
  $ua = 'Apple Mac OS X v10.6.4 CoreMedia v1.0.0.10F569';
  $ns = E21($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(17595,17017,17470,18092, $ua);
  }
  $ua = 'Apple Mac OS X v10.6.5 CoreMedia v1.0.0.10H574';
  $ns = E21($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(17595,17017,17470,18092, $ua);
  }
  $ua = 'Apple Mac OS X v10.6.4 CoreMedia v1.0.0.10F2108';
  $ns = E21($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(17595,17017,17470,18092, $ua);
  }
  $ua = 'Apple Mac OS X v10.6.6 CoreMedia v1.0.0.10J567';
  $ns = E21($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(17595,17017,17470,18092, $ua);
  }
  $ua = 'Apple Mac OS X v10.6.7 CoreMedia v1.0.0.10J869';
  $ns = E21($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(17595,17017,17470,18092, $ua);
  }
  $ua = 'Apple Mac OS X v10.6.7 CoreMedia v1.0.0.10J3250';
  $ns = E21($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(17595,17017,17470,18092, $ua);
  }
  $ua = 'Apple Mac OS X v10.6.6 CoreMedia v1.0.0.10J3210';
  $ns = E21($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(17595,17017,17470,18092, $ua);
  }
  $ua = 'Apple Mac OS X v10.6.3 CoreMedia v1.0.0.10D2125';
  $ns = E21($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(17595,17017,17470,18092, $ua);
  }
  $ua = 'Apple Mac OS X v10.6.7 CoreMedia v1.0.0.10J4138';
  $ns = E21($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(17595,17017,17470,18092, $ua);
  }
  $ua = 'Apple Mac OS X v10.6.7 CoreMedia v1.0.0.10J4139';
  $ns = E21($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(17595,17017,17470,18092, $ua);
  }
  $ua = 'Apple Mac OS X v10.6.8 CoreMedia v1.0.0.10K540';
  $ns = E21($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(17595,17017,17470,18092, $ua);
  }
  $ua = 'Apple Mac OS X v10.6.8 CoreMedia v1.0.0.10K549';
  $ns = E21($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(17595,17017,17470,18092, $ua);
  }
  $ua = 'AppleCoreMedia/1.0.0.11B26 (Macintosh; U; Intel Mac OS X 10_7_1; en_us)';
  $ns = E21($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(17595,17297,18215,18092, $ua);
  }
  $ua = 'AppleCoreMedia/1.0.0.11C74 (Macintosh; U; Intel Mac OS X 10_7_2; en_us)';
  $ns = E21($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(17595,17297,18215,18092, $ua);
  }
  $ua = 'AppleCoreMedia/1.0.0.11A511a (Macintosh; U; Intel Mac OS X 10_7; en_us)';
  $ns = E21($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(17595,17297,18215,18092, $ua);
  }
  $ua = 'AppleCoreMedia/1.0.0.11C74 (Macintosh; U; Intel Mac OS X 10_7_2; de_de)';
  $ns = E21($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(17595,17297,18215,18092, $ua);
  }
  $ua = 'AppleCoreMedia/1.0.0.11D50 (Macintosh; U; Intel Mac OS X 10_7_3; en_us)';
  $ns = E21($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(17595,17297,18215,18092, $ua);
  }
  $ua = 'AppleCoreMedia/1.0.0.11D50b (Macintosh; U; Intel Mac OS X 10_7_3; en_us)';
  $ns = E21($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(17595,17297,18215,18092, $ua);
  }
  $ua = 'AppleCoreMedia/1.0.0.11D50b (Macintosh; U; Intel Mac OS X 10_7_3; de_de)';
  $ns = E21($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(17595,17297,18215,18092, $ua);
  }
  $ua = 'AppleCoreMedia/1.0.0.11A511 (Macintosh; U; Intel Mac OS X 10_7; en_us)';
  $ns = E21($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(17595,17297,18215,18092, $ua);
  }
  $ua = 'AppleCoreMedia/1.0.0.11D50d (Macintosh; U; Intel Mac OS X 10_7_3; en_us)';
  $ns = E21($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(17595,17297,18215,18092, $ua);
  }
  $ua = 'AppleCoreMedia/1.0.0.11E53 (Macintosh; U; Intel Mac OS X 10_7_4; en_us)';
  $ns = E21($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(17595,17297,18215,18092, $ua);
  }
  $ua = 'AppleCoreMedia/1.0.0.11C2002 (Macintosh; U; Intel Mac OS X 10_7_2; en_us)';
  $ns = E21($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(17595,17297,18215,18092, $ua);
  }
  $ua = 'AppleCoreMedia/1.0.0.11B2118 (Macintosh; U; Intel Mac OS X 10_7_1; en_us)';
  $ns = E21($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(17595,17297,18215,18092, $ua);
  }
  $ua = 'AppleCoreMedia/1.0.0.11C74 (Macintosh; U; Intel Mac OS X 10_7_2; fr_fr)';
  $ns = E21($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(17595,17297,18215,18092, $ua);
  }
  $ua = 'AppleCoreMedia/1.0.0.11D2001 (Macintosh; U; Intel Mac OS X 10_7_3; en_us)';
  $ns = E21($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(17595,17297,18215,18092, $ua);
  }
  $ua = 'AppleCoreMedia/1.0.0.11C74 (Macintosh; U; Intel Mac OS X 10_7_2; es_es)';
  $ns = E21($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(17595,17297,18215,18092, $ua);
  }
  $ua = 'Apple iPhone OS v3.0 CoreMedia v1.0.0.7A341';
  $ns = E21($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(12280,17017,17470,18092, $ua);
  }
  $ua = 'Apple iPhone OS v3.0.1 CoreMedia v1.0.0.7A400';
  $ns = E21($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(12280,17017,17470,18092, $ua);
  }
  $ua = 'Apple iPhone OS v3.1.2 CoreMedia v1.0.0.7D11';
  $ns = E21($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(12280,17017,17470,18092, $ua);
  }
  $ua = 'Apple iPhone OS v3.1.1 CoreMedia v1.0.0.7C145';
  $ns = E21($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(12280,17017,17470,18092, $ua);
  }
  $ua = 'Apple iPhone OS v3.1.3 CoreMedia v1.0.0.7E18';
  $ns = E21($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(12280,17017,17470,18092, $ua);
  }
  $ua = 'Apple iPhone OS v3.1 CoreMedia v1.0.0.7C144';
  $ns = E21($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(12280,17017,17470,18092, $ua);
  }
  $ua = 'Apple iPhone OS v2.0 CoreMedia v1.0.0.5A347';
  $ns = E21($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(12280,17017,17470,18092, $ua);
  }
  $ua = 'Apple iPhone OS v2.0.1 CoreMedia v1.0.0.5B108';
  $ns = E21($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(12280,17017,17470,18092, $ua);
  }
  $ua = 'Apple iPhone OS v2.1 CoreMedia v1.0.0.5F136';
  $ns = E21($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(12280,17017,17470,18092, $ua);
  }
  $ua = 'Apple iPhone OS v2.1 CoreMedia v1.0.0.5F137';
  $ns = E21($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(12280,17017,17470,18092, $ua);
  }
  $ua = 'Apple iPhone OS v2.2 CoreMedia v1.0.0.5G77';
  $ns = E21($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(12280,17017,17470,18092, $ua);
  }
  $ua = 'Apple iPhone OS v2.2 CoreMedia v1.0.0.5G77a';
  $ns = E21($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(12280,17017,17470,18092, $ua);
  }
  $ua = 'Apple iPhone OS v2.1.1 CoreMedia v1.0.0.5F138';
  $ns = E21($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(12280,17017,17470,18092, $ua);
  }
  $ua = 'Apple iPhone OS v2.2.1 CoreMedia v1.0.0.5H11';
  $ns = E21($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(12280,17017,17470,18092, $ua);
  }
  return $dl;
}
