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

/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ esc(char *);
int /*<<< orphan*/ fatal(char *, ...);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
char *getenv(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ snprintf(char *, int, char *, char *, ...);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
int strlen(char *);
char *strstr(char *, char *);
int main(int argc, char **argv) {
  char *name;
  FILE *fin;
  char buf[1024], initfunc[1024], *p, *q;
  if (argc != 2) {
    fprintf(stderr, "usage: mkbuiltin1 sys\n");
    fatal("in file $1.6 s/PACKAGE/$1/");
  }
  name = argv[1];
  snprintf(initfunc, sizeof(initfunc), "init_%s_function", name);
  snprintf(buf, sizeof(buf), "%s.%s", name, getenv("O"));
  if ((fin = fopen(buf, "r")) == NULL) {
    fatal("open %s: %s", buf, strerror(errno));
  }
  while (fgets(buf, sizeof buf, fin) != NULL)
    if (strstr(buf, "$$"))
      goto begin;
  fatal("did not find beginning of imports");
begin:
  printf("char *%simport =\n", name);
  while (fgets(buf, sizeof buf, fin) != NULL) {
    buf[strlen(buf) - 1] = 0;
    if (strstr(buf, "$$"))
      goto end;
    for (p = buf; *p == ' ' || *p == '\t'; p++)
      ;
    if (strstr(buf, initfunc))
      continue;
    printf("\t\"");
    while (q = strstr(p, "PACKAGE")) {
      *q = 0;
      esc(p);
      printf("%s", name);
      p = q + 7;
    }
    esc(p);
    printf("\\n\"\n");
  }
  fatal("did not find end of imports");
end:
  printf("\t\"$$\\n\";\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x850,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     11f6 <main+0x46>
mov    0x2e06(%rip),%rax
mov    (%rax),%edi
lea    0xe1d(%rip),%rsi
call   1080 <fprintf@plt>
lea    0xe28(%rip),%rdi
mov    $0x0,%al
call   10c0 <fatal@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
lea    -0x820(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x400,%esi
lea    0xe19(%rip),%rdx
mov    $0x0,%al
call   1060 <snprintf@plt>
lea    -0x420(%rbp),%rax
mov    %rax,-0x840(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x838(%rbp)
lea    0xe09(%rip),%rdi
call   1030 <getenv@plt>
mov    -0x840(%rbp),%rdi
mov    -0x838(%rbp),%rcx
mov    %rax,%r8
mov    $0x400,%esi
lea    0xde1(%rip),%rdx
mov    $0x0,%al
call   1060 <snprintf@plt>
lea    -0x420(%rbp),%rdi
lea    0xdd4(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    12bd <main+0x10d>
lea    -0x420(%rbp),%rax
mov    %rax,-0x848(%rbp)
mov    0x2d39(%rip),%rax
mov    (%rax),%edi
call   10b0 <strerror@plt>
mov    -0x848(%rbp),%rsi
mov    %eax,%edx
lea    0xd97(%rip),%rdi
mov    $0x0,%al
call   10c0 <fatal@plt>
jmp    12c2 <main+0x112>
lea    -0x420(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    $0x400,%esi
call   1070 <fgets@plt>
cmp    $0x0,%rax
je     1308 <main+0x158>
lea    -0x420(%rbp),%rdi
lea    0xd6a(%rip),%rsi
call   10d0 <strstr@plt>
cmp    $0x0,%rax
je     1303 <main+0x153>
jmp    1316 <main+0x166>
jmp    12c2 <main+0x112>
lea    0xd4d(%rip),%rdi
mov    $0x0,%al
call   10c0 <fatal@plt>
mov    -0x18(%rbp),%rsi
lea    0xd5d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x420(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    $0x400,%esi
call   1070 <fgets@plt>
cmp    $0x0,%rax
je     14a2 <main+0x2f2>
lea    -0x420(%rbp),%rdi
call   1040 <strlen@plt>
sub    $0x1,%eax
cltq
movb   $0x0,-0x420(%rbp,%rax,1)
lea    -0x420(%rbp),%rdi
lea    0xceb(%rip),%rsi
call   10d0 <strstr@plt>
cmp    $0x0,%rax
je     1382 <main+0x1d2>
jmp    14b0 <main+0x300>
lea    -0x420(%rbp),%rax
mov    %rax,-0x828(%rbp)
mov    -0x828(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x849(%rbp)
je     13c1 <main+0x211>
mov    -0x828(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x849(%rbp)
mov    -0x849(%rbp),%al
test   $0x1,%al
jne    13d4 <main+0x224>
jmp    13f0 <main+0x240>
jmp    13d9 <main+0x229>
mov    -0x828(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x828(%rbp)
jmp    1390 <main+0x1e0>
lea    -0x420(%rbp),%rdi
lea    -0x820(%rbp),%rsi
call   10d0 <strstr@plt>
cmp    $0x0,%rax
je     1412 <main+0x262>
jmp    1328 <main+0x178>
lea    0xc77(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x828(%rbp),%rdi
lea    0xc65(%rip),%rsi
call   10d0 <strstr@plt>
mov    %rax,-0x830(%rbp)
cmp    $0x0,%rax
je     1483 <main+0x2d3>
mov    -0x830(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x828(%rbp),%rdi
call   1090 <esc@plt>
mov    -0x18(%rbp),%rsi
lea    0xbf1(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x830(%rbp),%rax
add    $0x7,%rax
mov    %rax,-0x828(%rbp)
jmp    1420 <main+0x270>
mov    -0x828(%rbp),%rdi
call   1090 <esc@plt>
lea    0xc05(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1328 <main+0x178>
lea    0xbf7(%rip),%rdi
mov    $0x0,%al
call   10c0 <fatal@plt>
lea    0xc05(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x850,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x818,%rsp
mov    %rsi,%rbx
cmp    $0x2,%edi
je     11fc <main+0x3c>
mov    0x2e00(%rip),%rax
mov    (%rax),%edi
lea    0xe17(%rip),%rsi
call   1090 <fprintf@plt>
lea    0xe22(%rip),%rdi
xor    %eax,%eax
call   10d0 <fatal@plt>
mov    0x8(%rbx),%r15
lea    0xe2b(%rip),%rdx
lea    0x410(%rsp),%rdi
mov    $0x400,%esi
mov    %r15,%rcx
xor    %eax,%eax
call   1070 <snprintf@plt>
lea    0xe24(%rip),%rdi
call   1030 <getenv@plt>
lea    0xe12(%rip),%rdx
lea    0x10(%rsp),%rbp
mov    %rbp,%rdi
mov    $0x400,%esi
mov    %r15,%rcx
mov    %rax,%r8
xor    %eax,%eax
call   1070 <snprintf@plt>
lea    0xdf9(%rip),%rsi
mov    %rbp,%rdi
call   10b0 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1285 <main+0xc5>
mov    0x2d6f(%rip),%rax
mov    (%rax),%edi
call   10c0 <strerror@plt>
lea    0xdd6(%rip),%rdi
lea    0x10(%rsp),%rsi
mov    %eax,%edx
xor    %eax,%eax
call   10d0 <fatal@plt>
lea    0x10(%rsp),%rbp
lea    0xdc8(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbp,%rdi
mov    $0x400,%esi
mov    %rbx,%rdx
call   1080 <fgets@plt>
test   %rax,%rax
je     12c7 <main+0x107>
mov    %rbp,%rdi
mov    %r14,%rsi
call   10e0 <strstr@plt>
test   %rax,%rax
je     12a0 <main+0xe0>
jmp    12d5 <main+0x115>
lea    0xd8e(%rip),%rdi
xor    %eax,%eax
call   10d0 <fatal@plt>
lea    0xda2(%rip),%rdi
mov    %r15,(%rsp)
mov    %r15,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0x10(%rsp),%rbp
mov    %rbp,%rdi
mov    $0x400,%esi
mov    %rbx,%rdx
call   1080 <fgets@plt>
test   %rax,%rax
je     1438 <main+0x278>
lea    0xd4a(%rip),%r14
lea    0xd7d(%rip),%r13
mov    %rbx,0x8(%rsp)
mov    (%rsp),%r12
jmp    1369 <main+0x1a9>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
call   10a0 <esc@plt>
lea    0xd81(%rip),%rdi
call   1040 <puts@plt>
lea    0xd0e(%rip),%r14
mov    %rbx,%r13
mov    %rbp,%rdi
mov    $0x400,%esi
mov    0x8(%rsp),%rdx
call   1080 <fgets@plt>
test   %rax,%rax
je     1438 <main+0x278>
mov    %rbp,%rdi
call   1050 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbp,1)
mov    %rbp,%rdi
mov    %r14,%rsi
call   10e0 <strstr@plt>
test   %rax,%rax
jne    1446 <main+0x286>
mov    %rbp,%r15
jmp    13a4 <main+0x1e4>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%r15
movzbl (%r15),%eax
cmp    $0x20,%al
je     13a0 <main+0x1e0>
cmp    $0x9,%al
je     13a0 <main+0x1e0>
mov    %rbp,%rdi
lea    0x410(%rsp),%rsi
call   10e0 <strstr@plt>
test   %rax,%rax
jne    134e <main+0x18e>
lea    0xcc4(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r15,%rdi
mov    %r13,%rbx
mov    %r13,%rsi
call   10e0 <strstr@plt>
test   %rax,%rax
je     1330 <main+0x170>
mov    %rax,%r14
lea    0xc62(%rip),%r13
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movb   $0x0,(%r14)
mov    %r15,%rdi
call   10a0 <esc@plt>
mov    %r13,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r14,%r15
add    $0x7,%r15
mov    %r15,%rdi
mov    %rbx,%rsi
call   10e0 <strstr@plt>
mov    %rax,%r14
test   %rax,%rax
jne    1400 <main+0x240>
jmp    1330 <main+0x170>
lea    0xc5c(%rip),%rdi
xor    %eax,%eax
call   10d0 <fatal@plt>
lea    0xc6a(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x818,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"usage: mkbuiltin1 sys\0A\00"
@.str.1 = [27 x i8] c"in file $1.6 s/PACKAGE/$1/\00"
@.str.2 = [17 x i8] c"init_%s_function\00"
@.str.3 = [6 x i8] c"%s.%s\00"
@.str.4 = [2 x i8] c"O\00"
@.str.5 = [2 x i8] c"r\00"
@.str.6 = [12 x i8] c"open %s: %s\00"
@errno = global i32 0
@.str.7 = [3 x i8] c"$$\00"
@.str.8 = [34 x i8] c"did not find beginning of imports\00"
@.str.9 = [18 x i8] c"char *%simport =\0A\00"
@.str.10 = [3 x i8] c"\09\22\00"
@.str.11 = [8 x i8] c"PACKAGE\00"
@.str.12 = [3 x i8] c"%s\00"
@.str.13 = [5 x i8] c"\\n\22\0A\00"
@.str.14 = [28 x i8] c"did not find end of imports\00"
@.str.15 = [10 x i8] c"\09\22$$\\n\22;\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca [1024 x i8]
%9 = alloca [1024 x i8]
%10 = alloca i8*
%11 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = load i32, i32* %4
%13 = icmp ne i32 %12, 2
br i1 %13, label %14, label %18
14: ; preds = %2
%15 = load i32, i32* @stderr
%16 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%17 = call i32 (i8*, ...) @fatal(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %14, %2
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
store i8* %21, i8** %6
%22 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%23 = load i8*, i8** %6
%24 = call i32 (i8*, i32, i8*, i8*, ...) @snprintf(i8* %22, i32 1024, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* %23)
%25 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%26 = load i8*, i8** %6
%27 = call i8* @getenv(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%28 = call i32 (i8*, i32, i8*, i8*, ...) @snprintf(i8* %25, i32 1024, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* %26, i8* %27)
%29 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%30 = call i32* @fopen(i8* %29, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
store i32* %30, i32** %7
%31 = icmp eq i32* %30, null
br i1 %31, label %32, label %37
32: ; preds = %18
%33 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%34 = load i32, i32* @errno
%35 = call i32 @strerror(i32 %34)
%36 = call i32 (i8*, ...) @fatal(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i8* %33, i32 %35)
br label %37
37: ; preds = %32, %18
br label %38
38: ; preds = %48, %37
%39 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%40 = load i32*, i32** %7
%41 = call i32* @fgets(i8* %39, i32 1024, i32* %40)
%42 = icmp ne i32* %41, null
br i1 %42, label %43, label %49
43: ; preds = %38
%44 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%45 = call i8* @strstr(i8* %44, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%46 = icmp ne i8* %45, null
br i1 %46, label %47, label %48
47: ; preds = %43
br label %51
48: ; preds = %43
br label %38
49: ; preds = %38
%50 = call i32 (i8*, ...) @fatal(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.8, i64 0, i64 0))
br label %51
51: ; preds = %49, %47
%52 = load i8*, i8** %6
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0), i8* %52)
br label %54
54: ; preds = %107, %92, %51
%55 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%56 = load i32*, i32** %7
%57 = call i32* @fgets(i8* %55, i32 1024, i32* %56)
%58 = icmp ne i32* %57, null
br i1 %58, label %59, label %111
59: ; preds = %54
%60 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%61 = call i32 @strlen(i8* %60)
%62 = sub nsw i32 %61, 1
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 %63
store i8 0, i8* %64
%65 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%66 = call i8* @strstr(i8* %65, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%67 = icmp ne i8* %66, null
br i1 %67, label %68, label %69
68: ; preds = %59
br label %113
69: ; preds = %59
%70 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
store i8* %70, i8** %10
br label %71
71: ; preds = %84, %69
%72 = load i8*, i8** %10
%73 = load i8, i8* %72
%74 = sext i8 %73 to i32
%75 = icmp eq i32 %74, 32
br i1 %75, label %81, label %76
76: ; preds = %71
%77 = load i8*, i8** %10
%78 = load i8, i8* %77
%79 = sext i8 %78 to i32
%80 = icmp eq i32 %79, 9
br label %81
81: ; preds = %76, %71
%82 = phi i1 [ true, %71 ], [ %80, %76 ]
br i1 %82, label %83, label %87
83: ; preds = %81
br label %84
84: ; preds = %83
%85 = load i8*, i8** %10
%86 = getelementptr inbounds i8, i8* %85, i32 1
store i8* %86, i8** %10
br label %71
87: ; preds = %81
%88 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%89 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%90 = call i8* @strstr(i8* %88, i8* %89)
%91 = icmp ne i8* %90, null
br i1 %91, label %92, label %93
92: ; preds = %87
br label %54
93: ; preds = %87
%94 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
br label %95
95: ; preds = %99, %93
%96 = load i8*, i8** %10
%97 = call i8* @strstr(i8* %96, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0))
store i8* %97, i8** %11
%98 = icmp ne i8* %97, null
br i1 %98, label %99, label %107
99: ; preds = %95
%100 = load i8*, i8** %11
store i8 0, i8* %100
%101 = load i8*, i8** %10
%102 = call i32 @esc(i8* %101)
%103 = load i8*, i8** %6
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i8* %103)
%105 = load i8*, i8** %11
%106 = getelementptr inbounds i8, i8* %105, i64 7
store i8* %106, i8** %10
br label %95
107: ; preds = %95
%108 = load i8*, i8** %10
%109 = call i32 @esc(i8* %108)
%110 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0))
br label %54
111: ; preds = %54
%112 = call i32 (i8*, ...) @fatal(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.14, i64 0, i64 0))
br label %113
113: ; preds = %111, %68
%114 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.15, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"usage: mkbuiltin1 sys\0A\00"
@.str.1 = [27 x i8] c"in file $1.6 s/PACKAGE/$1/\00"
@.str.2 = [17 x i8] c"init_%s_function\00"
@.str.3 = [6 x i8] c"%s.%s\00"
@.str.4 = [2 x i8] c"O\00"
@.str.5 = [2 x i8] c"r\00"
@.str.6 = [12 x i8] c"open %s: %s\00"
@errno = global i32 0
@.str.7 = [3 x i8] c"$$\00"
@.str.8 = [34 x i8] c"did not find beginning of imports\00"
@.str.9 = [18 x i8] c"char *%simport =\0A\00"
@.str.10 = [3 x i8] c"\09\22\00"
@.str.11 = [8 x i8] c"PACKAGE\00"
@.str.12 = [3 x i8] c"%s\00"
@.str.14 = [28 x i8] c"did not find end of imports\00"
@str = [9 x i8] c"\09\22$$\\n\22;\00"
@str.16 = [4 x i8] c"\\n\22\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [1024 x i8]
%4 = alloca [1024 x i8]
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%7 = icmp eq i32 %0, 2
br i1 %7, label %12, label %8
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%11 = tail call i32 (i8*, ...) @fatal(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %8, %2
%13 = getelementptr inbounds i8*, i8** %1, i64 1
%14 = load i8*, i8** %13
%15 = call i32 (i8*, i32, i8*, i8*, ...) @snprintf(i8* %6, i32 1024, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* %14)
%16 = call i8* @getenv(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%17 = call i32 (i8*, i32, i8*, i8*, ...) @snprintf(i8* %5, i32 1024, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* %14, i8* %16)
%18 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%19 = icmp eq i32* %18, null
br i1 %19, label %20, label %24
20: ; preds = %12
%21 = load i32, i32* @errno
%22 = call i32 @strerror(i32 %21)
%23 = call i32 (i8*, ...) @fatal(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i8* %5, i32 %22)
br label %24
24: ; preds = %20, %12
br label %25
25: ; preds = %24, %28
%26 = call i32* @fgets(i8* %5, i32 1024, i32* %18)
%27 = icmp eq i32* %26, null
br i1 %27, label %31, label %28
28: ; preds = %25
%29 = call i8* @strstr(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%30 = icmp eq i8* %29, null
br i1 %30, label %25, label %33
31: ; preds = %25
%32 = call i32 (i8*, ...) @fatal(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.8, i64 0, i64 0))
br label %33
33: ; preds = %28, %31
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0), i8* %14)
%35 = call i32* @fgets(i8* %5, i32 1024, i32* %18)
%36 = icmp eq i32* %35, null
br i1 %36, label %71, label %37
37: ; preds = %33, %68
%38 = call i32 @strlen(i8* %5)
%39 = add nsw i32 %38, -1
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 %40
store i8 0, i8* %41
%42 = call i8* @strstr(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%43 = icmp eq i8* %42, null
br i1 %43, label %44, label %73
44: ; preds = %37, %47
%45 = phi i8* [ %48, %47 ], [ %5, %37 ]
%46 = load i8, i8* %45
switch i8 %46, label %49 [
i8 32, label %47
i8 9, label %47
]
47: ; preds = %44, %44
%48 = getelementptr inbounds i8, i8* %45, i64 1
br label %44
49: ; preds = %44
%50 = call i8* @strstr(i8* %5, i8* %6)
%51 = icmp eq i8* %50, null
br i1 %51, label %52, label %68
52: ; preds = %49
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
%54 = call i8* @strstr(i8* %45, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0))
%55 = icmp eq i8* %54, null
br i1 %55, label %64, label %56
56: ; preds = %52, %56
%57 = phi i8* [ %62, %56 ], [ %54, %52 ]
%58 = phi i8* [ %61, %56 ], [ %45, %52 ]
store i8 0, i8* %57
%59 = call i32 @esc(i8* %58)
%60 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i8* %14)
%61 = getelementptr inbounds i8, i8* %57, i64 7
%62 = call i8* @strstr(i8* %61, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0))
%63 = icmp eq i8* %62, null
br i1 %63, label %64, label %56
64: ; preds = %56, %52
%65 = phi i8* [ %45, %52 ], [ %61, %56 ]
%66 = call i32 @esc(i8* %65)
%67 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.16, i64 0, i64 0))
br label %68
68: ; preds = %64, %49
%69 = call i32* @fgets(i8* %5, i32 1024, i32* %18)
%70 = icmp eq i32* %69, null
br i1 %70, label %71, label %37
71: ; preds = %68, %33
%72 = call i32 (i8*, ...) @fatal(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.14, i64 0, i64 0))
br label %73
73: ; preds = %37, %71
%74 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret i32 0
}