#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 /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int gc_init(int);
int init_obj();
int /*<<< orphan*/ init_random();
int setup_startup_time();
int /*<<< orphan*/ stderr;
int init(void) {
  int ret;
  ret = gc_init(-1);
  if (ret != 0) {
    fprintf(stderr, "gc system failed to initialize\n");
    return ret;
  }
  ret = init_obj();
  if (ret != 0) {
    return ret;
  }
  ret = setup_startup_time();
  if (ret != 0) {
    return ret;
  }
  init_random();
  return 0;
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xffffffff,%edi
call   1030 <gc_init@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     118f <init+0x3f>
mov    0x2e6a(%rip),%rax
mov    (%rax),%edi
lea    0xe81(%rip),%rsi
call   1060 <fprintf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    11db <init+0x8b>
mov    $0x0,%al
call   1050 <init_obj@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     11ae <init+0x5e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    11db <init+0x8b>
mov    $0x0,%al
call   1070 <setup_startup_time@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     11cd <init+0x7d>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    11db <init+0x8b>
mov    $0x0,%al
call   1040 <init_random@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rbx
mov    $0xffffffff,%edi
call   1030 <gc_init@plt>
test   %eax,%eax
je     1178 <init+0x28>
mov    %eax,%ebx
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
lea    0xe8f(%rip),%rsi
call   1060 <fprintf@plt>
jmp    119b <init+0x4b>
xor    %eax,%eax
call   1050 <init_obj@plt>
mov    %eax,%ebx
test   %eax,%eax
jne    119b <init+0x4b>
xor    %eax,%eax
call   1070 <setup_startup_time@plt>
mov    %eax,%ebx
test   %eax,%eax
jne    119b <init+0x4b>
xor    %eax,%eax
call   1040 <init_random@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"gc system failed to initialize\0A\00"
define i32 @init() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @gc_init(i32 -1)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %2
store i32 %9, i32* %1
br label %24
10: ; preds = %0
%11 = call i32 (...) @init_obj()
store i32 %11, i32* %2
%12 = load i32, i32* %2
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = load i32, i32* %2
store i32 %15, i32* %1
br label %24
16: ; preds = %10
%17 = call i32 (...) @setup_startup_time()
store i32 %17, i32* %2
%18 = load i32, i32* %2
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %16
%21 = load i32, i32* %2
store i32 %21, i32* %1
br label %24
22: ; preds = %16
%23 = call i32 (...) @init_random()
store i32 0, i32* %1
br label %24
24: ; preds = %22, %20, %14, %6
%25 = load i32, i32* %1
ret i32 %25
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"gc system failed to initialize\0A\00"
define i32 @init() {
%1 = tail call i32 @gc_init(i32 -1)
%2 = icmp eq i32 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %14
6: ; preds = %0
%7 = tail call i32 (...) @init_obj()
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %6
%10 = tail call i32 (...) @setup_startup_time()
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = tail call i32 (...) @init_random()
br label %14
14: ; preds = %9, %6, %12, %3
%15 = phi i32 [ %1, %3 ], [ 0, %12 ], [ %7, %6 ], [ %10, %9 ]
ret i32 %15
}