#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*/ szLine;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int atol(char const *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
char *getenv(char *);
scalar_t__ getpid();
int main(int argc, char **argv, char **envp) {
  const char *pszLogTo = getenv("WRAPPER_LOGTO");
  const char *pszLogFileArgs = getenv("WRAPPER_LOGFILEARGS");
  const char *pszLogEnv = getenv("WRAPPER_LOGENV");
  const char *pszExec = getenv("WRAPPER_EXEC");
  const char *pszSigSegv = getenv("WRAPPER_SIGSEGV");
  const char *pszRetVal = getenv("WRAPPER_RETVAL");
  int i;
  if (pszLogTo) {
    FILE *pLog = fopen(pszLogTo, "a");
    if (pLog) {
      fprintf(pLog, "+++ %s pid=%ld +++\n", argv[0], (long)getpid());
      for (i = 1; i < argc; i++) {
        fprintf(pLog, "argv[%d]: '%s'\n", i, argv[i]);
        if (pszLogFileArgs) {
          FILE *pArg = fopen(argv[i], "r");
          if (pArg) {
            int iLine = 0;
            static char szLine[64 * 1024];
            while (fgets(szLine, sizeof(szLine), pArg) && iLine++ < 42)
              fprintf(pLog, "%2d: %s", iLine, szLine);
            fclose(pArg);
          }
        }
      }
      if (pszLogEnv)
        for (i = 0; envp[i]; i++)
          fprintf(pLog, "envp[%d]: '%s'\n", i, envp[i]);
      fprintf(pLog, "--- %s pid=%ld ---\n", argv[0], (long)getpid());
      fclose(pLog);
    }
  }
  if (pszSigSegv) {
    char *pchIllegal = (char *)1;
    pchIllegal[0] = '\0';
  }
  if (pszExec) {
  }
  return pszRetVal ? atol(pszRetVal) : 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xe6c(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x20(%rbp)
lea    0xe6a(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x28(%rbp)
lea    0xe6e(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x30(%rbp)
lea    0xe6d(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x38(%rbp)
lea    0xe6a(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x40(%rbp)
lea    0xe6a(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     13f3 <main+0x283>
mov    -0x20(%rbp),%rdi
lea    0xe5a(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x58(%rbp)
cmpq   $0x0,-0x58(%rbp)
je     13ee <main+0x27e>
mov    -0x58(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x78(%rbp)
mov    $0x0,%al
call   1040 <getpid@plt>
mov    -0x80(%rbp),%rdi
mov    -0x78(%rbp),%rdx
mov    %rax,%rcx
lea    0xe1c(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x1,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    134d <main+0x1dd>
mov    -0x58(%rbp),%rdi
mov    -0x4c(%rbp),%edx
mov    -0x10(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mov    (%rax,%rcx,8),%rcx
lea    0xdfc(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
cmpq   $0x0,-0x28(%rbp)
je     133a <main+0x1ca>
mov    -0x10(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xde7(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x60(%rbp)
cmpq   $0x0,-0x60(%rbp)
je     1335 <main+0x1c5>
movl   $0x0,-0x64(%rbp)
mov    -0x60(%rbp),%rdx
lea    0x2dae(%rip),%rdi
mov    $0x10000,%esi
call   1060 <fgets@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x81(%rbp)
je     12f8 <main+0x188>
mov    -0x64(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x64(%rbp)
cmp    $0x2a,%eax
setl   %al
mov    %al,-0x81(%rbp)
mov    -0x81(%rbp),%al
test   $0x1,%al
jne    130b <main+0x19b>
jmp    132c <main+0x1bc>
mov    -0x58(%rbp),%rdi
mov    -0x64(%rbp),%edx
lea    0xd6c(%rip),%rsi
lea    0x2d50(%rip),%rcx
mov    $0x0,%al
call   1070 <fprintf@plt>
jmp    12b7 <main+0x147>
mov    -0x60(%rbp),%rdi
call   1050 <fclose@plt>
jmp    133a <main+0x1ca>
jmp    133f <main+0x1cf>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    1251 <main+0xe1>
cmpq   $0x0,-0x30(%rbp)
je     13a6 <main+0x236>
movl   $0x0,-0x4c(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x4c(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     13a1 <main+0x231>
mov    -0x58(%rbp),%rdi
mov    -0x4c(%rbp),%edx
mov    -0x18(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mov    (%rax,%rcx,8),%rcx
lea    0xd01(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    135f <main+0x1ef>
jmp    13a6 <main+0x236>
mov    -0x58(%rbp),%rax
mov    %rax,-0x98(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x90(%rbp)
mov    $0x0,%al
call   1040 <getpid@plt>
mov    -0x98(%rbp),%rdi
mov    -0x90(%rbp),%rdx
mov    %rax,%rcx
lea    0xcbf(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x58(%rbp),%rdi
call   1050 <fclose@plt>
jmp    13f3 <main+0x283>
cmpq   $0x0,-0x40(%rbp)
je     140e <main+0x29e>
mov    $0x1,%eax
mov    %rax,-0x70(%rbp)
mov    -0x70(%rbp),%rax
movb   $0x0,(%rax)
cmpq   $0x0,-0x38(%rbp)
je     141e <main+0x2ae>
jmp    141e <main+0x2ae>
cmpq   $0x0,-0x48(%rbp)
je     143d <main+0x2cd>
mov    -0x48(%rbp),%rdi
call   1080 <atol@plt>
mov    %eax,-0x9c(%rbp)
jmp    144d <main+0x2dd>
mov    $0x1,%eax
mov    %eax,-0x9c(%rbp)
jmp    144d <main+0x2dd>
mov    -0x9c(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rdx,%r15
mov    %rsi,%r13
mov    %edi,%r14d
lea    0xe72(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rbx
lea    0xe71(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,0x30(%rsp)
lea    0xe74(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,0x18(%rsp)
lea    0xe72(%rip),%rdi
call   1030 <getenv@plt>
lea    0xe73(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%r12
lea    0xe74(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rbp
test   %rbx,%rbx
je     13a0 <main+0x230>
lea    0xe6b(%rip),%rsi
mov    %rbx,%rdi
call   1090 <fopen@plt>
test   %rax,%rax
je     13a0 <main+0x230>
mov    %rax,%rbx
mov    %r12,(%rsp)
mov    %rbp,0x8(%rsp)
mov    %r15,0x10(%rsp)
mov    0x0(%r13),%rbp
xor    %eax,%eax
call   1040 <getpid@plt>
lea    0xe39(%rip),%rsi
mov    %rbx,%rdi
mov    %rbp,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   1070 <fprintf@plt>
cmp    $0x2,%r14d
jl     132b <main+0x1bb>
mov    %r14d,%eax
mov    %rax,0x28(%rsp)
mov    $0x1,%r12d
lea    0x2e1b(%rip),%r14
lea    0xe29(%rip),%r15
mov    %r13,0x20(%rsp)
jmp    128c <main+0x11c>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbp,%rdi
call   1050 <fclose@plt>
mov    0x20(%rsp),%r13
add    $0x1,%r12
cmp    0x28(%rsp),%r12
je     132b <main+0x1bb>
mov    0x0(%r13,%r12,8),%rcx
mov    %rbx,%rdi
lea    0xdd8(%rip),%rsi
mov    %r12d,%edx
xor    %eax,%eax
call   1070 <fprintf@plt>
cmpq   $0x0,0x30(%rsp)
je     127d <main+0x10d>
mov    0x0(%r13,%r12,8),%rdi
lea    0xdca(%rip),%rsi
call   1090 <fopen@plt>
test   %rax,%rax
je     127d <main+0x10d>
mov    %rax,%rbp
mov    %r14,%rdi
mov    $0x10000,%esi
mov    %rax,%rdx
call   1060 <fgets@plt>
test   %rax,%rax
je     1270 <main+0x100>
mov    $0x1,%r13d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmp    $0x2b,%r13d
je     1270 <main+0x100>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r13d,%edx
mov    %r14,%rcx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    %r14,%rdi
mov    $0x10000,%esi
mov    %rbp,%rdx
call   1060 <fgets@plt>
add    $0x1,%r13d
test   %rax,%rax
jne    12f0 <main+0x180>
jmp    1270 <main+0x100>
cmpq   $0x0,0x18(%rsp)
mov    0x10(%rsp),%r15
je     136d <main+0x1fd>
mov    (%r15),%rcx
test   %rcx,%rcx
je     136d <main+0x1fd>
lea    0xd46(%rip),%r14
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    0x8(%r15,%rbp,8),%rcx
add    $0x1,%rbp
test   %rcx,%rcx
jne    1350 <main+0x1e0>
mov    0x0(%r13),%rbp
xor    %eax,%eax
call   1040 <getpid@plt>
lea    0xd1e(%rip),%rsi
mov    %rbx,%rdi
mov    %rbp,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    %rbx,%rdi
call   1050 <fclose@plt>
mov    0x8(%rsp),%rbp
mov    (%rsp),%r12
test   %r12,%r12
je     13ad <main+0x23d>
movb   $0x0,0x1
test   %rbp,%rbp
je     13c8 <main+0x258>
mov    %rbp,%rdi
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1080 <atol@plt>
mov    $0x1,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"WRAPPER_LOGTO\00"
@.str.1 = [20 x i8] c"WRAPPER_LOGFILEARGS\00"
@.str.2 = [15 x i8] c"WRAPPER_LOGENV\00"
@.str.3 = [13 x i8] c"WRAPPER_EXEC\00"
@.str.4 = [16 x i8] c"WRAPPER_SIGSEGV\00"
@.str.5 = [15 x i8] c"WRAPPER_RETVAL\00"
@.str.6 = [2 x i8] c"a\00"
@.str.7 = [20 x i8] c"+++ %s pid=%ld +++\0A\00"
@.str.8 = [16 x i8] c"argv[%d]: '%s'\0A\00"
@.str.9 = [2 x i8] c"r\00"
@main.szLine = internal global [65536 x i8] zeroinitializer
@.str.10 = [8 x i8] c"%2d: %s\00"
@.str.11 = [16 x i8] c"envp[%d]: '%s'\0A\00"
@.str.12 = [20 x i8] c"--- %s pid=%ld ---\0A\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i32
%15 = alloca i32*
%16 = alloca i32*
%17 = alloca i32
%18 = alloca i8*
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%19 = call i8* @getenv(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store i8* %19, i8** %8
%20 = call i8* @getenv(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
store i8* %20, i8** %9
%21 = call i8* @getenv(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
store i8* %21, i8** %10
%22 = call i8* @getenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
store i8* %22, i8** %11
%23 = call i8* @getenv(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
store i8* %23, i8** %12
%24 = call i8* @getenv(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
store i8* %24, i8** %13
%25 = load i8*, i8** %8
%26 = icmp ne i8* %25, null
br i1 %26, label %27, label %120
27: ; preds = %3
%28 = load i8*, i8** %8
%29 = call i32* @fopen(i8* %28, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
store i32* %29, i32** %15
%30 = load i32*, i32** %15
%31 = icmp ne i32* %30, null
br i1 %31, label %32, label %119
32: ; preds = %27
%33 = load i32*, i32** %15
%34 = load i8**, i8*** %6
%35 = getelementptr inbounds i8*, i8** %34, i64 0
%36 = load i8*, i8** %35
%37 = call i64 (...) @getpid()
%38 = call i32 (i32*, i8*, ...) @fprintf(i32* %33, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0), i8* %36, i64 %37)
store i32 1, i32* %14
br label %39
39: ; preds = %83, %32
%40 = load i32, i32* %14
%41 = load i32, i32* %5
%42 = icmp slt i32 %40, %41
br i1 %42, label %43, label %86
43: ; preds = %39
%44 = load i32*, i32** %15
%45 = load i32, i32* %14
%46 = load i8**, i8*** %6
%47 = load i32, i32* %14
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds i8*, i8** %46, i64 %48
%50 = load i8*, i8** %49
%51 = call i32 (i32*, i8*, ...) @fprintf(i32* %44, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0), i32 %45, i8* %50)
%52 = load i8*, i8** %9
%53 = icmp ne i8* %52, null
br i1 %53, label %54, label %82
54: ; preds = %43
%55 = load i8**, i8*** %6
%56 = load i32, i32* %14
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds i8*, i8** %55, i64 %57
%59 = load i8*, i8** %58
%60 = call i32* @fopen(i8* %59, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
store i32* %60, i32** %16
%61 = load i32*, i32** %16
%62 = icmp ne i32* %61, null
br i1 %62, label %63, label %81
63: ; preds = %54
store i32 0, i32* %17
br label %64
64: ; preds = %74, %63
%65 = load i32*, i32** %16
%66 = call i64 @fgets(i8* getelementptr inbounds ([65536 x i8], [65536 x i8]* @main.szLine, i64 0, i64 0), i32 65536, i32* %65)
%67 = icmp ne i64 %66, 0
br i1 %67, label %68, label %72
68: ; preds = %64
%69 = load i32, i32* %17
%70 = add nsw i32 %69, 1
store i32 %70, i32* %17
%71 = icmp slt i32 %69, 42
br label %72
72: ; preds = %68, %64
%73 = phi i1 [ false, %64 ], [ %71, %68 ]
br i1 %73, label %74, label %78
74: ; preds = %72
%75 = load i32*, i32** %15
%76 = load i32, i32* %17
%77 = call i32 (i32*, i8*, ...) @fprintf(i32* %75, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0), i32 %76, i8* getelementptr inbounds ([65536 x i8], [65536 x i8]* @main.szLine, i64 0, i64 0))
br label %64
78: ; preds = %72
%79 = load i32*, i32** %16
%80 = call i32 @fclose(i32* %79)
br label %81
81: ; preds = %78, %54
br label %82
82: ; preds = %81, %43
br label %83
83: ; preds = %82
%84 = load i32, i32* %14
%85 = add nsw i32 %84, 1
store i32 %85, i32* %14
br label %39
86: ; preds = %39
%87 = load i8*, i8** %10
%88 = icmp ne i8* %87, null
br i1 %88, label %89, label %110
89: ; preds = %86
store i32 0, i32* %14
br label %90
90: ; preds = %106, %89
%91 = load i8**, i8*** %7
%92 = load i32, i32* %14
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds i8*, i8** %91, i64 %93
%95 = load i8*, i8** %94
%96 = icmp ne i8* %95, null
br i1 %96, label %97, label %109
97: ; preds = %90
%98 = load i32*, i32** %15
%99 = load i32, i32* %14
%100 = load i8**, i8*** %7
%101 = load i32, i32* %14
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds i8*, i8** %100, i64 %102
%104 = load i8*, i8** %103
%105 = call i32 (i32*, i8*, ...) @fprintf(i32* %98, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.11, i64 0, i64 0), i32 %99, i8* %104)
br label %106
106: ; preds = %97
%107 = load i32, i32* %14
%108 = add nsw i32 %107, 1
store i32 %108, i32* %14
br label %90
109: ; preds = %90
br label %110
110: ; preds = %109, %86
%111 = load i32*, i32** %15
%112 = load i8**, i8*** %6
%113 = getelementptr inbounds i8*, i8** %112, i64 0
%114 = load i8*, i8** %113
%115 = call i64 (...) @getpid()
%116 = call i32 (i32*, i8*, ...) @fprintf(i32* %111, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.12, i64 0, i64 0), i8* %114, i64 %115)
%117 = load i32*, i32** %15
%118 = call i32 @fclose(i32* %117)
br label %119
119: ; preds = %110, %27
br label %120
120: ; preds = %119, %3
%121 = load i8*, i8** %12
%122 = icmp ne i8* %121, null
br i1 %122, label %123, label %126
123: ; preds = %120
store i8* inttoptr (i64 1 to i8*), i8** %18
%124 = load i8*, i8** %18
%125 = getelementptr inbounds i8, i8* %124, i64 0
store i8 0, i8* %125
br label %126
126: ; preds = %123, %120
%127 = load i8*, i8** %11
%128 = icmp ne i8* %127, null
br i1 %128, label %129, label %130
129: ; preds = %126
br label %130
130: ; preds = %129, %126
%131 = load i8*, i8** %13
%132 = icmp ne i8* %131, null
br i1 %132, label %133, label %136
133: ; preds = %130
%134 = load i8*, i8** %13
%135 = call i32 @atol(i8* %134)
br label %137
136: ; preds = %130
br label %137
137: ; preds = %136, %133
%138 = phi i32 [ %135, %133 ], [ 1, %136 ]
ret i32 %138
}

LLVM IR (-O2):
@.str = [14 x i8] c"WRAPPER_LOGTO\00"
@.str.1 = [20 x i8] c"WRAPPER_LOGFILEARGS\00"
@.str.2 = [15 x i8] c"WRAPPER_LOGENV\00"
@.str.3 = [13 x i8] c"WRAPPER_EXEC\00"
@.str.4 = [16 x i8] c"WRAPPER_SIGSEGV\00"
@.str.5 = [15 x i8] c"WRAPPER_RETVAL\00"
@.str.6 = [2 x i8] c"a\00"
@.str.7 = [20 x i8] c"+++ %s pid=%ld +++\0A\00"
@.str.8 = [16 x i8] c"argv[%d]: '%s'\0A\00"
@.str.9 = [2 x i8] c"r\00"
@main.szLine = internal global [65536 x i8] zeroinitializer
@.str.10 = [8 x i8] c"%2d: %s\00"
@.str.11 = [16 x i8] c"envp[%d]: '%s'\0A\00"
@.str.12 = [20 x i8] c"--- %s pid=%ld ---\0A\00"
define i32 @main(i32 %0, i8** nocapture %1, i8** nocapture %2) {
%4 = tail call i8* @getenv(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%5 = tail call i8* @getenv(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i8* @getenv(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%7 = tail call i8* @getenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%8 = tail call i8* @getenv(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
%9 = tail call i8* @getenv(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
%10 = icmp eq i8* %4, null
br i1 %10, label %67, label %11
11: ; preds = %3
%12 = tail call i32* @fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%13 = icmp eq i32* %12, null
br i1 %13, label %67, label %14
14: ; preds = %11
%15 = load i8*, i8** %1
%16 = tail call i64 (...) @getpid()
%17 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %12, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0), i8* %15, i64 %16)
%18 = icmp sgt i32 %0, 1
br i1 %18, label %19, label %48
19: ; preds = %14
%20 = icmp eq i8* %5, null
%21 = zext i32 %0 to i64
br label %22
22: ; preds = %19, %45
%23 = phi i64 [ 1, %19 ], [ %46, %45 ]
%24 = getelementptr inbounds i8*, i8** %1, i64 %23
%25 = load i8*, i8** %24
%26 = trunc i64 %23 to i32
%27 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %12, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0), i32 %26, i8* %25)
br i1 %20, label %45, label %28
28: ; preds = %22
%29 = load i8*, i8** %24
%30 = tail call i32* @fopen(i8* %29, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%31 = icmp eq i32* %30, null
br i1 %31, label %45, label %32
32: ; preds = %28
%33 = tail call i64 @fgets(i8* getelementptr inbounds ([65536 x i8], [65536 x i8]* @main.szLine, i64 0, i64 0), i32 65536, i32* %30)
%34 = icmp eq i64 %33, 0
br i1 %34, label %43, label %35
35: ; preds = %32, %39
%36 = phi i32 [ %37, %39 ], [ 0, %32 ]
%37 = add nuw nsw i32 %36, 1
%38 = icmp eq i32 %36, 42
br i1 %38, label %43, label %39
39: ; preds = %35
%40 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %12, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0), i32 %37, i8* getelementptr inbounds ([65536 x i8], [65536 x i8]* @main.szLine, i64 0, i64 0))
%41 = tail call i64 @fgets(i8* getelementptr inbounds ([65536 x i8], [65536 x i8]* @main.szLine, i64 0, i64 0), i32 65536, i32* %30)
%42 = icmp eq i64 %41, 0
br i1 %42, label %43, label %35
43: ; preds = %35, %39, %32
%44 = tail call i32 @fclose(i32* %30)
br label %45
45: ; preds = %28, %43, %22
%46 = add nuw nsw i64 %23, 1
%47 = icmp eq i64 %46, %21
br i1 %47, label %48, label %22
48: ; preds = %45, %14
%49 = icmp eq i8* %6, null
br i1 %49, label %62, label %50
50: ; preds = %48
%51 = load i8*, i8** %2
%52 = icmp eq i8* %51, null
br i1 %52, label %62, label %53
53: ; preds = %50, %53
%54 = phi i64 [ %58, %53 ], [ 0, %50 ]
%55 = phi i8* [ %60, %53 ], [ %51, %50 ]
%56 = trunc i64 %54 to i32
%57 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %12, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.11, i64 0, i64 0), i32 %56, i8* %55)
%58 = add nuw i64 %54, 1
%59 = getelementptr inbounds i8*, i8** %2, i64 %58
%60 = load i8*, i8** %59
%61 = icmp eq i8* %60, null
br i1 %61, label %62, label %53
62: ; preds = %53, %50, %48
%63 = load i8*, i8** %1
%64 = tail call i64 (...) @getpid()
%65 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %12, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.12, i64 0, i64 0), i8* %63, i64 %64)
%66 = tail call i32 @fclose(i32* %12)
br label %67
67: ; preds = %11, %62, %3
%68 = icmp eq i8* %8, null
br i1 %68, label %70, label %69
69: ; preds = %67
store i8 0, i8* inttoptr (i64 1 to i8*)
br label %70
70: ; preds = %69, %67
%71 = icmp eq i8* %9, null
br i1 %71, label %74, label %72
72: ; preds = %70
%73 = tail call i32 @atol(i8* %9)
br label %74
74: ; preds = %70, %72
%75 = phi i32 [ %73, %72 ], [ 1, %70 ]
ret i32 %75
}