#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*/ log_clearup();
int log_initialize_console(int);
int log_initialize_file(int, char *, char *, int, int, int);
int log_start();
int log_initialize_default(int con_lvl, int file_lvl, char *file_path,
                           char *prefix, int buf_size, int sw_time,
                           int sw_size) {
  log_clearup();
  if (log_initialize_console(con_lvl) == -1) {
    return -1;
  }
  if (log_initialize_file(file_lvl, file_path, prefix, buf_size, sw_time,
                          sw_size) == -1) {
    return -1;
  }
  return log_start();
}


x86 assembly (clang, -O0):
<log_initialize_default>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%eax
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
mov    $0x0,%al
call   1030 <log_clearup@plt>
mov    -0x8(%rbp),%edi
call   1060 <log_initialize_console@plt>
cmp    $0xffffffff,%eax
jne    1185 <log_initialize_default+0x45>
movl   $0xffffffff,-0x4(%rbp)
jmp    11bf <log_initialize_default+0x7f>
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    -0x28(%rbp),%r8d
mov    0x10(%rbp),%r9d
call   1040 <log_initialize_file@plt>
cmp    $0xffffffff,%eax
jne    11b5 <log_initialize_default+0x75>
movl   $0xffffffff,-0x4(%rbp)
jmp    11bf <log_initialize_default+0x7f>
mov    $0x0,%al
call   1050 <log_start@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_initialize_default>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9d,0x4(%rsp)
mov    %r8d,%r15d
mov    %rcx,%r12
mov    %rdx,%rbx
mov    %esi,%ebp
mov    %edi,%r14d
mov    0x40(%rsp),%r13d
xor    %eax,%eax
call   1030 <log_clearup@plt>
mov    %r14d,%edi
call   1060 <log_initialize_console@plt>
cmp    $0xffffffff,%eax
je     11a9 <log_initialize_default+0x69>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r12,%rdx
mov    %r15d,%ecx
mov    0x4(%rsp),%r8d
mov    %r13d,%r9d
call   1040 <log_initialize_file@plt>
cmp    $0xffffffff,%eax
je     11a9 <log_initialize_default+0x69>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <log_start@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @log_initialize_default(i32 %0, i32 %1, i8* %2, i8* %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
store i32 %0, i32* %9
store i32 %1, i32* %10
store i8* %2, i8** %11
store i8* %3, i8** %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store i32 %6, i32* %15
%16 = call i32 (...) @log_clearup()
%17 = load i32, i32* %9
%18 = call i32 @log_initialize_console(i32 %17)
%19 = icmp eq i32 %18, -1
br i1 %19, label %20, label %21
20: ; preds = %7
store i32 -1, i32* %8
br label %33
21: ; preds = %7
%22 = load i32, i32* %10
%23 = load i8*, i8** %11
%24 = load i8*, i8** %12
%25 = load i32, i32* %13
%26 = load i32, i32* %14
%27 = load i32, i32* %15
%28 = call i32 @log_initialize_file(i32 %22, i8* %23, i8* %24, i32 %25, i32 %26, i32 %27)
%29 = icmp eq i32 %28, -1
br i1 %29, label %30, label %31
30: ; preds = %21
store i32 -1, i32* %8
br label %33
31: ; preds = %21
%32 = call i32 (...) @log_start()
store i32 %32, i32* %8
br label %33
33: ; preds = %31, %30, %20
%34 = load i32, i32* %8
ret i32 %34
}

LLVM IR (-O2):
define i32 @log_initialize_default(i32 %0, i32 %1, i8* %2, i8* %3, i32 %4, i32 %5, i32 %6) {
%8 = tail call i32 (...) @log_clearup()
%9 = tail call i32 @log_initialize_console(i32 %0)
%10 = icmp eq i32 %9, -1
br i1 %10, label %16, label %11
11: ; preds = %7
%12 = tail call i32 @log_initialize_file(i32 %1, i8* %2, i8* %3, i32 %4, i32 %5, i32 %6)
%13 = icmp eq i32 %12, -1
br i1 %13, label %16, label %14
14: ; preds = %11
%15 = tail call i32 (...) @log_start()
br label %16
16: ; preds = %11, %7, %14
%17 = phi i32 [ %15, %14 ], [ -1, %7 ], [ -1, %11 ]
ret i32 %17
}