#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 *getApplicationCommandLine(char *, char *, char const **, char **, char **,
                                size_t);
char *getEditorCommandLine(char *editor, char *filename) {
  const char *known[] = {
      "nedit",
      "gedit",
      "xedit",
      "textedit",
      "/Applications/TextEdit.app/Contents/MacOS/TextEdit",
      "/Applications/TextWrangler.app/Contents/MacOS/TextWrangler",
      "/Applications/Eclipse.app/Contents/MacOS/eclipse",
      "/Applications/eclipse/Eclipse.app/Contents/MacOS/eclipse",
      "xemacs",
      "emacs",
      "/Applications/Emacs.app/Contents/MacOS/Emacs",
      "gvim",
      "kedit",
      "vi",
      "nano",
      "pico"};
  char *xterm[] = {"n", "n", "n", "n", "n", "n", "n", "n",
                   "n", "n", "n", "n", "n", "y", "y", "y"};
  char *opencmd[] = {"",        "",        "", "", "TextEdit", "TextWrangler",
                     "Eclipse", "Eclipse", "", "", "Emacs",    "",
                     "",        "",        "", ""};
  size_t total = sizeof(known) / sizeof(known[0]);
  return getApplicationCommandLine(editor, filename, known, xterm, opencmd,
                                   total);
}


x86 assembly (clang, -O0):
<getEditorCommandLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x90(%rbp),%rdi
lea    0x2b5f(%rip),%rsi
mov    $0x80,%edx
call   1030 <memcpy@plt>
lea    -0x110(%rbp),%rdi
lea    0x2bc7(%rip),%rsi
mov    $0x80,%edx
call   1030 <memcpy@plt>
lea    -0x190(%rbp),%rdi
lea    0x2c2f(%rip),%rsi
mov    $0x80,%edx
call   1030 <memcpy@plt>
movq   $0x10,-0x198(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x90(%rbp),%rdx
lea    -0x110(%rbp),%rcx
lea    -0x190(%rbp),%r8
mov    -0x198(%rbp),%r9
call   1040 <getApplicationCommandLine@plt>
add    $0x1a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getEditorCommandLine>:
sub    $0x188,%rsp
movaps 0x2bf2(%rip),%xmm0
movaps %xmm0,0x170(%rsp)
movaps 0x2bd3(%rip),%xmm0
movaps %xmm0,0x160(%rsp)
movaps 0x2bb4(%rip),%xmm0
movaps %xmm0,0x150(%rsp)
movaps 0x2b95(%rip),%xmm0
movaps %xmm0,0x140(%rsp)
movaps 0x2b76(%rip),%xmm0
movaps %xmm0,0x130(%rsp)
movaps 0x2b57(%rip),%xmm0
movaps %xmm0,0x120(%rsp)
movaps 0x2b38(%rip),%xmm0
movaps %xmm0,0x110(%rsp)
movaps 0x2b19(%rip),%xmm0
movaps %xmm0,0x100(%rsp)
movaps 0x2bfa(%rip),%xmm0
movaps %xmm0,0xf0(%rsp)
movaps 0x2bdb(%rip),%xmm0
movaps %xmm0,0xe0(%rsp)
movaps 0x2bbc(%rip),%xmm0
movaps %xmm0,0xd0(%rsp)
movaps 0x2b9d(%rip),%xmm0
movaps %xmm0,0xc0(%rsp)
movaps 0x2b7e(%rip),%xmm0
movaps %xmm0,0xb0(%rsp)
movaps 0x2b5f(%rip),%xmm0
movaps %xmm0,0xa0(%rsp)
movaps 0x2b40(%rip),%xmm0
movaps %xmm0,0x90(%rsp)
movaps 0x2b21(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps 0x2c02(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0x2be6(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0x2bca(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0x2bae(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0x2b92(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0x2b76(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0x2b5a(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0x2b3e(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x100(%rsp),%rdx
lea    0x80(%rsp),%rcx
mov    %rsp,%r8
mov    $0x10,%r9d
call   1030 <getApplicationCommandLine@plt>
add    $0x188,%rsp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"nedit\00"
@.str.1 = [6 x i8] c"gedit\00"
@.str.2 = [6 x i8] c"xedit\00"
@.str.3 = [9 x i8] c"textedit\00"
@.str.4 = [51 x i8] c"/Applications/TextEdit.app/Contents/MacOS/TextEdit\00"
@.str.5 = [59 x i8] c"/Applications/TextWrangler.app/Contents/MacOS/TextWrangler\00"
@.str.6 = [49 x i8] c"/Applications/Eclipse.app/Contents/MacOS/eclipse\00"
@.str.7 = [57 x i8] c"/Applications/eclipse/Eclipse.app/Contents/MacOS/eclipse\00"
@.str.8 = [7 x i8] c"xemacs\00"
@.str.9 = [6 x i8] c"emacs\00"
@.str.10 = [45 x i8] c"/Applications/Emacs.app/Contents/MacOS/Emacs\00"
@.str.11 = [5 x i8] c"gvim\00"
@.str.12 = [6 x i8] c"kedit\00"
@.str.13 = [3 x i8] c"vi\00"
@.str.14 = [5 x i8] c"nano\00"
@.str.15 = [5 x i8] c"pico\00"
@__const.getEditorCommandLine.known = [16 x i8*] [i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 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 ([45 x i8], [45 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i32 0, i32 0)]
@.str.16 = [2 x i8] c"n\00"
@.str.17 = [2 x i8] c"y\00"
@__const.getEditorCommandLine.xterm = [16 x i8*] [i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.17, i32 0, i32 0)]
@.str.18 = [1 x i8] zeroinitializer
@.str.19 = [9 x i8] c"TextEdit\00"
@.str.20 = [13 x i8] c"TextWrangler\00"
@.str.21 = [8 x i8] c"Eclipse\00"
@.str.22 = [6 x i8] c"Emacs\00"
@__const.getEditorCommandLine.opencmd = [16 x i8*] [i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.19, i32 0, i32 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.21, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.21, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.22, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.18, i32 0, i32 0)]
define i8* @getEditorCommandLine(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [16 x i8*]
%6 = alloca [16 x i8*]
%7 = alloca [16 x i8*]
%8 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%9 = bitcast [16 x i8*]* %5 to i8*
%10 = bitcast [16 x i8*]* %6 to i8*
%11 = bitcast [16 x i8*]* %7 to i8*
store i64 16, i64* %8
%12 = load i8*, i8** %3
%13 = load i8*, i8** %4
%14 = getelementptr inbounds [16 x i8*], [16 x i8*]* %5, i64 0, i64 0
%15 = getelementptr inbounds [16 x i8*], [16 x i8*]* %6, i64 0, i64 0
%16 = getelementptr inbounds [16 x i8*], [16 x i8*]* %7, i64 0, i64 0
%17 = load i64, i64* %8
%18 = call i8* @getApplicationCommandLine(i8* %12, i8* %13, i8** %14, i8** %15, i8** %16, i64 %17)
ret i8* %18
}

LLVM IR (-O2):
@.str = [6 x i8] c"nedit\00"
@.str.1 = [6 x i8] c"gedit\00"
@.str.2 = [6 x i8] c"xedit\00"
@.str.3 = [9 x i8] c"textedit\00"
@.str.4 = [51 x i8] c"/Applications/TextEdit.app/Contents/MacOS/TextEdit\00"
@.str.5 = [59 x i8] c"/Applications/TextWrangler.app/Contents/MacOS/TextWrangler\00"
@.str.6 = [49 x i8] c"/Applications/Eclipse.app/Contents/MacOS/eclipse\00"
@.str.7 = [57 x i8] c"/Applications/eclipse/Eclipse.app/Contents/MacOS/eclipse\00"
@.str.8 = [7 x i8] c"xemacs\00"
@.str.9 = [6 x i8] c"emacs\00"
@.str.10 = [45 x i8] c"/Applications/Emacs.app/Contents/MacOS/Emacs\00"
@.str.11 = [5 x i8] c"gvim\00"
@.str.12 = [6 x i8] c"kedit\00"
@.str.13 = [3 x i8] c"vi\00"
@.str.14 = [5 x i8] c"nano\00"
@.str.15 = [5 x i8] c"pico\00"
@__const.getEditorCommandLine.known = [16 x i8*] [i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 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 ([45 x i8], [45 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i32 0, i32 0)]
@.str.16 = [2 x i8] c"n\00"
@.str.17 = [2 x i8] c"y\00"
@__const.getEditorCommandLine.xterm = [16 x i8*] [i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.17, i32 0, i32 0)]
@.str.18 = [1 x i8] zeroinitializer
@.str.19 = [9 x i8] c"TextEdit\00"
@.str.20 = [13 x i8] c"TextWrangler\00"
@.str.21 = [8 x i8] c"Eclipse\00"
@.str.22 = [6 x i8] c"Emacs\00"
@__const.getEditorCommandLine.opencmd = [16 x i8*] [i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.19, i32 0, i32 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.21, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.21, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.22, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.18, i32 0, i32 0)]
define i8* @getEditorCommandLine(i8* %0, i8* %1) {
%3 = alloca [16 x i8*]
%4 = alloca [16 x i8*]
%5 = alloca [16 x i8*]
%6 = bitcast [16 x i8*]* %3 to i8*
%7 = bitcast [16 x i8*]* %4 to i8*
%8 = bitcast [16 x i8*]* %5 to i8*
%9 = getelementptr inbounds [16 x i8*], [16 x i8*]* %3, i64 0, i64 0
%10 = getelementptr inbounds [16 x i8*], [16 x i8*]* %4, i64 0, i64 0
%11 = getelementptr inbounds [16 x i8*], [16 x i8*]* %5, i64 0, i64 0
%12 = call i8* @getApplicationCommandLine(i8* %0, i8* %1, i8** %9, i8** %10, i8** %11, i64 16)
ret i8* %12
}