#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 argc, const char *argv[]) {
  for (int i = 1; i <= 10; i++) {
    char *c;
    switch (i) {
    case 1:
      c = "thumb";
      break;
    case 2:
      c = "shoe";
      break;
    case 3:
      c = "knee";
      break;
    case 4:
      c = "door";
      break;
    case 5:
      c = "hive";
      break;
    case 6:
      c = "sticks";
      break;
    case 7:
      c = "heaven";
      break;
    case 8:
      c = "pate";
      break;
    case 9:
      c = "spine";
      break;
    case 10:
      c = "skin";
      break;
    }
    printf("This old man, he played %d.\n", i);
    printf("He played knick-knack on my %s\n", c);
    printf("With a Knick-Knac, paddy-whack,\n");
    printf("Give your dog a hone.\n");
    printf("This old man came rolling home.\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jg     1256 <main+0x146>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x28(%rbp)
sub    $0x9,%eax
ja     11fb <main+0xeb>
mov    -0x28(%rbp),%rax
lea    0xea9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xec1(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    11fb <main+0xeb>
lea    0xeb7(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    11fb <main+0xeb>
lea    0xeac(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    11fb <main+0xeb>
lea    0xea1(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    11fb <main+0xeb>
lea    0xe96(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    11fb <main+0xeb>
lea    0xe8b(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    11fb <main+0xeb>
lea    0xe82(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    11fb <main+0xeb>
lea    0xe79(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    11fb <main+0xeb>
lea    0xe6e(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    11fb <main+0xeb>
lea    0xe64(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rsi
lea    0xe66(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xf9a(%rip),%r15
lea    0xf3c(%rip),%r12
lea    0xf55(%rip),%r13
lea    0xf64(%rip),%rbx
xor    %ebp,%ebp
jmp    1192 <main+0x72>
nopl   0x0(%rax,%rax,1)
lea    0xee1(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeee(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
call   1030 <puts@plt>
mov    %r13,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
add    $0x4,%r15
cmp    $0xa,%ebp
je     11ab <main+0x8b>
mov    %ebp,%eax
lea    0x1(%rax),%ebp
cmp    $0x9,%eax
ja     1150 <main+0x30>
movslq (%r15),%r14
lea    0xf26(%rip),%rax
add    %rax,%r14
jmp    1150 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"thumb\00"
@.str.1 = [5 x i8] c"shoe\00"
@.str.2 = [5 x i8] c"knee\00"
@.str.3 = [5 x i8] c"door\00"
@.str.4 = [5 x i8] c"hive\00"
@.str.5 = [7 x i8] c"sticks\00"
@.str.6 = [7 x i8] c"heaven\00"
@.str.7 = [5 x i8] c"pate\00"
@.str.8 = [6 x i8] c"spine\00"
@.str.9 = [5 x i8] c"skin\00"
@.str.10 = [29 x i8] c"This old man, he played %d.\0A\00"
@.str.11 = [32 x i8] c"He played knick-knack on my %s\0A\00"
@.str.12 = [33 x i8] c"With a Knick-Knac, paddy-whack,\0A\00"
@.str.13 = [23 x i8] c"Give your dog a hone.\0A\00"
@.str.14 = [33 x i8] c"This old man came rolling home.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
br label %8
8: ; preds = %31, %2
%9 = load i32, i32* %6
%10 = icmp sle i32 %9, 10
br i1 %10, label %11, label %34
11: ; preds = %8
%12 = load i32, i32* %6
switch i32 %12, label %23 [
i32 1, label %13
i32 2, label %14
i32 3, label %15
i32 4, label %16
i32 5, label %17
i32 6, label %18
i32 7, label %19
i32 8, label %20
i32 9, label %21
i32 10, label %22
]
13: ; preds = %11
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %7
br label %23
14: ; preds = %11
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %7
br label %23
15: ; preds = %11
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8** %7
br label %23
16: ; preds = %11
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8** %7
br label %23
17: ; preds = %11
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8** %7
br label %23
18: ; preds = %11
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i8** %7
br label %23
19: ; preds = %11
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8** %7
br label %23
20: ; preds = %11
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8** %7
br label %23
21: ; preds = %11
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i8** %7
br label %23
22: ; preds = %11
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i8** %7
br label %23
23: ; preds = %11, %22, %21, %20, %19, %18, %17, %16, %15, %14, %13
%24 = load i32, i32* %6
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.10, i64 0, i64 0), i32 %24)
%26 = load i8*, i8** %7
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.11, i64 0, i64 0), i8* %26)
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.12, i64 0, i64 0))
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.13, i64 0, i64 0))
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.14, i64 0, i64 0))
br label %31
31: ; preds = %23
%32 = load i32, i32* %6
%33 = add nsw i32 %32, 1
store i32 %33, i32* %6
br label %8
34: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"thumb\00"
@.str.1 = [5 x i8] c"shoe\00"
@.str.2 = [5 x i8] c"knee\00"
@.str.3 = [5 x i8] c"door\00"
@.str.4 = [5 x i8] c"hive\00"
@.str.5 = [7 x i8] c"sticks\00"
@.str.6 = [7 x i8] c"heaven\00"
@.str.7 = [5 x i8] c"pate\00"
@.str.8 = [6 x i8] c"spine\00"
@.str.9 = [5 x i8] c"skin\00"
@.str.10 = [29 x i8] c"This old man, he played %d.\0A\00"
@.str.11 = [32 x i8] c"He played knick-knack on my %s\0A\00"
@str = [32 x i8] c"With a Knick-Knac, paddy-whack,\00"
@str.15 = [22 x i8] c"Give your dog a hone.\00"
@str.16 = [32 x i8] c"This old man came rolling home.\00"
@reltable.main = [10 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str to i64), i64 ptrtoint ([10 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.1 to i64), i64 ptrtoint ([10 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.2 to i64), i64 ptrtoint ([10 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.3 to i64), i64 ptrtoint ([10 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.4 to i64), i64 ptrtoint ([10 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.5 to i64), i64 ptrtoint ([10 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.6 to i64), i64 ptrtoint ([10 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.7 to i64), i64 ptrtoint ([10 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.8 to i64), i64 ptrtoint ([10 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.9 to i64), i64 ptrtoint ([10 x i32]* @reltable.main to i64)) to i32)]
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %4
3: ; preds = %13
ret i32 0
4: ; preds = %2, %13
%5 = phi i8* [ undef, %2 ], [ %14, %13 ]
%6 = phi i32 [ 1, %2 ], [ %20, %13 ]
%7 = add nsw i32 %6, -1
%8 = icmp ult i32 %7, 10
br i1 %8, label %9, label %13
9: ; preds = %4
%10 = sext i32 %7 to i64
%11 = shl i64 %10, 2
%12 = call i8* @llvm.load.relative.i64(i8* bitcast ([10 x i32]* @reltable.main to i8*), i64 %11)
br label %13
13: ; preds = %9, %4
%14 = phi i8* [ %5, %4 ], [ %12, %9 ]
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.10, i64 0, i64 0), i32 %6)
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.11, i64 0, i64 0), i8* %14)
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.15, i64 0, i64 0))
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.16, i64 0, i64 0))
%20 = add nuw nsw i32 %6, 1
%21 = icmp eq i32 %20, 11
br i1 %21, label %3, label %4
}