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

/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int errno;
int ioctl(int, int, int);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int read(int, unsigned char *, int);
int write(int, unsigned char *, int);
int main() {
  int fd, idx = 0, i = 0;
  int ret;
  int err_count = 0;
  int fd_array[2];
  int fd_init;
  unsigned char OV7725_initcode[200][2];
  unsigned char buff[100];
  int size_init = 0;
  if (0 > (fd_init = open("/home/ov7725_init", O_RDWR))) {
    printf("read ov7725 initial code\n");
    return 1;
  }
  while (2 == (read(fd_init, &OV7725_initcode[size_init][0], 2))) {
    ++size_init;
  }
  if (0 > (fd_array[0] = open("/dev/i2c-0", O_RDWR))) {
    printf("open i2c dev %s fail, error code=%d\n", "/dev/i2c-0", errno);
    return 1;
  }
  if (0 > (fd_array[1] = open("/dev/i2c-1", O_RDWR))) {
    printf("open i2c dev %s fail, error code=%d\n", "/dev/i2c-1", errno);
    return 1;
  }
  for (i = 0; i < 2; ++i) {
    ret = ioctl(fd_array[i], 0x0702, 1);
    ret = ioctl(fd_array[i], 0x0701, 1);
    ret = ioctl(fd_array[i], 0x0703, 0x21);
    for (idx = 0; idx < size_init; ++idx) {
      ret = write(fd_array[i], &OV7725_initcode[idx][0], 2);
      if (2 != ret) {
        printf("write data fail, set reg=0x%02X, set data=0x%02X\n",
               OV7725_initcode[idx][0], OV7725_initcode[idx][1]);
        ++err_count;
      }
    }
  }
  printf("sensor inital code transfer complete, %d  error\n", err_count);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x240,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x234(%rbp)
mov    0x2e60(%rip),%rax
mov    (%rax),%esi
lea    0xe6f(%rip),%rdi
call   1070 <open@plt>
mov    %eax,%ecx
mov    %ecx,-0x24(%rbp)
xor    %eax,%eax
cmp    %ecx,%eax
jle    11bf <main+0x6f>
lea    0xe66(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    13b5 <main+0x265>
jmp    11c4 <main+0x74>
mov    -0x24(%rbp),%edi
movslq -0x234(%rbp),%rax
lea    -0x1c0(%rbp),%rsi
shl    $0x1,%rax
add    %rax,%rsi
mov    $0x2,%edx
call   1060 <read@plt>
mov    %eax,%ecx
mov    $0x2,%eax
cmp    %ecx,%eax
jne    1209 <main+0xb9>
mov    -0x234(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x234(%rbp)
jmp    11c4 <main+0x74>
mov    0x2dd8(%rip),%rax
mov    (%rax),%esi
lea    0xe13(%rip),%rdi
call   1070 <open@plt>
mov    %eax,%ecx
mov    %ecx,-0x20(%rbp)
xor    %eax,%eax
cmp    %ecx,%eax
jle    1257 <main+0x107>
mov    0x2da4(%rip),%rax
mov    (%rax),%edx
lea    0xdfa(%rip),%rdi
lea    0xde8(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    13b5 <main+0x265>
mov    0x2d8a(%rip),%rax
mov    (%rax),%esi
lea    0xdf5(%rip),%rdi
call   1070 <open@plt>
mov    %eax,%ecx
mov    %ecx,-0x1c(%rbp)
xor    %eax,%eax
cmp    %ecx,%eax
jle    12a5 <main+0x155>
mov    0x2d56(%rip),%rax
mov    (%rax),%edx
lea    0xdac(%rip),%rdi
lea    0xdca(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    13b5 <main+0x265>
movl   $0x0,-0x10(%rbp)
cmpl   $0x2,-0x10(%rbp)
jge    13a4 <main+0x254>
movslq -0x10(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%edi
mov    $0x702,%esi
mov    $0x1,%edx
call   1050 <ioctl@plt>
mov    %eax,-0x14(%rbp)
movslq -0x10(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%edi
mov    $0x701,%esi
mov    $0x1,%edx
call   1050 <ioctl@plt>
mov    %eax,-0x14(%rbp)
movslq -0x10(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%edi
mov    $0x703,%esi
mov    $0x21,%edx
call   1050 <ioctl@plt>
mov    %eax,-0x14(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x234(%rbp),%eax
jge    1391 <main+0x241>
movslq -0x10(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%edi
movslq -0xc(%rbp),%rax
lea    -0x1c0(%rbp),%rsi
shl    $0x1,%rax
add    %rax,%rsi
mov    $0x2,%edx
call   1030 <write@plt>
mov    %eax,-0x14(%rbp)
mov    $0x2,%eax
cmp    -0x14(%rbp),%eax
je     137e <main+0x22e>
movslq -0xc(%rbp),%rax
movzbl -0x1c0(%rbp,%rax,2),%esi
ff
movslq -0xc(%rbp),%rax
movzbl -0x1bf(%rbp,%rax,2),%edx
ff
lea    0xcf9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1383 <main+0x233>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    130b <main+0x1bb>
jmp    1396 <main+0x246>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    12ac <main+0x15c>
mov    -0x18(%rbp),%esi
lea    0xceb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x240,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1a8,%rsp
mov    0x2e70(%rip),%r12
mov    (%r12),%esi
lea    0xe7d(%rip),%rdi
call   1080 <open@plt>
test   %eax,%eax
js     128f <main+0x12f>
mov    %eax,%r14d
mov    $0xffffffff,%ebx
lea    0x10(%rsp),%rbp
nopl   (%rax)
mov    %r14d,%edi
mov    %rbp,%rsi
mov    $0x2,%edx
call   1070 <read@plt>
add    $0x1,%ebx
add    $0x2,%rbp
cmp    $0x2,%eax
je     11a0 <main+0x40>
mov    (%r12),%esi
lea    0xe4b(%rip),%rdi
call   1080 <open@plt>
test   %eax,%eax
js     12a5 <main+0x145>
mov    %eax,%r15d
mov    (%r12),%esi
lea    0xe60(%rip),%rdi
call   1080 <open@plt>
test   %eax,%eax
js     12be <main+0x15e>
mov    %eax,0xc(%rsp)
mov    %r15d,%edi
mov    $0x702,%esi
mov    $0x1,%edx
call   1060 <ioctl@plt>
mov    %r15d,%edi
mov    $0x701,%esi
mov    $0x1,%edx
call   1060 <ioctl@plt>
mov    %r15d,%edi
mov    $0x703,%esi
mov    $0x21,%edx
call   1060 <ioctl@plt>
mov    %ebx,%r14d
test   %ebx,%ebx
je     12e6 <main+0x186>
lea    0x10(%rsp),%rbp
mov    %r14,%r12
xor    %r13d,%r13d
jmp    125e <main+0xfe>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x2,%rbp
add    $0xffffffffffffffff,%r12
je     12e9 <main+0x189>
mov    %r15d,%edi
mov    %rbp,%rsi
mov    $0x2,%edx
call   1040 <write@plt>
cmp    $0x2,%eax
je     1250 <main+0xf0>
movzbl 0x0(%rbp),%esi
movzbl 0x1(%rbp),%edx
lea    0xdcb(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%r13d
jmp    1250 <main+0xf0>
lea    0xe1a(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%ebx
jmp    1388 <main+0x228>
mov    0x2d2c(%rip),%rax
mov    (%rax),%edx
lea    0xd68(%rip),%rdi
lea    0xd56(%rip),%rsi
jmp    12d5 <main+0x175>
mov    0x2d13(%rip),%rax
mov    (%rax),%edx
lea    0xd4f(%rip),%rdi
lea    0xd6d(%rip),%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x1,%ebx
jmp    1388 <main+0x228>
xor    %r13d,%r13d
mov    0xc(%rsp),%ebp
mov    %ebp,%edi
mov    $0x702,%esi
mov    $0x1,%edx
call   1060 <ioctl@plt>
mov    %ebp,%edi
mov    $0x701,%esi
mov    $0x1,%edx
call   1060 <ioctl@plt>
mov    %ebp,%edi
mov    $0x703,%esi
mov    $0x21,%edx
call   1060 <ioctl@plt>
test   %ebx,%ebx
je     1375 <main+0x215>
lea    0x10(%rsp),%rbx
lea    0xd1d(%rip),%r15
jmp    134a <main+0x1ea>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x2,%rbx
add    $0xffffffffffffffff,%r14
je     1375 <main+0x215>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x2,%edx
call   1040 <write@plt>
cmp    $0x2,%eax
je     1340 <main+0x1e0>
movzbl (%rbx),%esi
movzbl 0x1(%rbx),%edx
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%r13d
jmp    1340 <main+0x1e0>
lea    0xd03(%rip),%rdi
xor    %ebx,%ebx
mov    %r13d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebx,%eax
add    $0x1a8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [18 x i8] c"/home/ov7725_init\00"
@O_RDWR = global i32 0
@.str.1 = [26 x i8] c"read ov7725 initial code\0A\00"
@.str.2 = [11 x i8] c"/dev/i2c-0\00"
@.str.3 = [37 x i8] c"open i2c dev %s fail, error code=%d\0A\00"
@errno = global i32 0
@.str.4 = [11 x i8] c"/dev/i2c-1\00"
@.str.5 = [50 x i8] c"write data fail, set reg=0x%02X, set data=0x%02X\0A\00"
@.str.6 = [49 x i8] c"sensor inital code transfer complete, %d error\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [2 x i32]
%8 = alloca i32
%9 = alloca [200 x [2 x i8]]
%10 = alloca [100 x i8]
%11 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %6
store i32 0, i32* %11
%12 = load i32, i32* @O_RDWR
%13 = call i32 @open(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %12)
store i32 %13, i32* %8
%14 = icmp sgt i32 0, %13
br i1 %14, label %15, label %17
15: ; preds = %0
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %1
br label %108
17: ; preds = %0
br label %18
18: ; preds = %26, %17
%19 = load i32, i32* %8
%20 = load i32, i32* %11
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [200 x [2 x i8]], [200 x [2 x i8]]* %9, i64 0, i64 %21
%23 = getelementptr inbounds [2 x i8], [2 x i8]* %22, i64 0, i64 0
%24 = call i32 @read(i32 %19, i8* %23, i32 2)
%25 = icmp eq i32 2, %24
br i1 %25, label %26, label %29
26: ; preds = %18
%27 = load i32, i32* %11
%28 = add nsw i32 %27, 1
store i32 %28, i32* %11
br label %18
29: ; preds = %18
%30 = load i32, i32* @O_RDWR
%31 = call i32 @open(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %30)
%32 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
store i32 %31, i32* %32
%33 = icmp sgt i32 0, %31
br i1 %33, label %34, label %37
34: ; preds = %29
%35 = load i32, i32* @errno
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %35)
store i32 1, i32* %1
br label %108
37: ; preds = %29
%38 = load i32, i32* @O_RDWR
%39 = call i32 @open(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 %38)
%40 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
store i32 %39, i32* %40
%41 = icmp sgt i32 0, %39
br i1 %41, label %42, label %45
42: ; preds = %37
%43 = load i32, i32* @errno
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 %43)
store i32 1, i32* %1
br label %108
45: ; preds = %37
store i32 0, i32* %4
br label %46
46: ; preds = %102, %45
%47 = load i32, i32* %4
%48 = icmp slt i32 %47, 2
br i1 %48, label %49, label %105
49: ; preds = %46
%50 = load i32, i32* %4
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 %51
%53 = load i32, i32* %52
%54 = call i32 @ioctl(i32 %53, i32 1794, i32 1)
store i32 %54, i32* %5
%55 = load i32, i32* %4
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 %56
%58 = load i32, i32* %57
%59 = call i32 @ioctl(i32 %58, i32 1793, i32 1)
store i32 %59, i32* %5
%60 = load i32, i32* %4
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 %61
%63 = load i32, i32* %62
%64 = call i32 @ioctl(i32 %63, i32 1795, i32 33)
store i32 %64, i32* %5
store i32 0, i32* %3
br label %65
65: ; preds = %98, %49
%66 = load i32, i32* %3
%67 = load i32, i32* %11
%68 = icmp slt i32 %66, %67
br i1 %68, label %69, label %101
69: ; preds = %65
%70 = load i32, i32* %4
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 %71
%73 = load i32, i32* %72
%74 = load i32, i32* %3
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds [200 x [2 x i8]], [200 x [2 x i8]]* %9, i64 0, i64 %75
%77 = getelementptr inbounds [2 x i8], [2 x i8]* %76, i64 0, i64 0
%78 = call i32 @write(i32 %73, i8* %77, i32 2)
store i32 %78, i32* %5
%79 = load i32, i32* %5
%80 = icmp ne i32 2, %79
br i1 %80, label %81, label %97
81: ; preds = %69
%82 = load i32, i32* %3
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds [200 x [2 x i8]], [200 x [2 x i8]]* %9, i64 0, i64 %83
%85 = getelementptr inbounds [2 x i8], [2 x i8]* %84, i64 0, i64 0
%86 = load i8, i8* %85
%87 = zext i8 %86 to i32
%88 = load i32, i32* %3
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds [200 x [2 x i8]], [200 x [2 x i8]]* %9, i64 0, i64 %89
%91 = getelementptr inbounds [2 x i8], [2 x i8]* %90, i64 0, i64 1
%92 = load i8, i8* %91
%93 = zext i8 %92 to i32
%94 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.5, i64 0, i64 0), i32 %87, i32 %93)
%95 = load i32, i32* %6
%96 = add nsw i32 %95, 1
store i32 %96, i32* %6
br label %97
97: ; preds = %81, %69
br label %98
98: ; preds = %97
%99 = load i32, i32* %3
%100 = add nsw i32 %99, 1
store i32 %100, i32* %3
br label %65
101: ; preds = %65
br label %102
102: ; preds = %101
%103 = load i32, i32* %4
%104 = add nsw i32 %103, 1
store i32 %104, i32* %4
br label %46
105: ; preds = %46
%106 = load i32, i32* %6
%107 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.6, i64 0, i64 0), i32 %106)
br label %108
108: ; preds = %105, %42, %34, %15
%109 = load i32, i32* %1
ret i32 %109
}

LLVM IR (-O2):
@.str = [18 x i8] c"/home/ov7725_init\00"
@O_RDWR = global i32 0
@.str.2 = [11 x i8] c"/dev/i2c-0\00"
@.str.3 = [37 x i8] c"open i2c dev %s fail, error code=%d\0A\00"
@errno = global i32 0
@.str.4 = [11 x i8] c"/dev/i2c-1\00"
@.str.5 = [50 x i8] c"write data fail, set reg=0x%02X, set data=0x%02X\0A\00"
@.str.6 = [49 x i8] c"sensor inital code transfer complete, %d error\0A\00"
@str = [25 x i8] c"read ov7725 initial code\00"
define i32 @main() {
%1 = alloca [200 x [2 x i8]]
%2 = getelementptr inbounds [200 x [2 x i8]], [200 x [2 x i8]]* %1, i64 0, i64 0, i64 0
%3 = load i32, i32* @O_RDWR
%4 = tail call i32 @open(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
br label %82
8: ; preds = %0, %8
%9 = phi i64 [ %13, %8 ], [ 0, %0 ]
%10 = getelementptr inbounds [200 x [2 x i8]], [200 x [2 x i8]]* %1, i64 0, i64 %9, i64 0
%11 = call i32 @read(i32 %4, i8* %10, i32 2)
%12 = icmp eq i32 %11, 2
%13 = add nuw i64 %9, 1
br i1 %12, label %8, label %14
14: ; preds = %8
%15 = trunc i64 %9 to i32
%16 = load i32, i32* @O_RDWR
%17 = tail call i32 @open(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %16)
%18 = icmp slt i32 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %14
%20 = load i32, i32* @errno
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %20)
br label %82
22: ; preds = %14
%23 = load i32, i32* @O_RDWR
%24 = tail call i32 @open(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 %23)
%25 = icmp slt i32 %24, 0
br i1 %25, label %31, label %26
26: ; preds = %22
%27 = icmp eq i32 %15, 0
%28 = tail call i32 @ioctl(i32 %17, i32 1794, i32 1)
%29 = tail call i32 @ioctl(i32 %17, i32 1793, i32 1)
%30 = tail call i32 @ioctl(i32 %17, i32 1795, i32 33)
br i1 %27, label %54, label %34
31: ; preds = %22
%32 = load i32, i32* @errno
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 %32)
br label %82
34: ; preds = %26
%35 = and i64 %9, 4294967295
br label %36
36: ; preds = %34, %50
%37 = phi i64 [ 0, %34 ], [ %52, %50 ]
%38 = phi i32 [ 0, %34 ], [ %51, %50 ]
%39 = getelementptr inbounds [200 x [2 x i8]], [200 x [2 x i8]]* %1, i64 0, i64 %37, i64 0
%40 = call i32 @write(i32 %17, i8* %39, i32 2)
%41 = icmp eq i32 %40, 2
br i1 %41, label %50, label %42
42: ; preds = %36
%43 = load i8, i8* %39
%44 = zext i8 %43 to i32
%45 = getelementptr inbounds [200 x [2 x i8]], [200 x [2 x i8]]* %1, i64 0, i64 %37, i64 1
%46 = load i8, i8* %45
%47 = zext i8 %46 to i32
%48 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.5, i64 0, i64 0), i32 %44, i32 %47)
%49 = add nsw i32 %38, 1
br label %50
50: ; preds = %36, %42
%51 = phi i32 [ %49, %42 ], [ %38, %36 ]
%52 = add nuw nsw i64 %37, 1
%53 = icmp eq i64 %52, %35
br i1 %53, label %54, label %36
54: ; preds = %50, %26
%55 = phi i32 [ 0, %26 ], [ %51, %50 ]
%56 = tail call i32 @ioctl(i32 %24, i32 1794, i32 1)
%57 = tail call i32 @ioctl(i32 %24, i32 1793, i32 1)
%58 = tail call i32 @ioctl(i32 %24, i32 1795, i32 33)
br i1 %27, label %79, label %59
59: ; preds = %54
%60 = and i64 %9, 4294967295
br label %61
61: ; preds = %75, %59
%62 = phi i64 [ 0, %59 ], [ %77, %75 ]
%63 = phi i32 [ %55, %59 ], [ %76, %75 ]
%64 = getelementptr inbounds [200 x [2 x i8]], [200 x [2 x i8]]* %1, i64 0, i64 %62, i64 0
%65 = call i32 @write(i32 %24, i8* %64, i32 2)
%66 = icmp eq i32 %65, 2
br i1 %66, label %75, label %67
67: ; preds = %61
%68 = load i8, i8* %64
%69 = zext i8 %68 to i32
%70 = getelementptr inbounds [200 x [2 x i8]], [200 x [2 x i8]]* %1, i64 0, i64 %62, i64 1
%71 = load i8, i8* %70
%72 = zext i8 %71 to i32
%73 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.5, i64 0, i64 0), i32 %69, i32 %72)
%74 = add nsw i32 %63, 1
br label %75
75: ; preds = %67, %61
%76 = phi i32 [ %74, %67 ], [ %63, %61 ]
%77 = add nuw nsw i64 %62, 1
%78 = icmp eq i64 %77, %60
br i1 %78, label %79, label %61
79: ; preds = %75, %54
%80 = phi i32 [ %55, %54 ], [ %76, %75 ]
%81 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.6, i64 0, i64 0), i32 %80)
br label %82
82: ; preds = %79, %31, %19, %6
%83 = phi i32 [ 1, %6 ], [ 1, %19 ], [ 1, %31 ], [ 0, %79 ]
ret i32 %83
}