#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 EXIT_SUCCESS;
int /*<<< orphan*/ checkInput(int *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int score;
  printf("Enter score: ");
  checkInput(&score);
  switch (score) {
  case 1:
  case 2:
  case 3:
    printf("result: %d", score * 10);
    break;
  case 4:
  case 5:
  case 6:
    printf("result: %d", score * 100);
    break;
  case 7:
  case 8:
  case 9:
    printf("result: %d", score * 1000);
    break;
  default:
    printf("Invalid score!");
  }
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    -0x8(%rbp),%rdi
call   1040 <checkInput@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xffffffff,%eax
sub    $0x3,%eax
jb     1185 <main+0x65>
jmp    115d <main+0x3d>
mov    -0xc(%rbp),%eax
add    $0xfffffffc,%eax
sub    $0x3,%eax
jb     119c <main+0x7c>
jmp    1171 <main+0x51>
mov    -0xc(%rbp),%eax
add    $0xfffffff9,%eax
sub    $0x3,%eax
jb     11b3 <main+0x93>
jmp    11cd <main+0xad>
imul   $0xa,-0x8(%rbp),%esi
lea    0xe7e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11db <main+0xbb>
imul   $0x64,-0x8(%rbp),%esi
lea    0xe67(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11db <main+0xbb>
imul   $0x3e8,-0x8(%rbp),%esi
lea    0xe4d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11db <main+0xbb>
lea    0xe45(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2dfe(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x4(%rsp),%rdi
call   1040 <checkInput@plt>
mov    0x4(%rsp),%eax
cmp    $0x9,%eax
ja     118b <main+0x6b>
mov    $0xe,%ecx
bt     %eax,%ecx
jb     1168 <main+0x48>
mov    $0x70,%ecx
bt     %eax,%ecx
jb     116f <main+0x4f>
mov    $0x380,%ecx
bt     %eax,%ecx
jae    118b <main+0x6b>
imul   $0x3e8,%eax,%esi
jmp    1172 <main+0x52>
add    %eax,%eax
lea    (%rax,%rax,4),%esi
jmp    1172 <main+0x52>
imul   $0x64,%eax,%esi
lea    0xe95(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2e59(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret
lea    0xe87(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    1180 <main+0x60>

LLVM IR (-O0):
@.str = [14 x i8] c"Enter score: \00"
@.str.1 = [11 x i8] c"result: %d\00"
@.str.2 = [15 x i8] c"Invalid score!\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @checkInput(i32* %2)
%5 = load i32, i32* %2
switch i32 %5, label %18 [
i32 1, label %6
i32 2, label %6
i32 3, label %6
i32 4, label %10
i32 5, label %10
i32 6, label %10
i32 7, label %14
i32 8, label %14
i32 9, label %14
]
6: ; preds = %0, %0, %0
%7 = load i32, i32* %2
%8 = mul nsw i32 %7, 10
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %8)
br label %20
10: ; preds = %0, %0, %0
%11 = load i32, i32* %2
%12 = mul nsw i32 %11, 100
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %12)
br label %20
14: ; preds = %0, %0, %0
%15 = load i32, i32* %2
%16 = mul nsw i32 %15, 1000
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %16)
br label %20
18: ; preds = %0
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
br label %20
20: ; preds = %18, %14, %10, %6
%21 = load i32, i32* @EXIT_SUCCESS
ret i32 %21
}

LLVM IR (-O2):
@.str = [14 x i8] c"Enter score: \00"
@.str.1 = [11 x i8] c"result: %d\00"
@.str.2 = [15 x i8] c"Invalid score!\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @checkInput(i32* %1)
%5 = load i32, i32* %1
switch i32 %5, label %15 [
i32 1, label %6
i32 2, label %6
i32 3, label %6
i32 4, label %9
i32 5, label %9
i32 6, label %9
i32 7, label %12
i32 8, label %12
i32 9, label %12
]
6: ; preds = %0, %0, %0
%7 = mul nuw nsw i32 %5, 10
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %7)
br label %17
9: ; preds = %0, %0, %0
%10 = mul nuw nsw i32 %5, 100
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %10)
br label %17
12: ; preds = %0, %0, %0
%13 = mul nuw nsw i32 %5, 1000
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %13)
br label %17
15: ; preds = %0
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
br label %17
17: ; preds = %15, %12, %9, %6
%18 = load i32, i32* @EXIT_SUCCESS
ret i32 %18
}