#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*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, long *);
int /*<<< orphan*/ main1(int, char **, int);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  FILE *loop_wrap = NULL;
  long loop_wrap1, loop_wrap2;
  if ((loop_wrap = fopen("_finfo_dataset", "rt")) == NULL) {
    fprintf(stderr, "\nError: Can't find dataset!\n");
    return 1;
  }
  fscanf(loop_wrap, "%ld", &loop_wrap2);
  fclose(loop_wrap);
  for (loop_wrap1 = 0; loop_wrap1 < loop_wrap2; loop_wrap1++) {
    main1(argc, argv, loop_wrap1 + 1 == loop_wrap2);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
lea    0xe8b(%rip),%rdi
lea    0xe93(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    11b0 <main+0x60>
mov    0x2e4a(%rip),%rax
mov    (%rax),%edi
lea    0xe73(%rip),%rsi
call   1060 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    121b <main+0xcb>
mov    -0x18(%rbp),%rdi
lea    0xe74(%rip),%rsi
lea    -0x28(%rbp),%rdx
call   1040 <fscanf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jge    1214 <main+0xc4>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rax
add    $0x1,%rax
cmp    -0x28(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edx
call   1050 <main1@plt>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    11d5 <main+0x85>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r15
mov    %edi,%ebp
lea    0xe9d(%rip),%rdi
lea    0xea5(%rip),%rsi
call   1070 <fopen@plt>
test   %rax,%rax
je     11c1 <main+0x71>
mov    %rax,%r14
lea    0xeb1(%rip),%rsi
mov    %rsp,%rdx
mov    %rax,%rdi
call   1040 <fscanf@plt>
mov    %r14,%rdi
call   1030 <fclose@plt>
mov    (%rsp),%rax
xor    %r14d,%r14d
test   %rax,%rax
jle    11dc <main+0x8c>
xor    %ebx,%ebx
nop
add    $0x1,%rbx
xor    %edx,%edx
cmp    %rax,%rbx
sete   %dl
mov    %ebp,%edi
mov    %r15,%rsi
call   1050 <main1@plt>
mov    (%rsp),%rax
cmp    %rax,%rbx
jl     11a0 <main+0x50>
jmp    11dc <main+0x8c>
mov    0x2e18(%rip),%rax
mov    (%rax),%edi
lea    0xe41(%rip),%rsi
call   1060 <fprintf@plt>
mov    $0x1,%r14d
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"_finfo_dataset\00"
@.str.1 = [3 x i8] c"rt\00"
@stderr = global i32 0
@.str.2 = [29 x i8] c"\0AError: Can't find dataset!\0A\00"
@.str.3 = [4 x i8] c"%ld\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i64
%8 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32* null, i32** %6
%9 = call i32* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %9, i32** %6
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %3
br label %36
14: ; preds = %2
%15 = load i32*, i32** %6
%16 = call i32 @fscanf(i32* %15, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i64* %8)
%17 = load i32*, i32** %6
%18 = call i32 @fclose(i32* %17)
store i64 0, i64* %7
br label %19
19: ; preds = %32, %14
%20 = load i64, i64* %7
%21 = load i64, i64* %8
%22 = icmp slt i64 %20, %21
br i1 %22, label %23, label %35
23: ; preds = %19
%24 = load i32, i32* %4
%25 = load i8**, i8*** %5
%26 = load i64, i64* %7
%27 = add nsw i64 %26, 1
%28 = load i64, i64* %8
%29 = icmp eq i64 %27, %28
%30 = zext i1 %29 to i32
%31 = call i32 @main1(i32 %24, i8** %25, i32 %30)
br label %32
32: ; preds = %23
%33 = load i64, i64* %7
%34 = add nsw i64 %33, 1
store i64 %34, i64* %7
br label %19
35: ; preds = %19
store i32 0, i32* %3
br label %36
36: ; preds = %35, %11
%37 = load i32, i32* %3
ret i32 %37
}

LLVM IR (-O2):
@.str = [15 x i8] c"_finfo_dataset\00"
@.str.1 = [3 x i8] c"rt\00"
@stderr = global i32 0
@.str.2 = [29 x i8] c"\0AError: Can't find dataset!\0A\00"
@.str.3 = [4 x i8] c"%ld\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = tail call i32* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
br label %24
10: ; preds = %2
%11 = call i32 @fscanf(i32* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i64* %3)
%12 = call i32 @fclose(i32* %5)
%13 = load i64, i64* %3
%14 = icmp sgt i64 %13, 0
br i1 %14, label %15, label %24
15: ; preds = %10, %15
%16 = phi i64 [ %22, %15 ], [ %13, %10 ]
%17 = phi i64 [ %18, %15 ], [ 0, %10 ]
%18 = add nuw nsw i64 %17, 1
%19 = icmp eq i64 %18, %16
%20 = zext i1 %19 to i32
%21 = call i32 @main1(i32 %0, i8** %1, i32 %20)
%22 = load i64, i64* %3
%23 = icmp slt i64 %18, %22
br i1 %23, label %15, label %24
24: ; preds = %15, %10, %7
%25 = phi i32 [ 1, %7 ], [ 0, %10 ], [ 0, %15 ]
ret i32 %25
}