#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_drink_fountain();
int /*<<< orphan*/ act_wash_fountain();
int /*<<< orphan*/ cursors();
int /*<<< orphan*/ ignore();
int /*<<< orphan*/ iopts();
int /*<<< orphan*/ lprcat(char *);
int ttgetch();
void ofountain(void) {
  cursors();
  lprcat("\nDo you (d) drink, (w) wash yourself");
  iopts();
  while (1)
    switch (ttgetch()) {
    case 'd':
      lprcat("drink");
      act_drink_fountain();
      return;
    case '\33':
    case 'i':
      ignore();
      return;
    case 'w':
      lprcat("wash yourself");
      act_wash_fountain();
      return;
    }
}


x86 assembly (clang, -O0):
<ofountain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <cursors@plt>
lea    0xe7a(%rip),%rdi
call   1070 <lprcat@plt>
mov    $0x0,%al
call   1050 <iopts@plt>
xor    %eax,%eax
call   1090 <ttgetch@plt>
mov    %eax,%ecx
mov    %ecx,-0x4(%rbp)
sub    $0x1b,%eax
je     11f7 <ofountain+0x87>
jmp    11ac <ofountain+0x3c>
mov    -0x4(%rbp),%eax
sub    $0x64,%eax
je     11df <ofountain+0x6f>
jmp    11bd <ofountain+0x4d>
mov    -0x4(%rbp),%eax
sub    $0x69,%eax
je     11f7 <ofountain+0x87>
jmp    11ce <ofountain+0x5e>
mov    -0x4(%rbp),%eax
sub    $0x77,%eax
je     1203 <ofountain+0x93>
jmp    121b <ofountain+0xab>
lea    0xe3f(%rip),%rdi
call   1070 <lprcat@plt>
mov    $0x0,%al
call   1040 <act_drink_fountain@plt>
jmp    1220 <ofountain+0xb0>
mov    $0x0,%al
call   1030 <ignore@plt>
jmp    1220 <ofountain+0xb0>
lea    0xe0d(%rip),%rdi
call   1070 <lprcat@plt>
mov    $0x0,%al
call   1080 <act_wash_fountain@plt>
jmp    1220 <ofountain+0xb0>
jmp    1192 <ofountain+0x22>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ofountain>:
push   %rax
xor    %eax,%eax
call   1060 <cursors@plt>
lea    0xe81(%rip),%rdi
call   1070 <lprcat@plt>
xor    %eax,%eax
call   1050 <iopts@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1090 <ttgetch@plt>
cmp    $0x68,%eax
jg     11b0 <ofountain+0x40>
cmp    $0x1b,%eax
je     11ce <ofountain+0x5e>
cmp    $0x64,%eax
jne    1190 <ofountain+0x20>
jmp    11d6 <ofountain+0x66>
nopl   0x0(%rax,%rax,1)
cmp    $0x69,%eax
je     11ce <ofountain+0x5e>
cmp    $0x77,%eax
jne    1190 <ofountain+0x20>
lea    0xe56(%rip),%rdi
call   1070 <lprcat@plt>
xor    %eax,%eax
pop    %rcx
jmp    1080 <act_wash_fountain@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <ignore@plt>
lea    0xe48(%rip),%rdi
call   1070 <lprcat@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <act_drink_fountain@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"\0ADo you (d) drink, (w) wash yourself\00"
@.str.1 = [6 x i8] c"drink\00"
@.str.2 = [14 x i8] c"wash yourself\00"
define void @ofountain() {
%1 = call i32 (...) @cursors()
%2 = call i32 @lprcat(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @iopts()
br label %4
4: ; preds = %0, %14
%5 = call i32 (...) @ttgetch()
switch i32 %5, label %14 [
i32 100, label %6
i32 27, label %9
i32 105, label %9
i32 119, label %11
]
6: ; preds = %4
%7 = call i32 @lprcat(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 (...) @act_drink_fountain()
br label %15
9: ; preds = %4, %4
%10 = call i32 (...) @ignore()
br label %15
11: ; preds = %4
%12 = call i32 @lprcat(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 (...) @act_wash_fountain()
br label %15
14: ; preds = %4
br label %4
15: ; preds = %11, %9, %6
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"\0ADo you (d) drink, (w) wash yourself\00"
@.str.1 = [6 x i8] c"drink\00"
@.str.2 = [14 x i8] c"wash yourself\00"
define void @ofountain() {
%1 = tail call i32 (...) @cursors()
%2 = tail call i32 @lprcat(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @iopts()
br label %4
4: ; preds = %4, %0
%5 = tail call i32 (...) @ttgetch()
switch i32 %5, label %4 [
i32 100, label %6
i32 27, label %9
i32 105, label %9
i32 119, label %11
]
6: ; preds = %4
%7 = tail call i32 @lprcat(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 (...) @act_drink_fountain()
br label %14
9: ; preds = %4, %4
%10 = tail call i32 (...) @ignore()
br label %14
11: ; preds = %4
%12 = tail call i32 @lprcat(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%13 = tail call i32 (...) @act_wash_fountain()
br label %14
14: ; preds = %11, %9, %6
ret void
}