#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 */
struct data_entry {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ dump_trace(struct data_entry *, int, int, int, int, int,
                              int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int fread(struct data_entry *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ free(struct data_entry *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
int ftell(int /*<<< orphan*/ *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
int strtol(char *, int /*<<< orphan*/ *, int);
int main(int argc, char **argv) {
  FILE *fi;
  if (argc < 2) {
    printf("Usage: dump_vcd [-d] [-t frames] [-w trig] <file>\n");
    exit(1);
  }
  int i = 1;
  int text_mode = 0;
  int length = 63 * 2 * 312 * 500;
  int trigger = -1;
  int file_size = 0;
  int skip_frames = 0;
  int temp = 1;
  int drive_mode = 0;
  if (strcmp(argv[i], "-d") == 0) {
    drive_mode = 1;
    i++;
  }
  if (strcmp(argv[i], "-f") == 0) {
    i++;
    skip_frames = strtol(argv[i], NULL, 10);
    fprintf(stderr, "Skipping %d frames.\n", skip_frames);
    i++;
  }
  if (strcmp(argv[i], "-t") == 0) {
    i++;
    text_mode = 1;
    temp = strtol(argv[i], NULL, 10);
    fprintf(stderr, "Text mode %d frames.\n", temp);
    i++;
    length = 63 * 2 * 312 * temp;
  }
  if (strcmp(argv[i], "-w") == 0) {
    i++;
    trigger = strtol(argv[i], NULL, 16);
    i++;
  }
  fi = fopen(argv[i], "rb");
  if (fi) {
    fseek(fi, 0, SEEK_END);
    file_size = ftell(fi);
    fseek(fi, 0, SEEK_SET);
    struct data_entry *entries = (struct data_entry *)malloc(file_size);
    int numberOfEntries = fread(entries, 4, file_size / 4, fi);
    fprintf(stderr, "%d number of entries read.\n", numberOfEntries);
    dump_trace(entries, numberOfEntries, length, text_mode, trigger,
               skip_frames, drive_mode);
    free(entries);
  } else {
    fprintf(stderr, "Can't open file.\n");
    exit(2);
  }
  fclose(fi);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1206 <main+0x36>
lea    0xe09(%rip),%rdi
call   1060 <printf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
movl   $0x1,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x12bed40,-0x24(%rbp)
movl   $0xffffffff,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
movl   $0x1,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xde2(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    1270 <main+0xa0>
movl   $0x1,-0x38(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xdb3(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    12db <main+0x10b>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   10a0 <strtol@plt>
mov    %eax,-0x30(%rbp)
mov    0x2d19(%rip),%rax
mov    (%rax),%edi
mov    -0x30(%rbp),%edx
lea    0xd6e(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd60(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    1357 <main+0x187>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
movl   $0x1,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   10a0 <strtol@plt>
mov    %eax,-0x34(%rbp)
mov    0x2ca7(%rip),%rax
mov    (%rax),%edi
mov    -0x34(%rbp),%edx
lea    0xd14(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
imul   $0x9990,-0x34(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xcfd(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    13a8 <main+0x1d8>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x10,%edx
call   10a0 <strtol@plt>
mov    %eax,-0x28(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xcaf(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1479 <main+0x2a9>
mov    -0x18(%rbp),%rdi
mov    0x2c0e(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10d0 <fseek@plt>
mov    -0x18(%rbp),%rdi
call   1090 <ftell@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2bd6(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10d0 <fseek@plt>
mov    -0x2c(%rbp),%edi
call   10b0 <malloc@plt>
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x2c(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
mov    -0x18(%rbp),%rcx
mov    $0x4,%esi
call   1040 <fread@plt>
mov    %eax,-0x44(%rbp)
mov    0x2ba0(%rip),%rax
mov    (%rax),%edi
mov    -0x44(%rbp),%edx
lea    0xc29(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x40(%rbp),%rdi
mov    -0x44(%rbp),%esi
mov    -0x24(%rbp),%edx
mov    -0x20(%rbp),%ecx
mov    -0x28(%rbp),%r8d
mov    -0x30(%rbp),%r9d
mov    -0x38(%rbp),%eax
mov    %eax,(%rsp)
call   10c0 <dump_trace@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
jmp    149a <main+0x2ca>
mov    0x2b58(%rip),%rax
mov    (%rax),%edi
lea    0xc00(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0x2,%edi
call   10f0 <exit@plt>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
xor    %eax,%eax
add    $0x50,%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
jle    13d4 <main+0x204>
mov    %rsi,%rbp
mov    0x8(%rsi),%rdi
lea    0xe0b(%rip),%rsi
call   1070 <strcmp@plt>
mov    %rax,%r13
cmp    $0x1,%rax
mov    $0x1,%r15d
adc    $0x0,%r15d
mov    0x0(%rbp,%r15,8),%rdi
lea    0xdec(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     122b <main+0x5b>
movl   $0x0,0x14(%rsp)
jmp    1260 <main+0x90>
mov    %r15d,%eax
mov    0x8(%rbp,%rax,8),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   10a0 <strtol@plt>
mov    %eax,%edx
mov    0x2d90(%rip),%rax
mov    (%rax),%edi
lea    0xdb5(%rip),%rsi
mov    %edx,0x14(%rsp)
xor    %eax,%eax
call   1080 <fprintf@plt>
add    $0x2,%r15d
mov    0x0(%rbp,%r15,8),%rdi
lea    0xdaf(%rip),%rsi
call   1070 <strcmp@plt>
mov    $0x12bed40,%r12d
test   %rax,%rax
je     1286 <main+0xb6>
movl   $0x0,0x10(%rsp)
jmp    12c8 <main+0xf8>
mov    %r15d,%eax
mov    0x8(%rbp,%rax,8),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   10a0 <strtol@plt>
mov    %eax,%ebx
mov    0x2d35(%rip),%rax
mov    (%rax),%edi
lea    0xd72(%rip),%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1080 <fprintf@plt>
add    $0x2,%r15d
imul   $0x9990,%ebx,%r12d
movl   $0x1,0x10(%rsp)
mov    0x0(%rbp,%r15,8),%rdi
lea    0xd60(%rip),%rsi
call   1070 <strcmp@plt>
mov    $0xffffffff,%r14d
test   %rax,%rax
jne    12ff <main+0x12f>
mov    %r15d,%eax
mov    0x8(%rbp,%rax,8),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   10a0 <strtol@plt>
mov    %eax,%r14d
add    $0x2,%r15d
mov    0x0(%rbp,%r15,8),%rdi
lea    0xd2c(%rip),%rsi
call   10e0 <fopen@plt>
test   %rax,%rax
je     13ea <main+0x21a>
mov    %rax,%rbp
xor    %r15d,%r15d
test   %r13,%r13
sete   %r15b
mov    0x2cbb(%rip),%rax
mov    (%rax),%edx
mov    %rbp,%rdi
xor    %esi,%esi
call   10d0 <fseek@plt>
mov    %rbp,%rdi
call   1090 <ftell@plt>
mov    %eax,%ebx
mov    0x2c86(%rip),%rax
mov    (%rax),%edx
mov    %rbp,%rdi
xor    %esi,%esi
call   10d0 <fseek@plt>
mov    %ebx,%edi
call   10b0 <malloc@plt>
mov    %rax,%r13
lea    0x3(%rbx),%edx
test   %ebx,%ebx
cmovns %ebx,%edx
sar    $0x2,%edx
mov    %rax,%rdi
mov    $0x4,%esi
mov    %rbp,%rcx
call   1050 <fread@plt>
mov    %eax,%ebx
mov    0x2c54(%rip),%rax
mov    (%rax),%edi
lea    0xcad(%rip),%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    %r15d,(%rsp)
mov    %r13,%rdi
mov    %ebx,%esi
mov    %r12d,%edx
mov    0x10(%rsp),%ecx
mov    %r14d,%r8d
mov    0x14(%rsp),%r9d
call   10c0 <dump_trace@plt>
mov    %r13,%rdi
call   1030 <free@plt>
mov    %rbp,%rdi
call   1060 <fclose@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc8d(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
mov    0x2be7(%rip),%rax
mov    (%rax),%edi
lea    0xc5c(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    $0x2,%edi
call   10f0 <exit@plt>

LLVM IR (-O0):
%struct.data_entry = type { i32 }
@.str = [51 x i8] c"Usage: dump_vcd [-d] [-t frames] [-w trig] <file>\0A\00"
@.str.1 = [3 x i8] c"-d\00"
@.str.2 = [3 x i8] c"-f\00"
@stderr = global i32 0
@.str.3 = [21 x i8] c"Skipping %d frames.\0A\00"
@.str.4 = [3 x i8] c"-t\00"
@.str.5 = [22 x i8] c"Text mode %d frames.\0A\00"
@.str.6 = [3 x i8] c"-w\00"
@.str.7 = [3 x i8] c"rb\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.8 = [28 x i8] c"%d number of entries read.\0A\00"
@.str.9 = [18 x i8] c"Can't open file.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca %struct.data_entry*
%16 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%17 = load i32, i32* %4
%18 = icmp slt i32 %17, 2
br i1 %18, label %19, label %22
19: ; preds = %2
%20 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%21 = call i32 @exit(i32 1)
unreachable
22: ; preds = %2
store i32 1, i32* %7
store i32 0, i32* %8
store i32 19656000, i32* %9
store i32 -1, i32* %10
store i32 0, i32* %11
store i32 0, i32* %12
store i32 1, i32* %13
store i32 0, i32* %14
%23 = load i8**, i8*** %5
%24 = load i32, i32* %7
%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 ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%29 = icmp eq i64 %28, 0
br i1 %29, label %30, label %33
30: ; preds = %22
store i32 1, i32* %14
%31 = load i32, i32* %7
%32 = add nsw i32 %31, 1
store i32 %32, i32* %7
br label %33
33: ; preds = %30, %22
%34 = load i8**, i8*** %5
%35 = load i32, i32* %7
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i8*, i8** %34, i64 %36
%38 = load i8*, i8** %37
%39 = call i64 @strcmp(i8* %38, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%40 = icmp eq i64 %39, 0
br i1 %40, label %41, label %55
41: ; preds = %33
%42 = load i32, i32* %7
%43 = add nsw i32 %42, 1
store i32 %43, i32* %7
%44 = load i8**, i8*** %5
%45 = load i32, i32* %7
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds i8*, i8** %44, i64 %46
%48 = load i8*, i8** %47
%49 = call i32 @strtol(i8* %48, i32* null, i32 10)
store i32 %49, i32* %12
%50 = load i32, i32* @stderr
%51 = load i32, i32* %12
%52 = call i32 (i32, i8*, ...) @fprintf(i32 %50, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i32 %51)
%53 = load i32, i32* %7
%54 = add nsw i32 %53, 1
store i32 %54, i32* %7
br label %55
55: ; preds = %41, %33
%56 = load i8**, i8*** %5
%57 = load i32, i32* %7
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds i8*, i8** %56, i64 %58
%60 = load i8*, i8** %59
%61 = call i64 @strcmp(i8* %60, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%62 = icmp eq i64 %61, 0
br i1 %62, label %63, label %79
63: ; preds = %55
%64 = load i32, i32* %7
%65 = add nsw i32 %64, 1
store i32 %65, i32* %7
store i32 1, i32* %8
%66 = load i8**, i8*** %5
%67 = load i32, i32* %7
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds i8*, i8** %66, i64 %68
%70 = load i8*, i8** %69
%71 = call i32 @strtol(i8* %70, i32* null, i32 10)
store i32 %71, i32* %13
%72 = load i32, i32* @stderr
%73 = load i32, i32* %13
%74 = call i32 (i32, i8*, ...) @fprintf(i32 %72, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i32 %73)
%75 = load i32, i32* %7
%76 = add nsw i32 %75, 1
store i32 %76, i32* %7
%77 = load i32, i32* %13
%78 = mul nsw i32 39312, %77
store i32 %78, i32* %9
br label %79
79: ; preds = %63, %55
%80 = load i8**, i8*** %5
%81 = load i32, i32* %7
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds i8*, i8** %80, i64 %82
%84 = load i8*, i8** %83
%85 = call i64 @strcmp(i8* %84, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%86 = icmp eq i64 %85, 0
br i1 %86, label %87, label %98
87: ; preds = %79
%88 = load i32, i32* %7
%89 = add nsw i32 %88, 1
store i32 %89, i32* %7
%90 = load i8**, i8*** %5
%91 = load i32, i32* %7
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds i8*, i8** %90, i64 %92
%94 = load i8*, i8** %93
%95 = call i32 @strtol(i8* %94, i32* null, i32 16)
store i32 %95, i32* %10
%96 = load i32, i32* %7
%97 = add nsw i32 %96, 1
store i32 %97, i32* %7
br label %98
98: ; preds = %87, %79
%99 = load i8**, i8*** %5
%100 = load i32, i32* %7
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds i8*, i8** %99, i64 %101
%103 = load i8*, i8** %102
%104 = call i32* @fopen(i8* %103, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
store i32* %104, i32** %6
%105 = load i32*, i32** %6
%106 = icmp ne i32* %105, null
br i1 %106, label %107, label %137
107: ; preds = %98
%108 = load i32*, i32** %6
%109 = load i32, i32* @SEEK_END
%110 = call i32 @fseek(i32* %108, i32 0, i32 %109)
%111 = load i32*, i32** %6
%112 = call i32 @ftell(i32* %111)
store i32 %112, i32* %11
%113 = load i32*, i32** %6
%114 = load i32, i32* @SEEK_SET
%115 = call i32 @fseek(i32* %113, i32 0, i32 %114)
%116 = load i32, i32* %11
%117 = call i64 @malloc(i32 %116)
%118 = inttoptr i64 %117 to %struct.data_entry*
store %struct.data_entry* %118, %struct.data_entry** %15
%119 = load %struct.data_entry*, %struct.data_entry** %15
%120 = load i32, i32* %11
%121 = sdiv i32 %120, 4
%122 = load i32*, i32** %6
%123 = call i32 @fread(%struct.data_entry* %119, i32 4, i32 %121, i32* %122)
store i32 %123, i32* %16
%124 = load i32, i32* @stderr
%125 = load i32, i32* %16
%126 = call i32 (i32, i8*, ...) @fprintf(i32 %124, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.8, i64 0, i64 0), i32 %125)
%127 = load %struct.data_entry*, %struct.data_entry** %15
%128 = load i32, i32* %16
%129 = load i32, i32* %9
%130 = load i32, i32* %8
%131 = load i32, i32* %10
%132 = load i32, i32* %12
%133 = load i32, i32* %14
%134 = call i32 @dump_trace(%struct.data_entry* %127, i32 %128, i32 %129, i32 %130, i32 %131, i32 %132, i32 %133)
%135 = load %struct.data_entry*, %struct.data_entry** %15
%136 = call i32 @free(%struct.data_entry* %135)
br label %141
137: ; preds = %98
%138 = load i32, i32* @stderr
%139 = call i32 (i32, i8*, ...) @fprintf(i32 %138, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0))
%140 = call i32 @exit(i32 2)
unreachable
141: ; preds = %107
%142 = load i32*, i32** %6
%143 = call i32 @fclose(i32* %142)
ret i32 0
}

LLVM IR (-O2):
%struct.data_entry = type { i32 }
@.str.1 = [3 x i8] c"-d\00"
@.str.2 = [3 x i8] c"-f\00"
@stderr = global i32 0
@.str.3 = [21 x i8] c"Skipping %d frames.\0A\00"
@.str.4 = [3 x i8] c"-t\00"
@.str.5 = [22 x i8] c"Text mode %d frames.\0A\00"
@.str.6 = [3 x i8] c"-w\00"
@.str.7 = [3 x i8] c"rb\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.8 = [28 x i8] c"%d number of entries read.\0A\00"
@.str.9 = [18 x i8] c"Can't open file.\0A\00"
@str = [50 x i8] c"Usage: dump_vcd [-d] [-t frames] [-w trig] <file>\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
%12 = select i1 %11, i32 2, i32 1
%13 = zext i32 %12 to i64
%14 = getelementptr inbounds i8*, i8** %1, i64 %13
%15 = load i8*, i8** %14
%16 = tail call i64 @strcmp(i8* %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %28
18: ; preds = %7
%19 = add nuw nsw i32 %12, 1
%20 = zext i32 %19 to i64
%21 = getelementptr inbounds i8*, i8** %1, i64 %20
%22 = load i8*, i8** %21
%23 = tail call i32 @strtol(i8* nocapture %22, i32* null, i32 10)
%24 = load i32, i32* @stderr
%25 = tail call i32 (i32, i8*, ...) @fprintf(i32 %24, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i32 %23)
%26 = add nuw nsw i32 %12, 2
%27 = zext i32 %26 to i64
br label %28
28: ; preds = %18, %7
%29 = phi i64 [ %27, %18 ], [ %13, %7 ]
%30 = phi i32 [ %23, %18 ], [ 0, %7 ]
%31 = phi i32 [ %26, %18 ], [ %12, %7 ]
%32 = getelementptr inbounds i8*, i8** %1, i64 %29
%33 = load i8*, i8** %32
%34 = tail call i64 @strcmp(i8* %33, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %47
36: ; preds = %28
%37 = add nuw nsw i32 %31, 1
%38 = zext i32 %37 to i64
%39 = getelementptr inbounds i8*, i8** %1, i64 %38
%40 = load i8*, i8** %39
%41 = tail call i32 @strtol(i8* nocapture %40, i32* null, i32 10)
%42 = load i32, i32* @stderr
%43 = tail call i32 (i32, i8*, ...) @fprintf(i32 %42, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i32 %41)
%44 = add nuw nsw i32 %31, 2
%45 = mul nsw i32 %41, 39312
%46 = zext i32 %44 to i64
br label %47
47: ; preds = %36, %28
%48 = phi i64 [ %46, %36 ], [ %29, %28 ]
%49 = phi i32 [ %45, %36 ], [ 19656000, %28 ]
%50 = phi i32 [ 1, %36 ], [ 0, %28 ]
%51 = phi i32 [ %44, %36 ], [ %31, %28 ]
%52 = getelementptr inbounds i8*, i8** %1, i64 %48
%53 = load i8*, i8** %52
%54 = tail call i64 @strcmp(i8* %53, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%55 = icmp eq i64 %54, 0
br i1 %55, label %56, label %64
56: ; preds = %47
%57 = add nuw nsw i32 %51, 1
%58 = zext i32 %57 to i64
%59 = getelementptr inbounds i8*, i8** %1, i64 %58
%60 = load i8*, i8** %59
%61 = tail call i32 @strtol(i8* nocapture %60, i32* null, i32 16)
%62 = add nuw nsw i32 %51, 2
%63 = zext i32 %62 to i64
br label %64
64: ; preds = %56, %47
%65 = phi i64 [ %63, %56 ], [ %48, %47 ]
%66 = phi i32 [ %61, %56 ], [ -1, %47 ]
%67 = getelementptr inbounds i8*, i8** %1, i64 %65
%68 = load i8*, i8** %67
%69 = tail call i32* @fopen(i8* %68, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%70 = icmp eq i32* %69, null
br i1 %70, label %87, label %71
71: ; preds = %64
%72 = zext i1 %11 to i32
%73 = load i32, i32* @SEEK_END
%74 = tail call i32 @fseek(i32* %69, i32 0, i32 %73)
%75 = tail call i32 @ftell(i32* %69)
%76 = load i32, i32* @SEEK_SET
%77 = tail call i32 @fseek(i32* %69, i32 0, i32 %76)
%78 = tail call i64 @malloc(i32 %75)
%79 = inttoptr i64 %78 to %struct.data_entry*
%80 = sdiv i32 %75, 4
%81 = tail call i32 @fread(%struct.data_entry* %79, i32 4, i32 %80, i32* %69)
%82 = load i32, i32* @stderr
%83 = tail call i32 (i32, i8*, ...) @fprintf(i32 %82, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.8, i64 0, i64 0), i32 %81)
%84 = tail call i32 @dump_trace(%struct.data_entry* %79, i32 %81, i32 %49, i32 %50, i32 %66, i32 %30, i32 %72)
%85 = tail call i32 @free(%struct.data_entry* %79)
%86 = tail call i32 @fclose(i32* %69)
ret i32 0
87: ; preds = %64
%88 = load i32, i32* @stderr
%89 = tail call i32 (i32, i8*, ...) @fprintf(i32 %88, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0))
%90 = tail call i32 @exit(i32 2)
unreachable
}