#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 do_choice(char *, char **, int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ load_cmd(char *);
void death() {
  char *choices[2] = {"Load a game", "Exit jorg"};
  int choice =
      do_choice("You are dead, what are your last words ?", choices, 2);
  if (choice == 0) {
    load_cmd("");
  } else {
    exit(0);
  }
}


x86 assembly (clang, -O0):
<death>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2cd1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0x2cce(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    -0x10(%rbp),%rsi
lea    0xebd(%rip),%rdi
mov    $0x2,%edx
call   1030 <do_choice@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1181 <death+0x51>
lea    0xec7(%rip),%rdi
call   1040 <load_cmd@plt>
jmp    1188 <death+0x58>
xor    %edi,%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<death>:
sub    $0x18,%rsp
movaps 0x2cd5(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xed0(%rip),%rdi
mov    %rsp,%rsi
mov    $0x2,%edx
call   1030 <do_choice@plt>
test   %eax,%eax
jne    1168 <death+0x38>
lea    0xee0(%rip),%rdi
call   1040 <load_cmd@plt>
add    $0x18,%rsp
ret
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Load a game\00"
@.str.1 = [10 x i8] c"Exit jorg\00"
@__const.death.choices = [2 x i8*] [i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i32 0, i32 0)]
@.str.2 = [41 x i8] c"You are dead, what are your last words ?\00"
@.str.3 = [1 x i8] zeroinitializer
define void @death() {
%1 = alloca [2 x i8*]
%2 = alloca i32
%3 = bitcast [2 x i8*]* %1 to i8*
%4 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
%5 = call i32 @do_choice(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0), i8** %4, i32 2)
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @load_cmd(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
br label %12
10: ; preds = %0
%11 = call i32 @exit(i32 0)
unreachable
12: ; preds = %8
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"Load a game\00"
@.str.1 = [10 x i8] c"Exit jorg\00"
@__const.death.choices = [2 x i8*] [i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i32 0, i32 0)]
@.str.2 = [41 x i8] c"You are dead, what are your last words ?\00"
@.str.3 = [1 x i8] zeroinitializer
define void @death() {
%1 = alloca [2 x i8*]
%2 = bitcast [2 x i8*]* %1 to i8*
%3 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
%4 = call i32 @do_choice(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0), i8** %3, i32 2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @load_cmd(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
ret void
8: ; preds = %0
%9 = call i32 @exit(i32 0)
unreachable
}