#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*/ SIGPIPE;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ get_host_ip();
int /*<<< orphan*/ http_log(char *);
scalar_t__ http_server();
int /*<<< orphan*/ parse_config(int, char **);
int /*<<< orphan*/ putenv(char *);
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
int main(int argc, char **argv) {
  putenv("http_proxy=");
  parse_config(argc, argv);
  signal(SIGPIPE, SIG_IGN);
  get_host_ip();
  if (http_server() < 0) {
    http_log("Could not start server\n");
    exit(1);
  }
  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)
lea    0xe73(%rip),%rdi
call   1040 <putenv@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1070 <parse_config@plt>
mov    0x2e33(%rip),%rax
mov    (%rax),%edi
mov    0x2e3a(%rip),%rax
mov    (%rax),%esi
call   1050 <signal@plt>
mov    $0x0,%al
call   1080 <get_host_ip@plt>
mov    $0x0,%al
call   1060 <http_server@plt>
cmp    $0x0,%rax
jge    11e3 <main+0x73>
lea    0xe38(%rip),%rdi
call   1030 <http_log@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xe81(%rip),%rdi
call   1040 <putenv@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1070 <parse_config@plt>
mov    0x2e43(%rip),%rax
mov    (%rax),%edi
mov    0x2e4a(%rip),%rax
mov    (%rax),%esi
call   1050 <signal@plt>
xor    %eax,%eax
call   1080 <get_host_ip@plt>
xor    %eax,%eax
call   1060 <http_server@plt>
test   %rax,%rax
js     11c1 <main+0x51>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xe44(%rip),%rdi
call   1030 <http_log@plt>
mov    $0x1,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"http_proxy=\00"
@SIGPIPE = global i32 0
@SIG_IGN = global i32 0
@.str.1 = [24 x i8] c"Could not start server\0A\00"
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 = call i32 @putenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = call i32 @parse_config(i32 %7, i8** %8)
%10 = load i32, i32* @SIGPIPE
%11 = load i32, i32* @SIG_IGN
%12 = call i32 @signal(i32 %10, i32 %11)
%13 = call i32 (...) @get_host_ip()
%14 = call i64 (...) @http_server()
%15 = icmp slt i64 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %2
%17 = call i32 @http_log(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%18 = call i32 @exit(i32 1)
unreachable
19: ; preds = %2
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"http_proxy=\00"
@SIGPIPE = global i32 0
@SIG_IGN = global i32 0
@.str.1 = [24 x i8] c"Could not start server\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @putenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @parse_config(i32 %0, i8** %1)
%5 = load i32, i32* @SIGPIPE
%6 = load i32, i32* @SIG_IGN
%7 = tail call i32 @signal(i32 %5, i32 %6)
%8 = tail call i32 (...) @get_host_ip()
%9 = tail call i64 (...) @http_server()
%10 = icmp slt i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = tail call i32 @http_log(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%13 = tail call i32 @exit(i32 1)
unreachable
14: ; preds = %2
ret i32 0
}