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

/* Variables and functions */
int /*<<< orphan*/ err(int, char *);
char *memchr(char *, char, int);
int pread(int, char *, int, unsigned long);
int /*<<< orphan*/ puts(char *);
int pwrite(int, char *, int, unsigned long);
int read_string(char *, char *);
int /*<<< orphan*/ write(int, char *, int);
void handle_database_commands(int dbfd) {
  char buf[1000];
  unsigned long pos = 16;
  while (1) {
    puts("Available commands:");
    puts("  (c)lose database");
    puts("  (s)how next record (there must be a following record for this)");
    puts("  (a)ppend record");
    puts("  (r)ewind back to first record");
    char cmd[2];
    read_string("db", cmd);
    switch (cmd[0]) {
    case 'c':
      return;
    case 's':;
      char entry[1000] = {0};
      int len = pread(dbfd, entry, sizeof(entry), pos);
      if (len == -1)
        err(1, "read entry");
      if (len == 0) {
        puts("EOF");
        break;
      }
      char *entry_end = memchr(entry, '\n', len);
      if (entry_end)
        len = (entry_end + 1) - entry;
      pos += len;
      write(1, entry, len);
      break;
    case 'a':
      while (1) {
        char c;
        int res = pread(dbfd, &c, 1, pos);
        if (res == 0)
          break;
        if (res == -1)
          err(1, "unable to skip to end of db file");
        pos++;
      }
      int buf_len = read_string("new data", buf);
      if (pwrite(dbfd, buf, buf_len, pos) != buf_len)
        err(1, "failed to append db record");
      pos += buf_len;
      if (pwrite(dbfd, "\n", 1, pos) != 1)
        err(1, "failed to terminate db record");
      pos++;
      break;
    case 'r':
      pos = 16;
      break;
    default:
      puts("unknown command");
      break;
    }
  }
}


x86 assembly (clang, -O0):
<handle_database_commands>:
push   %rbp
mov    %rsp,%rbp
sub    $0x820,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x10,-0x3f8(%rbp)
lea    0xeac(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb4(%rip),%rdi
call   1030 <puts@plt>
lea    0xebb(%rip),%rdi
call   1030 <puts@plt>
lea    0xef0(%rip),%rdi
call   1030 <puts@plt>
lea    0xef6(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0a(%rip),%rdi
lea    -0x3fa(%rbp),%rsi
call   10a0 <read_string@plt>
movsbl -0x3fa(%rbp),%eax
add    $0xffffff9f,%eax
mov    %eax,%ecx
mov    %rcx,-0x818(%rbp)
sub    $0x12,%eax
ja     143c <handle_database_commands+0x2bc>
mov    -0x818(%rbp),%rax
lea    0xdee(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
add    $0x820,%rsp
pop    %rbp
ret
lea    -0x7f0(%rbp),%rdi
xor    %esi,%esi
mov    $0x3e8,%edx
call   1050 <memset@plt>
mov    -0x4(%rbp),%edi
lea    -0x7f0(%rbp),%rsi
mov    -0x3f8(%rbp),%rcx
mov    $0x3e8,%edx
call   1090 <pread@plt>
mov    %eax,-0x7f4(%rbp)
cmpl   $0xffffffff,-0x7f4(%rbp)
jne    1276 <handle_database_commands+0xf6>
mov    $0x1,%edi
lea    0xe78(%rip),%rsi
call   1070 <err@plt>
cmpl   $0x0,-0x7f4(%rbp)
jne    1294 <handle_database_commands+0x114>
lea    0xe6a(%rip),%rdi
call   1030 <puts@plt>
jmp    1448 <handle_database_commands+0x2c8>
lea    -0x7f0(%rbp),%rdi
mov    -0x7f4(%rbp),%edx
mov    $0xa,%esi
call   1060 <memchr@plt>
mov    %rax,-0x800(%rbp)
cmpq   $0x0,-0x800(%rbp)
je     12db <handle_database_commands+0x15b>
mov    -0x800(%rbp),%rax
add    $0x1,%rax
lea    -0x7f0(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x7f4(%rbp)
movslq -0x7f4(%rbp),%rax
add    -0x3f8(%rbp),%rax
mov    %rax,-0x3f8(%rbp)
lea    -0x7f0(%rbp),%rsi
mov    -0x7f4(%rbp),%edx
mov    $0x1,%edi
call   1040 <write@plt>
jmp    1448 <handle_database_commands+0x2c8>
jmp    1311 <handle_database_commands+0x191>
mov    -0x4(%rbp),%edi
mov    -0x3f8(%rbp),%rcx
lea    -0x801(%rbp),%rsi
mov    $0x1,%edx
call   1090 <pread@plt>
mov    %eax,-0x808(%rbp)
cmpl   $0x0,-0x808(%rbp)
jne    1344 <handle_database_commands+0x1c4>
jmp    1379 <handle_database_commands+0x1f9>
cmpl   $0xffffffff,-0x808(%rbp)
jne    1362 <handle_database_commands+0x1e2>
mov    $0x1,%edi
lea    0xd9b(%rip),%rsi
call   1070 <err@plt>
mov    -0x3f8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x3f8(%rbp)
jmp    1311 <handle_database_commands+0x191>
lea    -0x3f0(%rbp),%rsi
lea    0xd92(%rip),%rdi
call   10a0 <read_string@plt>
mov    %eax,-0x80c(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x3f0(%rbp),%rsi
mov    -0x80c(%rbp),%edx
mov    -0x3f8(%rbp),%rcx
call   1080 <pwrite@plt>
cmp    -0x80c(%rbp),%eax
je     13cb <handle_database_commands+0x24b>
mov    $0x1,%edi
lea    0xd5c(%rip),%rsi
call   1070 <err@plt>
movslq -0x80c(%rbp),%rax
add    -0x3f8(%rbp),%rax
mov    %rax,-0x3f8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x3f8(%rbp),%rcx
lea    0xd4c(%rip),%rsi
mov    $0x1,%edx
call   1080 <pwrite@plt>
cmp    $0x1,%eax
je     1415 <handle_database_commands+0x295>
mov    $0x1,%edi
lea    0xd2f(%rip),%rsi
call   1070 <err@plt>
mov    -0x3f8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x3f8(%rbp)
jmp    1448 <handle_database_commands+0x2c8>
movq   $0x10,-0x3f8(%rbp)
jmp    1448 <handle_database_commands+0x2c8>
lea    0xd1a(%rip),%rdi
call   1030 <puts@plt>
jmp    1199 <handle_database_commands+0x19>

x86 assembly (clang, -O2):
<handle_database_commands>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x7e8,%rsp
mov    %edi,%ebx
mov    $0x10,%r12d
lea    0xeac(%rip),%r15
lea    0xeb9(%rip),%rbp
lea    0xd(%rsp),%r13
lea    0xf45(%rip),%r14
jmp    11d2 <handle_database_commands+0x52>
cs nopw 0x0(%rax,%rax,1)
nop
lea    0xf96(%rip),%rdi
call   1030 <puts@plt>
mov    %r12,%rax
mov    %rax,%r12
mov    %r15,%rdi
call   1030 <puts@plt>
mov    %rbp,%rdi
call   1030 <puts@plt>
lea    0xe8a(%rip),%rdi
call   1030 <puts@plt>
lea    0xebf(%rip),%rdi
call   1030 <puts@plt>
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
lea    0xed9(%rip),%rdi
lea    0xe(%rsp),%rsi
call   10a0 <read_string@plt>
movsbl 0xe(%rsp),%eax
add    $0xffffff9f,%eax
cmp    $0x12,%eax
ja     11c0 <handle_database_commands+0x40>
lea    0xdd5(%rip),%rdx
movslq (%rdx,%rax,4),%rcx
add    %rdx,%rcx
mov    $0x10,%eax
jmp    *%rcx
mov    $0x3e8,%edx
lea    0x10(%rsp),%rbp
mov    %rbp,%rdi
xor    %esi,%esi
call   1050 <memset@plt>
mov    %ebx,%edi
mov    %rbp,%rsi
mov    $0x3e8,%edx
mov    %r12,%rcx
call   1090 <pread@plt>
test   %eax,%eax
je     1373 <handle_database_commands+0x1f3>
mov    %eax,%r15d
cmp    $0xffffffff,%eax
jne    1280 <handle_database_commands+0x100>
mov    $0x1,%edi
lea    0xe6e(%rip),%rsi
call   1070 <err@plt>
lea    0x10(%rsp),%rbp
mov    %rbp,%rdi
mov    $0xa,%esi
mov    %r15d,%edx
call   1060 <memchr@plt>
mov    %eax,%ecx
sub    %ebp,%ecx
add    $0x1,%ecx
test   %rax,%rax
cmove  %r15d,%ecx
movslq %ecx,%rdx
add    %rdx,%r12
mov    $0x1,%edi
mov    %rbp,%rsi
call   1040 <write@plt>
jmp    137f <handle_database_commands+0x1ff>
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
mov    %r14,%rsi
call   1070 <err@plt>
add    $0x1,%r12
mov    %ebx,%edi
mov    %r13,%rsi
mov    $0x1,%edx
mov    %r12,%rcx
call   1090 <pread@plt>
cmp    $0xffffffff,%eax
je     12c0 <handle_database_commands+0x140>
test   %eax,%eax
jne    12cd <handle_database_commands+0x14d>
lea    0xe26(%rip),%rdi
lea    0x400(%rsp),%r15
mov    %r15,%rsi
call   10a0 <read_string@plt>
mov    %eax,%ebp
mov    %ebx,%edi
mov    %r15,%rsi
mov    %eax,%edx
mov    %r12,%rcx
call   1080 <pwrite@plt>
cmp    %ebp,%eax
je     1329 <handle_database_commands+0x1a9>
mov    $0x1,%edi
lea    0xdfe(%rip),%rsi
call   1070 <err@plt>
movslq %ebp,%rbp
lea    (%r12,%rbp,1),%rcx
mov    %ebx,%edi
lea    0xe04(%rip),%rsi
mov    $0x1,%edx
call   1080 <pwrite@plt>
cmp    $0x1,%eax
lea    0xcff(%rip),%r15
je     1360 <handle_database_commands+0x1e0>
mov    $0x1,%edi
lea    0xde4(%rip),%rsi
call   1070 <err@plt>
add    %rbp,%r12
add    $0x1,%r12
lea    0xcf2(%rip),%rbp
jmp    11d2 <handle_database_commands+0x52>
lea    0xd7a(%rip),%rdi
call   1030 <puts@plt>
mov    %r12,%rax
lea    0xcc3(%rip),%r15
lea    0xcd0(%rip),%rbp
jmp    11d2 <handle_database_commands+0x52>
add    $0x7e8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Available commands:\00"
@.str.1 = [19 x i8] c" (c)lose database\00"
@.str.2 = [65 x i8] c" (s)how next record (there must be a following record for this)\00"
@.str.3 = [18 x i8] c" (a)ppend record\00"
@.str.4 = [32 x i8] c" (r)ewind back to first record\00"
@.str.5 = [3 x i8] c"db\00"
@.str.6 = [11 x i8] c"read entry\00"
@.str.7 = [4 x i8] c"EOF\00"
@.str.8 = [33 x i8] c"unable to skip to end of db file\00"
@.str.9 = [9 x i8] c"new data\00"
@.str.10 = [27 x i8] c"failed to append db record\00"
@.str.11 = [2 x i8] c"\0A\00"
@.str.12 = [30 x i8] c"failed to terminate db record\00"
@.str.13 = [16 x i8] c"unknown command\00"
define void @handle_database_commands(i32 %0) {
%2 = alloca i32
%3 = alloca [1000 x i8]
%4 = alloca i64
%5 = alloca [2 x i8]
%6 = alloca [1000 x i8]
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8
%10 = alloca i32
%11 = alloca i32
store i32 %0, i32* %2
store i64 16, i64* %4
br label %12
12: ; preds = %1, %106
%13 = call i32 @puts(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @puts(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%15 = call i32 @puts(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.2, i64 0, i64 0))
%16 = call i32 @puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%17 = call i32 @puts(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0))
%18 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%19 = call i32 @read_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %18)
%20 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
switch i32 %22, label %104 [
i32 99, label %23
i32 115, label %24
i32 97, label %61
i32 114, label %103
]
23: ; preds = %12
ret void
24: ; preds = %12
%25 = bitcast [1000 x i8]* %6 to i8*
%26 = load i32, i32* %2
%27 = getelementptr inbounds [1000 x i8], [1000 x i8]* %6, i64 0, i64 0
%28 = load i64, i64* %4
%29 = call i32 @pread(i32 %26, i8* %27, i32 1000, i64 %28)
store i32 %29, i32* %7
%30 = load i32, i32* %7
%31 = icmp eq i32 %30, -1
br i1 %31, label %32, label %34
32: ; preds = %24
%33 = call i32 @err(i32 1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
br label %34
34: ; preds = %32, %24
%35 = load i32, i32* %7
%36 = icmp eq i32 %35, 0
br i1 %36, label %37, label %39
37: ; preds = %34
%38 = call i32 @puts(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
br label %106
39: ; preds = %34
%40 = getelementptr inbounds [1000 x i8], [1000 x i8]* %6, i64 0, i64 0
%41 = load i32, i32* %7
%42 = call i8* @memchr(i8* %40, i8 signext 10, i32 %41)
store i8* %42, i8** %8
%43 = load i8*, i8** %8
%44 = icmp ne i8* %43, null
br i1 %44, label %45, label %53
45: ; preds = %39
%46 = load i8*, i8** %8
%47 = getelementptr inbounds i8, i8* %46, i64 1
%48 = getelementptr inbounds [1000 x i8], [1000 x i8]* %6, i64 0, i64 0
%49 = ptrtoint i8* %47 to i64
%50 = ptrtoint i8* %48 to i64
%51 = sub i64 %49, %50
%52 = trunc i64 %51 to i32
store i32 %52, i32* %7
br label %53
53: ; preds = %45, %39
%54 = load i32, i32* %7
%55 = sext i32 %54 to i64
%56 = load i64, i64* %4
%57 = add i64 %56, %55
store i64 %57, i64* %4
%58 = getelementptr inbounds [1000 x i8], [1000 x i8]* %6, i64 0, i64 0
%59 = load i32, i32* %7
%60 = call i32 @write(i32 1, i8* %58, i32 %59)
br label %106
61: ; preds = %12
br label %62
62: ; preds = %61, %74
%63 = load i32, i32* %2
%64 = load i64, i64* %4
%65 = call i32 @pread(i32 %63, i8* %9, i32 1, i64 %64)
store i32 %65, i32* %10
%66 = load i32, i32* %10
%67 = icmp eq i32 %66, 0
br i1 %67, label %68, label %69
68: ; preds = %62
br label %77
69: ; preds = %62
%70 = load i32, i32* %10
%71 = icmp eq i32 %70, -1
br i1 %71, label %72, label %74
72: ; preds = %69
%73 = call i32 @err(i32 1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.8, i64 0, i64 0))
br label %74
74: ; preds = %72, %69
%75 = load i64, i64* %4
%76 = add i64 %75, 1
store i64 %76, i64* %4
br label %62
77: ; preds = %68
%78 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%79 = call i32 @read_string(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), i8* %78)
store i32 %79, i32* %11
%80 = load i32, i32* %2
%81 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%82 = load i32, i32* %11
%83 = load i64, i64* %4
%84 = call i32 @pwrite(i32 %80, i8* %81, i32 %82, i64 %83)
%85 = load i32, i32* %11
%86 = icmp ne i32 %84, %85
br i1 %86, label %87, label %89
87: ; preds = %77
%88 = call i32 @err(i32 1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.10, i64 0, i64 0))
br label %89
89: ; preds = %87, %77
%90 = load i32, i32* %11
%91 = sext i32 %90 to i64
%92 = load i64, i64* %4
%93 = add i64 %92, %91
store i64 %93, i64* %4
%94 = load i32, i32* %2
%95 = load i64, i64* %4
%96 = call i32 @pwrite(i32 %94, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0), i32 1, i64 %95)
%97 = icmp ne i32 %96, 1
br i1 %97, label %98, label %100
98: ; preds = %89
%99 = call i32 @err(i32 1, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.12, i64 0, i64 0))
br label %100
100: ; preds = %98, %89
%101 = load i64, i64* %4
%102 = add i64 %101, 1
store i64 %102, i64* %4
br label %106
103: ; preds = %12
store i64 16, i64* %4
br label %106
104: ; preds = %12
%105 = call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.13, i64 0, i64 0))
br label %106
106: ; preds = %104, %103, %100, %53, %37
br label %12
}

LLVM IR (-O2):
@.str = [20 x i8] c"Available commands:\00"
@.str.1 = [19 x i8] c" (c)lose database\00"
@.str.2 = [65 x i8] c" (s)how next record (there must be a following record for this)\00"
@.str.3 = [18 x i8] c" (a)ppend record\00"
@.str.4 = [32 x i8] c" (r)ewind back to first record\00"
@.str.5 = [3 x i8] c"db\00"
@.str.6 = [11 x i8] c"read entry\00"
@.str.7 = [4 x i8] c"EOF\00"
@.str.8 = [33 x i8] c"unable to skip to end of db file\00"
@.str.9 = [9 x i8] c"new data\00"
@.str.10 = [27 x i8] c"failed to append db record\00"
@.str.11 = [2 x i8] c"\0A\00"
@.str.12 = [30 x i8] c"failed to terminate db record\00"
@.str.13 = [16 x i8] c"unknown command\00"
define void @handle_database_commands(i32 %0) {
%2 = alloca [1000 x i8]
%3 = alloca [2 x i8]
%4 = alloca [1000 x i8]
%5 = alloca i8
%6 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [1000 x i8], [1000 x i8]* %4, i64 0, i64 0
%9 = ptrtoint [1000 x i8]* %4 to i64
br label %10
10: ; preds = %61, %1
%11 = phi i64 [ 16, %1 ], [ %62, %61 ]
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @.str.2, i64 0, i64 0))
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0))
%17 = call i32 @read_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %7)
%18 = load i8, i8* %7
%19 = sext i8 %18 to i32
switch i32 %19, label %59 [
i32 99, label %63
i32 115, label %20
i32 97, label %37
i32 114, label %61
]
20: ; preds = %10
%21 = call i32 @pread(i32 %0, i8* %8, i32 1000, i64 %11)
switch i32 %21, label %26 [
i32 -1, label %22
i32 0, label %24
]
22: ; preds = %20
%23 = call i32 @err(i32 1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
br label %26
24: ; preds = %20
%25 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
br label %61
26: ; preds = %22, %20
%27 = call i8* @memchr(i8* %8, i8 signext 10, i32 %21)
%28 = icmp eq i8* %27, null
%29 = getelementptr inbounds i8, i8* %27, i64 1
%30 = ptrtoint i8* %29 to i64
%31 = sub i64 %30, %9
%32 = trunc i64 %31 to i32
%33 = select i1 %28, i32 %21, i32 %32
%34 = sext i32 %33 to i64
%35 = add i64 %11, %34
%36 = call i32 @write(i32 1, i8* %8, i32 %33)
br label %61
37: ; preds = %10, %42
%38 = phi i64 [ %43, %42 ], [ %11, %10 ]
%39 = call i32 @pread(i32 %0, i8* %5, i32 1, i64 %38)
switch i32 %39, label %42 [
i32 0, label %44
i32 -1, label %40
]
40: ; preds = %37
%41 = call i32 @err(i32 1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.8, i64 0, i64 0))
br label %42
42: ; preds = %40, %37
%43 = add i64 %38, 1
br label %37
44: ; preds = %37
%45 = call i32 @read_string(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), i8* %6)
%46 = call i32 @pwrite(i32 %0, i8* %6, i32 %45, i64 %38)
%47 = icmp eq i32 %46, %45
br i1 %47, label %50, label %48
48: ; preds = %44
%49 = call i32 @err(i32 1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.10, i64 0, i64 0))
br label %50
50: ; preds = %48, %44
%51 = sext i32 %45 to i64
%52 = add i64 %38, %51
%53 = call i32 @pwrite(i32 %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0), i32 1, i64 %52)
%54 = icmp eq i32 %53, 1
br i1 %54, label %57, label %55
55: ; preds = %50
%56 = call i32 @err(i32 1, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.12, i64 0, i64 0))
br label %57
57: ; preds = %55, %50
%58 = add i64 %52, 1
br label %61
59: ; preds = %10
%60 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.13, i64 0, i64 0))
br label %61
61: ; preds = %24, %26, %57, %59, %10
%62 = phi i64 [ %11, %59 ], [ %58, %57 ], [ %11, %24 ], [ %35, %26 ], [ 16, %10 ]
br label %10
63: ; preds = %10
ret void
}