#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 inner();
int process_parameters(int, char const **);
scalar_t__ set_signals();
int main(int argc, const char *argv[]) {
  int r;
  r = process_parameters(argc, argv);
  if (r == 1)
    return 0;
  if (r < 0)
    return 1;
  if (set_signals())
    return 1;
  switch (inner()) {
  case 0:
    return 0;
  case 1:
    return 1;
  case 2:
    return 3;
  case 3:
    return 2;
  case 4:
    return 4;
  default:
    break;
  }
  return 5;
}


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   1040 <process_parameters@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    116b <main+0x3b>
movl   $0x0,-0x4(%rbp)
jmp    1210 <main+0xe0>
cmpl   $0x0,-0x14(%rbp)
jge    1181 <main+0x51>
movl   $0x1,-0x4(%rbp)
jmp    1210 <main+0xe0>
mov    $0x0,%al
call   1050 <set_signals@plt>
cmp    $0x0,%rax
je     119e <main+0x6e>
movl   $0x1,-0x4(%rbp)
jmp    1210 <main+0xe0>
xor    %eax,%eax
call   1030 <inner@plt>
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0x4,%eax
ja     1204 <main+0xd4>
mov    -0x20(%rbp),%rax
lea    0xe41(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x4(%rbp)
jmp    1210 <main+0xe0>
movl   $0x1,-0x4(%rbp)
jmp    1210 <main+0xe0>
movl   $0x3,-0x4(%rbp)
jmp    1210 <main+0xe0>
movl   $0x2,-0x4(%rbp)
jmp    1210 <main+0xe0>
movl   $0x4,-0x4(%rbp)
jmp    1210 <main+0xe0>
jmp    1209 <main+0xd9>
movl   $0x5,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
call   1040 <process_parameters@plt>
xor    %ebx,%ebx
cmp    $0x1,%eax
je     116f <main+0x3f>
mov    $0x1,%ebx
test   %eax,%eax
js     116f <main+0x3f>
xor    %eax,%eax
call   1050 <set_signals@plt>
test   %rax,%rax
jne    116f <main+0x3f>
xor    %eax,%eax
call   1030 <inner@plt>
mov    $0x5,%ebx
cmp    $0x4,%eax
ja     116f <main+0x3f>
cltq
lea    0xe94(%rip),%rcx
mov    (%rcx,%rax,4),%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
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 @process_parameters(i32 %7, i8** %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 0, i32* %3
br label %30
13: ; preds = %2
%14 = load i32, i32* %6
%15 = icmp slt i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %13
store i32 1, i32* %3
br label %30
17: ; preds = %13
%18 = call i64 (...) @set_signals()
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %17
store i32 1, i32* %3
br label %30
21: ; preds = %17
%22 = call i32 (...) @inner()
switch i32 %22, label %28 [
i32 0, label %23
i32 1, label %24
i32 2, label %25
i32 3, label %26
i32 4, label %27
]
23: ; preds = %21
store i32 0, i32* %3
br label %30
24: ; preds = %21
store i32 1, i32* %3
br label %30
25: ; preds = %21
store i32 3, i32* %3
br label %30
26: ; preds = %21
store i32 2, i32* %3
br label %30
27: ; preds = %21
store i32 4, i32* %3
br label %30
28: ; preds = %21
br label %29
29: ; preds = %28
store i32 5, i32* %3
br label %30
30: ; preds = %29, %27, %26, %25, %24, %23, %20, %16, %12
%31 = load i32, i32* %3
ret i32 %31
}

LLVM IR (-O2):
@switch.table.main = [5 x i32] [i32 0, i32 1, i32 3, i32 2, i32 4]
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @process_parameters(i32 %0, i8** %1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %17, label %5
5: ; preds = %2
%6 = icmp slt i32 %3, 0
br i1 %6, label %17, label %7
7: ; preds = %5
%8 = tail call i64 (...) @set_signals()
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %17
10: ; preds = %7
%11 = tail call i32 (...) @inner()
%12 = icmp ult i32 %11, 5
br i1 %12, label %13, label %17
13: ; preds = %10
%14 = sext i32 %11 to i64
%15 = getelementptr inbounds [5 x i32], [5 x i32]* @switch.table.main, i64 0, i64 %14
%16 = load i32, i32* %15
br label %17
17: ; preds = %10, %13, %7, %5, %2
%18 = phi i32 [ 0, %2 ], [ 1, %5 ], [ 1, %7 ], [ %16, %13 ], [ 5, %10 ]
ret i32 %18
}