#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 /*<<< 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);
  }
  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    1207 <main+0xb7>
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    1200 <main+0xb0>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
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     11b6 <main+0x66>
mov    %rax,%r14
lea    0xeb1(%rip),%rsi
mov    %rsp,%rdx
mov    %rax,%rdi
call   1040 <fscanf@plt>
mov    %r14,%rdi
call   1030 <fclose@plt>
cmpq   $0x0,(%rsp)
jle    11d3 <main+0x83>
xor    %r14d,%r14d
xor    %ebx,%ebx
nopl   (%rax)
mov    %ebp,%edi
mov    %r15,%rsi
call   1050 <main1@plt>
add    $0x1,%rbx
cmp    (%rsp),%rbx
jl     11a0 <main+0x50>
jmp    11d6 <main+0x86>
mov    0x2e23(%rip),%rax
mov    (%rax),%edi
lea    0xe4c(%rip),%rsi
call   1060 <fprintf@plt>
mov    $0x1,%r14d
jmp    11d6 <main+0x86>
xor    %r14d,%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 %31
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 = %27, %14
%20 = load i64, i64* %7
%21 = load i64, i64* %8
%22 = icmp slt i64 %20, %21
br i1 %22, label %23, label %30
23: ; preds = %19
%24 = load i32, i32* %4
%25 = load i8**, i8*** %5
%26 = call i32 @main1(i32 %24, i8** %25)
br label %27
27: ; preds = %23
%28 = load i64, i64* %7
%29 = add nsw i64 %28, 1
store i64 %29, i64* %7
br label %19
30: ; preds = %19
store i32 0, i32* %3
br label %31
31: ; preds = %30, %11
%32 = load i32, i32* %3
ret i32 %32
}

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 %21
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 %21
15: ; preds = %10, %15
%16 = phi i64 [ %18, %15 ], [ 0, %10 ]
%17 = call i32 @main1(i32 %0, i8** %1)
%18 = add nuw nsw i64 %16, 1
%19 = load i64, i64* %3
%20 = icmp slt i64 %18, %19
br i1 %20, label %15, label %21
21: ; preds = %15, %10, %7
%22 = phi i32 [ 1, %7 ], [ 0, %10 ], [ 0, %15 ]
ret i32 %22
}