#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 d(int);
int /*<<< orphan*/ printf(char *);
void art250(void) {
  switch (d(10)) {
  case 1:
    printf("A gold ring set with bloodstones (250 gp)\n");
    break;
  case 2:
    printf("A carved ivory statuette (250 gp)\n");
    break;
  case 3:
    printf("A large gold bracelet (250 gp)\n");
    break;
  case 4:
    printf("A silver necklace with a gemstone pendant (250 gp)\n");
    break;
  case 5:
    printf("A bronze crown (250 gp)\n");
    break;
  case 6:
    printf("A silk robe with gold embroidery (250 gp)\n");
    break;
  case 7:
    printf("A large well-made tapestry (250 gp)\n");
    break;
  case 8:
    printf("A brass mug with jade inlay (250 gp)\n");
    break;
  case 9:
    printf("A box of turquoise animal figures (250 gp)\n");
    break;
  case 10:
    printf("A gold bird cage with electrum filigree (250 gp)\n");
    break;
  }
}


x86 assembly (clang, -O0):
<art250>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xa,%edi
call   1030 <d@plt>
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x8(%rbp)
sub    $0x9,%eax
ja     11fd <art250+0xdd>
mov    -0x8(%rbp),%rax
lea    0xeb1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xec9(%rip),%rdi
call   1040 <printf@plt>
jmp    11fd <art250+0xdd>
lea    0xee3(%rip),%rdi
call   1040 <printf@plt>
jmp    11fd <art250+0xdd>
lea    0xef5(%rip),%rdi
call   1040 <printf@plt>
jmp    11fd <art250+0xdd>
lea    0xf04(%rip),%rdi
call   1040 <printf@plt>
jmp    11fd <art250+0xdd>
lea    0xf27(%rip),%rdi
call   1040 <printf@plt>
jmp    11fd <art250+0xdd>
lea    0xf2f(%rip),%rdi
call   1040 <printf@plt>
jmp    11fd <art250+0xdd>
lea    0xf49(%rip),%rdi
call   1040 <printf@plt>
jmp    11fd <art250+0xdd>
lea    0xf5d(%rip),%rdi
call   1040 <printf@plt>
jmp    11fd <art250+0xdd>
lea    0xf72(%rip),%rdi
call   1040 <printf@plt>
jmp    11fd <art250+0xdd>
lea    0xf8d(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<art250>:
push   %rax
mov    $0xa,%edi
call   1040 <d@plt>
add    $0xffffffff,%eax
cmp    $0x9,%eax
ja     1149 <art250+0x29>
cltq
lea    0x104c(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
pop    %rax
jmp    1030 <puts@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [43 x i8] c"A gold ring set with bloodstones (250 gp)\0A\00"
@.str.1 = [35 x i8] c"A carved ivory statuette (250 gp)\0A\00"
@.str.2 = [32 x i8] c"A large gold bracelet (250 gp)\0A\00"
@.str.3 = [52 x i8] c"A silver necklace with a gemstone pendant (250 gp)\0A\00"
@.str.4 = [25 x i8] c"A bronze crown (250 gp)\0A\00"
@.str.5 = [43 x i8] c"A silk robe with gold embroidery (250 gp)\0A\00"
@.str.6 = [37 x i8] c"A large well-made tapestry (250 gp)\0A\00"
@.str.7 = [38 x i8] c"A brass mug with jade inlay (250 gp)\0A\00"
@.str.8 = [44 x i8] c"A box of turquoise animal figures (250 gp)\0A\00"
@.str.9 = [50 x i8] c"A gold bird cage with electrum filigree (250 gp)\0A\00"
define void @art250() {
%1 = call i32 @d(i32 10)
switch i32 %1, label %22 [
i32 1, label %2
i32 2, label %4
i32 3, label %6
i32 4, label %8
i32 5, label %10
i32 6, label %12
i32 7, label %14
i32 8, label %16
i32 9, label %18
i32 10, label %20
]
2: ; preds = %0
%3 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
br label %22
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
br label %22
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
br label %22
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0))
br label %22
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
br label %22
12: ; preds = %0
%13 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0))
br label %22
14: ; preds = %0
%15 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.6, i64 0, i64 0))
br label %22
16: ; preds = %0
%17 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.7, i64 0, i64 0))
br label %22
18: ; preds = %0
%19 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.8, i64 0, i64 0))
br label %22
20: ; preds = %0
%21 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.9, i64 0, i64 0))
br label %22
22: ; preds = %0, %20, %18, %16, %14, %12, %10, %8, %6, %4, %2
ret void
}

LLVM IR (-O2):
@str = [49 x i8] c"A gold bird cage with electrum filigree (250 gp)\00"
@str.10 = [43 x i8] c"A box of turquoise animal figures (250 gp)\00"
@str.11 = [37 x i8] c"A brass mug with jade inlay (250 gp)\00"
@str.12 = [36 x i8] c"A large well-made tapestry (250 gp)\00"
@str.13 = [42 x i8] c"A silk robe with gold embroidery (250 gp)\00"
@str.14 = [24 x i8] c"A bronze crown (250 gp)\00"
@str.15 = [51 x i8] c"A silver necklace with a gemstone pendant (250 gp)\00"
@str.16 = [31 x i8] c"A large gold bracelet (250 gp)\00"
@str.17 = [34 x i8] c"A carved ivory statuette (250 gp)\00"
@str.18 = [42 x i8] c"A gold ring set with bloodstones (250 gp)\00"
@reltable.art250 = [10 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([42 x i8]* @str.18 to i64), i64 ptrtoint ([10 x i32]* @reltable.art250 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([34 x i8]* @str.17 to i64), i64 ptrtoint ([10 x i32]* @reltable.art250 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([31 x i8]* @str.16 to i64), i64 ptrtoint ([10 x i32]* @reltable.art250 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([51 x i8]* @str.15 to i64), i64 ptrtoint ([10 x i32]* @reltable.art250 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([24 x i8]* @str.14 to i64), i64 ptrtoint ([10 x i32]* @reltable.art250 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([42 x i8]* @str.13 to i64), i64 ptrtoint ([10 x i32]* @reltable.art250 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([36 x i8]* @str.12 to i64), i64 ptrtoint ([10 x i32]* @reltable.art250 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([37 x i8]* @str.11 to i64), i64 ptrtoint ([10 x i32]* @reltable.art250 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([43 x i8]* @str.10 to i64), i64 ptrtoint ([10 x i32]* @reltable.art250 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([49 x i8]* @str to i64), i64 ptrtoint ([10 x i32]* @reltable.art250 to i64)) to i32)]
define void @art250() {
%1 = tail call i32 @d(i32 10)
%2 = add i32 %1, -1
%3 = icmp ult i32 %2, 10
br i1 %3, label %4, label %9
4: ; preds = %0
%5 = sext i32 %2 to i64
%6 = shl i64 %5, 2
%7 = call i8* @llvm.load.relative.i64(i8* bitcast ([10 x i32]* @reltable.art250 to i8*), i64 %6)
%8 = tail call i32 @puts(i8* dereferenceable(1) %7)
br label %9
9: ; preds = %0, %4
ret void
}