#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);
scalar_t__ 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;
  if (log_open())
    return 1;
  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    1202 <main_configure+0xa2>
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    1202 <main_configure+0xa2>
mov    $0x1,%edi
call   1030 <drop_privileges@plt>
cmp    $0x0,%rax
je     11de <main_configure+0x7e>
movl   $0x1,-0x4(%rbp)
jmp    1202 <main_configure+0xa2>
mov    $0x0,%al
call   1040 <log_open@plt>
cmp    $0x0,%rax
je     11fb <main_configure+0x9b>
movl   $0x1,-0x4(%rbp)
jmp    1202 <main_configure+0xa2>
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    11ad <main_configure+0x4d>
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    11ad <main_configure+0x4d>
mov    $0x1,%ebx
mov    $0x1,%edi
call   1030 <drop_privileges@plt>
test   %rax,%rax
jne    11ad <main_configure+0x4d>
xor    %eax,%eax
call   1040 <log_open@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
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 %26
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 %26
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 %26
21: ; preds = %17
%22 = call i64 (...) @log_open()
%23 = icmp ne i64 %22, 0
br i1 %23, label %24, label %25
24: ; preds = %21
store i32 1, i32* %3
br label %26
25: ; preds = %21
store i32 0, i32* %3
br label %26
26: ; preds = %25, %24, %20, %16, %10
%27 = load i32, i32* %3
ret i32 %27
}

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 %17
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 %17
10: ; preds = %5
%11 = tail call i64 @drop_privileges(i32 1)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %10
%14 = tail call i64 (...) @log_open()
%15 = icmp ne i64 %14, 0
%16 = zext i1 %15 to i32
br label %17
17: ; preds = %13, %10, %5, %2
%18 = phi i32 [ 1, %2 ], [ 1, %5 ], [ 1, %10 ], [ %16, %13 ]
ret i32 %18
}