signed int writepsd48(char *name, signed int xres, signed int yres,
                      unsigned char *imgdata) {
  struct _IO_FILE$link41 *ofp;
  signed int y;
  signed int p;
  char width[4l];
  char height[4l];
  const char *sig = "8BPS";
  const char ver[8l] = {(const char)0, (const char)1, (const char)0,
                        (const char)0, (const char)0, (const char)0,
                        (const char)0, (const char)0};
  const char chn[2l] = {(const char)0, (const char)3};
  const char mod[4l] = {(const char)0, (const char)16, (const char)0,
                        (const char)3};
  const char hdr[14l] = {
      (const char)0, (const char)0, (const char)0, (const char)0, (const char)0,
      (const char)0, (const char)0, (const char)0, (const char)0, (const char)0,
      (const char)0, (const char)0, (const char)0, (const char)0};
  ofp = fopen(name, "wb");
  if (ofp == ((struct _IO_FILE$link41 *)((void *)0)))
    return 1;
  width[(signed long int)0] = (char)(xres >> 24 & 255);
  width[(signed long int)1] = (char)(xres >> 16 & 255);
  width[(signed long int)2] = (char)(xres >> 8 & 255);
  width[(signed long int)3] = (char)(xres & 255);
  height[(signed long int)0] = (char)(yres >> 24 & 255);
  height[(signed long int)1] = (char)(yres >> 16 & 255);
  height[(signed long int)2] = (char)(yres >> 8 & 255);
  height[(signed long int)3] = (char)(yres & 255);
  fwrite((const void *)sig, (unsigned long int)4, (unsigned long int)1, ofp);
  fwrite((const void *)ver, (unsigned long int)8, (unsigned long int)1, ofp);
  fwrite((const void *)chn, (unsigned long int)2, (unsigned long int)1, ofp);
  fwrite((const void *)height, (unsigned long int)4, (unsigned long int)1, ofp);
  fwrite((const void *)width, (unsigned long int)4, (unsigned long int)1, ofp);
  fwrite((const void *)mod, (unsigned long int)4, (unsigned long int)1, ofp);
  fwrite((const void *)hdr, (unsigned long int)14, (unsigned long int)1, ofp);
  p = 0;
  while (p < 3) {
    signed int paddr = xres * yres * 2 * p;
    y = 0;
    while (!(y >= yres)) {
      fwrite((const void *)&imgdata[(signed long int)(paddr + ((yres - y) - 1) *
                                                                  xres * 2)],
             (unsigned long int)1, (unsigned long int)(2 * xres), ofp);
      y = y + 1;
    }
    p = p + 1;
  }
  fclose(ofp);
  return 0;
}


x86 assembly (clang, -O0):
<writepsd48>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    0xea3(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xea0(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xe9d(%rip),%ax
mov    %ax,-0x4a(%rbp)
mov    0xe95(%rip),%eax
mov    %eax,-0x4e(%rbp)
lea    -0x5c(%rbp),%rdi
xor    %esi,%esi
mov    $0xe,%edx
call   1040 <memset@plt>
mov    -0x10(%rbp),%rdi
lea    0xe6a(%rip),%rsi
mov    $0x0,%al
call   1050 <fopen@plt>
cltq
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    11bf <writepsd48+0x7f>
movl   $0x1,-0x4(%rbp)
jmp    137e <writepsd48+0x23e>
mov    -0x14(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
mov    %al,-0x34(%rbp)
mov    -0x14(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %al,-0x33(%rbp)
mov    -0x14(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,-0x32(%rbp)
mov    -0x14(%rbp),%eax
and    $0xff,%eax
mov    %al,-0x31(%rbp)
mov    -0x18(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
mov    %al,-0x38(%rbp)
mov    -0x18(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %al,-0x37(%rbp)
mov    -0x18(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,-0x36(%rbp)
mov    -0x18(%rbp),%eax
and    $0xff,%eax
mov    %al,-0x35(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x28(%rbp),%rcx
mov    $0x4,%esi
mov    $0x1,%edx
mov    $0x0,%al
call   1060 <fwrite@plt>
lea    -0x48(%rbp),%rdi
mov    -0x28(%rbp),%rcx
mov    $0x8,%esi
mov    $0x1,%edx
mov    $0x0,%al
call   1060 <fwrite@plt>
lea    -0x4a(%rbp),%rdi
mov    -0x28(%rbp),%rcx
mov    $0x2,%esi
mov    $0x1,%edx
mov    $0x0,%al
call   1060 <fwrite@plt>
lea    -0x38(%rbp),%rdi
mov    -0x28(%rbp),%rcx
mov    $0x4,%esi
mov    $0x1,%edx
mov    $0x0,%al
call   1060 <fwrite@plt>
lea    -0x34(%rbp),%rdi
mov    -0x28(%rbp),%rcx
mov    $0x4,%esi
mov    $0x1,%edx
mov    $0x0,%al
call   1060 <fwrite@plt>
lea    -0x4e(%rbp),%rdi
mov    -0x28(%rbp),%rcx
mov    $0x4,%esi
mov    $0x1,%edx
mov    $0x0,%al
call   1060 <fwrite@plt>
lea    -0x5c(%rbp),%rdi
mov    -0x28(%rbp),%rcx
mov    $0xe,%esi
mov    $0x1,%edx
mov    $0x0,%al
call   1060 <fwrite@plt>
movl   $0x0,-0x30(%rbp)
cmpl   $0x3,-0x30(%rbp)
jge    136c <writepsd48+0x22c>
mov    -0x14(%rbp),%eax
imul   -0x18(%rbp),%eax
shl    $0x1,%eax
imul   -0x30(%rbp),%eax
mov    %eax,-0x60(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x18(%rbp),%eax
setge  %al
xor    $0xff,%al
test   $0x1,%al
jne    1319 <writepsd48+0x1d9>
jmp    135e <writepsd48+0x21e>
mov    -0x20(%rbp),%rdi
mov    -0x60(%rbp),%eax
mov    -0x18(%rbp),%ecx
sub    -0x2c(%rbp),%ecx
sub    $0x1,%ecx
imul   -0x14(%rbp),%ecx
shl    $0x1,%ecx
add    %ecx,%eax
cltq
add    %rax,%rdi
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
movslq %eax,%rdx
mov    -0x28(%rbp),%rcx
mov    $0x1,%esi
mov    $0x0,%al
call   1060 <fwrite@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1301 <writepsd48+0x1c1>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    12df <writepsd48+0x19f>
mov    -0x28(%rbp),%rdi
mov    $0x0,%al
call   1030 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writepsd48>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rcx,%r13
mov    %edx,%ebx
mov    %esi,%r14d
movq   $0x100,0x20(%rsp)
movw   $0x300,0x6(%rsp)
movl   $0x3001000,0x8(%rsp)
03
movq   $0x0,0x2e(%rsp)
movq   $0x0,0x28(%rsp)
lea    0xe8e(%rip),%rsi
xor    %eax,%eax
call   1040 <fopen@plt>
test   %eax,%eax
je     1360 <writepsd48+0x230>
movslq %eax,%r12
mov    %r14d,%eax
bswap  %eax
mov    %eax,0xc(%rsp)
mov    %ebx,%eax
shr    $0x18,%eax
mov    %al,0x2(%rsp)
mov    %ebx,%eax
shr    $0x10,%eax
mov    %al,0x3(%rsp)
mov    %bh,0x4(%rsp)
mov    %bl,0x5(%rsp)
lea    0xe4d(%rip),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %r12,%rcx
xor    %eax,%eax
call   1050 <fwrite@plt>
lea    0x20(%rsp),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %r12,%rcx
xor    %eax,%eax
call   1050 <fwrite@plt>
lea    0x6(%rsp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r12,%rcx
xor    %eax,%eax
call   1050 <fwrite@plt>
lea    0x2(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %r12,%rcx
xor    %eax,%eax
call   1050 <fwrite@plt>
lea    0xc(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %r12,%rcx
xor    %eax,%eax
call   1050 <fwrite@plt>
lea    0x8(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %r12,%rcx
xor    %eax,%eax
call   1050 <fwrite@plt>
lea    0x28(%rsp),%rdi
mov    $0xe,%esi
mov    $0x1,%edx
mov    %r12,%rcx
xor    %eax,%eax
call   1050 <fwrite@plt>
test   %ebx,%ebx
jle    1352 <writepsd48+0x222>
lea    (%r14,%r14,1),%eax
movslq %eax,%r15
mov    %ebx,%eax
mov    %r12,%rbp
mov    %rbx,0x18(%rsp)
lea    -0x1(%rbx),%r12d
imul   %r14d,%r12d
add    %r12d,%r12d
mov    %rax,0x10(%rsp)
mov    %rax,%rbx
nopl   0x0(%rax)
movslq %r12d,%r12
lea    (%r12,%r13,1),%rdi
mov    $0x1,%esi
mov    %r15,%rdx
mov    %rbp,%rcx
xor    %eax,%eax
call   1050 <fwrite@plt>
sub    %r15d,%r12d
add    $0xffffffffffffffff,%rbx
jne    1290 <writepsd48+0x160>
mov    0x18(%rsp),%rax
test   %eax,%eax
mov    %rbp,%r12
mov    0x10(%rsp),%rbp
jle    1352 <writepsd48+0x222>
lea    (%rax,%rax,1),%ebx
add    $0xffffffff,%ebx
imul   %r14d,%ebx
add    %ebx,%ebx
mov    %r12,%rax
mov    %r13,%r12
mov    %rax,%r13
nopl   0x0(%rax)
movslq %ebx,%rbx
lea    (%r12,%rbx,1),%rdi
mov    $0x1,%esi
mov    %r15,%rdx
mov    %r13,%rcx
xor    %eax,%eax
call   1050 <fwrite@plt>
sub    %r15d,%ebx
add    $0xffffffffffffffff,%rbp
jne    12e0 <writepsd48+0x1b0>
mov    0x18(%rsp),%rax
test   %eax,%eax
mov    %r12,%rbx
mov    %r13,%r12
mov    0x10(%rsp),%rbp
jle    1352 <writepsd48+0x222>
lea    (%rax,%rax,2),%eax
add    $0xffffffff,%eax
imul   %eax,%r14d
add    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movslq %r14d,%r14
lea    (%rbx,%r14,1),%rdi
mov    $0x1,%esi
mov    %r15,%rdx
mov    %r12,%rcx
xor    %eax,%eax
call   1050 <fwrite@plt>
sub    %r15d,%r14d
add    $0xffffffffffffffff,%rbp
jne    1330 <writepsd48+0x200>
mov    %r12,%rdi
xor    %eax,%eax
call   1030 <fclose@plt>
xor    %eax,%eax
jmp    1365 <writepsd48+0x235>
mov    $0x1,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%"struct._IO_FILE$link41" = type opaque
@.str = [5 x i8] c"8BPS\00"
@__const.writepsd48.ver = [8 x i8] c"\00\01\00\00\00\00\00\00"
@__const.writepsd48.chn = [2 x i8] c"\00\03"
@__const.writepsd48.mod = [4 x i8] c"\00\10\00\03"
@.str.1 = [3 x i8] c"wb\00"
define i32 @writepsd48(i8* %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca %"struct._IO_FILE$link41"*
%11 = alloca i32
%12 = alloca i32
%13 = alloca [4 x i8]
%14 = alloca [4 x i8]
%15 = alloca i8*
%16 = alloca [8 x i8]
%17 = alloca [2 x i8]
%18 = alloca [4 x i8]
%19 = alloca [14 x i8]
%20 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %15
%21 = bitcast [8 x i8]* %16 to i8*
%22 = bitcast [2 x i8]* %17 to i8*
%23 = bitcast [4 x i8]* %18 to i8*
%24 = bitcast [14 x i8]* %19 to i8*
%25 = load i8*, i8** %6
%26 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @fopen to i32 (i8*, i8*, ...)*)(i8* %25, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%27 = sext i32 %26 to i64
%28 = inttoptr i64 %27 to %"struct._IO_FILE$link41"*
store %"struct._IO_FILE$link41"* %28, %"struct._IO_FILE$link41"** %10
%29 = load %"struct._IO_FILE$link41"*, %"struct._IO_FILE$link41"** %10
%30 = icmp eq %"struct._IO_FILE$link41"* %29, null
br i1 %30, label %31, label %32
31: ; preds = %4
store i32 1, i32* %5
br label %133
32: ; preds = %4
%33 = load i32, i32* %7
%34 = ashr i32 %33, 24
%35 = and i32 %34, 255
%36 = trunc i32 %35 to i8
%37 = getelementptr inbounds [4 x i8], [4 x i8]* %13, i64 0, i64 0
store i8 %36, i8* %37
%38 = load i32, i32* %7
%39 = ashr i32 %38, 16
%40 = and i32 %39, 255
%41 = trunc i32 %40 to i8
%42 = getelementptr inbounds [4 x i8], [4 x i8]* %13, i64 0, i64 1
store i8 %41, i8* %42
%43 = load i32, i32* %7
%44 = ashr i32 %43, 8
%45 = and i32 %44, 255
%46 = trunc i32 %45 to i8
%47 = getelementptr inbounds [4 x i8], [4 x i8]* %13, i64 0, i64 2
store i8 %46, i8* %47
%48 = load i32, i32* %7
%49 = and i32 %48, 255
%50 = trunc i32 %49 to i8
%51 = getelementptr inbounds [4 x i8], [4 x i8]* %13, i64 0, i64 3
store i8 %50, i8* %51
%52 = load i32, i32* %8
%53 = ashr i32 %52, 24
%54 = and i32 %53, 255
%55 = trunc i32 %54 to i8
%56 = getelementptr inbounds [4 x i8], [4 x i8]* %14, i64 0, i64 0
store i8 %55, i8* %56
%57 = load i32, i32* %8
%58 = ashr i32 %57, 16
%59 = and i32 %58, 255
%60 = trunc i32 %59 to i8
%61 = getelementptr inbounds [4 x i8], [4 x i8]* %14, i64 0, i64 1
store i8 %60, i8* %61
%62 = load i32, i32* %8
%63 = ashr i32 %62, 8
%64 = and i32 %63, 255
%65 = trunc i32 %64 to i8
%66 = getelementptr inbounds [4 x i8], [4 x i8]* %14, i64 0, i64 2
store i8 %65, i8* %66
%67 = load i32, i32* %8
%68 = and i32 %67, 255
%69 = trunc i32 %68 to i8
%70 = getelementptr inbounds [4 x i8], [4 x i8]* %14, i64 0, i64 3
store i8 %69, i8* %70
%71 = load i8*, i8** %15
%72 = load %"struct._IO_FILE$link41"*, %"struct._IO_FILE$link41"** %10
%73 = call i32 (i8*, i64, i64, %"struct._IO_FILE$link41"*, ...) bitcast (i32 (...)* @fwrite to i32 (i8*, i64, i64, %"struct._IO_FILE$link41"*, ...)*)(i8* %71, i64 4, i64 1, %"struct._IO_FILE$link41"* %72)
%74 = getelementptr inbounds [8 x i8], [8 x i8]* %16, i64 0, i64 0
%75 = load %"struct._IO_FILE$link41"*, %"struct._IO_FILE$link41"** %10
%76 = call i32 (i8*, i64, i64, %"struct._IO_FILE$link41"*, ...) bitcast (i32 (...)* @fwrite to i32 (i8*, i64, i64, %"struct._IO_FILE$link41"*, ...)*)(i8* %74, i64 8, i64 1, %"struct._IO_FILE$link41"* %75)
%77 = getelementptr inbounds [2 x i8], [2 x i8]* %17, i64 0, i64 0
%78 = load %"struct._IO_FILE$link41"*, %"struct._IO_FILE$link41"** %10
%79 = call i32 (i8*, i64, i64, %"struct._IO_FILE$link41"*, ...) bitcast (i32 (...)* @fwrite to i32 (i8*, i64, i64, %"struct._IO_FILE$link41"*, ...)*)(i8* %77, i64 2, i64 1, %"struct._IO_FILE$link41"* %78)
%80 = getelementptr inbounds [4 x i8], [4 x i8]* %14, i64 0, i64 0
%81 = load %"struct._IO_FILE$link41"*, %"struct._IO_FILE$link41"** %10
%82 = call i32 (i8*, i64, i64, %"struct._IO_FILE$link41"*, ...) bitcast (i32 (...)* @fwrite to i32 (i8*, i64, i64, %"struct._IO_FILE$link41"*, ...)*)(i8* %80, i64 4, i64 1, %"struct._IO_FILE$link41"* %81)
%83 = getelementptr inbounds [4 x i8], [4 x i8]* %13, i64 0, i64 0
%84 = load %"struct._IO_FILE$link41"*, %"struct._IO_FILE$link41"** %10
%85 = call i32 (i8*, i64, i64, %"struct._IO_FILE$link41"*, ...) bitcast (i32 (...)* @fwrite to i32 (i8*, i64, i64, %"struct._IO_FILE$link41"*, ...)*)(i8* %83, i64 4, i64 1, %"struct._IO_FILE$link41"* %84)
%86 = getelementptr inbounds [4 x i8], [4 x i8]* %18, i64 0, i64 0
%87 = load %"struct._IO_FILE$link41"*, %"struct._IO_FILE$link41"** %10
%88 = call i32 (i8*, i64, i64, %"struct._IO_FILE$link41"*, ...) bitcast (i32 (...)* @fwrite to i32 (i8*, i64, i64, %"struct._IO_FILE$link41"*, ...)*)(i8* %86, i64 4, i64 1, %"struct._IO_FILE$link41"* %87)
%89 = getelementptr inbounds [14 x i8], [14 x i8]* %19, i64 0, i64 0
%90 = load %"struct._IO_FILE$link41"*, %"struct._IO_FILE$link41"** %10
%91 = call i32 (i8*, i64, i64, %"struct._IO_FILE$link41"*, ...) bitcast (i32 (...)* @fwrite to i32 (i8*, i64, i64, %"struct._IO_FILE$link41"*, ...)*)(i8* %89, i64 14, i64 1, %"struct._IO_FILE$link41"* %90)
store i32 0, i32* %12
br label %92
92: ; preds = %127, %32
%93 = load i32, i32* %12
%94 = icmp slt i32 %93, 3
br i1 %94, label %95, label %130
95: ; preds = %92
%96 = load i32, i32* %7
%97 = load i32, i32* %8
%98 = mul nsw i32 %96, %97
%99 = mul nsw i32 %98, 2
%100 = load i32, i32* %12
%101 = mul nsw i32 %99, %100
store i32 %101, i32* %20
store i32 0, i32* %11
br label %102
102: ; preds = %107, %95
%103 = load i32, i32* %11
%104 = load i32, i32* %8
%105 = icmp sge i32 %103, %104
%106 = xor i1 %105, true
br i1 %106, label %107, label %127
107: ; preds = %102
%108 = load i8*, i8** %9
%109 = load i32, i32* %20
%110 = load i32, i32* %8
%111 = load i32, i32* %11
%112 = sub nsw i32 %110, %111
%113 = sub nsw i32 %112, 1
%114 = load i32, i32* %7
%115 = mul nsw i32 %113, %114
%116 = mul nsw i32 %115, 2
%117 = add nsw i32 %109, %116
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds i8, i8* %108, i64 %118
%120 = load i32, i32* %7
%121 = mul nsw i32 2, %120
%122 = sext i32 %121 to i64
%123 = load %"struct._IO_FILE$link41"*, %"struct._IO_FILE$link41"** %10
%124 = call i32 (i8*, i64, i64, %"struct._IO_FILE$link41"*, ...) bitcast (i32 (...)* @fwrite to i32 (i8*, i64, i64, %"struct._IO_FILE$link41"*, ...)*)(i8* %119, i64 1, i64 %122, %"struct._IO_FILE$link41"* %123)
%125 = load i32, i32* %11
%126 = add nsw i32 %125, 1
store i32 %126, i32* %11
br label %102
127: ; preds = %102
%128 = load i32, i32* %12
%129 = add nsw i32 %128, 1
store i32 %129, i32* %12
br label %92
130: ; preds = %92
%131 = load %"struct._IO_FILE$link41"*, %"struct._IO_FILE$link41"** %10
%132 = call i32 (%"struct._IO_FILE$link41"*, ...) bitcast (i32 (...)* @fclose to i32 (%"struct._IO_FILE$link41"*, ...)*)(%"struct._IO_FILE$link41"* %131)
store i32 0, i32* %5
br label %133
133: ; preds = %130, %31
%134 = load i32, i32* %5
ret i32 %134
}

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