#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_END;
int /*<<< orphan*/ SEEK_SET;
int atoi(char *);
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*/ free(unsigned char *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
int ftell(int /*<<< orphan*/ *);
unsigned char *malloc(int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int main(int argc, char *argv[]) {
  FILE *fp = NULL;
  unsigned char *in;
  char *name;
  int i, fs, s, e;
  i = 1;
  if (argc != 4) {
    fprintf(stderr, "\nICOPY Binary to GB-Z80 Code Converter v1.0\n");
    fprintf(stderr, "Written by Ville Helin in 2001\n");
    fprintf(stderr, "USAGE: %s <BIN FILE> <START> <END>\n\n", argv[0]);
    return 1;
  }
  name = argv[1];
  s = atoi(argv[2]);
  e = atoi(argv[3]);
  fp = fopen(name, "rb");
  if (fp == NULL) {
    fprintf(stderr, "MAIN: Could not open file \"%s\".\n", name);
    return 1;
  }
  fseek(fp, 0, SEEK_END);
  fs = ftell(fp);
  fseek(fp, 0, SEEK_SET);
  in = malloc(sizeof(char) * fs);
  if (in == NULL) {
    fprintf(stderr, "MAIN: Out of memory. Could not allocate %d bytes.\n", fs);
    fclose(fp);
    return 1;
  }
  fread(in, 1, fs, fp);
  fclose(fp);
  if (e >= fs) {
    fprintf(stderr,
            "MAIN: End (%d) is too much, ending conversion to the last byte "
            "(%d).\n",
            e, fs - 1);
    e = fs - 1;
  }
  fprintf(stdout, "; this file was created with icopy by ville helin "
                  "<vhelin@cc.hut.fi>.\n");
  fprintf(stdout,
          "; listing of file \"%s\" (bytes %d-%d, file range 0...%d).\n", name,
          s, e, fs - 1);
  for (; s <= e; s++) {
    fprintf(stdout, "\tld\ta, %d\n", in[s]);
    fprintf(stdout, "\tldi\t(hl), a\n");
  }
  free(in);
  return 0;
}


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)
movq   $0x0,-0x18(%rbp)
movl   $0x1,-0x2c(%rbp)
cmpl   $0x4,-0x8(%rbp)
je     1217 <main+0x87>
mov    0x2e12(%rip),%rax
mov    (%rax),%edi
lea    0xe31(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2dfb(%rip),%rax
mov    (%rax),%edi
lea    0xe47(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2de4(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe49(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1402 <main+0x272>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10b0 <atoi@plt>
mov    %eax,-0x34(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   10b0 <atoi@plt>
mov    %eax,-0x38(%rbp)
mov    -0x28(%rbp),%rdi
lea    0xe24(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1289 <main+0xf9>
mov    0x2d6f(%rip),%rax
mov    (%rax),%edi
mov    -0x28(%rbp),%rdx
lea    0xdff(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1402 <main+0x272>
mov    -0x18(%rbp),%rdi
mov    0x2d54(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1090 <fseek@plt>
mov    -0x18(%rbp),%rdi
call   1070 <ftell@plt>
mov    %eax,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2d1c(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1090 <fseek@plt>
movslq -0x30(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    130a <main+0x17a>
mov    0x2cf6(%rip),%rax
mov    (%rax),%edi
mov    -0x30(%rbp),%edx
lea    0xda8(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
movl   $0x1,-0x4(%rbp)
jmp    1402 <main+0x272>
mov    -0x20(%rbp),%rdi
mov    -0x30(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
call   1040 <fread@plt>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x38(%rbp),%eax
cmp    -0x30(%rbp),%eax
jl     135d <main+0x1cd>
mov    0x2c9d(%rip),%rax
mov    (%rax),%edi
mov    -0x38(%rbp),%edx
mov    -0x30(%rbp),%ecx
sub    $0x1,%ecx
lea    0xd7c(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x30(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x38(%rbp)
mov    0x2c64(%rip),%rax
mov    (%rax),%edi
lea    0xda2(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2c4d(%rip),%rax
mov    (%rax),%edi
mov    -0x28(%rbp),%rdx
mov    -0x34(%rbp),%ecx
mov    -0x38(%rbp),%r8d
mov    -0x30(%rbp),%r9d
sub    $0x1,%r9d
lea    0xdbf(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x34(%rbp),%eax
cmp    -0x38(%rbp),%eax
jg     13f2 <main+0x262>
mov    0x2c17(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
movzbl (%rax,%rcx,1),%edx
lea    0xdca(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2bf4(%rip),%rax
mov    (%rax),%edi
lea    0xdbe(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    139e <main+0x20e>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
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
push   %rax
mov    %rsi,%rbx
cmp    $0x4,%edi
jne    1251 <main+0xc1>
mov    0x8(%rbx),%r15
mov    0x10(%rbx),%rdi
call   10b0 <atoi@plt>
mov    %eax,%r14d
mov    0x18(%rbx),%rdi
call   10b0 <atoi@plt>
mov    %eax,%r12d
lea    0xea8(%rip),%rsi
mov    %r15,%rdi
call   10a0 <fopen@plt>
test   %rax,%rax
je     1289 <main+0xf9>
mov    %rax,%rbp
mov    0x2e03(%rip),%rax
mov    (%rax),%edx
mov    %rbp,%rdi
xor    %esi,%esi
call   1090 <fseek@plt>
mov    %rbp,%rdi
call   1070 <ftell@plt>
mov    %eax,%r13d
mov    0x2dcd(%rip),%rax
mov    (%rax),%edx
mov    %rbp,%rdi
xor    %esi,%esi
call   1090 <fseek@plt>
mov    %r13d,%edi
call   1080 <malloc@plt>
test   %rax,%rax
je     12ad <main+0x11d>
mov    %rax,(%rsp)
mov    %rax,%rdi
mov    $0x1,%esi
mov    %r13d,%edx
mov    %rbp,%rcx
call   1040 <fread@plt>
mov    %rbp,%rdi
call   1050 <fclose@plt>
cmp    %r13d,%r12d
jge    12d9 <main+0x149>
add    $0xffffffff,%r13d
jmp    12fd <main+0x16d>
mov    0x2d80(%rip),%rbp
mov    0x0(%rbp),%edi
lea    0xd9e(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    0x0(%rbp),%edi
lea    0xdba(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    0x0(%rbp),%edi
mov    (%rbx),%rdx
lea    0xdc6(%rip),%rsi
jmp    129c <main+0x10c>
mov    0x2d48(%rip),%rax
mov    (%rax),%edi
lea    0xddc(%rip),%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0x1,%eax
jmp    1394 <main+0x204>
mov    0x2d24(%rip),%rax
mov    (%rax),%edi
lea    0xdd9(%rip),%rsi
mov    %r13d,%edx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    %rbp,%rdi
call   1050 <fclose@plt>
mov    $0x1,%eax
jmp    1394 <main+0x204>
mov    0x2cf8(%rip),%rax
mov    (%rax),%edi
add    $0xffffffff,%r13d
lea    0xddc(%rip),%rsi
mov    %r12d,%edx
mov    %r13d,%ecx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    %r13d,%r12d
mov    %r14d,%ebx
mov    0x2cc1(%rip),%r14
mov    (%r14),%edi
lea    0xdfe(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    (%r14),%edi
lea    0xe34(%rip),%rsi
mov    %r15,%rdx
mov    %ebx,%ecx
mov    %r12d,%r8d
mov    %r13d,%r9d
xor    %eax,%eax
call   1060 <fprintf@plt>
cmp    %r12d,%ebx
jg     1389 <main+0x1f9>
movslq %ebx,%rax
mov    (%rsp),%rbp
add    %rax,%rbp
sub    %ebx,%r12d
add    $0x1,%r12d
lea    0xe3f(%rip),%r13
lea    0xe43(%rip),%rbx
xor    %r15d,%r15d
nopl   0x0(%rax,%rax,1)
mov    (%r14),%edi
movzbl 0x0(%rbp,%r15,1),%edx
mov    %r13,%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    (%r14),%edi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
add    $0x1,%r15
cmp    %r15d,%r12d
jne    1360 <main+0x1d0>
mov    (%rsp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [45 x i8] c"\0AICOPY Binary to GB-Z80 Code Converter v1.0\0A\00"
@.str.1 = [32 x i8] c"Written by Ville Helin in 2001\0A\00"
@.str.2 = [37 x i8] c"USAGE: %s <BIN FILE> <START> <END>\0A\0A\00"
@.str.3 = [3 x i8] c"rb\00"
@.str.4 = [33 x i8] c"MAIN: Could not open file \22%s\22.\0A\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.5 = [51 x i8] c"MAIN: Out of memory. Could not allocate %d bytes.\0A\00"
@.str.6 = [70 x i8] c"MAIN: End (%d) is too much, ending conversion to the last byte (%d).\0A\00"
@stdout = global i32 0
@.str.7 = [71 x i8] c"; this file was created with icopy by ville helin <vhelin@cc.hut.fi>.\0A\00"
@.str.8 = [58 x i8] c"; listing of file \22%s\22 (bytes %d-%d, file range 0...%d).\0A\00"
@.str.9 = [11 x i8] c"\09ld\09a, %d\0A\00"
@.str.10 = [14 x i8] c"\09ldi\09(hl), a\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32* null, i32** %6
store i32 1, i32* %9
%13 = load i32, i32* %4
%14 = icmp ne i32 %13, 4
br i1 %14, label %15, label %25
15: ; preds = %2
%16 = load i32, i32* @stderr
%17 = call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%18 = load i32, i32* @stderr
%19 = call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%20 = load i32, i32* @stderr
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 0
%23 = load i8*, i8** %22
%24 = call i32 (i32, i8*, ...) @fprintf(i32 %20, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i8* %23)
store i32 1, i32* %3
br label %116
25: ; preds = %2
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 1
%28 = load i8*, i8** %27
store i8* %28, i8** %8
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 2
%31 = load i8*, i8** %30
%32 = call i32 @atoi(i8* %31)
store i32 %32, i32* %11
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 3
%35 = load i8*, i8** %34
%36 = call i32 @atoi(i8* %35)
store i32 %36, i32* %12
%37 = load i8*, i8** %8
%38 = call i32* @fopen(i8* %37, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
store i32* %38, i32** %6
%39 = load i32*, i32** %6
%40 = icmp eq i32* %39, null
br i1 %40, label %41, label %45
41: ; preds = %25
%42 = load i32, i32* @stderr
%43 = load i8*, i8** %8
%44 = call i32 (i32, i8*, ...) @fprintf(i32 %42, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0), i8* %43)
store i32 1, i32* %3
br label %116
45: ; preds = %25
%46 = load i32*, i32** %6
%47 = load i32, i32* @SEEK_END
%48 = call i32 @fseek(i32* %46, i32 0, i32 %47)
%49 = load i32*, i32** %6
%50 = call i32 @ftell(i32* %49)
store i32 %50, i32* %10
%51 = load i32*, i32** %6
%52 = load i32, i32* @SEEK_SET
%53 = call i32 @fseek(i32* %51, i32 0, i32 %52)
%54 = load i32, i32* %10
%55 = sext i32 %54 to i64
%56 = mul i64 1, %55
%57 = trunc i64 %56 to i32
%58 = call i8* @malloc(i32 %57)
store i8* %58, i8** %7
%59 = load i8*, i8** %7
%60 = icmp eq i8* %59, null
br i1 %60, label %61, label %67
61: ; preds = %45
%62 = load i32, i32* @stderr
%63 = load i32, i32* %10
%64 = call i32 (i32, i8*, ...) @fprintf(i32 %62, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.5, i64 0, i64 0), i32 %63)
%65 = load i32*, i32** %6
%66 = call i32 @fclose(i32* %65)
store i32 1, i32* %3
br label %116
67: ; preds = %45
%68 = load i8*, i8** %7
%69 = load i32, i32* %10
%70 = load i32*, i32** %6
%71 = call i32 @fread(i8* %68, i32 1, i32 %69, i32* %70)
%72 = load i32*, i32** %6
%73 = call i32 @fclose(i32* %72)
%74 = load i32, i32* %12
%75 = load i32, i32* %10
%76 = icmp sge i32 %74, %75
br i1 %76, label %77, label %85
77: ; preds = %67
%78 = load i32, i32* @stderr
%79 = load i32, i32* %12
%80 = load i32, i32* %10
%81 = sub nsw i32 %80, 1
%82 = call i32 (i32, i8*, ...) @fprintf(i32 %78, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.6, i64 0, i64 0), i32 %79, i32 %81)
%83 = load i32, i32* %10
%84 = sub nsw i32 %83, 1
store i32 %84, i32* %12
br label %85
85: ; preds = %77, %67
%86 = load i32, i32* @stdout
%87 = call i32 (i32, i8*, ...) @fprintf(i32 %86, i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.7, i64 0, i64 0))
%88 = load i32, i32* @stdout
%89 = load i8*, i8** %8
%90 = load i32, i32* %11
%91 = load i32, i32* %12
%92 = load i32, i32* %10
%93 = sub nsw i32 %92, 1
%94 = call i32 (i32, i8*, ...) @fprintf(i32 %88, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.8, i64 0, i64 0), i8* %89, i32 %90, i32 %91, i32 %93)
br label %95
95: ; preds = %110, %85
%96 = load i32, i32* %11
%97 = load i32, i32* %12
%98 = icmp sle i32 %96, %97
br i1 %98, label %99, label %113
99: ; preds = %95
%100 = load i32, i32* @stdout
%101 = load i8*, i8** %7
%102 = load i32, i32* %11
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds i8, i8* %101, i64 %103
%105 = load i8, i8* %104
%106 = zext i8 %105 to i32
%107 = call i32 (i32, i8*, ...) @fprintf(i32 %100, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0), i32 %106)
%108 = load i32, i32* @stdout
%109 = call i32 (i32, i8*, ...) @fprintf(i32 %108, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0))
br label %110
110: ; preds = %99
%111 = load i32, i32* %11
%112 = add nsw i32 %111, 1
store i32 %112, i32* %11
br label %95
113: ; preds = %95
%114 = load i8*, i8** %7
%115 = call i32 @free(i8* %114)
store i32 0, i32* %3
br label %116
116: ; preds = %113, %61, %41, %15
%117 = load i32, i32* %3
ret i32 %117
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [45 x i8] c"\0AICOPY Binary to GB-Z80 Code Converter v1.0\0A\00"
@.str.1 = [32 x i8] c"Written by Ville Helin in 2001\0A\00"
@.str.2 = [37 x i8] c"USAGE: %s <BIN FILE> <START> <END>\0A\0A\00"
@.str.3 = [3 x i8] c"rb\00"
@.str.4 = [33 x i8] c"MAIN: Could not open file \22%s\22.\0A\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.5 = [51 x i8] c"MAIN: Out of memory. Could not allocate %d bytes.\0A\00"
@.str.6 = [70 x i8] c"MAIN: End (%d) is too much, ending conversion to the last byte (%d).\0A\00"
@stdout = global i32 0
@.str.7 = [71 x i8] c"; this file was created with icopy by ville helin <vhelin@cc.hut.fi>.\0A\00"
@.str.8 = [58 x i8] c"; listing of file \22%s\22 (bytes %d-%d, file range 0...%d).\0A\00"
@.str.9 = [11 x i8] c"\09ld\09a, %d\0A\00"
@.str.10 = [14 x i8] c"\09ldi\09(hl), a\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 4
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = tail call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %1
%11 = tail call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i8* %10)
br label %73
12: ; preds = %2
%13 = getelementptr inbounds i8*, i8** %1, i64 1
%14 = load i8*, i8** %13
%15 = getelementptr inbounds i8*, i8** %1, i64 2
%16 = load i8*, i8** %15
%17 = tail call i32 @atoi(i8* %16)
%18 = getelementptr inbounds i8*, i8** %1, i64 3
%19 = load i8*, i8** %18
%20 = tail call i32 @atoi(i8* %19)
%21 = tail call i32* @fopen(i8* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%22 = icmp eq i32* %21, null
br i1 %22, label %23, label %26
23: ; preds = %12
%24 = load i32, i32* @stderr
%25 = tail call i32 (i32, i8*, ...) @fprintf(i32 %24, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0), i8* %14)
br label %73
26: ; preds = %12
%27 = load i32, i32* @SEEK_END
%28 = tail call i32 @fseek(i32* %21, i32 0, i32 %27)
%29 = tail call i32 @ftell(i32* %21)
%30 = load i32, i32* @SEEK_SET
%31 = tail call i32 @fseek(i32* %21, i32 0, i32 %30)
%32 = tail call i8* @malloc(i32 %29)
%33 = icmp eq i8* %32, null
br i1 %33, label %34, label %38
34: ; preds = %26
%35 = load i32, i32* @stderr
%36 = tail call i32 (i32, i8*, ...) @fprintf(i32 %35, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.5, i64 0, i64 0), i32 %29)
%37 = tail call i32 @fclose(i32* %21)
br label %73
38: ; preds = %26
%39 = tail call i32 @fread(i8* %32, i32 1, i32 %29, i32* %21)
%40 = tail call i32 @fclose(i32* %21)
%41 = icmp slt i32 %20, %29
br i1 %41, label %42, label %44
42: ; preds = %38
%43 = add nsw i32 %29, -1
br label %48
44: ; preds = %38
%45 = load i32, i32* @stderr
%46 = add nsw i32 %29, -1
%47 = tail call i32 (i32, i8*, ...) @fprintf(i32 %45, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.6, i64 0, i64 0), i32 %20, i32 %46)
br label %48
48: ; preds = %42, %44
%49 = phi i32 [ %43, %42 ], [ %46, %44 ]
%50 = phi i32 [ %20, %42 ], [ %46, %44 ]
%51 = load i32, i32* @stdout
%52 = tail call i32 (i32, i8*, ...) @fprintf(i32 %51, i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.7, i64 0, i64 0))
%53 = load i32, i32* @stdout
%54 = tail call i32 (i32, i8*, ...) @fprintf(i32 %53, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.8, i64 0, i64 0), i8* %14, i32 %17, i32 %50, i32 %49)
%55 = icmp sgt i32 %17, %50
br i1 %55, label %71, label %56
56: ; preds = %48
%57 = sext i32 %17 to i64
%58 = add nsw i32 %50, 1
br label %59
59: ; preds = %56, %59
%60 = phi i64 [ %57, %56 ], [ %68, %59 ]
%61 = load i32, i32* @stdout
%62 = getelementptr inbounds i8, i8* %32, i64 %60
%63 = load i8, i8* %62
%64 = zext i8 %63 to i32
%65 = tail call i32 (i32, i8*, ...) @fprintf(i32 %61, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0), i32 %64)
%66 = load i32, i32* @stdout
%67 = tail call i32 (i32, i8*, ...) @fprintf(i32 %66, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0))
%68 = add nsw i64 %60, 1
%69 = trunc i64 %68 to i32
%70 = icmp eq i32 %58, %69
br i1 %70, label %71, label %59
71: ; preds = %59, %48
%72 = tail call i32 @free(i8* %32)
br label %73
73: ; preds = %71, %34, %23, %4
%74 = phi i32 [ 1, %4 ], [ 1, %23 ], [ 1, %34 ], [ 0, %71 ]
ret i32 %74
}