#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*/ header;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ fread(unsigned char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ putc(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ strncpy(char *, char *, unsigned char);
void ProcessFile(char *filename) {
  FILE *binfile;
  unsigned char header[128];
  char name[80];
  int dlen, rlen;
  int i, ch;
  binfile = fopen(filename, "r");
  if (binfile == NULL) {
    fprintf(stderr, "Cannot open %s\n", filename);
    return;
  }
  fread(header, 1, sizeof(header), binfile);
  if (header[0] != 0 || header[74] != 0 || header[82] != 0 || header[1] <= 0 ||
      header[1] > 33 || header[63] != 0 || header[2 + header[1]] != 0) {
    fprintf(stderr, "%s does not look like a macbinary file\n", filename);
    fclose(binfile);
    return;
  }
  strncpy(name, (char *)header + 2, header[1]);
  name[header[1]] = '\0';
  dlen = ((header[0x53] << 24) | (header[0x54] << 16) | (header[0x55] << 8) |
          header[0x56]);
  rlen = ((header[0x57] << 24) | (header[0x58] << 16) | (header[0x59] << 8) |
          header[0x5a]);
  fprintf(stderr, " %s => %s, dfork len=%d rfork len=%d\n", filename, name,
          dlen, rlen);
  {
    FILE *datafile, *resfile, *infofile;
    if (dlen > 0) {
      fseek(binfile, 128, SEEK_SET);
      strcpy(name + header[1], ".data");
      datafile = fopen(name, "w");
      if (datafile == NULL)
        fprintf(stderr, "Cannot open output file: %s\n", name);
      else {
        for (i = 0; i < dlen && (ch = getc(binfile)) != EOF; ++i)
          putc(ch, datafile);
        fclose(datafile);
      }
    }
    if (rlen > 0) {
      fseek(binfile, 128 + ((dlen + 127) & ~127), SEEK_SET);
      strcpy(name + header[1], ".rsrc");
      resfile = fopen(name, "w");
      if (resfile == NULL)
        fprintf(stderr, "Cannot open output file: %s\n", name);
      else {
        for (i = 0; i < rlen && (ch = getc(binfile)) != EOF; ++i)
          putc(ch, resfile);
        fclose(resfile);
      }
    }
    strcpy(name + header[1], ".info");
    infofile = fopen(name, "w");
    if (infofile == NULL) {
      fprintf(stderr, "Cannot open output file: %s\n", name);
    } else {
      name[header[1]] = '\0';
      fprintf(infofile, "Mac filename = %s\n", name);
      fprintf(infofile, "Data fork length = %d\n", dlen);
      fprintf(infofile, "Resource fork length = %d\n", rlen);
      fprintf(infofile, "File Type = %c%c%c%c\n", header[65], header[66],
              header[67], header[68]);
      fprintf(infofile, "File Creator = %c%c%c%c\n", header[69], header[70],
              header[71], header[72]);
      fprintf(infofile, "Finder Flags = %08x\n", header[73]);
      fclose(infofile);
    }
  }
  fclose(binfile);
}


x86 assembly (clang, -O0):
<ProcessFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe56(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    11df <ProcessFile+0x4f>
mov    0x2e13(%rip),%rax
movslq (%rax),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe2f(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
jmp    16d0 <ProcessFile+0x540>
lea    -0x90(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
mov    $0x80,%edx
call   1050 <fread@plt>
movzbl -0x90(%rbp),%eax
cmp    $0x0,%eax
jne    126d <ProcessFile+0xdd>
movzbl -0x46(%rbp),%eax
cmp    $0x0,%eax
jne    126d <ProcessFile+0xdd>
movzbl -0x3e(%rbp),%eax
cmp    $0x0,%eax
jne    126d <ProcessFile+0xdd>
movzbl -0x8f(%rbp),%eax
cmp    $0x0,%eax
jle    126d <ProcessFile+0xdd>
movzbl -0x8f(%rbp),%eax
cmp    $0x21,%eax
jg     126d <ProcessFile+0xdd>
movzbl -0x51(%rbp),%eax
cmp    $0x0,%eax
jne    126d <ProcessFile+0xdd>
movzbl -0x8f(%rbp),%eax
add    $0x2,%eax
cltq
movzbl -0x90(%rbp,%rax,1),%eax
ff
cmp    $0x0,%eax
je     1297 <ProcessFile+0x107>
mov    0x2d64(%rip),%rax
movslq (%rax),%rdi
mov    -0x8(%rbp),%rdx
lea    0xd90(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1060 <fclose@plt>
jmp    16d0 <ProcessFile+0x540>
lea    -0xe0(%rbp),%rdi
lea    -0x90(%rbp),%rsi
add    $0x2,%rsi
movzbl -0x8f(%rbp),%edx
call   1030 <strncpy@plt>
movzbl -0x8f(%rbp),%eax
movb   $0x0,-0xe0(%rbp,%rax,1)
movzbl -0x3d(%rbp),%eax
shl    $0x18,%eax
movzbl -0x3c(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
movzbl -0x3b(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
movzbl -0x3a(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xe4(%rbp)
movzbl -0x39(%rbp),%eax
shl    $0x18,%eax
movzbl -0x38(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
movzbl -0x37(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
movzbl -0x36(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xe8(%rbp)
mov    0x2cc3(%rip),%rax
movslq (%rax),%rdi
mov    -0x8(%rbp),%rdx
lea    -0xe0(%rbp),%rcx
mov    -0xe4(%rbp),%r8d
mov    -0xe8(%rbp),%r9d
lea    0xd02(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
cmpl   $0x0,-0xe4(%rbp)
jle    145d <ProcessFile+0x2cd>
mov    -0x10(%rbp),%rdi
mov    0x2c79(%rip),%rax
mov    (%rax),%edx
mov    $0x80,%esi
call   1090 <fseek@plt>
lea    -0xe0(%rbp),%rdi
movzbl -0x8f(%rbp),%eax
cltq
add    %rax,%rdi
lea    0xce3(%rip),%rsi
call   1040 <strcpy@plt>
lea    -0xe0(%rbp),%rdi
lea    0xcd6(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0xf8(%rbp)
cmpq   $0x0,-0xf8(%rbp)
jne    13ce <ProcessFile+0x23e>
mov    0x2c27(%rip),%rax
movslq (%rax),%rdi
lea    -0xe0(%rbp),%rdx
lea    0xca6(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
jmp    1458 <ProcessFile+0x2c8>
movl   $0x0,-0xec(%rbp)
mov    -0xec(%rbp),%ecx
xor    %eax,%eax
cmp    -0xe4(%rbp),%ecx
mov    %al,-0x109(%rbp)
jge    1413 <ProcessFile+0x283>
mov    -0x10(%rbp),%rdi
call   10b0 <getc@plt>
mov    %eax,-0xf0(%rbp)
mov    0x2be0(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0x109(%rbp)
mov    -0x109(%rbp),%al
test   $0x1,%al
jne    1426 <ProcessFile+0x296>
jmp    144c <ProcessFile+0x2bc>
mov    -0xf0(%rbp),%edi
mov    -0xf8(%rbp),%rsi
call   1070 <putc@plt>
mov    -0xec(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xec(%rbp)
jmp    13d8 <ProcessFile+0x248>
mov    -0xf8(%rbp),%rdi
call   1060 <fclose@plt>
jmp    145d <ProcessFile+0x2cd>
cmpl   $0x0,-0xe8(%rbp)
jle    1588 <ProcessFile+0x3f8>
mov    -0x10(%rbp),%rdi
mov    -0xe4(%rbp),%esi
add    $0x7f,%esi
and    $0xffffff80,%esi
add    $0x80,%esi
mov    0x2b49(%rip),%rax
mov    (%rax),%edx
call   1090 <fseek@plt>
lea    -0xe0(%rbp),%rdi
movzbl -0x8f(%rbp),%eax
cltq
add    %rax,%rdi
lea    0xbdd(%rip),%rsi
call   1040 <strcpy@plt>
lea    -0xe0(%rbp),%rdi
lea    0xbab(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x100(%rbp)
cmpq   $0x0,-0x100(%rbp)
jne    14f9 <ProcessFile+0x369>
mov    0x2afc(%rip),%rax
movslq (%rax),%rdi
lea    -0xe0(%rbp),%rdx
lea    0xb7b(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
jmp    1583 <ProcessFile+0x3f3>
movl   $0x0,-0xec(%rbp)
mov    -0xec(%rbp),%ecx
xor    %eax,%eax
cmp    -0xe8(%rbp),%ecx
mov    %al,-0x10a(%rbp)
jge    153e <ProcessFile+0x3ae>
mov    -0x10(%rbp),%rdi
call   10b0 <getc@plt>
mov    %eax,-0xf0(%rbp)
mov    0x2ab5(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0x10a(%rbp)
mov    -0x10a(%rbp),%al
test   $0x1,%al
jne    1551 <ProcessFile+0x3c1>
jmp    1577 <ProcessFile+0x3e7>
mov    -0xf0(%rbp),%edi
mov    -0x100(%rbp),%rsi
call   1070 <putc@plt>
mov    -0xec(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xec(%rbp)
jmp    1503 <ProcessFile+0x373>
mov    -0x100(%rbp),%rdi
call   1060 <fclose@plt>
jmp    1588 <ProcessFile+0x3f8>
lea    -0xe0(%rbp),%rdi
movzbl -0x8f(%rbp),%eax
cltq
add    %rax,%rdi
lea    0xae9(%rip),%rsi
call   1040 <strcpy@plt>
lea    -0xe0(%rbp),%rdi
lea    0xab1(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x108(%rbp)
cmpq   $0x0,-0x108(%rbp)
jne    15f3 <ProcessFile+0x463>
mov    0x2a02(%rip),%rax
movslq (%rax),%rdi
lea    -0xe0(%rbp),%rdx
lea    0xa81(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
jmp    16c7 <ProcessFile+0x537>
movzbl -0x8f(%rbp),%eax
movb   $0x0,-0xe0(%rbp,%rax,1)
mov    -0x108(%rbp),%rdi
lea    -0xe0(%rbp),%rdx
lea    0xa7a(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x108(%rbp),%rdi
mov    -0xe4(%rbp),%edx
lea    0xa72(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x108(%rbp),%rdi
mov    -0xe8(%rbp),%edx
lea    0xa6e(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x108(%rbp),%rdi
movzbl -0x4f(%rbp),%edx
movzbl -0x4e(%rbp),%ecx
movzbl -0x4d(%rbp),%r8d
movzbl -0x4c(%rbp),%r9d
lea    0xa62(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x108(%rbp),%rdi
movzbl -0x4b(%rbp),%edx
movzbl -0x4a(%rbp),%ecx
movzbl -0x49(%rbp),%r8d
movzbl -0x48(%rbp),%r9d
lea    0xa51(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x108(%rbp),%rdi
movzbl -0x47(%rbp),%edx
lea    0xa51(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x108(%rbp),%rdi
call   1060 <fclose@plt>
mov    -0x10(%rbp),%rdi
call   1060 <fclose@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ProcessFile>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xd8,%rsp
mov    %rdi,%rbp
lea    0xe55(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     1239 <ProcessFile+0xa9>
mov    %rax,%r12
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x80,%edx
mov    %rax,%rcx
call   1050 <fread@plt>
cmpb   $0x0,(%rsp)
jne    1205 <ProcessFile+0x75>
cmpb   $0x0,0x4a(%rsp)
jne    1205 <ProcessFile+0x75>
cmpb   $0x0,0x52(%rsp)
jne    1205 <ProcessFile+0x75>
mov    0x1(%rsp),%al
test   %al,%al
je     1205 <ProcessFile+0x75>
cmp    $0x21,%al
ja     1205 <ProcessFile+0x75>
cmpb   $0x0,0x3f(%rsp)
jne    1205 <ProcessFile+0x75>
movzbl %al,%edx
cmpb   $0x0,0x2(%rdx,%rbx,1)
je     1265 <ProcessFile+0xd5>
mov    0x2dcc(%rip),%rax
movslq (%rax),%rdi
lea    0xdfc(%rip),%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    %r12,%rdi
add    $0xd8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1060 <fclose@plt>
mov    0x2d98(%rip),%rax
movslq (%rax),%rdi
lea    0xdb8(%rip),%rsi
mov    %rbp,%rdx
xor    %eax,%eax
add    $0xd8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1080 <fprintf@plt>
lea    0x2(%rsp),%rsi
lea    0x80(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strncpy@plt>
movzbl 0x1(%rsp),%eax
movb   $0x0,0x80(%rsp,%rax,1)
mov    0x53(%rsp),%r15d
mov    0x57(%rsp),%r14d
bswap  %r15d
bswap  %r14d
mov    0x2d3a(%rip),%r13
movslq 0x0(%r13),%rdi
lea    0xd91(%rip),%rsi
mov    %rbp,%rdx
mov    %rbx,%rcx
mov    %r15d,%r8d
mov    %r14d,%r9d
xor    %eax,%eax
call   1080 <fprintf@plt>
test   %r15d,%r15d
jle    135c <ProcessFile+0x1cc>
mov    0x2d04(%rip),%rax
mov    (%rax),%edx
mov    %r12,%rdi
mov    $0x80,%esi
call   1090 <fseek@plt>
movzbl 0x1(%rsp),%eax
lea    (%rsp,%rax,1),%rdi
add    $0x80,%rdi
lea    0xd6e(%rip),%rsi
call   1040 <strcpy@plt>
lea    0xd68(%rip),%rsi
lea    0x80(%rsp),%rdi
call   10a0 <fopen@plt>
test   %rax,%rax
je     13fe <ProcessFile+0x26e>
mov    %rax,%rbx
mov    0x2cca(%rip),%rbp
mov    %r15d,%r13d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
call   10b0 <getc@plt>
cmp    0x0(%rbp),%eax
je     134d <ProcessFile+0x1bd>
mov    %eax,%edi
mov    %rbx,%rsi
call   1070 <putc@plt>
add    $0xffffffff,%r13d
jne    1330 <ProcessFile+0x1a0>
mov    %rbx,%rdi
call   1060 <fclose@plt>
mov    0x2c7c(%rip),%r13
test   %r14d,%r14d
jle    143d <ProcessFile+0x2ad>
lea    0xff(%r15),%esi
and    $0xffffff80,%esi
mov    0x2c5a(%rip),%rax
mov    (%rax),%edx
mov    %r12,%rdi
call   1090 <fseek@plt>
movzbl 0x1(%rsp),%eax
lea    (%rsp,%rax,1),%rdi
add    $0x80,%rdi
lea    0xcee(%rip),%rsi
call   1040 <strcpy@plt>
lea    0xcc3(%rip),%rsi
lea    0x80(%rsp),%rdi
call   10a0 <fopen@plt>
test   %rax,%rax
je     1423 <ProcessFile+0x293>
mov    %rax,%rbx
mov    0x2c29(%rip),%r13
mov    %r14d,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r12,%rdi
call   10b0 <getc@plt>
cmp    0x0(%r13),%eax
je     13ed <ProcessFile+0x25d>
mov    %eax,%edi
mov    %rbx,%rsi
call   1070 <putc@plt>
add    $0xffffffff,%ebp
jne    13d0 <ProcessFile+0x240>
mov    %rbx,%rdi
call   1060 <fclose@plt>
mov    0x2bdc(%rip),%r13
jmp    143d <ProcessFile+0x2ad>
movslq 0x0(%r13),%rdi
lea    0xc5f(%rip),%rsi
lea    0x80(%rsp),%rdx
xor    %eax,%eax
call   1080 <fprintf@plt>
test   %r14d,%r14d
jg     1365 <ProcessFile+0x1d5>
jmp    143d <ProcessFile+0x2ad>
movslq 0x0(%r13),%rdi
lea    0xc3a(%rip),%rsi
lea    0x80(%rsp),%rdx
xor    %eax,%eax
call   1080 <fprintf@plt>
movzbl 0x1(%rsp),%eax
lea    (%rsp,%rax,1),%rdi
add    $0x80,%rdi
lea    0xc37(%rip),%rsi
call   1040 <strcpy@plt>
lea    0xc06(%rip),%rsi
lea    0x80(%rsp),%rdi
call   10a0 <fopen@plt>
test   %rax,%rax
je     1535 <ProcessFile+0x3a5>
mov    %rax,%rbp
movzbl 0x1(%rsp),%eax
movb   $0x0,0x80(%rsp,%rax,1)
lea    0xc04(%rip),%rsi
lea    0x80(%rsp),%rdx
mov    %rbp,%rdi
xor    %eax,%eax
call   1080 <fprintf@plt>
lea    0xbfe(%rip),%rsi
mov    %rbp,%rdi
mov    %r15d,%edx
xor    %eax,%eax
call   1080 <fprintf@plt>
lea    0xc01(%rip),%rsi
mov    %rbp,%rdi
mov    %r14d,%edx
xor    %eax,%eax
call   1080 <fprintf@plt>
movzbl 0x41(%rsp),%edx
movzbl 0x42(%rsp),%ecx
movzbl 0x43(%rsp),%r8d
movzbl 0x44(%rsp),%r9d
lea    0xbf2(%rip),%rsi
mov    %rbp,%rdi
xor    %eax,%eax
call   1080 <fprintf@plt>
movzbl 0x45(%rsp),%edx
movzbl 0x46(%rsp),%ecx
movzbl 0x47(%rsp),%r8d
movzbl 0x48(%rsp),%r9d
lea    0xbe1(%rip),%rsi
mov    %rbp,%rdi
xor    %eax,%eax
call   1080 <fprintf@plt>
movzbl 0x49(%rsp),%edx
lea    0xbe4(%rip),%rsi
mov    %rbp,%rdi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    %rbp,%rdi
call   1060 <fclose@plt>
jmp    154f <ProcessFile+0x3bf>
movslq 0x0(%r13),%rdi
lea    0xb28(%rip),%rsi
lea    0x80(%rsp),%rdx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    %r12,%rdi
call   1060 <fclose@plt>
add    $0xd8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.1 = [16 x i8] c"Cannot open %s\0A\00"
@.str.2 = [40 x i8] c"%s does not look like a macbinary file\0A\00"
@.str.3 = [38 x i8] c" %s => %s, dfork len=%d rfork len=%d\0A\00"
@SEEK_SET = global i32 0
@.str.4 = [6 x i8] c".data\00"
@.str.5 = [2 x i8] c"w\00"
@.str.6 = [29 x i8] c"Cannot open output file: %s\0A\00"
@EOF = global i32 0
@.str.7 = [6 x i8] c".rsrc\00"
@.str.8 = [6 x i8] c".info\00"
@.str.9 = [19 x i8] c"Mac filename = %s\0A\00"
@.str.10 = [23 x i8] c"Data fork length = %d\0A\00"
@.str.11 = [27 x i8] c"Resource fork length = %d\0A\00"
@.str.12 = [22 x i8] c"File Type = %c%c%c%c\0A\00"
@.str.13 = [25 x i8] c"File Creator = %c%c%c%c\0A\00"
@.str.14 = [21 x i8] c"Finder Flags = %08x\0A\00"
define void @ProcessFile(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca [128 x i8]
%5 = alloca [80 x i8]
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
store i8* %0, i8** %2
%13 = load i8*, i8** %2
%14 = call i32* @fopen(i8* %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %14, i32** %3
%15 = load i32*, i32** %3
%16 = icmp eq i32* %15, null
br i1 %16, label %17, label %23
17: ; preds = %1
%18 = load i32, i32* @stderr
%19 = sext i32 %18 to i64
%20 = inttoptr i64 %19 to i32*
%21 = load i8*, i8** %2
%22 = call i32 (i32*, i8*, ...) @fprintf(i32* %20, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %21)
br label %296
23: ; preds = %1
%24 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%25 = load i32*, i32** %3
%26 = call i32 @fread(i8* %24, i32 1, i32 128, i32* %25)
%27 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%28 = load i8, i8* %27
%29 = zext i8 %28 to i32
%30 = icmp ne i32 %29, 0
br i1 %30, label %66, label %31
31: ; preds = %23
%32 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 74
%33 = load i8, i8* %32
%34 = zext i8 %33 to i32
%35 = icmp ne i32 %34, 0
br i1 %35, label %66, label %36
36: ; preds = %31
%37 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 82
%38 = load i8, i8* %37
%39 = zext i8 %38 to i32
%40 = icmp ne i32 %39, 0
br i1 %40, label %66, label %41
41: ; preds = %36
%42 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 1
%43 = load i8, i8* %42
%44 = zext i8 %43 to i32
%45 = icmp sle i32 %44, 0
br i1 %45, label %66, label %46
46: ; preds = %41
%47 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 1
%48 = load i8, i8* %47
%49 = zext i8 %48 to i32
%50 = icmp sgt i32 %49, 33
br i1 %50, label %66, label %51
51: ; preds = %46
%52 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 63
%53 = load i8, i8* %52
%54 = zext i8 %53 to i32
%55 = icmp ne i32 %54, 0
br i1 %55, label %66, label %56
56: ; preds = %51
%57 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 1
%58 = load i8, i8* %57
%59 = zext i8 %58 to i32
%60 = add nsw i32 2, %59
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 %61
%63 = load i8, i8* %62
%64 = zext i8 %63 to i32
%65 = icmp ne i32 %64, 0
br i1 %65, label %66, label %74
66: ; preds = %56, %51, %46, %41, %36, %31, %23
%67 = load i32, i32* @stderr
%68 = sext i32 %67 to i64
%69 = inttoptr i64 %68 to i32*
%70 = load i8*, i8** %2
%71 = call i32 (i32*, i8*, ...) @fprintf(i32* %69, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i8* %70)
%72 = load i32*, i32** %3
%73 = call i32 @fclose(i32* %72)
br label %296
74: ; preds = %56
%75 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%76 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%77 = getelementptr inbounds i8, i8* %76, i64 2
%78 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 1
%79 = load i8, i8* %78
%80 = call i32 @strncpy(i8* %75, i8* %77, i8 zeroext %79)
%81 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 1
%82 = load i8, i8* %81
%83 = zext i8 %82 to i64
%84 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 %83
store i8 0, i8* %84
%85 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 83
%86 = load i8, i8* %85
%87 = zext i8 %86 to i32
%88 = shl i32 %87, 24
%89 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 84
%90 = load i8, i8* %89
%91 = zext i8 %90 to i32
%92 = shl i32 %91, 16
%93 = or i32 %88, %92
%94 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 85
%95 = load i8, i8* %94
%96 = zext i8 %95 to i32
%97 = shl i32 %96, 8
%98 = or i32 %93, %97
%99 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 86
%100 = load i8, i8* %99
%101 = zext i8 %100 to i32
%102 = or i32 %98, %101
store i32 %102, i32* %6
%103 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 87
%104 = load i8, i8* %103
%105 = zext i8 %104 to i32
%106 = shl i32 %105, 24
%107 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 88
%108 = load i8, i8* %107
%109 = zext i8 %108 to i32
%110 = shl i32 %109, 16
%111 = or i32 %106, %110
%112 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 89
%113 = load i8, i8* %112
%114 = zext i8 %113 to i32
%115 = shl i32 %114, 8
%116 = or i32 %111, %115
%117 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 90
%118 = load i8, i8* %117
%119 = zext i8 %118 to i32
%120 = or i32 %116, %119
store i32 %120, i32* %7
%121 = load i32, i32* @stderr
%122 = sext i32 %121 to i64
%123 = inttoptr i64 %122 to i32*
%124 = load i8*, i8** %2
%125 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%126 = load i32, i32* %6
%127 = load i32, i32* %7
%128 = call i32 (i32*, i8*, ...) @fprintf(i32* %123, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i8* %124, i8* %125, i32 %126, i32 %127)
%129 = load i32, i32* %6
%130 = icmp sgt i32 %129, 0
br i1 %130, label %131, label %175
131: ; preds = %74
%132 = load i32*, i32** %3
%133 = load i32, i32* @SEEK_SET
%134 = call i32 @fseek(i32* %132, i32 128, i32 %133)
%135 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%136 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 1
%137 = load i8, i8* %136
%138 = zext i8 %137 to i32
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds i8, i8* %135, i64 %139
%141 = call i32 @strcpy(i8* %140, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%142 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%143 = call i32* @fopen(i8* %142, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
store i32* %143, i32** %10
%144 = load i32*, i32** %10
%145 = icmp eq i32* %144, null
br i1 %145, label %146, label %152
146: ; preds = %131
%147 = load i32, i32* @stderr
%148 = sext i32 %147 to i64
%149 = inttoptr i64 %148 to i32*
%150 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%151 = call i32 (i32*, i8*, ...) @fprintf(i32* %149, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0), i8* %150)
br label %174
152: ; preds = %131
store i32 0, i32* %8
br label %153
153: ; preds = %168, %152
%154 = load i32, i32* %8
%155 = load i32, i32* %6
%156 = icmp slt i32 %154, %155
br i1 %156, label %157, label %162
157: ; preds = %153
%158 = load i32*, i32** %3
%159 = call i32 @getc(i32* %158)
store i32 %159, i32* %9
%160 = load i32, i32* @EOF
%161 = icmp ne i32 %159, %160
br label %162
162: ; preds = %157, %153
%163 = phi i1 [ false, %153 ], [ %161, %157 ]
br i1 %163, label %164, label %171
164: ; preds = %162
%165 = load i32, i32* %9
%166 = load i32*, i32** %10
%167 = call i32 @putc(i32 %165, i32* %166)
br label %168
168: ; preds = %164
%169 = load i32, i32* %8
%170 = add nsw i32 %169, 1
store i32 %170, i32* %8
br label %153
171: ; preds = %162
%172 = load i32*, i32** %10
%173 = call i32 @fclose(i32* %172)
br label %174
174: ; preds = %171, %146
br label %175
175: ; preds = %174, %74
%176 = load i32, i32* %7
%177 = icmp sgt i32 %176, 0
br i1 %177, label %178, label %226
178: ; preds = %175
%179 = load i32*, i32** %3
%180 = load i32, i32* %6
%181 = add nsw i32 %180, 127
%182 = and i32 %181, -128
%183 = add nsw i32 128, %182
%184 = load i32, i32* @SEEK_SET
%185 = call i32 @fseek(i32* %179, i32 %183, i32 %184)
%186 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%187 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 1
%188 = load i8, i8* %187
%189 = zext i8 %188 to i32
%190 = sext i32 %189 to i64
%191 = getelementptr inbounds i8, i8* %186, i64 %190
%192 = call i32 @strcpy(i8* %191, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%193 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%194 = call i32* @fopen(i8* %193, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
store i32* %194, i32** %11
%195 = load i32*, i32** %11
%196 = icmp eq i32* %195, null
br i1 %196, label %197, label %203
197: ; preds = %178
%198 = load i32, i32* @stderr
%199 = sext i32 %198 to i64
%200 = inttoptr i64 %199 to i32*
%201 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%202 = call i32 (i32*, i8*, ...) @fprintf(i32* %200, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0), i8* %201)
br label %225
203: ; preds = %178
store i32 0, i32* %8
br label %204
204: ; preds = %219, %203
%205 = load i32, i32* %8
%206 = load i32, i32* %7
%207 = icmp slt i32 %205, %206
br i1 %207, label %208, label %213
208: ; preds = %204
%209 = load i32*, i32** %3
%210 = call i32 @getc(i32* %209)
store i32 %210, i32* %9
%211 = load i32, i32* @EOF
%212 = icmp ne i32 %210, %211
br label %213
213: ; preds = %208, %204
%214 = phi i1 [ false, %204 ], [ %212, %208 ]
br i1 %214, label %215, label %222
215: ; preds = %213
%216 = load i32, i32* %9
%217 = load i32*, i32** %11
%218 = call i32 @putc(i32 %216, i32* %217)
br label %219
219: ; preds = %215
%220 = load i32, i32* %8
%221 = add nsw i32 %220, 1
store i32 %221, i32* %8
br label %204
222: ; preds = %213
%223 = load i32*, i32** %11
%224 = call i32 @fclose(i32* %223)
br label %225
225: ; preds = %222, %197
br label %226
226: ; preds = %225, %175
%227 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%228 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 1
%229 = load i8, i8* %228
%230 = zext i8 %229 to i32
%231 = sext i32 %230 to i64
%232 = getelementptr inbounds i8, i8* %227, i64 %231
%233 = call i32 @strcpy(i8* %232, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%234 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%235 = call i32* @fopen(i8* %234, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
store i32* %235, i32** %12
%236 = load i32*, i32** %12
%237 = icmp eq i32* %236, null
br i1 %237, label %238, label %244
238: ; preds = %226
%239 = load i32, i32* @stderr
%240 = sext i32 %239 to i64
%241 = inttoptr i64 %240 to i32*
%242 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%243 = call i32 (i32*, i8*, ...) @fprintf(i32* %241, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0), i8* %242)
br label %293
244: ; preds = %226
%245 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 1
%246 = load i8, i8* %245
%247 = zext i8 %246 to i64
%248 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 %247
store i8 0, i8* %248
%249 = load i32*, i32** %12
%250 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%251 = call i32 (i32*, i8*, ...) @fprintf(i32* %249, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0), i8* %250)
%252 = load i32*, i32** %12
%253 = load i32, i32* %6
%254 = call i32 (i32*, i8*, ...) @fprintf(i32* %252, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.10, i64 0, i64 0), i32 %253)
%255 = load i32*, i32** %12
%256 = load i32, i32* %7
%257 = call i32 (i32*, i8*, ...) @fprintf(i32* %255, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.11, i64 0, i64 0), i32 %256)
%258 = load i32*, i32** %12
%259 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 65
%260 = load i8, i8* %259
%261 = zext i8 %260 to i32
%262 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 66
%263 = load i8, i8* %262
%264 = zext i8 %263 to i32
%265 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 67
%266 = load i8, i8* %265
%267 = zext i8 %266 to i32
%268 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 68
%269 = load i8, i8* %268
%270 = zext i8 %269 to i32
%271 = call i32 (i32*, i8*, ...) @fprintf(i32* %258, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.12, i64 0, i64 0), i32 %261, i32 %264, i32 %267, i32 %270)
%272 = load i32*, i32** %12
%273 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 69
%274 = load i8, i8* %273
%275 = zext i8 %274 to i32
%276 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 70
%277 = load i8, i8* %276
%278 = zext i8 %277 to i32
%279 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 71
%280 = load i8, i8* %279
%281 = zext i8 %280 to i32
%282 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 72
%283 = load i8, i8* %282
%284 = zext i8 %283 to i32
%285 = call i32 (i32*, i8*, ...) @fprintf(i32* %272, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.13, i64 0, i64 0), i32 %275, i32 %278, i32 %281, i32 %284)
%286 = load i32*, i32** %12
%287 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 73
%288 = load i8, i8* %287
%289 = zext i8 %288 to i32
%290 = call i32 (i32*, i8*, ...) @fprintf(i32* %286, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.14, i64 0, i64 0), i32 %289)
%291 = load i32*, i32** %12
%292 = call i32 @fclose(i32* %291)
br label %293
293: ; preds = %244, %238
%294 = load i32*, i32** %3
%295 = call i32 @fclose(i32* %294)
br label %296
296: ; preds = %293, %66, %17
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.1 = [16 x i8] c"Cannot open %s\0A\00"
@.str.2 = [40 x i8] c"%s does not look like a macbinary file\0A\00"
@.str.3 = [38 x i8] c" %s => %s, dfork len=%d rfork len=%d\0A\00"
@SEEK_SET = global i32 0
@.str.4 = [6 x i8] c".data\00"
@.str.5 = [2 x i8] c"w\00"
@.str.6 = [29 x i8] c"Cannot open output file: %s\0A\00"
@EOF = global i32 0
@.str.7 = [6 x i8] c".rsrc\00"
@.str.8 = [6 x i8] c".info\00"
@.str.9 = [19 x i8] c"Mac filename = %s\0A\00"
@.str.10 = [23 x i8] c"Data fork length = %d\0A\00"
@.str.11 = [27 x i8] c"Resource fork length = %d\0A\00"
@.str.12 = [22 x i8] c"File Type = %c%c%c%c\0A\00"
@.str.13 = [25 x i8] c"File Creator = %c%c%c%c\0A\00"
@.str.14 = [21 x i8] c"Finder Flags = %08x\0A\00"
define void @ProcessFile(i8* %0) {
%2 = alloca [128 x i8]
%3 = alloca [80 x i8]
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%6 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i32* %6, null
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
%12 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %11, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %200
13: ; preds = %1
%14 = call i32 @fread(i8* %4, i32 1, i32 128, i32* %6)
%15 = load i8, i8* %4
%16 = icmp ne i8 %15, 0
%17 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 74
%18 = load i8, i8* %17
%19 = icmp ne i8 %18, 0
%20 = select i1 %16, i1 true, i1 %19
%21 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 82
%22 = load i8, i8* %21
%23 = icmp ne i8 %22, 0
%24 = select i1 %20, i1 true, i1 %23
%25 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 1
%26 = load i8, i8* %25
%27 = icmp eq i8 %26, 0
%28 = select i1 %24, i1 true, i1 %27
%29 = icmp ugt i8 %26, 33
%30 = select i1 %28, i1 true, i1 %29
%31 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 63
%32 = load i8, i8* %31
%33 = icmp ne i8 %32, 0
%34 = select i1 %30, i1 true, i1 %33
br i1 %34, label %41, label %35
35: ; preds = %13
%36 = zext i8 %26 to i64
%37 = add nuw nsw i64 %36, 2
%38 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 %37
%39 = load i8, i8* %38
%40 = icmp eq i8 %39, 0
br i1 %40, label %47, label %41
41: ; preds = %35, %13
%42 = load i32, i32* @stderr
%43 = sext i32 %42 to i64
%44 = inttoptr i64 %43 to i32*
%45 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %44, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i8* %0)
%46 = tail call i32 @fclose(i32* %6)
br label %200
47: ; preds = %35
%48 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 2
%49 = call i32 @strncpy(i8* %5, i8* %48, i8 zeroext %26)
%50 = load i8, i8* %25
%51 = zext i8 %50 to i64
%52 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 %51
store i8 0, i8* %52
%53 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 83
%54 = load i8, i8* %53
%55 = zext i8 %54 to i32
%56 = shl nuw i32 %55, 24
%57 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 84
%58 = load i8, i8* %57
%59 = zext i8 %58 to i32
%60 = shl nuw nsw i32 %59, 16
%61 = or i32 %60, %56
%62 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 85
%63 = load i8, i8* %62
%64 = zext i8 %63 to i32
%65 = shl nuw nsw i32 %64, 8
%66 = or i32 %61, %65
%67 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 86
%68 = load i8, i8* %67
%69 = zext i8 %68 to i32
%70 = or i32 %66, %69
%71 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 87
%72 = load i8, i8* %71
%73 = zext i8 %72 to i32
%74 = shl nuw i32 %73, 24
%75 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 88
%76 = load i8, i8* %75
%77 = zext i8 %76 to i32
%78 = shl nuw nsw i32 %77, 16
%79 = or i32 %78, %74
%80 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 89
%81 = load i8, i8* %80
%82 = zext i8 %81 to i32
%83 = shl nuw nsw i32 %82, 8
%84 = or i32 %79, %83
%85 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 90
%86 = load i8, i8* %85
%87 = zext i8 %86 to i32
%88 = or i32 %84, %87
%89 = load i32, i32* @stderr
%90 = sext i32 %89 to i64
%91 = inttoptr i64 %90 to i32*
%92 = call i32 (i32*, i8*, ...) @fprintf(i32* %91, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i8* %0, i8* %5, i32 %70, i32 %88)
%93 = icmp sgt i32 %70, 0
br i1 %93, label %94, label %119
94: ; preds = %47
%95 = load i32, i32* @SEEK_SET
%96 = call i32 @fseek(i32* %6, i32 128, i32 %95)
%97 = load i8, i8* %25
%98 = zext i8 %97 to i64
%99 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 %98
%100 = call i32 @strcpy(i8* %99, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%101 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%102 = icmp eq i32* %101, null
br i1 %102, label %103, label %108
103: ; preds = %94
%104 = load i32, i32* @stderr
%105 = sext i32 %104 to i64
%106 = inttoptr i64 %105 to i32*
%107 = call i32 (i32*, i8*, ...) @fprintf(i32* %106, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0), i8* %5)
br label %119
108: ; preds = %94, %113
%109 = phi i32 [ %115, %113 ], [ 0, %94 ]
%110 = call i32 @getc(i32* %6)
%111 = load i32, i32* @EOF
%112 = icmp eq i32 %110, %111
br i1 %112, label %117, label %113
113: ; preds = %108
%114 = call i32 @putc(i32 %110, i32* %101)
%115 = add nuw nsw i32 %109, 1
%116 = icmp eq i32 %115, %70
br i1 %116, label %117, label %108
117: ; preds = %108, %113
%118 = call i32 @fclose(i32* %101)
br label %119
119: ; preds = %103, %117, %47
%120 = icmp sgt i32 %88, 0
br i1 %120, label %121, label %148
121: ; preds = %119
%122 = add i32 %70, 255
%123 = and i32 %122, -128
%124 = load i32, i32* @SEEK_SET
%125 = call i32 @fseek(i32* %6, i32 %123, i32 %124)
%126 = load i8, i8* %25
%127 = zext i8 %126 to i64
%128 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 %127
%129 = call i32 @strcpy(i8* %128, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%130 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%131 = icmp eq i32* %130, null
br i1 %131, label %132, label %137
132: ; preds = %121
%133 = load i32, i32* @stderr
%134 = sext i32 %133 to i64
%135 = inttoptr i64 %134 to i32*
%136 = call i32 (i32*, i8*, ...) @fprintf(i32* %135, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0), i8* %5)
br label %148
137: ; preds = %121, %142
%138 = phi i32 [ %144, %142 ], [ 0, %121 ]
%139 = call i32 @getc(i32* %6)
%140 = load i32, i32* @EOF
%141 = icmp eq i32 %139, %140
br i1 %141, label %146, label %142
142: ; preds = %137
%143 = call i32 @putc(i32 %139, i32* %130)
%144 = add nuw nsw i32 %138, 1
%145 = icmp eq i32 %144, %88
br i1 %145, label %146, label %137
146: ; preds = %137, %142
%147 = call i32 @fclose(i32* %130)
br label %148
148: ; preds = %132, %146, %119
%149 = load i8, i8* %25
%150 = zext i8 %149 to i64
%151 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 %150
%152 = call i32 @strcpy(i8* %151, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%153 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%154 = icmp eq i32* %153, null
br i1 %154, label %155, label %160
155: ; preds = %148
%156 = load i32, i32* @stderr
%157 = sext i32 %156 to i64
%158 = inttoptr i64 %157 to i32*
%159 = call i32 (i32*, i8*, ...) @fprintf(i32* %158, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0), i8* %5)
br label %198
160: ; preds = %148
%161 = load i8, i8* %25
%162 = zext i8 %161 to i64
%163 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 %162
store i8 0, i8* %163
%164 = call i32 (i32*, i8*, ...) @fprintf(i32* %153, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0), i8* %5)
%165 = call i32 (i32*, i8*, ...) @fprintf(i32* %153, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.10, i64 0, i64 0), i32 %70)
%166 = call i32 (i32*, i8*, ...) @fprintf(i32* %153, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.11, i64 0, i64 0), i32 %88)
%167 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 65
%168 = load i8, i8* %167
%169 = zext i8 %168 to i32
%170 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 66
%171 = load i8, i8* %170
%172 = zext i8 %171 to i32
%173 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 67
%174 = load i8, i8* %173
%175 = zext i8 %174 to i32
%176 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 68
%177 = load i8, i8* %176
%178 = zext i8 %177 to i32
%179 = call i32 (i32*, i8*, ...) @fprintf(i32* %153, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.12, i64 0, i64 0), i32 %169, i32 %172, i32 %175, i32 %178)
%180 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 69
%181 = load i8, i8* %180
%182 = zext i8 %181 to i32
%183 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 70
%184 = load i8, i8* %183
%185 = zext i8 %184 to i32
%186 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 71
%187 = load i8, i8* %186
%188 = zext i8 %187 to i32
%189 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 72
%190 = load i8, i8* %189
%191 = zext i8 %190 to i32
%192 = call i32 (i32*, i8*, ...) @fprintf(i32* %153, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.13, i64 0, i64 0), i32 %182, i32 %185, i32 %188, i32 %191)
%193 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 73
%194 = load i8, i8* %193
%195 = zext i8 %194 to i32
%196 = call i32 (i32*, i8*, ...) @fprintf(i32* %153, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.14, i64 0, i64 0), i32 %195)
%197 = call i32 @fclose(i32* %153)
br label %198
198: ; preds = %160, %155
%199 = call i32 @fclose(i32* %6)
br label %200
200: ; preds = %198, %41, %8
ret void
}