#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);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fwrite(int *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
int main() {
  FILE *fp;
  struct Bimap_File_Header {
    unsigned short bftype;
    unsigned long bfsize;
    unsigned short bfreserved1;
    unsigned short bfreserved2;
    unsigned long bfoffbits;
  } bfh;
  bfh.bftype = 0x4d42;
  bfh.bfreserved1 = 0;
  bfh.bfreserved2 = 0;
  bfh.bfoffbits = 0x3e;
  struct Bitmap_File_Info_Header {
    unsigned long bfihsize;
    unsigned long width;
    unsigned long height;
    unsigned short biplanes;
    unsigned short bibitcount;
    unsigned long bicompression;
    unsigned long bisizeimage;
    unsigned long bixpelspermeter;
    unsigned long biypelspermeter;
    unsigned long biclrused;
    unsigned long biclrimportant;
  } bfih;
  bfih.bfihsize = 0x28;
  bfih.width = 300;
  bfih.height = 300;
  bfih.biplanes = 1;
  bfih.bibitcount = 1;
  bfih.bicompression = 0;
  bfih.bisizeimage = (300 / 32 * 4 + (300 % 32 ? 4 : 0)) * 300;
  bfih.bixpelspermeter = 0;
  bfih.biypelspermeter = 0;
  bfih.biclrused = 0;
  bfih.biclrimportant = 0;
  bfh.bfsize = 0x36 + 8 + bfih.bisizeimage;
  if ((fp = fopen("a.bmp", "wb+")) == NULL) {
    printf("error to open c:\\a.bmp!");
    exit(1);
  }
  fwrite(&bfh.bftype, 2, 1, fp);
  fwrite(&bfh.bfsize, 4, 1, fp);
  fwrite(&bfh.bfreserved1, 2, 1, fp);
  fwrite(&bfh.bfreserved2, 2, 1, fp);
  fwrite(&bfh.bfoffbits, 4, 1, fp);
  fwrite(&bfih.bfihsize, 4, 1, fp);
  fwrite(&bfih.width, 4, 1, fp);
  fwrite(&bfih.height, 4, 1, fp);
  fwrite(&bfih.biplanes, 2, 1, fp);
  fwrite(&bfih.bibitcount, 2, 1, fp);
  fwrite(&bfih.bicompression, 4, 1, fp);
  fwrite(&bfih.bisizeimage, 4, 1, fp);
  fwrite(&bfih.bixpelspermeter, 4, 1, fp);
  fwrite(&bfih.biypelspermeter, 4, 1, fp);
  fwrite(&bfih.biclrused, 4, 1, fp);
  fwrite(&bfih.biclrimportant, 4, 1, fp);
  struct RGB {
    unsigned short Blue;
    unsigned short Green;
    unsigned short Red;
    unsigned short Reserved;
  } rgb0, rgb1;
  rgb0.Blue = 0xff;
  rgb0.Green = 0xff;
  rgb0.Red = 0xff;
  rgb0.Reserved = 0;
  rgb1.Blue = 0x00;
  rgb1.Green = 0x00;
  rgb1.Red = 0x00;
  rgb1.Reserved = 0;
  fwrite(&rgb0.Blue, 1, 1, fp);
  fwrite(&rgb0.Green, 1, 1, fp);
  fwrite(&rgb0.Red, 1, 1, fp);
  fwrite(&rgb0.Reserved, 1, 1, fp);
  fwrite(&rgb1.Blue, 1, 1, fp);
  fwrite(&rgb1.Green, 1, 1, fp);
  fwrite(&rgb1.Red, 1, 1, fp);
  fwrite(&rgb1.Reserved, 1, 1, fp);
  int a[300][300], i, j, k = 0, n = 0, m = 0, c, b[32];
  for (i = 0; i < 300; i++) {
    for (j = 0; j < 300; j++) {
      if (j == i || i + j == 300 - 1) {
        a[i][j] = 1;
      } else {
        a[i][j] = 0;
      }
    }
  }
  for (i = 300 - 1; i >= 0; i--, j = 0) {
    if (300 % 32 == 0) {
      for (j = 0; j < 300; j++) {
        k = a[i][j] + k * 2;
        m++;
        if (m % 8 == 0) {
          fwrite(&k, 1, 1, fp);
          k = 0;
          m = 0;
        }
      }
    } else {
      if (300 >= 32) {
        n = 300 % 32;
        for (j = 0; j < 300 - n; j++) {
          k = a[i][j] + k * 2;
          m++;
          if (m % 8 == 0) {
            fwrite(&k, 1, 1, fp);
            k = 0;
            m = 0;
          }
        }
        for (c = 0; c < 32; c++, j++) {
          if (j < 300)
            b[c] = a[i][j];
          else
            b[c] = 0;
        }
        for (c = 0; c < 32; c++) {
          k = b[c] + k * 2;
          m++;
          if (m % 8 == 0) {
            fwrite(&k, 1, 1, fp);
            k = 0;
            m = 0;
          }
        }
      } else {
        for (c = 0; c < 32; c++, j++) {
          if (j < 300)
            b[c] = a[i][j];
          else
            b[c] = 0;
        }
        for (c = 0; c < 32; c++) {
          k = b[c] + k * 2;
          m++;
          if (m % 8 == 0) {
            fwrite(&k, 1, 1, fp);
            k = 0;
            m = 0;
          }
        }
      }
    }
  }
  fclose(fp);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x57f70,%rsp
movl   $0x0,-0x4(%rbp)
movw   $0x4d42,-0x30(%rbp)
movw   $0x0,-0x20(%rbp)
movw   $0x0,-0x1e(%rbp)
movq   $0x3e,-0x18(%rbp)
movq   $0x28,-0x80(%rbp)
movq   $0x12c,-0x78(%rbp)
movq   $0x12c,-0x70(%rbp)
movw   $0x1,-0x68(%rbp)
movw   $0x1,-0x66(%rbp)
movq   $0x0,-0x60(%rbp)
movq   $0x2ee0,-0x58(%rbp)
movq   $0x0,-0x50(%rbp)
movq   $0x0,-0x48(%rbp)
movq   $0x0,-0x40(%rbp)
movq   $0x0,-0x38(%rbp)
mov    -0x58(%rbp),%rax
add    $0x3e,%rax
mov    %rax,-0x28(%rbp)
lea    0xe1d(%rip),%rdi
lea    0xe1c(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1213 <main+0xc3>
lea    0xe06(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x2,%esi
mov    $0x1,%edx
call   1070 <fwrite@plt>
lea    -0x30(%rbp),%rdi
add    $0x8,%rdi
mov    -0x10(%rbp),%rcx
mov    $0x4,%esi
mov    $0x1,%edx
call   1070 <fwrite@plt>
lea    -0x30(%rbp),%rdi
add    $0x10,%rdi
mov    -0x10(%rbp),%rcx
mov    $0x2,%esi
mov    $0x1,%edx
call   1070 <fwrite@plt>
lea    -0x30(%rbp),%rdi
add    $0x12,%rdi
mov    -0x10(%rbp),%rcx
mov    $0x2,%esi
mov    $0x1,%edx
call   1070 <fwrite@plt>
lea    -0x30(%rbp),%rdi
add    $0x18,%rdi
mov    -0x10(%rbp),%rcx
mov    $0x4,%esi
mov    $0x1,%edx
call   1070 <fwrite@plt>
lea    -0x80(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x4,%esi
mov    $0x1,%edx
call   1070 <fwrite@plt>
lea    -0x80(%rbp),%rdi
add    $0x8,%rdi
mov    -0x10(%rbp),%rcx
mov    $0x4,%esi
mov    $0x1,%edx
call   1070 <fwrite@plt>
lea    -0x80(%rbp),%rdi
add    $0x10,%rdi
mov    -0x10(%rbp),%rcx
mov    $0x4,%esi
mov    $0x1,%edx
call   1070 <fwrite@plt>
lea    -0x80(%rbp),%rdi
add    $0x18,%rdi
mov    -0x10(%rbp),%rcx
mov    $0x2,%esi
mov    $0x1,%edx
call   1070 <fwrite@plt>
lea    -0x80(%rbp),%rdi
add    $0x1a,%rdi
mov    -0x10(%rbp),%rcx
mov    $0x2,%esi
mov    $0x1,%edx
call   1070 <fwrite@plt>
lea    -0x80(%rbp),%rdi
add    $0x20,%rdi
mov    -0x10(%rbp),%rcx
mov    $0x4,%esi
mov    $0x1,%edx
call   1070 <fwrite@plt>
lea    -0x80(%rbp),%rdi
add    $0x28,%rdi
mov    -0x10(%rbp),%rcx
mov    $0x4,%esi
mov    $0x1,%edx
call   1070 <fwrite@plt>
lea    -0x80(%rbp),%rdi
add    $0x30,%rdi
mov    -0x10(%rbp),%rcx
mov    $0x4,%esi
mov    $0x1,%edx
call   1070 <fwrite@plt>
lea    -0x80(%rbp),%rdi
add    $0x38,%rdi
mov    -0x10(%rbp),%rcx
mov    $0x4,%esi
mov    $0x1,%edx
call   1070 <fwrite@plt>
lea    -0x80(%rbp),%rdi
add    $0x40,%rdi
mov    -0x10(%rbp),%rcx
mov    $0x4,%esi
mov    $0x1,%edx
call   1070 <fwrite@plt>
lea    -0x80(%rbp),%rdi
add    $0x48,%rdi
mov    -0x10(%rbp),%rcx
mov    $0x4,%esi
mov    $0x1,%edx
call   1070 <fwrite@plt>
movw   $0xff,-0x88(%rbp)
movw   $0xff,-0x86(%rbp)
movw   $0xff,-0x84(%rbp)
movw   $0x0,-0x82(%rbp)
movw   $0x0,-0x90(%rbp)
movw   $0x0,-0x8e(%rbp)
movw   $0x0,-0x8c(%rbp)
movw   $0x0,-0x8a(%rbp)
lea    -0x88(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x1,%edx
mov    %edx,%esi
call   1070 <fwrite@plt>
lea    -0x88(%rbp),%rdi
add    $0x2,%rdi
mov    -0x10(%rbp),%rcx
mov    $0x1,%edx
mov    %edx,%esi
call   1070 <fwrite@plt>
lea    -0x88(%rbp),%rdi
add    $0x4,%rdi
mov    -0x10(%rbp),%rcx
mov    $0x1,%edx
mov    %edx,%esi
call   1070 <fwrite@plt>
lea    -0x88(%rbp),%rdi
add    $0x6,%rdi
mov    -0x10(%rbp),%rcx
mov    $0x1,%edx
mov    %edx,%esi
call   1070 <fwrite@plt>
lea    -0x90(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x1,%edx
mov    %edx,%esi
call   1070 <fwrite@plt>
lea    -0x90(%rbp),%rdi
add    $0x2,%rdi
mov    -0x10(%rbp),%rcx
mov    $0x1,%edx
mov    %edx,%esi
call   1070 <fwrite@plt>
lea    -0x90(%rbp),%rdi
add    $0x4,%rdi
mov    -0x10(%rbp),%rcx
mov    $0x1,%edx
mov    %edx,%esi
call   1070 <fwrite@plt>
lea    -0x90(%rbp),%rdi
add    $0x6,%rdi
mov    -0x10(%rbp),%rcx
mov    $0x1,%edx
mov    %edx,%esi
call   1070 <fwrite@plt>
movl   $0x0,-0x57edc(%rbp)
movl   $0x0,-0x57ee0(%rbp)
movl   $0x0,-0x57ee4(%rbp)
movl   $0x0,-0x57ed4(%rbp)
cmpl   $0x12c,-0x57ed4(%rbp)
jge    15d1 <main+0x481>
movl   $0x0,-0x57ed8(%rbp)
cmpl   $0x12c,-0x57ed8(%rbp)
jge    15b8 <main+0x468>
mov    -0x57ed8(%rbp),%eax
cmp    -0x57ed4(%rbp),%eax
je     154e <main+0x3fe>
mov    -0x57ed4(%rbp),%eax
add    -0x57ed8(%rbp),%eax
cmp    $0x12b,%eax
jne    1579 <main+0x429>
movslq -0x57ed4(%rbp),%rcx
lea    -0x57ed0(%rbp),%rax
imul   $0x4b0,%rcx,%rcx
add    %rcx,%rax
movslq -0x57ed8(%rbp),%rcx
movl   $0x1,(%rax,%rcx,4)
jmp    159f <main+0x44f>
movslq -0x57ed4(%rbp),%rcx
lea    -0x57ed0(%rbp),%rax
imul   $0x4b0,%rcx,%rcx
add    %rcx,%rax
movslq -0x57ed8(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
jmp    15a4 <main+0x454>
mov    -0x57ed8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x57ed8(%rbp)
jmp    1515 <main+0x3c5>
jmp    15bd <main+0x46d>
mov    -0x57ed4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x57ed4(%rbp)
jmp    14fb <main+0x3ab>
movl   $0x12b,-0x57ed4(%rbp)
cmpl   $0x0,-0x57ed4(%rbp)
jl     180b <main+0x6bb>
movl   $0xc,-0x57ee0(%rbp)
movl   $0x0,-0x57ed8(%rbp)
mov    -0x57ed8(%rbp),%eax
mov    $0x12c,%ecx
sub    -0x57ee0(%rbp),%ecx
cmp    %ecx,%eax
jge    16b2 <main+0x562>
movslq -0x57ed4(%rbp),%rcx
lea    -0x57ed0(%rbp),%rax
imul   $0x4b0,%rcx,%rcx
add    %rcx,%rax
movslq -0x57ed8(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x57edc(%rbp),%ecx
shl    $0x1,%ecx
add    %ecx,%eax
mov    %eax,-0x57edc(%rbp)
mov    -0x57ee4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x57ee4(%rbp)
mov    -0x57ee4(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1699 <main+0x549>
mov    -0x10(%rbp),%rcx
lea    -0x57edc(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1070 <fwrite@plt>
movl   $0x0,-0x57edc(%rbp)
movl   $0x0,-0x57ee4(%rbp)
jmp    169e <main+0x54e>
mov    -0x57ed8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x57ed8(%rbp)
jmp    15fc <main+0x4ac>
movl   $0x0,-0x57ee8(%rbp)
cmpl   $0x20,-0x57ee8(%rbp)
jge    1748 <main+0x5f8>
cmpl   $0x12c,-0x57ed8(%rbp)
jge    170e <main+0x5be>
movslq -0x57ed4(%rbp),%rcx
lea    -0x57ed0(%rbp),%rax
imul   $0x4b0,%rcx,%rcx
add    %rcx,%rax
movslq -0x57ed8(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
movslq -0x57ee8(%rbp),%rax
mov    %ecx,-0x57f70(%rbp,%rax,4)
jmp    1720 <main+0x5d0>
movslq -0x57ee8(%rbp),%rax
movl   $0x0,-0x57f70(%rbp,%rax,4)
jmp    1725 <main+0x5d5>
mov    -0x57ee8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x57ee8(%rbp)
mov    -0x57ed8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x57ed8(%rbp)
jmp    16bc <main+0x56c>
movl   $0x0,-0x57ee8(%rbp)
cmpl   $0x20,-0x57ee8(%rbp)
jge    17e8 <main+0x698>
movslq -0x57ee8(%rbp),%rax
mov    -0x57f70(%rbp,%rax,4),%eax
mov    -0x57edc(%rbp),%ecx
shl    $0x1,%ecx
add    %ecx,%eax
mov    %eax,-0x57edc(%rbp)
mov    -0x57ee4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x57ee4(%rbp)
mov    -0x57ee4(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    17cf <main+0x67f>
mov    -0x10(%rbp),%rcx
lea    -0x57edc(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1070 <fwrite@plt>
movl   $0x0,-0x57edc(%rbp)
movl   $0x0,-0x57ee4(%rbp)
jmp    17d4 <main+0x684>
mov    -0x57ee8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x57ee8(%rbp)
jmp    1752 <main+0x602>
jmp    17ed <main+0x69d>
mov    -0x57ed4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x57ed4(%rbp)
movl   $0x0,-0x57ed8(%rbp)
jmp    15db <main+0x48b>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x57f70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x57f38,%rsp
movw   $0x4d42,(%rsp)
movl   $0x0,0x10(%rsp)
movq   $0x3e,0x18(%rsp)
movaps 0xe71(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movq   $0x12c,0x30(%rsp)
movl   $0x10001,0x38(%rsp)
movaps 0xe64(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x60(%rsp)
movq   $0x2f1e,0x8(%rsp)
lea    0xe52(%rip),%rdi
lea    0xe51(%rip),%rsi
call   1060 <fopen@plt>
test   %rax,%rax
je     155c <main+0x3fc>
mov    %rax,%r14
lea    0x10(%rsp),%r12
lea    0x12(%rsp),%r15
lea    0x18(%rsp),%rbx
lea    0x8(%rsp),%r13
lea    0x28(%rsp),%rbp
mov    %rsp,%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1080 <fwrite@plt>
mov    %r13,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1080 <fwrite@plt>
mov    %r12,%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1080 <fwrite@plt>
mov    %r15,%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1080 <fwrite@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1080 <fwrite@plt>
lea    0x20(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1080 <fwrite@plt>
mov    %rbp,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1080 <fwrite@plt>
lea    0x30(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1080 <fwrite@plt>
lea    0x38(%rsp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1080 <fwrite@plt>
lea    0x3a(%rsp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1080 <fwrite@plt>
lea    0x40(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1080 <fwrite@plt>
lea    0x48(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1080 <fwrite@plt>
lea    0x50(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1080 <fwrite@plt>
lea    0x58(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1080 <fwrite@plt>
lea    0x60(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1080 <fwrite@plt>
lea    0x68(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1080 <fwrite@plt>
mov    $0xffffffff,%edi
mov    %r14,%rsi
call   1050 <fputc@plt>
mov    $0xffffffff,%edi
mov    %r14,%rsi
call   1050 <fputc@plt>
mov    $0xffffffff,%edi
mov    %r14,%rsi
call   1050 <fputc@plt>
xor    %ebx,%ebx
xor    %edi,%edi
mov    %r14,%rsi
call   1050 <fputc@plt>
xor    %edi,%edi
mov    %r14,%rsi
call   1050 <fputc@plt>
xor    %edi,%edi
mov    %r14,%rsi
call   1050 <fputc@plt>
xor    %edi,%edi
mov    %r14,%rsi
call   1050 <fputc@plt>
xor    %edi,%edi
mov    %r14,%rsi
call   1050 <fputc@plt>
lea    0xf4(%rsp),%rax
xor    %r8d,%r8d
nopl   0x0(%rax)
lea    -0x4(%rbx),%rdi
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
cmp    %rsi,%rbx
sete   %cl
lea    (%rbx,%rsi,1),%rbp
cmp    $0x4ac,%rbp
sete   %dl
or     %cl,%dl
movzbl %dl,%ecx
mov    %ecx,-0x4(%rax,%rsi,1)
cmp    %rsi,%rdi
sete   %cl
cmp    $0x4a8,%rbp
sete   %dl
or     %cl,%dl
movzbl %dl,%ecx
mov    %ecx,(%rax,%rsi,1)
add    $0x8,%rsi
cmp    $0x4b0,%rsi
jne    13e0 <main+0x280>
add    $0x1,%r8
add    $0x4,%rbx
add    $0x4b0,%rax
cmp    $0x12c,%r8
jne    13d0 <main+0x270>
lea    0x57a80(%rsp),%r12
lea    0x57f04(%rsp),%rbx
xor    %ecx,%ecx
mov    $0x12b,%r15d
xor    %eax,%eax
jmp    1478 <main+0x318>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0xfffffffffffffb50,%r12
add    $0xfffffffffffffb50,%rbx
sub    $0x1,%r15
jb     1540 <main+0x3e0>
xor    %ebp,%ebp
jmp    148d <main+0x32d>
nopl   0x0(%rax)
add    $0x1,%rbp
cmp    $0x120,%rbp
je     14b0 <main+0x350>
movzbl %al,%eax
add    %eax,%eax
add    (%r12,%rbp,4),%eax
add    $0x1,%ecx
test   $0x7,%cl
jne    1480 <main+0x320>
movsbl %al,%edi
mov    %r14,%rsi
call   1050 <fputc@plt>
xor    %eax,%eax
xor    %ecx,%ecx
jmp    1480 <main+0x320>
nop
xor    %edx,%edx
jmp    14d1 <main+0x371>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %edi,0x74(%rsp,%rdx,4)
add    $0x2,%rdx
cmp    $0x13e,%rsi
je     1500 <main+0x3a0>
lea    0x120(%rdx),%rsi
xor    %edi,%edi
mov    $0x0,%ebp
cmp    $0x12b,%rsi
ja     14ec <main+0x38c>
mov    -0x4(%rbx,%rdx,4),%ebp
mov    %ebp,0x70(%rsp,%rdx,4)
cmp    $0x12a,%rsi
ja     14c0 <main+0x360>
mov    (%rbx,%rdx,4),%edi
jmp    14c0 <main+0x360>
xchg   %ax,%ax
xor    %ebp,%ebp
jmp    151e <main+0x3be>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%rbp
cmp    $0x20,%rbp
je     1460 <main+0x300>
movzbl %al,%eax
add    %eax,%eax
add    0x70(%rsp,%rbp,4),%eax
add    $0x1,%ecx
test   $0x7,%cl
jne    1510 <main+0x3b0>
movsbl %al,%edi
mov    %r14,%rsi
call   1050 <fputc@plt>
xor    %eax,%eax
xor    %ecx,%ecx
jmp    1510 <main+0x3b0>
mov    %r14,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x57f38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xac7(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
%struct.Bimap_File_Header = type { i16, i64, i16, i16, i64 }
%struct.Bitmap_File_Info_Header = type { i64, i64, i64, i16, i16, i64, i64, i64, i64, i64, i64 }
%struct.RGB = type { i16, i16, i16, i16 }
@.str = [6 x i8] c"a.bmp\00"
@.str.1 = [4 x i8] c"wb+\00"
@.str.2 = [24 x i8] c"error to open c:\\a.bmp!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca %struct.Bimap_File_Header
%4 = alloca %struct.Bitmap_File_Info_Header
%5 = alloca %struct.RGB
%6 = alloca %struct.RGB
%7 = alloca [300 x [300 x i32]]
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca [32 x i32]
store i32 0, i32* %1
%15 = getelementptr inbounds %struct.Bimap_File_Header, %struct.Bimap_File_Header* %3, i32 0, i32 0
store i16 19778, i16* %15
%16 = getelementptr inbounds %struct.Bimap_File_Header, %struct.Bimap_File_Header* %3, i32 0, i32 2
store i16 0, i16* %16
%17 = getelementptr inbounds %struct.Bimap_File_Header, %struct.Bimap_File_Header* %3, i32 0, i32 3
store i16 0, i16* %17
%18 = getelementptr inbounds %struct.Bimap_File_Header, %struct.Bimap_File_Header* %3, i32 0, i32 4
store i64 62, i64* %18
%19 = getelementptr inbounds %struct.Bitmap_File_Info_Header, %struct.Bitmap_File_Info_Header* %4, i32 0, i32 0
store i64 40, i64* %19
%20 = getelementptr inbounds %struct.Bitmap_File_Info_Header, %struct.Bitmap_File_Info_Header* %4, i32 0, i32 1
store i64 300, i64* %20
%21 = getelementptr inbounds %struct.Bitmap_File_Info_Header, %struct.Bitmap_File_Info_Header* %4, i32 0, i32 2
store i64 300, i64* %21
%22 = getelementptr inbounds %struct.Bitmap_File_Info_Header, %struct.Bitmap_File_Info_Header* %4, i32 0, i32 3
store i16 1, i16* %22
%23 = getelementptr inbounds %struct.Bitmap_File_Info_Header, %struct.Bitmap_File_Info_Header* %4, i32 0, i32 4
store i16 1, i16* %23
%24 = getelementptr inbounds %struct.Bitmap_File_Info_Header, %struct.Bitmap_File_Info_Header* %4, i32 0, i32 5
store i64 0, i64* %24
%25 = getelementptr inbounds %struct.Bitmap_File_Info_Header, %struct.Bitmap_File_Info_Header* %4, i32 0, i32 6
store i64 12000, i64* %25
%26 = getelementptr inbounds %struct.Bitmap_File_Info_Header, %struct.Bitmap_File_Info_Header* %4, i32 0, i32 7
store i64 0, i64* %26
%27 = getelementptr inbounds %struct.Bitmap_File_Info_Header, %struct.Bitmap_File_Info_Header* %4, i32 0, i32 8
store i64 0, i64* %27
%28 = getelementptr inbounds %struct.Bitmap_File_Info_Header, %struct.Bitmap_File_Info_Header* %4, i32 0, i32 9
store i64 0, i64* %28
%29 = getelementptr inbounds %struct.Bitmap_File_Info_Header, %struct.Bitmap_File_Info_Header* %4, i32 0, i32 10
store i64 0, i64* %29
%30 = getelementptr inbounds %struct.Bitmap_File_Info_Header, %struct.Bitmap_File_Info_Header* %4, i32 0, i32 6
%31 = load i64, i64* %30
%32 = add i64 62, %31
%33 = getelementptr inbounds %struct.Bimap_File_Header, %struct.Bimap_File_Header* %3, i32 0, i32 1
store i64 %32, i64* %33
%34 = call i32* @fopen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
store i32* %34, i32** %2
%35 = icmp eq i32* %34, null
br i1 %35, label %36, label %39
36: ; preds = %0
%37 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%38 = call i32 @exit(i32 1)
unreachable
39: ; preds = %0
%40 = getelementptr inbounds %struct.Bimap_File_Header, %struct.Bimap_File_Header* %3, i32 0, i32 0
%41 = bitcast i16* %40 to i32*
%42 = load i32*, i32** %2
%43 = call i32 @fwrite(i32* %41, i32 2, i32 1, i32* %42)
%44 = getelementptr inbounds %struct.Bimap_File_Header, %struct.Bimap_File_Header* %3, i32 0, i32 1
%45 = bitcast i64* %44 to i32*
%46 = load i32*, i32** %2
%47 = call i32 @fwrite(i32* %45, i32 4, i32 1, i32* %46)
%48 = getelementptr inbounds %struct.Bimap_File_Header, %struct.Bimap_File_Header* %3, i32 0, i32 2
%49 = bitcast i16* %48 to i32*
%50 = load i32*, i32** %2
%51 = call i32 @fwrite(i32* %49, i32 2, i32 1, i32* %50)
%52 = getelementptr inbounds %struct.Bimap_File_Header, %struct.Bimap_File_Header* %3, i32 0, i32 3
%53 = bitcast i16* %52 to i32*
%54 = load i32*, i32** %2
%55 = call i32 @fwrite(i32* %53, i32 2, i32 1, i32* %54)
%56 = getelementptr inbounds %struct.Bimap_File_Header, %struct.Bimap_File_Header* %3, i32 0, i32 4
%57 = bitcast i64* %56 to i32*
%58 = load i32*, i32** %2
%59 = call i32 @fwrite(i32* %57, i32 4, i32 1, i32* %58)
%60 = getelementptr inbounds %struct.Bitmap_File_Info_Header, %struct.Bitmap_File_Info_Header* %4, i32 0, i32 0
%61 = bitcast i64* %60 to i32*
%62 = load i32*, i32** %2
%63 = call i32 @fwrite(i32* %61, i32 4, i32 1, i32* %62)
%64 = getelementptr inbounds %struct.Bitmap_File_Info_Header, %struct.Bitmap_File_Info_Header* %4, i32 0, i32 1
%65 = bitcast i64* %64 to i32*
%66 = load i32*, i32** %2
%67 = call i32 @fwrite(i32* %65, i32 4, i32 1, i32* %66)
%68 = getelementptr inbounds %struct.Bitmap_File_Info_Header, %struct.Bitmap_File_Info_Header* %4, i32 0, i32 2
%69 = bitcast i64* %68 to i32*
%70 = load i32*, i32** %2
%71 = call i32 @fwrite(i32* %69, i32 4, i32 1, i32* %70)
%72 = getelementptr inbounds %struct.Bitmap_File_Info_Header, %struct.Bitmap_File_Info_Header* %4, i32 0, i32 3
%73 = bitcast i16* %72 to i32*
%74 = load i32*, i32** %2
%75 = call i32 @fwrite(i32* %73, i32 2, i32 1, i32* %74)
%76 = getelementptr inbounds %struct.Bitmap_File_Info_Header, %struct.Bitmap_File_Info_Header* %4, i32 0, i32 4
%77 = bitcast i16* %76 to i32*
%78 = load i32*, i32** %2
%79 = call i32 @fwrite(i32* %77, i32 2, i32 1, i32* %78)
%80 = getelementptr inbounds %struct.Bitmap_File_Info_Header, %struct.Bitmap_File_Info_Header* %4, i32 0, i32 5
%81 = bitcast i64* %80 to i32*
%82 = load i32*, i32** %2
%83 = call i32 @fwrite(i32* %81, i32 4, i32 1, i32* %82)
%84 = getelementptr inbounds %struct.Bitmap_File_Info_Header, %struct.Bitmap_File_Info_Header* %4, i32 0, i32 6
%85 = bitcast i64* %84 to i32*
%86 = load i32*, i32** %2
%87 = call i32 @fwrite(i32* %85, i32 4, i32 1, i32* %86)
%88 = getelementptr inbounds %struct.Bitmap_File_Info_Header, %struct.Bitmap_File_Info_Header* %4, i32 0, i32 7
%89 = bitcast i64* %88 to i32*
%90 = load i32*, i32** %2
%91 = call i32 @fwrite(i32* %89, i32 4, i32 1, i32* %90)
%92 = getelementptr inbounds %struct.Bitmap_File_Info_Header, %struct.Bitmap_File_Info_Header* %4, i32 0, i32 8
%93 = bitcast i64* %92 to i32*
%94 = load i32*, i32** %2
%95 = call i32 @fwrite(i32* %93, i32 4, i32 1, i32* %94)
%96 = getelementptr inbounds %struct.Bitmap_File_Info_Header, %struct.Bitmap_File_Info_Header* %4, i32 0, i32 9
%97 = bitcast i64* %96 to i32*
%98 = load i32*, i32** %2
%99 = call i32 @fwrite(i32* %97, i32 4, i32 1, i32* %98)
%100 = getelementptr inbounds %struct.Bitmap_File_Info_Header, %struct.Bitmap_File_Info_Header* %4, i32 0, i32 10
%101 = bitcast i64* %100 to i32*
%102 = load i32*, i32** %2
%103 = call i32 @fwrite(i32* %101, i32 4, i32 1, i32* %102)
%104 = getelementptr inbounds %struct.RGB, %struct.RGB* %5, i32 0, i32 0
store i16 255, i16* %104
%105 = getelementptr inbounds %struct.RGB, %struct.RGB* %5, i32 0, i32 1
store i16 255, i16* %105
%106 = getelementptr inbounds %struct.RGB, %struct.RGB* %5, i32 0, i32 2
store i16 255, i16* %106
%107 = getelementptr inbounds %struct.RGB, %struct.RGB* %5, i32 0, i32 3
store i16 0, i16* %107
%108 = getelementptr inbounds %struct.RGB, %struct.RGB* %6, i32 0, i32 0
store i16 0, i16* %108
%109 = getelementptr inbounds %struct.RGB, %struct.RGB* %6, i32 0, i32 1
store i16 0, i16* %109
%110 = getelementptr inbounds %struct.RGB, %struct.RGB* %6, i32 0, i32 2
store i16 0, i16* %110
%111 = getelementptr inbounds %struct.RGB, %struct.RGB* %6, i32 0, i32 3
store i16 0, i16* %111
%112 = getelementptr inbounds %struct.RGB, %struct.RGB* %5, i32 0, i32 0
%113 = bitcast i16* %112 to i32*
%114 = load i32*, i32** %2
%115 = call i32 @fwrite(i32* %113, i32 1, i32 1, i32* %114)
%116 = getelementptr inbounds %struct.RGB, %struct.RGB* %5, i32 0, i32 1
%117 = bitcast i16* %116 to i32*
%118 = load i32*, i32** %2
%119 = call i32 @fwrite(i32* %117, i32 1, i32 1, i32* %118)
%120 = getelementptr inbounds %struct.RGB, %struct.RGB* %5, i32 0, i32 2
%121 = bitcast i16* %120 to i32*
%122 = load i32*, i32** %2
%123 = call i32 @fwrite(i32* %121, i32 1, i32 1, i32* %122)
%124 = getelementptr inbounds %struct.RGB, %struct.RGB* %5, i32 0, i32 3
%125 = bitcast i16* %124 to i32*
%126 = load i32*, i32** %2
%127 = call i32 @fwrite(i32* %125, i32 1, i32 1, i32* %126)
%128 = getelementptr inbounds %struct.RGB, %struct.RGB* %6, i32 0, i32 0
%129 = bitcast i16* %128 to i32*
%130 = load i32*, i32** %2
%131 = call i32 @fwrite(i32* %129, i32 1, i32 1, i32* %130)
%132 = getelementptr inbounds %struct.RGB, %struct.RGB* %6, i32 0, i32 1
%133 = bitcast i16* %132 to i32*
%134 = load i32*, i32** %2
%135 = call i32 @fwrite(i32* %133, i32 1, i32 1, i32* %134)
%136 = getelementptr inbounds %struct.RGB, %struct.RGB* %6, i32 0, i32 2
%137 = bitcast i16* %136 to i32*
%138 = load i32*, i32** %2
%139 = call i32 @fwrite(i32* %137, i32 1, i32 1, i32* %138)
%140 = getelementptr inbounds %struct.RGB, %struct.RGB* %6, i32 0, i32 3
%141 = bitcast i16* %140 to i32*
%142 = load i32*, i32** %2
%143 = call i32 @fwrite(i32* %141, i32 1, i32 1, i32* %142)
store i32 0, i32* %10
store i32 0, i32* %11
store i32 0, i32* %12
store i32 0, i32* %8
br label %144
144: ; preds = %179, %39
%145 = load i32, i32* %8
%146 = icmp slt i32 %145, 300
br i1 %146, label %147, label %182
147: ; preds = %144
store i32 0, i32* %9
br label %148
148: ; preds = %175, %147
%149 = load i32, i32* %9
%150 = icmp slt i32 %149, 300
br i1 %150, label %151, label %178
151: ; preds = %148
%152 = load i32, i32* %9
%153 = load i32, i32* %8
%154 = icmp eq i32 %152, %153
br i1 %154, label %160, label %155
155: ; preds = %151
%156 = load i32, i32* %8
%157 = load i32, i32* %9
%158 = add nsw i32 %156, %157
%159 = icmp eq i32 %158, 299
br i1 %159, label %160, label %167
160: ; preds = %155, %151
%161 = load i32, i32* %8
%162 = sext i32 %161 to i64
%163 = getelementptr inbounds [300 x [300 x i32]], [300 x [300 x i32]]* %7, i64 0, i64 %162
%164 = load i32, i32* %9
%165 = sext i32 %164 to i64
%166 = getelementptr inbounds [300 x i32], [300 x i32]* %163, i64 0, i64 %165
store i32 1, i32* %166
br label %174
167: ; preds = %155
%168 = load i32, i32* %8
%169 = sext i32 %168 to i64
%170 = getelementptr inbounds [300 x [300 x i32]], [300 x [300 x i32]]* %7, i64 0, i64 %169
%171 = load i32, i32* %9
%172 = sext i32 %171 to i64
%173 = getelementptr inbounds [300 x i32], [300 x i32]* %170, i64 0, i64 %172
store i32 0, i32* %173
br label %174
174: ; preds = %167, %160
br label %175
175: ; preds = %174
%176 = load i32, i32* %9
%177 = add nsw i32 %176, 1
store i32 %177, i32* %9
br label %148
178: ; preds = %148
br label %179
179: ; preds = %178
%180 = load i32, i32* %8
%181 = add nsw i32 %180, 1
store i32 %181, i32* %8
br label %144
182: ; preds = %144
store i32 299, i32* %8
br label %183
183: ; preds = %268, %182
%184 = load i32, i32* %8
%185 = icmp sge i32 %184, 0
br i1 %185, label %186, label %271
186: ; preds = %183
store i32 12, i32* %11
store i32 0, i32* %9
br label %187
187: ; preds = %212, %186
%188 = load i32, i32* %9
%189 = load i32, i32* %11
%190 = sub nsw i32 300, %189
%191 = icmp slt i32 %188, %190
br i1 %191, label %192, label %215
192: ; preds = %187
%193 = load i32, i32* %8
%194 = sext i32 %193 to i64
%195 = getelementptr inbounds [300 x [300 x i32]], [300 x [300 x i32]]* %7, i64 0, i64 %194
%196 = load i32, i32* %9
%197 = sext i32 %196 to i64
%198 = getelementptr inbounds [300 x i32], [300 x i32]* %195, i64 0, i64 %197
%199 = load i32, i32* %198
%200 = load i32, i32* %10
%201 = mul nsw i32 %200, 2
%202 = add nsw i32 %199, %201
store i32 %202, i32* %10
%203 = load i32, i32* %12
%204 = add nsw i32 %203, 1
store i32 %204, i32* %12
%205 = load i32, i32* %12
%206 = srem i32 %205, 8
%207 = icmp eq i32 %206, 0
br i1 %207, label %208, label %211
208: ; preds = %192
%209 = load i32*, i32** %2
%210 = call i32 @fwrite(i32* %10, i32 1, i32 1, i32* %209)
store i32 0, i32* %10
store i32 0, i32* %12
br label %211
211: ; preds = %208, %192
br label %212
212: ; preds = %211
%213 = load i32, i32* %9
%214 = add nsw i32 %213, 1
store i32 %214, i32* %9
br label %187
215: ; preds = %187
store i32 0, i32* %13
br label %216
216: ; preds = %238, %215
%217 = load i32, i32* %13
%218 = icmp slt i32 %217, 32
br i1 %218, label %219, label %243
219: ; preds = %216
%220 = load i32, i32* %9
%221 = icmp slt i32 %220, 300
br i1 %221, label %222, label %233
222: ; preds = %219
%223 = load i32, i32* %8
%224 = sext i32 %223 to i64
%225 = getelementptr inbounds [300 x [300 x i32]], [300 x [300 x i32]]* %7, i64 0, i64 %224
%226 = load i32, i32* %9
%227 = sext i32 %226 to i64
%228 = getelementptr inbounds [300 x i32], [300 x i32]* %225, i64 0, i64 %227
%229 = load i32, i32* %228
%230 = load i32, i32* %13
%231 = sext i32 %230 to i64
%232 = getelementptr inbounds [32 x i32], [32 x i32]* %14, i64 0, i64 %231
store i32 %229, i32* %232
br label %237
233: ; preds = %219
%234 = load i32, i32* %13
%235 = sext i32 %234 to i64
%236 = getelementptr inbounds [32 x i32], [32 x i32]* %14, i64 0, i64 %235
store i32 0, i32* %236
br label %237
237: ; preds = %233, %222
br label %238
238: ; preds = %237
%239 = load i32, i32* %13
%240 = add nsw i32 %239, 1
store i32 %240, i32* %13
%241 = load i32, i32* %9
%242 = add nsw i32 %241, 1
store i32 %242, i32* %9
br label %216
243: ; preds = %216
store i32 0, i32* %13
br label %244
244: ; preds = %264, %243
%245 = load i32, i32* %13
%246 = icmp slt i32 %245, 32
br i1 %246, label %247, label %267
247: ; preds = %244
%248 = load i32, i32* %13
%249 = sext i32 %248 to i64
%250 = getelementptr inbounds [32 x i32], [32 x i32]* %14, i64 0, i64 %249
%251 = load i32, i32* %250
%252 = load i32, i32* %10
%253 = mul nsw i32 %252, 2
%254 = add nsw i32 %251, %253
store i32 %254, i32* %10
%255 = load i32, i32* %12
%256 = add nsw i32 %255, 1
store i32 %256, i32* %12
%257 = load i32, i32* %12
%258 = srem i32 %257, 8
%259 = icmp eq i32 %258, 0
br i1 %259, label %260, label %263
260: ; preds = %247
%261 = load i32*, i32** %2
%262 = call i32 @fwrite(i32* %10, i32 1, i32 1, i32* %261)
store i32 0, i32* %10
store i32 0, i32* %12
br label %263
263: ; preds = %260, %247
br label %264
264: ; preds = %263
%265 = load i32, i32* %13
%266 = add nsw i32 %265, 1
store i32 %266, i32* %13
br label %244
267: ; preds = %244
br label %268
268: ; preds = %267
%269 = load i32, i32* %8
%270 = add nsw i32 %269, -1
store i32 %270, i32* %8
store i32 0, i32* %9
br label %183
271: ; preds = %183
%272 = load i32*, i32** %2
%273 = call i32 @fclose(i32* %272)
ret i32 0
}

LLVM IR (-O2):
%struct.Bimap_File_Header = type { i16, i64, i16, i16, i64 }
%struct.Bitmap_File_Info_Header = type { i64, i64, i64, i16, i16, i64, i64, i64, i64, i64, i64 }
@.str = [6 x i8] c"a.bmp\00"
@.str.1 = [4 x i8] c"wb+\00"
@.str.2 = [24 x i8] c"error to open c:\\a.bmp!\00"
define i32 @main() {
%1 = alloca %struct.Bimap_File_Header
%2 = alloca %struct.Bitmap_File_Info_Header
%3 = alloca [300 x [300 x i32]]
%4 = alloca [32 x i32]
%5 = bitcast %struct.Bimap_File_Header* %1 to i8*
%6 = getelementptr inbounds %struct.Bimap_File_Header, %struct.Bimap_File_Header* %1, i64 0, i32 0
store i16 19778, i16* %6
%7 = getelementptr inbounds %struct.Bimap_File_Header, %struct.Bimap_File_Header* %1, i64 0, i32 2
store i16 0, i16* %7
%8 = getelementptr inbounds %struct.Bimap_File_Header, %struct.Bimap_File_Header* %1, i64 0, i32 3
store i16 0, i16* %8
%9 = getelementptr inbounds %struct.Bimap_File_Header, %struct.Bimap_File_Header* %1, i64 0, i32 4
store i64 62, i64* %9
%10 = bitcast %struct.Bitmap_File_Info_Header* %2 to i8*
%11 = bitcast %struct.Bitmap_File_Info_Header* %2 to <2 x i64>*
store <2 x i64> <i64 40, i64 300>, <2 x i64>* %11
%12 = getelementptr inbounds %struct.Bitmap_File_Info_Header, %struct.Bitmap_File_Info_Header* %2, i64 0, i32 2
store i64 300, i64* %12
%13 = getelementptr inbounds %struct.Bitmap_File_Info_Header, %struct.Bitmap_File_Info_Header* %2, i64 0, i32 3
store i16 1, i16* %13
%14 = getelementptr inbounds %struct.Bitmap_File_Info_Header, %struct.Bitmap_File_Info_Header* %2, i64 0, i32 4
store i16 1, i16* %14
%15 = getelementptr inbounds %struct.Bitmap_File_Info_Header, %struct.Bitmap_File_Info_Header* %2, i64 0, i32 5
%16 = bitcast i64* %15 to <2 x i64>*
store <2 x i64> <i64 0, i64 12000>, <2 x i64>* %16
%17 = getelementptr inbounds %struct.Bitmap_File_Info_Header, %struct.Bitmap_File_Info_Header* %2, i64 0, i32 7
%18 = getelementptr inbounds %struct.Bimap_File_Header, %struct.Bimap_File_Header* %1, i64 0, i32 1
%19 = bitcast i64* %17 to i8*
store i64 12062, i64* %18
%20 = tail call i32* @fopen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%21 = icmp eq i32* %20, null
br i1 %21, label %22, label %25
22: ; preds = %0
%23 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%24 = tail call i32 @exit(i32 1)
unreachable
25: ; preds = %0
%26 = getelementptr inbounds %struct.Bitmap_File_Info_Header, %struct.Bitmap_File_Info_Header* %2, i64 0, i32 6
%27 = getelementptr inbounds %struct.Bitmap_File_Info_Header, %struct.Bitmap_File_Info_Header* %2, i64 0, i32 1
%28 = getelementptr inbounds %struct.Bitmap_File_Info_Header, %struct.Bitmap_File_Info_Header* %2, i64 0, i32 10
%29 = getelementptr inbounds %struct.Bitmap_File_Info_Header, %struct.Bitmap_File_Info_Header* %2, i64 0, i32 9
%30 = getelementptr inbounds %struct.Bitmap_File_Info_Header, %struct.Bitmap_File_Info_Header* %2, i64 0, i32 8
%31 = bitcast %struct.Bimap_File_Header* %1 to i32*
%32 = call i32 @fwrite(i32* %31, i32 2, i32 1, i32* %20)
%33 = bitcast i64* %18 to i32*
%34 = call i32 @fwrite(i32* %33, i32 4, i32 1, i32* %20)
%35 = bitcast i16* %7 to i32*
%36 = call i32 @fwrite(i32* %35, i32 2, i32 1, i32* %20)
%37 = bitcast i16* %8 to i32*
%38 = call i32 @fwrite(i32* %37, i32 2, i32 1, i32* %20)
%39 = bitcast i64* %9 to i32*
%40 = call i32 @fwrite(i32* %39, i32 4, i32 1, i32* %20)
%41 = bitcast %struct.Bitmap_File_Info_Header* %2 to i32*
%42 = call i32 @fwrite(i32* %41, i32 4, i32 1, i32* %20)
%43 = bitcast i64* %27 to i32*
%44 = call i32 @fwrite(i32* %43, i32 4, i32 1, i32* %20)
%45 = bitcast i64* %12 to i32*
%46 = call i32 @fwrite(i32* %45, i32 4, i32 1, i32* %20)
%47 = bitcast i16* %13 to i32*
%48 = call i32 @fwrite(i32* %47, i32 2, i32 1, i32* %20)
%49 = bitcast i16* %14 to i32*
%50 = call i32 @fwrite(i32* %49, i32 2, i32 1, i32* %20)
%51 = bitcast i64* %15 to i32*
%52 = call i32 @fwrite(i32* %51, i32 4, i32 1, i32* %20)
%53 = bitcast i64* %26 to i32*
%54 = call i32 @fwrite(i32* %53, i32 4, i32 1, i32* %20)
%55 = bitcast i64* %17 to i32*
%56 = call i32 @fwrite(i32* %55, i32 4, i32 1, i32* %20)
%57 = bitcast i64* %30 to i32*
%58 = call i32 @fwrite(i32* %57, i32 4, i32 1, i32* %20)
%59 = bitcast i64* %29 to i32*
%60 = call i32 @fwrite(i32* %59, i32 4, i32 1, i32* %20)
%61 = bitcast i64* %28 to i32*
%62 = call i32 @fwrite(i32* %61, i32 4, i32 1, i32* %20)
%63 = tail call i32 @fputc(i32 -1, i32* %20)
%64 = tail call i32 @fputc(i32 -1, i32* %20)
%65 = tail call i32 @fputc(i32 -1, i32* %20)
%66 = tail call i32 @fputc(i32 0, i32* %20)
%67 = tail call i32 @fputc(i32 0, i32* %20)
%68 = tail call i32 @fputc(i32 0, i32* %20)
%69 = tail call i32 @fputc(i32 0, i32* %20)
%70 = tail call i32 @fputc(i32 0, i32* %20)
%71 = bitcast [300 x [300 x i32]]* %3 to i8*
%72 = bitcast [32 x i32]* %4 to i8*
br label %73
73: ; preds = %25, %92
%74 = phi i64 [ 0, %25 ], [ %93, %92 ]
br label %75
75: ; preds = %75, %73
%76 = phi i64 [ 0, %73 ], [ %90, %75 ]
%77 = icmp eq i64 %76, %74
%78 = add nuw nsw i64 %76, %74
%79 = icmp eq i64 %78, 299
%80 = select i1 %77, i1 true, i1 %79
%81 = zext i1 %80 to i32
%82 = getelementptr inbounds [300 x [300 x i32]], [300 x [300 x i32]]* %3, i64 0, i64 %74, i64 %76
store i32 %81, i32* %82
%83 = or i64 %76, 1
%84 = icmp eq i64 %83, %74
%85 = add nuw nsw i64 %83, %74
%86 = icmp eq i64 %85, 299
%87 = select i1 %84, i1 true, i1 %86
%88 = zext i1 %87 to i32
%89 = getelementptr inbounds [300 x [300 x i32]], [300 x [300 x i32]]* %3, i64 0, i64 %74, i64 %83
store i32 %88, i32* %89
%90 = add nuw nsw i64 %76, 2
%91 = icmp eq i64 %90, 300
br i1 %91, label %92, label %75
92: ; preds = %75
%93 = add nuw nsw i64 %74, 1
%94 = icmp eq i64 %93, 300
br i1 %94, label %95, label %73
95: ; preds = %92, %165
%96 = phi i64 [ %166, %165 ], [ 299, %92 ]
%97 = phi i32 [ %162, %165 ], [ 0, %92 ]
%98 = phi i8 [ %161, %165 ], [ 0, %92 ]
br label %99
99: ; preds = %95, %116
%100 = phi i64 [ 0, %95 ], [ %119, %116 ]
%101 = phi i32 [ %97, %95 ], [ %118, %116 ]
%102 = phi i8 [ %98, %95 ], [ %117, %116 ]
%103 = getelementptr inbounds [300 x [300 x i32]], [300 x [300 x i32]]* %3, i64 0, i64 %96, i64 %100
%104 = load i32, i32* %103
%105 = zext i8 %102 to i32
%106 = shl nuw nsw i32 %105, 1
%107 = add i32 %106, %104
%108 = trunc i32 %107 to i8
%109 = add nsw i32 %101, 1
%110 = and i32 %109, 7
%111 = icmp eq i32 %110, 0
br i1 %111, label %112, label %116
112: ; preds = %99
%113 = shl i32 %107, 24
%114 = ashr exact i32 %113, 24
%115 = tail call i32 @fputc(i32 %114, i32* %20)
br label %116
116: ; preds = %99, %112
%117 = phi i8 [ 0, %112 ], [ %108, %99 ]
%118 = phi i32 [ 0, %112 ], [ %109, %99 ]
%119 = add nuw nsw i64 %100, 1
%120 = icmp eq i64 %119, 288
br i1 %120, label %121, label %99
121: ; preds = %116, %137
%122 = phi i64 [ %141, %137 ], [ 288, %116 ]
%123 = phi i64 [ %140, %137 ], [ 0, %116 ]
%124 = icmp ult i64 %122, 300
br i1 %124, label %125, label %128
125: ; preds = %121
%126 = getelementptr inbounds [300 x [300 x i32]], [300 x [300 x i32]]* %3, i64 0, i64 %96, i64 %122
%127 = load i32, i32* %126
br label %128
128: ; preds = %121, %125
%129 = phi i32 [ %127, %125 ], [ 0, %121 ]
%130 = getelementptr inbounds [32 x i32], [32 x i32]* %4, i64 0, i64 %123
store i32 %129, i32* %130
%131 = or i64 %123, 1
%132 = icmp ult i64 %122, 299
br i1 %132, label %133, label %137
133: ; preds = %128
%134 = or i64 %122, 1
%135 = getelementptr inbounds [300 x [300 x i32]], [300 x [300 x i32]]* %3, i64 0, i64 %96, i64 %134
%136 = load i32, i32* %135
br label %137
137: ; preds = %133, %128
%138 = phi i32 [ %136, %133 ], [ 0, %128 ]
%139 = getelementptr inbounds [32 x i32], [32 x i32]* %4, i64 0, i64 %131
store i32 %138, i32* %139
%140 = add nuw nsw i64 %123, 2
%141 = add nuw nsw i64 %122, 2
%142 = icmp eq i64 %140, 32
br i1 %142, label %143, label %121
143: ; preds = %137, %160
%144 = phi i64 [ %163, %160 ], [ 0, %137 ]
%145 = phi i32 [ %162, %160 ], [ %118, %137 ]
%146 = phi i8 [ %161, %160 ], [ %117, %137 ]
%147 = getelementptr inbounds [32 x i32], [32 x i32]* %4, i64 0, i64 %144
%148 = load i32, i32* %147
%149 = zext i8 %146 to i32
%150 = shl nuw nsw i32 %149, 1
%151 = add i32 %150, %148
%152 = trunc i32 %151 to i8
%153 = add nsw i32 %145, 1
%154 = and i32 %153, 7
%155 = icmp eq i32 %154, 0
br i1 %155, label %156, label %160
156: ; preds = %143
%157 = shl i32 %151, 24
%158 = ashr exact i32 %157, 24
%159 = tail call i32 @fputc(i32 %158, i32* %20)
br label %160
160: ; preds = %143, %156
%161 = phi i8 [ 0, %156 ], [ %152, %143 ]
%162 = phi i32 [ 0, %156 ], [ %153, %143 ]
%163 = add nuw nsw i64 %144, 1
%164 = icmp eq i64 %163, 32
br i1 %164, label %165, label %143
165: ; preds = %160
%166 = add nsw i64 %96, -1
%167 = icmp eq i64 %96, 0
br i1 %167, label %168, label %95
168: ; preds = %165
%169 = tail call i32 @fclose(i32* %20)
ret i32 0
}