#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 /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
unsigned int fread(unsigned char *, int, unsigned int, int /*<<< orphan*/ *);
int /*<<< orphan*/ free(unsigned char *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, long, int /*<<< orphan*/);
unsigned int ftell(int /*<<< orphan*/ *);
int /*<<< orphan*/ fwrite(char *, int /*<<< orphan*/, int,
                          int /*<<< orphan*/ *);
unsigned char *malloc(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sprintf(char *, char *, ...);
int /*<<< orphan*/ strlen(char *);
int main() {
  static unsigned char *bufferin;
  FILE *fdin;
  FILE *fdout;
  char linein[1024];
  char lineout[1024];
  char filein[] = "converted_dump.asm";
  char fileout[] = "gcc_dump.asm";
  static unsigned int filelenin;
  if ((fdin = fopen(filein, "rb")) == 0) {
    printf("Can't open file: converted_dump.asm\n");
    return 1;
  }
  fseek(fdin, 0, SEEK_END);
  filelenin = ftell(fdin);
  fseek(fdin, 0L, SEEK_SET);
  bufferin = malloc(sizeof(char) * filelenin);
  if (bufferin == 0) {
    printf("Couldn't allocate enought memory to load file: dump.asm\n");
    return 1;
  }
  if ((fread(bufferin, 1, filelenin, fdin)) != filelenin) {
    printf("Failure by reading file: dump.asm\n");
    return 1;
  }
  fclose(fdin);
  fdout = fopen(fileout, "w");
  static unsigned char *posin;
  static unsigned char *endinoff;
  endinoff = filelenin + bufferin;
  posin = bufferin;
  int i;
  while (posin <= endinoff) {
    for (i = 0; *posin && posin <= endinoff; posin++, i++) {
      if (*posin != 0x0A && *posin != 0x0D) {
        linein[i] = *posin;
      } else {
        break;
      }
    }
    linein[i] = 0;
    if (!*linein)
      sprintf(lineout, "\n");
    else
      sprintf(lineout, "\"%s\\n\"\n", linein);
    fwrite(lineout, strlen(lineout), 1, fdout);
    while (*posin && *posin != 0x0a && posin <= endinoff) {
      posin++;
    }
    if (*posin == 0x0A)
      posin++;
    if (!*posin)
      break;
  }
  printf("Done\n");
  fclose(fdout);
  free(bufferin);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x870,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xe37(%rip),%rax
mov    %rax,-0x840(%rbp)
mov    0xe31(%rip),%rax
mov    %rax,-0x838(%rbp)
mov    0xe2b(%rip),%ax
mov    %ax,-0x830(%rbp)
mov    0xe20(%rip),%al
mov    %al,-0x82e(%rbp)
mov    0xe14(%rip),%rax
mov    %rax,-0x84d(%rbp)
mov    0xe0f(%rip),%eax
mov    %eax,-0x845(%rbp)
mov    0xe07(%rip),%al
mov    %al,-0x841(%rbp)
lea    -0x840(%rbp),%rdi
lea    0xdf4(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1257 <main+0xa7>
lea    0xddd(%rip),%rdi
call   1070 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    158c <main+0x3dc>
mov    -0x10(%rbp),%rdi
mov    0x2d86(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   10a0 <fseek@plt>
mov    -0x10(%rbp),%rdi
call   1080 <ftell@plt>
mov    %eax,0x2e0c(%rip)
mov    -0x10(%rbp),%rdi
mov    0x2d51(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   10a0 <fseek@plt>
mov    0x2df0(%rip),%eax
shl    $0x0,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,0x2dd6(%rip)
cmpq   $0x0,0x2dce(%rip)
jne    12d0 <main+0x120>
lea    0xd89(%rip),%rdi
call   1070 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    158c <main+0x3dc>
mov    0x2da9(%rip),%rdi
mov    0x2dab(%rip),%edx
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
call   1040 <fread@plt>
cmp    0x2d97(%rip),%eax
je     130f <main+0x15f>
lea    0xd83(%rip),%rdi
call   1070 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    158c <main+0x3dc>
mov    -0x10(%rbp),%rdi
call   1050 <fclose@plt>
lea    -0x84d(%rbp),%rdi
lea    0xd7e(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    0x2d53(%rip),%ecx
mov    0x2d44(%rip),%rax
mov    %ecx,%ecx
add    %rcx,%rax
mov    %rax,0x2d58(%rip)
mov    0x2d31(%rip),%rax
mov    %rax,0x2d42(%rip)
mov    0x2d3b(%rip),%rax
cmp    0x2d3c(%rip),%rax
ja     1564 <main+0x3b4>
movl   $0x0,-0x854(%rbp)
mov    0x2d1d(%rip),%rax
movzbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x855(%rbp)
je     13a6 <main+0x1f6>
mov    0x2d02(%rip),%rax
cmp    0x2d03(%rip),%rax
setbe  %al
mov    %al,-0x855(%rbp)
mov    -0x855(%rbp),%al
test   $0x1,%al
jne    13b9 <main+0x209>
jmp    142b <main+0x27b>
mov    0x2cd8(%rip),%rax
movzbl (%rax),%eax
cmp    $0xa,%eax
je     13fb <main+0x24b>
mov    0x2cc5(%rip),%rax
movzbl (%rax),%eax
cmp    $0xd,%eax
je     13fb <main+0x24b>
mov    0x2cb2(%rip),%rax
mov    (%rax),%cl
movslq -0x854(%rbp),%rax
mov    %cl,-0x420(%rbp,%rax,1)
jmp    1400 <main+0x250>
jmp    142b <main+0x27b>
jmp    1405 <main+0x255>
mov    0x2c8c(%rip),%rax
add    $0x1,%rax
mov    %rax,0x2c81(%rip)
mov    -0x854(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x854(%rbp)
jmp    1374 <main+0x1c4>
movslq -0x854(%rbp),%rax
movb   $0x0,-0x420(%rbp,%rax,1)
cmpb   $0x0,-0x420(%rbp)
jne    1461 <main+0x2b1>
lea    -0x820(%rbp),%rdi
lea    0xc57(%rip),%rsi
mov    $0x0,%al
call   10c0 <sprintf@plt>
jmp    147d <main+0x2cd>
lea    -0x820(%rbp),%rdi
lea    -0x420(%rbp),%rdx
lea    0xc30(%rip),%rsi
mov    $0x0,%al
call   10c0 <sprintf@plt>
lea    -0x820(%rbp),%rax
mov    %rax,-0x860(%rbp)
lea    -0x820(%rbp),%rdi
call   1060 <strlen@plt>
mov    -0x860(%rbp),%rdi
mov    %eax,%esi
mov    -0x18(%rbp),%rcx
mov    $0x1,%edx
call   10d0 <fwrite@plt>
mov    0x2be3(%rip),%rax
movzbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x861(%rbp)
je     14fb <main+0x34b>
mov    0x2bc8(%rip),%rax
movzbl (%rax),%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x861(%rbp)
je     14fb <main+0x34b>
mov    0x2bad(%rip),%rax
cmp    0x2bae(%rip),%rax
setbe  %al
mov    %al,-0x861(%rbp)
mov    -0x861(%rbp),%al
test   $0x1,%al
jne    150e <main+0x35e>
jmp    1525 <main+0x375>
mov    0x2b83(%rip),%rax
add    $0x1,%rax
mov    %rax,0x2b78(%rip)
jmp    14ae <main+0x2fe>
mov    0x2b6c(%rip),%rax
movzbl (%rax),%eax
cmp    $0xa,%eax
jne    154a <main+0x39a>
mov    0x2b59(%rip),%rax
add    $0x1,%rax
mov    %rax,0x2b4e(%rip)
mov    0x2b47(%rip),%rax
cmpb   $0x0,(%rax)
jne    155f <main+0x3af>
jmp    1564 <main+0x3b4>
jmp    1356 <main+0x1a6>
lea    0xb43(%rip),%rdi
call   1070 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
mov    0x2b00(%rip),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x870,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x830,%rsp
movaps 0xe3a(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0x6d7361,0x1f(%rsp)
movabs $0x6d73612e706d75,%rax
mov    %rax,0x5(%rsp)
movabs $0x706d75645f636367,%rax
75 6d 70
mov    %rax,(%rsp)
lea    0xe29(%rip),%rsi
lea    0x10(%rsp),%rdi
call   10b0 <fopen@plt>
test   %rax,%rax
je     1405 <main+0x255>
mov    %rax,%rbx
mov    0x2dd4(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   10a0 <fseek@plt>
mov    %rbx,%rdi
call   1080 <ftell@plt>
mov    %eax,0x2e5a(%rip)
mov    0x2da3(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   10a0 <fseek@plt>
mov    0x2e40(%rip),%r14d
mov    %r14d,%edi
call   1090 <malloc@plt>
mov    %rax,0x2e29(%rip)
test   %rax,%rax
je     140e <main+0x25e>
mov    $0x1,%ebp
mov    %rax,%rdi
mov    $0x1,%esi
mov    %r14d,%edx
mov    %rbx,%rcx
call   1050 <fread@plt>
cmp    0x2e0a(%rip),%eax
jne    1421 <main+0x271>
mov    %rbx,%rdi
call   1060 <fclose@plt>
lea    0xd90(%rip),%rsi
mov    %rsp,%rdi
call   10b0 <fopen@plt>
mov    %rax,%rbp
mov    0x2de4(%rip),%edi
mov    0x2dd5(%rip),%rcx
add    %rcx,%rdi
mov    %rdi,0x2deb(%rip)
mov    %rcx,0x2ddc(%rip)
lea    0x430(%rsp),%r14
lea    0xd5a(%rip),%r15
lea    0x30(%rsp),%r12
cmp    %rdi,%rcx
ja     13e1 <main+0x231>
mov    (%rcx),%bl
test   %bl,%bl
je     1330 <main+0x180>
add    $0x1,%rcx
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nop
cmp    $0xa,%bl
je     1332 <main+0x182>
cmp    $0xd,%bl
je     1332 <main+0x182>
mov    %bl,0x30(%rsp,%rdx,1)
lea    (%rcx,%rdx,1),%rsi
mov    %rsi,0x2d8f(%rip)
movzbl (%rcx,%rdx,1),%ebx
add    $0x1,%rdx
test   %bl,%bl
sete   %r8b
cmp    %rdi,%rsi
seta   %al
or     %r8b,%al
je     12f0 <main+0x140>
jmp    1332 <main+0x182>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %edx,%edx
mov    %edx,%eax
movb   $0x0,0x30(%rsp,%rax,1)
cmpb   $0x0,0x30(%rsp)
je     1360 <main+0x1b0>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   10c0 <sprintf@plt>
jmp    136a <main+0x1ba>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movw   $0xa,0x430(%rsp)
mov    %r14,%rdi
call   1070 <strlen@plt>
mov    %r14,%rdi
mov    %eax,%esi
mov    $0x1,%edx
mov    %rbp,%rcx
call   10d0 <fwrite@plt>
mov    0x2d0d(%rip),%rcx
mov    0x2d0e(%rip),%rdi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%rcx
movzbl -0x1(%rcx),%edx
test   %dl,%dl
je     13e1 <main+0x231>
cmp    $0xa,%dl
je     13c3 <main+0x213>
lea    -0x1(%rcx),%rsi
cmp    %rdi,%rsi
ja     13d6 <main+0x226>
mov    %rcx,0x2cd7(%rip)
jmp    13a0 <main+0x1f0>
mov    %rcx,0x2cce(%rip)
mov    (%rcx),%dl
test   %dl,%dl
jne    12d0 <main+0x120>
jmp    13e1 <main+0x231>
mov    %rsi,%rcx
test   %dl,%dl
jne    12d0 <main+0x120>
lea    0xc45(%rip),%rdi
call   1040 <puts@plt>
mov    %rbp,%rdi
call   1060 <fclose@plt>
mov    0x2c84(%rip),%rdi
call   1030 <free@plt>
xor    %ebp,%ebp
jmp    142d <main+0x27d>
lea    0xc80(%rip),%rdi
jmp    1415 <main+0x265>
lea    0xc3f(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%ebp
jmp    142d <main+0x27d>
lea    0xc0a(%rip),%rdi
call   1040 <puts@plt>
mov    %ebp,%eax
add    $0x830,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@main.bufferin = internal global i8* null
@__const.main.filein = [19 x i8] c"converted_dump.asm\00"
@__const.main.fileout = [13 x i8] c"gcc_dump.asm\00"
@main.filelenin = internal global i32 0
@.str = [3 x i8] c"rb\00"
@.str.1 = [37 x i8] c"Can't open file: converted_dump.asm\0A\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.2 = [57 x i8] c"Couldn't allocate enought memory to load file: dump.asm\0A\00"
@.str.3 = [35 x i8] c"Failure by reading file: dump.asm\0A\00"
@.str.4 = [2 x i8] c"w\00"
@main.posin = internal global i8* null
@main.endinoff = internal global i8* null
@.str.5 = [2 x i8] c"\0A\00"
@.str.6 = [8 x i8] c"\22%s\\n\22\0A\00"
@.str.7 = [6 x i8] c"Done\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca [1024 x i8]
%5 = alloca [1024 x i8]
%6 = alloca [19 x i8]
%7 = alloca [13 x i8]
%8 = alloca i32
store i32 0, i32* %1
%9 = bitcast [19 x i8]* %6 to i8*
%10 = bitcast [13 x i8]* %7 to i8*
%11 = getelementptr inbounds [19 x i8], [19 x i8]* %6, i64 0, i64 0
%12 = call i32* @fopen(i8* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %12, i32** %2
%13 = icmp eq i32* %12, null
br i1 %13, label %14, label %16
14: ; preds = %0
%15 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %1
br label %151
16: ; preds = %0
%17 = load i32*, i32** %2
%18 = load i32, i32* @SEEK_END
%19 = call i32 @fseek(i32* %17, i64 0, i32 %18)
%20 = load i32*, i32** %2
%21 = call i32 @ftell(i32* %20)
store i32 %21, i32* @main.filelenin
%22 = load i32*, i32** %2
%23 = load i32, i32* @SEEK_SET
%24 = call i32 @fseek(i32* %22, i64 0, i32 %23)
%25 = load i32, i32* @main.filelenin
%26 = zext i32 %25 to i64
%27 = mul i64 1, %26
%28 = trunc i64 %27 to i32
%29 = call i8* @malloc(i32 %28)
store i8* %29, i8** @main.bufferin
%30 = load i8*, i8** @main.bufferin
%31 = icmp eq i8* %30, null
br i1 %31, label %32, label %34
32: ; preds = %16
%33 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %1
br label %151
34: ; preds = %16
%35 = load i8*, i8** @main.bufferin
%36 = load i32, i32* @main.filelenin
%37 = load i32*, i32** %2
%38 = call i32 @fread(i8* %35, i32 1, i32 %36, i32* %37)
%39 = load i32, i32* @main.filelenin
%40 = icmp ne i32 %38, %39
br i1 %40, label %41, label %43
41: ; preds = %34
%42 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %1
br label %151
43: ; preds = %34
%44 = load i32*, i32** %2
%45 = call i32 @fclose(i32* %44)
%46 = getelementptr inbounds [13 x i8], [13 x i8]* %7, i64 0, i64 0
%47 = call i32* @fopen(i8* %46, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32* %47, i32** %3
%48 = load i32, i32* @main.filelenin
%49 = load i8*, i8** @main.bufferin
%50 = zext i32 %48 to i64
%51 = getelementptr inbounds i8, i8* %49, i64 %50
store i8* %51, i8** @main.endinoff
%52 = load i8*, i8** @main.bufferin
store i8* %52, i8** @main.posin
br label %53
53: ; preds = %144, %43
%54 = load i8*, i8** @main.posin
%55 = load i8*, i8** @main.endinoff
%56 = icmp ule i8* %54, %55
br i1 %56, label %57, label %145
57: ; preds = %53
store i32 0, i32* %8
br label %58
58: ; preds = %87, %57
%59 = load i8*, i8** @main.posin
%60 = load i8, i8* %59
%61 = zext i8 %60 to i32
%62 = icmp ne i32 %61, 0
br i1 %62, label %63, label %67
63: ; preds = %58
%64 = load i8*, i8** @main.posin
%65 = load i8*, i8** @main.endinoff
%66 = icmp ule i8* %64, %65
br label %67
67: ; preds = %63, %58
%68 = phi i1 [ false, %58 ], [ %66, %63 ]
br i1 %68, label %69, label %92
69: ; preds = %67
%70 = load i8*, i8** @main.posin
%71 = load i8, i8* %70
%72 = zext i8 %71 to i32
%73 = icmp ne i32 %72, 10
br i1 %73, label %74, label %85
74: ; preds = %69
%75 = load i8*, i8** @main.posin
%76 = load i8, i8* %75
%77 = zext i8 %76 to i32
%78 = icmp ne i32 %77, 13
br i1 %78, label %79, label %85
79: ; preds = %74
%80 = load i8*, i8** @main.posin
%81 = load i8, i8* %80
%82 = load i32, i32* %8
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 %83
store i8 %81, i8* %84
br label %86
85: ; preds = %74, %69
br label %92
86: ; preds = %79
br label %87
87: ; preds = %86
%88 = load i8*, i8** @main.posin
%89 = getelementptr inbounds i8, i8* %88, i32 1
store i8* %89, i8** @main.posin
%90 = load i32, i32* %8
%91 = add nsw i32 %90, 1
store i32 %91, i32* %8
br label %58
92: ; preds = %85, %67
%93 = load i32, i32* %8
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 %94
store i8 0, i8* %95
%96 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%97 = load i8, i8* %96
%98 = icmp ne i8 %97, 0
br i1 %98, label %102, label %99
99: ; preds = %92
%100 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%101 = call i32 (i8*, i8*, ...) @sprintf(i8* %100, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %106
102: ; preds = %92
%103 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%104 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%105 = call i32 (i8*, i8*, ...) @sprintf(i8* %103, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i8* %104)
br label %106
106: ; preds = %102, %99
%107 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%108 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%109 = call i32 @strlen(i8* %108)
%110 = load i32*, i32** %3
%111 = call i32 @fwrite(i8* %107, i32 %109, i32 1, i32* %110)
br label %112
112: ; preds = %128, %106
%113 = load i8*, i8** @main.posin
%114 = load i8, i8* %113
%115 = zext i8 %114 to i32
%116 = icmp ne i32 %115, 0
br i1 %116, label %117, label %126
117: ; preds = %112
%118 = load i8*, i8** @main.posin
%119 = load i8, i8* %118
%120 = zext i8 %119 to i32
%121 = icmp ne i32 %120, 10
br i1 %121, label %122, label %126
122: ; preds = %117
%123 = load i8*, i8** @main.posin
%124 = load i8*, i8** @main.endinoff
%125 = icmp ule i8* %123, %124
br label %126
126: ; preds = %122, %117, %112
%127 = phi i1 [ false, %117 ], [ false, %112 ], [ %125, %122 ]
br i1 %127, label %128, label %131
128: ; preds = %126
%129 = load i8*, i8** @main.posin
%130 = getelementptr inbounds i8, i8* %129, i32 1
store i8* %130, i8** @main.posin
br label %112
131: ; preds = %126
%132 = load i8*, i8** @main.posin
%133 = load i8, i8* %132
%134 = zext i8 %133 to i32
%135 = icmp eq i32 %134, 10
br i1 %135, label %136, label %139
136: ; preds = %131
%137 = load i8*, i8** @main.posin
%138 = getelementptr inbounds i8, i8* %137, i32 1
store i8* %138, i8** @main.posin
br label %139
139: ; preds = %136, %131
%140 = load i8*, i8** @main.posin
%141 = load i8, i8* %140
%142 = icmp ne i8 %141, 0
br i1 %142, label %144, label %143
143: ; preds = %139
br label %145
144: ; preds = %139
br label %53
145: ; preds = %143, %53
%146 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%147 = load i32*, i32** %3
%148 = call i32 @fclose(i32* %147)
%149 = load i8*, i8** @main.bufferin
%150 = call i32 @free(i8* %149)
store i32 0, i32* %1
br label %151
151: ; preds = %145, %41, %32, %14
%152 = load i32, i32* %1
ret i32 %152
}

LLVM IR (-O2):
@main.bufferin = internal unnamed_addr global i8* null
@__const.main.filein = [19 x i8] c"converted_dump.asm\00"
@__const.main.fileout = [13 x i8] c"gcc_dump.asm\00"
@main.filelenin = internal unnamed_addr global i32 0
@.str = [3 x i8] c"rb\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.4 = [2 x i8] c"w\00"
@main.posin = internal unnamed_addr global i8* null
@main.endinoff = internal unnamed_addr global i8* null
@.str.6 = [8 x i8] c"\22%s\\n\22\0A\00"
@str = [5 x i8] c"Done\00"
@str.8 = [34 x i8] c"Failure by reading file: dump.asm\00"
@str.9 = [56 x i8] c"Couldn't allocate enought memory to load file: dump.asm\00"
@str.10 = [36 x i8] c"Can't open file: converted_dump.asm\00"
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = alloca [1024 x i8]
%3 = alloca [19 x i8]
%4 = alloca [13 x i8]
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [19 x i8], [19 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [13 x i8], [13 x i8]* %4, i64 0, i64 0
%9 = call i32* @fopen(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %13
11: ; preds = %0
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.10, i64 0, i64 0))
br label %96
13: ; preds = %0
%14 = load i32, i32* @SEEK_END
%15 = tail call i32 @fseek(i32* %9, i64 0, i32 %14)
%16 = tail call i32 @ftell(i32* %9)
store i32 %16, i32* @main.filelenin
%17 = load i32, i32* @SEEK_SET
%18 = tail call i32 @fseek(i32* %9, i64 0, i32 %17)
%19 = load i32, i32* @main.filelenin
%20 = tail call i8* @malloc(i32 %19)
store i8* %20, i8** @main.bufferin
%21 = icmp eq i8* %20, null
br i1 %21, label %22, label %24
22: ; preds = %13
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.9, i64 0, i64 0))
br label %96
24: ; preds = %13
%25 = tail call i32 @fread(i8* %20, i32 1, i32 %19, i32* %9)
%26 = load i32, i32* @main.filelenin
%27 = icmp eq i32 %25, %26
br i1 %27, label %30, label %28
28: ; preds = %24
%29 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.8, i64 0, i64 0))
br label %96
30: ; preds = %24
%31 = tail call i32 @fclose(i32* %9)
%32 = call i32* @fopen(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%33 = load i32, i32* @main.filelenin
%34 = load i8*, i8** @main.bufferin
%35 = zext i32 %33 to i64
%36 = getelementptr inbounds i8, i8* %34, i64 %35
store i8* %36, i8** @main.endinoff
store i8* %34, i8** @main.posin
%37 = bitcast [1024 x i8]* %2 to i16*
br label %38
38: ; preds = %87, %30
%39 = phi i8* [ %76, %87 ], [ %36, %30 ]
%40 = phi i8* [ %89, %87 ], [ %34, %30 ]
%41 = icmp ugt i8* %40, %39
br i1 %41, label %91, label %42
42: ; preds = %38
%43 = load i8, i8* %40
%44 = freeze i8 %43
%45 = icmp eq i8 %44, 0
br i1 %45, label %63, label %46
46: ; preds = %42, %51
%47 = phi i64 [ %54, %51 ], [ 0, %42 ]
%48 = phi i8 [ %56, %51 ], [ %44, %42 ]
%49 = phi i32 [ %55, %51 ], [ 0, %42 ]
%50 = phi i8* [ %53, %51 ], [ %40, %42 ]
switch i8 %48, label %51 [
i8 13, label %61
i8 10, label %61
]
51: ; preds = %46
%52 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 %47
store i8 %48, i8* %52
%53 = getelementptr inbounds i8, i8* %50, i64 1
store i8* %53, i8** @main.posin
%54 = add nuw i64 %47, 1
%55 = add nuw nsw i32 %49, 1
%56 = load i8, i8* %53
%57 = icmp eq i8 %56, 0
%58 = icmp ugt i8* %53, %39
%59 = select i1 %57, i1 true, i1 %58
%60 = freeze i1 %59
br i1 %60, label %63, label %46
61: ; preds = %46, %46
%62 = trunc i64 %47 to i32
br label %63
63: ; preds = %51, %61, %42
%64 = phi i32 [ 0, %42 ], [ %62, %61 ], [ %55, %51 ]
%65 = zext i32 %64 to i64
%66 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 %65
store i8 0, i8* %66
%67 = load i8, i8* %5
%68 = icmp eq i8 %67, 0
br i1 %68, label %69, label %70
69: ; preds = %63
store i16 10, i16* %37
br label %72
70: ; preds = %63
%71 = call i32 (i8*, i8*, ...) @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i8* %5)
br label %72
72: ; preds = %70, %69
%73 = call i32 @strlen(i8* %6)
%74 = call i32 @fwrite(i8* %6, i32 %73, i32 1, i32* %32)
%75 = load i8*, i8** @main.posin
%76 = load i8*, i8** @main.endinoff
br label %77
77: ; preds = %82, %72
%78 = phi i8* [ %83, %82 ], [ %75, %72 ]
%79 = load i8, i8* %78
switch i8 %79, label %80 [
i8 10, label %84
i8 0, label %91
]
80: ; preds = %77
%81 = icmp ugt i8* %78, %76
br i1 %81, label %87, label %82
82: ; preds = %80
%83 = getelementptr inbounds i8, i8* %78, i64 1
store i8* %83, i8** @main.posin
br label %77
84: ; preds = %77
%85 = getelementptr inbounds i8, i8* %78, i64 1
store i8* %85, i8** @main.posin
%86 = load i8, i8* %85
br label %87
87: ; preds = %80, %84
%88 = phi i8 [ %86, %84 ], [ %79, %80 ]
%89 = phi i8* [ %85, %84 ], [ %78, %80 ]
%90 = icmp eq i8 %88, 0
br i1 %90, label %91, label %38
91: ; preds = %87, %38, %77
%92 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%93 = call i32 @fclose(i32* %32)
%94 = load i8*, i8** @main.bufferin
%95 = call i32 @free(i8* %94)
br label %96
96: ; preds = %91, %28, %22, %11
%97 = phi i32 [ 1, %11 ], [ 1, %22 ], [ 1, %28 ], [ 0, %91 ]
ret i32 %97
}