#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 /*<<< orphan*/ scanf(char *, int *);
int main() {
  int score;
  printf("Please enter score[1..9]: ");
  scanf("%d", &score);
  switch (score) {
  case 1:
  case 2:
  case 3:
    score *= 10;
    break;
  case 4:
  case 5:
  case 6:
    score *= 100;
    break;
  case 7:
  case 8:
  case 9:
    score *= 1000;
    break;
  default:
    printf("Invalid score\n");
    break;
  }
  if (0 < score && score < 10) {
    printf("Score: %d\n", score);
  }
  return 0;
}


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    0xed7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xffffffff,%eax
sub    $0x3,%eax
jb     118c <main+0x6c>
jmp    1164 <main+0x44>
mov    -0xc(%rbp),%eax
add    $0xfffffffc,%eax
sub    $0x3,%eax
jb     1198 <main+0x78>
jmp    1178 <main+0x58>
mov    -0xc(%rbp),%eax
add    $0xfffffff9,%eax
sub    $0x3,%eax
jb     11a4 <main+0x84>
jmp    11b3 <main+0x93>
imul   $0xa,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    11c1 <main+0xa1>
imul   $0x64,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    11c1 <main+0xa1>
imul   $0x3e8,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    11c1 <main+0xa1>
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
jge    11e7 <main+0xc7>
cmpl   $0xa,-0x8(%rbp)
jge    11e7 <main+0xc7>
mov    -0x8(%rbp),%esi
lea    0xe4d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x9,%eax
ja     1197 <main+0x67>
mov    $0xe,%ecx
bt     %eax,%ecx
jb     1183 <main+0x53>
mov    $0x70,%ecx
bt     %eax,%ecx
jb     118e <main+0x5e>
mov    $0x380,%ecx
bt     %eax,%ecx
jae    1197 <main+0x67>
imul   $0x3e8,%eax,%esi
mov    %esi,0x4(%rsp)
jmp    11a7 <main+0x77>
add    %eax,%eax
lea    (%rax,%rax,4),%esi
mov    %esi,0x4(%rsp)
jmp    11a7 <main+0x77>
imul   $0x64,%eax,%esi
mov    %esi,0x4(%rsp)
jmp    11a7 <main+0x77>
lea    0xe8b(%rip),%rdi
call   1030 <puts@plt>
mov    0x4(%rsp),%esi
lea    -0x1(%rsi),%eax
cmp    $0x8,%eax
ja     11bd <main+0x8d>
lea    0xe68(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Please enter score[1..9]: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [15 x i8] c"Invalid score\0A\00"
@.str.3 = [11 x i8] c"Score: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
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 = load i32, i32* %2
%8 = mul nsw i32 %7, 10
store i32 %8, i32* %2
br label %17
9: ; preds = %0, %0, %0
%10 = load i32, i32* %2
%11 = mul nsw i32 %10, 100
store i32 %11, i32* %2
br label %17
12: ; preds = %0, %0, %0
%13 = load i32, i32* %2
%14 = mul nsw i32 %13, 1000
store i32 %14, i32* %2
br label %17
15: ; preds = %0
%16 = call i32 (i8*, ...) @printf(i8* 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* %2
%19 = icmp slt i32 0, %18
br i1 %19, label %20, label %26
20: ; preds = %17
%21 = load i32, i32* %2
%22 = icmp slt i32 %21, 10
br i1 %22, label %23, label %26
23: ; preds = %20
%24 = load i32, i32* %2
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 %24)
br label %26
26: ; preds = %23, %20, %17
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"Please enter score[1..9]: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.3 = [11 x i8] c"Score: %d\0A\00"
@str = [14 x i8] c"Invalid score\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
switch i32 %5, label %12 [
i32 1, label %6
i32 2, label %6
i32 3, label %6
i32 4, label %8
i32 5, label %8
i32 6, label %8
i32 7, label %10
i32 8, label %10
i32 9, label %10
]
6: ; preds = %0, %0, %0
%7 = mul nuw nsw i32 %5, 10
store i32 %7, i32* %1
br label %15
8: ; preds = %0, %0, %0
%9 = mul nuw nsw i32 %5, 100
store i32 %9, i32* %1
br label %15
10: ; preds = %0, %0, %0
%11 = mul nuw nsw i32 %5, 1000
store i32 %11, i32* %1
br label %15
12: ; preds = %0
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%14 = load i32, i32* %1
br label %15
15: ; preds = %12, %10, %8, %6
%16 = phi i32 [ %14, %12 ], [ %11, %10 ], [ %9, %8 ], [ %7, %6 ]
%17 = add i32 %16, -1
%18 = icmp ult i32 %17, 9
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 %16)
br label %21
21: ; preds = %19, %15
ret i32 0
}