#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*/ finalize();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ parse_args(int, char **);
int /*<<< orphan*/ stderr;
int yyparse();
int main(int argc, char **argv) {
  int retval;
  parse_args(argc, argv);
  retval = yyparse();
  switch (retval) {
  case 0:
    break;
  case 1:
    fprintf(stderr, "yyparse returned syntax error\n");
    break;
  case 2:
    fprintf(stderr, "yyparse returned out of memory error\n");
    break;
  default:
    fprintf(stderr, "yyparse returned unknown error\n");
    break;
  }
  finalize();
  return retval;
}


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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <parse_args@plt>
xor    %eax,%eax
call   1030 <yyparse@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
test   %eax,%eax
je     11a1 <main+0x61>
jmp    117f <main+0x3f>
mov    -0x18(%rbp),%eax
sub    $0x1,%eax
je     11a6 <main+0x66>
jmp    1190 <main+0x50>
mov    -0x18(%rbp),%eax
sub    $0x2,%eax
je     11c0 <main+0x80>
jmp    11da <main+0x9a>
jmp    11ef <main+0xaf>
mov    0x2e33(%rip),%rax
mov    (%rax),%edi
lea    0xe4a(%rip),%rsi
call   1060 <fprintf@plt>
jmp    11ef <main+0xaf>
mov    0x2e19(%rip),%rax
mov    (%rax),%edi
lea    0xe4f(%rip),%rsi
call   1060 <fprintf@plt>
jmp    11ef <main+0xaf>
mov    0x2dff(%rip),%rax
mov    (%rax),%edi
lea    0xe5b(%rip),%rsi
call   1060 <fprintf@plt>
mov    $0x0,%al
call   1040 <finalize@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
call   1050 <parse_args@plt>
xor    %eax,%eax
call   1030 <yyparse@plt>
mov    %eax,%ebx
test   %eax,%eax
je     1184 <main+0x44>
cmp    $0x1,%ebx
je     1166 <main+0x26>
cmp    $0x2,%ebx
jne    116f <main+0x2f>
lea    0xebb(%rip),%rsi
jmp    1176 <main+0x36>
lea    0xe93(%rip),%rsi
jmp    1176 <main+0x36>
lea    0xecf(%rip),%rsi
mov    0x2e63(%rip),%rax
mov    (%rax),%edi
call   1060 <fprintf@plt>
xor    %eax,%eax
call   1040 <finalize@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"yyparse returned syntax error\0A\00"
@.str.1 = [38 x i8] c"yyparse returned out of memory error\0A\00"
@.str.2 = [32 x i8] c"yyparse returned unknown error\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = call i32 @parse_args(i32 %7, i8** %8)
%10 = call i32 (...) @yyparse()
store i32 %10, i32* %6
%11 = load i32, i32* %6
switch i32 %11, label %19 [
i32 0, label %12
i32 1, label %13
i32 2, label %16
]
12: ; preds = %2
br label %22
13: ; preds = %2
%14 = load i32, i32* @stderr
%15 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %22
16: ; preds = %2
%17 = load i32, i32* @stderr
%18 = call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
br label %22
19: ; preds = %2
%20 = load i32, i32* @stderr
%21 = call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
br label %22
22: ; preds = %19, %16, %13, %12
%23 = call i32 (...) @finalize()
%24 = load i32, i32* %6
ret i32 %24
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"yyparse returned syntax error\0A\00"
@.str.1 = [38 x i8] c"yyparse returned out of memory error\0A\00"
@.str.2 = [32 x i8] c"yyparse returned unknown error\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @parse_args(i32 %0, i8** %1)
%4 = tail call i32 (...) @yyparse()
switch i32 %4, label %6 [
i32 0, label %11
i32 1, label %7
i32 2, label %5
]
5: ; preds = %2
br label %7
6: ; preds = %2
br label %7
7: ; preds = %2, %5, %6
%8 = phi i8* [ getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), %6 ], [ getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), %5 ], [ getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), %2 ]
%9 = load i32, i32* @stderr
%10 = tail call i32 @fprintf(i32 %9, i8* %8)
br label %11
11: ; preds = %7, %2
%12 = tail call i32 (...) @finalize()
ret i32 %4
}