#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*/ carmen_commander_clear_processes();
int /*<<< orphan*/ carmen_commander_print_message(char *);
char getchar();
int carmen_commander_quit() {
  char answ = ' ';
  carmen_commander_print_message("Kill all processes? (y/n/c)");
  while (answ != 'y' && answ != 'n' && answ != 'c' && answ != 'Y' &&
         answ != 'N' && answ != 'C') {
    answ = getchar();
  }
  if (answ == 'c' || answ == 'C')
    return 0;
  if (answ == 'y' || answ == 'Y')
    carmen_commander_clear_processes();
  return 1;
}


x86 assembly (clang, -O0):
<carmen_commander_quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x20,-0x5(%rbp)
lea    0xebd(%rip),%rdi
call   1040 <carmen_commander_print_message@plt>
movsbl -0x5(%rbp),%ecx
xor    %eax,%eax
cmp    $0x79,%ecx
mov    %al,-0x6(%rbp)
je     11af <carmen_commander_quit+0x7f>
movsbl -0x5(%rbp),%ecx
xor    %eax,%eax
cmp    $0x6e,%ecx
mov    %al,-0x6(%rbp)
je     11af <carmen_commander_quit+0x7f>
movsbl -0x5(%rbp),%ecx
xor    %eax,%eax
cmp    $0x63,%ecx
mov    %al,-0x6(%rbp)
je     11af <carmen_commander_quit+0x7f>
movsbl -0x5(%rbp),%ecx
xor    %eax,%eax
cmp    $0x59,%ecx
mov    %al,-0x6(%rbp)
je     11af <carmen_commander_quit+0x7f>
movsbl -0x5(%rbp),%ecx
xor    %eax,%eax
cmp    $0x4e,%ecx
mov    %al,-0x6(%rbp)
je     11af <carmen_commander_quit+0x7f>
movsbl -0x5(%rbp),%eax
cmp    $0x43,%eax
setne  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
test   $0x1,%al
jne    11bf <carmen_commander_quit+0x8f>
jmp    11ce <carmen_commander_quit+0x9e>
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x5(%rbp)
jmp    1148 <carmen_commander_quit+0x18>
movsbl -0x5(%rbp),%eax
cmp    $0x63,%eax
je     11e8 <carmen_commander_quit+0xb8>
movsbl -0x5(%rbp),%eax
cmp    $0x43,%eax
jne    11f4 <carmen_commander_quit+0xc4>
movl   $0x0,-0x4(%rbp)
jmp    121c <carmen_commander_quit+0xec>
movsbl -0x5(%rbp),%eax
cmp    $0x79,%eax
je     120e <carmen_commander_quit+0xde>
movsbl -0x5(%rbp),%eax
cmp    $0x59,%eax
jne    1215 <carmen_commander_quit+0xe5>
mov    $0x0,%al
call   1050 <carmen_commander_clear_processes@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<carmen_commander_quit>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1040 <carmen_commander_print_message@plt>
mov    $0x20,%al
movabs $0x40080100400801,%rbx
jmp    1157 <carmen_commander_quit+0x27>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
lea    -0x43(%rax),%ecx
cmp    $0x36,%cl
ja     1150 <carmen_commander_quit+0x20>
movzbl %cl,%ecx
bt     %rcx,%rbx
jae    1150 <carmen_commander_quit+0x20>
and    $0xdf,%al
cmp    $0x43,%al
je     1180 <carmen_commander_quit+0x50>
cmp    $0x59,%al
jne    1179 <carmen_commander_quit+0x49>
xor    %eax,%eax
call   1050 <carmen_commander_clear_processes@plt>
mov    $0x1,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Kill all processes? (y/n/c)\00"
define i32 @carmen_commander_quit() {
%1 = alloca i32
%2 = alloca i8
store i8 32, i8* %2
%3 = call i32 @carmen_commander_print_message(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %30, %0
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 121
br i1 %7, label %8, label %28
8: ; preds = %4
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 110
br i1 %11, label %12, label %28
12: ; preds = %8
%13 = load i8, i8* %2
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 99
br i1 %15, label %16, label %28
16: ; preds = %12
%17 = load i8, i8* %2
%18 = sext i8 %17 to i32
%19 = icmp ne i32 %18, 89
br i1 %19, label %20, label %28
20: ; preds = %16
%21 = load i8, i8* %2
%22 = sext i8 %21 to i32
%23 = icmp ne i32 %22, 78
br i1 %23, label %24, label %28
24: ; preds = %20
%25 = load i8, i8* %2
%26 = sext i8 %25 to i32
%27 = icmp ne i32 %26, 67
br label %28
28: ; preds = %24, %20, %16, %12, %8, %4
%29 = phi i1 [ false, %20 ], [ false, %16 ], [ false, %12 ], [ false, %8 ], [ false, %4 ], [ %27, %24 ]
br i1 %29, label %30, label %32
30: ; preds = %28
%31 = call signext i8 (...) @getchar()
store i8 %31, i8* %2
br label %4
32: ; preds = %28
%33 = load i8, i8* %2
%34 = sext i8 %33 to i32
%35 = icmp eq i32 %34, 99
br i1 %35, label %40, label %36
36: ; preds = %32
%37 = load i8, i8* %2
%38 = sext i8 %37 to i32
%39 = icmp eq i32 %38, 67
br i1 %39, label %40, label %41
40: ; preds = %36, %32
store i32 0, i32* %1
br label %52
41: ; preds = %36
%42 = load i8, i8* %2
%43 = sext i8 %42 to i32
%44 = icmp eq i32 %43, 121
br i1 %44, label %49, label %45
45: ; preds = %41
%46 = load i8, i8* %2
%47 = sext i8 %46 to i32
%48 = icmp eq i32 %47, 89
br i1 %48, label %49, label %51
49: ; preds = %45, %41
%50 = call i32 (...) @carmen_commander_clear_processes()
br label %51
51: ; preds = %49, %45
store i32 1, i32* %1
br label %52
52: ; preds = %51, %40
%53 = load i32, i32* %1
ret i32 %53
}

LLVM IR (-O2):
@.str = [28 x i8] c"Kill all processes? (y/n/c)\00"
define i32 @carmen_commander_quit() {
%1 = tail call i32 @carmen_commander_print_message(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %4, %0
%3 = phi i8 [ 32, %0 ], [ %5, %4 ]
switch i8 %3, label %4 [
i8 121, label %6
i8 110, label %6
i8 99, label %6
i8 89, label %6
i8 78, label %6
i8 67, label %6
]
4: ; preds = %2
%5 = tail call signext i8 (...) @getchar()
br label %2
6: ; preds = %2, %2, %2, %2, %2, %2
%7 = and i8 %3, -33
switch i8 %7, label %10 [
i8 67, label %11
i8 89, label %8
]
8: ; preds = %6
%9 = tail call i32 (...) @carmen_commander_clear_processes()
br label %11
10: ; preds = %6
br label %11
11: ; preds = %6, %10, %8
%12 = phi i32 [ 0, %6 ], [ 1, %8 ], [ 1, %10 ]
ret i32 %12
}