#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*/ printf(char *);
void printPrompt(int prompt) {
  switch (prompt) {
  case 10:
    printf("\nOptions:\n0. Quit Small POS\n");
    printf("1. Sell an item not in your SKU library\n");
    printf("2. Add to the till\n");
    printf("3. Remove from the till\n");
    printf("4. Show till balance\n");
    printf("5. Print List of SKUs\n");
    printf("6. Add to list of SKUs\n");
    printf("7. Remove from list of SKUs\n");
    printf("8. Find price of SKU\n");
    printf("9. Sell an item in your SKU library\n\n>>");
    break;
  case 12:
    printf("\nPlease enter the item you wish to sell's price\n");
    printf("(use the format 0.00)\n\n>>$");
    break;
  case 21:
    printf("\nHow much to add to the till?\n");
    printf("(use the format 0.00)\n\n>>$");
    break;
  case 22:
    printf("\nHow much to remove from the till?\n(use the format 0.00)\n\n>>$");
    break;
  case 23:
    printf("\nThe till has ");
    break;
  case 25:
    printf("\nWhat number SKU would you like to add?\n\n>>");
    break;
  case 26:
    printf("\nWhich SKU to remove?\n\n>>");
    break;
  case 27:
    printf("\nWhat SKU would you like to look up?\n\n>>");
    break;
  case 62:
    printf("\nWhat SKU would you like to sell?\n\n>>");
    break;
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<printPrompt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xfffffff6,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x34,%eax
ja     1261 <printPrompt+0x151>
mov    -0x10(%rbp),%rax
lea    0xec5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf89(%rip),%rdi
call   1030 <printf@plt>
lea    0xf9a(%rip),%rdi
call   1030 <printf@plt>
lea    0xfb7(%rip),%rdi
call   1030 <printf@plt>
lea    0xfbf(%rip),%rdi
call   1030 <printf@plt>
lea    0xfcc(%rip),%rdi
call   1030 <printf@plt>
lea    0xfd6(%rip),%rdi
call   1030 <printf@plt>
lea    0xfe1(%rip),%rdi
call   1030 <printf@plt>
lea    0xfed(%rip),%rdi
call   1030 <printf@plt>
lea    0xffe(%rip),%rdi
call   1030 <printf@plt>
lea    0x1008(%rip),%rdi
call   1030 <printf@plt>
jmp    1266 <printPrompt+0x156>
lea    0x101f(%rip),%rdi
call   1030 <printf@plt>
lea    0x1086(%rip),%rdi
call   1030 <printf@plt>
jmp    1266 <printPrompt+0x156>
lea    0x1033(%rip),%rdi
call   1030 <printf@plt>
lea    0x1069(%rip),%rdi
call   1030 <printf@plt>
jmp    1266 <printPrompt+0x156>
lea    0x1035(%rip),%rdi
call   1030 <printf@plt>
jmp    1266 <printPrompt+0x156>
lea    0x1062(%rip),%rdi
call   1030 <printf@plt>
jmp    1266 <printPrompt+0x156>
lea    0x1060(%rip),%rdi
call   1030 <printf@plt>
jmp    1266 <printPrompt+0x156>
lea    0x107b(%rip),%rdi
call   1030 <printf@plt>
jmp    1266 <printPrompt+0x156>
lea    0x1084(%rip),%rdi
call   1030 <printf@plt>
jmp    1266 <printPrompt+0x156>
lea    0x109c(%rip),%rdi
call   1030 <printf@plt>
jmp    1266 <printPrompt+0x156>
jmp    1266 <printPrompt+0x156>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printPrompt>:
push   %rax
mov    %edi,%eax
add    $0xfffffff6,%eax
cmp    $0x34,%eax
ja     11bf <printPrompt+0x9f>
lea    0xfc6(%rip),%rdi
lea    0xec3(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0x10df(%rip),%rdi
call   1030 <puts@plt>
lea    0x10ef(%rip),%rdi
call   1030 <puts@plt>
lea    0x110b(%rip),%rdi
call   1030 <puts@plt>
lea    0x1112(%rip),%rdi
call   1030 <puts@plt>
lea    0x111e(%rip),%rdi
call   1030 <puts@plt>
lea    0x1127(%rip),%rdi
call   1030 <puts@plt>
lea    0x1131(%rip),%rdi
call   1030 <puts@plt>
lea    0x113c(%rip),%rdi
call   1030 <puts@plt>
lea    0x114c(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1b(%rip),%rdi
pop    %rax
jmp    1040 <printf@plt>
pop    %rax
ret
lea    0x1034(%rip),%rdi
jmp    11d1 <printPrompt+0xb1>
lea    0x100d(%rip),%rdi
call   1030 <puts@plt>
lea    0xf42(%rip),%rdi
pop    %rax
jmp    1040 <printf@plt>
lea    0xf50(%rip),%rdi
pop    %rax
jmp    1040 <printf@plt>
lea    0xf52(%rip),%rdi
pop    %rax
jmp    1040 <printf@plt>
lea    0xf71(%rip),%rdi
pop    %rax
jmp    1040 <printf@plt>
lea    0xf7e(%rip),%rdi
pop    %rax
jmp    1040 <printf@plt>
lea    0xf9a(%rip),%rdi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"\0AOptions:\0A0. Quit Small POS\0A\00"
@.str.1 = [41 x i8] c"1. Sell an item not in your SKU library\0A\00"
@.str.2 = [20 x i8] c"2. Add to the till\0A\00"
@.str.3 = [25 x i8] c"3. Remove from the till\0A\00"
@.str.4 = [22 x i8] c"4. Show till balance\0A\00"
@.str.5 = [23 x i8] c"5. Print List of SKUs\0A\00"
@.str.6 = [24 x i8] c"6. Add to list of SKUs\0A\00"
@.str.7 = [29 x i8] c"7. Remove from list of SKUs\0A\00"
@.str.8 = [22 x i8] c"8. Find price of SKU\0A\00"
@.str.9 = [40 x i8] c"9. Sell an item in your SKU library\0A\0A>>\00"
@.str.10 = [49 x i8] c"\0APlease enter the item you wish to sell's price\0A\00"
@.str.11 = [27 x i8] c"(use the format 0.00)\0A\0A>>$\00"
@.str.12 = [31 x i8] c"\0AHow much to add to the till?\0A\00"
@.str.13 = [62 x i8] c"\0AHow much to remove from the till?\0A(use the format 0.00)\0A\0A>>$\00"
@.str.14 = [15 x i8] c"\0AThe till has \00"
@.str.15 = [44 x i8] c"\0AWhat number SKU would you like to add?\0A\0A>>\00"
@.str.16 = [26 x i8] c"\0AWhich SKU to remove?\0A\0A>>\00"
@.str.17 = [41 x i8] c"\0AWhat SKU would you like to look up?\0A\0A>>\00"
@.str.18 = [38 x i8] c"\0AWhat SKU would you like to sell?\0A\0A>>\00"
define void @printPrompt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %33 [
i32 10, label %4
i32 12, label %15
i32 21, label %18
i32 22, label %21
i32 23, label %23
i32 25, label %25
i32 26, label %27
i32 27, label %29
i32 62, label %31
]
4: ; preds = %1
%5 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.7, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.9, i64 0, i64 0))
br label %34
15: ; preds = %1
%16 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.10, i64 0, i64 0))
%17 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.11, i64 0, i64 0))
br label %34
18: ; preds = %1
%19 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.12, i64 0, i64 0))
%20 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.11, i64 0, i64 0))
br label %34
21: ; preds = %1
%22 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.13, i64 0, i64 0))
br label %34
23: ; preds = %1
%24 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.14, i64 0, i64 0))
br label %34
25: ; preds = %1
%26 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.15, i64 0, i64 0))
br label %34
27: ; preds = %1
%28 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.16, i64 0, i64 0))
br label %34
29: ; preds = %1
%30 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.17, i64 0, i64 0))
br label %34
31: ; preds = %1
%32 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.18, i64 0, i64 0))
br label %34
33: ; preds = %1
br label %34
34: ; preds = %33, %31, %29, %27, %25, %23, %21, %18, %15, %4
ret void
}

LLVM IR (-O2):
@.str.9 = [40 x i8] c"9. Sell an item in your SKU library\0A\0A>>\00"
@.str.11 = [27 x i8] c"(use the format 0.00)\0A\0A>>$\00"
@.str.13 = [62 x i8] c"\0AHow much to remove from the till?\0A(use the format 0.00)\0A\0A>>$\00"
@.str.14 = [15 x i8] c"\0AThe till has \00"
@.str.15 = [44 x i8] c"\0AWhat number SKU would you like to add?\0A\0A>>\00"
@.str.16 = [26 x i8] c"\0AWhich SKU to remove?\0A\0A>>\00"
@.str.17 = [41 x i8] c"\0AWhat SKU would you like to look up?\0A\0A>>\00"
@.str.18 = [38 x i8] c"\0AWhat SKU would you like to sell?\0A\0A>>\00"
@str = [30 x i8] c"\0AHow much to add to the till?\00"
@str.19 = [48 x i8] c"\0APlease enter the item you wish to sell's price\00"
@str.20 = [28 x i8] c"\0AOptions:\0A0. Quit Small POS\00"
@str.21 = [40 x i8] c"1. Sell an item not in your SKU library\00"
@str.22 = [19 x i8] c"2. Add to the till\00"
@str.23 = [24 x i8] c"3. Remove from the till\00"
@str.24 = [21 x i8] c"4. Show till balance\00"
@str.25 = [22 x i8] c"5. Print List of SKUs\00"
@str.26 = [23 x i8] c"6. Add to list of SKUs\00"
@str.27 = [28 x i8] c"7. Remove from list of SKUs\00"
@str.28 = [21 x i8] c"8. Find price of SKU\00"
define void @printPrompt(i32 %0) {
switch i32 %0, label %24 [
i32 10, label %2
i32 12, label %12
i32 21, label %14
i32 22, label %21
i32 23, label %16
i32 25, label %17
i32 26, label %18
i32 27, label %19
i32 62, label %20
]
2: ; preds = %1
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.20, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.21, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.22, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.23, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.24, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.25, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.26, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.27, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.28, i64 0, i64 0))
br label %21
12: ; preds = %1
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.19, i64 0, i64 0))
br label %21
14: ; preds = %1
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
br label %21
16: ; preds = %1
br label %21
17: ; preds = %1
br label %21
18: ; preds = %1
br label %21
19: ; preds = %1
br label %21
20: ; preds = %1
br label %21
21: ; preds = %1, %2, %12, %14, %16, %17, %18, %19, %20
%22 = phi i8* [ getelementptr inbounds ([38 x i8], [38 x i8]* @.str.18, i64 0, i64 0), %20 ], [ getelementptr inbounds ([41 x i8], [41 x i8]* @.str.17, i64 0, i64 0), %19 ], [ getelementptr inbounds ([26 x i8], [26 x i8]* @.str.16, i64 0, i64 0), %18 ], [ getelementptr inbounds ([44 x i8], [44 x i8]* @.str.15, i64 0, i64 0), %17 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.14, i64 0, i64 0), %16 ], [ getelementptr inbounds ([27 x i8], [27 x i8]* @.str.11, i64 0, i64 0), %14 ], [ getelementptr inbounds ([27 x i8], [27 x i8]* @.str.11, i64 0, i64 0), %12 ], [ getelementptr inbounds ([40 x i8], [40 x i8]* @.str.9, i64 0, i64 0), %2 ], [ getelementptr inbounds ([62 x i8], [62 x i8]* @.str.13, i64 0, i64 0), %1 ]
%23 = tail call i32 @printf(i8* dereferenceable(1) %22)
br label %24
24: ; preds = %21, %1
ret void
}