#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*/ buf;

/* Variables and functions */
int /*<<< orphan*/ __write1(char *);
char *getenv(char *);
int /*<<< orphan*/ puts(char *);
int read(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ strcmp(char *, char *);
int strlen(char *);
int strtoul(char *, char **, int);
int /*<<< orphan*/ write(int, char *, int);
int main() {
  char *method = getenv("REQUEST_METHOD");
  if (!method) {
    __write1(
        "Content-Type: text/plain\r\n\r\nFatal: $REQUEST_METHOD not set!\n");
    return 1;
  }
  if (!strcmp(method, "GET")) {
    char *c = getenv("QUERY_STRING");
    __write1("Content-Type: text/plain\r\n\r\n");
    if (c)
      write(1, c, strlen(c));
    else {
      __write1("Fatal: $QUERY_STRING not set!\n");
      return 1;
    }
  } else if (!strcmp(method, "POST")) {
    char *c = getenv("CONTENT_TYPE");
    char *d = getenv("CONTENT_LENGTH");
    int l;
    if (!c) {
      __write1(
          "Content-Type: text/plain\r\n\r\nFatal: $CONTENT_TYPE not set!\n");
      return 1;
    }
    if (!d) {
      __write1(
          "Content-Type: text/plain\r\n\r\nFatal: $CONTENT_LENGTH not set!\n");
      return 1;
    }
    {
      char *e;
      l = strtoul(d, &e, 10);
      if (e == d || *e) {
        __write1("Content-Type: text/plain\r\n\r\nFatal: $CONTENT_LENGTH not a "
                 "number: ");
        __write1(d);
        __write1("\n");
        return 1;
      }
    }
    __write1("Content-Type: ");
    __write1(c);
    __write1("\r\n");
    __write1("Content-Length: ");
    __write1(d);
    __write1("\r\n\r\n");
    while (l > 0) {
      char buf[2048];
      int r;
      r = read(0, buf, sizeof(buf));
      if (r == -1)
        return 1;
      if (r == 0)
        break;
      l -= r;
      write(1, buf, r);
    }
  } else {
    puts("Content-Type: text/plain\r\n\r\nFatal: $REQUEST_METHOD is neither "
         "GET nor POST!\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x850,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe67(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    11c5 <main+0x45>
lea    0xe5b(%rip),%rdi
call   10a0 <__write1@plt>
movl   $0x1,-0x4(%rbp)
jmp    13fd <main+0x27d>
mov    -0x10(%rbp),%rdi
lea    0xe7c(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%eax
jne    124e <main+0xce>
lea    0xe6b(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x18(%rbp)
lea    0xe68(%rip),%rdi
call   10a0 <__write1@plt>
cmpq   $0x0,-0x18(%rbp)
je     1231 <main+0xb1>
mov    -0x18(%rbp),%rax
mov    %rax,-0x850(%rbp)
mov    -0x18(%rbp),%rdi
call   1060 <strlen@plt>
mov    -0x850(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1050 <write@plt>
jmp    1249 <main+0xc9>
lea    0xe42(%rip),%rdi
call   10a0 <__write1@plt>
movl   $0x1,-0x4(%rbp)
jmp    13fd <main+0x27d>
jmp    13fd <main+0x27d>
mov    -0x10(%rbp),%rdi
lea    0xe40(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%eax
jne    13ec <main+0x26c>
lea    0xe30(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x20(%rbp)
lea    0xe2d(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    12aa <main+0x12a>
lea    0xe21(%rip),%rdi
call   10a0 <__write1@plt>
movl   $0x1,-0x4(%rbp)
jmp    13fd <main+0x27d>
cmpq   $0x0,-0x28(%rbp)
jne    12cd <main+0x14d>
lea    0xe39(%rip),%rdi
call   10a0 <__write1@plt>
movl   $0x1,-0x4(%rbp)
jmp    13fd <main+0x27d>
mov    -0x28(%rbp),%rdi
lea    -0x38(%rbp),%rsi
mov    $0xa,%edx
call   1090 <strtoul@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x38(%rbp),%rax
cmp    -0x28(%rbp),%rax
je     1300 <main+0x180>
mov    -0x38(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     132d <main+0x1ad>
lea    0xe2b(%rip),%rdi
call   10a0 <__write1@plt>
mov    -0x28(%rbp),%rdi
call   10a0 <__write1@plt>
lea    0xd5c(%rip),%rdi
call   10a0 <__write1@plt>
movl   $0x1,-0x4(%rbp)
jmp    13fd <main+0x27d>
lea    0xe40(%rip),%rdi
call   10a0 <__write1@plt>
mov    -0x20(%rbp),%rdi
call   10a0 <__write1@plt>
lea    0xd2e(%rip),%rdi
call   10a0 <__write1@plt>
lea    0xe2e(%rip),%rdi
call   10a0 <__write1@plt>
mov    -0x28(%rbp),%rdi
call   10a0 <__write1@plt>
lea    0xd0b(%rip),%rdi
call   10a0 <__write1@plt>
cmpl   $0x0,-0x2c(%rbp)
jle    13e7 <main+0x267>
lea    -0x840(%rbp),%rsi
xor    %edi,%edi
mov    $0x800,%edx
call   1070 <read@plt>
mov    %eax,-0x844(%rbp)
cmpl   $0xffffffff,-0x844(%rbp)
jne    13ab <main+0x22b>
movl   $0x1,-0x4(%rbp)
jmp    13fd <main+0x27d>
cmpl   $0x0,-0x844(%rbp)
jne    13bd <main+0x23d>
jmp    13e7 <main+0x267>
mov    -0x844(%rbp),%ecx
mov    -0x2c(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x2c(%rbp)
lea    -0x840(%rbp),%rsi
mov    -0x844(%rbp),%edx
mov    $0x1,%edi
call   1050 <write@plt>
jmp    136f <main+0x1ef>
jmp    13f8 <main+0x278>
lea    0xda1(%rip),%rdi
call   1040 <puts@plt>
jmp    13fd <main+0x27d>
mov    -0x4(%rbp),%eax
add    $0x850,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x808,%rsp
lea    0xe6c(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     11d5 <main+0x55>
mov    %rax,%rbx
lea    0xea4(%rip),%rsi
mov    %rax,%rdi
call   1080 <strcmp@plt>
test   %eax,%eax
je     11e8 <main+0x68>
lea    0xede(%rip),%rsi
mov    %rbx,%rdi
call   1080 <strcmp@plt>
test   %eax,%eax
je     1233 <main+0xb3>
lea    0xfc6(%rip),%rdi
call   1040 <puts@plt>
jmp    1223 <main+0xa3>
lea    0xe33(%rip),%rdi
call   10a0 <__write1@plt>
mov    $0x1,%eax
jmp    1225 <main+0xa5>
lea    0xe61(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rbx
lea    0xe5f(%rip),%rdi
call   10a0 <__write1@plt>
test   %rbx,%rbx
je     129b <main+0x11b>
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1050 <write@plt>
xor    %eax,%eax
add    $0x808,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe64(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%r15
lea    0xe62(%rip),%rdi
call   1030 <getenv@plt>
test   %r15,%r15
je     12a7 <main+0x127>
mov    %rax,%r14
test   %rax,%rax
je     12b3 <main+0x133>
mov    %rsp,%rsi
mov    %r14,%rdi
mov    $0xa,%edx
call   1090 <strtoul@plt>
mov    %eax,%ebx
mov    (%rsp),%rax
cmp    %r14,%rax
je     127b <main+0xfb>
cmpb   $0x0,(%rax)
je     12bf <main+0x13f>
lea    0xeb0(%rip),%rdi
call   10a0 <__write1@plt>
mov    %r14,%rdi
call   10a0 <__write1@plt>
lea    0xde2(%rip),%rdi
jmp    11dc <main+0x5c>
lea    0xdd8(%rip),%rdi
jmp    11dc <main+0x5c>
lea    0xe0c(%rip),%rdi
jmp    11dc <main+0x5c>
lea    0xe3b(%rip),%rdi
jmp    11dc <main+0x5c>
lea    0xeae(%rip),%rdi
call   10a0 <__write1@plt>
mov    %r15,%rdi
call   10a0 <__write1@plt>
lea    0xd9d(%rip),%rdi
call   10a0 <__write1@plt>
lea    0xe9d(%rip),%rdi
call   10a0 <__write1@plt>
mov    %r14,%rdi
call   10a0 <__write1@plt>
lea    0xd7b(%rip),%rdi
call   10a0 <__write1@plt>
test   %ebx,%ebx
jle    1223 <main+0xa3>
mov    %rsp,%r14
xor    %edi,%edi
mov    %r14,%rsi
mov    $0x800,%edx
call   1070 <read@plt>
test   %eax,%eax
je     1223 <main+0xa3>
mov    %eax,%ebp
cmp    $0xffffffff,%eax
je     1342 <main+0x1c2>
mov    $0x1,%edi
mov    %r14,%rsi
mov    %ebp,%edx
call   1050 <write@plt>
xor    %eax,%eax
sub    %ebp,%ebx
jg     130a <main+0x18a>
jmp    1225 <main+0xa5>
mov    $0x1,%eax
jmp    1225 <main+0xa5>

LLVM IR (-O0):
@.str = [15 x i8] c"REQUEST_METHOD\00"
@.str.1 = [61 x i8] c"Content-Type: text/plain\0D\0A\0D\0AFatal: $REQUEST_METHOD not set!\0A\00"
@.str.2 = [4 x i8] c"GET\00"
@.str.3 = [13 x i8] c"QUERY_STRING\00"
@.str.4 = [29 x i8] c"Content-Type: text/plain\0D\0A\0D\0A\00"
@.str.5 = [31 x i8] c"Fatal: $QUERY_STRING not set!\0A\00"
@.str.6 = [5 x i8] c"POST\00"
@.str.7 = [13 x i8] c"CONTENT_TYPE\00"
@.str.8 = [15 x i8] c"CONTENT_LENGTH\00"
@.str.9 = [59 x i8] c"Content-Type: text/plain\0D\0A\0D\0AFatal: $CONTENT_TYPE not set!\0A\00"
@.str.10 = [61 x i8] c"Content-Type: text/plain\0D\0A\0D\0AFatal: $CONTENT_LENGTH not set!\0A\00"
@.str.11 = [66 x i8] c"Content-Type: text/plain\0D\0A\0D\0AFatal: $CONTENT_LENGTH not a number: \00"
@.str.12 = [2 x i8] c"\0A\00"
@.str.13 = [15 x i8] c"Content-Type: \00"
@.str.14 = [3 x i8] c"\0D\0A\00"
@.str.15 = [17 x i8] c"Content-Length: \00"
@.str.16 = [5 x i8] c"\0D\0A\0D\0A\00"
@.str.17 = [77 x i8] c"Content-Type: text/plain\0D\0A\0D\0AFatal: $REQUEST_METHOD is neither GET nor POST!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca [2048 x i8]
%9 = alloca i32
store i32 0, i32* %1
%10 = call i8* @getenv(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
store i8* %10, i8** %2
%11 = load i8*, i8** %2
%12 = icmp ne i8* %11, null
br i1 %12, label %15, label %13
13: ; preds = %0
%14 = call i32 @__write1(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %1
br label %97
15: ; preds = %0
%16 = load i8*, i8** %2
%17 = call i32 @strcmp(i8* %16, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%18 = icmp ne i32 %17, 0
br i1 %18, label %32, label %19
19: ; preds = %15
%20 = call i8* @getenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
store i8* %20, i8** %3
%21 = call i32 @__write1(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0))
%22 = load i8*, i8** %3
%23 = icmp ne i8* %22, null
br i1 %23, label %24, label %29
24: ; preds = %19
%25 = load i8*, i8** %3
%26 = load i8*, i8** %3
%27 = call i32 @strlen(i8* %26)
%28 = call i32 @write(i32 1, i8* %25, i32 %27)
br label %31
29: ; preds = %19
%30 = call i32 @__write1(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0))
store i32 1, i32* %1
br label %97
31: ; preds = %24
br label %97
32: ; preds = %15
%33 = load i8*, i8** %2
%34 = call i32 @strcmp(i8* %33, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%35 = icmp ne i32 %34, 0
br i1 %35, label %94, label %36
36: ; preds = %32
%37 = call i8* @getenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
store i8* %37, i8** %4
%38 = call i8* @getenv(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0))
store i8* %38, i8** %5
%39 = load i8*, i8** %4
%40 = icmp ne i8* %39, null
br i1 %40, label %43, label %41
41: ; preds = %36
%42 = call i32 @__write1(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.9, i64 0, i64 0))
store i32 1, i32* %1
br label %97
43: ; preds = %36
%44 = load i8*, i8** %5
%45 = icmp ne i8* %44, null
br i1 %45, label %48, label %46
46: ; preds = %43
%47 = call i32 @__write1(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.10, i64 0, i64 0))
store i32 1, i32* %1
br label %97
48: ; preds = %43
%49 = load i8*, i8** %5
%50 = call i32 @strtoul(i8* %49, i8** %7, i32 10)
store i32 %50, i32* %6
%51 = load i8*, i8** %7
%52 = load i8*, i8** %5
%53 = icmp eq i8* %51, %52
br i1 %53, label %59, label %54
54: ; preds = %48
%55 = load i8*, i8** %7
%56 = load i8, i8* %55
%57 = sext i8 %56 to i32
%58 = icmp ne i32 %57, 0
br i1 %58, label %59, label %64
59: ; preds = %54, %48
%60 = call i32 @__write1(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.11, i64 0, i64 0))
%61 = load i8*, i8** %5
%62 = call i32 @__write1(i8* %61)
%63 = call i32 @__write1(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
store i32 1, i32* %1
br label %97
64: ; preds = %54
%65 = call i32 @__write1(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.13, i64 0, i64 0))
%66 = load i8*, i8** %4
%67 = call i32 @__write1(i8* %66)
%68 = call i32 @__write1(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0))
%69 = call i32 @__write1(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.15, i64 0, i64 0))
%70 = load i8*, i8** %5
%71 = call i32 @__write1(i8* %70)
%72 = call i32 @__write1(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.16, i64 0, i64 0))
br label %73
73: ; preds = %86, %64
%74 = load i32, i32* %6
%75 = icmp sgt i32 %74, 0
br i1 %75, label %76, label %93
76: ; preds = %73
%77 = getelementptr inbounds [2048 x i8], [2048 x i8]* %8, i64 0, i64 0
%78 = call i32 @read(i32 0, i8* %77, i32 2048)
store i32 %78, i32* %9
%79 = load i32, i32* %9
%80 = icmp eq i32 %79, -1
br i1 %80, label %81, label %82
81: ; preds = %76
store i32 1, i32* %1
br label %97
82: ; preds = %76
%83 = load i32, i32* %9
%84 = icmp eq i32 %83, 0
br i1 %84, label %85, label %86
85: ; preds = %82
br label %93
86: ; preds = %82
%87 = load i32, i32* %9
%88 = load i32, i32* %6
%89 = sub nsw i32 %88, %87
store i32 %89, i32* %6
%90 = getelementptr inbounds [2048 x i8], [2048 x i8]* %8, i64 0, i64 0
%91 = load i32, i32* %9
%92 = call i32 @write(i32 1, i8* %90, i32 %91)
br label %73
93: ; preds = %85, %73
br label %96
94: ; preds = %32
%95 = call i32 @puts(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.17, i64 0, i64 0))
br label %96
96: ; preds = %94, %93
br label %97
97: ; preds = %13, %29, %41, %46, %59, %81, %96, %31
%98 = load i32, i32* %1
ret i32 %98
}

LLVM IR (-O2):
@.str = [15 x i8] c"REQUEST_METHOD\00"
@.str.1 = [61 x i8] c"Content-Type: text/plain\0D\0A\0D\0AFatal: $REQUEST_METHOD not set!\0A\00"
@.str.2 = [4 x i8] c"GET\00"
@.str.3 = [13 x i8] c"QUERY_STRING\00"
@.str.4 = [29 x i8] c"Content-Type: text/plain\0D\0A\0D\0A\00"
@.str.5 = [31 x i8] c"Fatal: $QUERY_STRING not set!\0A\00"
@.str.6 = [5 x i8] c"POST\00"
@.str.7 = [13 x i8] c"CONTENT_TYPE\00"
@.str.8 = [15 x i8] c"CONTENT_LENGTH\00"
@.str.9 = [59 x i8] c"Content-Type: text/plain\0D\0A\0D\0AFatal: $CONTENT_TYPE not set!\0A\00"
@.str.10 = [61 x i8] c"Content-Type: text/plain\0D\0A\0D\0AFatal: $CONTENT_LENGTH not set!\0A\00"
@.str.11 = [66 x i8] c"Content-Type: text/plain\0D\0A\0D\0AFatal: $CONTENT_LENGTH not a number: \00"
@.str.12 = [2 x i8] c"\0A\00"
@.str.13 = [15 x i8] c"Content-Type: \00"
@.str.14 = [3 x i8] c"\0D\0A\00"
@.str.15 = [17 x i8] c"Content-Length: \00"
@.str.16 = [5 x i8] c"\0D\0A\0D\0A\00"
@.str.17 = [77 x i8] c"Content-Type: text/plain\0D\0A\0D\0AFatal: $REQUEST_METHOD is neither GET nor POST!\0A\00"
define i32 @main() {
%1 = alloca i8*
%2 = alloca [2048 x i8]
%3 = tail call i8* @getenv(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = tail call i32 @__write1(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.1, i64 0, i64 0))
br label %66
7: ; preds = %0
%8 = tail call i32 @strcmp(i8* %3, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %19
10: ; preds = %7
%11 = tail call i8* @getenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%12 = tail call i32 @__write1(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0))
%13 = icmp eq i8* %11, null
br i1 %13, label %17, label %14
14: ; preds = %10
%15 = tail call i32 @strlen(i8* %11)
%16 = tail call i32 @write(i32 1, i8* %11, i32 %15)
br label %66
17: ; preds = %10
%18 = tail call i32 @__write1(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0))
br label %66
19: ; preds = %7
%20 = tail call i32 @strcmp(i8* %3, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %64
22: ; preds = %19
%23 = tail call i8* @getenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
%24 = tail call i8* @getenv(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0))
%25 = icmp eq i8* %23, null
br i1 %25, label %26, label %28
26: ; preds = %22
%27 = tail call i32 @__write1(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.9, i64 0, i64 0))
br label %66
28: ; preds = %22
%29 = icmp eq i8* %24, null
br i1 %29, label %30, label %32
30: ; preds = %28
%31 = tail call i32 @__write1(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.10, i64 0, i64 0))
br label %66
32: ; preds = %28
%33 = bitcast i8** %1 to i8*
%34 = call i32 @strtoul(i8* %24, i8** %1, i32 10)
%35 = load i8*, i8** %1
%36 = icmp eq i8* %35, %24
br i1 %36, label %40, label %37
37: ; preds = %32
%38 = load i8, i8* %35
%39 = icmp eq i8 %38, 0
br i1 %39, label %44, label %40
40: ; preds = %32, %37
%41 = tail call i32 @__write1(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.11, i64 0, i64 0))
%42 = tail call i32 @__write1(i8* %24)
%43 = tail call i32 @__write1(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
br label %66
44: ; preds = %37
%45 = tail call i32 @__write1(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.13, i64 0, i64 0))
%46 = tail call i32 @__write1(i8* %23)
%47 = tail call i32 @__write1(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0))
%48 = tail call i32 @__write1(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.15, i64 0, i64 0))
%49 = tail call i32 @__write1(i8* %24)
%50 = tail call i32 @__write1(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.16, i64 0, i64 0))
%51 = icmp sgt i32 %34, 0
br i1 %51, label %52, label %66
52: ; preds = %44
%53 = getelementptr inbounds [2048 x i8], [2048 x i8]* %2, i64 0, i64 0
br label %54
54: ; preds = %52, %60
%55 = phi i32 [ %34, %52 ], [ %61, %60 ]
%56 = call i32 @read(i32 0, i8* %53, i32 2048)
switch i32 %56, label %60 [
i32 -1, label %57
i32 0, label %58
]
57: ; preds = %54
br label %58
58: ; preds = %54, %57
%59 = phi i32 [ 1, %57 ], [ 0, %54 ]
br label %66
60: ; preds = %54
%61 = sub nsw i32 %55, %56
%62 = call i32 @write(i32 1, i8* %53, i32 %56)
%63 = icmp sgt i32 %61, 0
br i1 %63, label %54, label %66
64: ; preds = %19
%65 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @.str.17, i64 0, i64 0))
br label %66
66: ; preds = %60, %44, %58, %40, %26, %30, %17, %14, %64, %5
%67 = phi i32 [ 1, %5 ], [ 0, %64 ], [ 0, %14 ], [ 1, %17 ], [ 1, %40 ], [ 1, %30 ], [ 1, %26 ], [ %59, %58 ], [ 0, %44 ], [ 0, %60 ]
ret i32 %67
}