#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 */
char EOF;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int);
char getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ putc(char, int /*<<< orphan*/ *);
void importFile(char arquivo[]) {
  FILE *original, *reg, *regOffset;
  int i, tamHeader, offset, tamReg;
  char carac, string[256];
  original = fopen(arquivo, "r");
  reg = fopen("reg.txt", "w");
  regOffset = fopen("regOffset.txt", "w");
  tamHeader = 32 + 1;
  carac = getc(original);
  fseek(reg, tamHeader, 0);
  putc('#', reg);
  offset = tamHeader + 1;
  fprintf(regOffset, "%d", offset);
  fputs("|", regOffset);
  do {
    i = 0;
    fseek(reg, 2, 1);
    tamReg = 0;
    do {
      string[i] = carac;
      i++;
      carac = getc(original);
    } while (carac != '\t');
    string[i++] = '|';
    string[i++] = '\0';
    tamReg = tamReg + i - 1;
    fputs(string, reg);
    i = 0;
    carac = getc(original);
    do {
      string[i] = carac;
      i++;
      carac = getc(original);
    } while (carac != '\t');
    string[i++] = '|';
    string[i++] = '\0';
    tamReg = tamReg + i - 1;
    fputs(string, reg);
    i = 0;
    carac = getc(original);
    do {
      string[i] = carac;
      i++;
      carac = getc(original);
    } while (carac != '\t');
    string[i++] = '|';
    string[i++] = '\0';
    tamReg = tamReg + i - 1;
    fputs(string, reg);
    i = 0;
    carac = getc(original);
    do {
      string[i] = carac;
      i++;
      carac = getc(original);
    } while (carac != '\n');
    string[i - 1] = '|';
    string[i++] = '\0';
    tamReg = tamReg + i - 1;
    fputs(string, reg);
    fseek(reg, -(tamReg + 2), 1);
    fprintf(reg, "%d", tamReg);
    fseek(reg, tamReg, 1);
    tamReg = tamReg + 2;
    offset = offset + tamReg;
    fprintf(regOffset, "%d", offset);
    fputs("|", regOffset);
    carac = getc(original);
  } while (carac != EOF);
  fclose(original);
  fclose(reg);
  fclose(regOffset);
}


x86 assembly (clang, -O0):
<importFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x140,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe76(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x10(%rbp)
lea    0xe68(%rip),%rdi
lea    0xe69(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x18(%rbp)
lea    0xe5b(%rip),%rdi
lea    0xe52(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x20(%rbp)
movl   $0x21,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1090 <getc@plt>
mov    %al,-0x31(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%esi
xor    %edx,%edx
call   1070 <fseek@plt>
mov    -0x18(%rbp),%rsi
mov    $0x23,%edi
call   1050 <putc@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x2c(%rbp),%edx
lea    0xe13(%rip),%rsi
call   1060 <fprintf@plt>
mov    -0x20(%rbp),%rsi
lea    0xe06(%rip),%rdi
call   1040 <fputs@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1070 <fseek@plt>
movl   $0x0,-0x30(%rbp)
mov    -0x31(%rbp),%cl
movslq -0x24(%rbp),%rax
mov    %cl,-0x140(%rbp,%rax,1)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
call   1090 <getc@plt>
mov    %al,-0x31(%rbp)
movsbl -0x31(%rbp),%eax
cmp    $0x9,%eax
jne    123d <importFile+0xcd>
mov    -0x24(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x24(%rbp)
cltq
movb   $0x7c,-0x140(%rbp,%rax,1)
7c
mov    -0x24(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x24(%rbp)
cltq
movb   $0x0,-0x140(%rbp,%rax,1)
mov    -0x30(%rbp),%eax
add    -0x24(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x30(%rbp)
lea    -0x140(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <fputs@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
call   1090 <getc@plt>
mov    %al,-0x31(%rbp)
mov    -0x31(%rbp),%cl
movslq -0x24(%rbp),%rax
mov    %cl,-0x140(%rbp,%rax,1)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
call   1090 <getc@plt>
mov    %al,-0x31(%rbp)
movsbl -0x31(%rbp),%eax
cmp    $0x9,%eax
jne    12c6 <importFile+0x156>
mov    -0x24(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x24(%rbp)
cltq
movb   $0x7c,-0x140(%rbp,%rax,1)
7c
mov    -0x24(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x24(%rbp)
cltq
movb   $0x0,-0x140(%rbp,%rax,1)
mov    -0x30(%rbp),%eax
add    -0x24(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x30(%rbp)
lea    -0x140(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <fputs@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
call   1090 <getc@plt>
mov    %al,-0x31(%rbp)
mov    -0x31(%rbp),%cl
movslq -0x24(%rbp),%rax
mov    %cl,-0x140(%rbp,%rax,1)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
call   1090 <getc@plt>
mov    %al,-0x31(%rbp)
movsbl -0x31(%rbp),%eax
cmp    $0x9,%eax
jne    134f <importFile+0x1df>
mov    -0x24(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x24(%rbp)
cltq
movb   $0x7c,-0x140(%rbp,%rax,1)
7c
mov    -0x24(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x24(%rbp)
cltq
movb   $0x0,-0x140(%rbp,%rax,1)
mov    -0x30(%rbp),%eax
add    -0x24(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x30(%rbp)
lea    -0x140(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <fputs@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
call   1090 <getc@plt>
mov    %al,-0x31(%rbp)
mov    -0x31(%rbp),%cl
movslq -0x24(%rbp),%rax
mov    %cl,-0x140(%rbp,%rax,1)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
call   1090 <getc@plt>
mov    %al,-0x31(%rbp)
movsbl -0x31(%rbp),%eax
cmp    $0xa,%eax
jne    13d8 <importFile+0x268>
mov    -0x24(%rbp),%eax
sub    $0x1,%eax
cltq
movb   $0x7c,-0x140(%rbp,%rax,1)
7c
mov    -0x24(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x24(%rbp)
cltq
movb   $0x0,-0x140(%rbp,%rax,1)
mov    -0x30(%rbp),%eax
add    -0x24(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x30(%rbp)
lea    -0x140(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <fputs@plt>
mov    -0x18(%rbp),%rdi
mov    -0x30(%rbp),%eax
add    $0x2,%eax
xor    %esi,%esi
sub    %eax,%esi
mov    $0x1,%edx
call   1070 <fseek@plt>
mov    -0x18(%rbp),%rdi
mov    -0x30(%rbp),%edx
lea    0xbab(%rip),%rsi
call   1060 <fprintf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x30(%rbp),%esi
mov    $0x1,%edx
call   1070 <fseek@plt>
mov    -0x30(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x30(%rbp)
mov    -0x2c(%rbp),%eax
add    -0x30(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x2c(%rbp),%edx
lea    0xb75(%rip),%rsi
call   1060 <fprintf@plt>
mov    -0x20(%rbp),%rsi
lea    0xb68(%rip),%rdi
call   1040 <fputs@plt>
mov    -0x10(%rbp),%rdi
call   1090 <getc@plt>
mov    %al,-0x31(%rbp)
movsbl -0x31(%rbp),%eax
mov    0x2b17(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    121c <importFile+0xac>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x140,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<importFile>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x128,%rsp
lea    0xe68(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,%r15
lea    0xe5b(%rip),%rdi
lea    0xe5c(%rip),%rbx
mov    %rbx,%rsi
call   1090 <fopen@plt>
mov    %rax,%rbp
lea    0xe4c(%rip),%rdi
mov    %rbx,%rsi
call   1090 <fopen@plt>
mov    %rax,%rbx
mov    %r15,%rdi
call   10a0 <getc@plt>
mov    %eax,%r12d
mov    %rbp,%rdi
mov    $0x21,%esi
xor    %edx,%edx
call   1080 <fseek@plt>
mov    $0x23,%edi
mov    %rbp,%rsi
call   1060 <putc@plt>
lea    0xe21(%rip),%rsi
mov    $0x22,%r14d
mov    %rbx,%rdi
mov    $0x22,%edx
call   1070 <fprintf@plt>
mov    $0x7c,%edi
mov    %rbx,0x18(%rsp)
mov    %rbx,%rsi
call   1050 <fputc@plt>
mov    %rbp,0x8(%rsp)
mov    %r15,0x10(%rsp)
nopl   0x0(%rax,%rax,1)
mov    %rbp,%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1080 <fseek@plt>
add    $0x8,%r14d
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%r13
mov    %r14d,%ebp
mov    %r12b,0x20(%rsp,%rbx,1)
add    $0x1,%rbx
mov    %r15,%rdi
call   10a0 <getc@plt>
mov    %eax,%r12d
lea    0x1(%rbp),%r14d
cmp    $0x9,%al
jne    1250 <importFile+0xd0>
lea    0x2(%r13),%eax
mov    %ebx,%ecx
movb   $0x7c,0x20(%rsp,%rcx,1)
movb   $0x0,0x20(%rsp,%rax,1)
lea    0x20(%rsp),%rdi
mov    0x8(%rsp),%rsi
call   1040 <fputs@plt>
mov    %r15,%rdi
call   10a0 <getc@plt>
xor    %r14d,%r14d
nopl   0x0(%rax)
mov    %r14,%r12
mov    %ebp,%ebx
mov    %al,0x20(%rsp,%r14,1)
add    $0x1,%r14
mov    %r15,%rdi
call   10a0 <getc@plt>
lea    0x1(%rbx),%ebp
cmp    $0x9,%al
jne    12a0 <importFile+0x120>
lea    0x2(%r12),%eax
mov    %r14d,%ecx
movb   $0x7c,0x20(%rsp,%rcx,1)
movb   $0x0,0x20(%rsp,%rax,1)
lea    0x20(%rsp),%rdi
mov    0x8(%rsp),%rsi
call   1040 <fputs@plt>
mov    %r15,%rdi
call   10a0 <getc@plt>
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    %rbp,%r15
mov    %ebx,%r14d
mov    %al,0x20(%rsp,%rbp,1)
add    $0x1,%rbp
mov    0x10(%rsp),%rdi
call   10a0 <getc@plt>
lea    0x1(%r14),%ebx
cmp    $0x9,%al
jne    12f0 <importFile+0x170>
lea    0x2(%r15),%eax
mov    %ebp,%ecx
movb   $0x7c,0x20(%rsp,%rcx,1)
movb   $0x0,0x20(%rsp,%rax,1)
lea    0x20(%rsp),%rdi
mov    0x8(%rsp),%rsi
call   1040 <fputs@plt>
mov    0x10(%rsp),%rdi
call   10a0 <getc@plt>
add    %r12d,%r13d
add    %r15d,%r13d
mov    $0xfffffffa,%ebx
sub    %r13d,%ebx
xor    %ebp,%ebp
mov    0x10(%rsp),%r15
xchg   %ax,%ax
mov    %al,0x20(%rsp,%rbp,1)
add    $0x1,%rbp
mov    %r15,%rdi
call   10a0 <getc@plt>
add    $0x1,%r14d
add    $0xffffffff,%ebx
cmp    $0xa,%al
jne    1350 <importFile+0x1d0>
lea    -0x1(%rbp),%eax
movb   $0x7c,0x20(%rsp,%rax,1)
mov    %ebp,%eax
movb   $0x0,0x20(%rsp,%rax,1)
mov    %ebx,%r12d
neg    %r12d
lea    0x20(%rsp),%rdi
mov    0x8(%rsp),%rbp
mov    %rbp,%rsi
call   1040 <fputs@plt>
add    $0xfffffffe,%ebx
mov    %rbp,%rdi
mov    %ebx,%esi
mov    $0x1,%edx
call   1080 <fseek@plt>
mov    %rbp,%rdi
lea    0xc6c(%rip),%r13
mov    %r13,%rsi
mov    %r12d,%edx
call   1070 <fprintf@plt>
mov    %rbp,%rdi
mov    %r12d,%esi
mov    $0x1,%edx
call   1080 <fseek@plt>
mov    0x18(%rsp),%rbx
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %r14d,%edx
call   1070 <fprintf@plt>
mov    $0x7c,%edi
mov    %rbx,%rsi
call   1050 <fputc@plt>
mov    %r15,%rdi
call   10a0 <getc@plt>
mov    %eax,%r12d
mov    0x2bed(%rip),%rax
cmp    (%rax),%r12b
jne    1230 <importFile+0xb0>
mov    %r15,%rdi
call   1030 <fclose@plt>
mov    %rbp,%rdi
call   1030 <fclose@plt>
mov    0x18(%rsp),%rdi
add    $0x128,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [8 x i8] c"reg.txt\00"
@.str.2 = [2 x i8] c"w\00"
@.str.3 = [14 x i8] c"regOffset.txt\00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [2 x i8] c"|\00"
@EOF = global i8 0
define void @importFile(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8
%11 = alloca [256 x i8]
store i8* %0, i8** %2
%12 = load i8*, i8** %2
%13 = call i32* @fopen(i8* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %13, i32** %3
%14 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %14, i32** %4
%15 = call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %15, i32** %5
store i32 33, i32* %7
%16 = load i32*, i32** %3
%17 = call signext i8 @getc(i32* %16)
store i8 %17, i8* %10
%18 = load i32*, i32** %4
%19 = load i32, i32* %7
%20 = call i32 @fseek(i32* %18, i32 %19, i32 0)
%21 = load i32*, i32** %4
%22 = call i32 @putc(i8 signext 35, i32* %21)
%23 = load i32, i32* %7
%24 = add nsw i32 %23, 1
store i32 %24, i32* %8
%25 = load i32*, i32** %5
%26 = load i32, i32* %8
%27 = call i32 @fprintf(i32* %25, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %26)
%28 = load i32*, i32** %5
%29 = call i32 @fputs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i32* %28)
br label %30
30: ; preds = %178, %1
store i32 0, i32* %6
%31 = load i32*, i32** %4
%32 = call i32 @fseek(i32* %31, i32 2, i32 1)
store i32 0, i32* %9
br label %33
33: ; preds = %42, %30
%34 = load i8, i8* %10
%35 = load i32, i32* %6
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 %36
store i8 %34, i8* %37
%38 = load i32, i32* %6
%39 = add nsw i32 %38, 1
store i32 %39, i32* %6
%40 = load i32*, i32** %3
%41 = call signext i8 @getc(i32* %40)
store i8 %41, i8* %10
br label %42
42: ; preds = %33
%43 = load i8, i8* %10
%44 = sext i8 %43 to i32
%45 = icmp ne i32 %44, 9
br i1 %45, label %33, label %46
46: ; preds = %42
%47 = load i32, i32* %6
%48 = add nsw i32 %47, 1
store i32 %48, i32* %6
%49 = sext i32 %47 to i64
%50 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 %49
store i8 124, i8* %50
%51 = load i32, i32* %6
%52 = add nsw i32 %51, 1
store i32 %52, i32* %6
%53 = sext i32 %51 to i64
%54 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 %53
store i8 0, i8* %54
%55 = load i32, i32* %9
%56 = load i32, i32* %6
%57 = add nsw i32 %55, %56
%58 = sub nsw i32 %57, 1
store i32 %58, i32* %9
%59 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%60 = load i32*, i32** %4
%61 = call i32 @fputs(i8* %59, i32* %60)
store i32 0, i32* %6
%62 = load i32*, i32** %3
%63 = call signext i8 @getc(i32* %62)
store i8 %63, i8* %10
br label %64
64: ; preds = %73, %46
%65 = load i8, i8* %10
%66 = load i32, i32* %6
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 %67
store i8 %65, i8* %68
%69 = load i32, i32* %6
%70 = add nsw i32 %69, 1
store i32 %70, i32* %6
%71 = load i32*, i32** %3
%72 = call signext i8 @getc(i32* %71)
store i8 %72, i8* %10
br label %73
73: ; preds = %64
%74 = load i8, i8* %10
%75 = sext i8 %74 to i32
%76 = icmp ne i32 %75, 9
br i1 %76, label %64, label %77
77: ; preds = %73
%78 = load i32, i32* %6
%79 = add nsw i32 %78, 1
store i32 %79, i32* %6
%80 = sext i32 %78 to i64
%81 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 %80
store i8 124, i8* %81
%82 = load i32, i32* %6
%83 = add nsw i32 %82, 1
store i32 %83, i32* %6
%84 = sext i32 %82 to i64
%85 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 %84
store i8 0, i8* %85
%86 = load i32, i32* %9
%87 = load i32, i32* %6
%88 = add nsw i32 %86, %87
%89 = sub nsw i32 %88, 1
store i32 %89, i32* %9
%90 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%91 = load i32*, i32** %4
%92 = call i32 @fputs(i8* %90, i32* %91)
store i32 0, i32* %6
%93 = load i32*, i32** %3
%94 = call signext i8 @getc(i32* %93)
store i8 %94, i8* %10
br label %95
95: ; preds = %104, %77
%96 = load i8, i8* %10
%97 = load i32, i32* %6
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 %98
store i8 %96, i8* %99
%100 = load i32, i32* %6
%101 = add nsw i32 %100, 1
store i32 %101, i32* %6
%102 = load i32*, i32** %3
%103 = call signext i8 @getc(i32* %102)
store i8 %103, i8* %10
br label %104
104: ; preds = %95
%105 = load i8, i8* %10
%106 = sext i8 %105 to i32
%107 = icmp ne i32 %106, 9
br i1 %107, label %95, label %108
108: ; preds = %104
%109 = load i32, i32* %6
%110 = add nsw i32 %109, 1
store i32 %110, i32* %6
%111 = sext i32 %109 to i64
%112 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 %111
store i8 124, i8* %112
%113 = load i32, i32* %6
%114 = add nsw i32 %113, 1
store i32 %114, i32* %6
%115 = sext i32 %113 to i64
%116 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 %115
store i8 0, i8* %116
%117 = load i32, i32* %9
%118 = load i32, i32* %6
%119 = add nsw i32 %117, %118
%120 = sub nsw i32 %119, 1
store i32 %120, i32* %9
%121 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%122 = load i32*, i32** %4
%123 = call i32 @fputs(i8* %121, i32* %122)
store i32 0, i32* %6
%124 = load i32*, i32** %3
%125 = call signext i8 @getc(i32* %124)
store i8 %125, i8* %10
br label %126
126: ; preds = %135, %108
%127 = load i8, i8* %10
%128 = load i32, i32* %6
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 %129
store i8 %127, i8* %130
%131 = load i32, i32* %6
%132 = add nsw i32 %131, 1
store i32 %132, i32* %6
%133 = load i32*, i32** %3
%134 = call signext i8 @getc(i32* %133)
store i8 %134, i8* %10
br label %135
135: ; preds = %126
%136 = load i8, i8* %10
%137 = sext i8 %136 to i32
%138 = icmp ne i32 %137, 10
br i1 %138, label %126, label %139
139: ; preds = %135
%140 = load i32, i32* %6
%141 = sub nsw i32 %140, 1
%142 = sext i32 %141 to i64
%143 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 %142
store i8 124, i8* %143
%144 = load i32, i32* %6
%145 = add nsw i32 %144, 1
store i32 %145, i32* %6
%146 = sext i32 %144 to i64
%147 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 %146
store i8 0, i8* %147
%148 = load i32, i32* %9
%149 = load i32, i32* %6
%150 = add nsw i32 %148, %149
%151 = sub nsw i32 %150, 1
store i32 %151, i32* %9
%152 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%153 = load i32*, i32** %4
%154 = call i32 @fputs(i8* %152, i32* %153)
%155 = load i32*, i32** %4
%156 = load i32, i32* %9
%157 = add nsw i32 %156, 2
%158 = sub nsw i32 0, %157
%159 = call i32 @fseek(i32* %155, i32 %158, i32 1)
%160 = load i32*, i32** %4
%161 = load i32, i32* %9
%162 = call i32 @fprintf(i32* %160, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %161)
%163 = load i32*, i32** %4
%164 = load i32, i32* %9
%165 = call i32 @fseek(i32* %163, i32 %164, i32 1)
%166 = load i32, i32* %9
%167 = add nsw i32 %166, 2
store i32 %167, i32* %9
%168 = load i32, i32* %8
%169 = load i32, i32* %9
%170 = add nsw i32 %168, %169
store i32 %170, i32* %8
%171 = load i32*, i32** %5
%172 = load i32, i32* %8
%173 = call i32 @fprintf(i32* %171, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %172)
%174 = load i32*, i32** %5
%175 = call i32 @fputs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i32* %174)
%176 = load i32*, i32** %3
%177 = call signext i8 @getc(i32* %176)
store i8 %177, i8* %10
br label %178
178: ; preds = %139
%179 = load i8, i8* %10
%180 = sext i8 %179 to i32
%181 = load i8, i8* @EOF
%182 = sext i8 %181 to i32
%183 = icmp ne i32 %180, %182
br i1 %183, label %30, label %184
184: ; preds = %178
%185 = load i32*, i32** %3
%186 = call i32 @fclose(i32* %185)
%187 = load i32*, i32** %4
%188 = call i32 @fclose(i32* %187)
%189 = load i32*, i32** %5
%190 = call i32 @fclose(i32* %189)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [8 x i8] c"reg.txt\00"
@.str.2 = [2 x i8] c"w\00"
@.str.3 = [14 x i8] c"regOffset.txt\00"
@.str.4 = [3 x i8] c"%d\00"
@EOF = global i8 0
define void @importFile(i8* nocapture %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%7 = tail call signext i8 @getc(i32* %4)
%8 = tail call i32 @fseek(i32* %5, i32 33, i32 0)
%9 = tail call i32 @putc(i8 signext 35, i32* %5)
%10 = tail call i32 @fprintf(i32* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 34)
%11 = tail call i32 @fputc(i32 124, i32* %6)
br label %12
12: ; preds = %71, %1
%13 = phi i32 [ 34, %1 ], [ %88, %71 ]
%14 = phi i8 [ %7, %1 ], [ %91, %71 ]
%15 = tail call i32 @fseek(i32* %5, i32 2, i32 1)
br label %16
16: ; preds = %16, %12
%17 = phi i64 [ %20, %16 ], [ 0, %12 ]
%18 = phi i8 [ %21, %16 ], [ %14, %12 ]
%19 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 %17
store i8 %18, i8* %19
%20 = add nuw i64 %17, 1
%21 = tail call signext i8 @getc(i32* %4)
%22 = icmp eq i8 %21, 9
br i1 %22, label %23, label %16
23: ; preds = %16
%24 = trunc i64 %17 to i32
%25 = add i64 %17, 2
%26 = and i64 %20, 4294967295
%27 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 %26
store i8 124, i8* %27
%28 = and i64 %25, 4294967295
%29 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 %28
store i8 0, i8* %29
%30 = call i32 @fputs(i8* %3, i32* %5)
%31 = tail call signext i8 @getc(i32* %4)
br label %32
32: ; preds = %32, %23
%33 = phi i64 [ %36, %32 ], [ 0, %23 ]
%34 = phi i8 [ %37, %32 ], [ %31, %23 ]
%35 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 %33
store i8 %34, i8* %35
%36 = add nuw i64 %33, 1
%37 = tail call signext i8 @getc(i32* %4)
%38 = icmp eq i8 %37, 9
br i1 %38, label %39, label %32
39: ; preds = %32
%40 = trunc i64 %33 to i32
%41 = add i64 %33, 2
%42 = and i64 %36, 4294967295
%43 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 %42
store i8 124, i8* %43
%44 = and i64 %41, 4294967295
%45 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 %44
store i8 0, i8* %45
%46 = call i32 @fputs(i8* %3, i32* %5)
%47 = tail call signext i8 @getc(i32* %4)
br label %48
48: ; preds = %48, %39
%49 = phi i64 [ %52, %48 ], [ 0, %39 ]
%50 = phi i8 [ %53, %48 ], [ %47, %39 ]
%51 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 %49
store i8 %50, i8* %51
%52 = add nuw i64 %49, 1
%53 = tail call signext i8 @getc(i32* %4)
%54 = icmp eq i8 %53, 9
br i1 %54, label %55, label %48
55: ; preds = %48
%56 = trunc i64 %49 to i32
%57 = add i64 %49, 2
%58 = and i64 %52, 4294967295
%59 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 %58
store i8 124, i8* %59
%60 = and i64 %57, 4294967295
%61 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 %60
store i8 0, i8* %61
%62 = call i32 @fputs(i8* %3, i32* %5)
%63 = tail call signext i8 @getc(i32* %4)
br label %64
64: ; preds = %64, %55
%65 = phi i64 [ %68, %64 ], [ 0, %55 ]
%66 = phi i8 [ %69, %64 ], [ %63, %55 ]
%67 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 %65
store i8 %66, i8* %67
%68 = add nuw i64 %65, 1
%69 = tail call signext i8 @getc(i32* %4)
%70 = icmp eq i8 %69, 10
br i1 %70, label %71, label %64
71: ; preds = %64
%72 = trunc i64 %65 to i32
%73 = and i64 %65, 4294967295
%74 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 %73
store i8 124, i8* %74
%75 = and i64 %68, 4294967295
%76 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 %75
store i8 0, i8* %76
%77 = add nuw i32 %24, 5
%78 = add i32 %77, %40
%79 = add i32 %78, %56
%80 = add i32 %79, %72
%81 = add i32 %80, 2
%82 = call i32 @fputs(i8* %3, i32* %5)
%83 = sub i32 -4, %80
%84 = tail call i32 @fseek(i32* %5, i32 %83, i32 1)
%85 = tail call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %81)
%86 = tail call i32 @fseek(i32* %5, i32 %81, i32 1)
%87 = add i32 %13, 4
%88 = add i32 %87, %80
%89 = tail call i32 @fprintf(i32* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %88)
%90 = tail call i32 @fputc(i32 124, i32* %6)
%91 = tail call signext i8 @getc(i32* %4)
%92 = load i8, i8* @EOF
%93 = icmp eq i8 %91, %92
br i1 %93, label %94, label %12
94: ; preds = %71
%95 = tail call i32 @fclose(i32* %4)
%96 = tail call i32 @fclose(i32* %5)
%97 = tail call i32 @fclose(i32* %6)
ret void
}