#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ known;

/* Variables and functions */
char *detectApplications(char **, size_t);
char *detectBrowsers() {
  char *known[] = {
      "firefox",
      "google-chrome",
      "/Applications/Firefox.app/Contents/MacOS/firefox",
      "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
      "/Applications/Safari.app/Contents/MacOS/Safari",
      "/Applications/Opera.app/Contents/MacOS/Opera",
      "netscape",
      "w3m",
      "konqueror",
      "opera",
      "elinks",
      "links",
      "lynx",
      "yelp"};
  size_t total = sizeof(known) / sizeof(known[0]);
  return detectApplications(known, total);
}


x86 assembly (clang, -O0):
<detectBrowsers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
lea    -0x70(%rbp),%rdi
lea    0x2c7a(%rip),%rsi
mov    $0x70,%edx
call   1040 <memcpy@plt>
movq   $0xe,-0x78(%rbp)
lea    -0x70(%rbp),%rdi
mov    -0x78(%rbp),%rsi
call   1030 <detectApplications@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<detectBrowsers>:
sub    $0x78,%rsp
movaps 0x2cf5(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0x2cd9(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0x2cbd(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0x2ca1(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0x2c85(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0x2c69(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0x2c4d(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0xe,%esi
call   1030 <detectApplications@plt>
add    $0x78,%rsp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"firefox\00"
@.str.1 = [14 x i8] c"google-chrome\00"
@.str.2 = [49 x i8] c"/Applications/Firefox.app/Contents/MacOS/firefox\00"
@.str.3 = [61 x i8] c"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome\00"
@.str.4 = [47 x i8] c"/Applications/Safari.app/Contents/MacOS/Safari\00"
@.str.5 = [45 x i8] c"/Applications/Opera.app/Contents/MacOS/Opera\00"
@.str.6 = [9 x i8] c"netscape\00"
@.str.7 = [4 x i8] c"w3m\00"
@.str.8 = [10 x i8] c"konqueror\00"
@.str.9 = [6 x i8] c"opera\00"
@.str.10 = [7 x i8] c"elinks\00"
@.str.11 = [6 x i8] c"links\00"
@.str.12 = [5 x i8] c"lynx\00"
@.str.13 = [5 x i8] c"yelp\00"
@__const.detectBrowsers.known = [14 x i8*] [i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i32 0, i32 0)]
define i8* @detectBrowsers() {
%1 = alloca [14 x i8*]
%2 = alloca i64
%3 = bitcast [14 x i8*]* %1 to i8*
store i64 14, i64* %2
%4 = getelementptr inbounds [14 x i8*], [14 x i8*]* %1, i64 0, i64 0
%5 = load i64, i64* %2
%6 = call i8* @detectApplications(i8** %4, i64 %5)
ret i8* %6
}

LLVM IR (-O2):
@.str = [8 x i8] c"firefox\00"
@.str.1 = [14 x i8] c"google-chrome\00"
@.str.2 = [49 x i8] c"/Applications/Firefox.app/Contents/MacOS/firefox\00"
@.str.3 = [61 x i8] c"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome\00"
@.str.4 = [47 x i8] c"/Applications/Safari.app/Contents/MacOS/Safari\00"
@.str.5 = [45 x i8] c"/Applications/Opera.app/Contents/MacOS/Opera\00"
@.str.6 = [9 x i8] c"netscape\00"
@.str.7 = [4 x i8] c"w3m\00"
@.str.8 = [10 x i8] c"konqueror\00"
@.str.9 = [6 x i8] c"opera\00"
@.str.10 = [7 x i8] c"elinks\00"
@.str.11 = [6 x i8] c"links\00"
@.str.12 = [5 x i8] c"lynx\00"
@.str.13 = [5 x i8] c"yelp\00"
@__const.detectBrowsers.known = [14 x i8*] [i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i32 0, i32 0)]
define i8* @detectBrowsers() {
%1 = alloca [14 x i8*]
%2 = bitcast [14 x i8*]* %1 to i8*
%3 = getelementptr inbounds [14 x i8*], [14 x i8*]* %1, i64 0, i64 0
%4 = call i8* @detectApplications(i8** %3, i64 14)
ret i8* %4
}