#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ error(int, char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int fread(unsigned char *, int, int, int /*<<< orphan*/ *);
scalar_t__ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int fwrite(unsigned char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ help();
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  int i, nr_file = 0;
  char *in_name, *out_name;
  FILE *in_fp, *out_fp;
  unsigned char buf[8];
  if (argc == 1)
    help();
  for (i = 1; i < argc; i++) {
    if (strcmp(argv[i], "-help") == 0) {
      help();
    } else if (*argv[i] == '-') {
      fprintf(stderr, "Unknown option.\n");
      exit(1);
    } else {
      if (nr_file == 0) {
        in_name = argv[i];
        nr_file++;
      } else if (nr_file == 1) {
        out_name = argv[i];
        nr_file++;
      } else {
        fprintf(stderr, "Bad argument ( Too many argument ).\n");
        exit(1);
      }
    }
  }
  if (nr_file != 2) {
    fprintf(stderr, "Bad argument ( Too short argument ).\n");
    exit(1);
  }
  if (!(in_fp = fopen(in_name, "rb"))) {
    fprintf(stderr, "\n%s: Can't open file %s\n", argv[0], in_name);
    exit(1);
  }
  if (!(out_fp = fopen(out_name, "wb"))) {
    fprintf(stderr, "\n%s: Can't open file %s\n", argv[0], out_name);
    exit(1);
  }
  if (fseek(in_fp, (1 << 12), SEEK_SET))
    error(0, in_name);
  for (i = 0; i < 0x100; i++) {
    if (fread(buf, sizeof(unsigned char), 8, in_fp) != 8)
      error(1, in_name);
    if (fwrite(buf, sizeof(unsigned char), 8, out_fp) != 8)
      error(2, out_name);
  }
  for (i = 0; i < 0x100; i++) {
    if (i & 0x01) {
      buf[0] = buf[1] = 0xf0;
    } else {
      buf[0] = buf[1] = 0x00;
    }
    if (i & 0x02) {
      buf[2] = buf[3] = 0xf0;
    } else {
      buf[2] = buf[3] = 0x00;
    }
    if (i & 0x04) {
      buf[4] = buf[5] = 0xf0;
    } else {
      buf[4] = buf[5] = 0x00;
    }
    if (i & 0x08) {
      buf[6] = buf[7] = 0xf0;
    } else {
      buf[6] = buf[7] = 0x00;
    }
    if (i & 0x10) {
      buf[0] = buf[1] |= 0x0f;
    }
    if (i & 0x20) {
      buf[2] = buf[3] |= 0x0f;
    }
    if (i & 0x40) {
      buf[4] = buf[5] |= 0x0f;
    }
    if (i & 0x80) {
      buf[6] = buf[7] |= 0x0f;
    }
    if (fwrite(buf, sizeof(unsigned char), 8, out_fp) != 8)
      error(2, out_name);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    11be <main+0x2e>
mov    $0x0,%al
call   1090 <help@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    12cb <main+0x13b>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe1c(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11ff <main+0x6f>
mov    $0x0,%al
call   1090 <help@plt>
jmp    12b8 <main+0x128>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1238 <main+0xa8>
mov    0x2dc2(%rip),%rax
mov    (%rax),%edi
lea    0xddf(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
cmpl   $0x0,-0x18(%rbp)
jne    1260 <main+0xd0>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    12ae <main+0x11e>
cmpl   $0x1,-0x18(%rbp)
jne    1288 <main+0xf8>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    12a9 <main+0x119>
mov    0x2d51(%rip),%rax
mov    (%rax),%edi
lea    0xd7f(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
jmp    12ae <main+0x11e>
jmp    12b3 <main+0x123>
jmp    12b8 <main+0x128>
jmp    12bd <main+0x12d>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11c5 <main+0x35>
cmpl   $0x2,-0x18(%rbp)
je     12f6 <main+0x166>
mov    0x2d04(%rip),%rax
mov    (%rax),%edi
lea    0xd57(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
mov    -0x20(%rbp),%rdi
lea    0xd61(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x30(%rbp)
cmp    $0x0,%rax
jne    1340 <main+0x1b0>
mov    0x2cc5(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    -0x20(%rbp),%rcx
lea    0xd36(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
mov    -0x28(%rbp),%rdi
lea    0xd33(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x38(%rbp)
cmp    $0x0,%rax
jne    138a <main+0x1fa>
mov    0x2c7b(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    -0x28(%rbp),%rcx
lea    0xcec(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
mov    -0x30(%rbp),%rdi
mov    0x2c43(%rip),%rax
mov    (%rax),%edx
mov    $0x1000,%esi
call   1060 <fseek@plt>
cmp    $0x0,%rax
je     13b6 <main+0x226>
mov    -0x20(%rbp),%rsi
xor    %edi,%edi
call   1070 <error@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x100,-0x14(%rbp)
jge    1439 <main+0x2a9>
lea    -0x40(%rbp),%rdi
mov    -0x30(%rbp),%rcx
mov    $0x1,%esi
mov    $0x8,%edx
call   1030 <fread@plt>
cmp    $0x8,%eax
je     13f8 <main+0x268>
mov    -0x20(%rbp),%rsi
mov    $0x1,%edi
call   1070 <error@plt>
lea    -0x40(%rbp),%rdi
mov    -0x38(%rbp),%rcx
mov    $0x1,%esi
mov    $0x8,%edx
call   10b0 <fwrite@plt>
cmp    $0x8,%eax
je     1426 <main+0x296>
mov    -0x28(%rbp),%rsi
mov    $0x2,%edi
call   1070 <error@plt>
jmp    142b <main+0x29b>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    13bd <main+0x22d>
movl   $0x0,-0x14(%rbp)
cmpl   $0x100,-0x14(%rbp)
jge    1590 <main+0x400>
mov    -0x14(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1469 <main+0x2d9>
movb   $0xf0,-0x3f(%rbp)
movb   $0xf0,-0x40(%rbp)
jmp    1471 <main+0x2e1>
movb   $0x0,-0x3f(%rbp)
movb   $0x0,-0x40(%rbp)
mov    -0x14(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     148d <main+0x2fd>
movb   $0xf0,-0x3d(%rbp)
movb   $0xf0,-0x3e(%rbp)
jmp    1495 <main+0x305>
movb   $0x0,-0x3d(%rbp)
movb   $0x0,-0x3e(%rbp)
mov    -0x14(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     14b1 <main+0x321>
movb   $0xf0,-0x3b(%rbp)
movb   $0xf0,-0x3c(%rbp)
jmp    14b9 <main+0x329>
movb   $0x0,-0x3b(%rbp)
movb   $0x0,-0x3c(%rbp)
mov    -0x14(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     14d5 <main+0x345>
movb   $0xf0,-0x39(%rbp)
movb   $0xf0,-0x3a(%rbp)
jmp    14dd <main+0x34d>
movb   $0x0,-0x39(%rbp)
movb   $0x0,-0x3a(%rbp)
mov    -0x14(%rbp),%eax
and    $0x10,%eax
cmp    $0x0,%eax
je     14f9 <main+0x369>
movzbl -0x3f(%rbp),%eax
or     $0xf,%eax
mov    %al,-0x3f(%rbp)
mov    %al,-0x40(%rbp)
mov    -0x14(%rbp),%eax
and    $0x20,%eax
cmp    $0x0,%eax
je     1515 <main+0x385>
movzbl -0x3d(%rbp),%eax
or     $0xf,%eax
mov    %al,-0x3d(%rbp)
mov    %al,-0x3e(%rbp)
mov    -0x14(%rbp),%eax
and    $0x40,%eax
cmp    $0x0,%eax
je     1531 <main+0x3a1>
movzbl -0x3b(%rbp),%eax
or     $0xf,%eax
mov    %al,-0x3b(%rbp)
mov    %al,-0x3c(%rbp)
mov    -0x14(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     154f <main+0x3bf>
movzbl -0x39(%rbp),%eax
or     $0xf,%eax
mov    %al,-0x39(%rbp)
mov    %al,-0x3a(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x38(%rbp),%rcx
mov    $0x1,%esi
mov    $0x8,%edx
call   10b0 <fwrite@plt>
cmp    $0x8,%eax
je     157d <main+0x3ed>
mov    -0x28(%rbp),%rsi
mov    $0x2,%edi
call   1070 <error@plt>
jmp    1582 <main+0x3f2>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1440 <main+0x2b0>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
cmp    $0x1,%edi
je     143a <main+0x2aa>
jle    1441 <main+0x2b1>
mov    %rsi,%rbx
mov    %edi,%r13d
mov    $0x1,%ebp
lea    0xe41(%rip),%r12
xor    %r15d,%r15d
jmp    11e0 <main+0x50>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1090 <help@plt>
add    $0x1,%rbp
cmp    %rbp,%r13
je     122d <main+0x9d>
mov    (%rbx,%rbp,8),%rdi
mov    %r12,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11d0 <main+0x40>
mov    (%rbx,%rbp,8),%rax
cmpb   $0x2d,(%rax)
je     1416 <main+0x286>
test   %r15d,%r15d
je     1220 <main+0x90>
cmp    $0x1,%r15d
jne    1428 <main+0x298>
mov    $0x2,%r15d
mov    %rax,%r14
jmp    11d7 <main+0x47>
nopl   0x0(%rax,%rax,1)
mov    %rax,0x10(%rsp)
mov    $0x1,%r15d
jmp    11d7 <main+0x47>
cmp    $0x2,%r15d
jne    1441 <main+0x2b1>
lea    0xe24(%rip),%rsi
mov    0x10(%rsp),%r15
mov    %r15,%rdi
call   1080 <fopen@plt>
test   %rax,%rax
je     1462 <main+0x2d2>
mov    %rax,%r13
lea    0xe20(%rip),%rsi
mov    %r14,%rdi
call   1080 <fopen@plt>
test   %rax,%rax
je     147a <main+0x2ea>
mov    %rax,%r12
mov    0x2d5f(%rip),%rax
mov    (%rax),%edx
mov    %r13,%rdi
mov    $0x1000,%esi
call   1060 <fseek@plt>
test   %rax,%rax
je     1297 <main+0x107>
xor    %edi,%edi
mov    %r15,%rsi
call   1070 <error@plt>
mov    $0x100,%ebp
lea    0x8(%rsp),%rbx
jmp    12b5 <main+0x125>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0xffffffff,%ebp
je     1305 <main+0x175>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x8,%edx
mov    %r13,%rcx
call   1030 <fread@plt>
cmp    $0x8,%eax
je     12dc <main+0x14c>
mov    $0x1,%edi
mov    %r15,%rsi
call   1070 <error@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x8,%edx
mov    %r12,%rcx
call   10b0 <fwrite@plt>
cmp    $0x8,%eax
je     12b0 <main+0x120>
mov    $0x2,%edi
mov    %r14,%rsi
call   1070 <error@plt>
jmp    12b0 <main+0x120>
xor    %ebp,%ebp
lea    0x8(%rsp),%r15
jmp    131f <main+0x18f>
xchg   %ax,%ax
add    $0x1,%ebp
cmp    $0x100,%ebp
je     1405 <main+0x275>
test   $0x1,%bpl
sete   %bl
shl    $0x4,%bl
add    $0xf0,%bl
mov    %bl,0x9(%rsp)
mov    %bl,0x8(%rsp)
test   $0x2,%bpl
sete   %dl
shl    $0x4,%dl
add    $0xf0,%dl
mov    %dl,0xb(%rsp)
mov    %dl,0xa(%rsp)
test   $0x4,%bpl
sete   %cl
shl    $0x4,%cl
add    $0xf0,%cl
mov    %cl,0xd(%rsp)
mov    %cl,0xc(%rsp)
test   $0x8,%bpl
sete   %al
shl    $0x4,%al
add    $0xf0,%al
mov    %al,0xf(%rsp)
mov    %al,0xe(%rsp)
test   $0x10,%bpl
jne    13d0 <main+0x240>
test   $0x20,%bpl
jne    13e1 <main+0x251>
test   $0x40,%bpl
jne    13f2 <main+0x262>
test   $0x80,%bpl
je     1394 <main+0x204>
or     $0xf,%al
mov    %al,0xf(%rsp)
mov    %al,0xe(%rsp)
mov    %r15,%rdi
mov    $0x1,%esi
mov    $0x8,%edx
mov    %r12,%rcx
call   10b0 <fwrite@plt>
cmp    $0x8,%eax
je     1310 <main+0x180>
mov    $0x2,%edi
mov    %r14,%rsi
call   1070 <error@plt>
jmp    1310 <main+0x180>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
or     $0xf,%bl
mov    %bl,0x9(%rsp)
mov    %bl,0x8(%rsp)
test   $0x20,%bpl
je     137e <main+0x1ee>
or     $0xf,%dl
mov    %dl,0xb(%rsp)
mov    %dl,0xa(%rsp)
test   $0x40,%bpl
je     1384 <main+0x1f4>
or     $0xf,%cl
mov    %cl,0xd(%rsp)
mov    %cl,0xc(%rsp)
test   $0x80,%bpl
jne    138a <main+0x1fa>
jmp    1394 <main+0x204>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2bc3(%rip),%rax
mov    (%rax),%edi
lea    0xbe0(%rip),%rsi
jmp    1451 <main+0x2c1>
mov    0x2bb1(%rip),%rax
mov    (%rax),%edi
lea    0xbdf(%rip),%rsi
jmp    1451 <main+0x2c1>
xor    %eax,%eax
call   1090 <help@plt>
mov    0x2b98(%rip),%rax
mov    (%rax),%edi
lea    0xbeb(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
mov    0x2b77(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xbf0(%rip),%rsi
mov    %r15,%rcx
jmp    1490 <main+0x300>
mov    0x2b5f(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xbd8(%rip),%rsi
mov    %r14,%rcx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"-help\00"
@stderr = global i32 0
@.str.1 = [17 x i8] c"Unknown option.\0A\00"
@.str.2 = [37 x i8] c"Bad argument ( Too many argument ).\0A\00"
@.str.3 = [38 x i8] c"Bad argument ( Too short argument ).\0A\00"
@.str.4 = [3 x i8] c"rb\00"
@.str.5 = [25 x i8] c"\0A%s: Can't open file %s\0A\00"
@.str.6 = [3 x i8] c"wb\00"
@SEEK_SET = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca [8 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
%13 = load i32, i32* %4
%14 = icmp eq i32 %13, 1
br i1 %14, label %15, label %17
15: ; preds = %2
%16 = call i32 (...) @help()
br label %17
17: ; preds = %15, %2
store i32 1, i32* %6
br label %18
18: ; preds = %75, %17
%19 = load i32, i32* %6
%20 = load i32, i32* %4
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %78
22: ; preds = %18
%23 = load i8**, i8*** %5
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8*, i8** %23, i64 %25
%27 = load i8*, i8** %26
%28 = call i64 @strcmp(i8* %27, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%29 = icmp eq i64 %28, 0
br i1 %29, label %30, label %32
30: ; preds = %22
%31 = call i32 (...) @help()
br label %74
32: ; preds = %22
%33 = load i8**, i8*** %5
%34 = load i32, i32* %6
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i8*, i8** %33, i64 %35
%37 = load i8*, i8** %36
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = icmp eq i32 %39, 45
br i1 %40, label %41, label %45
41: ; preds = %32
%42 = load i32, i32* @stderr
%43 = call i32 (i32, i8*, ...) @fprintf(i32 %42, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%44 = call i32 @exit(i32 1)
unreachable
45: ; preds = %32
%46 = load i32, i32* %7
%47 = icmp eq i32 %46, 0
br i1 %47, label %48, label %56
48: ; preds = %45
%49 = load i8**, i8*** %5
%50 = load i32, i32* %6
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds i8*, i8** %49, i64 %51
%53 = load i8*, i8** %52
store i8* %53, i8** %8
%54 = load i32, i32* %7
%55 = add nsw i32 %54, 1
store i32 %55, i32* %7
br label %72
56: ; preds = %45
%57 = load i32, i32* %7
%58 = icmp eq i32 %57, 1
br i1 %58, label %59, label %67
59: ; preds = %56
%60 = load i8**, i8*** %5
%61 = load i32, i32* %6
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds i8*, i8** %60, i64 %62
%64 = load i8*, i8** %63
store i8* %64, i8** %9
%65 = load i32, i32* %7
%66 = add nsw i32 %65, 1
store i32 %66, i32* %7
br label %71
67: ; preds = %56
%68 = load i32, i32* @stderr
%69 = call i32 (i32, i8*, ...) @fprintf(i32 %68, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
%70 = call i32 @exit(i32 1)
unreachable
71: ; preds = %59
br label %72
72: ; preds = %71, %48
br label %73
73: ; preds = %72
br label %74
74: ; preds = %73, %30
br label %75
75: ; preds = %74
%76 = load i32, i32* %6
%77 = add nsw i32 %76, 1
store i32 %77, i32* %6
br label %18
78: ; preds = %18
%79 = load i32, i32* %7
%80 = icmp ne i32 %79, 2
br i1 %80, label %81, label %85
81: ; preds = %78
%82 = load i32, i32* @stderr
%83 = call i32 (i32, i8*, ...) @fprintf(i32 %82, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
%84 = call i32 @exit(i32 1)
unreachable
85: ; preds = %78
%86 = load i8*, i8** %8
%87 = call i32* @fopen(i8* %86, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
store i32* %87, i32** %10
%88 = icmp ne i32* %87, null
br i1 %88, label %97, label %89
89: ; preds = %85
%90 = load i32, i32* @stderr
%91 = load i8**, i8*** %5
%92 = getelementptr inbounds i8*, i8** %91, i64 0
%93 = load i8*, i8** %92
%94 = load i8*, i8** %8
%95 = call i32 (i32, i8*, ...) @fprintf(i32 %90, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i8* %93, i8* %94)
%96 = call i32 @exit(i32 1)
unreachable
97: ; preds = %85
%98 = load i8*, i8** %9
%99 = call i32* @fopen(i8* %98, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
store i32* %99, i32** %11
%100 = icmp ne i32* %99, null
br i1 %100, label %109, label %101
101: ; preds = %97
%102 = load i32, i32* @stderr
%103 = load i8**, i8*** %5
%104 = getelementptr inbounds i8*, i8** %103, i64 0
%105 = load i8*, i8** %104
%106 = load i8*, i8** %9
%107 = call i32 (i32, i8*, ...) @fprintf(i32 %102, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i8* %105, i8* %106)
%108 = call i32 @exit(i32 1)
unreachable
109: ; preds = %97
%110 = load i32*, i32** %10
%111 = load i32, i32* @SEEK_SET
%112 = call i64 @fseek(i32* %110, i32 4096, i32 %111)
%113 = icmp ne i64 %112, 0
br i1 %113, label %114, label %117
114: ; preds = %109
%115 = load i8*, i8** %8
%116 = call i32 @error(i32 0, i8* %115)
br label %117
117: ; preds = %114, %109
store i32 0, i32* %6
br label %118
118: ; preds = %138, %117
%119 = load i32, i32* %6
%120 = icmp slt i32 %119, 256
br i1 %120, label %121, label %141
121: ; preds = %118
%122 = getelementptr inbounds [8 x i8], [8 x i8]* %12, i64 0, i64 0
%123 = load i32*, i32** %10
%124 = call i32 @fread(i8* %122, i32 1, i32 8, i32* %123)
%125 = icmp ne i32 %124, 8
br i1 %125, label %126, label %129
126: ; preds = %121
%127 = load i8*, i8** %8
%128 = call i32 @error(i32 1, i8* %127)
br label %129
129: ; preds = %126, %121
%130 = getelementptr inbounds [8 x i8], [8 x i8]* %12, i64 0, i64 0
%131 = load i32*, i32** %11
%132 = call i32 @fwrite(i8* %130, i32 1, i32 8, i32* %131)
%133 = icmp ne i32 %132, 8
br i1 %133, label %134, label %137
134: ; preds = %129
%135 = load i8*, i8** %9
%136 = call i32 @error(i32 2, i8* %135)
br label %137
137: ; preds = %134, %129
br label %138
138: ; preds = %137
%139 = load i32, i32* %6
%140 = add nsw i32 %139, 1
store i32 %140, i32* %6
br label %118
141: ; preds = %118
store i32 0, i32* %6
br label %142
142: ; preds = %238, %141
%143 = load i32, i32* %6
%144 = icmp slt i32 %143, 256
br i1 %144, label %145, label %241
145: ; preds = %142
%146 = load i32, i32* %6
%147 = and i32 %146, 1
%148 = icmp ne i32 %147, 0
br i1 %148, label %149, label %152
149: ; preds = %145
%150 = getelementptr inbounds [8 x i8], [8 x i8]* %12, i64 0, i64 1
store i8 -16, i8* %150
%151 = getelementptr inbounds [8 x i8], [8 x i8]* %12, i64 0, i64 0
store i8 -16, i8* %151
br label %155
152: ; preds = %145
%153 = getelementptr inbounds [8 x i8], [8 x i8]* %12, i64 0, i64 1
store i8 0, i8* %153
%154 = getelementptr inbounds [8 x i8], [8 x i8]* %12, i64 0, i64 0
store i8 0, i8* %154
br label %155
155: ; preds = %152, %149
%156 = load i32, i32* %6
%157 = and i32 %156, 2
%158 = icmp ne i32 %157, 0
br i1 %158, label %159, label %162
159: ; preds = %155
%160 = getelementptr inbounds [8 x i8], [8 x i8]* %12, i64 0, i64 3
store i8 -16, i8* %160
%161 = getelementptr inbounds [8 x i8], [8 x i8]* %12, i64 0, i64 2
store i8 -16, i8* %161
br label %165
162: ; preds = %155
%163 = getelementptr inbounds [8 x i8], [8 x i8]* %12, i64 0, i64 3
store i8 0, i8* %163
%164 = getelementptr inbounds [8 x i8], [8 x i8]* %12, i64 0, i64 2
store i8 0, i8* %164
br label %165
165: ; preds = %162, %159
%166 = load i32, i32* %6
%167 = and i32 %166, 4
%168 = icmp ne i32 %167, 0
br i1 %168, label %169, label %172
169: ; preds = %165
%170 = getelementptr inbounds [8 x i8], [8 x i8]* %12, i64 0, i64 5
store i8 -16, i8* %170
%171 = getelementptr inbounds [8 x i8], [8 x i8]* %12, i64 0, i64 4
store i8 -16, i8* %171
br label %175
172: ; preds = %165
%173 = getelementptr inbounds [8 x i8], [8 x i8]* %12, i64 0, i64 5
store i8 0, i8* %173
%174 = getelementptr inbounds [8 x i8], [8 x i8]* %12, i64 0, i64 4
store i8 0, i8* %174
br label %175
175: ; preds = %172, %169
%176 = load i32, i32* %6
%177 = and i32 %176, 8
%178 = icmp ne i32 %177, 0
br i1 %178, label %179, label %182
179: ; preds = %175
%180 = getelementptr inbounds [8 x i8], [8 x i8]* %12, i64 0, i64 7
store i8 -16, i8* %180
%181 = getelementptr inbounds [8 x i8], [8 x i8]* %12, i64 0, i64 6
store i8 -16, i8* %181
br label %185
182: ; preds = %175
%183 = getelementptr inbounds [8 x i8], [8 x i8]* %12, i64 0, i64 7
store i8 0, i8* %183
%184 = getelementptr inbounds [8 x i8], [8 x i8]* %12, i64 0, i64 6
store i8 0, i8* %184
br label %185
185: ; preds = %182, %179
%186 = load i32, i32* %6
%187 = and i32 %186, 16
%188 = icmp ne i32 %187, 0
br i1 %188, label %189, label %196
189: ; preds = %185
%190 = getelementptr inbounds [8 x i8], [8 x i8]* %12, i64 0, i64 1
%191 = load i8, i8* %190
%192 = zext i8 %191 to i32
%193 = or i32 %192, 15
%194 = trunc i32 %193 to i8
store i8 %194, i8* %190
%195 = getelementptr inbounds [8 x i8], [8 x i8]* %12, i64 0, i64 0
store i8 %194, i8* %195
br label %196
196: ; preds = %189, %185
%197 = load i32, i32* %6
%198 = and i32 %197, 32
%199 = icmp ne i32 %198, 0
br i1 %199, label %200, label %207
200: ; preds = %196
%201 = getelementptr inbounds [8 x i8], [8 x i8]* %12, i64 0, i64 3
%202 = load i8, i8* %201
%203 = zext i8 %202 to i32
%204 = or i32 %203, 15
%205 = trunc i32 %204 to i8
store i8 %205, i8* %201
%206 = getelementptr inbounds [8 x i8], [8 x i8]* %12, i64 0, i64 2
store i8 %205, i8* %206
br label %207
207: ; preds = %200, %196
%208 = load i32, i32* %6
%209 = and i32 %208, 64
%210 = icmp ne i32 %209, 0
br i1 %210, label %211, label %218
211: ; preds = %207
%212 = getelementptr inbounds [8 x i8], [8 x i8]* %12, i64 0, i64 5
%213 = load i8, i8* %212
%214 = zext i8 %213 to i32
%215 = or i32 %214, 15
%216 = trunc i32 %215 to i8
store i8 %216, i8* %212
%217 = getelementptr inbounds [8 x i8], [8 x i8]* %12, i64 0, i64 4
store i8 %216, i8* %217
br label %218
218: ; preds = %211, %207
%219 = load i32, i32* %6
%220 = and i32 %219, 128
%221 = icmp ne i32 %220, 0
br i1 %221, label %222, label %229
222: ; preds = %218
%223 = getelementptr inbounds [8 x i8], [8 x i8]* %12, i64 0, i64 7
%224 = load i8, i8* %223
%225 = zext i8 %224 to i32
%226 = or i32 %225, 15
%227 = trunc i32 %226 to i8
store i8 %227, i8* %223
%228 = getelementptr inbounds [8 x i8], [8 x i8]* %12, i64 0, i64 6
store i8 %227, i8* %228
br label %229
229: ; preds = %222, %218
%230 = getelementptr inbounds [8 x i8], [8 x i8]* %12, i64 0, i64 0
%231 = load i32*, i32** %11
%232 = call i32 @fwrite(i8* %230, i32 1, i32 8, i32* %231)
%233 = icmp ne i32 %232, 8
br i1 %233, label %234, label %237
234: ; preds = %229
%235 = load i8*, i8** %9
%236 = call i32 @error(i32 2, i8* %235)
br label %237
237: ; preds = %234, %229
br label %238
238: ; preds = %237
%239 = load i32, i32* %6
%240 = add nsw i32 %239, 1
store i32 %240, i32* %6
br label %142
241: ; preds = %142
%242 = load i32, i32* %3
ret i32 %242
}

LLVM IR (-O2):
@.str = [6 x i8] c"-help\00"
@stderr = global i32 0
@.str.1 = [17 x i8] c"Unknown option.\0A\00"
@.str.2 = [37 x i8] c"Bad argument ( Too many argument ).\0A\00"
@.str.3 = [38 x i8] c"Bad argument ( Too short argument ).\0A\00"
@.str.4 = [3 x i8] c"rb\00"
@.str.5 = [25 x i8] c"\0A%s: Can't open file %s\0A\00"
@.str.6 = [3 x i8] c"wb\00"
@SEEK_SET = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [8 x i8]
%4 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%5 = icmp eq i32 %0, 1
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 (...) @help()
br label %45
8: ; preds = %2
%9 = icmp sgt i32 %0, 1
br i1 %9, label %10, label %45
10: ; preds = %8
%11 = zext i32 %0 to i64
br label %12
12: ; preds = %10, %37
%13 = phi i64 [ 1, %10 ], [ %41, %37 ]
%14 = phi i32 [ 0, %10 ], [ %40, %37 ]
%15 = phi i8* [ undef, %10 ], [ %39, %37 ]
%16 = phi i8* [ undef, %10 ], [ %38, %37 ]
%17 = getelementptr inbounds i8*, i8** %1, i64 %13
%18 = load i8*, i8** %17
%19 = tail call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %12
%22 = tail call i32 (...) @help()
br label %37
23: ; preds = %12
%24 = load i8*, i8** %17
%25 = load i8, i8* %24
%26 = icmp eq i8 %25, 45
br i1 %26, label %27, label %31
27: ; preds = %23
%28 = load i32, i32* @stderr
%29 = tail call i32 (i32, i8*, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%30 = tail call i32 @exit(i32 1)
unreachable
31: ; preds = %23
switch i32 %14, label %33 [
i32 0, label %37
i32 1, label %32
]
32: ; preds = %31
br label %37
33: ; preds = %31
%34 = load i32, i32* @stderr
%35 = tail call i32 (i32, i8*, ...) @fprintf(i32 %34, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
%36 = tail call i32 @exit(i32 1)
unreachable
37: ; preds = %31, %21, %32
%38 = phi i8* [ %16, %21 ], [ %16, %32 ], [ %24, %31 ]
%39 = phi i8* [ %15, %21 ], [ %24, %32 ], [ %15, %31 ]
%40 = phi i32 [ %14, %21 ], [ 2, %32 ], [ 1, %31 ]
%41 = add nuw nsw i64 %13, 1
%42 = icmp eq i64 %41, %11
br i1 %42, label %43, label %12
43: ; preds = %37
%44 = icmp eq i32 %40, 2
br i1 %44, label %49, label %45
45: ; preds = %6, %8, %43
%46 = load i32, i32* @stderr
%47 = tail call i32 (i32, i8*, ...) @fprintf(i32 %46, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
%48 = tail call i32 @exit(i32 1)
unreachable
49: ; preds = %43
%50 = tail call i32* @fopen(i8* %38, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%51 = icmp eq i32* %50, null
br i1 %51, label %52, label %57
52: ; preds = %49
%53 = load i32, i32* @stderr
%54 = load i8*, i8** %1
%55 = tail call i32 (i32, i8*, ...) @fprintf(i32 %53, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i8* %54, i8* %38)
%56 = tail call i32 @exit(i32 1)
unreachable
57: ; preds = %49
%58 = tail call i32* @fopen(i8* %39, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%59 = icmp eq i32* %58, null
br i1 %59, label %60, label %65
60: ; preds = %57
%61 = load i32, i32* @stderr
%62 = load i8*, i8** %1
%63 = tail call i32 (i32, i8*, ...) @fprintf(i32 %61, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i8* %62, i8* %39)
%64 = tail call i32 @exit(i32 1)
unreachable
65: ; preds = %57
%66 = load i32, i32* @SEEK_SET
%67 = tail call i64 @fseek(i32* %50, i32 4096, i32 %66)
%68 = icmp eq i64 %67, 0
br i1 %68, label %69, label %70
69: ; preds = %70, %65
br label %80
70: ; preds = %65
%71 = tail call i32 @error(i32 0, i8* %38)
br label %69
72: ; preds = %91
%73 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 1
%74 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 3
%75 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 2
%76 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 5
%77 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 4
%78 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 7
%79 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 6
br label %94
80: ; preds = %69, %91
%81 = phi i32 [ %92, %91 ], [ 0, %69 ]
%82 = call i32 @fread(i8* %4, i32 1, i32 8, i32* %50)
%83 = icmp eq i32 %82, 8
br i1 %83, label %86, label %84
84: ; preds = %80
%85 = tail call i32 @error(i32 1, i8* %38)
br label %86
86: ; preds = %84, %80
%87 = call i32 @fwrite(i8* %4, i32 1, i32 8, i32* %58)
%88 = icmp eq i32 %87, 8
br i1 %88, label %91, label %89
89: ; preds = %86
%90 = tail call i32 @error(i32 2, i8* %39)
br label %91
91: ; preds = %86, %89
%92 = add nuw nsw i32 %81, 1
%93 = icmp eq i32 %92, 256
br i1 %93, label %72, label %80
94: ; preds = %72, %132
%95 = phi i32 [ 0, %72 ], [ %133, %132 ]
%96 = and i32 %95, 1
%97 = icmp eq i32 %96, 0
%98 = select i1 %97, i8 0, i8 -16
store i8 %98, i8* %73
store i8 %98, i8* %4
%99 = and i32 %95, 2
%100 = icmp eq i32 %99, 0
%101 = select i1 %100, i8 0, i8 -16
store i8 %101, i8* %74
store i8 %101, i8* %75
%102 = and i32 %95, 4
%103 = icmp eq i32 %102, 0
%104 = select i1 %103, i8 0, i8 -16
store i8 %104, i8* %76
store i8 %104, i8* %77
%105 = and i32 %95, 8
%106 = icmp eq i32 %105, 0
%107 = select i1 %106, i8 0, i8 -16
store i8 %107, i8* %78
store i8 %107, i8* %79
%108 = and i32 %95, 16
%109 = icmp eq i32 %108, 0
br i1 %109, label %112, label %110
110: ; preds = %94
%111 = or i8 %98, 15
store i8 %111, i8* %73
store i8 %111, i8* %4
br label %112
112: ; preds = %110, %94
%113 = and i32 %95, 32
%114 = icmp eq i32 %113, 0
br i1 %114, label %117, label %115
115: ; preds = %112
%116 = or i8 %101, 15
store i8 %116, i8* %74
store i8 %116, i8* %75
br label %117
117: ; preds = %115, %112
%118 = and i32 %95, 64
%119 = icmp eq i32 %118, 0
br i1 %119, label %122, label %120
120: ; preds = %117
%121 = or i8 %104, 15
store i8 %121, i8* %76
store i8 %121, i8* %77
br label %122
122: ; preds = %120, %117
%123 = and i32 %95, 128
%124 = icmp eq i32 %123, 0
br i1 %124, label %127, label %125
125: ; preds = %122
%126 = or i8 %107, 15
store i8 %126, i8* %78
store i8 %126, i8* %79
br label %127
127: ; preds = %125, %122
%128 = call i32 @fwrite(i8* %4, i32 1, i32 8, i32* %58)
%129 = icmp eq i32 %128, 8
br i1 %129, label %132, label %130
130: ; preds = %127
%131 = tail call i32 @error(i32 2, i8* %39)
br label %132
132: ; preds = %127, %130
%133 = add nuw nsw i32 %95, 1
%134 = icmp eq i32 %133, 256
br i1 %134, label %135, label %94
135: ; preds = %132
ret i32 0
}