#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*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int, int);
int main() {
  FILE *fp;
  int y, xt, color;
  fp = fopen("TESTIMGS.IMG", "w");
  for (xt = 0; xt < 8; xt++) {
    for (y = 0; y < 1024; y++)
      fprintf(fp, "%c%c", 0x00, 0xF8);
    for (y = 0; y < 1024; y++)
      fprintf(fp, "%c%c", 0xFF, 0xFF);
    for (y = 0; y < 1024; y++)
      fprintf(fp, "%c%c", 0x1F, 0x00);
    for (y = 0; y < 1024; y++)
      fprintf(fp, "%c%c", 0xE0, 0x07);
    for (y = 0; y < 1024; y++)
      fprintf(fp, "%c%c", 0x0F, 0x00);
    for (y = 0; y < 1024; y++)
      fprintf(fp, "%c%c", 0xE0, 0x7B);
    for (y = 0; y < 1024; y++)
      fprintf(fp, "%c%c", 0xE5, 0xAF);
    for (y = 0; y < 1024; y++)
      fprintf(fp, "%c%c", 0x20, 0xFD);
    for (y = 0; y < 1024; y++)
      fprintf(fp, "%c%c", 0x0F, 0x3E);
    for (y = 0; y < 1024; y++)
      fprintf(fp, "%c%c", 0xF1, 0xF8);
    for (y = 0; y < 1024; y++)
      fprintf(fp, "%c%c", 0x00, 0x00);
    for (y = 0; y < 1024; y++)
      fprintf(fp, "%c%c", 0x0F, 0x78);
    for (y = 0; y < 1024; y++)
      fprintf(fp, "%c%c", 0xAA, 0x55);
    for (y = 0; y < 1024; y++)
      fprintf(fp, "%c%c", 0x55, 0xAA);
    for (y = 0; y < 1024; y++)
      fprintf(fp, "%c%c", 0xA5, 0x5A);
    for (y = 0; y < 1024; y++)
      fprintf(fp, "%c%c", 0x5A, 0xA5);
    for (y = 0; y < 1024; y++)
      fprintf(fp, "%c%c", 0xA5, 0xA5);
    for (y = 0; y < 1024; y++)
      fprintf(fp, "%c%c", 0x5A, 0x5A);
  }
  fclose(fp);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    0xec0(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x8,-0x18(%rbp)
jge    159a <main+0x46a>
movl   $0x0,-0x14(%rbp)
cmpl   $0x400,-0x14(%rbp)
jge    11a0 <main+0x70>
mov    -0x10(%rbp),%rdi
lea    0xe89(%rip),%rsi
xor    %edx,%edx
mov    $0xf8,%ecx
call   1040 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    116e <main+0x3e>
movl   $0x0,-0x14(%rbp)
cmpl   $0x400,-0x14(%rbp)
jge    11d9 <main+0xa9>
mov    -0x10(%rbp),%rdi
lea    0xe50(%rip),%rsi
mov    $0xff,%ecx
mov    %ecx,%edx
call   1040 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11a7 <main+0x77>
movl   $0x0,-0x14(%rbp)
cmpl   $0x400,-0x14(%rbp)
jge    1212 <main+0xe2>
mov    -0x10(%rbp),%rdi
lea    0xe17(%rip),%rsi
mov    $0x1f,%edx
xor    %ecx,%ecx
call   1040 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11e0 <main+0xb0>
movl   $0x0,-0x14(%rbp)
cmpl   $0x400,-0x14(%rbp)
jge    124e <main+0x11e>
mov    -0x10(%rbp),%rdi
lea    0xdde(%rip),%rsi
mov    $0xe0,%edx
mov    $0x7,%ecx
call   1040 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1219 <main+0xe9>
movl   $0x0,-0x14(%rbp)
cmpl   $0x400,-0x14(%rbp)
jge    1287 <main+0x157>
mov    -0x10(%rbp),%rdi
lea    0xda2(%rip),%rsi
mov    $0xf,%edx
xor    %ecx,%ecx
call   1040 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1255 <main+0x125>
movl   $0x0,-0x14(%rbp)
cmpl   $0x400,-0x14(%rbp)
jge    12c3 <main+0x193>
mov    -0x10(%rbp),%rdi
lea    0xd69(%rip),%rsi
mov    $0xe0,%edx
mov    $0x7b,%ecx
call   1040 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    128e <main+0x15e>
movl   $0x0,-0x14(%rbp)
cmpl   $0x400,-0x14(%rbp)
jge    12ff <main+0x1cf>
mov    -0x10(%rbp),%rdi
lea    0xd2d(%rip),%rsi
mov    $0xe5,%edx
mov    $0xaf,%ecx
call   1040 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    12ca <main+0x19a>
movl   $0x0,-0x14(%rbp)
cmpl   $0x400,-0x14(%rbp)
jge    133b <main+0x20b>
mov    -0x10(%rbp),%rdi
lea    0xcf1(%rip),%rsi
mov    $0x20,%edx
mov    $0xfd,%ecx
call   1040 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1306 <main+0x1d6>
movl   $0x0,-0x14(%rbp)
cmpl   $0x400,-0x14(%rbp)
jge    1377 <main+0x247>
mov    -0x10(%rbp),%rdi
lea    0xcb5(%rip),%rsi
mov    $0xf,%edx
mov    $0x3e,%ecx
call   1040 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1342 <main+0x212>
movl   $0x0,-0x14(%rbp)
cmpl   $0x400,-0x14(%rbp)
jge    13b3 <main+0x283>
mov    -0x10(%rbp),%rdi
lea    0xc79(%rip),%rsi
mov    $0xf1,%edx
mov    $0xf8,%ecx
call   1040 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    137e <main+0x24e>
movl   $0x0,-0x14(%rbp)
cmpl   $0x400,-0x14(%rbp)
jge    13e9 <main+0x2b9>
mov    -0x10(%rbp),%rdi
lea    0xc3d(%rip),%rsi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1040 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    13ba <main+0x28a>
movl   $0x0,-0x14(%rbp)
cmpl   $0x400,-0x14(%rbp)
jge    1425 <main+0x2f5>
mov    -0x10(%rbp),%rdi
lea    0xc07(%rip),%rsi
mov    $0xf,%edx
mov    $0x78,%ecx
call   1040 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    13f0 <main+0x2c0>
movl   $0x0,-0x14(%rbp)
cmpl   $0x400,-0x14(%rbp)
jge    1461 <main+0x331>
mov    -0x10(%rbp),%rdi
lea    0xbcb(%rip),%rsi
mov    $0xaa,%edx
mov    $0x55,%ecx
call   1040 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    142c <main+0x2fc>
movl   $0x0,-0x14(%rbp)
cmpl   $0x400,-0x14(%rbp)
jge    149d <main+0x36d>
mov    -0x10(%rbp),%rdi
lea    0xb8f(%rip),%rsi
mov    $0x55,%edx
mov    $0xaa,%ecx
call   1040 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1468 <main+0x338>
movl   $0x0,-0x14(%rbp)
cmpl   $0x400,-0x14(%rbp)
jge    14d9 <main+0x3a9>
mov    -0x10(%rbp),%rdi
lea    0xb53(%rip),%rsi
mov    $0xa5,%edx
mov    $0x5a,%ecx
call   1040 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    14a4 <main+0x374>
movl   $0x0,-0x14(%rbp)
cmpl   $0x400,-0x14(%rbp)
jge    1515 <main+0x3e5>
mov    -0x10(%rbp),%rdi
lea    0xb17(%rip),%rsi
mov    $0x5a,%edx
mov    $0xa5,%ecx
call   1040 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    14e0 <main+0x3b0>
movl   $0x0,-0x14(%rbp)
cmpl   $0x400,-0x14(%rbp)
jge    154e <main+0x41e>
mov    -0x10(%rbp),%rdi
lea    0xadb(%rip),%rsi
mov    $0xa5,%ecx
mov    %ecx,%edx
call   1040 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    151c <main+0x3ec>
movl   $0x0,-0x14(%rbp)
cmpl   $0x400,-0x14(%rbp)
jge    1587 <main+0x457>
mov    -0x10(%rbp),%rdi
lea    0xaa2(%rip),%rsi
mov    $0x5a,%ecx
mov    %ecx,%edx
call   1040 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1555 <main+0x425>
jmp    158c <main+0x45c>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    115d <main+0x2d>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xec2(%rip),%rdi
lea    0xec8(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
xor    %r15d,%r15d
lea    0xeb8(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    $0x400,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %edx,%edx
mov    $0xf8,%ecx
call   1040 <fprintf@plt>
add    $0xffffffff,%ebp
jne    1170 <main+0x40>
mov    $0x400,%ebp
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xff,%edx
mov    $0xff,%ecx
call   1040 <fprintf@plt>
add    $0xffffffff,%ebp
jne    1190 <main+0x60>
mov    $0x400,%ebp
nop
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x1f,%edx
xor    %ecx,%ecx
call   1040 <fprintf@plt>
add    $0xffffffff,%ebp
jne    11b0 <main+0x80>
mov    $0x400,%ebp
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xe0,%edx
mov    $0x7,%ecx
call   1040 <fprintf@plt>
add    $0xffffffff,%ebp
jne    11d0 <main+0xa0>
mov    $0x400,%ebp
nop
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xf,%edx
xor    %ecx,%ecx
call   1040 <fprintf@plt>
add    $0xffffffff,%ebp
jne    11f0 <main+0xc0>
mov    $0x400,%ebp
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xe0,%edx
mov    $0x7b,%ecx
call   1040 <fprintf@plt>
add    $0xffffffff,%ebp
jne    1210 <main+0xe0>
mov    $0x400,%ebp
nop
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xe5,%edx
mov    $0xaf,%ecx
call   1040 <fprintf@plt>
add    $0xffffffff,%ebp
jne    1230 <main+0x100>
mov    $0x400,%ebp
nop
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x20,%edx
mov    $0xfd,%ecx
call   1040 <fprintf@plt>
add    $0xffffffff,%ebp
jne    1250 <main+0x120>
mov    $0x400,%ebp
nop
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xf,%edx
mov    $0x3e,%ecx
call   1040 <fprintf@plt>
add    $0xffffffff,%ebp
jne    1270 <main+0x140>
mov    $0x400,%ebp
nop
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xf1,%edx
mov    $0xf8,%ecx
call   1040 <fprintf@plt>
add    $0xffffffff,%ebp
jne    1290 <main+0x160>
mov    $0x400,%ebp
nop
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
call   1040 <fprintf@plt>
add    $0xffffffff,%ebp
jne    12b0 <main+0x180>
mov    $0x400,%ebp
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xf,%edx
mov    $0x78,%ecx
call   1040 <fprintf@plt>
add    $0xffffffff,%ebp
jne    12d0 <main+0x1a0>
mov    $0x400,%ebp
nop
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xaa,%edx
mov    $0x55,%ecx
call   1040 <fprintf@plt>
add    $0xffffffff,%ebp
jne    12f0 <main+0x1c0>
mov    $0x400,%ebp
nop
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x55,%edx
mov    $0xaa,%ecx
call   1040 <fprintf@plt>
add    $0xffffffff,%ebp
jne    1310 <main+0x1e0>
mov    $0x400,%ebp
nop
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xa5,%edx
mov    $0x5a,%ecx
call   1040 <fprintf@plt>
add    $0xffffffff,%ebp
jne    1330 <main+0x200>
mov    $0x400,%ebp
nop
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x5a,%edx
mov    $0xa5,%ecx
call   1040 <fprintf@plt>
add    $0xffffffff,%ebp
jne    1350 <main+0x220>
mov    $0x400,%ebp
nop
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xa5,%edx
mov    $0xa5,%ecx
call   1040 <fprintf@plt>
add    $0xffffffff,%ebp
jne    1370 <main+0x240>
mov    $0x400,%ebp
nop
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x5a,%edx
mov    $0x5a,%ecx
call   1040 <fprintf@plt>
add    $0xffffffff,%ebp
jne    1390 <main+0x260>
add    $0x1,%r15d
cmp    $0x8,%r15d
jne    1160 <main+0x30>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"TESTIMGS.IMG\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [5 x i8] c"%c%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %6, i32** %2
store i32 0, i32* %4
br label %7
7: ; preds = %191, %0
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 8
br i1 %9, label %10, label %194
10: ; preds = %7
store i32 0, i32* %3
br label %11
11: ; preds = %17, %10
%12 = load i32, i32* %3
%13 = icmp slt i32 %12, 1024
br i1 %13, label %14, label %20
14: ; preds = %11
%15 = load i32*, i32** %2
%16 = call i32 @fprintf(i32* %15, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 0, i32 248)
br label %17
17: ; preds = %14
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %11
20: ; preds = %11
store i32 0, i32* %3
br label %21
21: ; preds = %27, %20
%22 = load i32, i32* %3
%23 = icmp slt i32 %22, 1024
br i1 %23, label %24, label %30
24: ; preds = %21
%25 = load i32*, i32** %2
%26 = call i32 @fprintf(i32* %25, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 255, i32 255)
br label %27
27: ; preds = %24
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 1
store i32 %29, i32* %3
br label %21
30: ; preds = %21
store i32 0, i32* %3
br label %31
31: ; preds = %37, %30
%32 = load i32, i32* %3
%33 = icmp slt i32 %32, 1024
br i1 %33, label %34, label %40
34: ; preds = %31
%35 = load i32*, i32** %2
%36 = call i32 @fprintf(i32* %35, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 31, i32 0)
br label %37
37: ; preds = %34
%38 = load i32, i32* %3
%39 = add nsw i32 %38, 1
store i32 %39, i32* %3
br label %31
40: ; preds = %31
store i32 0, i32* %3
br label %41
41: ; preds = %47, %40
%42 = load i32, i32* %3
%43 = icmp slt i32 %42, 1024
br i1 %43, label %44, label %50
44: ; preds = %41
%45 = load i32*, i32** %2
%46 = call i32 @fprintf(i32* %45, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 224, i32 7)
br label %47
47: ; preds = %44
%48 = load i32, i32* %3
%49 = add nsw i32 %48, 1
store i32 %49, i32* %3
br label %41
50: ; preds = %41
store i32 0, i32* %3
br label %51
51: ; preds = %57, %50
%52 = load i32, i32* %3
%53 = icmp slt i32 %52, 1024
br i1 %53, label %54, label %60
54: ; preds = %51
%55 = load i32*, i32** %2
%56 = call i32 @fprintf(i32* %55, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 15, i32 0)
br label %57
57: ; preds = %54
%58 = load i32, i32* %3
%59 = add nsw i32 %58, 1
store i32 %59, i32* %3
br label %51
60: ; preds = %51
store i32 0, i32* %3
br label %61
61: ; preds = %67, %60
%62 = load i32, i32* %3
%63 = icmp slt i32 %62, 1024
br i1 %63, label %64, label %70
64: ; preds = %61
%65 = load i32*, i32** %2
%66 = call i32 @fprintf(i32* %65, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 224, i32 123)
br label %67
67: ; preds = %64
%68 = load i32, i32* %3
%69 = add nsw i32 %68, 1
store i32 %69, i32* %3
br label %61
70: ; preds = %61
store i32 0, i32* %3
br label %71
71: ; preds = %77, %70
%72 = load i32, i32* %3
%73 = icmp slt i32 %72, 1024
br i1 %73, label %74, label %80
74: ; preds = %71
%75 = load i32*, i32** %2
%76 = call i32 @fprintf(i32* %75, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 229, i32 175)
br label %77
77: ; preds = %74
%78 = load i32, i32* %3
%79 = add nsw i32 %78, 1
store i32 %79, i32* %3
br label %71
80: ; preds = %71
store i32 0, i32* %3
br label %81
81: ; preds = %87, %80
%82 = load i32, i32* %3
%83 = icmp slt i32 %82, 1024
br i1 %83, label %84, label %90
84: ; preds = %81
%85 = load i32*, i32** %2
%86 = call i32 @fprintf(i32* %85, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 32, i32 253)
br label %87
87: ; preds = %84
%88 = load i32, i32* %3
%89 = add nsw i32 %88, 1
store i32 %89, i32* %3
br label %81
90: ; preds = %81
store i32 0, i32* %3
br label %91
91: ; preds = %97, %90
%92 = load i32, i32* %3
%93 = icmp slt i32 %92, 1024
br i1 %93, label %94, label %100
94: ; preds = %91
%95 = load i32*, i32** %2
%96 = call i32 @fprintf(i32* %95, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 15, i32 62)
br label %97
97: ; preds = %94
%98 = load i32, i32* %3
%99 = add nsw i32 %98, 1
store i32 %99, i32* %3
br label %91
100: ; preds = %91
store i32 0, i32* %3
br label %101
101: ; preds = %107, %100
%102 = load i32, i32* %3
%103 = icmp slt i32 %102, 1024
br i1 %103, label %104, label %110
104: ; preds = %101
%105 = load i32*, i32** %2
%106 = call i32 @fprintf(i32* %105, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 241, i32 248)
br label %107
107: ; preds = %104
%108 = load i32, i32* %3
%109 = add nsw i32 %108, 1
store i32 %109, i32* %3
br label %101
110: ; preds = %101
store i32 0, i32* %3
br label %111
111: ; preds = %117, %110
%112 = load i32, i32* %3
%113 = icmp slt i32 %112, 1024
br i1 %113, label %114, label %120
114: ; preds = %111
%115 = load i32*, i32** %2
%116 = call i32 @fprintf(i32* %115, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 0, i32 0)
br label %117
117: ; preds = %114
%118 = load i32, i32* %3
%119 = add nsw i32 %118, 1
store i32 %119, i32* %3
br label %111
120: ; preds = %111
store i32 0, i32* %3
br label %121
121: ; preds = %127, %120
%122 = load i32, i32* %3
%123 = icmp slt i32 %122, 1024
br i1 %123, label %124, label %130
124: ; preds = %121
%125 = load i32*, i32** %2
%126 = call i32 @fprintf(i32* %125, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 15, i32 120)
br label %127
127: ; preds = %124
%128 = load i32, i32* %3
%129 = add nsw i32 %128, 1
store i32 %129, i32* %3
br label %121
130: ; preds = %121
store i32 0, i32* %3
br label %131
131: ; preds = %137, %130
%132 = load i32, i32* %3
%133 = icmp slt i32 %132, 1024
br i1 %133, label %134, label %140
134: ; preds = %131
%135 = load i32*, i32** %2
%136 = call i32 @fprintf(i32* %135, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 170, i32 85)
br label %137
137: ; preds = %134
%138 = load i32, i32* %3
%139 = add nsw i32 %138, 1
store i32 %139, i32* %3
br label %131
140: ; preds = %131
store i32 0, i32* %3
br label %141
141: ; preds = %147, %140
%142 = load i32, i32* %3
%143 = icmp slt i32 %142, 1024
br i1 %143, label %144, label %150
144: ; preds = %141
%145 = load i32*, i32** %2
%146 = call i32 @fprintf(i32* %145, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 85, i32 170)
br label %147
147: ; preds = %144
%148 = load i32, i32* %3
%149 = add nsw i32 %148, 1
store i32 %149, i32* %3
br label %141
150: ; preds = %141
store i32 0, i32* %3
br label %151
151: ; preds = %157, %150
%152 = load i32, i32* %3
%153 = icmp slt i32 %152, 1024
br i1 %153, label %154, label %160
154: ; preds = %151
%155 = load i32*, i32** %2
%156 = call i32 @fprintf(i32* %155, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 165, i32 90)
br label %157
157: ; preds = %154
%158 = load i32, i32* %3
%159 = add nsw i32 %158, 1
store i32 %159, i32* %3
br label %151
160: ; preds = %151
store i32 0, i32* %3
br label %161
161: ; preds = %167, %160
%162 = load i32, i32* %3
%163 = icmp slt i32 %162, 1024
br i1 %163, label %164, label %170
164: ; preds = %161
%165 = load i32*, i32** %2
%166 = call i32 @fprintf(i32* %165, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 90, i32 165)
br label %167
167: ; preds = %164
%168 = load i32, i32* %3
%169 = add nsw i32 %168, 1
store i32 %169, i32* %3
br label %161
170: ; preds = %161
store i32 0, i32* %3
br label %171
171: ; preds = %177, %170
%172 = load i32, i32* %3
%173 = icmp slt i32 %172, 1024
br i1 %173, label %174, label %180
174: ; preds = %171
%175 = load i32*, i32** %2
%176 = call i32 @fprintf(i32* %175, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 165, i32 165)
br label %177
177: ; preds = %174
%178 = load i32, i32* %3
%179 = add nsw i32 %178, 1
store i32 %179, i32* %3
br label %171
180: ; preds = %171
store i32 0, i32* %3
br label %181
181: ; preds = %187, %180
%182 = load i32, i32* %3
%183 = icmp slt i32 %182, 1024
br i1 %183, label %184, label %190
184: ; preds = %181
%185 = load i32*, i32** %2
%186 = call i32 @fprintf(i32* %185, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 90, i32 90)
br label %187
187: ; preds = %184
%188 = load i32, i32* %3
%189 = add nsw i32 %188, 1
store i32 %189, i32* %3
br label %181
190: ; preds = %181
br label %191
191: ; preds = %190
%192 = load i32, i32* %4
%193 = add nsw i32 %192, 1
store i32 %193, i32* %4
br label %7
194: ; preds = %7
%195 = load i32*, i32** %2
%196 = call i32 @fclose(i32* %195)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"TESTIMGS.IMG\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [5 x i8] c"%c%c\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %2
2: ; preds = %0, %94
%3 = phi i32 [ 0, %0 ], [ %95, %94 ]
br label %4
4: ; preds = %2, %4
%5 = phi i32 [ 0, %2 ], [ %7, %4 ]
%6 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 0, i32 248)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, 1024
br i1 %8, label %9, label %4
9: ; preds = %4, %9
%10 = phi i32 [ %12, %9 ], [ 0, %4 ]
%11 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 255, i32 255)
%12 = add nuw nsw i32 %10, 1
%13 = icmp eq i32 %12, 1024
br i1 %13, label %14, label %9
14: ; preds = %9, %14
%15 = phi i32 [ %17, %14 ], [ 0, %9 ]
%16 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 31, i32 0)
%17 = add nuw nsw i32 %15, 1
%18 = icmp eq i32 %17, 1024
br i1 %18, label %19, label %14
19: ; preds = %14, %19
%20 = phi i32 [ %22, %19 ], [ 0, %14 ]
%21 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 224, i32 7)
%22 = add nuw nsw i32 %20, 1
%23 = icmp eq i32 %22, 1024
br i1 %23, label %24, label %19
24: ; preds = %19, %24
%25 = phi i32 [ %27, %24 ], [ 0, %19 ]
%26 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 15, i32 0)
%27 = add nuw nsw i32 %25, 1
%28 = icmp eq i32 %27, 1024
br i1 %28, label %29, label %24
29: ; preds = %24, %29
%30 = phi i32 [ %32, %29 ], [ 0, %24 ]
%31 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 224, i32 123)
%32 = add nuw nsw i32 %30, 1
%33 = icmp eq i32 %32, 1024
br i1 %33, label %34, label %29
34: ; preds = %29, %34
%35 = phi i32 [ %37, %34 ], [ 0, %29 ]
%36 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 229, i32 175)
%37 = add nuw nsw i32 %35, 1
%38 = icmp eq i32 %37, 1024
br i1 %38, label %39, label %34
39: ; preds = %34, %39
%40 = phi i32 [ %42, %39 ], [ 0, %34 ]
%41 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 32, i32 253)
%42 = add nuw nsw i32 %40, 1
%43 = icmp eq i32 %42, 1024
br i1 %43, label %44, label %39
44: ; preds = %39, %44
%45 = phi i32 [ %47, %44 ], [ 0, %39 ]
%46 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 15, i32 62)
%47 = add nuw nsw i32 %45, 1
%48 = icmp eq i32 %47, 1024
br i1 %48, label %49, label %44
49: ; preds = %44, %49
%50 = phi i32 [ %52, %49 ], [ 0, %44 ]
%51 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 241, i32 248)
%52 = add nuw nsw i32 %50, 1
%53 = icmp eq i32 %52, 1024
br i1 %53, label %54, label %49
54: ; preds = %49, %54
%55 = phi i32 [ %57, %54 ], [ 0, %49 ]
%56 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 0, i32 0)
%57 = add nuw nsw i32 %55, 1
%58 = icmp eq i32 %57, 1024
br i1 %58, label %59, label %54
59: ; preds = %54, %59
%60 = phi i32 [ %62, %59 ], [ 0, %54 ]
%61 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 15, i32 120)
%62 = add nuw nsw i32 %60, 1
%63 = icmp eq i32 %62, 1024
br i1 %63, label %64, label %59
64: ; preds = %59, %64
%65 = phi i32 [ %67, %64 ], [ 0, %59 ]
%66 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 170, i32 85)
%67 = add nuw nsw i32 %65, 1
%68 = icmp eq i32 %67, 1024
br i1 %68, label %69, label %64
69: ; preds = %64, %69
%70 = phi i32 [ %72, %69 ], [ 0, %64 ]
%71 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 85, i32 170)
%72 = add nuw nsw i32 %70, 1
%73 = icmp eq i32 %72, 1024
br i1 %73, label %74, label %69
74: ; preds = %69, %74
%75 = phi i32 [ %77, %74 ], [ 0, %69 ]
%76 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 165, i32 90)
%77 = add nuw nsw i32 %75, 1
%78 = icmp eq i32 %77, 1024
br i1 %78, label %79, label %74
79: ; preds = %74, %79
%80 = phi i32 [ %82, %79 ], [ 0, %74 ]
%81 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 90, i32 165)
%82 = add nuw nsw i32 %80, 1
%83 = icmp eq i32 %82, 1024
br i1 %83, label %84, label %79
84: ; preds = %79, %84
%85 = phi i32 [ %87, %84 ], [ 0, %79 ]
%86 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 165, i32 165)
%87 = add nuw nsw i32 %85, 1
%88 = icmp eq i32 %87, 1024
br i1 %88, label %89, label %84
89: ; preds = %84, %89
%90 = phi i32 [ %92, %89 ], [ 0, %84 ]
%91 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 90, i32 90)
%92 = add nuw nsw i32 %90, 1
%93 = icmp eq i32 %92, 1024
br i1 %93, label %94, label %89
94: ; preds = %89
%95 = add nuw nsw i32 %3, 1
%96 = icmp eq i32 %95, 8
br i1 %96, label %97, label %2
97: ; preds = %94
%98 = tail call i32 @fclose(i32* %1)
ret i32 0
}