#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 simple(int n, int a) {
  switch (n) {
  case 1:
    printf("ONE ");
    break;
  case 2:
    printf("TWO ");
    break;
  case 3:
    printf("THREE ");
    break;
  case 4:
    printf("FOUR ");
    break;
  case 5:
    printf("FIVE ");
    break;
  case 6:
    printf("SIX ");
    break;
  case 7:
    printf("SEVEN ");
    break;
  case 8:
    printf("EIGHT ");
    break;
  case 9:
    printf("NINE ");
    break;
  }
  switch (a) {
  case 0:
    printf("THOUSAND ");
    break;
  case 1:
    printf("HUNDRED ");
    break;
  case 3:
    printf("AND PAISE ");
    break;
  }
}


x86 assembly (clang, -O0):
<simple>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x8,%eax
ja     11db <simple+0xcb>
mov    -0x10(%rbp),%rax
lea    0xec2(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
jmp    11db <simple+0xcb>
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
jmp    11db <simple+0xcb>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
jmp    11db <simple+0xcb>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
jmp    11db <simple+0xcb>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
jmp    11db <simple+0xcb>
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
jmp    11db <simple+0xcb>
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
jmp    11db <simple+0xcb>
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
jmp    11db <simple+0xcb>
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
test   %eax,%eax
je     1210 <simple+0x100>
jmp    11ee <simple+0xde>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
je     1221 <simple+0x111>
jmp    11ff <simple+0xef>
mov    -0x14(%rbp),%eax
sub    $0x3,%eax
je     1232 <simple+0x122>
jmp    123e <simple+0x12e>
lea    0xe43(%rip),%rdi
call   1030 <printf@plt>
jmp    123e <simple+0x12e>
lea    0xe3c(%rip),%rdi
call   1030 <printf@plt>
jmp    123e <simple+0x12e>
lea    0xe34(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple>:
push   %rbx
mov    %esi,%ebx
add    $0xffffffff,%edi
cmp    $0x8,%edi
ja     1131 <simple+0x21>
movslq %edi,%rax
lea    0xf2f(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
call   1030 <printf@plt>
test   %ebx,%ebx
je     114c <simple+0x3c>
cmp    $0x3,%ebx
je     1159 <simple+0x49>
cmp    $0x1,%ebx
jne    1166 <simple+0x56>
lea    0xefa(%rip),%rdi
pop    %rbx
jmp    1030 <printf@plt>
lea    0xee3(%rip),%rdi
pop    %rbx
jmp    1030 <printf@plt>
lea    0xee9(%rip),%rdi
pop    %rbx
jmp    1030 <printf@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"ONE \00"
@.str.1 = [5 x i8] c"TWO \00"
@.str.2 = [7 x i8] c"THREE \00"
@.str.3 = [6 x i8] c"FOUR \00"
@.str.4 = [6 x i8] c"FIVE \00"
@.str.5 = [5 x i8] c"SIX \00"
@.str.6 = [7 x i8] c"SEVEN \00"
@.str.7 = [7 x i8] c"EIGHT \00"
@.str.8 = [6 x i8] c"NINE \00"
@.str.9 = [10 x i8] c"THOUSAND \00"
@.str.10 = [9 x i8] c"HUNDRED \00"
@.str.11 = [11 x i8] c"AND PAISE \00"
define void @simple(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
switch i32 %5, label %24 [
i32 1, label %6
i32 2, label %8
i32 3, label %10
i32 4, label %12
i32 5, label %14
i32 6, label %16
i32 7, label %18
i32 8, label %20
i32 9, label %22
]
6: ; preds = %2
%7 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %24
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %24
10: ; preds = %2
%11 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %24
12: ; preds = %2
%13 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %24
14: ; preds = %2
%15 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %24
16: ; preds = %2
%17 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
br label %24
18: ; preds = %2
%19 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
br label %24
20: ; preds = %2
%21 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
br label %24
22: ; preds = %2
%23 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
br label %24
24: ; preds = %2, %22, %20, %18, %16, %14, %12, %10, %8, %6
%25 = load i32, i32* %4
switch i32 %25, label %32 [
i32 0, label %26
i32 1, label %28
i32 3, label %30
]
26: ; preds = %24
%27 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0))
br label %32
28: ; preds = %24
%29 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0))
br label %32
30: ; preds = %24
%31 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.11, i64 0, i64 0))
br label %32
32: ; preds = %24, %30, %28, %26
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"ONE \00"
@.str.1 = [5 x i8] c"TWO \00"
@.str.2 = [7 x i8] c"THREE \00"
@.str.3 = [6 x i8] c"FOUR \00"
@.str.4 = [6 x i8] c"FIVE \00"
@.str.5 = [5 x i8] c"SIX \00"
@.str.6 = [7 x i8] c"SEVEN \00"
@.str.7 = [7 x i8] c"EIGHT \00"
@.str.8 = [6 x i8] c"NINE \00"
@.str.9 = [10 x i8] c"THOUSAND \00"
@.str.10 = [9 x i8] c"HUNDRED \00"
@.str.11 = [11 x i8] c"AND PAISE \00"
@reltable.simple = [9 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str to i64), i64 ptrtoint ([9 x i32]* @reltable.simple to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.1 to i64), i64 ptrtoint ([9 x i32]* @reltable.simple to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.2 to i64), i64 ptrtoint ([9 x i32]* @reltable.simple to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.3 to i64), i64 ptrtoint ([9 x i32]* @reltable.simple to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.4 to i64), i64 ptrtoint ([9 x i32]* @reltable.simple to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.5 to i64), i64 ptrtoint ([9 x i32]* @reltable.simple to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.6 to i64), i64 ptrtoint ([9 x i32]* @reltable.simple to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.7 to i64), i64 ptrtoint ([9 x i32]* @reltable.simple to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.8 to i64), i64 ptrtoint ([9 x i32]* @reltable.simple to i64)) to i32)]
define void @simple(i32 %0, i32 %1) {
%3 = add i32 %0, -1
%4 = icmp ult i32 %3, 9
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = sext i32 %3 to i64
%7 = shl i64 %6, 2
%8 = call i8* @llvm.load.relative.i64(i8* bitcast ([9 x i32]* @reltable.simple to i8*), i64 %7)
%9 = tail call i32 @printf(i8* dereferenceable(1) %8)
br label %10
10: ; preds = %2, %5
switch i32 %1, label %16 [
i32 0, label %13
i32 1, label %11
i32 3, label %12
]
11: ; preds = %10
br label %13
12: ; preds = %10
br label %13
13: ; preds = %10, %11, %12
%14 = phi i8* [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.11, i64 0, i64 0), %12 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), %11 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), %10 ]
%15 = tail call i32 @printf(i8* dereferenceable(1) %14)
br label %16
16: ; preds = %13, %10
ret void
}