#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*/ SIGCHLD;
int /*<<< orphan*/ SIGPIPE;
int /*<<< orphan*/ SIG_IGN;
scalar_t__ cmdline_isInetdMode();
scalar_t__ cmdline_parse(int, char **);
int /*<<< orphan*/ config_parse();
int /*<<< orphan*/ mainloop();
int /*<<< orphan*/ mainloop_inetd();
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  if (cmdline_parse(argc, argv)) {
    signal(SIGPIPE, SIG_IGN);
    signal(SIGCHLD, SIG_IGN);
    config_parse();
    if (cmdline_isInetdMode())
      mainloop_inetd();
    else
      mainloop();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <cmdline_parse@plt>
cmp    $0x0,%rax
je     11ea <main+0x8a>
mov    0x2e3d(%rip),%rax
mov    (%rax),%edi
mov    0x2e44(%rip),%rax
mov    (%rax),%esi
call   1060 <signal@plt>
mov    0x2e3e(%rip),%rax
mov    (%rax),%edi
mov    0x2e2d(%rip),%rax
mov    (%rax),%esi
call   1060 <signal@plt>
mov    $0x0,%al
call   1070 <config_parse@plt>
mov    $0x0,%al
call   1050 <cmdline_isInetdMode@plt>
cmp    $0x0,%rax
je     11de <main+0x7e>
mov    $0x0,%al
call   1040 <mainloop_inetd@plt>
jmp    11e5 <main+0x85>
mov    $0x0,%al
call   1080 <mainloop@plt>
jmp    11ea <main+0x8a>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
call   1030 <cmdline_parse@plt>
test   %rax,%rax
je     11b5 <main+0x55>
mov    0x2e5e(%rip),%rax
mov    (%rax),%edi
mov    0x2e65(%rip),%rbx
mov    (%rbx),%esi
call   1060 <signal@plt>
mov    0x2e5f(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%esi
call   1060 <signal@plt>
xor    %eax,%eax
call   1070 <config_parse@plt>
xor    %eax,%eax
call   1050 <cmdline_isInetdMode@plt>
test   %rax,%rax
je     11ae <main+0x4e>
xor    %eax,%eax
call   1040 <mainloop_inetd@plt>
jmp    11b5 <main+0x55>
xor    %eax,%eax
call   1080 <mainloop@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@SIGPIPE = global i32 0
@SIG_IGN = global i32 0
@SIGCHLD = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i64 @cmdline_parse(i32 %6, i8** %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %25
10: ; preds = %2
%11 = load i32, i32* @SIGPIPE
%12 = load i32, i32* @SIG_IGN
%13 = call i32 @signal(i32 %11, i32 %12)
%14 = load i32, i32* @SIGCHLD
%15 = load i32, i32* @SIG_IGN
%16 = call i32 @signal(i32 %14, i32 %15)
%17 = call i32 (...) @config_parse()
%18 = call i64 (...) @cmdline_isInetdMode()
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %10
%21 = call i32 (...) @mainloop_inetd()
br label %24
22: ; preds = %10
%23 = call i32 (...) @mainloop()
br label %24
24: ; preds = %22, %20
br label %25
25: ; preds = %24, %2
ret i32 0
}

LLVM IR (-O2):
@SIGPIPE = global i32 0
@SIG_IGN = global i32 0
@SIGCHLD = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i64 @cmdline_parse(i32 %0, i8** %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %19, label %5
5: ; preds = %2
%6 = load i32, i32* @SIGPIPE
%7 = load i32, i32* @SIG_IGN
%8 = tail call i32 @signal(i32 %6, i32 %7)
%9 = load i32, i32* @SIGCHLD
%10 = load i32, i32* @SIG_IGN
%11 = tail call i32 @signal(i32 %9, i32 %10)
%12 = tail call i32 (...) @config_parse()
%13 = tail call i64 (...) @cmdline_isInetdMode()
%14 = icmp eq i64 %13, 0
br i1 %14, label %17, label %15
15: ; preds = %5
%16 = tail call i32 (...) @mainloop_inetd()
br label %19
17: ; preds = %5
%18 = tail call i32 (...) @mainloop()
br label %19
19: ; preds = %15, %17, %2
ret i32 0
}