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

/* Variables and functions */
int /*<<< orphan*/ exit(int);
scalar_t__ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
scalar_t__ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
void add() {
  int a[1536], b[1536], c[1536], i, cont = 0, choice;
  printf("Number of columns has a table?\x0a");
  scanf("%d", &choice);
  int aa = 0, bb = 0, cc = 0;
  a[0] = 0;
  b[0] = 0;
  c[0] = 0;
  for (i = 0; i < choice; ++i) {
    if (!(i % 8))
      aa = !aa;
    if (!(i % 4))
      bb = !bb;
    if (!(i % 2))
      cc = !cc;
    a[i] = aa ? 0 : 1;
    b[i] = bb ? 0 : 1;
    c[i] = cc ? 0 : 1;
  }
  printf(" \x0a  List Table with rows\x0a +---+---+---+-------+\x0a");
  printf(" | A | B | C |   S   |\x0a");
  printf(" +---+---+---+-------+\x0a");
  for (i = 0; i < choice; i++)
    printf(" | %i | %i | %i |       | \x0a", a[i], b[i], c[i]);
  printf(" +--------------------+\x0a");
  FILE *arq;
  arq = fopen("table.txt", "a");
  if (!arq)
    exit(1);
  fprintf(arq, " \x0a List Table with rows\x0a +---+---+---+-------+\x0a");
  fprintf(arq, " | A | B | C |   S   |\x0a");
  fprintf(arq, " +---+---+---+-------+\x0a");
  for (i = 0; i < choice; i++)
    fprintf(arq, " | %i | %i | %i |       | \x0a", a[i], b[i], c[i]);
  fprintf(arq, " +-------------------+\x0a") && fclose(arq);
}


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4830,%rsp
movl   $0x0,-0x4808(%rbp)
lea    0xe84(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe96(%rip),%rdi
lea    -0x480c(%rbp),%rsi
call   1060 <scanf@plt>
movl   $0x0,-0x4810(%rbp)
movl   $0x0,-0x4814(%rbp)
movl   $0x0,-0x4818(%rbp)
movl   $0x0,-0x1800(%rbp)
movl   $0x0,-0x3000(%rbp)
movl   $0x0,-0x4800(%rbp)
movl   $0x0,-0x4804(%rbp)
mov    -0x4804(%rbp),%eax
cmp    -0x480c(%rbp),%eax
jge    12ef <add+0x18f>
mov    -0x4804(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    121c <add+0xbc>
cmpl   $0x0,-0x4810(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4810(%rbp)
mov    -0x4804(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    124a <add+0xea>
cmpl   $0x0,-0x4814(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4814(%rbp)
mov    -0x4804(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1278 <add+0x118>
cmpl   $0x0,-0x4818(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4818(%rbp)
mov    -0x4810(%rbp),%edx
mov    $0x1,%ecx
xor    %eax,%eax
cmp    $0x0,%edx
cmovne %eax,%ecx
movslq -0x4804(%rbp),%rax
mov    %ecx,-0x1800(%rbp,%rax,4)
mov    -0x4814(%rbp),%edx
mov    $0x1,%ecx
xor    %eax,%eax
cmp    $0x0,%edx
cmovne %eax,%ecx
movslq -0x4804(%rbp),%rax
mov    %ecx,-0x3000(%rbp,%rax,4)
mov    -0x4818(%rbp),%edx
mov    $0x1,%ecx
xor    %eax,%eax
cmp    $0x0,%edx
cmovne %eax,%ecx
movslq -0x4804(%rbp),%rax
mov    %ecx,-0x4800(%rbp,%rax,4)
mov    -0x4804(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4804(%rbp)
jmp    11dc <add+0x7c>
lea    0xd2d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd50(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xdb3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4804(%rbp)
mov    -0x4804(%rbp),%eax
cmp    -0x480c(%rbp),%eax
jge    1381 <add+0x221>
movslq -0x4804(%rbp),%rax
mov    -0x1800(%rbp,%rax,4),%esi
movslq -0x4804(%rbp),%rax
mov    -0x3000(%rbp,%rax,4),%edx
movslq -0x4804(%rbp),%rax
mov    -0x4800(%rbp,%rax,4),%ecx
lea    0xd06(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4804(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4804(%rbp)
jmp    1323 <add+0x1c3>
lea    0xd00(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd0b(%rip),%rdi
lea    0xd0e(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x4820(%rbp)
cmpq   $0x0,-0x4820(%rbp)
jne    13c1 <add+0x261>
mov    $0x1,%edi
call   1080 <exit@plt>
mov    -0x4820(%rbp),%rdi
lea    0xcde(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x4820(%rbp),%rdi
lea    0xc70(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x4820(%rbp),%rdi
lea    0xccc(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
movl   $0x0,-0x4804(%rbp)
mov    -0x4804(%rbp),%eax
cmp    -0x480c(%rbp),%eax
jge    1470 <add+0x310>
mov    -0x4820(%rbp),%rdi
movslq -0x4804(%rbp),%rax
mov    -0x1800(%rbp,%rax,4),%edx
movslq -0x4804(%rbp),%rax
mov    -0x3000(%rbp,%rax,4),%ecx
movslq -0x4804(%rbp),%rax
mov    -0x4800(%rbp,%rax,4),%r8d
ff
lea    0xc17(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x4804(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4804(%rbp)
jmp    140a <add+0x2aa>
mov    -0x4820(%rbp),%rdi
lea    0xc5f(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x4821(%rbp)
je     14b3 <add+0x353>
mov    -0x4820(%rbp),%rdi
call   1030 <fclose@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x4821(%rbp)
mov    -0x4821(%rbp),%al
add    $0x4830,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
push   %r15
push   %r14
push   %rbx
sub    $0x4810,%rsp
lea    0xef8(%rip),%rdi
call   1030 <puts@plt>
lea    0xe61(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1070 <scanf@plt>
movl   $0x0,0x3010(%rsp)
movl   $0x0,0x1810(%rsp)
movl   $0x0,0x10(%rsp)
mov    0xc(%rsp),%eax
test   %eax,%eax
jle    1237 <add+0xb7>
xor    %ecx,%ecx
xor    %edx,%edx
xor    %esi,%esi
xor    %edi,%edi
nopw   0x0(%rax,%rax,1)
xor    %ebx,%ebx
test   %edi,%edi
sete   %bl
test   $0x7,%cl
cmove  %ebx,%edi
xor    %ebx,%ebx
test   %esi,%esi
sete   %bl
test   $0x3,%cl
cmove  %ebx,%esi
xor    %ebx,%ebx
test   %edx,%edx
sete   %bl
test   $0x1,%cl
cmove  %ebx,%edx
xor    %ebx,%ebx
test   %edi,%edi
sete   %bl
mov    %ebx,0x3010(%rsp,%rcx,4)
xor    %ebx,%ebx
test   %esi,%esi
sete   %bl
mov    %ebx,0x1810(%rsp,%rcx,4)
xor    %ebx,%ebx
test   %edx,%edx
sete   %bl
mov    %ebx,0x10(%rsp,%rcx,4)
add    $0x1,%rcx
cmp    %rcx,%rax
jne    11e0 <add+0x60>
lea    0xe6c(%rip),%rdi
call   1030 <puts@plt>
lea    0xe90(%rip),%rdi
call   1030 <puts@plt>
lea    0xe6d(%rip),%rdi
call   1030 <puts@plt>
cmpl   $0x0,0xc(%rsp)
jle    129a <add+0x11a>
lea    0xdb2(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    0x3010(%rsp,%rbx,4),%esi
mov    0x1810(%rsp,%rbx,4),%edx
mov    0x10(%rsp,%rbx,4),%ecx
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbx
movslq 0xc(%rsp),%rax
cmp    %rax,%rbx
jl     1270 <add+0xf0>
lea    0xe50(%rip),%rdi
call   1030 <puts@plt>
lea    0xd8a(%rip),%rdi
lea    0xd8d(%rip),%rsi
call   1080 <fopen@plt>
test   %rax,%rax
je     1379 <add+0x1f9>
mov    %rax,%r15
lea    0xd77(%rip),%rdi
mov    $0x2f,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   10a0 <fwrite@plt>
lea    0xd1e(%rip),%rdi
mov    $0x17,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   10a0 <fwrite@plt>
lea    0xd5d(%rip),%rdi
mov    $0x17,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   10a0 <fwrite@plt>
cmpl   $0x0,0xc(%rsp)
jle    134e <add+0x1ce>
lea    0xcfd(%rip),%r14
xor    %ebx,%ebx
mov    0x3010(%rsp,%rbx,4),%edx
mov    0x1810(%rsp,%rbx,4),%ecx
mov    0x10(%rsp,%rbx,4),%r8d
mov    %r15,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
add    $0x1,%rbx
movslq 0xc(%rsp),%rax
cmp    %rax,%rbx
jl     1320 <add+0x1a0>
lea    0xd1e(%rip),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <fprintf@plt>
test   %rax,%rax
je     136c <add+0x1ec>
mov    %r15,%rdi
call   1040 <fclose@plt>
add    $0x4810,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
mov    $0x1,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"Number of columns has a table?\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [49 x i8] c" \0A List Table with rows\0A +---+---+---+-------+\0A\00"
@.str.3 = [24 x i8] c" | A | B | C | S |\0A\00"
@.str.4 = [24 x i8] c" +---+---+---+-------+\0A\00"
@.str.5 = [28 x i8] c" | %i | %i | %i | | \0A\00"
@.str.6 = [25 x i8] c" +--------------------+\0A\00"
@.str.7 = [10 x i8] c"table.txt\00"
@.str.8 = [2 x i8] c"a\00"
@.str.9 = [48 x i8] c" \0A List Table with rows\0A +---+---+---+-------+\0A\00"
@.str.10 = [24 x i8] c" +-------------------+\0A\00"
define void @add() {
%1 = alloca [1536 x i32]
%2 = alloca [1536 x i32]
%3 = alloca [1536 x i32]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32*
store i32 0, i32* %5
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
%13 = getelementptr inbounds [1536 x i32], [1536 x i32]* %1, i64 0, i64 0
store i32 0, i32* %13
%14 = getelementptr inbounds [1536 x i32], [1536 x i32]* %2, i64 0, i64 0
store i32 0, i32* %14
%15 = getelementptr inbounds [1536 x i32], [1536 x i32]* %3, i64 0, i64 0
store i32 0, i32* %15
store i32 0, i32* %4
br label %16
16: ; preds = %69, %0
%17 = load i32, i32* %4
%18 = load i32, i32* %6
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %72
20: ; preds = %16
%21 = load i32, i32* %4
%22 = srem i32 %21, 8
%23 = icmp ne i32 %22, 0
br i1 %23, label %29, label %24
24: ; preds = %20
%25 = load i32, i32* %7
%26 = icmp ne i32 %25, 0
%27 = xor i1 %26, true
%28 = zext i1 %27 to i32
store i32 %28, i32* %7
br label %29
29: ; preds = %24, %20
%30 = load i32, i32* %4
%31 = srem i32 %30, 4
%32 = icmp ne i32 %31, 0
br i1 %32, label %38, label %33
33: ; preds = %29
%34 = load i32, i32* %8
%35 = icmp ne i32 %34, 0
%36 = xor i1 %35, true
%37 = zext i1 %36 to i32
store i32 %37, i32* %8
br label %38
38: ; preds = %33, %29
%39 = load i32, i32* %4
%40 = srem i32 %39, 2
%41 = icmp ne i32 %40, 0
br i1 %41, label %47, label %42
42: ; preds = %38
%43 = load i32, i32* %9
%44 = icmp ne i32 %43, 0
%45 = xor i1 %44, true
%46 = zext i1 %45 to i32
store i32 %46, i32* %9
br label %47
47: ; preds = %42, %38
%48 = load i32, i32* %7
%49 = icmp ne i32 %48, 0
%50 = zext i1 %49 to i64
%51 = select i1 %49, i32 0, i32 1
%52 = load i32, i32* %4
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds [1536 x i32], [1536 x i32]* %1, i64 0, i64 %53
store i32 %51, i32* %54
%55 = load i32, i32* %8
%56 = icmp ne i32 %55, 0
%57 = zext i1 %56 to i64
%58 = select i1 %56, i32 0, i32 1
%59 = load i32, i32* %4
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds [1536 x i32], [1536 x i32]* %2, i64 0, i64 %60
store i32 %58, i32* %61
%62 = load i32, i32* %9
%63 = icmp ne i32 %62, 0
%64 = zext i1 %63 to i64
%65 = select i1 %63, i32 0, i32 1
%66 = load i32, i32* %4
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds [1536 x i32], [1536 x i32]* %3, i64 0, i64 %67
store i32 %65, i32* %68
br label %69
69: ; preds = %47
%70 = load i32, i32* %4
%71 = add nsw i32 %70, 1
store i32 %71, i32* %4
br label %16
72: ; preds = %16
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0))
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %4
br label %76
76: ; preds = %94, %72
%77 = load i32, i32* %4
%78 = load i32, i32* %6
%79 = icmp slt i32 %77, %78
br i1 %79, label %80, label %97
80: ; preds = %76
%81 = load i32, i32* %4
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds [1536 x i32], [1536 x i32]* %1, i64 0, i64 %82
%84 = load i32, i32* %83
%85 = load i32, i32* %4
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds [1536 x i32], [1536 x i32]* %2, i64 0, i64 %86
%88 = load i32, i32* %87
%89 = load i32, i32* %4
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds [1536 x i32], [1536 x i32]* %3, i64 0, i64 %90
%92 = load i32, i32* %91
%93 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0), i32 %84, i32 %88, i32 %92)
br label %94
94: ; preds = %80
%95 = load i32, i32* %4
%96 = add nsw i32 %95, 1
store i32 %96, i32* %4
br label %76
97: ; preds = %76
%98 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0))
%99 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
store i32* %99, i32** %10
%100 = load i32*, i32** %10
%101 = icmp ne i32* %100, null
br i1 %101, label %104, label %102
102: ; preds = %97
%103 = call i32 @exit(i32 1)
unreachable
104: ; preds = %97
%105 = load i32*, i32** %10
%106 = call i64 (i32*, i8*, ...) @fprintf(i32* %105, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.9, i64 0, i64 0))
%107 = load i32*, i32** %10
%108 = call i64 (i32*, i8*, ...) @fprintf(i32* %107, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
%109 = load i32*, i32** %10
%110 = call i64 (i32*, i8*, ...) @fprintf(i32* %109, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %4
br label %111
111: ; preds = %130, %104
%112 = load i32, i32* %4
%113 = load i32, i32* %6
%114 = icmp slt i32 %112, %113
br i1 %114, label %115, label %133
115: ; preds = %111
%116 = load i32*, i32** %10
%117 = load i32, i32* %4
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds [1536 x i32], [1536 x i32]* %1, i64 0, i64 %118
%120 = load i32, i32* %119
%121 = load i32, i32* %4
%122 = sext i32 %121 to i64
%123 = getelementptr inbounds [1536 x i32], [1536 x i32]* %2, i64 0, i64 %122
%124 = load i32, i32* %123
%125 = load i32, i32* %4
%126 = sext i32 %125 to i64
%127 = getelementptr inbounds [1536 x i32], [1536 x i32]* %3, i64 0, i64 %126
%128 = load i32, i32* %127
%129 = call i64 (i32*, i8*, ...) @fprintf(i32* %116, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0), i32 %120, i32 %124, i32 %128)
br label %130
130: ; preds = %115
%131 = load i32, i32* %4
%132 = add nsw i32 %131, 1
store i32 %132, i32* %4
br label %111
133: ; preds = %111
%134 = load i32*, i32** %10
%135 = call i64 (i32*, i8*, ...) @fprintf(i32* %134, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.10, i64 0, i64 0))
%136 = icmp ne i64 %135, 0
br i1 %136, label %137, label %141
137: ; preds = %133
%138 = load i32*, i32** %10
%139 = call i64 @fclose(i32* %138)
%140 = icmp ne i64 %139, 0
br label %141
141: ; preds = %137, %133
%142 = phi i1 [ false, %133 ], [ %140, %137 ]
%143 = zext i1 %142 to i32
ret void
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.3 = [24 x i8] c" | A | B | C | S |\0A\00"
@.str.4 = [24 x i8] c" +---+---+---+-------+\0A\00"
@.str.5 = [28 x i8] c" | %i | %i | %i | | \0A\00"
@.str.7 = [10 x i8] c"table.txt\00"
@.str.8 = [2 x i8] c"a\00"
@.str.9 = [48 x i8] c" \0A List Table with rows\0A +---+---+---+-------+\0A\00"
@.str.10 = [24 x i8] c" +-------------------+\0A\00"
@str = [31 x i8] c"Number of columns has a table?\00"
@str.11 = [48 x i8] c" \0A List Table with rows\0A +---+---+---+-------+\00"
@str.12 = [23 x i8] c" | A | B | C | S |\00"
@str.13 = [23 x i8] c" +---+---+---+-------+\00"
@str.14 = [24 x i8] c" +--------------------+\00"
define void @add() {
%1 = alloca [1536 x i32]
%2 = alloca [1536 x i32]
%3 = alloca [1536 x i32]
%4 = alloca i32
%5 = bitcast [1536 x i32]* %1 to i8*
%6 = bitcast [1536 x i32]* %2 to i8*
%7 = bitcast [1536 x i32]* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%11 = getelementptr inbounds [1536 x i32], [1536 x i32]* %1, i64 0, i64 0
store i32 0, i32* %11
%12 = getelementptr inbounds [1536 x i32], [1536 x i32]* %2, i64 0, i64 0
store i32 0, i32* %12
%13 = getelementptr inbounds [1536 x i32], [1536 x i32]* %3, i64 0, i64 0
store i32 0, i32* %13
%14 = load i32, i32* %4
%15 = icmp sgt i32 %14, 0
br i1 %15, label %16, label %50
16: ; preds = %0
%17 = zext i32 %14 to i64
br label %18
18: ; preds = %16, %18
%19 = phi i64 [ 0, %16 ], [ %48, %18 ]
%20 = phi i32 [ 0, %16 ], [ %38, %18 ]
%21 = phi i32 [ 0, %16 ], [ %33, %18 ]
%22 = phi i32 [ 0, %16 ], [ %28, %18 ]
%23 = trunc i64 %19 to i32
%24 = and i32 %23, 7
%25 = icmp eq i32 %24, 0
%26 = icmp eq i32 %22, 0
%27 = zext i1 %26 to i32
%28 = select i1 %25, i32 %27, i32 %22
%29 = and i32 %23, 3
%30 = icmp eq i32 %29, 0
%31 = icmp eq i32 %21, 0
%32 = zext i1 %31 to i32
%33 = select i1 %30, i32 %32, i32 %21
%34 = and i32 %23, 1
%35 = icmp eq i32 %34, 0
%36 = icmp eq i32 %20, 0
%37 = zext i1 %36 to i32
%38 = select i1 %35, i32 %37, i32 %20
%39 = icmp eq i32 %28, 0
%40 = zext i1 %39 to i32
%41 = getelementptr inbounds [1536 x i32], [1536 x i32]* %1, i64 0, i64 %19
store i32 %40, i32* %41
%42 = icmp eq i32 %33, 0
%43 = zext i1 %42 to i32
%44 = getelementptr inbounds [1536 x i32], [1536 x i32]* %2, i64 0, i64 %19
store i32 %43, i32* %44
%45 = icmp eq i32 %38, 0
%46 = zext i1 %45 to i32
%47 = getelementptr inbounds [1536 x i32], [1536 x i32]* %3, i64 0, i64 %19
store i32 %46, i32* %47
%48 = add nuw nsw i64 %19, 1
%49 = icmp eq i64 %48, %17
br i1 %49, label %50, label %18
50: ; preds = %18, %0
%51 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.11, i64 0, i64 0))
%52 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.12, i64 0, i64 0))
%53 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.13, i64 0, i64 0))
%54 = load i32, i32* %4
%55 = icmp sgt i32 %54, 0
br i1 %55, label %56, label %69
56: ; preds = %50, %56
%57 = phi i64 [ %65, %56 ], [ 0, %50 ]
%58 = getelementptr inbounds [1536 x i32], [1536 x i32]* %1, i64 0, i64 %57
%59 = load i32, i32* %58
%60 = getelementptr inbounds [1536 x i32], [1536 x i32]* %2, i64 0, i64 %57
%61 = load i32, i32* %60
%62 = getelementptr inbounds [1536 x i32], [1536 x i32]* %3, i64 0, i64 %57
%63 = load i32, i32* %62
%64 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0), i32 %59, i32 %61, i32 %63)
%65 = add nuw nsw i64 %57, 1
%66 = load i32, i32* %4
%67 = sext i32 %66 to i64
%68 = icmp slt i64 %65, %67
br i1 %68, label %56, label %69
69: ; preds = %56, %50
%70 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.14, i64 0, i64 0))
%71 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%72 = icmp eq i32* %71, null
br i1 %72, label %73, label %75
73: ; preds = %69
%74 = call i32 @exit(i32 1)
unreachable
75: ; preds = %69
%76 = call i64 @fwrite(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.9, i64 0, i64 0), i64 47, i64 1, i32* %71)
%77 = call i64 @fwrite(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i64 23, i64 1, i32* %71)
%78 = call i64 @fwrite(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i64 23, i64 1, i32* %71)
%79 = load i32, i32* %4
%80 = icmp sgt i32 %79, 0
br i1 %80, label %81, label %94
81: ; preds = %75, %81
%82 = phi i64 [ %90, %81 ], [ 0, %75 ]
%83 = getelementptr inbounds [1536 x i32], [1536 x i32]* %1, i64 0, i64 %82
%84 = load i32, i32* %83
%85 = getelementptr inbounds [1536 x i32], [1536 x i32]* %2, i64 0, i64 %82
%86 = load i32, i32* %85
%87 = getelementptr inbounds [1536 x i32], [1536 x i32]* %3, i64 0, i64 %82
%88 = load i32, i32* %87
%89 = call i64 (i32*, i8*, ...) @fprintf(i32* %71, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0), i32 %84, i32 %86, i32 %88)
%90 = add nuw nsw i64 %82, 1
%91 = load i32, i32* %4
%92 = sext i32 %91 to i64
%93 = icmp slt i64 %90, %92
br i1 %93, label %81, label %94
94: ; preds = %81, %75
%95 = call i64 (i32*, i8*, ...) @fprintf(i32* %71, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.10, i64 0, i64 0))
%96 = icmp eq i64 %95, 0
br i1 %96, label %99, label %97
97: ; preds = %94
%98 = call i64 @fclose(i32* %71)
br label %99
99: ; preds = %97, %94
ret void
}