#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_desecrate_altar();
int /*<<< orphan*/ act_donation_pray();
int /*<<< orphan*/ act_ignore_altar();
int /*<<< orphan*/ act_just_pray();
int /*<<< orphan*/ ignore();
int /*<<< orphan*/ iopts();
int /*<<< orphan*/ lprcat(char *);
int ttgetch();
void oaltar(void) {
  lprcat("\nDo you (p) pray  (d) desecrate");
  iopts();
  while (1) {
    while (1)
      switch (ttgetch()) {
      case 'p':
        lprcat(" pray\nDo you (m) give money or (j) just pray? ");
        while (1)
          switch (ttgetch()) {
          case 'j':
            act_just_pray();
            return;
          case 'm':
            act_donation_pray();
            return;
          case '\33':
            return;
          };
      case 'd':
        lprcat(" desecrate");
        act_desecrate_altar();
        return;
      case 'i':
      case '\33':
        ignore();
        act_ignore_altar();
        return;
      };
  }
}


x86 assembly (clang, -O0):
<oaltar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xe71(%rip),%rdi
call   1090 <lprcat@plt>
mov    $0x0,%al
call   1070 <iopts@plt>
jmp    11a0 <oaltar+0x20>
xor    %eax,%eax
call   10a0 <ttgetch@plt>
mov    %eax,%ecx
mov    %ecx,-0x4(%rbp)
sub    $0x1b,%eax
je     126f <oaltar+0xef>
jmp    11ba <oaltar+0x3a>
mov    -0x4(%rbp),%eax
sub    $0x64,%eax
je     1257 <oaltar+0xd7>
jmp    11cb <oaltar+0x4b>
mov    -0x4(%rbp),%eax
sub    $0x69,%eax
je     126f <oaltar+0xef>
jmp    11dc <oaltar+0x5c>
mov    -0x4(%rbp),%eax
sub    $0x70,%eax
jne    1282 <oaltar+0x102>
jmp    11ed <oaltar+0x6d>
lea    0xe2c(%rip),%rdi
call   1090 <lprcat@plt>
xor    %eax,%eax
call   10a0 <ttgetch@plt>
mov    %eax,%ecx
mov    %ecx,-0x8(%rbp)
sub    $0x1b,%eax
je     124d <oaltar+0xcd>
jmp    1213 <oaltar+0x93>
mov    -0x8(%rbp),%eax
sub    $0x6a,%eax
je     1235 <oaltar+0xb5>
jmp    1224 <oaltar+0xa4>
mov    -0x8(%rbp),%eax
sub    $0x6d,%eax
je     1241 <oaltar+0xc1>
jmp    1252 <oaltar+0xd2>
mov    $0x0,%al
call   1060 <act_just_pray@plt>
jmp    1287 <oaltar+0x107>
mov    $0x0,%al
call   1080 <act_donation_pray@plt>
jmp    1287 <oaltar+0x107>
jmp    1287 <oaltar+0x107>
jmp    11f9 <oaltar+0x79>
lea    0xdb7(%rip),%rdi
call   1090 <lprcat@plt>
mov    $0x0,%al
call   1050 <act_desecrate_altar@plt>
jmp    1287 <oaltar+0x107>
mov    $0x0,%al
call   1040 <ignore@plt>
mov    $0x0,%al
call   1030 <act_ignore_altar@plt>
jmp    1287 <oaltar+0x107>
jmp    11a0 <oaltar+0x20>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<oaltar>:
push   %rax
lea    0xe78(%rip),%rdi
call   1090 <lprcat@plt>
xor    %eax,%eax
call   1070 <iopts@plt>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   10a0 <ttgetch@plt>
cmp    $0x68,%eax
jg     11c0 <oaltar+0x40>
cmp    $0x1b,%eax
je     11fe <oaltar+0x7e>
cmp    $0x64,%eax
jne    11a0 <oaltar+0x20>
jmp    120d <oaltar+0x8d>
nopl   0x0(%rax,%rax,1)
cmp    $0x69,%eax
je     11fe <oaltar+0x7e>
cmp    $0x70,%eax
jne    11a0 <oaltar+0x20>
lea    0xe4f(%rip),%rdi
call   1090 <lprcat@plt>
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   10a0 <ttgetch@plt>
cmp    $0x1b,%eax
je     1221 <oaltar+0xa1>
cmp    $0x6d,%eax
je     1223 <oaltar+0xa3>
cmp    $0x6a,%eax
jne    11e0 <oaltar+0x60>
xor    %eax,%eax
pop    %rcx
jmp    1060 <act_just_pray@plt>
xor    %eax,%eax
call   1040 <ignore@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <act_ignore_altar@plt>
lea    0xe01(%rip),%rdi
call   1090 <lprcat@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <act_desecrate_altar@plt>
pop    %rax
ret
xor    %eax,%eax
pop    %rcx
jmp    1080 <act_donation_pray@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"\0ADo you (p) pray (d) desecrate\00"
@.str.1 = [47 x i8] c" pray\0ADo you (m) give money or (j) just pray? \00"
@.str.2 = [11 x i8] c" desecrate\00"
define void @oaltar() {
%1 = call i32 @lprcat(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @iopts()
br label %3
3: ; preds = %0
br label %4
4: ; preds = %3, %22
%5 = call i32 (...) @ttgetch()
switch i32 %5, label %22 [
i32 112, label %6
i32 100, label %16
i32 105, label %19
i32 27, label %19
]
6: ; preds = %4
%7 = call i32 @lprcat(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %15
%9 = call i32 (...) @ttgetch()
switch i32 %9, label %15 [
i32 106, label %10
i32 109, label %12
i32 27, label %14
]
10: ; preds = %8
%11 = call i32 (...) @act_just_pray()
br label %23
12: ; preds = %8
%13 = call i32 (...) @act_donation_pray()
br label %23
14: ; preds = %8
br label %23
15: ; preds = %8
br label %8
16: ; preds = %4
%17 = call i32 @lprcat(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%18 = call i32 (...) @act_desecrate_altar()
br label %23
19: ; preds = %4, %4
%20 = call i32 (...) @ignore()
%21 = call i32 (...) @act_ignore_altar()
br label %23
22: ; preds = %4
br label %4
23: ; preds = %19, %16, %14, %12, %10
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"\0ADo you (p) pray (d) desecrate\00"
@.str.1 = [47 x i8] c" pray\0ADo you (m) give money or (j) just pray? \00"
@.str.2 = [11 x i8] c" desecrate\00"
define void @oaltar() {
%1 = tail call i32 @lprcat(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @iopts()
br label %3
3: ; preds = %3, %0
%4 = tail call i32 (...) @ttgetch()
switch i32 %4, label %3 [
i32 112, label %5
i32 100, label %13
i32 105, label %16
i32 27, label %16
]
5: ; preds = %3
%6 = tail call i32 @lprcat(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %7, %5
%8 = tail call i32 (...) @ttgetch()
switch i32 %8, label %7 [
i32 106, label %9
i32 109, label %11
i32 27, label %19
]
9: ; preds = %7
%10 = tail call i32 (...) @act_just_pray()
br label %19
11: ; preds = %7
%12 = tail call i32 (...) @act_donation_pray()
br label %19
13: ; preds = %3
%14 = tail call i32 @lprcat(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%15 = tail call i32 (...) @act_desecrate_altar()
br label %19
16: ; preds = %3, %3
%17 = tail call i32 (...) @ignore()
%18 = tail call i32 (...) @act_ignore_altar()
br label %19
19: ; preds = %7, %16, %13, %11, %9
ret void
}