signed int writergb(char *name, signed int xres, signed int yres,
                    unsigned char *imgdata) {
  struct _IO_FILE$link42 *ofp;
  char iname[80l];
  signed int x;
  signed int y;
  signed int i;
  ofp = fopen(name, "wb");
  if (!(ofp == ((struct _IO_FILE$link42 *)((void *)0)))) {
    putshort(ofp, (unsigned short int)474);
    putbyte(ofp, (unsigned char)0);
    putbyte(ofp, (unsigned char)1);
    putshort(ofp, (unsigned short int)3);
    putshort(ofp, (unsigned short int)xres);
    putshort(ofp, (unsigned short int)yres);
    putshort(ofp, (unsigned short int)3);
    putint(ofp, (unsigned int)0);
    putint(ofp, (unsigned int)255);
    i = 0;
    while (i < 4) {
      putbyte(ofp, (unsigned char)0);
      i = i + 1;
    }
    strcpy(iname, "Tachyon Ray Tracer Image");
    fwrite((const void *)iname, (unsigned long int)80, (unsigned long int)1,
           ofp);
    putint(ofp, (unsigned int)0);
    i = 0;
    while (i < 404) {
      putbyte(ofp, (unsigned char)0);
      i = i + 1;
    }
    i = 0;
    while (i < 3) {
      y = 0;
      while (!(y >= yres)) {
        x = 0;
        while (!(x >= xres)) {
          fwrite(
              (const void *)&imgdata[(signed long int)((y * xres + x) * 3 + i)],
              (unsigned long int)1, (unsigned long int)1, ofp);
          x = x + 1;
        }
        y = y + 1;
      }
      i = i + 1;
    }
    fclose(ofp);
  }
  return 0;
}


x86 assembly (clang, -O0):
<writergb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe6c(%rip),%rsi
mov    $0x0,%al
call   1070 <fopen@plt>
cltq
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1379 <writergb+0x209>
mov    -0x20(%rbp),%rdi
mov    $0x1da,%esi
mov    $0x0,%al
call   1040 <putshort@plt>
mov    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1080 <putbyte@plt>
mov    -0x20(%rbp),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1080 <putbyte@plt>
mov    -0x20(%rbp),%rdi
mov    $0x3,%esi
mov    $0x0,%al
call   1040 <putshort@plt>
mov    -0x20(%rbp),%rdi
mov    -0xc(%rbp),%eax
movzwl %ax,%esi
mov    $0x0,%al
call   1040 <putshort@plt>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%eax
movzwl %ax,%esi
mov    $0x0,%al
call   1040 <putshort@plt>
mov    -0x20(%rbp),%rdi
mov    $0x3,%esi
mov    $0x0,%al
call   1040 <putshort@plt>
mov    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1030 <putint@plt>
mov    -0x20(%rbp),%rdi
mov    $0xff,%esi
mov    $0x0,%al
call   1030 <putint@plt>
movl   $0x0,-0x7c(%rbp)
cmpl   $0x4,-0x7c(%rbp)
jge    1264 <writergb+0xf4>
mov    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1080 <putbyte@plt>
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    123f <writergb+0xcf>
lea    -0x70(%rbp),%rdi
lea    0xd94(%rip),%rsi
call   1050 <strcpy@plt>
lea    -0x70(%rbp),%rdi
mov    -0x20(%rbp),%rcx
mov    $0x50,%esi
mov    $0x1,%edx
mov    $0x0,%al
call   1090 <fwrite@plt>
mov    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1030 <putint@plt>
movl   $0x0,-0x7c(%rbp)
cmpl   $0x194,-0x7c(%rbp)
jge    12c9 <writergb+0x159>
mov    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1080 <putbyte@plt>
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    12a1 <writergb+0x131>
movl   $0x0,-0x7c(%rbp)
cmpl   $0x3,-0x7c(%rbp)
jge    136e <writergb+0x1fe>
movl   $0x0,-0x78(%rbp)
mov    -0x78(%rbp),%eax
cmp    -0x10(%rbp),%eax
setge  %al
xor    $0xff,%al
test   $0x1,%al
jne    12f9 <writergb+0x189>
jmp    1360 <writergb+0x1f0>
movl   $0x0,-0x74(%rbp)
mov    -0x74(%rbp),%eax
cmp    -0xc(%rbp),%eax
setge  %al
xor    $0xff,%al
test   $0x1,%al
jne    1318 <writergb+0x1a8>
jmp    1352 <writergb+0x1e2>
mov    -0x18(%rbp),%rdi
mov    -0x78(%rbp),%eax
imul   -0xc(%rbp),%eax
add    -0x74(%rbp),%eax
imul   $0x3,%eax,%eax
add    -0x7c(%rbp),%eax
cltq
add    %rax,%rdi
mov    -0x20(%rbp),%rcx
mov    $0x1,%edx
mov    %rdx,%rsi
mov    $0x0,%al
call   1090 <fwrite@plt>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    1300 <writergb+0x190>
mov    -0x78(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x78(%rbp)
jmp    12e1 <writergb+0x171>
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    12d0 <writergb+0x160>
mov    -0x20(%rbp),%rdi
mov    $0x0,%al
call   1060 <fclose@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writergb>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %rcx,%r15
mov    %edx,%ebp
mov    %esi,%r12d
lea    0xe83(%rip),%rsi
xor    %eax,%eax
call   1060 <fopen@plt>
test   %eax,%eax
je     13dd <writergb+0x27d>
movslq %eax,%r14
mov    %r14,%rdi
mov    $0x1da,%esi
xor    %eax,%eax
call   1040 <putshort@plt>
mov    %r14,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1070 <putbyte@plt>
mov    %r14,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1070 <putbyte@plt>
mov    %r14,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <putshort@plt>
movzwl %r12w,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <putshort@plt>
movzwl %bp,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <putshort@plt>
mov    %r14,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <putshort@plt>
mov    %r14,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <putint@plt>
mov    %r14,%rdi
mov    $0xff,%esi
xor    %eax,%eax
call   1030 <putint@plt>
mov    %r14,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1070 <putbyte@plt>
mov    %r14,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1070 <putbyte@plt>
mov    %r14,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1070 <putbyte@plt>
mov    %r14,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1070 <putbyte@plt>
movups 0xdbf(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movups 0xdbc(%rip),%xmm0
movups %xmm0,0x29(%rsp)
lea    0x20(%rsp),%rdi
mov    $0x50,%esi
mov    $0x1,%edx
mov    %r14,%rcx
xor    %eax,%eax
call   1080 <fwrite@plt>
mov    %r14,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <putint@plt>
mov    $0x194,%ebx
nop
mov    %r14,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1070 <putbyte@plt>
add    $0xffffffff,%ebx
jne    1280 <writergb+0x120>
test   %ebp,%ebp
jle    13d3 <writergb+0x273>
movslq %r12d,%rax
mov    %ebp,0x4(%rsp)
mov    %ebp,%ecx
mov    %rcx,0x18(%rsp)
mov    %r12d,(%rsp)
mov    %r12d,%ecx
mov    %rcx,0x8(%rsp)
lea    (%rax,%rax,2),%rax
mov    %rax,0x10(%rsp)
mov    %r15,%rbp
xor    %r12d,%r12d
jmp    12e0 <writergb+0x180>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%r12
add    0x10(%rsp),%r15
cmp    0x18(%rsp),%r12
je     1313 <writergb+0x1b3>
cmpl   $0x0,(%rsp)
jle    12d0 <writergb+0x170>
mov    0x8(%rsp),%r13
mov    %r15,%rbx
xchg   %ax,%ax
mov    $0x1,%esi
mov    $0x1,%edx
mov    %rbx,%rdi
mov    %r14,%rcx
xor    %eax,%eax
call   1080 <fwrite@plt>
add    $0x3,%rbx
add    $0xffffffffffffffff,%r13
jne    12f0 <writergb+0x190>
jmp    12d0 <writergb+0x170>
cmpl   $0x0,0x4(%rsp)
jle    13d3 <writergb+0x273>
mov    %rbp,%r13
lea    0x1(%rbp),%r15
xor    %r12d,%r12d
jmp    1340 <writergb+0x1e0>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r12
add    0x10(%rsp),%r15
cmp    0x18(%rsp),%r12
je     1373 <writergb+0x213>
cmpl   $0x0,(%rsp)
jle    1330 <writergb+0x1d0>
mov    %r15,%rbx
mov    0x8(%rsp),%rbp
xchg   %ax,%ax
mov    $0x1,%esi
mov    $0x1,%edx
mov    %rbx,%rdi
mov    %r14,%rcx
xor    %eax,%eax
call   1080 <fwrite@plt>
add    $0x3,%rbx
add    $0xffffffffffffffff,%rbp
jne    1350 <writergb+0x1f0>
jmp    1330 <writergb+0x1d0>
cmpl   $0x0,0x4(%rsp)
mov    (%rsp),%r12d
jle    13d3 <writergb+0x273>
add    $0x2,%r13
xor    %r15d,%r15d
jmp    13a0 <writergb+0x240>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r15
add    0x10(%rsp),%r13
cmp    0x18(%rsp),%r15
je     13d3 <writergb+0x273>
test   %r12d,%r12d
jle    1390 <writergb+0x230>
mov    %r13,%rbx
mov    0x8(%rsp),%rbp
nopl   (%rax)
mov    $0x1,%esi
mov    $0x1,%edx
mov    %rbx,%rdi
mov    %r14,%rcx
xor    %eax,%eax
call   1080 <fwrite@plt>
add    $0x3,%rbx
add    $0xffffffffffffffff,%rbp
jne    13b0 <writergb+0x250>
jmp    1390 <writergb+0x230>
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <fclose@plt>
xor    %eax,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%"struct._IO_FILE$link42" = type opaque
@.str = [3 x i8] c"wb\00"
@.str.1 = [25 x i8] c"Tachyon Ray Tracer Image\00"
define i32 @writergb(i8* %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca %"struct._IO_FILE$link42"*
%10 = alloca [80 x i8]
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%14 = load i8*, i8** %5
%15 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @fopen to i32 (i8*, i8*, ...)*)(i8* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%16 = sext i32 %15 to i64
%17 = inttoptr i64 %16 to %"struct._IO_FILE$link42"*
store %"struct._IO_FILE$link42"* %17, %"struct._IO_FILE$link42"** %9
%18 = load %"struct._IO_FILE$link42"*, %"struct._IO_FILE$link42"** %9
%19 = icmp eq %"struct._IO_FILE$link42"* %18, null
br i1 %19, label %110, label %20
20: ; preds = %4
%21 = load %"struct._IO_FILE$link42"*, %"struct._IO_FILE$link42"** %9
%22 = call i32 (%"struct._IO_FILE$link42"*, i32, ...) bitcast (i32 (...)* @putshort to i32 (%"struct._IO_FILE$link42"*, i32, ...)*)(%"struct._IO_FILE$link42"* %21, i32 474)
%23 = load %"struct._IO_FILE$link42"*, %"struct._IO_FILE$link42"** %9
%24 = call i32 (%"struct._IO_FILE$link42"*, i32, ...) bitcast (i32 (...)* @putbyte to i32 (%"struct._IO_FILE$link42"*, i32, ...)*)(%"struct._IO_FILE$link42"* %23, i32 0)
%25 = load %"struct._IO_FILE$link42"*, %"struct._IO_FILE$link42"** %9
%26 = call i32 (%"struct._IO_FILE$link42"*, i32, ...) bitcast (i32 (...)* @putbyte to i32 (%"struct._IO_FILE$link42"*, i32, ...)*)(%"struct._IO_FILE$link42"* %25, i32 1)
%27 = load %"struct._IO_FILE$link42"*, %"struct._IO_FILE$link42"** %9
%28 = call i32 (%"struct._IO_FILE$link42"*, i32, ...) bitcast (i32 (...)* @putshort to i32 (%"struct._IO_FILE$link42"*, i32, ...)*)(%"struct._IO_FILE$link42"* %27, i32 3)
%29 = load %"struct._IO_FILE$link42"*, %"struct._IO_FILE$link42"** %9
%30 = load i32, i32* %6
%31 = trunc i32 %30 to i16
%32 = zext i16 %31 to i32
%33 = call i32 (%"struct._IO_FILE$link42"*, i32, ...) bitcast (i32 (...)* @putshort to i32 (%"struct._IO_FILE$link42"*, i32, ...)*)(%"struct._IO_FILE$link42"* %29, i32 %32)
%34 = load %"struct._IO_FILE$link42"*, %"struct._IO_FILE$link42"** %9
%35 = load i32, i32* %7
%36 = trunc i32 %35 to i16
%37 = zext i16 %36 to i32
%38 = call i32 (%"struct._IO_FILE$link42"*, i32, ...) bitcast (i32 (...)* @putshort to i32 (%"struct._IO_FILE$link42"*, i32, ...)*)(%"struct._IO_FILE$link42"* %34, i32 %37)
%39 = load %"struct._IO_FILE$link42"*, %"struct._IO_FILE$link42"** %9
%40 = call i32 (%"struct._IO_FILE$link42"*, i32, ...) bitcast (i32 (...)* @putshort to i32 (%"struct._IO_FILE$link42"*, i32, ...)*)(%"struct._IO_FILE$link42"* %39, i32 3)
%41 = load %"struct._IO_FILE$link42"*, %"struct._IO_FILE$link42"** %9
%42 = call i32 (%"struct._IO_FILE$link42"*, i32, ...) bitcast (i32 (...)* @putint to i32 (%"struct._IO_FILE$link42"*, i32, ...)*)(%"struct._IO_FILE$link42"* %41, i32 0)
%43 = load %"struct._IO_FILE$link42"*, %"struct._IO_FILE$link42"** %9
%44 = call i32 (%"struct._IO_FILE$link42"*, i32, ...) bitcast (i32 (...)* @putint to i32 (%"struct._IO_FILE$link42"*, i32, ...)*)(%"struct._IO_FILE$link42"* %43, i32 255)
store i32 0, i32* %13
br label %45
45: ; preds = %48, %20
%46 = load i32, i32* %13
%47 = icmp slt i32 %46, 4
br i1 %47, label %48, label %53
48: ; preds = %45
%49 = load %"struct._IO_FILE$link42"*, %"struct._IO_FILE$link42"** %9
%50 = call i32 (%"struct._IO_FILE$link42"*, i32, ...) bitcast (i32 (...)* @putbyte to i32 (%"struct._IO_FILE$link42"*, i32, ...)*)(%"struct._IO_FILE$link42"* %49, i32 0)
%51 = load i32, i32* %13
%52 = add nsw i32 %51, 1
store i32 %52, i32* %13
br label %45
53: ; preds = %45
%54 = getelementptr inbounds [80 x i8], [80 x i8]* %10, i64 0, i64 0
%55 = call i8* @strcpy(i8* %54, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%56 = getelementptr inbounds [80 x i8], [80 x i8]* %10, i64 0, i64 0
%57 = load %"struct._IO_FILE$link42"*, %"struct._IO_FILE$link42"** %9
%58 = call i32 (i8*, i64, i64, %"struct._IO_FILE$link42"*, ...) bitcast (i32 (...)* @fwrite to i32 (i8*, i64, i64, %"struct._IO_FILE$link42"*, ...)*)(i8* %56, i64 80, i64 1, %"struct._IO_FILE$link42"* %57)
%59 = load %"struct._IO_FILE$link42"*, %"struct._IO_FILE$link42"** %9
%60 = call i32 (%"struct._IO_FILE$link42"*, i32, ...) bitcast (i32 (...)* @putint to i32 (%"struct._IO_FILE$link42"*, i32, ...)*)(%"struct._IO_FILE$link42"* %59, i32 0)
store i32 0, i32* %13
br label %61
61: ; preds = %64, %53
%62 = load i32, i32* %13
%63 = icmp slt i32 %62, 404
br i1 %63, label %64, label %69
64: ; preds = %61
%65 = load %"struct._IO_FILE$link42"*, %"struct._IO_FILE$link42"** %9
%66 = call i32 (%"struct._IO_FILE$link42"*, i32, ...) bitcast (i32 (...)* @putbyte to i32 (%"struct._IO_FILE$link42"*, i32, ...)*)(%"struct._IO_FILE$link42"* %65, i32 0)
%67 = load i32, i32* %13
%68 = add nsw i32 %67, 1
store i32 %68, i32* %13
br label %61
69: ; preds = %61
store i32 0, i32* %13
br label %70
70: ; preds = %104, %69
%71 = load i32, i32* %13
%72 = icmp slt i32 %71, 3
br i1 %72, label %73, label %107
73: ; preds = %70
store i32 0, i32* %12
br label %74
74: ; preds = %101, %73
%75 = load i32, i32* %12
%76 = load i32, i32* %7
%77 = icmp sge i32 %75, %76
%78 = xor i1 %77, true
br i1 %78, label %79, label %104
79: ; preds = %74
store i32 0, i32* %11
br label %80
80: ; preds = %85, %79
%81 = load i32, i32* %11
%82 = load i32, i32* %6
%83 = icmp sge i32 %81, %82
%84 = xor i1 %83, true
br i1 %84, label %85, label %101
85: ; preds = %80
%86 = load i8*, i8** %8
%87 = load i32, i32* %12
%88 = load i32, i32* %6
%89 = mul nsw i32 %87, %88
%90 = load i32, i32* %11
%91 = add nsw i32 %89, %90
%92 = mul nsw i32 %91, 3
%93 = load i32, i32* %13
%94 = add nsw i32 %92, %93
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds i8, i8* %86, i64 %95
%97 = load %"struct._IO_FILE$link42"*, %"struct._IO_FILE$link42"** %9
%98 = call i32 (i8*, i64, i64, %"struct._IO_FILE$link42"*, ...) bitcast (i32 (...)* @fwrite to i32 (i8*, i64, i64, %"struct._IO_FILE$link42"*, ...)*)(i8* %96, i64 1, i64 1, %"struct._IO_FILE$link42"* %97)
%99 = load i32, i32* %11
%100 = add nsw i32 %99, 1
store i32 %100, i32* %11
br label %80
101: ; preds = %80
%102 = load i32, i32* %12
%103 = add nsw i32 %102, 1
store i32 %103, i32* %12
br label %74
104: ; preds = %74
%105 = load i32, i32* %13
%106 = add nsw i32 %105, 1
store i32 %106, i32* %13
br label %70
107: ; preds = %70
%108 = load %"struct._IO_FILE$link42"*, %"struct._IO_FILE$link42"** %9
%109 = call i32 (%"struct._IO_FILE$link42"*, ...) bitcast (i32 (...)* @fclose to i32 (%"struct._IO_FILE$link42"*, ...)*)(%"struct._IO_FILE$link42"* %108)
br label %110
110: ; preds = %107, %4
ret i32 0
}

LLVM IR (-O2):
%"struct._IO_FILE$link42" = type opaque
@.str = [3 x i8] c"wb\00"
@.str.1 = [25 x i8] c"Tachyon Ray Tracer Image\00"
define i32 @writergb(i8* %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca [80 x i8]
%6 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%7 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @fopen to i32 (i8*, i8*, ...)*)(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to %"struct._IO_FILE$link42"*
%10 = icmp eq i32 %7, 0
br i1 %10, label %98, label %11
11: ; preds = %4
%12 = tail call i32 (%"struct._IO_FILE$link42"*, i32, ...) bitcast (i32 (...)* @putshort to i32 (%"struct._IO_FILE$link42"*, i32, ...)*)(%"struct._IO_FILE$link42"* %9, i32 474)
%13 = tail call i32 (%"struct._IO_FILE$link42"*, i32, ...) bitcast (i32 (...)* @putbyte to i32 (%"struct._IO_FILE$link42"*, i32, ...)*)(%"struct._IO_FILE$link42"* %9, i32 0)
%14 = tail call i32 (%"struct._IO_FILE$link42"*, i32, ...) bitcast (i32 (...)* @putbyte to i32 (%"struct._IO_FILE$link42"*, i32, ...)*)(%"struct._IO_FILE$link42"* %9, i32 1)
%15 = tail call i32 (%"struct._IO_FILE$link42"*, i32, ...) bitcast (i32 (...)* @putshort to i32 (%"struct._IO_FILE$link42"*, i32, ...)*)(%"struct._IO_FILE$link42"* %9, i32 3)
%16 = and i32 %1, 65535
%17 = tail call i32 (%"struct._IO_FILE$link42"*, i32, ...) bitcast (i32 (...)* @putshort to i32 (%"struct._IO_FILE$link42"*, i32, ...)*)(%"struct._IO_FILE$link42"* %9, i32 %16)
%18 = and i32 %2, 65535
%19 = tail call i32 (%"struct._IO_FILE$link42"*, i32, ...) bitcast (i32 (...)* @putshort to i32 (%"struct._IO_FILE$link42"*, i32, ...)*)(%"struct._IO_FILE$link42"* %9, i32 %18)
%20 = tail call i32 (%"struct._IO_FILE$link42"*, i32, ...) bitcast (i32 (...)* @putshort to i32 (%"struct._IO_FILE$link42"*, i32, ...)*)(%"struct._IO_FILE$link42"* %9, i32 3)
%21 = tail call i32 (%"struct._IO_FILE$link42"*, i32, ...) bitcast (i32 (...)* @putint to i32 (%"struct._IO_FILE$link42"*, i32, ...)*)(%"struct._IO_FILE$link42"* %9, i32 0)
%22 = tail call i32 (%"struct._IO_FILE$link42"*, i32, ...) bitcast (i32 (...)* @putint to i32 (%"struct._IO_FILE$link42"*, i32, ...)*)(%"struct._IO_FILE$link42"* %9, i32 255)
%23 = tail call i32 (%"struct._IO_FILE$link42"*, i32, ...) bitcast (i32 (...)* @putbyte to i32 (%"struct._IO_FILE$link42"*, i32, ...)*)(%"struct._IO_FILE$link42"* %9, i32 0)
%24 = tail call i32 (%"struct._IO_FILE$link42"*, i32, ...) bitcast (i32 (...)* @putbyte to i32 (%"struct._IO_FILE$link42"*, i32, ...)*)(%"struct._IO_FILE$link42"* %9, i32 0)
%25 = tail call i32 (%"struct._IO_FILE$link42"*, i32, ...) bitcast (i32 (...)* @putbyte to i32 (%"struct._IO_FILE$link42"*, i32, ...)*)(%"struct._IO_FILE$link42"* %9, i32 0)
%26 = tail call i32 (%"struct._IO_FILE$link42"*, i32, ...) bitcast (i32 (...)* @putbyte to i32 (%"struct._IO_FILE$link42"*, i32, ...)*)(%"struct._IO_FILE$link42"* %9, i32 0)
%27 = call i32 (i8*, i64, i64, %"struct._IO_FILE$link42"*, ...) bitcast (i32 (...)* @fwrite to i32 (i8*, i64, i64, %"struct._IO_FILE$link42"*, ...)*)(i8* %6, i64 80, i64 1, %"struct._IO_FILE$link42"* %9)
%28 = call i32 (%"struct._IO_FILE$link42"*, i32, ...) bitcast (i32 (...)* @putint to i32 (%"struct._IO_FILE$link42"*, i32, ...)*)(%"struct._IO_FILE$link42"* %9, i32 0)
br label %33
29: ; preds = %33
%30 = icmp sgt i32 %2, 0
%31 = icmp sgt i32 %1, 0
%32 = sext i32 %1 to i64
br i1 %30, label %38, label %96
33: ; preds = %11, %33
%34 = phi i32 [ 0, %11 ], [ %36, %33 ]
%35 = call i32 (%"struct._IO_FILE$link42"*, i32, ...) bitcast (i32 (...)* @putbyte to i32 (%"struct._IO_FILE$link42"*, i32, ...)*)(%"struct._IO_FILE$link42"* %9, i32 0)
%36 = add nuw nsw i32 %34, 1
%37 = icmp eq i32 %36, 404
br i1 %37, label %29, label %33
38: ; preds = %29
%39 = zext i32 %2 to i64
%40 = zext i32 %1 to i64
br label %41
41: ; preds = %38, %53
%42 = phi i64 [ 0, %38 ], [ %54, %53 ]
br i1 %31, label %43, label %53
43: ; preds = %41
%44 = mul nsw i64 %42, %32
br label %45
45: ; preds = %43, %45
%46 = phi i64 [ 0, %43 ], [ %51, %45 ]
%47 = add nsw i64 %46, %44
%48 = mul nsw i64 %47, 3
%49 = getelementptr inbounds i8, i8* %3, i64 %48
%50 = call i32 (i8*, i64, i64, %"struct._IO_FILE$link42"*, ...) bitcast (i32 (...)* @fwrite to i32 (i8*, i64, i64, %"struct._IO_FILE$link42"*, ...)*)(i8* %49, i64 1, i64 1, %"struct._IO_FILE$link42"* %9)
%51 = add nuw nsw i64 %46, 1
%52 = icmp eq i64 %51, %40
br i1 %52, label %53, label %45
53: ; preds = %45, %41
%54 = add nuw nsw i64 %42, 1
%55 = icmp eq i64 %54, %39
br i1 %55, label %56, label %41
56: ; preds = %53
br i1 %30, label %57, label %96
57: ; preds = %56
%58 = zext i32 %2 to i64
%59 = zext i32 %1 to i64
br label %60
60: ; preds = %73, %57
%61 = phi i64 [ 0, %57 ], [ %74, %73 ]
br i1 %31, label %62, label %73
62: ; preds = %60
%63 = mul nsw i64 %61, %32
br label %64
64: ; preds = %64, %62
%65 = phi i64 [ 0, %62 ], [ %71, %64 ]
%66 = add nsw i64 %65, %63
%67 = mul nsw i64 %66, 3
%68 = add nsw i64 %67, 1
%69 = getelementptr inbounds i8, i8* %3, i64 %68
%70 = call i32 (i8*, i64, i64, %"struct._IO_FILE$link42"*, ...) bitcast (i32 (...)* @fwrite to i32 (i8*, i64, i64, %"struct._IO_FILE$link42"*, ...)*)(i8* %69, i64 1, i64 1, %"struct._IO_FILE$link42"* %9)
%71 = add nuw nsw i64 %65, 1
%72 = icmp eq i64 %71, %59
br i1 %72, label %73, label %64
73: ; preds = %64, %60
%74 = add nuw nsw i64 %61, 1
%75 = icmp eq i64 %74, %58
br i1 %75, label %76, label %60
76: ; preds = %73
br i1 %30, label %77, label %96
77: ; preds = %76
%78 = zext i32 %2 to i64
%79 = zext i32 %1 to i64
br label %80
80: ; preds = %93, %77
%81 = phi i64 [ 0, %77 ], [ %94, %93 ]
br i1 %31, label %82, label %93
82: ; preds = %80
%83 = mul nsw i64 %81, %32
br label %84
84: ; preds = %84, %82
%85 = phi i64 [ 0, %82 ], [ %91, %84 ]
%86 = add nsw i64 %85, %83
%87 = mul nsw i64 %86, 3
%88 = add nsw i64 %87, 2
%89 = getelementptr inbounds i8, i8* %3, i64 %88
%90 = call i32 (i8*, i64, i64, %"struct._IO_FILE$link42"*, ...) bitcast (i32 (...)* @fwrite to i32 (i8*, i64, i64, %"struct._IO_FILE$link42"*, ...)*)(i8* %89, i64 1, i64 1, %"struct._IO_FILE$link42"* %9)
%91 = add nuw nsw i64 %85, 1
%92 = icmp eq i64 %91, %79
br i1 %92, label %93, label %84
93: ; preds = %84, %80
%94 = add nuw nsw i64 %81, 1
%95 = icmp eq i64 %94, %78
br i1 %95, label %96, label %80
96: ; preds = %93, %29, %56, %76
%97 = call i32 (%"struct._IO_FILE$link42"*, ...) bitcast (i32 (...)* @fclose to i32 (%"struct._IO_FILE$link42"*, ...)*)(%"struct._IO_FILE$link42"* %9)
br label %98
98: ; preds = %96, %4
ret i32 0
}