#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*/ CheckPriceBleed(int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, int *);
void DisplayOptions(char item1[50], char item2[50], char item3[50]) {
  int choice = -1;
  printf("Option 1: Cost 100: %s \n", item1);
  printf("Option 2: Cost 50: %s \n", item2);
  printf("Option 3: Cost 300: %s \n", item3);
  scanf("%d", &choice);
  switch (choice) {
  case 1:
    CheckPriceBleed(100);
    break;
  case 2:
    CheckPriceBleed(50);
    break;
  case 3:
    CheckPriceBleed(300);
    break;
  default:
    puts("Option not in the list.");
    break;
  }
}


x86 assembly (clang, -O0):
<DisplayOptions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0xffffffff,-0x1c(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb8(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
sub    $0x1,%eax
je     11d1 <DisplayOptions+0x91>
jmp    11af <DisplayOptions+0x6f>
mov    -0x20(%rbp),%eax
sub    $0x2,%eax
je     11e0 <DisplayOptions+0xa0>
jmp    11c0 <DisplayOptions+0x80>
mov    -0x20(%rbp),%eax
sub    $0x3,%eax
je     11ef <DisplayOptions+0xaf>
jmp    11fe <DisplayOptions+0xbe>
mov    $0x64,%edi
call   1050 <CheckPriceBleed@plt>
jmp    120a <DisplayOptions+0xca>
mov    $0x32,%edi
call   1050 <CheckPriceBleed@plt>
jmp    120a <DisplayOptions+0xca>
mov    $0x12c,%edi
call   1050 <CheckPriceBleed@plt>
jmp    120a <DisplayOptions+0xca>
lea    0xe48(%rip),%rdi
call   1030 <puts@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DisplayOptions>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%rsi
movl   $0xffffffff,0x4(%rsp)
ff
lea    0xea4(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb1(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
lea    0xeba(%rip),%rdi
mov    %r14,%rsi
call   1040 <printf@plt>
lea    0xec4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x3,%eax
je     11af <DisplayOptions+0x6f>
cmp    $0x2,%eax
je     11bb <DisplayOptions+0x7b>
cmp    $0x1,%eax
jne    11c7 <DisplayOptions+0x87>
mov    $0x64,%edi
call   1050 <CheckPriceBleed@plt>
jmp    11d3 <DisplayOptions+0x93>
mov    $0x12c,%edi
call   1050 <CheckPriceBleed@plt>
jmp    11d3 <DisplayOptions+0x93>
mov    $0x32,%edi
call   1050 <CheckPriceBleed@plt>
jmp    11d3 <DisplayOptions+0x93>
lea    0xe7f(%rip),%rdi
call   1030 <puts@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Option 1: Cost 100: %s \0A\00"
@.str.1 = [24 x i8] c"Option 2: Cost 50: %s \0A\00"
@.str.2 = [25 x i8] c"Option 3: Cost 300: %s \0A\00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [24 x i8] c"Option not in the list.\00"
define void @DisplayOptions(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
store i32 -1, i32* %7
%8 = load i8*, i8** %4
%9 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i8*, i8** %5
%11 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%12 = load i8*, i8** %6
%13 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* %12)
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %7)
%15 = load i32, i32* %7
switch i32 %15, label %22 [
i32 1, label %16
i32 2, label %18
i32 3, label %20
]
16: ; preds = %3
%17 = call i32 @CheckPriceBleed(i32 100)
br label %24
18: ; preds = %3
%19 = call i32 @CheckPriceBleed(i32 50)
br label %24
20: ; preds = %3
%21 = call i32 @CheckPriceBleed(i32 300)
br label %24
22: ; preds = %3
%23 = call i32 @puts(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
br label %24
24: ; preds = %22, %20, %18, %16
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"Option 1: Cost 100: %s \0A\00"
@.str.1 = [24 x i8] c"Option 2: Cost 50: %s \0A\00"
@.str.2 = [25 x i8] c"Option 3: Cost 300: %s \0A\00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [24 x i8] c"Option not in the list.\00"
define void @DisplayOptions(i8* %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
store i32 -1, i32* %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* %2)
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %4)
%10 = load i32, i32* %4
switch i32 %10, label %17 [
i32 1, label %11
i32 2, label %13
i32 3, label %15
]
11: ; preds = %3
%12 = call i32 @CheckPriceBleed(i32 100)
br label %19
13: ; preds = %3
%14 = call i32 @CheckPriceBleed(i32 50)
br label %19
15: ; preds = %3
%16 = call i32 @CheckPriceBleed(i32 300)
br label %19
17: ; preds = %3
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
br label %19
19: ; preds = %17, %15, %13, %11
ret void
}