#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 *, ...);
int main() {
  int myMark = 9;
  printf("My mark is %d\n", myMark);
  switch (myMark) {
  case 10:
    printf("My rewards include a PSP\n");
  case 9:
    printf("My rewards include a bicycle\n");
  case 8:
    printf("My rewards include a T-shirt\n");
  default:
    printf("My rewards include a IceCream\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x9,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x8,%eax
je     1189 <main+0x79>
jmp    114b <main+0x3b>
mov    -0xc(%rbp),%eax
sub    $0x9,%eax
je     117b <main+0x6b>
jmp    115c <main+0x4c>
mov    -0xc(%rbp),%eax
sub    $0xa,%eax
jne    1197 <main+0x87>
jmp    116d <main+0x5d>
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x9,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed4(%rip),%rdi
call   1030 <puts@plt>
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
lea    0xef6(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"My mark is %d\0A\00"
@.str.1 = [26 x i8] c"My rewards include a PSP\0A\00"
@.str.2 = [30 x i8] c"My rewards include a bicycle\0A\00"
@.str.3 = [30 x i8] c"My rewards include a T-shirt\0A\00"
@.str.4 = [31 x i8] c"My rewards include a IceCream\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 9, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
switch i32 %5, label %12 [
i32 10, label %6
i32 9, label %8
i32 8, label %10
]
6: ; preds = %0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %0, %6
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %0, %8
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
br label %12
12: ; preds = %0, %10
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
br label %14
14: ; preds = %12
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@.str = [15 x i8] c"My mark is %d\0A\00"
@str = [29 x i8] c"My rewards include a bicycle\00"
@str.5 = [29 x i8] c"My rewards include a T-shirt\00"
@str.6 = [30 x i8] c"My rewards include a IceCream\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 9)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.6, i64 0, i64 0))
ret i32 0
}