#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 keyBundleStore {
  int dummy;
};

/* Variables and functions */
scalar_t__ alert(struct keyBundleStore *, double *);
struct keyBundleStore *buildFromFile(char *);
int /*<<< orphan*/ kbs_insert_times(struct keyBundleStore *, double, double,
                                    double, double, double);
int /*<<< orphan*/ makeFile(struct keyBundleStore *);
double *readData(char *);
bool begin(char *data) {
  struct keyBundleStore *kbs = buildFromFile("file.txt");
  double *info = readData(data);
  if (alert(kbs, info)) {
    kbs_insert_times(kbs, info[0], info[1], info[2], info[3], info[4]);
    makeFile(kbs);
    return true;
  } else {
    return false;
  }
}


x86 assembly (clang, -O0):
<begin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xe9d(%rip),%rdi
call   1030 <buildFromFile@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <readData@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1060 <alert@plt>
cmp    $0x0,%rax
je     11da <begin+0x8a>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x20(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x20(%rbp),%rax
movsd  0x10(%rax),%xmm2
mov    -0x20(%rbp),%rax
movsd  0x18(%rax),%xmm3
mov    -0x20(%rbp),%rax
movsd  0x20(%rax),%xmm4
call   1040 <kbs_insert_times@plt>
mov    -0x18(%rbp),%rdi
call   1070 <makeFile@plt>
movl   $0x1,-0x4(%rbp)
jmp    11e1 <begin+0x91>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<begin>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xea2(%rip),%rdi
call   1030 <buildFromFile@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1050 <readData@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1060 <alert@plt>
test   %rax,%rax
je     11b0 <begin+0x60>
movsd  (%rbx),%xmm0
movsd  0x8(%rbx),%xmm1
movsd  0x10(%rbx),%xmm2
movsd  0x18(%rbx),%xmm3
movsd  0x20(%rbx),%xmm4
mov    %r14,%rdi
call   1040 <kbs_insert_times@plt>
mov    %r14,%rdi
call   1070 <makeFile@plt>
mov    $0x1,%eax
jmp    11b2 <begin+0x62>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.keyBundleStore = type { i32 }
@.str = [9 x i8] c"file.txt\00"
define i32 @begin(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.keyBundleStore*
%5 = alloca double*
store i8* %0, i8** %3
%6 = call %struct.keyBundleStore* @buildFromFile(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
store %struct.keyBundleStore* %6, %struct.keyBundleStore** %4
%7 = load i8*, i8** %3
%8 = call double* @readData(i8* %7)
store double* %8, double** %5
%9 = load %struct.keyBundleStore*, %struct.keyBundleStore** %4
%10 = load double*, double** %5
%11 = call i64 @alert(%struct.keyBundleStore* %9, double* %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %33
13: ; preds = %1
%14 = load %struct.keyBundleStore*, %struct.keyBundleStore** %4
%15 = load double*, double** %5
%16 = getelementptr inbounds double, double* %15, i64 0
%17 = load double, double* %16
%18 = load double*, double** %5
%19 = getelementptr inbounds double, double* %18, i64 1
%20 = load double, double* %19
%21 = load double*, double** %5
%22 = getelementptr inbounds double, double* %21, i64 2
%23 = load double, double* %22
%24 = load double*, double** %5
%25 = getelementptr inbounds double, double* %24, i64 3
%26 = load double, double* %25
%27 = load double*, double** %5
%28 = getelementptr inbounds double, double* %27, i64 4
%29 = load double, double* %28
%30 = call i32 @kbs_insert_times(%struct.keyBundleStore* %14, double %17, double %20, double %23, double %26, double %29)
%31 = load %struct.keyBundleStore*, %struct.keyBundleStore** %4
%32 = call i32 @makeFile(%struct.keyBundleStore* %31)
store i32 1, i32* %2
br label %34
33: ; preds = %1
store i32 0, i32* %2
br label %34
34: ; preds = %33, %13
%35 = load i32, i32* %2
ret i32 %35
}

LLVM IR (-O2):
%struct.keyBundleStore = type { i32 }
@.str = [9 x i8] c"file.txt\00"
define i32 @begin(i8* %0) {
%2 = tail call %struct.keyBundleStore* @buildFromFile(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = tail call double* @readData(i8* %0)
%4 = tail call i64 @alert(%struct.keyBundleStore* %2, double* %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %18, label %6
6: ; preds = %1
%7 = load double, double* %3
%8 = getelementptr inbounds double, double* %3, i64 1
%9 = load double, double* %8
%10 = getelementptr inbounds double, double* %3, i64 2
%11 = load double, double* %10
%12 = getelementptr inbounds double, double* %3, i64 3
%13 = load double, double* %12
%14 = getelementptr inbounds double, double* %3, i64 4
%15 = load double, double* %14
%16 = tail call i32 @kbs_insert_times(%struct.keyBundleStore* %2, double %7, double %9, double %11, double %13, double %15)
%17 = tail call i32 @makeFile(%struct.keyBundleStore* %2)
br label %18
18: ; preds = %1, %6
%19 = phi i32 [ 1, %6 ], [ 0, %1 ]
ret i32 %19
}