#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 */
struct obj_data {
  int dummy;
};
struct char_data {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ act(char *, int, struct char_data *, struct obj_data *,
                       int /*<<< orphan*/, int /*<<< orphan*/);
perform_wear(struct char_data *ch, struct obj_data *obj_object, int keyword) {
  char buffer[4096];
  struct char_data *i;
  switch (keyword) {
  case 0:
    act("$n light $p and holds it.", 0, ch, obj_object, 0, 0);
    break;
  case 1:
    act("$n wears $p on $s finger.", 1, ch, obj_object, 0, 0);
    break;
  case 2:
    act("$n wears $p around $s neck.", 1, ch, obj_object, 0, 0);
    break;
  case 3:
    act("$n wears $p on $s body.", 1, ch, obj_object, 0, 0);
    break;
  case 4:
    act("$n wears $p on $s head.", 1, ch, obj_object, 0, 0);
    break;
  case 5:
    act("$n wears $p on $s legs.", 1, ch, obj_object, 0, 0);
    break;
  case 6:
    act("$n wears $p on $s feet.", 1, ch, obj_object, 0, 0);
    break;
  case 7:
    act("$n wears $p on $s hands.", 1, ch, obj_object, 0, 0);
    break;
  case 8:
    act("$n wears $p on $s arms.", 1, ch, obj_object, 0, 0);
    break;
  case 9:
    act("$n wears $p about $s body.", 1, ch, obj_object, 0, 0);
    break;
  case 10:
    act("$n wears $p about $s waist.", 1, ch, obj_object, 0, 0);
    break;
  case 11:
    act("$n wears $p around $s wrist.", 1, ch, obj_object, 0, 0);
    break;
  case 12:
    act("$n wields $p.", 1, ch, obj_object, 0, 0);
    break;
  case 13:
    act("$n grabs $p.", 1, ch, obj_object, 0, 0);
    break;
  case 14:
    act("$n starts using $p as shield.", 1, ch, obj_object, 0, 0);
    break;
  }
}


x86 assembly (clang, -O0):
<perform_wear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1030,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %rax,-0x1030(%rbp)
sub    $0xe,%rax
ja     1366 <perform_wear+0x256>
mov    -0x1030(%rbp),%rax
lea    0xeb8(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xedc(%rip),%rdi
xor    %r9d,%r9d
mov    %r9d,%esi
mov    %r9d,%r8d
call   1030 <act@plt>
jmp    1366 <perform_wear+0x256>
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xed4(%rip),%rdi
mov    $0x1,%esi
xor    %r9d,%r9d
mov    %r9d,%r8d
call   1030 <act@plt>
jmp    1366 <perform_wear+0x256>
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xeca(%rip),%rdi
mov    $0x1,%esi
xor    %r9d,%r9d
mov    %r9d,%r8d
call   1030 <act@plt>
jmp    1366 <perform_wear+0x256>
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xec2(%rip),%rdi
mov    $0x1,%esi
xor    %r9d,%r9d
mov    %r9d,%r8d
call   1030 <act@plt>
jmp    1366 <perform_wear+0x256>
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xeb6(%rip),%rdi
mov    $0x1,%esi
xor    %r9d,%r9d
mov    %r9d,%r8d
call   1030 <act@plt>
jmp    1366 <perform_wear+0x256>
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xeaa(%rip),%rdi
mov    $0x1,%esi
xor    %r9d,%r9d
mov    %r9d,%r8d
call   1030 <act@plt>
jmp    1366 <perform_wear+0x256>
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xe9e(%rip),%rdi
mov    $0x1,%esi
xor    %r9d,%r9d
mov    %r9d,%r8d
call   1030 <act@plt>
jmp    1366 <perform_wear+0x256>
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xe92(%rip),%rdi
mov    $0x1,%esi
xor    %r9d,%r9d
mov    %r9d,%r8d
call   1030 <act@plt>
jmp    1366 <perform_wear+0x256>
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xe87(%rip),%rdi
mov    $0x1,%esi
xor    %r9d,%r9d
mov    %r9d,%r8d
call   1030 <act@plt>
jmp    1366 <perform_wear+0x256>
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xe7b(%rip),%rdi
mov    $0x1,%esi
xor    %r9d,%r9d
mov    %r9d,%r8d
call   1030 <act@plt>
jmp    1366 <perform_wear+0x256>
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xe72(%rip),%rdi
mov    $0x1,%esi
xor    %r9d,%r9d
mov    %r9d,%r8d
call   1030 <act@plt>
jmp    1366 <perform_wear+0x256>
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xe6a(%rip),%rdi
mov    $0x1,%esi
xor    %r9d,%r9d
mov    %r9d,%r8d
call   1030 <act@plt>
jmp    1366 <perform_wear+0x256>
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xe63(%rip),%rdi
mov    $0x1,%esi
xor    %r9d,%r9d
mov    %r9d,%r8d
call   1030 <act@plt>
jmp    1366 <perform_wear+0x256>
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xe4d(%rip),%rdi
mov    $0x1,%esi
xor    %r9d,%r9d
mov    %r9d,%r8d
call   1030 <act@plt>
jmp    1366 <perform_wear+0x256>
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xe36(%rip),%rdi
mov    $0x1,%esi
xor    %r9d,%r9d
mov    %r9d,%r8d
call   1030 <act@plt>
mov    -0x4(%rbp),%eax
add    $0x1030,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<perform_wear>:
push   %rax
cmp    $0xe,%edx
ja     11cf <perform_wear+0xbf>
mov    %rsi,%rcx
mov    %rdi,%rax
mov    %edx,%edx
lea    0xed7(%rip),%rsi
movslq (%rsi,%rdx,4),%rdx
add    %rsi,%rdx
jmp    *%rdx
lea    0xf03(%rip),%rdi
xor    %esi,%esi
jmp    11c1 <perform_wear+0xb1>
lea    0xf0f(%rip),%rdi
jmp    11bc <perform_wear+0xac>
lea    0xf20(%rip),%rdi
jmp    11bc <perform_wear+0xac>
lea    0xf33(%rip),%rdi
jmp    11bc <perform_wear+0xac>
lea    0xf42(%rip),%rdi
jmp    11bc <perform_wear+0xac>
lea    0xf51(%rip),%rdi
jmp    11bc <perform_wear+0xac>
lea    0xf60(%rip),%rdi
jmp    11bc <perform_wear+0xac>
lea    0xf6f(%rip),%rdi
jmp    11bc <perform_wear+0xac>
lea    0xf7f(%rip),%rdi
jmp    11bc <perform_wear+0xac>
lea    0xf8e(%rip),%rdi
jmp    11bc <perform_wear+0xac>
lea    0xfa0(%rip),%rdi
jmp    11bc <perform_wear+0xac>
lea    0xfb3(%rip),%rdi
jmp    11bc <perform_wear+0xac>
lea    0xfc7(%rip),%rdi
jmp    11bc <perform_wear+0xac>
lea    0xfcc(%rip),%rdi
jmp    11bc <perform_wear+0xac>
lea    0xfd0(%rip),%rdi
mov    $0x1,%esi
mov    %rax,%rdx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <act@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.char_data = type { i32 }
%struct.obj_data = type { i32 }
@.str = [26 x i8] c"$n light $p and holds it.\00"
@.str.1 = [26 x i8] c"$n wears $p on $s finger.\00"
@.str.2 = [28 x i8] c"$n wears $p around $s neck.\00"
@.str.3 = [24 x i8] c"$n wears $p on $s body.\00"
@.str.4 = [24 x i8] c"$n wears $p on $s head.\00"
@.str.5 = [24 x i8] c"$n wears $p on $s legs.\00"
@.str.6 = [24 x i8] c"$n wears $p on $s feet.\00"
@.str.7 = [25 x i8] c"$n wears $p on $s hands.\00"
@.str.8 = [24 x i8] c"$n wears $p on $s arms.\00"
@.str.9 = [27 x i8] c"$n wears $p about $s body.\00"
@.str.10 = [28 x i8] c"$n wears $p about $s waist.\00"
@.str.11 = [29 x i8] c"$n wears $p around $s wrist.\00"
@.str.12 = [14 x i8] c"$n wields $p.\00"
@.str.13 = [13 x i8] c"$n grabs $p.\00"
@.str.14 = [30 x i8] c"$n starts using $p as shield.\00"
define i32 @perform_wear(%struct.char_data* %0, %struct.obj_data* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.char_data*
%6 = alloca %struct.obj_data*
%7 = alloca i32
%8 = alloca [4096 x i8]
%9 = alloca %struct.char_data*
store %struct.char_data* %0, %struct.char_data** %5
store %struct.obj_data* %1, %struct.obj_data** %6
store i32 %2, i32* %7
%10 = load i32, i32* %7
switch i32 %10, label %71 [
i32 0, label %11
i32 1, label %15
i32 2, label %19
i32 3, label %23
i32 4, label %27
i32 5, label %31
i32 6, label %35
i32 7, label %39
i32 8, label %43
i32 9, label %47
i32 10, label %51
i32 11, label %55
i32 12, label %59
i32 13, label %63
i32 14, label %67
]
11: ; preds = %3
%12 = load %struct.char_data*, %struct.char_data** %5
%13 = load %struct.obj_data*, %struct.obj_data** %6
%14 = call i32 @act(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 0, %struct.char_data* %12, %struct.obj_data* %13, i32 0, i32 0)
br label %71
15: ; preds = %3
%16 = load %struct.char_data*, %struct.char_data** %5
%17 = load %struct.obj_data*, %struct.obj_data** %6
%18 = call i32 @act(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 1, %struct.char_data* %16, %struct.obj_data* %17, i32 0, i32 0)
br label %71
19: ; preds = %3
%20 = load %struct.char_data*, %struct.char_data** %5
%21 = load %struct.obj_data*, %struct.obj_data** %6
%22 = call i32 @act(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 1, %struct.char_data* %20, %struct.obj_data* %21, i32 0, i32 0)
br label %71
23: ; preds = %3
%24 = load %struct.char_data*, %struct.char_data** %5
%25 = load %struct.obj_data*, %struct.obj_data** %6
%26 = call i32 @act(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i32 1, %struct.char_data* %24, %struct.obj_data* %25, i32 0, i32 0)
br label %71
27: ; preds = %3
%28 = load %struct.char_data*, %struct.char_data** %5
%29 = load %struct.obj_data*, %struct.obj_data** %6
%30 = call i32 @act(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i32 1, %struct.char_data* %28, %struct.obj_data* %29, i32 0, i32 0)
br label %71
31: ; preds = %3
%32 = load %struct.char_data*, %struct.char_data** %5
%33 = load %struct.obj_data*, %struct.obj_data** %6
%34 = call i32 @act(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0), i32 1, %struct.char_data* %32, %struct.obj_data* %33, i32 0, i32 0)
br label %71
35: ; preds = %3
%36 = load %struct.char_data*, %struct.char_data** %5
%37 = load %struct.obj_data*, %struct.obj_data** %6
%38 = call i32 @act(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), i32 1, %struct.char_data* %36, %struct.obj_data* %37, i32 0, i32 0)
br label %71
39: ; preds = %3
%40 = load %struct.char_data*, %struct.char_data** %5
%41 = load %struct.obj_data*, %struct.obj_data** %6
%42 = call i32 @act(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0), i32 1, %struct.char_data* %40, %struct.obj_data* %41, i32 0, i32 0)
br label %71
43: ; preds = %3
%44 = load %struct.char_data*, %struct.char_data** %5
%45 = load %struct.obj_data*, %struct.obj_data** %6
%46 = call i32 @act(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.8, i64 0, i64 0), i32 1, %struct.char_data* %44, %struct.obj_data* %45, i32 0, i32 0)
br label %71
47: ; preds = %3
%48 = load %struct.char_data*, %struct.char_data** %5
%49 = load %struct.obj_data*, %struct.obj_data** %6
%50 = call i32 @act(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0), i32 1, %struct.char_data* %48, %struct.obj_data* %49, i32 0, i32 0)
br label %71
51: ; preds = %3
%52 = load %struct.char_data*, %struct.char_data** %5
%53 = load %struct.obj_data*, %struct.obj_data** %6
%54 = call i32 @act(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.10, i64 0, i64 0), i32 1, %struct.char_data* %52, %struct.obj_data* %53, i32 0, i32 0)
br label %71
55: ; preds = %3
%56 = load %struct.char_data*, %struct.char_data** %5
%57 = load %struct.obj_data*, %struct.obj_data** %6
%58 = call i32 @act(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.11, i64 0, i64 0), i32 1, %struct.char_data* %56, %struct.obj_data* %57, i32 0, i32 0)
br label %71
59: ; preds = %3
%60 = load %struct.char_data*, %struct.char_data** %5
%61 = load %struct.obj_data*, %struct.obj_data** %6
%62 = call i32 @act(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.12, i64 0, i64 0), i32 1, %struct.char_data* %60, %struct.obj_data* %61, i32 0, i32 0)
br label %71
63: ; preds = %3
%64 = load %struct.char_data*, %struct.char_data** %5
%65 = load %struct.obj_data*, %struct.obj_data** %6
%66 = call i32 @act(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.13, i64 0, i64 0), i32 1, %struct.char_data* %64, %struct.obj_data* %65, i32 0, i32 0)
br label %71
67: ; preds = %3
%68 = load %struct.char_data*, %struct.char_data** %5
%69 = load %struct.obj_data*, %struct.obj_data** %6
%70 = call i32 @act(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.14, i64 0, i64 0), i32 1, %struct.char_data* %68, %struct.obj_data* %69, i32 0, i32 0)
br label %71
71: ; preds = %3, %67, %63, %59, %55, %51, %47, %43, %39, %35, %31, %27, %23, %19, %15, %11
%72 = load i32, i32* %4
ret i32 %72
}

LLVM IR (-O2):
%struct.char_data = type { i32 }
%struct.obj_data = type { i32 }
@.str = [26 x i8] c"$n light $p and holds it.\00"
@.str.1 = [26 x i8] c"$n wears $p on $s finger.\00"
@.str.2 = [28 x i8] c"$n wears $p around $s neck.\00"
@.str.3 = [24 x i8] c"$n wears $p on $s body.\00"
@.str.4 = [24 x i8] c"$n wears $p on $s head.\00"
@.str.5 = [24 x i8] c"$n wears $p on $s legs.\00"
@.str.6 = [24 x i8] c"$n wears $p on $s feet.\00"
@.str.7 = [25 x i8] c"$n wears $p on $s hands.\00"
@.str.8 = [24 x i8] c"$n wears $p on $s arms.\00"
@.str.9 = [27 x i8] c"$n wears $p about $s body.\00"
@.str.10 = [28 x i8] c"$n wears $p about $s waist.\00"
@.str.11 = [29 x i8] c"$n wears $p around $s wrist.\00"
@.str.12 = [14 x i8] c"$n wields $p.\00"
@.str.13 = [13 x i8] c"$n grabs $p.\00"
@.str.14 = [30 x i8] c"$n starts using $p as shield.\00"
define i32 @perform_wear(%struct.char_data* %0, %struct.obj_data* %1, i32 %2) {
switch i32 %2, label %34 [
i32 0, label %4
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
i32 10, label %24
i32 11, label %26
i32 12, label %28
i32 13, label %30
i32 14, label %32
]
4: ; preds = %3
%5 = tail call i32 @act(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 0, %struct.char_data* %0, %struct.obj_data* %1, i32 0, i32 0)
br label %34
6: ; preds = %3
%7 = tail call i32 @act(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 1, %struct.char_data* %0, %struct.obj_data* %1, i32 0, i32 0)
br label %34
8: ; preds = %3
%9 = tail call i32 @act(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 1, %struct.char_data* %0, %struct.obj_data* %1, i32 0, i32 0)
br label %34
10: ; preds = %3
%11 = tail call i32 @act(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i32 1, %struct.char_data* %0, %struct.obj_data* %1, i32 0, i32 0)
br label %34
12: ; preds = %3
%13 = tail call i32 @act(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i32 1, %struct.char_data* %0, %struct.obj_data* %1, i32 0, i32 0)
br label %34
14: ; preds = %3
%15 = tail call i32 @act(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0), i32 1, %struct.char_data* %0, %struct.obj_data* %1, i32 0, i32 0)
br label %34
16: ; preds = %3
%17 = tail call i32 @act(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), i32 1, %struct.char_data* %0, %struct.obj_data* %1, i32 0, i32 0)
br label %34
18: ; preds = %3
%19 = tail call i32 @act(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0), i32 1, %struct.char_data* %0, %struct.obj_data* %1, i32 0, i32 0)
br label %34
20: ; preds = %3
%21 = tail call i32 @act(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.8, i64 0, i64 0), i32 1, %struct.char_data* %0, %struct.obj_data* %1, i32 0, i32 0)
br label %34
22: ; preds = %3
%23 = tail call i32 @act(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0), i32 1, %struct.char_data* %0, %struct.obj_data* %1, i32 0, i32 0)
br label %34
24: ; preds = %3
%25 = tail call i32 @act(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.10, i64 0, i64 0), i32 1, %struct.char_data* %0, %struct.obj_data* %1, i32 0, i32 0)
br label %34
26: ; preds = %3
%27 = tail call i32 @act(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.11, i64 0, i64 0), i32 1, %struct.char_data* %0, %struct.obj_data* %1, i32 0, i32 0)
br label %34
28: ; preds = %3
%29 = tail call i32 @act(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.12, i64 0, i64 0), i32 1, %struct.char_data* %0, %struct.obj_data* %1, i32 0, i32 0)
br label %34
30: ; preds = %3
%31 = tail call i32 @act(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.13, i64 0, i64 0), i32 1, %struct.char_data* %0, %struct.obj_data* %1, i32 0, i32 0)
br label %34
32: ; preds = %3
%33 = tail call i32 @act(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.14, i64 0, i64 0), i32 1, %struct.char_data* %0, %struct.obj_data* %1, i32 0, i32 0)
br label %34
34: ; preds = %3, %32, %30, %28, %26, %24, %22, %20, %18, %16, %14, %12, %10, %8, %6, %4
ret i32 undef
}