#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 const *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int, int, char, char,
                           ...);
int /*<<< orphan*/ fputc(unsigned char, int /*<<< orphan*/ *);
void SaveBMPFile(unsigned char **image, const char *outputdestination,
                 int width, int height) {
  int x, y, j;
  FILE *fd_out;
  unsigned long ulBitmapSize = (height * width * 3) + 54;
  char ucaBitmapSize[4];
  ucaBitmapSize[3] = (ulBitmapSize & 0xFF000000) >> 24;
  ucaBitmapSize[2] = (ulBitmapSize & 0x00FF0000) >> 16;
  ucaBitmapSize[1] = (ulBitmapSize & 0x0000FF00) >> 8;
  ucaBitmapSize[0] = (ulBitmapSize & 0x000000FF);
  fd_out = fopen(outputdestination, "wb");
  fprintf(fd_out, "%c%c%c%c%c%c%c%c%c%c", 66, 77, ucaBitmapSize[0],
          ucaBitmapSize[1], ucaBitmapSize[2], ucaBitmapSize[3], 0, 0, 0, 0);
  fprintf(fd_out, "%c%c%c%c%c%c%c%c%c%c", 54, 0, 0, 0, 40, 0, 0, 0,
          (width & 0x00FF), (width & 0xFF00) >> 8);
  fprintf(fd_out, "%c%c%c%c%c%c%c%c%c%c", 0, 0, (height & 0x00FF),
          (height & 0xFF00) >> 8, 0, 0, 1, 0, 24, 0);
  fprintf(fd_out, "%c%c%c%c%c%c%c%c%c%c", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
  fprintf(fd_out, "%c%c%c%c%c%c%c%c%c%c", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
  fprintf(fd_out, "%c%c%c%c", 0, 0, 0, 0);
  for (y = 0; y < height; y++) {
    for (x = 0; x < width; x++) {
      fputc(image[x][y], fd_out);
      fputc(image[x][y], fd_out);
      fputc(image[x][y], fd_out);
    }
    int over = width % 4;
    if (over != 0) {
      for (j = 0; j < over; j++) {
        fputc(0, fd_out);
      }
    }
  }
  fclose(fd_out);
}


x86 assembly (clang, -O0):
<SaveBMPFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x18(%rbp),%eax
imul   -0x14(%rbp),%eax
imul   $0x3,%eax,%eax
add    $0x36,%eax
cltq
mov    %rax,-0x38(%rbp)
movabs $0xff000000,%rax
and    -0x38(%rbp),%rax
shr    $0x18,%rax
mov    %al,-0x39(%rbp)
mov    -0x38(%rbp),%rax
and    $0xff0000,%rax
shr    $0x10,%rax
mov    %al,-0x3a(%rbp)
mov    -0x38(%rbp),%rax
and    $0xff00,%rax
shr    $0x8,%rax
mov    %al,-0x3b(%rbp)
mov    -0x38(%rbp),%rax
and    $0xff,%rax
mov    %al,-0x3c(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe48(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x3c(%rbp),%r8b
mov    -0x3b(%rbp),%r9b
movsbl -0x3a(%rbp),%r10d
movsbl -0x39(%rbp),%eax
lea    0xe26(%rip),%rsi
mov    $0x42,%edx
mov    $0x4d,%ecx
xor    %r11d,%r11d
movsbl %r8b,%r8d
movsbl %r9b,%r9d
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x0,0x18(%rsp)
movl   $0x0,0x20(%rsp)
movl   $0x0,0x28(%rsp)
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x30(%rbp),%rdi
mov    -0x14(%rbp),%r10d
and    $0xff,%r10d
mov    -0x14(%rbp),%eax
and    $0xff00,%eax
sar    $0x8,%eax
lea    0xdc1(%rip),%rsi
mov    $0x36,%edx
xor    %r9d,%r9d
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x28,(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x0,0x18(%rsp)
mov    %r10d,0x20(%rsp)
mov    %eax,0x28(%rsp)
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%eax
and    $0xff,%eax
mov    %al,%r8b
mov    -0x18(%rbp),%eax
and    $0xff00,%eax
sar    $0x8,%eax
lea    0xd63(%rip),%rsi
xor    %ecx,%ecx
mov    %ecx,%edx
movsbl %r8b,%r8d
movsbl %al,%r9d
movl   $0x0,(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x1,0x10(%rsp)
movl   $0x0,0x18(%rsp)
movl   $0x18,0x20(%rsp)
movl   $0x0,0x28(%rsp)
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xd16(%rip),%rsi
xor    %r9d,%r9d
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x0,(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x0,0x18(%rsp)
movl   $0x0,0x20(%rsp)
movl   $0x0,0x28(%rsp)
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xcc9(%rip),%rsi
xor    %r9d,%r9d
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x0,(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x0,0x18(%rsp)
movl   $0x0,0x20(%rsp)
movl   $0x0,0x28(%rsp)
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xc88(%rip),%rsi
xor    %r9d,%r9d
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
mov    $0x0,%al
call   1050 <fprintf@plt>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1487 <SaveBMPFile+0x347>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    142b <SaveBMPFile+0x2eb>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    -0x30(%rbp),%rsi
movzbl %al,%edi
call   1040 <fputc@plt>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    -0x30(%rbp),%rsi
movzbl %al,%edi
call   1040 <fputc@plt>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    -0x30(%rbp),%rsi
movzbl %al,%edi
call   1040 <fputc@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    13b4 <SaveBMPFile+0x274>
mov    -0x14(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %edx,-0x40(%rbp)
cmpl   $0x0,-0x40(%rbp)
je     1474 <SaveBMPFile+0x334>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x40(%rbp),%eax
jge    146f <SaveBMPFile+0x32f>
mov    -0x30(%rbp),%rsi
xor    %edi,%edi
call   1040 <fputc@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    144a <SaveBMPFile+0x30a>
jmp    1474 <SaveBMPFile+0x334>
jmp    1479 <SaveBMPFile+0x339>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    13a1 <SaveBMPFile+0x261>
mov    -0x30(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SaveBMPFile>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %ecx,0x8(%rsp)
mov    %edx,%r15d
mov    %rsi,%rax
mov    %rdi,%r14
imul   %ecx,%edx
lea    (%rdx,%rdx,2),%ebx
add    $0x36,%ebx
mov    %ebx,%ebp
shr    $0x8,%ebp
lea    0xe90(%rip),%rsi
mov    %rax,%rdi
call   1060 <fopen@plt>
mov    %rax,%r13
mov    %ebx,%eax
shr    $0x10,%eax
movsbl %al,%r10d
mov    %ebx,%r11d
sar    $0x18,%r11d
movsbl %bl,%r8d
movsbl %bpl,%r9d
lea    0xe69(%rip),%r12
mov    %r13,%rdi
mov    %r12,%rsi
mov    $0x42,%edx
mov    $0x4d,%ecx
xor    %eax,%eax
push   $0x0
push   $0x0
push   $0x0
push   $0x0
push   %r11
push   %r10
call   1050 <fprintf@plt>
add    $0x30,%rsp
mov    %r15,%rax
movzbl %al,%ebp
mov    %r15,0x10(%rsp)
movzbl %ah,%ebx
mov    %r13,%rdi
mov    %r12,%rsi
mov    $0x36,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
xor    %eax,%eax
push   %rbx
push   %rbp
push   $0x0
push   $0x0
push   $0x0
push   $0x28
call   1050 <fprintf@plt>
add    $0x30,%rsp
mov    0x8(%rsp),%ebp
mov    %ebp,%eax
shr    $0x8,%eax
movsbl %bpl,%r8d
movsbl %al,%r9d
mov    %r13,%rdi
mov    %r12,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %eax,%eax
push   $0x0
push   $0x18
push   $0x0
push   $0x1
push   $0x0
push   $0x0
call   1050 <fprintf@plt>
add    $0x30,%rsp
mov    %r13,%rdi
mov    %r12,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
xor    %eax,%eax
push   $0x0
push   $0x0
push   $0x0
push   $0x0
push   $0x0
push   $0x0
call   1050 <fprintf@plt>
add    $0x30,%rsp
mov    %r13,%rdi
mov    %r12,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
xor    %eax,%eax
push   $0x0
push   $0x0
push   $0x0
push   $0x0
push   $0x0
push   $0x0
call   1050 <fprintf@plt>
add    $0x30,%rsp
lea    0xd91(%rip),%rsi
mov    %r13,%rdi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
xor    %eax,%eax
call   1050 <fprintf@plt>
test   %ebp,%ebp
jle    1344 <SaveBMPFile+0x204>
mov    %ebp,%edx
mov    0x10(%rsp),%rcx
lea    0x3(%rcx),%eax
test   %ecx,%ecx
cmovns %ecx,%eax
and    $0xfffffffc,%eax
mov    %ecx,%r15d
sub    %eax,%r15d
mov    %ebp,%eax
mov    %rax,0x8(%rsp)
mov    %ecx,%r12d
xor    %ebp,%ebp
jmp    12cb <SaveBMPFile+0x18b>
add    $0x1,%rbp
cmp    0x8(%rsp),%rbp
je     1344 <SaveBMPFile+0x204>
cmpl   $0x0,0x10(%rsp)
jle    1319 <SaveBMPFile+0x1d9>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%r14,%rbx,8),%rax
movzbl (%rax,%rbp,1),%edi
mov    %r13,%rsi
call   1040 <fputc@plt>
mov    (%r14,%rbx,8),%rax
movzbl (%rax,%rbp,1),%edi
mov    %r13,%rsi
call   1040 <fputc@plt>
mov    (%r14,%rbx,8),%rax
movzbl (%rax,%rbp,1),%edi
mov    %r13,%rsi
call   1040 <fputc@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    12e0 <SaveBMPFile+0x1a0>
mov    %r15d,%eax
test   %r15d,%r15d
jle    12c0 <SaveBMPFile+0x180>
mov    %r15d,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %edi,%edi
mov    %r13,%rsi
call   1040 <fputc@plt>
add    $0xffffffff,%ebx
jne    1330 <SaveBMPFile+0x1f0>
jmp    12c0 <SaveBMPFile+0x180>
mov    %r13,%rdi
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <fclose@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"wb\00"
@.str.1 = [21 x i8] c"%c%c%c%c%c%c%c%c%c%c\00"
@.str.2 = [9 x i8] c"%c%c%c%c\00"
define void @SaveBMPFile(i8** nocapture %0, i8* nocapture %1, i32 %2, i32 %3) {
%5 = mul i32 %2, 3
%6 = mul i32 %5, %3
%7 = add nsw i32 %6, 54
%8 = lshr i32 %7, 8
%9 = trunc i32 %8 to i8
%10 = trunc i32 %7 to i8
%11 = tail call i32* @fopen(i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%12 = shl i32 %7, 8
%13 = ashr i32 %12, 24
%14 = ashr i32 %7, 24
%15 = tail call i32 (i32*, i8*, i32, i32, i8, i8, ...) @fprintf(i32* %11, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 66, i32 77, i8 signext %10, i8 signext %9, i32 %13, i32 %14, i32 0, i32 0, i32 0, i32 0)
%16 = and i32 %2, 255
%17 = lshr i32 %2, 8
%18 = and i32 %17, 255
%19 = tail call i32 (i32*, i8*, i32, i32, i8, i8, ...) @fprintf(i32* %11, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 54, i32 0, i8 signext 0, i8 signext 0, i32 40, i32 0, i32 0, i32 0, i32 %16, i32 %18)
%20 = trunc i32 %3 to i8
%21 = lshr i32 %3, 8
%22 = trunc i32 %21 to i8
%23 = tail call i32 (i32*, i8*, i32, i32, i8, i8, ...) @fprintf(i32* %11, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 0, i8 signext %20, i8 signext %22, i32 0, i32 0, i32 1, i32 0, i32 24, i32 0)
%24 = tail call i32 (i32*, i8*, i32, i32, i8, i8, ...) @fprintf(i32* %11, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 0, i8 signext 0, i8 signext 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
%25 = tail call i32 (i32*, i8*, i32, i32, i8, i8, ...) @fprintf(i32* %11, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 0, i8 signext 0, i8 signext 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
%26 = tail call i32 (i32*, i8*, i32, i32, i8, i8, ...) @fprintf(i32* %11, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 0, i32 0, i8 signext 0, i8 signext 0)
%27 = icmp sgt i32 %3, 0
br i1 %27, label %28, label %62
28: ; preds = %4
%29 = icmp sgt i32 %2, 0
%30 = srem i32 %2, 4
%31 = icmp slt i32 %30, 1
%32 = zext i32 %3 to i64
%33 = zext i32 %2 to i64
br label %34
34: ; preds = %28, %59
%35 = phi i64 [ 0, %28 ], [ %60, %59 ]
br i1 %29, label %36, label %53
36: ; preds = %34, %36
%37 = phi i64 [ %51, %36 ], [ 0, %34 ]
%38 = getelementptr inbounds i8*, i8** %0, i64 %37
%39 = load i8*, i8** %38
%40 = getelementptr inbounds i8, i8* %39, i64 %35
%41 = load i8, i8* %40
%42 = tail call i32 @fputc(i8 zeroext %41, i32* %11)
%43 = load i8*, i8** %38
%44 = getelementptr inbounds i8, i8* %43, i64 %35
%45 = load i8, i8* %44
%46 = tail call i32 @fputc(i8 zeroext %45, i32* %11)
%47 = load i8*, i8** %38
%48 = getelementptr inbounds i8, i8* %47, i64 %35
%49 = load i8, i8* %48
%50 = tail call i32 @fputc(i8 zeroext %49, i32* %11)
%51 = add nuw nsw i64 %37, 1
%52 = icmp eq i64 %51, %33
br i1 %52, label %53, label %36
53: ; preds = %36, %34
br i1 %31, label %59, label %54
54: ; preds = %53, %54
%55 = phi i32 [ %57, %54 ], [ 0, %53 ]
%56 = tail call i32 @fputc(i8 zeroext 0, i32* %11)
%57 = add nuw nsw i32 %55, 1
%58 = icmp eq i32 %57, %30
br i1 %58, label %59, label %54
59: ; preds = %54, %53
%60 = add nuw nsw i64 %35, 1
%61 = icmp eq i64 %60, %32
br i1 %61, label %62, label %34
62: ; preds = %59, %4
%63 = tail call i32 @fclose(i32* %11)
ret void
}