#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 get_single_quiet(char *);
int /*<<< orphan*/ help(char *, int /*<<< orphan*/);
int /*<<< orphan*/ my_printf(char *, ...);
int /*<<< orphan*/ my_putchar(char);
int wanttoyell(int cmd) {
  my_printf("%s", cmd == 'y' ? "Yell to Sysop\n" : "Upload Yell to Sysop\n");
  help("yell.list", 0);
  my_printf("Enter your choice -> ");
  switch (get_single_quiet("1234YN \n")) {
  case '1':
    help("yell.voice.1", 0);
    break;
  case '2':
    help("yell.voice.2", 0);
    break;
  case '3':
    help("yell.voice.3", 0);
    break;
  case '4':
    help("yell.voice.4", 0);
    break;
  case 'Y':
    my_putchar('\n');
    return (1);
  default:
    my_putchar('\n');
    break;
  }
  return (0);
}


x86 assembly (clang, -O0):
<wanttoyell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x79,%eax
lea    0xf56(%rip),%rax
lea    0xf48(%rip),%rsi
cmove  %rax,%rsi
lea    0xf3a(%rip),%rdi
xor    %eax,%eax
mov    %eax,-0x18(%rbp)
mov    %al,-0x11(%rbp)
call   1030 <my_printf@plt>
mov    -0x18(%rbp),%esi
lea    0xf3c(%rip),%rdi
call   1060 <help@plt>
mov    -0x11(%rbp),%al
lea    0xf37(%rip),%rdi
call   1030 <my_printf@plt>
lea    0xf41(%rip),%rdi
call   1040 <get_single_quiet@plt>
add    $0xffffffcf,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x28,%eax
ja     1229 <wanttoyell+0xe9>
mov    -0x10(%rbp),%rax
lea    0xe42(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf18(%rip),%rdi
xor    %esi,%esi
call   1060 <help@plt>
jmp    1233 <wanttoyell+0xf3>
lea    0xf12(%rip),%rdi
xor    %esi,%esi
call   1060 <help@plt>
jmp    1233 <wanttoyell+0xf3>
lea    0xf0c(%rip),%rdi
xor    %esi,%esi
call   1060 <help@plt>
jmp    1233 <wanttoyell+0xf3>
lea    0xf06(%rip),%rdi
xor    %esi,%esi
call   1060 <help@plt>
jmp    1233 <wanttoyell+0xf3>
mov    $0xa,%edi
call   1050 <my_putchar@plt>
movl   $0x1,-0x4(%rbp)
jmp    123a <wanttoyell+0xfa>
mov    $0xa,%edi
call   1050 <my_putchar@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wanttoyell>:
push   %rbx
cmp    $0x79,%edi
lea    0xf63(%rip),%rax
lea    0xf55(%rip),%rsi
cmove  %rax,%rsi
lea    0xf47(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <my_printf@plt>
lea    0xf50(%rip),%rdi
xor    %esi,%esi
call   1060 <help@plt>
lea    0xf4c(%rip),%rdi
xor    %eax,%eax
call   1030 <my_printf@plt>
lea    0xf54(%rip),%rdi
call   1040 <get_single_quiet@plt>
add    $0xffffffcf,%eax
cmp    $0x28,%eax
ja     11d3 <wanttoyell+0x93>
lea    0xe63(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf39(%rip),%rdi
jmp    11c8 <wanttoyell+0x88>
lea    0xf3d(%rip),%rdi
jmp    11c8 <wanttoyell+0x88>
lea    0xf41(%rip),%rdi
jmp    11c8 <wanttoyell+0x88>
lea    0xf45(%rip),%rdi
xor    %ebx,%ebx
xor    %esi,%esi
call   1060 <help@plt>
jmp    11ee <wanttoyell+0xae>
mov    $0xa,%edi
call   1050 <my_putchar@plt>
jmp    11ee <wanttoyell+0xae>
mov    $0xa,%edi
call   1050 <my_putchar@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [15 x i8] c"Yell to Sysop\0A\00"
@.str.2 = [22 x i8] c"Upload Yell to Sysop\0A\00"
@.str.3 = [10 x i8] c"yell.list\00"
@.str.4 = [22 x i8] c"Enter your choice -> \00"
@.str.5 = [9 x i8] c"1234YN \0A\00"
@.str.6 = [13 x i8] c"yell.voice.1\00"
@.str.7 = [13 x i8] c"yell.voice.2\00"
@.str.8 = [13 x i8] c"yell.voice.3\00"
@.str.9 = [13 x i8] c"yell.voice.4\00"
define i32 @wanttoyell(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 121
%6 = zext i1 %5 to i64
%7 = select i1 %5, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0)
%8 = call i32 (i8*, ...) @my_printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = call i32 @help(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 0)
%10 = call i32 (i8*, ...) @my_printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
%11 = call i32 @get_single_quiet(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
switch i32 %11, label %22 [
i32 49, label %12
i32 50, label %14
i32 51, label %16
i32 52, label %18
i32 89, label %20
]
12: ; preds = %1
%13 = call i32 @help(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i32 0)
br label %24
14: ; preds = %1
%15 = call i32 @help(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 0)
br label %24
16: ; preds = %1
%17 = call i32 @help(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i32 0)
br label %24
18: ; preds = %1
%19 = call i32 @help(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i32 0)
br label %24
20: ; preds = %1
%21 = call i32 @my_putchar(i8 signext 10)
store i32 1, i32* %2
br label %25
22: ; preds = %1
%23 = call i32 @my_putchar(i8 signext 10)
br label %24
24: ; preds = %22, %18, %16, %14, %12
store i32 0, i32* %2
br label %25
25: ; preds = %24, %20
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [15 x i8] c"Yell to Sysop\0A\00"
@.str.2 = [22 x i8] c"Upload Yell to Sysop\0A\00"
@.str.3 = [10 x i8] c"yell.list\00"
@.str.4 = [22 x i8] c"Enter your choice -> \00"
@.str.5 = [9 x i8] c"1234YN \0A\00"
@.str.6 = [13 x i8] c"yell.voice.1\00"
@.str.7 = [13 x i8] c"yell.voice.2\00"
@.str.8 = [13 x i8] c"yell.voice.3\00"
@.str.9 = [13 x i8] c"yell.voice.4\00"
define i32 @wanttoyell(i32 %0) {
%2 = icmp eq i32 %0, 121
%3 = select i1 %2, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0)
%4 = tail call i32 (i8*, ...) @my_printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call i32 @help(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 0)
%6 = tail call i32 (i8*, ...) @my_printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
%7 = tail call i32 @get_single_quiet(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
switch i32 %7, label %18 [
i32 49, label %8
i32 50, label %10
i32 51, label %12
i32 52, label %14
i32 89, label %16
]
8: ; preds = %1
%9 = tail call i32 @help(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i32 0)
br label %20
10: ; preds = %1
%11 = tail call i32 @help(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 0)
br label %20
12: ; preds = %1
%13 = tail call i32 @help(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i32 0)
br label %20
14: ; preds = %1
%15 = tail call i32 @help(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i32 0)
br label %20
16: ; preds = %1
%17 = tail call i32 @my_putchar(i8 signext 10)
br label %20
18: ; preds = %1
%19 = tail call i32 @my_putchar(i8 signext 10)
br label %20
20: ; preds = %8, %10, %12, %14, %18, %16
%21 = phi i32 [ 1, %16 ], [ 0, %18 ], [ 0, %14 ], [ 0, %12 ], [ 0, %10 ], [ 0, %8 ]
ret i32 %21
}