#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 */

/* Variables and functions */
int EXIT_FAILURE;
int mainloop_run();
int /*<<< orphan*/ ta_voland_init();
int /*<<< orphan*/ ta_voland_quit();
int /*<<< orphan*/ voland_init();
int /*<<< orphan*/ voland_quit();
int /*<<< orphan*/ xtimed_init();
int /*<<< orphan*/ xtimed_quit();
int main(int ac, char **av) {
  int res = EXIT_FAILURE;
  if (!xtimed_init()) {
    goto cleanup;
  }
  if (!voland_init()) {
    goto cleanup;
  }
  if (!ta_voland_init()) {
    goto cleanup;
  }
  res = mainloop_run();
cleanup:
  ta_voland_quit();
  voland_quit();
  xtimed_quit();
  return res;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e53(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1050 <xtimed_init@plt>
cmp    $0x0,%eax
jne    11a7 <main+0x37>
jmp    11db <main+0x6b>
mov    $0x0,%al
call   1070 <voland_init@plt>
cmp    $0x0,%eax
jne    11bc <main+0x4c>
jmp    11db <main+0x6b>
mov    $0x0,%al
call   1060 <ta_voland_init@plt>
cmp    $0x0,%eax
jne    11d1 <main+0x61>
jmp    11db <main+0x6b>
mov    $0x0,%al
call   1030 <mainloop_run@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1080 <ta_voland_quit@plt>
mov    $0x0,%al
call   1090 <voland_quit@plt>
mov    $0x0,%al
call   1040 <xtimed_quit@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2e68(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1050 <xtimed_init@plt>
test   %eax,%eax
je     11a4 <main+0x34>
xor    %eax,%eax
call   1070 <voland_init@plt>
test   %eax,%eax
je     11a4 <main+0x34>
xor    %eax,%eax
call   1060 <ta_voland_init@plt>
test   %eax,%eax
je     11a4 <main+0x34>
xor    %eax,%eax
call   1030 <mainloop_run@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1080 <ta_voland_quit@plt>
xor    %eax,%eax
call   1090 <voland_quit@plt>
xor    %eax,%eax
call   1040 <xtimed_quit@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* @EXIT_FAILURE
store i32 %7, i32* %6
%8 = call i32 (...) @xtimed_init()
%9 = icmp ne i32 %8, 0
br i1 %9, label %11, label %10
10: ; preds = %2
br label %21
11: ; preds = %2
%12 = call i32 (...) @voland_init()
%13 = icmp ne i32 %12, 0
br i1 %13, label %15, label %14
14: ; preds = %11
br label %21
15: ; preds = %11
%16 = call i32 (...) @ta_voland_init()
%17 = icmp ne i32 %16, 0
br i1 %17, label %19, label %18
18: ; preds = %15
br label %21
19: ; preds = %15
%20 = call i32 (...) @mainloop_run()
store i32 %20, i32* %6
br label %21
21: ; preds = %19, %18, %14, %10
%22 = call i32 (...) @ta_voland_quit()
%23 = call i32 (...) @voland_quit()
%24 = call i32 (...) @xtimed_quit()
%25 = load i32, i32* %6
ret i32 %25
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 (...) @xtimed_init()
%5 = icmp eq i32 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %2
%7 = tail call i32 (...) @voland_init()
%8 = icmp eq i32 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %6
%10 = tail call i32 (...) @ta_voland_init()
%11 = icmp eq i32 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %9
%13 = tail call i32 (...) @mainloop_run()
br label %14
14: ; preds = %9, %6, %2, %12
%15 = phi i32 [ %13, %12 ], [ %3, %9 ], [ %3, %6 ], [ %3, %2 ]
%16 = tail call i32 (...) @ta_voland_quit()
%17 = tail call i32 (...) @voland_quit()
%18 = tail call i32 (...) @xtimed_quit()
ret i32 %15
}