#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 */
scalar_t__ cloudvpn_event_init();
scalar_t__ cloudvpn_init_plugins();
scalar_t__ cloudvpn_init_pool();
scalar_t__ cloudvpn_scheduler_init();
int cloudvpn_core_init() {
  if (cloudvpn_event_init())
    return 1;
  if (cloudvpn_scheduler_init())
    return 2;
  if (cloudvpn_init_plugins())
    return 3;
  if (cloudvpn_init_pool())
    return 4;
  return 0;
}


x86 assembly (clang, -O0):
<cloudvpn_core_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <cloudvpn_event_init@plt>
cmp    $0x0,%rax
je     1165 <cloudvpn_core_init+0x25>
movl   $0x1,-0x4(%rbp)
jmp    11c3 <cloudvpn_core_init+0x83>
mov    $0x0,%al
call   1040 <cloudvpn_scheduler_init@plt>
cmp    $0x0,%rax
je     1182 <cloudvpn_core_init+0x42>
movl   $0x2,-0x4(%rbp)
jmp    11c3 <cloudvpn_core_init+0x83>
mov    $0x0,%al
call   1060 <cloudvpn_init_plugins@plt>
cmp    $0x0,%rax
je     119f <cloudvpn_core_init+0x5f>
movl   $0x3,-0x4(%rbp)
jmp    11c3 <cloudvpn_core_init+0x83>
mov    $0x0,%al
call   1050 <cloudvpn_init_pool@plt>
cmp    $0x0,%rax
je     11bc <cloudvpn_core_init+0x7c>
movl   $0x4,-0x4(%rbp)
jmp    11c3 <cloudvpn_core_init+0x83>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cloudvpn_core_init>:
push   %rax
xor    %eax,%eax
call   1030 <cloudvpn_event_init@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1157 <cloudvpn_core_init+0x17>
pop    %rcx
ret
xor    %eax,%eax
call   1040 <cloudvpn_scheduler_init@plt>
mov    %rax,%rcx
mov    $0x2,%eax
test   %rcx,%rcx
jne    1155 <cloudvpn_core_init+0x15>
xor    %eax,%eax
call   1060 <cloudvpn_init_plugins@plt>
mov    %rax,%rcx
mov    $0x3,%eax
test   %rcx,%rcx
jne    1155 <cloudvpn_core_init+0x15>
xor    %eax,%eax
call   1050 <cloudvpn_init_pool@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
shl    $0x2,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @cloudvpn_core_init() {
%1 = alloca i32
%2 = call i64 (...) @cloudvpn_event_init()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 1, i32* %1
br label %18
5: ; preds = %0
%6 = call i64 (...) @cloudvpn_scheduler_init()
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %5
store i32 2, i32* %1
br label %18
9: ; preds = %5
%10 = call i64 (...) @cloudvpn_init_plugins()
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %9
store i32 3, i32* %1
br label %18
13: ; preds = %9
%14 = call i64 (...) @cloudvpn_init_pool()
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %13
store i32 4, i32* %1
br label %18
17: ; preds = %13
store i32 0, i32* %1
br label %18
18: ; preds = %17, %16, %12, %8, %4
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
define i32 @cloudvpn_core_init() {
%1 = tail call i64 (...) @cloudvpn_event_init()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %13
3: ; preds = %0
%4 = tail call i64 (...) @cloudvpn_scheduler_init()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = tail call i64 (...) @cloudvpn_init_plugins()
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = tail call i64 (...) @cloudvpn_init_pool()
%11 = icmp eq i64 %10, 0
%12 = select i1 %11, i32 0, i32 4
br label %13
13: ; preds = %9, %6, %3, %0
%14 = phi i32 [ 1, %0 ], [ 2, %3 ], [ 3, %6 ], [ %12, %9 ]
ret i32 %14
}