#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 */
struct entry {
  int dummy;
};

/* Variables and functions */
struct entry *config_parse(char *);
int menu_display(struct entry *);
int /*<<< orphan*/ putc(char, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int main(int argc, char **argv) {
  struct entry *mp;
  int res;
  if (argc != 2)
    return 1;
  mp = config_parse(*++argv);
  if (!mp)
    return 1;
  res = menu_display(mp);
  putc('\n', stdout);
  return res;
}


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)
cmpl   $0x2,-0x8(%rbp)
je     115c <main+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    11b4 <main+0x84>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rdi
call   1050 <config_parse@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    118f <main+0x5f>
movl   $0x1,-0x4(%rbp)
jmp    11b4 <main+0x84>
mov    -0x18(%rbp),%rdi
call   1040 <menu_display@plt>
mov    %eax,-0x1c(%rbp)
mov    0x2e3e(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1030 <putc@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x2,%edi
jne    1165 <main+0x35>
mov    0x8(%rsi),%rdi
call   1050 <config_parse@plt>
test   %rax,%rax
je     1165 <main+0x35>
mov    %rax,%rdi
call   1040 <menu_display@plt>
mov    %eax,%ebx
mov    0x2e8b(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1030 <putc@plt>
mov    %ebx,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.entry = type { i32 }
@stdout = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.entry*
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 2
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 1, i32* %3
br label %25
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i32 1
store i8** %13, i8*** %5
%14 = load i8*, i8** %13
%15 = call %struct.entry* @config_parse(i8* %14)
store %struct.entry* %15, %struct.entry** %6
%16 = load %struct.entry*, %struct.entry** %6
%17 = icmp ne %struct.entry* %16, null
br i1 %17, label %19, label %18
18: ; preds = %11
store i32 1, i32* %3
br label %25
19: ; preds = %11
%20 = load %struct.entry*, %struct.entry** %6
%21 = call i32 @menu_display(%struct.entry* %20)
store i32 %21, i32* %7
%22 = load i32, i32* @stdout
%23 = call i32 @putc(i8 signext 10, i32 %22)
%24 = load i32, i32* %7
store i32 %24, i32* %3
br label %25
25: ; preds = %19, %18, %10
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
%struct.entry = type { i32 }
@stdout = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call %struct.entry* @config_parse(i8* %6)
%8 = icmp eq %struct.entry* %7, null
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = tail call i32 @menu_display(%struct.entry* %7)
%11 = load i32, i32* @stdout
%12 = tail call i32 @putc(i8 signext 10, i32 %11)
br label %13
13: ; preds = %4, %2, %9
%14 = phi i32 [ %10, %9 ], [ 1, %2 ], [ 1, %4 ]
ret i32 %14
}