#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 */
struct timespec {
  int tv_sec;
  scalar_t__ tv_nsec;
};
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ STDIN_FILENO;
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
int read(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ strncmp(char *, char *, int);
int write(int /*<<< orphan*/, char *, int /*<<< orphan*/);
int main() {
  char input[65536 + 1];
  int sock;
  ssize_t len;
  struct timespec ts;
  char *crypt = "2002928\n-----BEGIN PGP MESSAGE-----\nVersion: GnuPG v1.4.9 "
                "(GNU/Linux)\n\nhQIOAzz6ltMxvh7UEAf/"
                "Xy60gF+"
                "WHzgZNyflPb8seVn7KjSdA5ojkIpUjnsf4Xhc\n66PgvVrQwyiyYZ6KFs2f4na"
                "BwdSUTYEa/YL+7Tsc5el1ipdYxwdVOzD9Iac1XG9G\nQDeByA/"
                "UHk4CJj171I0CCJvIeuA7Bjd6JEpjCaNatxL1AGeLEAL4fv7dGzKYYwNc\nFvy"
                "aIDMWtbbY1VVHmPg1yv7he1y0bTAN/"
                "PrDmlvcE5t7YNpQGixbF4mVWtys4zLi\nZIqculNyqd+BrBLB3tYbS7K/"
                "ixufYw2PdI4dWZ70bc0S0fK17gSjJI/l8DYIGV86\npqeon/"
                "18JjNjj64yf86tf0TZZbDr1320QeLpKWrnUgf/e7ceFNySjJg/"
                "ZxX5jXU5\neYYoFqM/h+uMBonssstQzpQcccinttR+zBcsaqbx6y8PxU/"
                "83Zu2pdhAHDcp3uo2\ndLitOKa5UDKBWbwxhym+"
                "l9MzNvrRTEE4ZyWnSuzWdPZBv39CkDC00pLb8AHCBWBU\ndBdCPPxznzPiA31a"
                "MiWRlmY+iZJ7oj2/"
                "4MTpSWfxLhVdGhos701xl8OuAzRIg0Xj\n9XWywzstNl7D3Gak4OqP+"
                "b7amzVLFHNjqcVMZ00qaz76Y+eO/"
                "hmPTlgzCrxtmxEm\n9ODn8w44RK9aiDdK6Mg5TnDZMENjLvDSWAfWznh34+"
                "Ah0dVnw7X3t7nTmljOjHMy\nI9JSARazAgS0KIQP8M/"
                "qYZMEOf22hBNYbNPBmfI3a7QQJGXqbGNTFPWqHtwu809W\nUQQpdMJCi/"
                "N7fhdVK2Rgws+fYN3qbX1XKG2jrxD1Yj0QbOU/KA==\n=pStt\n-----END "
                "PGP MESSAGE-----\n";
  read(STDIN_FILENO, input, 4);
  input[4] = '\0';
  fprintf(stderr, "dummy-LTP cmd: %s\n", input);
  read(STDIN_FILENO, input, 128);
  input[128] = '\0';
  fprintf(stderr, "dummy-LTP listens to url: %s\n", input);
  ts.tv_sec = 3;
  ts.tv_nsec = 0;
  nanosleep(&ts, NULL);
  len = write(STDOUT_FILENO, crypt, strlen(crypt));
  fprintf(stderr, "len=%lu\n", strlen(crypt));
  while (1) {
    len = read(STDIN_FILENO, input, 65536 + 1);
    if (len < 0) {
      perror("tp/dummy/listen: read");
      return 1;
    }
    if (len > 65536) {
      fprintf(stderr, "Packet too big (%lu)!\n", len);
      continue;
    }
    input[len] = '\0';
    fprintf(stderr, "dummy-LTP received command: %s (until first \\0)\n",
            input);
    if (!strncmp(input, "1002", 4)) {
      fprintf(stderr, "dummy/c: Time to say goodbye...\n");
      return 0;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10050,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe77(%rip),%rax
mov    %rax,-0x10030(%rbp)
mov    0x2e39(%rip),%rax
mov    (%rax),%edi
lea    -0x10010(%rbp),%rsi
mov    $0x4,%edx
call   1070 <read@plt>
movb   $0x0,-0x1000c(%rbp)
mov    0x2e20(%rip),%rax
mov    (%rax),%edi
lea    -0x10010(%rbp),%rdx
lea    0x11e1(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x2dfa(%rip),%rax
mov    (%rax),%edi
lea    -0x10010(%rbp),%rsi
mov    $0x80,%edx
call   1070 <read@plt>
movb   $0x0,-0xff90(%rbp)
mov    0x2de1(%rip),%rax
mov    (%rax),%edi
lea    -0x10010(%rbp),%rdx
lea    0x11b5(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x3,-0x10028(%rbp)
movq   $0x0,-0x10020(%rbp)
lea    -0x10028(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1060 <nanosleep@plt>
mov    0x2db6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10044(%rbp)
mov    -0x10030(%rbp),%rax
mov    %rax,-0x10040(%rbp)
mov    -0x10030(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x10044(%rbp),%edi
mov    -0x10040(%rbp),%rsi
mov    %eax,%edx
call   1040 <write@plt>
mov    %eax,-0x10018(%rbp)
mov    0x2d5b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10034(%rbp)
mov    -0x10030(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x10034(%rbp),%edi
mov    %eax,%edx
lea    0x113a(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x2d22(%rip),%rax
mov    (%rax),%edi
lea    -0x10010(%rbp),%rsi
mov    $0x10001,%edx
call   1070 <read@plt>
mov    %eax,-0x10018(%rbp)
cmpl   $0x0,-0x10018(%rbp)
jge    12ec <main+0x17c>
lea    0x1108(%rip),%rdi
call   1090 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    1394 <main+0x224>
cmpl   $0x10000,-0x10018(%rbp)
jle    131e <main+0x1ae>
mov    0x2cd5(%rip),%rax
mov    (%rax),%edi
mov    -0x10018(%rbp),%edx
lea    0x10e7(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
jmp    12a7 <main+0x137>
movslq -0x10018(%rbp),%rax
movb   $0x0,-0x10010(%rbp,%rax,1)
mov    0x2ca4(%rip),%rax
mov    (%rax),%edi
lea    -0x10010(%rbp),%rdx
lea    0x10cc(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
lea    -0x10010(%rbp),%rdi
lea    0x10e8(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    138f <main+0x21f>
mov    0x2c65(%rip),%rax
mov    (%rax),%edi
lea    0x10ca(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1394 <main+0x224>
jmp    12a7 <main+0x137>
mov    -0x4(%rbp),%eax
add    $0x10050,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10018,%rsp
mov    0x2e48(%rip),%r13
mov    0x0(%r13),%edi
lea    0x10(%rsp),%r14
mov    %r14,%rsi
mov    $0x4,%edx
call   1070 <read@plt>
movb   $0x0,0x14(%rsp)
mov    0x2e2e(%rip),%rbp
mov    0x0(%rbp),%edi
lea    0x11f5(%rip),%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    0x0(%r13),%edi
mov    %r14,%rsi
mov    $0x80,%edx
call   1070 <read@plt>
movb   $0x0,0x90(%rsp)
mov    0x0(%rbp),%edi
lea    0x11db(%rip),%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1080 <fprintf@plt>
movl   $0x3,(%rsp)
movq   $0x0,0x8(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
call   1060 <nanosleep@plt>
mov    0x2de4(%rip),%rax
mov    (%rax),%ebx
lea    0xdeb(%rip),%r15
mov    %r15,%rdi
call   1050 <strlen@plt>
mov    %ebx,%edi
mov    %r15,%rsi
mov    %eax,%edx
call   1040 <write@plt>
mov    0x0(%rbp),%ebx
mov    %r15,%rdi
call   1050 <strlen@plt>
lea    0x119f(%rip),%rsi
mov    %ebx,%edi
mov    %eax,%edx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    0x0(%r13),%edi
mov    %r14,%rsi
mov    $0x10001,%edx
call   1070 <read@plt>
test   %eax,%eax
js     12fd <main+0x18d>
lea    0x1193(%rip),%r14
lea    0x10(%rsp),%rbx
lea    0x119e(%rip),%r15
lea    0x11c8(%rip),%r12
jmp    12a4 <main+0x134>
nopl   0x0(%rax,%rax,1)
mov    0x0(%rbp),%edi
mov    %r14,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    0x0(%r13),%edi
mov    %rbx,%rsi
mov    $0x10001,%edx
call   1070 <read@plt>
test   %eax,%eax
js     12fd <main+0x18d>
cmp    $0x10001,%eax
jae    1280 <main+0x110>
mov    %eax,%eax
movb   $0x0,0x10(%rsp,%rax,1)
mov    0x0(%rbp),%edi
mov    %r15,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
jne    128f <main+0x11f>
mov    0x0(%rbp),%edi
lea    0x1166(%rip),%rsi
xor    %ebx,%ebx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    %ebx,%eax
add    $0x10018,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x10df(%rip),%rdi
call   1090 <perror@plt>
mov    $0x1,%ebx
jmp    12e9 <main+0x179>

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
@.str = [937 x i8] c"2002928\0A-----BEGIN PGP MESSAGE-----\0AVersion: GnuPG v1.4.9 (GNU/Linux)\0A\0AhQIOAzz6ltMxvh7UEAf/Xy60gF+WHzgZNyflPb8seVn7KjSdA5ojkIpUjnsf4Xhc\0A66PgvVrQwyiyYZ6KFs2f4naBwdSUTYEa/YL+7Tsc5el1ipdYxwdVOzD9Iac1XG9G\0AQDeByA/UHk4CJj171I0CCJvIeuA7Bjd6JEpjCaNatxL1AGeLEAL4fv7dGzKYYwNc\0AFvyaIDMWtbbY1VVHmPg1yv7he1y0bTAN/PrDmlvcE5t7YNpQGixbF4mVWtys4zLi\0AZIqculNyqd+BrBLB3tYbS7K/ixufYw2PdI4dWZ70bc0S0fK17gSjJI/l8DYIGV86\0Apqeon/18JjNjj64yf86tf0TZZbDr1320QeLpKWrnUgf/e7ceFNySjJg/ZxX5jXU5\0AeYYoFqM/h+uMBonssstQzpQcccinttR+zBcsaqbx6y8PxU/83Zu2pdhAHDcp3uo2\0AdLitOKa5UDKBWbwxhym+l9MzNvrRTEE4ZyWnSuzWdPZBv39CkDC00pLb8AHCBWBU\0AdBdCPPxznzPiA31aMiWRlmY+iZJ7oj2/4MTpSWfxLhVdGhos701xl8OuAzRIg0Xj\0A9XWywzstNl7D3Gak4OqP+b7amzVLFHNjqcVMZ00qaz76Y+eO/hmPTlgzCrxtmxEm\0A9ODn8w44RK9aiDdK6Mg5TnDZMENjLvDSWAfWznh34+Ah0dVnw7X3t7nTmljOjHMy\0AI9JSARazAgS0KIQP8M/qYZMEOf22hBNYbNPBmfI3a7QQJGXqbGNTFPWqHtwu809W\0AUQQpdMJCi/N7fhdVK2Rgws+fYN3qbX1XKG2jrxD1Yj0QbOU/KA==\0A=pStt\0A-----END PGP MESSAGE-----\0A\00"
@STDIN_FILENO = global i32 0
@stderr = global i32 0
@.str.1 = [19 x i8] c"dummy-LTP cmd: %s\0A\00"
@.str.2 = [30 x i8] c"dummy-LTP listens to url: %s\0A\00"
@STDOUT_FILENO = global i32 0
@.str.3 = [9 x i8] c"len=%lu\0A\00"
@.str.4 = [22 x i8] c"tp/dummy/listen: read\00"
@.str.5 = [23 x i8] c"Packet too big (%lu)!\0A\00"
@.str.6 = [49 x i8] c"dummy-LTP received command: %s (until first \\0)\0A\00"
@.str.7 = [5 x i8] c"1002\00"
@.str.8 = [33 x i8] c"dummy/c: Time to say goodbye...\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [65537 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.timespec
%6 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([937 x i8], [937 x i8]* @.str, i64 0, i64 0), i8** %6
%7 = load i32, i32* @STDIN_FILENO
%8 = getelementptr inbounds [65537 x i8], [65537 x i8]* %2, i64 0, i64 0
%9 = call i32 @read(i32 %7, i8* %8, i32 4)
%10 = getelementptr inbounds [65537 x i8], [65537 x i8]* %2, i64 0, i64 4
store i8 0, i8* %10
%11 = load i32, i32* @stderr
%12 = getelementptr inbounds [65537 x i8], [65537 x i8]* %2, i64 0, i64 0
%13 = call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %12)
%14 = load i32, i32* @STDIN_FILENO
%15 = getelementptr inbounds [65537 x i8], [65537 x i8]* %2, i64 0, i64 0
%16 = call i32 @read(i32 %14, i8* %15, i32 128)
%17 = getelementptr inbounds [65537 x i8], [65537 x i8]* %2, i64 0, i64 128
store i8 0, i8* %17
%18 = load i32, i32* @stderr
%19 = getelementptr inbounds [65537 x i8], [65537 x i8]* %2, i64 0, i64 0
%20 = call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* %19)
%21 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 0
store i32 3, i32* %21
%22 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 1
store i64 0, i64* %22
%23 = call i32 @nanosleep(%struct.timespec* %5, i32* null)
%24 = load i32, i32* @STDOUT_FILENO
%25 = load i8*, i8** %6
%26 = load i8*, i8** %6
%27 = call i32 @strlen(i8* %26)
%28 = call i32 @write(i32 %24, i8* %25, i32 %27)
store i32 %28, i32* %4
%29 = load i32, i32* @stderr
%30 = load i8*, i8** %6
%31 = call i32 @strlen(i8* %30)
%32 = call i32 (i32, i8*, ...) @fprintf(i32 %29, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %31)
br label %33
33: ; preds = %0, %44, %61
%34 = load i32, i32* @STDIN_FILENO
%35 = getelementptr inbounds [65537 x i8], [65537 x i8]* %2, i64 0, i64 0
%36 = call i32 @read(i32 %34, i8* %35, i32 65537)
store i32 %36, i32* %4
%37 = load i32, i32* %4
%38 = icmp slt i32 %37, 0
br i1 %38, label %39, label %41
39: ; preds = %33
%40 = call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %1
br label %62
41: ; preds = %33
%42 = load i32, i32* %4
%43 = icmp sgt i32 %42, 65536
br i1 %43, label %44, label %48
44: ; preds = %41
%45 = load i32, i32* @stderr
%46 = load i32, i32* %4
%47 = call i32 (i32, i8*, ...) @fprintf(i32 %45, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), i32 %46)
br label %33
48: ; preds = %41
%49 = load i32, i32* %4
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [65537 x i8], [65537 x i8]* %2, i64 0, i64 %50
store i8 0, i8* %51
%52 = load i32, i32* @stderr
%53 = getelementptr inbounds [65537 x i8], [65537 x i8]* %2, i64 0, i64 0
%54 = call i32 (i32, i8*, ...) @fprintf(i32 %52, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.6, i64 0, i64 0), i8* %53)
%55 = getelementptr inbounds [65537 x i8], [65537 x i8]* %2, i64 0, i64 0
%56 = call i32 @strncmp(i8* %55, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i32 4)
%57 = icmp ne i32 %56, 0
br i1 %57, label %61, label %58
58: ; preds = %48
%59 = load i32, i32* @stderr
%60 = call i32 (i32, i8*, ...) @fprintf(i32 %59, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.8, i64 0, i64 0))
store i32 0, i32* %1
br label %62
61: ; preds = %48
br label %33
62: ; preds = %58, %39
%63 = load i32, i32* %1
ret i32 %63
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
@.str = [937 x i8] c"2002928\0A-----BEGIN PGP MESSAGE-----\0AVersion: GnuPG v1.4.9 (GNU/Linux)\0A\0AhQIOAzz6ltMxvh7UEAf/Xy60gF+WHzgZNyflPb8seVn7KjSdA5ojkIpUjnsf4Xhc\0A66PgvVrQwyiyYZ6KFs2f4naBwdSUTYEa/YL+7Tsc5el1ipdYxwdVOzD9Iac1XG9G\0AQDeByA/UHk4CJj171I0CCJvIeuA7Bjd6JEpjCaNatxL1AGeLEAL4fv7dGzKYYwNc\0AFvyaIDMWtbbY1VVHmPg1yv7he1y0bTAN/PrDmlvcE5t7YNpQGixbF4mVWtys4zLi\0AZIqculNyqd+BrBLB3tYbS7K/ixufYw2PdI4dWZ70bc0S0fK17gSjJI/l8DYIGV86\0Apqeon/18JjNjj64yf86tf0TZZbDr1320QeLpKWrnUgf/e7ceFNySjJg/ZxX5jXU5\0AeYYoFqM/h+uMBonssstQzpQcccinttR+zBcsaqbx6y8PxU/83Zu2pdhAHDcp3uo2\0AdLitOKa5UDKBWbwxhym+l9MzNvrRTEE4ZyWnSuzWdPZBv39CkDC00pLb8AHCBWBU\0AdBdCPPxznzPiA31aMiWRlmY+iZJ7oj2/4MTpSWfxLhVdGhos701xl8OuAzRIg0Xj\0A9XWywzstNl7D3Gak4OqP+b7amzVLFHNjqcVMZ00qaz76Y+eO/hmPTlgzCrxtmxEm\0A9ODn8w44RK9aiDdK6Mg5TnDZMENjLvDSWAfWznh34+Ah0dVnw7X3t7nTmljOjHMy\0AI9JSARazAgS0KIQP8M/qYZMEOf22hBNYbNPBmfI3a7QQJGXqbGNTFPWqHtwu809W\0AUQQpdMJCi/N7fhdVK2Rgws+fYN3qbX1XKG2jrxD1Yj0QbOU/KA==\0A=pStt\0A-----END PGP MESSAGE-----\0A\00"
@STDIN_FILENO = global i32 0
@stderr = global i32 0
@.str.1 = [19 x i8] c"dummy-LTP cmd: %s\0A\00"
@.str.2 = [30 x i8] c"dummy-LTP listens to url: %s\0A\00"
@STDOUT_FILENO = global i32 0
@.str.3 = [9 x i8] c"len=%lu\0A\00"
@.str.4 = [22 x i8] c"tp/dummy/listen: read\00"
@.str.5 = [23 x i8] c"Packet too big (%lu)!\0A\00"
@.str.6 = [49 x i8] c"dummy-LTP received command: %s (until first \\0)\0A\00"
@.str.7 = [5 x i8] c"1002\00"
@.str.8 = [33 x i8] c"dummy/c: Time to say goodbye...\0A\00"
define i32 @main() {
%1 = alloca [65537 x i8]
%2 = alloca %struct.timespec
%3 = getelementptr inbounds [65537 x i8], [65537 x i8]* %1, i64 0, i64 0
%4 = bitcast %struct.timespec* %2 to i8*
%5 = load i32, i32* @STDIN_FILENO
%6 = call i32 @read(i32 %5, i8* %3, i32 4)
%7 = getelementptr inbounds [65537 x i8], [65537 x i8]* %1, i64 0, i64 4
store i8 0, i8* %7
%8 = load i32, i32* @stderr
%9 = call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%10 = load i32, i32* @STDIN_FILENO
%11 = call i32 @read(i32 %10, i8* %3, i32 128)
%12 = getelementptr inbounds [65537 x i8], [65537 x i8]* %1, i64 0, i64 128
store i8 0, i8* %12
%13 = load i32, i32* @stderr
%14 = call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%15 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i32 3, i32* %15
%16 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i64 0, i64* %16
%17 = call i32 @nanosleep(%struct.timespec* %2, i32* null)
%18 = load i32, i32* @STDOUT_FILENO
%19 = call i32 @strlen(i8* getelementptr inbounds ([937 x i8], [937 x i8]* @.str, i64 0, i64 0))
%20 = call i32 @write(i32 %18, i8* getelementptr inbounds ([937 x i8], [937 x i8]* @.str, i64 0, i64 0), i32 %19)
%21 = load i32, i32* @stderr
%22 = call i32 @strlen(i8* getelementptr inbounds ([937 x i8], [937 x i8]* @.str, i64 0, i64 0))
%23 = call i32 (i32, i8*, ...) @fprintf(i32 %21, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %22)
%24 = load i32, i32* @STDIN_FILENO
%25 = call i32 @read(i32 %24, i8* %3, i32 65537)
%26 = icmp slt i32 %25, 0
br i1 %26, label %27, label %29
27: ; preds = %35, %0
%28 = call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
br label %49
29: ; preds = %0, %35
%30 = phi i32 [ %37, %35 ], [ %25, %0 ]
%31 = icmp ugt i32 %30, 65536
br i1 %31, label %32, label %39
32: ; preds = %29
%33 = load i32, i32* @stderr
%34 = call i32 (i32, i8*, ...) @fprintf(i32 %33, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), i32 %30)
br label %35
35: ; preds = %32, %39
%36 = load i32, i32* @STDIN_FILENO
%37 = call i32 @read(i32 %36, i8* %3, i32 65537)
%38 = icmp slt i32 %37, 0
br i1 %38, label %27, label %29
39: ; preds = %29
%40 = zext i32 %30 to i64
%41 = getelementptr inbounds [65537 x i8], [65537 x i8]* %1, i64 0, i64 %40
store i8 0, i8* %41
%42 = load i32, i32* @stderr
%43 = call i32 (i32, i8*, ...) @fprintf(i32 %42, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.6, i64 0, i64 0), i8* %3)
%44 = call i32 @strncmp(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i32 4)
%45 = icmp eq i32 %44, 0
br i1 %45, label %46, label %35
46: ; preds = %39
%47 = load i32, i32* @stderr
%48 = call i32 (i32, i8*, ...) @fprintf(i32 %47, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.8, i64 0, i64 0))
br label %49
49: ; preds = %46, %27
%50 = phi i32 [ 1, %27 ], [ 0, %46 ]
ret i32 %50
}