#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*/ act_remove_gems(int);
int /*<<< orphan*/ act_sit_throne(int);
int /*<<< orphan*/ ignore();
int /*<<< orphan*/ iopts();
int /*<<< orphan*/ lprcat(char *);
int ttgetch();
void othrone(int arg) {
  lprcat("\nDo you (p) pry off jewels, (s) sit down");
  iopts();
  while (1) {
    while (1)
      switch (ttgetch()) {
      case 'p':
        lprcat(" pry off");
        act_remove_gems(arg);
        return;
      case 's':
        lprcat(" sit down");
        act_sit_throne(arg);
        return;
      case 'i':
      case '\33':
        ignore();
        return;
      };
  }
}


x86 assembly (clang, -O0):
<othrone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xe8e(%rip),%rdi
call   1060 <lprcat@plt>
mov    $0x0,%al
call   1050 <iopts@plt>
jmp    1183 <othrone+0x23>
xor    %eax,%eax
call   1070 <ttgetch@plt>
mov    %eax,%ecx
mov    %ecx,-0x8(%rbp)
sub    $0x1b,%eax
je     1202 <othrone+0xa2>
jmp    119d <othrone+0x3d>
mov    -0x8(%rbp),%eax
sub    $0x69,%eax
je     1202 <othrone+0xa2>
jmp    11ae <othrone+0x4e>
mov    -0x8(%rbp),%eax
sub    $0x70,%eax
je     11d0 <othrone+0x70>
jmp    11bf <othrone+0x5f>
mov    -0x8(%rbp),%eax
sub    $0x73,%eax
je     11e9 <othrone+0x89>
jmp    120e <othrone+0xae>
lea    0xe52(%rip),%rdi
call   1060 <lprcat@plt>
mov    -0x4(%rbp),%edi
call   1080 <act_remove_gems@plt>
jmp    1213 <othrone+0xb3>
lea    0xe2f(%rip),%rdi
call   1060 <lprcat@plt>
mov    -0x4(%rbp),%edi
call   1040 <act_sit_throne@plt>
jmp    1213 <othrone+0xb3>
mov    $0x0,%al
call   1030 <ignore@plt>
jmp    1213 <othrone+0xb3>
jmp    1183 <othrone+0x23>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<othrone>:
push   %rbx
mov    %edi,%ebx
lea    0xe96(%rip),%rdi
call   1060 <lprcat@plt>
xor    %eax,%eax
call   1050 <iopts@plt>
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1070 <ttgetch@plt>
cmp    $0x6f,%eax
jg     11a0 <othrone+0x40>
cmp    $0x1b,%eax
je     11be <othrone+0x5e>
cmp    $0x69,%eax
jne    1180 <othrone+0x20>
jmp    11be <othrone+0x5e>
nopl   0x0(%rax,%rax,1)
cmp    $0x73,%eax
je     11c6 <othrone+0x66>
cmp    $0x70,%eax
jne    1180 <othrone+0x20>
lea    0xe78(%rip),%rdi
call   1060 <lprcat@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1080 <act_remove_gems@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <ignore@plt>
lea    0xe52(%rip),%rdi
call   1060 <lprcat@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <act_sit_throne@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"\0ADo you (p) pry off jewels, (s) sit down\00"
@.str.1 = [9 x i8] c" pry off\00"
@.str.2 = [10 x i8] c" sit down\00"
define void @othrone(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @lprcat(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @iopts()
br label %5
5: ; preds = %1
br label %6
6: ; preds = %5, %18
%7 = call i32 (...) @ttgetch()
switch i32 %7, label %18 [
i32 112, label %8
i32 115, label %12
i32 105, label %16
i32 27, label %16
]
8: ; preds = %6
%9 = call i32 @lprcat(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32, i32* %2
%11 = call i32 @act_remove_gems(i32 %10)
br label %19
12: ; preds = %6
%13 = call i32 @lprcat(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%14 = load i32, i32* %2
%15 = call i32 @act_sit_throne(i32 %14)
br label %19
16: ; preds = %6, %6
%17 = call i32 (...) @ignore()
br label %19
18: ; preds = %6
br label %6
19: ; preds = %16, %12, %8
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"\0ADo you (p) pry off jewels, (s) sit down\00"
@.str.1 = [9 x i8] c" pry off\00"
@.str.2 = [10 x i8] c" sit down\00"
define void @othrone(i32 %0) {
%2 = tail call i32 @lprcat(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @iopts()
br label %4
4: ; preds = %4, %1
%5 = tail call i32 (...) @ttgetch()
switch i32 %5, label %4 [
i32 112, label %6
i32 115, label %9
i32 105, label %12
i32 27, label %12
]
6: ; preds = %4
%7 = tail call i32 @lprcat(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 @act_remove_gems(i32 %0)
br label %14
9: ; preds = %4
%10 = tail call i32 @lprcat(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%11 = tail call i32 @act_sit_throne(i32 %0)
br label %14
12: ; preds = %4, %4
%13 = tail call i32 (...) @ignore()
br label %14
14: ; preds = %12, %9, %6
ret void
}