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

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ format_label(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, ...);
scalar_t__ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ ftell(int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ strcasecmp(char *, char *);
char *strtok_r(char *, char *, char **);
void convert(FILE *in, FILE *out, char *line, char *buff) {
  char *tmp;
  char *token;
  char *v1;
  char *v2;
  char *label;
  off_t pos;
  unsigned int xp = 1;
  while (!feof(in)) {
    pos = ftell(in);
    if (fgets(line, 1024, in) != NULL) {
      tmp = line;
      token = strtok_r(tmp, " \t\r\n", &tmp);
      if (token != NULL) {
        if (strcasecmp(token, "XP") == 0) {
          fprintf(out, "XP # %u\n", xp++);
        } else if (strcasecmp(token, "v") == 0) {
          if (xp == 1) {
            fprintf(out, "XP # %u\n", xp++);
          }
          v1 = strtok_r(NULL, " \t\r\n", &tmp);
          label = strtok_r(NULL, "\r\n", &tmp);
          format_label(label, buff);
          fprintf(out, "v %s %s\n", v1, buff);
        } else if (!strcasecmp(token, "e") || !strcasecmp(token, "d") ||
                   !strcasecmp(token, "u")) {
          if (xp == 1) {
            fprintf(out, "XP # %u\n", xp++);
          }
          v1 = strtok_r(NULL, " \t\r\n", &tmp);
          v2 = strtok_r(NULL, " \t\r\n", &tmp);
          label = strtok_r(NULL, "\r\n", &tmp);
          printf("LABEL (%s)\n", label);
          format_label(label, buff);
          printf("BUFF (%s)\n", buff);
          fprintf(out, "%s %s %s %s\n", token, v1, v2, buff);
        } else {
          if (fseek(in, pos, SEEK_SET)) {
            perror("seek");
            break;
          }
          if (fgets(line, 1024, in) == NULL) {
            perror("fgets");
            break;
          }
          fprintf(out, "// %s", line);
        }
      }
    }
  }
}


x86 assembly (clang, -O0):
<convert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movl   $0x1,-0x50(%rbp)
mov    -0x8(%rbp),%rdi
call   1090 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    11dd <convert+0x3d>
jmp    14b2 <convert+0x312>
mov    -0x8(%rbp),%rdi
call   1080 <ftell@plt>
mov    %eax,-0x4c(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x400,%esi
call   1060 <fgets@plt>
cmp    $0x0,%rax
je     14ad <convert+0x30d>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
lea    0xde8(%rip),%rsi
lea    -0x28(%rbp),%rdx
call   1050 <strtok_r@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     14a8 <convert+0x308>
mov    -0x30(%rbp),%rdi
lea    0xdca(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1270 <convert+0xd0>
mov    -0x10(%rbp),%rdi
mov    -0x50(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x50(%rbp)
mov    %eax,%eax
mov    %eax,%edx
lea    0xda4(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
jmp    14a3 <convert+0x303>
mov    -0x30(%rbp),%rdi
lea    0xd96(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1311 <convert+0x171>
cmpl   $0x1,-0x50(%rbp)
jne    12b5 <convert+0x115>
mov    -0x10(%rbp),%rdi
mov    -0x50(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x50(%rbp)
mov    %eax,%eax
mov    %eax,%edx
lea    0xd5a(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
xor    %eax,%eax
mov    %eax,%edi
lea    0xd40(%rip),%rsi
lea    -0x28(%rbp),%rdx
call   1050 <strtok_r@plt>
mov    %rax,-0x38(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xd2a(%rip),%rsi
lea    -0x28(%rbp),%rdx
call   1050 <strtok_r@plt>
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   10c0 <format_label@plt>
mov    -0x10(%rbp),%rdi
mov    -0x38(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    0xd0e(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
jmp    149e <convert+0x2fe>
mov    -0x30(%rbp),%rdi
lea    0xd00(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
je     135f <convert+0x1bf>
mov    -0x30(%rbp),%rdi
lea    0xce8(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
je     135f <convert+0x1bf>
mov    -0x30(%rbp),%rdi
lea    0xcd0(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1426 <convert+0x286>
cmpl   $0x1,-0x50(%rbp)
jne    138a <convert+0x1ea>
mov    -0x10(%rbp),%rdi
mov    -0x50(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x50(%rbp)
mov    %eax,%eax
mov    %eax,%edx
lea    0xc85(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
xor    %eax,%eax
mov    %eax,%edi
lea    0xc6b(%rip),%rsi
lea    -0x28(%rbp),%rdx
call   1050 <strtok_r@plt>
mov    %rax,-0x38(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xc53(%rip),%rsi
lea    -0x28(%rbp),%rdx
call   1050 <strtok_r@plt>
mov    %rax,-0x40(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xc3d(%rip),%rsi
lea    -0x28(%rbp),%rdx
call   1050 <strtok_r@plt>
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rsi
lea    0xc45(%rip),%rdi
call   1040 <printf@plt>
mov    -0x48(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   10c0 <format_label@plt>
mov    -0x20(%rbp),%rsi
lea    0xc34(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x30(%rbp),%rdx
mov    -0x38(%rbp),%rcx
mov    -0x40(%rbp),%r8
mov    -0x20(%rbp),%r9
lea    0xc1f(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
jmp    1499 <convert+0x2f9>
mov    -0x8(%rbp),%rdi
mov    -0x4c(%rbp),%esi
mov    0x2bac(%rip),%rax
mov    (%rax),%edx
call   10a0 <fseek@plt>
cmp    $0x0,%rax
je     1456 <convert+0x2b6>
lea    0xbfa(%rip),%rdi
call   10b0 <perror@plt>
jmp    14b2 <convert+0x312>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x400,%esi
call   1060 <fgets@plt>
cmp    $0x0,%rax
jne    1483 <convert+0x2e3>
lea    0xbd2(%rip),%rdi
call   10b0 <perror@plt>
jmp    14b2 <convert+0x312>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xbbf(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
jmp    149e <convert+0x2fe>
jmp    14a3 <convert+0x303>
jmp    14a8 <convert+0x308>
jmp    14ad <convert+0x30d>
jmp    11bf <convert+0x1f>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rcx,0x20(%rsp)
mov    %rdx,%r12
mov    %rsi,0x10(%rsp)
mov    %rdi,%rbx
call   1090 <feof@plt>
test   %eax,%eax
je     11d6 <convert+0x36>
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
movl   $0x1,0xc(%rsp)
lea    0xe1b(%rip),%r14
lea    0xe19(%rip),%rbp
jmp    12a8 <convert+0x108>
cmpl   $0x1,0xc(%rsp)
je     1447 <convert+0x2a7>
xor    %edi,%edi
mov    %r14,%rsi
lea    0x18(%rsp),%rbp
mov    %rbp,%rdx
call   1050 <strtok_r@plt>
mov    %rax,0x30(%rsp)
xor    %edi,%edi
mov    %r14,%rsi
mov    %rbp,%rdx
call   1050 <strtok_r@plt>
mov    %rax,0x28(%rsp)
xor    %edi,%edi
lea    0xdd4(%rip),%rsi
mov    %rbp,%rdx
call   1050 <strtok_r@plt>
mov    %rax,%r14
lea    0xde2(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %r14,%rdi
mov    0x20(%rsp),%r15
mov    %r15,%rsi
call   10c0 <format_label@plt>
lea    0xdcf(%rip),%rdi
mov    %r15,%rsi
call   1040 <printf@plt>
mov    0x10(%rsp),%rdi
lea    0xdc6(%rip),%rsi
mov    %r13,%rdx
mov    0x30(%rsp),%rcx
mov    0x28(%rsp),%r8
lea    0xd79(%rip),%r14
mov    %r15,%r9
xor    %eax,%eax
call   1070 <fprintf@plt>
lea    0xd6d(%rip),%rbp
mov    %rbx,%rdi
call   1090 <feof@plt>
test   %eax,%eax
jne    11c7 <convert+0x27>
mov    %rbx,%rdi
call   1080 <ftell@plt>
mov    %eax,%r15d
mov    %r12,%rdi
mov    $0x400,%esi
mov    %rbx,%rdx
call   1060 <fgets@plt>
test   %rax,%rax
je     1298 <convert+0xf8>
mov    %r12,0x18(%rsp)
mov    %r12,%rdi
mov    %r14,%rsi
lea    0x18(%rsp),%rdx
call   1050 <strtok_r@plt>
test   %rax,%rax
je     1298 <convert+0xf8>
mov    %rax,%r13
mov    %rax,%rdi
mov    %rbp,%rsi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     13a0 <convert+0x200>
mov    %r13,%rdi
lea    0xd0e(%rip),%rsi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     13c5 <convert+0x225>
mov    %r13,%rdi
lea    0xd01(%rip),%rsi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     11f1 <convert+0x51>
mov    %r13,%rdi
lea    0xceb(%rip),%rsi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     11f1 <convert+0x51>
mov    %r13,%rdi
lea    0xcd5(%rip),%rsi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     11f1 <convert+0x51>
mov    0x2c80(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    %r15d,%esi
call   10a0 <fseek@plt>
test   %rax,%rax
jne    146c <convert+0x2cc>
mov    %r12,%rdi
mov    $0x400,%esi
mov    %rbx,%rdx
call   1060 <fgets@plt>
test   %rax,%rax
je     1475 <convert+0x2d5>
mov    0x10(%rsp),%rdi
lea    0xcb6(%rip),%rsi
mov    %r12,%rdx
jmp    13b9 <convert+0x219>
mov    0xc(%rsp),%eax
mov    %eax,%edx
add    $0x1,%eax
mov    %eax,0xc(%rsp)
mov    0x10(%rsp),%rdi
lea    0xc4f(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
jmp    1298 <convert+0xf8>
cmpl   $0x1,0xc(%rsp)
jne    13ec <convert+0x24c>
mov    $0x1,%edx
mov    0x10(%rsp),%rdi
lea    0xc2b(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
movl   $0x2,0xc(%rsp)
xor    %edi,%edi
mov    %r14,%rsi
lea    0x18(%rsp),%r15
mov    %r15,%rdx
call   1050 <strtok_r@plt>
mov    %rax,%rbp
xor    %edi,%edi
lea    0xbf8(%rip),%rsi
mov    %r15,%rdx
call   1050 <strtok_r@plt>
mov    %rax,%rdi
mov    0x20(%rsp),%r15
mov    %r15,%rsi
call   10c0 <format_label@plt>
mov    0x10(%rsp),%rdi
lea    0xbe5(%rip),%rsi
mov    %rbp,%rdx
lea    0xbc8(%rip),%r14
mov    %r15,%rcx
xor    %eax,%eax
call   1070 <fprintf@plt>
jmp    1291 <convert+0xf1>
mov    $0x1,%edx
mov    0x10(%rsp),%rdi
lea    0xbb0(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
movl   $0x2,0xc(%rsp)
jmp    11fc <convert+0x5c>
lea    0xbd3(%rip),%rdi
jmp    147c <convert+0x2dc>
lea    0xbcf(%rip),%rdi
call   10b0 <perror@plt>
jmp    11c7 <convert+0x27>

LLVM IR (-O0):
@.str = [5 x i8] c" \09\0D\0A\00"
@.str.1 = [3 x i8] c"XP\00"
@.str.2 = [9 x i8] c"XP # %u\0A\00"
@.str.3 = [2 x i8] c"v\00"
@.str.4 = [3 x i8] c"\0D\0A\00"
@.str.5 = [9 x i8] c"v %s %s\0A\00"
@.str.6 = [2 x i8] c"e\00"
@.str.7 = [2 x i8] c"d\00"
@.str.8 = [2 x i8] c"u\00"
@.str.9 = [12 x i8] c"LABEL (%s)\0A\00"
@.str.10 = [11 x i8] c"BUFF (%s)\0A\00"
@.str.11 = [13 x i8] c"%s %s %s %s\0A\00"
@SEEK_SET = global i32 0
@.str.12 = [5 x i8] c"seek\00"
@.str.13 = [6 x i8] c"fgets\00"
@.str.14 = [6 x i8] c"// %s\00"
define void @convert(i32* %0, i32* %1, i8* %2, i8* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i32
%15 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
store i32 1, i32* %15
br label %16
16: ; preds = %131, %4
%17 = load i32*, i32** %5
%18 = call i32 @feof(i32* %17)
%19 = icmp ne i32 %18, 0
%20 = xor i1 %19, true
br i1 %20, label %21, label %132
21: ; preds = %16
%22 = load i32*, i32** %5
%23 = call i32 @ftell(i32* %22)
store i32 %23, i32* %14
%24 = load i8*, i8** %7
%25 = load i32*, i32** %5
%26 = call i32* @fgets(i8* %24, i32 1024, i32* %25)
%27 = icmp ne i32* %26, null
br i1 %27, label %28, label %131
28: ; preds = %21
%29 = load i8*, i8** %7
store i8* %29, i8** %9
%30 = load i8*, i8** %9
%31 = call i8* @strtok_r(i8* %30, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %9)
store i8* %31, i8** %10
%32 = load i8*, i8** %10
%33 = icmp ne i8* %32, null
br i1 %33, label %34, label %130
34: ; preds = %28
%35 = load i8*, i8** %10
%36 = call i64 @strcasecmp(i8* %35, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%37 = icmp eq i64 %36, 0
br i1 %37, label %38, label %45
38: ; preds = %34
%39 = load i32*, i32** %6
%40 = load i32, i32* %15
%41 = add i32 %40, 1
store i32 %41, i32* %15
%42 = zext i32 %40 to i64
%43 = inttoptr i64 %42 to i8*
%44 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %39, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %43)
br label %129
45: ; preds = %34
%46 = load i8*, i8** %10
%47 = call i64 @strcasecmp(i8* %46, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%48 = icmp eq i64 %47, 0
br i1 %48, label %49, label %69
49: ; preds = %45
%50 = load i32, i32* %15
%51 = icmp eq i32 %50, 1
br i1 %51, label %52, label %59
52: ; preds = %49
%53 = load i32*, i32** %6
%54 = load i32, i32* %15
%55 = add i32 %54, 1
store i32 %55, i32* %15
%56 = zext i32 %54 to i64
%57 = inttoptr i64 %56 to i8*
%58 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %53, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %57)
br label %59
59: ; preds = %52, %49
%60 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %9)
store i8* %60, i8** %11
%61 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8** %9)
store i8* %61, i8** %13
%62 = load i8*, i8** %13
%63 = load i8*, i8** %8
%64 = call i32 @format_label(i8* %62, i8* %63)
%65 = load i32*, i32** %6
%66 = load i8*, i8** %11
%67 = load i8*, i8** %8
%68 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %65, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i8* %66, i8* %67)
br label %128
69: ; preds = %45
%70 = load i8*, i8** %10
%71 = call i64 @strcasecmp(i8* %70, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%72 = icmp ne i64 %71, 0
br i1 %72, label %73, label %81
73: ; preds = %69
%74 = load i8*, i8** %10
%75 = call i64 @strcasecmp(i8* %74, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%76 = icmp ne i64 %75, 0
br i1 %76, label %77, label %81
77: ; preds = %73
%78 = load i8*, i8** %10
%79 = call i64 @strcasecmp(i8* %78, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%80 = icmp ne i64 %79, 0
br i1 %80, label %108, label %81
81: ; preds = %77, %73, %69
%82 = load i32, i32* %15
%83 = icmp eq i32 %82, 1
br i1 %83, label %84, label %91
84: ; preds = %81
%85 = load i32*, i32** %6
%86 = load i32, i32* %15
%87 = add i32 %86, 1
store i32 %87, i32* %15
%88 = zext i32 %86 to i64
%89 = inttoptr i64 %88 to i8*
%90 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %85, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %89)
br label %91
91: ; preds = %84, %81
%92 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %9)
store i8* %92, i8** %11
%93 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %9)
store i8* %93, i8** %12
%94 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8** %9)
store i8* %94, i8** %13
%95 = load i8*, i8** %13
%96 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0), i8* %95)
%97 = load i8*, i8** %13
%98 = load i8*, i8** %8
%99 = call i32 @format_label(i8* %97, i8* %98)
%100 = load i8*, i8** %8
%101 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0), i8* %100)
%102 = load i32*, i32** %6
%103 = load i8*, i8** %10
%104 = load i8*, i8** %11
%105 = load i8*, i8** %12
%106 = load i8*, i8** %8
%107 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %102, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.11, i64 0, i64 0), i8* %103, i8* %104, i8* %105, i8* %106)
br label %127
108: ; preds = %77
%109 = load i32*, i32** %5
%110 = load i32, i32* %14
%111 = load i32, i32* @SEEK_SET
%112 = call i64 @fseek(i32* %109, i32 %110, i32 %111)
%113 = icmp ne i64 %112, 0
br i1 %113, label %114, label %116
114: ; preds = %108
%115 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0))
br label %132
116: ; preds = %108
%117 = load i8*, i8** %7
%118 = load i32*, i32** %5
%119 = call i32* @fgets(i8* %117, i32 1024, i32* %118)
%120 = icmp eq i32* %119, null
br i1 %120, label %121, label %123
121: ; preds = %116
%122 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0))
br label %132
123: ; preds = %116
%124 = load i32*, i32** %6
%125 = load i8*, i8** %7
%126 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %124, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0), i8* %125)
br label %127
127: ; preds = %123, %91
br label %128
128: ; preds = %127, %59
br label %129
129: ; preds = %128, %38
br label %130
130: ; preds = %129, %28
br label %131
131: ; preds = %130, %21
br label %16
132: ; preds = %121, %114, %16
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c" \09\0D\0A\00"
@.str.1 = [3 x i8] c"XP\00"
@.str.2 = [9 x i8] c"XP # %u\0A\00"
@.str.3 = [2 x i8] c"v\00"
@.str.4 = [3 x i8] c"\0D\0A\00"
@.str.5 = [9 x i8] c"v %s %s\0A\00"
@.str.6 = [2 x i8] c"e\00"
@.str.7 = [2 x i8] c"d\00"
@.str.8 = [2 x i8] c"u\00"
@.str.9 = [12 x i8] c"LABEL (%s)\0A\00"
@.str.10 = [11 x i8] c"BUFF (%s)\0A\00"
@.str.11 = [13 x i8] c"%s %s %s %s\0A\00"
@SEEK_SET = global i32 0
@.str.12 = [5 x i8] c"seek\00"
@.str.13 = [6 x i8] c"fgets\00"
@.str.14 = [6 x i8] c"// %s\00"
define void @convert(i32* nocapture %0, i32* nocapture %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = bitcast i8** %5 to i8*
%7 = call i32 @feof(i32* %0)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %76
9: ; preds = %4, %69
%10 = phi i32 [ %70, %69 ], [ 1, %4 ]
%11 = call i32 @ftell(i32* %0)
%12 = call i32* @fgets(i8* %2, i32 1024, i32* %0)
%13 = icmp eq i32* %12, null
br i1 %13, label %69, label %14
14: ; preds = %9
store i8* %2, i8** %5
%15 = call i8* @strtok_r(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %5)
%16 = icmp eq i8* %15, null
br i1 %16, label %69, label %17
17: ; preds = %14
%18 = call i64 @strcasecmp(i8* %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %25
20: ; preds = %17
%21 = add i32 %10, 1
%22 = zext i32 %10 to i64
%23 = inttoptr i64 %22 to i8*
%24 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %23)
br label %69
25: ; preds = %17
%26 = call i64 @strcasecmp(i8* %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
br i1 %27, label %28, label %38
28: ; preds = %25
%29 = icmp eq i32 %10, 1
br i1 %29, label %30, label %32
30: ; preds = %28
%31 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* inttoptr (i64 1 to i8*))
br label %32
32: ; preds = %30, %28
%33 = phi i32 [ 2, %30 ], [ %10, %28 ]
%34 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %5)
%35 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8** %5)
%36 = call i32 @format_label(i8* %35, i8* %3)
%37 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i8* %34, i8* %3)
br label %69
38: ; preds = %25
%39 = call i64 @strcasecmp(i8* %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%40 = icmp eq i64 %39, 0
br i1 %40, label %47, label %41
41: ; preds = %38
%42 = call i64 @strcasecmp(i8* %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%43 = icmp eq i64 %42, 0
br i1 %43, label %47, label %44
44: ; preds = %41
%45 = call i64 @strcasecmp(i8* %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%46 = icmp eq i64 %45, 0
br i1 %46, label %47, label %60
47: ; preds = %44, %41, %38
%48 = icmp eq i32 %10, 1
br i1 %48, label %49, label %51
49: ; preds = %47
%50 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* inttoptr (i64 1 to i8*))
br label %51
51: ; preds = %49, %47
%52 = phi i32 [ 2, %49 ], [ %10, %47 ]
%53 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %5)
%54 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %5)
%55 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8** %5)
%56 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0), i8* %55)
%57 = call i32 @format_label(i8* %55, i8* %3)
%58 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0), i8* %3)
%59 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.11, i64 0, i64 0), i8* %15, i8* %53, i8* %54, i8* %3)
br label %69
60: ; preds = %44
%61 = load i32, i32* @SEEK_SET
%62 = call i64 @fseek(i32* %0, i32 %11, i32 %61)
%63 = icmp eq i64 %62, 0
br i1 %63, label %64, label %73
64: ; preds = %60
%65 = call i32* @fgets(i8* %2, i32 1024, i32* %0)
%66 = icmp eq i32* %65, null
br i1 %66, label %73, label %67
67: ; preds = %64
%68 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0), i8* %2)
br label %69
69: ; preds = %14, %32, %67, %51, %20, %9
%70 = phi i32 [ %21, %20 ], [ %33, %32 ], [ %10, %67 ], [ %52, %51 ], [ %10, %14 ], [ %10, %9 ]
%71 = call i32 @feof(i32* %0)
%72 = icmp eq i32 %71, 0
br i1 %72, label %9, label %76
73: ; preds = %64, %60
%74 = phi i8* [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0), %60 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0), %64 ]
%75 = call i32 @perror(i8* %74)
br label %76
76: ; preds = %69, %73, %4
ret void
}