#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 EXIT_FAILURE;
int EXIT_SUCCESS;
int listen(int, int);
int /*<<< orphan*/ show_usage(int);
int /*<<< orphan*/ shutdown();
int startup(char **, int *, int *);
int main(int argc, char **argv) {
  int ret = EXIT_FAILURE, msg_in = 0, msg_out = 0;
  if (argc < 3) {
    msg_in = 0xdead1;
    msg_out = 0xdead2;
  }
  if ((ret = startup(argv, &msg_in, &msg_out)) == EXIT_SUCCESS) {
    ret = listen(msg_in, msg_out);
    shutdown();
    ret = EXIT_SUCCESS;
  } else {
    show_usage(ret);
    ret = EXIT_FAILURE;
  }
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e83(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    1188 <main+0x48>
movl   $0xdead1,-0x18(%rbp)
movl   $0xdead2,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
call   1050 <startup@plt>
mov    %eax,-0x14(%rbp)
mov    0x2e35(%rip),%rcx
cmp    (%rcx),%eax
jne    11d1 <main+0x91>
mov    -0x18(%rbp),%edi
mov    -0x1c(%rbp),%esi
call   1040 <listen@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <shutdown@plt>
mov    0x2e11(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
jmp    11e5 <main+0xa5>
mov    -0x14(%rbp),%edi
call   1060 <show_usage@plt>
mov    0x2e00(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rax
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
cmp    $0x2,%edi
jg     116d <main+0x2d>
movl   $0xdead1,0xc(%rsp)
movl   $0xdead2,0x8(%rsp)
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
mov    %rax,%rdi
call   1050 <startup@plt>
mov    0x2e52(%rip),%rbx
cmp    (%rbx),%eax
jne    11a0 <main+0x60>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
call   1040 <listen@plt>
xor    %eax,%eax
call   1030 <shutdown@plt>
jmp    11ae <main+0x6e>
mov    %eax,%edi
call   1060 <show_usage@plt>
mov    0x2e32(%rip),%rbx
mov    (%rbx),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* @EXIT_FAILURE
store i32 %9, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, 3
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 912081, i32* %7
store i32 912082, i32* %8
br label %13
13: ; preds = %12, %2
%14 = load i8**, i8*** %5
%15 = call i32 @startup(i8** %14, i32* %7, i32* %8)
store i32 %15, i32* %6
%16 = load i32, i32* @EXIT_SUCCESS
%17 = icmp eq i32 %15, %16
br i1 %17, label %18, label %24
18: ; preds = %13
%19 = load i32, i32* %7
%20 = load i32, i32* %8
%21 = call i32 @listen(i32 %19, i32 %20)
store i32 %21, i32* %6
%22 = call i32 (...) @shutdown()
%23 = load i32, i32* @EXIT_SUCCESS
store i32 %23, i32* %6
br label %28
24: ; preds = %13
%25 = load i32, i32* %6
%26 = call i32 @show_usage(i32 %25)
%27 = load i32, i32* @EXIT_FAILURE
store i32 %27, i32* %6
br label %28
28: ; preds = %24, %18
%29 = load i32, i32* %6
ret i32 %29
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%6 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%7 = icmp slt i32 %0, 3
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 912081, i32* %3
store i32 912082, i32* %4
br label %9
9: ; preds = %8, %2
%10 = call i32 @startup(i8** %1, i32* %3, i32* %4)
%11 = load i32, i32* @EXIT_SUCCESS
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %18
13: ; preds = %9
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = call i32 @listen(i32 %14, i32 %15)
%17 = call i32 (...) @shutdown()
br label %20
18: ; preds = %9
%19 = call i32 @show_usage(i32 %10)
br label %20
20: ; preds = %18, %13
%21 = phi i32* [ @EXIT_SUCCESS, %13 ], [ @EXIT_FAILURE, %18 ]
%22 = load i32, i32* %21
ret i32 %22
}