#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__ bind_ports();
scalar_t__ drop_privileges(int);
int /*<<< orphan*/ log_open();
scalar_t__ parse_commandline(char *, char *);
int /*<<< orphan*/ str_canary_init();
int /*<<< orphan*/ syslog_open();
int main_configure(char *arg1, char *arg2) {
  if (parse_commandline(arg1, arg2))
    return 1;
  str_canary_init();
  syslog_open();
  if (bind_ports())
    return 1;
  if (drop_privileges(1))
    return 1;
  log_open();
  return 0;
}


x86 assembly (clang, -O0):
<main_configure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1070 <parse_commandline@plt>
cmp    $0x0,%rax
je     1193 <main_configure+0x33>
movl   $0x1,-0x4(%rbp)
jmp    11ec <main_configure+0x8c>
mov    $0x0,%al
call   1050 <str_canary_init@plt>
mov    $0x0,%al
call   1060 <syslog_open@plt>
mov    $0x0,%al
call   1080 <bind_ports@plt>
cmp    $0x0,%rax
je     11be <main_configure+0x5e>
movl   $0x1,-0x4(%rbp)
jmp    11ec <main_configure+0x8c>
mov    $0x1,%edi
call   1030 <drop_privileges@plt>
cmp    $0x0,%rax
je     11de <main_configure+0x7e>
movl   $0x1,-0x4(%rbp)
jmp    11ec <main_configure+0x8c>
mov    $0x0,%al
call   1040 <log_open@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main_configure>:
push   %rbx
call   1070 <parse_commandline@plt>
mov    $0x1,%ebx
test   %rax,%rax
jne    11a7 <main_configure+0x47>
xor    %eax,%eax
call   1050 <str_canary_init@plt>
xor    %eax,%eax
call   1060 <syslog_open@plt>
xor    %eax,%eax
call   1080 <bind_ports@plt>
test   %rax,%rax
jne    11a7 <main_configure+0x47>
mov    $0x1,%ebx
mov    $0x1,%edi
call   1030 <drop_privileges@plt>
test   %rax,%rax
jne    11a7 <main_configure+0x47>
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <log_open@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main_configure(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = load i8*, i8** %5
%8 = call i64 @parse_commandline(i8* %6, i8* %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 1, i32* %3
br label %23
11: ; preds = %2
%12 = call i32 (...) @str_canary_init()
%13 = call i32 (...) @syslog_open()
%14 = call i64 (...) @bind_ports()
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %11
store i32 1, i32* %3
br label %23
17: ; preds = %11
%18 = call i64 @drop_privileges(i32 1)
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %17
store i32 1, i32* %3
br label %23
21: ; preds = %17
%22 = call i32 (...) @log_open()
store i32 0, i32* %3
br label %23
23: ; preds = %21, %20, %16, %10
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @main_configure(i8* %0, i8* %1) {
%3 = tail call i64 @parse_commandline(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %15
5: ; preds = %2
%6 = tail call i32 (...) @str_canary_init()
%7 = tail call i32 (...) @syslog_open()
%8 = tail call i64 (...) @bind_ports()
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %5
%11 = tail call i64 @drop_privileges(i32 1)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = tail call i32 (...) @log_open()
br label %15
15: ; preds = %10, %5, %2, %13
%16 = phi i32 [ 0, %13 ], [ 1, %2 ], [ 1, %5 ], [ 1, %10 ]
ret i32 %16
}