#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 */

/* Variables and functions */
int /*<<< orphan*/ close(int);
int open(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ read(int, ...);
int vmwLoadPCX(char *filename, char *raw_image) {
  int pcx_fd, debug = 1, bpp;
  int x, y;
  int i, numacross;
  int xsize, ysize, plane;
  int xmin, ymin, xmax, ymax, version;
  unsigned char pcx_header[128];
  unsigned char temp_byte;
  pcx_fd = open(filename, 0x0000, 0);
  if (pcx_fd < 0) {
    printf("ERROR!  File \"%s\" not found!\n", filename);
    return -1;
  }
  read(pcx_fd, &pcx_header, 128);
  xmin = (pcx_header[5] << 8) + pcx_header[4];
  ymin = (pcx_header[7] << 8) + pcx_header[6];
  xmax = (pcx_header[9] << 8) + pcx_header[8];
  ymax = (pcx_header[11] << 8) + pcx_header[10];
  version = pcx_header[1];
  bpp = pcx_header[3];
  if (debug) {
    printf("Manufacturer: ");
    if (pcx_header[0] == 10)
      printf("Zsoft\n");
    else
      printf("Unknown %d\n", pcx_header[0]);
    printf("Version: ");
    switch (version) {
    case 0:
      printf("2.5\n");
      break;
    case 2:
      printf("2.8 w palette\n");
      break;
    case 3:
      printf("2.8 w/o palette\n");
      break;
    case 4:
      printf("Paintbrush for Windows\n");
      break;
    case 5:
      printf("3.0+\n");
      break;
    default:
      printf("Unknown %i\n", version);
    }
    printf("Encoding: ");
    if (pcx_header[2] == 1)
      printf("RLE\n");
    else
      printf("Unknown %d\n", pcx_header[2]);
    printf("BitsPerPixelPerPlane: %d\n", bpp);
    printf("File goes from %i,%i to %i,%i\n", xmin, ymin, xmax, ymax);
    printf("Horizontal DPI: %i\n", (pcx_header[13] << 8) + pcx_header[12]);
    printf("Vertical   DPI: %i\n", (pcx_header[15] << 8) + pcx_header[14]);
    printf("Number of colored planes: %i\n", pcx_header[65]);
    printf("Bytes per line: %i\n", (pcx_header[67] << 8) + pcx_header[66]);
    printf("Palette Type: %i\n", (pcx_header[69] << 8) + pcx_header[68]);
    printf("Hscreen Size: %i\n", (pcx_header[71] << 8) + pcx_header[70]);
    printf("Vscreen Size: %i\n", (pcx_header[73] << 8) + pcx_header[72]);
  }
  xsize = ((xmax - xmin) + 1);
  ysize = ((ymax - ymin) + 1);
  x = 0;
  y = 0;
  int rgb[800][4];
  while (y < ysize) {
    for (plane = 0; plane < 4; plane++) {
      x = 0;
      while (x < xsize) {
        read(pcx_fd, &temp_byte, 1);
        if (0xc0 == (temp_byte & 0xc0)) {
          numacross = temp_byte & 0x3f;
          read(pcx_fd, &temp_byte, 1);
          for (i = 0; i < numacross; i++) {
            rgb[x][plane] = temp_byte;
            x++;
          }
        } else {
          rgb[x][plane] = temp_byte;
          x++;
        }
      }
    }
    for (i = 0; i < xsize; i++) {
      raw_image[(y * xsize * 3) + (i * 3) + 0] = rgb[i][0];
      raw_image[(y * xsize * 3) + (i * 3) + 1] = rgb[i][1];
      raw_image[(y * xsize * 3) + (i * 3) + 2] = rgb[i][2];
    }
    y++;
  }
  close(pcx_fd);
  return 0;
}


x86 assembly (clang, -O0):
<vmwLoadPCX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3300,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x1,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1060 <open@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1192 <vmwLoadPCX+0x52>
mov    -0x10(%rbp),%rsi
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    166c <vmwLoadPCX+0x52c>
mov    -0x1c(%rbp),%edi
lea    -0xe0(%rbp),%rsi
mov    $0x80,%edx
mov    $0x0,%al
call   1050 <read@plt>
movzbl -0xdb(%rbp),%eax
shl    $0x8,%eax
movzbl -0xdc(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x44(%rbp)
movzbl -0xd9(%rbp),%eax
shl    $0x8,%eax
movzbl -0xda(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x48(%rbp)
movzbl -0xd7(%rbp),%eax
shl    $0x8,%eax
movzbl -0xd8(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x4c(%rbp)
movzbl -0xd5(%rbp),%eax
shl    $0x8,%eax
movzbl -0xd6(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x50(%rbp)
movzbl -0xdf(%rbp),%eax
mov    %eax,-0x54(%rbp)
movzbl -0xdd(%rbp),%eax
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     145a <vmwLoadPCX+0x31a>
lea    0xe11(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movzbl -0xe0(%rbp),%eax
cmp    $0xa,%eax
jne    124f <vmwLoadPCX+0x10f>
lea    0xe02(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1264 <vmwLoadPCX+0x124>
movzbl -0xe0(%rbp),%esi
lea    0xdef(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xded(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    -0x54(%rbp),%eax
mov    %rax,-0x32f8(%rbp)
sub    $0x5,%rax
ja     12fc <vmwLoadPCX+0x1bc>
mov    -0x32f8(%rbp),%rax
lea    0xd6c(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xdbe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    130d <vmwLoadPCX+0x1cd>
lea    0xdb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    130d <vmwLoadPCX+0x1cd>
lea    0xdac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    130d <vmwLoadPCX+0x1cd>
lea    0xdaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    130d <vmwLoadPCX+0x1cd>
lea    0xdaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    130d <vmwLoadPCX+0x1cd>
mov    -0x54(%rbp),%esi
lea    0xd9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movzbl -0xde(%rbp),%eax
cmp    $0x1,%eax
jne    133e <vmwLoadPCX+0x1fe>
lea    0xd8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1353 <vmwLoadPCX+0x213>
movzbl -0xde(%rbp),%esi
lea    0xd00(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%esi
lea    0xd64(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x44(%rbp),%esi
mov    -0x48(%rbp),%edx
mov    -0x4c(%rbp),%ecx
mov    -0x50(%rbp),%r8d
lea    0xd63(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movzbl -0xd3(%rbp),%esi
shl    $0x8,%esi
movzbl -0xd4(%rbp),%eax
add    %eax,%esi
lea    0xd61(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movzbl -0xd1(%rbp),%esi
shl    $0x8,%esi
movzbl -0xd2(%rbp),%eax
add    %eax,%esi
lea    0xd54(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movzbl -0x9f(%rbp),%esi
lea    0xd53(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movzbl -0x9d(%rbp),%esi
shl    $0x8,%esi
movzbl -0x9e(%rbp),%eax
add    %eax,%esi
lea    0xd50(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movzbl -0x9b(%rbp),%esi
shl    $0x8,%esi
movzbl -0x9c(%rbp),%eax
add    %eax,%esi
lea    0xd43(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movzbl -0x99(%rbp),%esi
shl    $0x8,%esi
movzbl -0x9a(%rbp),%eax
add    %eax,%esi
lea    0xd34(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movzbl -0x97(%rbp),%esi
shl    $0x8,%esi
movzbl -0x98(%rbp),%eax
add    %eax,%esi
lea    0xd25(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4c(%rbp),%eax
sub    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
mov    -0x50(%rbp),%eax
sub    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jge    165d <vmwLoadPCX+0x51d>
movl   $0x0,-0x40(%rbp)
cmpl   $0x4,-0x40(%rbp)
jge    1593 <vmwLoadPCX+0x453>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x38(%rbp),%eax
jge    1580 <vmwLoadPCX+0x440>
mov    -0x1c(%rbp),%edi
lea    -0xe1(%rbp),%rsi
mov    $0x1,%edx
mov    $0x0,%al
call   1050 <read@plt>
movzbl -0xe1(%rbp),%ecx
and    $0xc0,%ecx
mov    $0xc0,%eax
cmp    %ecx,%eax
jne    1552 <vmwLoadPCX+0x412>
movzbl -0xe1(%rbp),%eax
and    $0x3f,%eax
mov    %eax,-0x34(%rbp)
mov    -0x1c(%rbp),%edi
lea    -0xe1(%rbp),%rsi
mov    $0x1,%edx
mov    $0x0,%al
call   1050 <read@plt>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x34(%rbp),%eax
jge    154d <vmwLoadPCX+0x40d>
movzbl -0xe1(%rbp),%edx
movslq -0x28(%rbp),%rcx
lea    -0x32f0(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0x40(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    150a <vmwLoadPCX+0x3ca>
jmp    157b <vmwLoadPCX+0x43b>
movzbl -0xe1(%rbp),%edx
movslq -0x28(%rbp),%rcx
lea    -0x32f0(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0x40(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    14a4 <vmwLoadPCX+0x364>
jmp    1585 <vmwLoadPCX+0x445>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    1493 <vmwLoadPCX+0x353>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x38(%rbp),%eax
jge    164f <vmwLoadPCX+0x50f>
movslq -0x30(%rbp),%rcx
lea    -0x32f0(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%eax
mov    %al,%dl
mov    -0x18(%rbp),%rax
mov    -0x2c(%rbp),%ecx
imul   -0x38(%rbp),%ecx
imul   $0x3,%ecx,%ecx
imul   $0x3,-0x30(%rbp),%esi
add    %esi,%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
movslq -0x30(%rbp),%rcx
lea    -0x32f0(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    0x4(%rax),%eax
mov    %al,%dl
mov    -0x18(%rbp),%rax
mov    -0x2c(%rbp),%ecx
imul   -0x38(%rbp),%ecx
imul   $0x3,%ecx,%ecx
imul   $0x3,-0x30(%rbp),%esi
add    %esi,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
movslq -0x30(%rbp),%rcx
lea    -0x32f0(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    0x8(%rax),%eax
mov    %al,%dl
mov    -0x18(%rbp),%rax
mov    -0x2c(%rbp),%ecx
imul   -0x38(%rbp),%ecx
imul   $0x3,%ecx,%ecx
imul   $0x3,-0x30(%rbp),%esi
add    %esi,%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    159a <vmwLoadPCX+0x45a>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1480 <vmwLoadPCX+0x340>
mov    -0x1c(%rbp),%edi
call   1040 <close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x3300,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vmwLoadPCX>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x32a8,%rsp
mov    %rsi,%r15
mov    %rdi,%rbx
xor    %esi,%esi
xor    %edx,%edx
call   1070 <open@plt>
test   %eax,%eax
js     11d8 <vmwLoadPCX+0x88>
mov    %eax,%r13d
lea    0x20(%rsp),%rsi
mov    %eax,%edi
mov    $0x80,%edx
xor    %eax,%eax
call   1060 <read@plt>
movzwl 0x24(%rsp),%ebx
movzwl 0x26(%rsp),%eax
mov    %eax,0x8(%rsp)
movzwl 0x28(%rsp),%r14d
movzwl 0x2a(%rsp),%ebp
movzbl 0x21(%rsp),%r12d
movzbl 0x23(%rsp),%eax
mov    %eax,0xc(%rsp)
lea    0xe7d(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0x20(%rsp),%esi
cmp    $0xa,%esi
jne    11f3 <vmwLoadPCX+0xa3>
lea    0xfac(%rip),%rdi
call   1030 <puts@plt>
jmp    1201 <vmwLoadPCX+0xb1>
lea    0xe39(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xffffffff,%eax
jmp    1368 <vmwLoadPCX+0x218>
lea    0xe4b(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe49(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x5,%r12b
ja     1231 <vmwLoadPCX+0xe1>
mov    %r12d,%eax
lea    0xde1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf4a(%rip),%rdi
jmp    1266 <vmwLoadPCX+0x116>
lea    0xe23(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    126b <vmwLoadPCX+0x11b>
lea    0xf20(%rip),%rdi
jmp    1266 <vmwLoadPCX+0x116>
lea    0xf07(%rip),%rdi
jmp    1266 <vmwLoadPCX+0x116>
lea    0xee7(%rip),%rdi
jmp    1266 <vmwLoadPCX+0x116>
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%r12d
lea    0xdf2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0x22(%rsp),%esi
cmp    $0x1,%esi
jne    1294 <vmwLoadPCX+0x144>
lea    0xeb3(%rip),%rdi
call   1030 <puts@plt>
jmp    12a2 <vmwLoadPCX+0x152>
lea    0xdaa(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xdc9(%rip),%rdi
mov    0xc(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xdd1(%rip),%rdi
mov    %r12d,%esi
mov    0x8(%rsp),%ebx
mov    %ebx,%edx
mov    %r14d,%ecx
mov    %ebp,%r8d
xor    %eax,%eax
call   1040 <printf@plt>
movzwl 0x2c(%rsp),%esi
lea    0xdce(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzwl 0x2e(%rsp),%esi
lea    0xdcf(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0x61(%rsp),%esi
lea    0xdd0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzwl 0x62(%rsp),%esi
lea    0xddb(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzwl 0x64(%rsp),%esi
lea    0xddc(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzwl 0x66(%rsp),%esi
lea    0xddb(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzwl 0x68(%rsp),%esi
lea    0xdda(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
sub    %ebx,%ebp
mov    %ebp,0x10(%rsp)
jae    137a <vmwLoadPCX+0x22a>
mov    %r13d,%edi
call   1050 <close@plt>
xor    %eax,%eax
add    $0x32a8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
sub    %r12d,%r14d
lea    0x1(%r14),%eax
addl   $0x1,0x10(%rsp)
mov    %eax,%ecx
mov    %rcx,0x18(%rsp)
lea    (%rax,%rax,2),%eax
mov    %eax,0x14(%rsp)
lea    0x7(%rsp),%r12
movl   $0x0,0x8(%rsp)
xor    %ecx,%ecx
jmp    13c9 <vmwLoadPCX+0x279>
cs nopw 0x0(%rax,%rax,1)
nop
mov    0xc(%rsp),%ecx
add    $0x1,%ecx
mov    0x8(%rsp),%eax
add    0x14(%rsp),%eax
mov    %eax,0x8(%rsp)
cmp    0x10(%rsp),%ecx
je     135e <vmwLoadPCX+0x20e>
mov    %ecx,0xc(%rsp)
test   %r14d,%r14d
js     13b0 <vmwLoadPCX+0x260>
mov    %r15,%rbp
xor    %r15d,%r15d
jmp    13fe <vmwLoadPCX+0x2ae>
nopw   0x0(%rax,%rax,1)
movslq %r15d,%r15
mov    %r15,%rax
shl    $0x4,%rax
mov    %ebx,0xa0(%rsp,%rax,1)
add    $0x1,%r15d
cmp    %r14d,%r15d
jg     14d0 <vmwLoadPCX+0x380>
mov    %r13d,%edi
mov    %r12,%rsi
mov    $0x1,%edx
xor    %eax,%eax
call   1060 <read@plt>
movzbl 0x7(%rsp),%ebx
mov    %ebx,%eax
not    %eax
test   $0xc0,%al
jne    13e0 <vmwLoadPCX+0x290>
mov    %r13d,%edi
mov    %r12,%rsi
mov    $0x1,%edx
xor    %eax,%eax
call   1060 <read@plt>
mov    %ebx,%esi
and    $0x3f,%esi
je     13f5 <vmwLoadPCX+0x2a5>
movzbl 0x7(%rsp),%eax
movslq %r15d,%r15
lea    -0x1(%rsi),%ecx
and    $0x3,%ebx
cmp    $0x3,%ecx
jb     148a <vmwLoadPCX+0x33a>
mov    %r15,%rcx
shl    $0x4,%rcx
lea    0xd0(%rsp),%rdx
add    %rdx,%rcx
mov    %ebx,%edx
sub    %esi,%edx
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %eax,-0x30(%rcx)
mov    %eax,-0x20(%rcx)
mov    %eax,-0x10(%rcx)
mov    %eax,(%rcx)
add    $0xfffffffffffffffc,%rsi
add    $0x40,%rcx
cmp    %esi,%edx
jne    1470 <vmwLoadPCX+0x320>
sub    %rsi,%r15
test   %ebx,%ebx
je     13f5 <vmwLoadPCX+0x2a5>
mov    %r15,%rcx
shl    $0x4,%rcx
add    %rsp,%rcx
add    $0xa0,%rcx
neg    %ebx
xor    %edx,%edx
nopw   0x0(%rax,%rax,1)
mov    %eax,(%rcx)
add    $0xffffffffffffffff,%rdx
add    $0x10,%rcx
cmp    %edx,%ebx
jne    14b0 <vmwLoadPCX+0x360>
sub    %rdx,%r15
jmp    13f5 <vmwLoadPCX+0x2a5>
cs nopw 0x0(%rax,%rax,1)
test   %r14d,%r14d
mov    %rbp,%r15
js     13b0 <vmwLoadPCX+0x260>
xor    %ebx,%ebx
jmp    14fd <vmwLoadPCX+0x3ad>
movslq %ebx,%rbx
mov    %rbx,%rax
shl    $0x4,%rax
mov    %ebp,0xa4(%rsp,%rax,1)
add    $0x1,%ebx
cmp    %r14d,%ebx
jg     15c0 <vmwLoadPCX+0x470>
mov    %r13d,%edi
mov    %r12,%rsi
mov    $0x1,%edx
xor    %eax,%eax
call   1060 <read@plt>
movzbl 0x7(%rsp),%ebp
mov    %ebp,%eax
not    %eax
test   $0xc0,%al
jne    14e0 <vmwLoadPCX+0x390>
mov    %r13d,%edi
mov    %r12,%rsi
mov    $0x1,%edx
xor    %eax,%eax
call   1060 <read@plt>
mov    %ebp,%esi
and    $0x3f,%esi
je     14f4 <vmwLoadPCX+0x3a4>
movzbl 0x7(%rsp),%eax
movslq %ebx,%rbx
lea    -0x1(%rsi),%ecx
and    $0x3,%ebp
cmp    $0x3,%ecx
jb     157a <vmwLoadPCX+0x42a>
mov    %rbx,%rcx
shl    $0x4,%rcx
lea    0xd4(%rsp),%rdx
add    %rdx,%rcx
mov    %ebp,%edx
sub    %esi,%edx
xor    %esi,%esi
mov    %eax,-0x30(%rcx)
mov    %eax,-0x20(%rcx)
mov    %eax,-0x10(%rcx)
mov    %eax,(%rcx)
add    $0xfffffffffffffffc,%rsi
add    $0x40,%rcx
cmp    %esi,%edx
jne    1560 <vmwLoadPCX+0x410>
sub    %rsi,%rbx
test   %ebp,%ebp
je     14f4 <vmwLoadPCX+0x3a4>
mov    %rbx,%rcx
shl    $0x4,%rcx
lea    0xa4(%rsp),%rdx
add    %rdx,%rcx
neg    %ebp
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
mov    %eax,(%rcx)
add    $0xffffffffffffffff,%rdx
add    $0x10,%rcx
cmp    %edx,%ebp
jne    15a0 <vmwLoadPCX+0x450>
sub    %rdx,%rbx
jmp    14f4 <vmwLoadPCX+0x3a4>
cs nopw 0x0(%rax,%rax,1)
test   %r14d,%r14d
js     13b0 <vmwLoadPCX+0x260>
xor    %ebx,%ebx
jmp    15ed <vmwLoadPCX+0x49d>
nopl   (%rax)
movslq %ebx,%rbx
mov    %rbx,%rax
shl    $0x4,%rax
mov    %ebp,0xa8(%rsp,%rax,1)
add    $0x1,%ebx
cmp    %r14d,%ebx
jg     16b0 <vmwLoadPCX+0x560>
mov    %r13d,%edi
mov    %r12,%rsi
mov    $0x1,%edx
xor    %eax,%eax
call   1060 <read@plt>
movzbl 0x7(%rsp),%ebp
mov    %ebp,%eax
not    %eax
test   $0xc0,%al
jne    15d0 <vmwLoadPCX+0x480>
mov    %r13d,%edi
mov    %r12,%rsi
mov    $0x1,%edx
xor    %eax,%eax
call   1060 <read@plt>
mov    %ebp,%esi
and    $0x3f,%esi
je     15e4 <vmwLoadPCX+0x494>
movzbl 0x7(%rsp),%eax
movslq %ebx,%rbx
lea    -0x1(%rsi),%ecx
and    $0x3,%ebp
cmp    $0x3,%ecx
jb     166a <vmwLoadPCX+0x51a>
mov    %rbx,%rcx
shl    $0x4,%rcx
lea    0xd8(%rsp),%rdx
add    %rdx,%rcx
mov    %ebp,%edx
sub    %esi,%edx
xor    %esi,%esi
mov    %eax,-0x30(%rcx)
mov    %eax,-0x20(%rcx)
mov    %eax,-0x10(%rcx)
mov    %eax,(%rcx)
add    $0xfffffffffffffffc,%rsi
add    $0x40,%rcx
cmp    %esi,%edx
jne    1650 <vmwLoadPCX+0x500>
sub    %rsi,%rbx
test   %ebp,%ebp
je     15e4 <vmwLoadPCX+0x494>
mov    %rbx,%rcx
shl    $0x4,%rcx
lea    0xa8(%rsp),%rdx
add    %rdx,%rcx
neg    %ebp
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
mov    %eax,(%rcx)
add    $0xffffffffffffffff,%rdx
add    $0x10,%rcx
cmp    %edx,%ebp
jne    1690 <vmwLoadPCX+0x540>
sub    %rdx,%rbx
jmp    15e4 <vmwLoadPCX+0x494>
cs nopw 0x0(%rax,%rax,1)
test   %r14d,%r14d
js     13b0 <vmwLoadPCX+0x260>
xor    %ebx,%ebx
jmp    16dd <vmwLoadPCX+0x58d>
nopl   (%rax)
movslq %ebx,%rbx
mov    %rbx,%rax
shl    $0x4,%rax
mov    %ebp,0xac(%rsp,%rax,1)
add    $0x1,%ebx
cmp    %r14d,%ebx
jg     1796 <vmwLoadPCX+0x646>
mov    %r13d,%edi
mov    %r12,%rsi
mov    $0x1,%edx
xor    %eax,%eax
call   1060 <read@plt>
movzbl 0x7(%rsp),%ebp
mov    %ebp,%eax
not    %eax
test   $0xc0,%al
jne    16c0 <vmwLoadPCX+0x570>
mov    %r13d,%edi
mov    %r12,%rsi
mov    $0x1,%edx
xor    %eax,%eax
call   1060 <read@plt>
mov    %ebp,%esi
and    $0x3f,%esi
je     16d4 <vmwLoadPCX+0x584>
movzbl 0x7(%rsp),%eax
movslq %ebx,%rbx
lea    -0x1(%rsi),%ecx
and    $0x3,%ebp
cmp    $0x3,%ecx
jb     175a <vmwLoadPCX+0x60a>
mov    %rbx,%rcx
shl    $0x4,%rcx
lea    0xdc(%rsp),%rdx
add    %rdx,%rcx
mov    %ebp,%edx
sub    %esi,%edx
xor    %esi,%esi
mov    %eax,-0x30(%rcx)
mov    %eax,-0x20(%rcx)
mov    %eax,-0x10(%rcx)
mov    %eax,(%rcx)
add    $0xfffffffffffffffc,%rsi
add    $0x40,%rcx
cmp    %esi,%edx
jne    1740 <vmwLoadPCX+0x5f0>
sub    %rsi,%rbx
test   %ebp,%ebp
je     16d4 <vmwLoadPCX+0x584>
mov    %rbx,%rcx
shl    $0x4,%rcx
lea    0xac(%rsp),%rdx
add    %rdx,%rcx
neg    %ebp
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
mov    %eax,(%rcx)
add    $0xffffffffffffffff,%rdx
add    $0x10,%rcx
cmp    %edx,%ebp
jne    1780 <vmwLoadPCX+0x630>
sub    %rdx,%rbx
jmp    16d4 <vmwLoadPCX+0x584>
test   %r14d,%r14d
js     13b0 <vmwLoadPCX+0x260>
mov    0x18(%rsp),%rax
mov    0x8(%rsp),%ecx
lea    0xa8(%rsp),%rdx
movzbl -0x8(%rdx),%ebx
movslq %ecx,%rcx
mov    %bl,(%r15,%rcx,1)
movzbl -0x4(%rdx),%ebx
lea    0x1(%rcx),%esi
movslq %esi,%rsi
mov    %bl,(%r15,%rsi,1)
movzbl (%rdx),%ebx
lea    0x2(%rcx),%esi
movslq %esi,%rsi
mov    %bl,(%r15,%rsi,1)
add    $0x10,%rdx
add    $0x3,%ecx
add    $0xffffffffffffffff,%rax
jne    17b0 <vmwLoadPCX+0x660>
jmp    13b0 <vmwLoadPCX+0x260>

LLVM IR (-O0):
@.str = [30 x i8] c"ERROR! File \22%s\22 not found!\0A\00"
@.str.1 = [15 x i8] c"Manufacturer: \00"
@.str.2 = [7 x i8] c"Zsoft\0A\00"
@.str.3 = [12 x i8] c"Unknown %d\0A\00"
@.str.4 = [10 x i8] c"Version: \00"
@.str.5 = [5 x i8] c"2.5\0A\00"
@.str.6 = [15 x i8] c"2.8 w palette\0A\00"
@.str.7 = [17 x i8] c"2.8 w/o palette\0A\00"
@.str.8 = [24 x i8] c"Paintbrush for Windows\0A\00"
@.str.9 = [6 x i8] c"3.0+\0A\00"
@.str.10 = [12 x i8] c"Unknown %i\0A\00"
@.str.11 = [11 x i8] c"Encoding: \00"
@.str.12 = [5 x i8] c"RLE\0A\00"
@.str.13 = [26 x i8] c"BitsPerPixelPerPlane: %d\0A\00"
@.str.14 = [31 x i8] c"File goes from %i,%i to %i,%i\0A\00"
@.str.15 = [20 x i8] c"Horizontal DPI: %i\0A\00"
@.str.16 = [20 x i8] c"Vertical DPI: %i\0A\00"
@.str.17 = [30 x i8] c"Number of colored planes: %i\0A\00"
@.str.18 = [20 x i8] c"Bytes per line: %i\0A\00"
@.str.19 = [18 x i8] c"Palette Type: %i\0A\00"
@.str.20 = [18 x i8] c"Hscreen Size: %i\0A\00"
@.str.21 = [18 x i8] c"Vscreen Size: %i\0A\00"
define i32 @vmwLoadPCX(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca [128 x i8]
%22 = alloca i8
%23 = alloca [800 x [4 x i32]]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 1, i32* %7
%24 = load i8*, i8** %4
%25 = call i32 @open(i8* %24, i32 0, i32 0)
store i32 %25, i32* %6
%26 = load i32, i32* %6
%27 = icmp slt i32 %26, 0
br i1 %27, label %28, label %31
28: ; preds = %2
%29 = load i8*, i8** %4
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %29)
store i32 -1, i32* %3
br label %318
31: ; preds = %2
%32 = load i32, i32* %6
%33 = call i32 (i32, ...) @read(i32 %32, [128 x i8]* %21, i32 128)
%34 = getelementptr inbounds [128 x i8], [128 x i8]* %21, i64 0, i64 5
%35 = load i8, i8* %34
%36 = zext i8 %35 to i32
%37 = shl i32 %36, 8
%38 = getelementptr inbounds [128 x i8], [128 x i8]* %21, i64 0, i64 4
%39 = load i8, i8* %38
%40 = zext i8 %39 to i32
%41 = add nsw i32 %37, %40
store i32 %41, i32* %16
%42 = getelementptr inbounds [128 x i8], [128 x i8]* %21, i64 0, i64 7
%43 = load i8, i8* %42
%44 = zext i8 %43 to i32
%45 = shl i32 %44, 8
%46 = getelementptr inbounds [128 x i8], [128 x i8]* %21, i64 0, i64 6
%47 = load i8, i8* %46
%48 = zext i8 %47 to i32
%49 = add nsw i32 %45, %48
store i32 %49, i32* %17
%50 = getelementptr inbounds [128 x i8], [128 x i8]* %21, i64 0, i64 9
%51 = load i8, i8* %50
%52 = zext i8 %51 to i32
%53 = shl i32 %52, 8
%54 = getelementptr inbounds [128 x i8], [128 x i8]* %21, i64 0, i64 8
%55 = load i8, i8* %54
%56 = zext i8 %55 to i32
%57 = add nsw i32 %53, %56
store i32 %57, i32* %18
%58 = getelementptr inbounds [128 x i8], [128 x i8]* %21, i64 0, i64 11
%59 = load i8, i8* %58
%60 = zext i8 %59 to i32
%61 = shl i32 %60, 8
%62 = getelementptr inbounds [128 x i8], [128 x i8]* %21, i64 0, i64 10
%63 = load i8, i8* %62
%64 = zext i8 %63 to i32
%65 = add nsw i32 %61, %64
store i32 %65, i32* %19
%66 = getelementptr inbounds [128 x i8], [128 x i8]* %21, i64 0, i64 1
%67 = load i8, i8* %66
%68 = zext i8 %67 to i32
store i32 %68, i32* %20
%69 = getelementptr inbounds [128 x i8], [128 x i8]* %21, i64 0, i64 3
%70 = load i8, i8* %69
%71 = zext i8 %70 to i32
store i32 %71, i32* %8
%72 = load i32, i32* %7
%73 = icmp ne i32 %72, 0
br i1 %73, label %74, label %182
74: ; preds = %31
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%76 = getelementptr inbounds [128 x i8], [128 x i8]* %21, i64 0, i64 0
%77 = load i8, i8* %76
%78 = zext i8 %77 to i32
%79 = icmp eq i32 %78, 10
br i1 %79, label %80, label %82
80: ; preds = %74
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %87
82: ; preds = %74
%83 = getelementptr inbounds [128 x i8], [128 x i8]* %21, i64 0, i64 0
%84 = load i8, i8* %83
%85 = zext i8 %84 to i32
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %85)
br label %87
87: ; preds = %82, %80
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%89 = load i32, i32* %20
switch i32 %89, label %100 [
i32 0, label %90
i32 2, label %92
i32 3, label %94
i32 4, label %96
i32 5, label %98
]
90: ; preds = %87
%91 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
br label %103
92: ; preds = %87
%93 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0))
br label %103
94: ; preds = %87
%95 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0))
br label %103
96: ; preds = %87
%97 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.8, i64 0, i64 0))
br label %103
98: ; preds = %87
%99 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
br label %103
100: ; preds = %87
%101 = load i32, i32* %20
%102 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i64 0, i64 0), i32 %101)
br label %103
103: ; preds = %100, %98, %96, %94, %92, %90
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.11, i64 0, i64 0))
%105 = getelementptr inbounds [128 x i8], [128 x i8]* %21, i64 0, i64 2
%106 = load i8, i8* %105
%107 = zext i8 %106 to i32
%108 = icmp eq i32 %107, 1
br i1 %108, label %109, label %111
109: ; preds = %103
%110 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0))
br label %116
111: ; preds = %103
%112 = getelementptr inbounds [128 x i8], [128 x i8]* %21, i64 0, i64 2
%113 = load i8, i8* %112
%114 = zext i8 %113 to i32
%115 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %114)
br label %116
116: ; preds = %111, %109
%117 = load i32, i32* %8
%118 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.13, i64 0, i64 0), i32 %117)
%119 = load i32, i32* %16
%120 = load i32, i32* %17
%121 = load i32, i32* %18
%122 = load i32, i32* %19
%123 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.14, i64 0, i64 0), i32 %119, i32 %120, i32 %121, i32 %122)
%124 = getelementptr inbounds [128 x i8], [128 x i8]* %21, i64 0, i64 13
%125 = load i8, i8* %124
%126 = zext i8 %125 to i32
%127 = shl i32 %126, 8
%128 = getelementptr inbounds [128 x i8], [128 x i8]* %21, i64 0, i64 12
%129 = load i8, i8* %128
%130 = zext i8 %129 to i32
%131 = add nsw i32 %127, %130
%132 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.15, i64 0, i64 0), i32 %131)
%133 = getelementptr inbounds [128 x i8], [128 x i8]* %21, i64 0, i64 15
%134 = load i8, i8* %133
%135 = zext i8 %134 to i32
%136 = shl i32 %135, 8
%137 = getelementptr inbounds [128 x i8], [128 x i8]* %21, i64 0, i64 14
%138 = load i8, i8* %137
%139 = zext i8 %138 to i32
%140 = add nsw i32 %136, %139
%141 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.16, i64 0, i64 0), i32 %140)
%142 = getelementptr inbounds [128 x i8], [128 x i8]* %21, i64 0, i64 65
%143 = load i8, i8* %142
%144 = zext i8 %143 to i32
%145 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.17, i64 0, i64 0), i32 %144)
%146 = getelementptr inbounds [128 x i8], [128 x i8]* %21, i64 0, i64 67
%147 = load i8, i8* %146
%148 = zext i8 %147 to i32
%149 = shl i32 %148, 8
%150 = getelementptr inbounds [128 x i8], [128 x i8]* %21, i64 0, i64 66
%151 = load i8, i8* %150
%152 = zext i8 %151 to i32
%153 = add nsw i32 %149, %152
%154 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.18, i64 0, i64 0), i32 %153)
%155 = getelementptr inbounds [128 x i8], [128 x i8]* %21, i64 0, i64 69
%156 = load i8, i8* %155
%157 = zext i8 %156 to i32
%158 = shl i32 %157, 8
%159 = getelementptr inbounds [128 x i8], [128 x i8]* %21, i64 0, i64 68
%160 = load i8, i8* %159
%161 = zext i8 %160 to i32
%162 = add nsw i32 %158, %161
%163 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.19, i64 0, i64 0), i32 %162)
%164 = getelementptr inbounds [128 x i8], [128 x i8]* %21, i64 0, i64 71
%165 = load i8, i8* %164
%166 = zext i8 %165 to i32
%167 = shl i32 %166, 8
%168 = getelementptr inbounds [128 x i8], [128 x i8]* %21, i64 0, i64 70
%169 = load i8, i8* %168
%170 = zext i8 %169 to i32
%171 = add nsw i32 %167, %170
%172 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.20, i64 0, i64 0), i32 %171)
%173 = getelementptr inbounds [128 x i8], [128 x i8]* %21, i64 0, i64 73
%174 = load i8, i8* %173
%175 = zext i8 %174 to i32
%176 = shl i32 %175, 8
%177 = getelementptr inbounds [128 x i8], [128 x i8]* %21, i64 0, i64 72
%178 = load i8, i8* %177
%179 = zext i8 %178 to i32
%180 = add nsw i32 %176, %179
%181 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.21, i64 0, i64 0), i32 %180)
br label %182
182: ; preds = %116, %31
%183 = load i32, i32* %18
%184 = load i32, i32* %16
%185 = sub nsw i32 %183, %184
%186 = add nsw i32 %185, 1
store i32 %186, i32* %13
%187 = load i32, i32* %19
%188 = load i32, i32* %17
%189 = sub nsw i32 %187, %188
%190 = add nsw i32 %189, 1
store i32 %190, i32* %14
store i32 0, i32* %9
store i32 0, i32* %10
br label %191
191: ; preds = %312, %182
%192 = load i32, i32* %10
%193 = load i32, i32* %14
%194 = icmp slt i32 %192, %193
br i1 %194, label %195, label %315
195: ; preds = %191
store i32 0, i32* %15
br label %196
196: ; preds = %249, %195
%197 = load i32, i32* %15
%198 = icmp slt i32 %197, 4
br i1 %198, label %199, label %252
199: ; preds = %196
store i32 0, i32* %9
br label %200
200: ; preds = %247, %199
%201 = load i32, i32* %9
%202 = load i32, i32* %13
%203 = icmp slt i32 %201, %202
br i1 %203, label %204, label %248
204: ; preds = %200
%205 = load i32, i32* %6
%206 = call i32 (i32, ...) @read(i32 %205, i8* %22, i32 1)
%207 = load i8, i8* %22
%208 = zext i8 %207 to i32
%209 = and i32 %208, 192
%210 = icmp eq i32 192, %209
br i1 %210, label %211, label %236
211: ; preds = %204
%212 = load i8, i8* %22
%213 = zext i8 %212 to i32
%214 = and i32 %213, 63
store i32 %214, i32* %12
%215 = load i32, i32* %6
%216 = call i32 (i32, ...) @read(i32 %215, i8* %22, i32 1)
store i32 0, i32* %11
br label %217
217: ; preds = %232, %211
%218 = load i32, i32* %11
%219 = load i32, i32* %12
%220 = icmp slt i32 %218, %219
br i1 %220, label %221, label %235
221: ; preds = %217
%222 = load i8, i8* %22
%223 = zext i8 %222 to i32
%224 = load i32, i32* %9
%225 = sext i32 %224 to i64
%226 = getelementptr inbounds [800 x [4 x i32]], [800 x [4 x i32]]* %23, i64 0, i64 %225
%227 = load i32, i32* %15
%228 = sext i32 %227 to i64
%229 = getelementptr inbounds [4 x i32], [4 x i32]* %226, i64 0, i64 %228
store i32 %223, i32* %229
%230 = load i32, i32* %9
%231 = add nsw i32 %230, 1
store i32 %231, i32* %9
br label %232
232: ; preds = %221
%233 = load i32, i32* %11
%234 = add nsw i32 %233, 1
store i32 %234, i32* %11
br label %217
235: ; preds = %217
br label %247
236: ; preds = %204
%237 = load i8, i8* %22
%238 = zext i8 %237 to i32
%239 = load i32, i32* %9
%240 = sext i32 %239 to i64
%241 = getelementptr inbounds [800 x [4 x i32]], [800 x [4 x i32]]* %23, i64 0, i64 %240
%242 = load i32, i32* %15
%243 = sext i32 %242 to i64
%244 = getelementptr inbounds [4 x i32], [4 x i32]* %241, i64 0, i64 %243
store i32 %238, i32* %244
%245 = load i32, i32* %9
%246 = add nsw i32 %245, 1
store i32 %246, i32* %9
br label %247
247: ; preds = %236, %235
br label %200
248: ; preds = %200
br label %249
249: ; preds = %248
%250 = load i32, i32* %15
%251 = add nsw i32 %250, 1
store i32 %251, i32* %15
br label %196
252: ; preds = %196
store i32 0, i32* %11
br label %253
253: ; preds = %309, %252
%254 = load i32, i32* %11
%255 = load i32, i32* %13
%256 = icmp slt i32 %254, %255
br i1 %256, label %257, label %312
257: ; preds = %253
%258 = load i32, i32* %11
%259 = sext i32 %258 to i64
%260 = getelementptr inbounds [800 x [4 x i32]], [800 x [4 x i32]]* %23, i64 0, i64 %259
%261 = getelementptr inbounds [4 x i32], [4 x i32]* %260, i64 0, i64 0
%262 = load i32, i32* %261
%263 = trunc i32 %262 to i8
%264 = load i8*, i8** %5
%265 = load i32, i32* %10
%266 = load i32, i32* %13
%267 = mul nsw i32 %265, %266
%268 = mul nsw i32 %267, 3
%269 = load i32, i32* %11
%270 = mul nsw i32 %269, 3
%271 = add nsw i32 %268, %270
%272 = add nsw i32 %271, 0
%273 = sext i32 %272 to i64
%274 = getelementptr inbounds i8, i8* %264, i64 %273
store i8 %263, i8* %274
%275 = load i32, i32* %11
%276 = sext i32 %275 to i64
%277 = getelementptr inbounds [800 x [4 x i32]], [800 x [4 x i32]]* %23, i64 0, i64 %276
%278 = getelementptr inbounds [4 x i32], [4 x i32]* %277, i64 0, i64 1
%279 = load i32, i32* %278
%280 = trunc i32 %279 to i8
%281 = load i8*, i8** %5
%282 = load i32, i32* %10
%283 = load i32, i32* %13
%284 = mul nsw i32 %282, %283
%285 = mul nsw i32 %284, 3
%286 = load i32, i32* %11
%287 = mul nsw i32 %286, 3
%288 = add nsw i32 %285, %287
%289 = add nsw i32 %288, 1
%290 = sext i32 %289 to i64
%291 = getelementptr inbounds i8, i8* %281, i64 %290
store i8 %280, i8* %291
%292 = load i32, i32* %11
%293 = sext i32 %292 to i64
%294 = getelementptr inbounds [800 x [4 x i32]], [800 x [4 x i32]]* %23, i64 0, i64 %293
%295 = getelementptr inbounds [4 x i32], [4 x i32]* %294, i64 0, i64 2
%296 = load i32, i32* %295
%297 = trunc i32 %296 to i8
%298 = load i8*, i8** %5
%299 = load i32, i32* %10
%300 = load i32, i32* %13
%301 = mul nsw i32 %299, %300
%302 = mul nsw i32 %301, 3
%303 = load i32, i32* %11
%304 = mul nsw i32 %303, 3
%305 = add nsw i32 %302, %304
%306 = add nsw i32 %305, 2
%307 = sext i32 %306 to i64
%308 = getelementptr inbounds i8, i8* %298, i64 %307
store i8 %297, i8* %308
br label %309
309: ; preds = %257
%310 = load i32, i32* %11
%311 = add nsw i32 %310, 1
store i32 %311, i32* %11
br label %253
312: ; preds = %253
%313 = load i32, i32* %10
%314 = add nsw i32 %313, 1
store i32 %314, i32* %10
br label %191
315: ; preds = %191
%316 = load i32, i32* %6
%317 = call i32 @close(i32 %316)
store i32 0, i32* %3
br label %318
318: ; preds = %315, %28
%319 = load i32, i32* %3
ret i32 %319
}

LLVM IR (-O2):
@.str = [30 x i8] c"ERROR! File \22%s\22 not found!\0A\00"
@.str.1 = [15 x i8] c"Manufacturer: \00"
@.str.3 = [12 x i8] c"Unknown %d\0A\00"
@.str.4 = [10 x i8] c"Version: \00"
@.str.10 = [12 x i8] c"Unknown %i\0A\00"
@.str.11 = [11 x i8] c"Encoding: \00"
@.str.13 = [26 x i8] c"BitsPerPixelPerPlane: %d\0A\00"
@.str.14 = [31 x i8] c"File goes from %i,%i to %i,%i\0A\00"
@.str.15 = [20 x i8] c"Horizontal DPI: %i\0A\00"
@.str.16 = [20 x i8] c"Vertical DPI: %i\0A\00"
@.str.17 = [30 x i8] c"Number of colored planes: %i\0A\00"
@.str.18 = [20 x i8] c"Bytes per line: %i\0A\00"
@.str.19 = [18 x i8] c"Palette Type: %i\0A\00"
@.str.20 = [18 x i8] c"Hscreen Size: %i\0A\00"
@.str.21 = [18 x i8] c"Vscreen Size: %i\0A\00"
@str = [5 x i8] c"3.0+\00"
@str.22 = [4 x i8] c"RLE\00"
@str.23 = [23 x i8] c"Paintbrush for Windows\00"
@str.24 = [16 x i8] c"2.8 w/o palette\00"
@str.25 = [14 x i8] c"2.8 w palette\00"
@str.26 = [4 x i8] c"2.5\00"
@str.27 = [6 x i8] c"Zsoft\00"
define i32 @vmwLoadPCX(i8* %0, i8* nocapture writeonly %1) {
%3 = alloca [128 x i8]
%4 = alloca i8
%5 = alloca [800 x [4 x i32]]
%6 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%7 = tail call i32 @open(i8* %0, i32 0, i32 0)
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %406
11: ; preds = %2
%12 = call i32 (i32, ...) @read(i32 %7, [128 x i8]* %3, i32 128)
%13 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 5
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = shl nuw nsw i32 %15, 8
%17 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 4
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = or i32 %16, %19
%21 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 7
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = shl nuw nsw i32 %23, 8
%25 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 6
%26 = load i8, i8* %25
%27 = zext i8 %26 to i32
%28 = or i32 %24, %27
%29 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 9
%30 = load i8, i8* %29
%31 = zext i8 %30 to i32
%32 = shl nuw nsw i32 %31, 8
%33 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 8
%34 = load i8, i8* %33
%35 = zext i8 %34 to i32
%36 = or i32 %32, %35
%37 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 11
%38 = load i8, i8* %37
%39 = zext i8 %38 to i32
%40 = shl nuw nsw i32 %39, 8
%41 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 10
%42 = load i8, i8* %41
%43 = zext i8 %42 to i32
%44 = or i32 %40, %43
%45 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 1
%46 = load i8, i8* %45
%47 = zext i8 %46 to i32
%48 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 3
%49 = load i8, i8* %48
%50 = zext i8 %49 to i32
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%52 = load i8, i8* %6
%53 = icmp eq i8 %52, 10
br i1 %53, label %54, label %56
54: ; preds = %11
%55 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.27, i64 0, i64 0))
br label %59
56: ; preds = %11
%57 = zext i8 %52 to i32
%58 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %57)
br label %59
59: ; preds = %56, %54
%60 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
switch i8 %46, label %71 [
i8 0, label %61
i8 2, label %63
i8 3, label %65
i8 4, label %67
i8 5, label %69
]
61: ; preds = %59
%62 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.26, i64 0, i64 0))
br label %73
63: ; preds = %59
%64 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.25, i64 0, i64 0))
br label %73
65: ; preds = %59
%66 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.24, i64 0, i64 0))
br label %73
67: ; preds = %59
%68 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.23, i64 0, i64 0))
br label %73
69: ; preds = %59
%70 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
br label %73
71: ; preds = %59
%72 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i64 0, i64 0), i32 %47)
br label %73
73: ; preds = %71, %69, %67, %65, %63, %61
%74 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.11, i64 0, i64 0))
%75 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 2
%76 = load i8, i8* %75
%77 = icmp eq i8 %76, 1
br i1 %77, label %78, label %80
78: ; preds = %73
%79 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.22, i64 0, i64 0))
br label %83
80: ; preds = %73
%81 = zext i8 %76 to i32
%82 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %81)
br label %83
83: ; preds = %80, %78
%84 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.13, i64 0, i64 0), i32 %50)
%85 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.14, i64 0, i64 0), i32 %20, i32 %28, i32 %36, i32 %44)
%86 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 13
%87 = load i8, i8* %86
%88 = zext i8 %87 to i32
%89 = shl nuw nsw i32 %88, 8
%90 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 12
%91 = load i8, i8* %90
%92 = zext i8 %91 to i32
%93 = or i32 %89, %92
%94 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.15, i64 0, i64 0), i32 %93)
%95 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 15
%96 = load i8, i8* %95
%97 = zext i8 %96 to i32
%98 = shl nuw nsw i32 %97, 8
%99 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 14
%100 = load i8, i8* %99
%101 = zext i8 %100 to i32
%102 = or i32 %98, %101
%103 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.16, i64 0, i64 0), i32 %102)
%104 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 65
%105 = load i8, i8* %104
%106 = zext i8 %105 to i32
%107 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.17, i64 0, i64 0), i32 %106)
%108 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 67
%109 = load i8, i8* %108
%110 = zext i8 %109 to i32
%111 = shl nuw nsw i32 %110, 8
%112 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 66
%113 = load i8, i8* %112
%114 = zext i8 %113 to i32
%115 = or i32 %111, %114
%116 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.18, i64 0, i64 0), i32 %115)
%117 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 69
%118 = load i8, i8* %117
%119 = zext i8 %118 to i32
%120 = shl nuw nsw i32 %119, 8
%121 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 68
%122 = load i8, i8* %121
%123 = zext i8 %122 to i32
%124 = or i32 %120, %123
%125 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.19, i64 0, i64 0), i32 %124)
%126 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 71
%127 = load i8, i8* %126
%128 = zext i8 %127 to i32
%129 = shl nuw nsw i32 %128, 8
%130 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 70
%131 = load i8, i8* %130
%132 = zext i8 %131 to i32
%133 = or i32 %129, %132
%134 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.20, i64 0, i64 0), i32 %133)
%135 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 73
%136 = load i8, i8* %135
%137 = zext i8 %136 to i32
%138 = shl nuw nsw i32 %137, 8
%139 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 72
%140 = load i8, i8* %139
%141 = zext i8 %140 to i32
%142 = or i32 %138, %141
%143 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.21, i64 0, i64 0), i32 %142)
%144 = sub nsw i32 %36, %20
%145 = add nsw i32 %144, 1
%146 = bitcast [800 x [4 x i32]]* %5 to i8*
%147 = icmp ult i32 %44, %28
br i1 %147, label %404, label %148
148: ; preds = %83
%149 = icmp slt i32 %144, 0
%150 = add nuw nsw i32 %44, 1
%151 = sub nsw i32 %150, %28
%152 = zext i32 %145 to i64
br label %153
153: ; preds = %148, %401
%154 = phi i32 [ 0, %148 ], [ %402, %401 ]
br i1 %149, label %401, label %157
155: ; preds = %376
%156 = mul nsw i32 %154, %145
br label %377
157: ; preds = %153, %208
%158 = phi i32 [ %209, %208 ], [ 0, %153 ]
%159 = call i32 (i32, ...) @read(i32 %7, i8* %4, i32 1)
%160 = load i8, i8* %4
%161 = zext i8 %160 to i32
%162 = and i32 %161, 192
%163 = icmp eq i32 %162, 192
br i1 %163, label %164, label %190
164: ; preds = %157
%165 = and i32 %161, 63
%166 = call i32 (i32, ...) @read(i32 %7, i8* %4, i32 1)
%167 = icmp eq i32 %165, 0
br i1 %167, label %208, label %168
168: ; preds = %164
%169 = load i8, i8* %4
%170 = zext i8 %169 to i32
%171 = sext i32 %158 to i64
%172 = add nsw i32 %165, -1
%173 = and i32 %161, 3
%174 = icmp ult i32 %172, 3
br i1 %174, label %194, label %175
175: ; preds = %168
%176 = sub nsw i32 %165, %173
br label %177
177: ; preds = %177, %175
%178 = phi i64 [ %171, %175 ], [ %187, %177 ]
%179 = phi i32 [ 0, %175 ], [ %188, %177 ]
%180 = getelementptr inbounds [800 x [4 x i32]], [800 x [4 x i32]]* %5, i64 0, i64 %178, i64 0
store i32 %170, i32* %180
%181 = add nsw i64 %178, 1
%182 = getelementptr inbounds [800 x [4 x i32]], [800 x [4 x i32]]* %5, i64 0, i64 %181, i64 0
store i32 %170, i32* %182
%183 = add nsw i64 %178, 2
%184 = getelementptr inbounds [800 x [4 x i32]], [800 x [4 x i32]]* %5, i64 0, i64 %183, i64 0
store i32 %170, i32* %184
%185 = add nsw i64 %178, 3
%186 = getelementptr inbounds [800 x [4 x i32]], [800 x [4 x i32]]* %5, i64 0, i64 %185, i64 0
store i32 %170, i32* %186
%187 = add nsw i64 %178, 4
%188 = add i32 %179, 4
%189 = icmp eq i32 %188, %176
br i1 %189, label %194, label %177
190: ; preds = %157
%191 = sext i32 %158 to i64
%192 = getelementptr inbounds [800 x [4 x i32]], [800 x [4 x i32]]* %5, i64 0, i64 %191, i64 0
store i32 %161, i32* %192
%193 = add nsw i32 %158, 1
br label %208
194: ; preds = %177, %168
%195 = phi i64 [ undef, %168 ], [ %187, %177 ]
%196 = phi i64 [ %171, %168 ], [ %187, %177 ]
%197 = icmp eq i32 %173, 0
br i1 %197, label %205, label %198
198: ; preds = %194, %198
%199 = phi i64 [ %202, %198 ], [ %196, %194 ]
%200 = phi i32 [ %203, %198 ], [ 0, %194 ]
%201 = getelementptr inbounds [800 x [4 x i32]], [800 x [4 x i32]]* %5, i64 0, i64 %199, i64 0
store i32 %170, i32* %201
%202 = add nsw i64 %199, 1
%203 = add i32 %200, 1
%204 = icmp eq i32 %203, %173
br i1 %204, label %205, label %198
205: ; preds = %198, %194
%206 = phi i64 [ %195, %194 ], [ %202, %198 ]
%207 = trunc i64 %206 to i32
br label %208
208: ; preds = %205, %164, %190
%209 = phi i32 [ %193, %190 ], [ %158, %164 ], [ %207, %205 ]
%210 = icmp sgt i32 %209, %144
br i1 %210, label %211, label %157
211: ; preds = %208
br i1 %149, label %401, label %212
212: ; preds = %211, %263
%213 = phi i32 [ %264, %263 ], [ 0, %211 ]
%214 = call i32 (i32, ...) @read(i32 %7, i8* %4, i32 1)
%215 = load i8, i8* %4
%216 = zext i8 %215 to i32
%217 = and i32 %216, 192
%218 = icmp eq i32 %217, 192
br i1 %218, label %223, label %219
219: ; preds = %212
%220 = sext i32 %213 to i64
%221 = getelementptr inbounds [800 x [4 x i32]], [800 x [4 x i32]]* %5, i64 0, i64 %220, i64 1
store i32 %216, i32* %221
%222 = add nsw i32 %213, 1
br label %263
223: ; preds = %212
%224 = and i32 %216, 63
%225 = call i32 (i32, ...) @read(i32 %7, i8* %4, i32 1)
%226 = icmp eq i32 %224, 0
br i1 %226, label %263, label %227
227: ; preds = %223
%228 = load i8, i8* %4
%229 = zext i8 %228 to i32
%230 = sext i32 %213 to i64
%231 = add nsw i32 %224, -1
%232 = and i32 %216, 3
%233 = icmp ult i32 %231, 3
br i1 %233, label %249, label %234
234: ; preds = %227
%235 = sub nsw i32 %224, %232
br label %236
236: ; preds = %236, %234
%237 = phi i64 [ %230, %234 ], [ %246, %236 ]
%238 = phi i32 [ 0, %234 ], [ %247, %236 ]
%239 = getelementptr inbounds [800 x [4 x i32]], [800 x [4 x i32]]* %5, i64 0, i64 %237, i64 1
store i32 %229, i32* %239
%240 = add nsw i64 %237, 1
%241 = getelementptr inbounds [800 x [4 x i32]], [800 x [4 x i32]]* %5, i64 0, i64 %240, i64 1
store i32 %229, i32* %241
%242 = add nsw i64 %237, 2
%243 = getelementptr inbounds [800 x [4 x i32]], [800 x [4 x i32]]* %5, i64 0, i64 %242, i64 1
store i32 %229, i32* %243
%244 = add nsw i64 %237, 3
%245 = getelementptr inbounds [800 x [4 x i32]], [800 x [4 x i32]]* %5, i64 0, i64 %244, i64 1
store i32 %229, i32* %245
%246 = add nsw i64 %237, 4
%247 = add i32 %238, 4
%248 = icmp eq i32 %247, %235
br i1 %248, label %249, label %236
249: ; preds = %236, %227
%250 = phi i64 [ undef, %227 ], [ %246, %236 ]
%251 = phi i64 [ %230, %227 ], [ %246, %236 ]
%252 = icmp eq i32 %232, 0
br i1 %252, label %260, label %253
253: ; preds = %249, %253
%254 = phi i64 [ %257, %253 ], [ %251, %249 ]
%255 = phi i32 [ %258, %253 ], [ 0, %249 ]
%256 = getelementptr inbounds [800 x [4 x i32]], [800 x [4 x i32]]* %5, i64 0, i64 %254, i64 1
store i32 %229, i32* %256
%257 = add nsw i64 %254, 1
%258 = add i32 %255, 1
%259 = icmp eq i32 %258, %232
br i1 %259, label %260, label %253
260: ; preds = %253, %249
%261 = phi i64 [ %250, %249 ], [ %257, %253 ]
%262 = trunc i64 %261 to i32
br label %263
263: ; preds = %260, %223, %219
%264 = phi i32 [ %222, %219 ], [ %213, %223 ], [ %262, %260 ]
%265 = icmp sgt i32 %264, %144
br i1 %265, label %266, label %212
266: ; preds = %263
br i1 %149, label %401, label %267
267: ; preds = %266, %318
%268 = phi i32 [ %319, %318 ], [ 0, %266 ]
%269 = call i32 (i32, ...) @read(i32 %7, i8* %4, i32 1)
%270 = load i8, i8* %4
%271 = zext i8 %270 to i32
%272 = and i32 %271, 192
%273 = icmp eq i32 %272, 192
br i1 %273, label %278, label %274
274: ; preds = %267
%275 = sext i32 %268 to i64
%276 = getelementptr inbounds [800 x [4 x i32]], [800 x [4 x i32]]* %5, i64 0, i64 %275, i64 2
store i32 %271, i32* %276
%277 = add nsw i32 %268, 1
br label %318
278: ; preds = %267
%279 = and i32 %271, 63
%280 = call i32 (i32, ...) @read(i32 %7, i8* %4, i32 1)
%281 = icmp eq i32 %279, 0
br i1 %281, label %318, label %282
282: ; preds = %278
%283 = load i8, i8* %4
%284 = zext i8 %283 to i32
%285 = sext i32 %268 to i64
%286 = add nsw i32 %279, -1
%287 = and i32 %271, 3
%288 = icmp ult i32 %286, 3
br i1 %288, label %304, label %289
289: ; preds = %282
%290 = sub nsw i32 %279, %287
br label %291
291: ; preds = %291, %289
%292 = phi i64 [ %285, %289 ], [ %301, %291 ]
%293 = phi i32 [ 0, %289 ], [ %302, %291 ]
%294 = getelementptr inbounds [800 x [4 x i32]], [800 x [4 x i32]]* %5, i64 0, i64 %292, i64 2
store i32 %284, i32* %294
%295 = add nsw i64 %292, 1
%296 = getelementptr inbounds [800 x [4 x i32]], [800 x [4 x i32]]* %5, i64 0, i64 %295, i64 2
store i32 %284, i32* %296
%297 = add nsw i64 %292, 2
%298 = getelementptr inbounds [800 x [4 x i32]], [800 x [4 x i32]]* %5, i64 0, i64 %297, i64 2
store i32 %284, i32* %298
%299 = add nsw i64 %292, 3
%300 = getelementptr inbounds [800 x [4 x i32]], [800 x [4 x i32]]* %5, i64 0, i64 %299, i64 2
store i32 %284, i32* %300
%301 = add nsw i64 %292, 4
%302 = add i32 %293, 4
%303 = icmp eq i32 %302, %290
br i1 %303, label %304, label %291
304: ; preds = %291, %282
%305 = phi i64 [ undef, %282 ], [ %301, %291 ]
%306 = phi i64 [ %285, %282 ], [ %301, %291 ]
%307 = icmp eq i32 %287, 0
br i1 %307, label %315, label %308
308: ; preds = %304, %308
%309 = phi i64 [ %312, %308 ], [ %306, %304 ]
%310 = phi i32 [ %313, %308 ], [ 0, %304 ]
%311 = getelementptr inbounds [800 x [4 x i32]], [800 x [4 x i32]]* %5, i64 0, i64 %309, i64 2
store i32 %284, i32* %311
%312 = add nsw i64 %309, 1
%313 = add i32 %310, 1
%314 = icmp eq i32 %313, %287
br i1 %314, label %315, label %308
315: ; preds = %308, %304
%316 = phi i64 [ %305, %304 ], [ %312, %308 ]
%317 = trunc i64 %316 to i32
br label %318
318: ; preds = %315, %278, %274
%319 = phi i32 [ %277, %274 ], [ %268, %278 ], [ %317, %315 ]
%320 = icmp sgt i32 %319, %144
br i1 %320, label %321, label %267
321: ; preds = %318
br i1 %149, label %401, label %322
322: ; preds = %321, %373
%323 = phi i32 [ %374, %373 ], [ 0, %321 ]
%324 = call i32 (i32, ...) @read(i32 %7, i8* %4, i32 1)
%325 = load i8, i8* %4
%326 = zext i8 %325 to i32
%327 = and i32 %326, 192
%328 = icmp eq i32 %327, 192
br i1 %328, label %333, label %329
329: ; preds = %322
%330 = sext i32 %323 to i64
%331 = getelementptr inbounds [800 x [4 x i32]], [800 x [4 x i32]]* %5, i64 0, i64 %330, i64 3
store i32 %326, i32* %331
%332 = add nsw i32 %323, 1
br label %373
333: ; preds = %322
%334 = and i32 %326, 63
%335 = call i32 (i32, ...) @read(i32 %7, i8* %4, i32 1)
%336 = icmp eq i32 %334, 0
br i1 %336, label %373, label %337
337: ; preds = %333
%338 = load i8, i8* %4
%339 = zext i8 %338 to i32
%340 = sext i32 %323 to i64
%341 = add nsw i32 %334, -1
%342 = and i32 %326, 3
%343 = icmp ult i32 %341, 3
br i1 %343, label %359, label %344
344: ; preds = %337
%345 = sub nsw i32 %334, %342
br label %346
346: ; preds = %346, %344
%347 = phi i64 [ %340, %344 ], [ %356, %346 ]
%348 = phi i32 [ 0, %344 ], [ %357, %346 ]
%349 = getelementptr inbounds [800 x [4 x i32]], [800 x [4 x i32]]* %5, i64 0, i64 %347, i64 3
store i32 %339, i32* %349
%350 = add nsw i64 %347, 1
%351 = getelementptr inbounds [800 x [4 x i32]], [800 x [4 x i32]]* %5, i64 0, i64 %350, i64 3
store i32 %339, i32* %351
%352 = add nsw i64 %347, 2
%353 = getelementptr inbounds [800 x [4 x i32]], [800 x [4 x i32]]* %5, i64 0, i64 %352, i64 3
store i32 %339, i32* %353
%354 = add nsw i64 %347, 3
%355 = getelementptr inbounds [800 x [4 x i32]], [800 x [4 x i32]]* %5, i64 0, i64 %354, i64 3
store i32 %339, i32* %355
%356 = add nsw i64 %347, 4
%357 = add i32 %348, 4
%358 = icmp eq i32 %357, %345
br i1 %358, label %359, label %346
359: ; preds = %346, %337
%360 = phi i64 [ undef, %337 ], [ %356, %346 ]
%361 = phi i64 [ %340, %337 ], [ %356, %346 ]
%362 = icmp eq i32 %342, 0
br i1 %362, label %370, label %363
363: ; preds = %359, %363
%364 = phi i64 [ %367, %363 ], [ %361, %359 ]
%365 = phi i32 [ %368, %363 ], [ 0, %359 ]
%366 = getelementptr inbounds [800 x [4 x i32]], [800 x [4 x i32]]* %5, i64 0, i64 %364, i64 3
store i32 %339, i32* %366
%367 = add nsw i64 %364, 1
%368 = add i32 %365, 1
%369 = icmp eq i32 %368, %342
br i1 %369, label %370, label %363
370: ; preds = %363, %359
%371 = phi i64 [ %360, %359 ], [ %367, %363 ]
%372 = trunc i64 %371 to i32
br label %373
373: ; preds = %370, %333, %329
%374 = phi i32 [ %332, %329 ], [ %323, %333 ], [ %372, %370 ]
%375 = icmp sgt i32 %374, %144
br i1 %375, label %376, label %322
376: ; preds = %373
br i1 %149, label %401, label %155
377: ; preds = %155, %377
%378 = phi i64 [ 0, %155 ], [ %399, %377 ]
%379 = getelementptr inbounds [800 x [4 x i32]], [800 x [4 x i32]]* %5, i64 0, i64 %378, i64 0
%380 = load i32, i32* %379
%381 = trunc i32 %380 to i8
%382 = trunc i64 %378 to i32
%383 = add i32 %156, %382
%384 = mul i32 %383, 3
%385 = sext i32 %384 to i64
%386 = getelementptr inbounds i8, i8* %1, i64 %385
store i8 %381, i8* %386
%387 = getelementptr inbounds [800 x [4 x i32]], [800 x [4 x i32]]* %5, i64 0, i64 %378, i64 1
%388 = load i32, i32* %387
%389 = trunc i32 %388 to i8
%390 = add nsw i32 %384, 1
%391 = sext i32 %390 to i64
%392 = getelementptr inbounds i8, i8* %1, i64 %391
store i8 %389, i8* %392
%393 = getelementptr inbounds [800 x [4 x i32]], [800 x [4 x i32]]* %5, i64 0, i64 %378, i64 2
%394 = load i32, i32* %393
%395 = trunc i32 %394 to i8
%396 = add nsw i32 %384, 2
%397 = sext i32 %396 to i64
%398 = getelementptr inbounds i8, i8* %1, i64 %397
store i8 %395, i8* %398
%399 = add nuw nsw i64 %378, 1
%400 = icmp eq i64 %399, %152
br i1 %400, label %401, label %377
401: ; preds = %377, %153, %211, %266, %321, %376
%402 = add nuw nsw i32 %154, 1
%403 = icmp eq i32 %402, %151
br i1 %403, label %404, label %153
404: ; preds = %401, %83
%405 = call i32 @close(i32 %7)
br label %406
406: ; preds = %404, %9
%407 = phi i32 [ -1, %9 ], [ 0, %404 ]
ret i32 %407
}