#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 */
typedef int uint8_t;
typedef int uint16_t;
typedef int int8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int makeInteger(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scan(int /*<<< orphan*/ *, char *, int, int);
int get_item(FILE *fp) {
  char num;
  char buf[256];
  int dum = 0;
  unsigned long value = 0;
  uint8_t type;
  uint16_t low, mid, high;
  int align, cursed, special;
  scan(fp, buf, 16, 0);
  buf[buf[0] + 1] = 0;
  printf("Identified Name    : %s\n", &buf[1]);
  scan(fp, buf, 16, 0);
  buf[buf[0] + 1] = 0;
  printf("Un-identified Name : %s\n", &buf[1]);
  scan(fp, buf, 2, 1);
  type = makeInteger(buf);
  printf("Type               : %d\n", type);
  switch (type) {
  case 0:
  case 1:
  case 2:
  case 3:
  case 5:
  case 6:
    scan(fp, buf, 2, 0);
    align = makeInteger(buf);
    printf("Align              : %d\n", align);
    scan(fp, buf, 2, 0);
    cursed = makeInteger(buf);
    printf("Cursed             : %d\n", cursed);
    scan(fp, buf, 2, 0);
    special = makeInteger(buf);
    printf("Special            : %d\n", special);
    scan(fp, buf, 4, 1);
    scan(fp, buf, 2, 0);
    low = makeInteger(buf);
    scan(fp, buf, 2, 0);
    mid = makeInteger(buf);
    scan(fp, buf, 2, 0);
    high = makeInteger(buf);
    printf("low                : %d\n", low);
    printf("mid                : %d\n", mid);
    printf("high               : %d\n", high);
    value = low + (mid * 10000) + (high * 10000 * 10000);
    printf("Value              : %ld\n", value);
    scan(fp, buf, 6, 1);
    scan(fp, buf, 1, 1);
    scan(fp, buf, 7, 1);
    scan(fp, buf, 1, 0);
    printf("Armor Class        : %d\n", (int8_t)buf[0]);
    scan(fp, buf, 13, 1);
    break;
  case 90:
    scan(fp, buf, 1, 1);
    break;
  default:
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<get_item>:
push   %rbp
mov    %rsp,%rbp
sub    $0x160,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x114(%rbp)
movq   $0x0,-0x120(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x110(%rbp),%rsi
mov    %rsi,-0x150(%rbp)
mov    $0x10,%edx
mov    %edx,-0x160(%rbp)
xor    %ecx,%ecx
mov    %ecx,-0x15c(%rbp)
call   1050 <scan@plt>
mov    -0x150(%rbp),%rdx
mov    -0x15c(%rbp),%eax
movsbq -0x110(%rbp),%rcx
ff
movb   $0x0,0x1(%rcx,%rdx,1)
lea    -0x10f(%rbp),%rsi
mov    %rsi,-0x158(%rbp)
lea    0xe53(%rip),%rdi
mov    %al,-0x141(%rbp)
call   1040 <printf@plt>
mov    -0x160(%rbp),%edx
mov    -0x15c(%rbp),%ecx
mov    -0x150(%rbp),%rsi
mov    -0x8(%rbp),%rdi
call   1050 <scan@plt>
mov    -0x158(%rbp),%rsi
mov    -0x150(%rbp),%rdx
mov    -0x141(%rbp),%al
movsbq -0x110(%rbp),%rcx
ff
movb   $0x0,0x1(%rcx,%rdx,1)
lea    0xe1d(%rip),%rdi
call   1040 <printf@plt>
mov    -0x150(%rbp),%rsi
mov    -0x8(%rbp),%rdi
mov    $0x2,%edx
mov    $0x1,%ecx
call   1050 <scan@plt>
mov    -0x150(%rbp),%rdi
call   1030 <makeInteger@plt>
mov    %eax,%ecx
mov    -0x141(%rbp),%al
mov    %ecx,-0x124(%rbp)
mov    -0x124(%rbp),%esi
lea    0xdf0(%rip),%rdi
call   1040 <printf@plt>
mov    -0x124(%rbp),%eax
mov    %eax,-0x140(%rbp)
sub    $0x4,%eax
jb     128c <get_item+0x15c>
jmp    1261 <get_item+0x131>
mov    -0x140(%rbp),%eax
add    $0xfffffffb,%eax
sub    $0x2,%eax
jb     128c <get_item+0x15c>
jmp    1278 <get_item+0x148>
mov    -0x140(%rbp),%eax
sub    $0x5a,%eax
je     14ec <get_item+0x3bc>
jmp    1508 <get_item+0x3d8>
mov    -0x8(%rbp),%rdi
lea    -0x110(%rbp),%rsi
mov    $0x2,%edx
xor    %ecx,%ecx
call   1050 <scan@plt>
lea    -0x110(%rbp),%rdi
call   1030 <makeInteger@plt>
mov    %eax,-0x134(%rbp)
mov    -0x134(%rbp),%esi
lea    0xd89(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x110(%rbp),%rsi
mov    $0x2,%edx
xor    %ecx,%ecx
call   1050 <scan@plt>
lea    -0x110(%rbp),%rdi
call   1030 <makeInteger@plt>
mov    %eax,-0x138(%rbp)
mov    -0x138(%rbp),%esi
lea    0xd65(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x110(%rbp),%rsi
mov    $0x2,%edx
xor    %ecx,%ecx
call   1050 <scan@plt>
lea    -0x110(%rbp),%rdi
call   1030 <makeInteger@plt>
mov    %eax,-0x13c(%rbp)
mov    -0x13c(%rbp),%esi
lea    0xd41(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x110(%rbp),%rsi
mov    $0x4,%edx
mov    $0x1,%ecx
call   1050 <scan@plt>
mov    -0x8(%rbp),%rdi
lea    -0x110(%rbp),%rsi
mov    $0x2,%edx
xor    %ecx,%ecx
call   1050 <scan@plt>
lea    -0x110(%rbp),%rdi
call   1030 <makeInteger@plt>
mov    %eax,-0x128(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x110(%rbp),%rsi
mov    $0x2,%edx
xor    %ecx,%ecx
call   1050 <scan@plt>
lea    -0x110(%rbp),%rdi
call   1030 <makeInteger@plt>
mov    %eax,-0x12c(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x110(%rbp),%rsi
mov    $0x2,%edx
xor    %ecx,%ecx
call   1050 <scan@plt>
lea    -0x110(%rbp),%rdi
call   1030 <makeInteger@plt>
mov    %eax,-0x130(%rbp)
mov    -0x128(%rbp),%esi
lea    0xcb1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x12c(%rbp),%esi
lea    0xcb6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x130(%rbp),%esi
lea    0xcbb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x128(%rbp),%eax
imul   $0x2710,-0x12c(%rbp),%ecx
add    %ecx,%eax
imul   $0x2710,-0x130(%rbp),%ecx
imul   $0x2710,%ecx,%ecx
add    %ecx,%eax
cltq
mov    %rax,-0x120(%rbp)
mov    -0x120(%rbp),%rsi
lea    0xc92(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x110(%rbp),%rsi
mov    $0x6,%edx
mov    $0x1,%ecx
call   1050 <scan@plt>
mov    -0x8(%rbp),%rdi
lea    -0x110(%rbp),%rsi
mov    $0x1,%ecx
mov    %ecx,%edx
call   1050 <scan@plt>
mov    -0x8(%rbp),%rdi
lea    -0x110(%rbp),%rsi
mov    $0x7,%edx
mov    $0x1,%ecx
call   1050 <scan@plt>
mov    -0x8(%rbp),%rdi
lea    -0x110(%rbp),%rsi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1050 <scan@plt>
movsbl -0x110(%rbp),%esi
lea    0xc35(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x110(%rbp),%rsi
mov    $0xd,%edx
mov    $0x1,%ecx
call   1050 <scan@plt>
jmp    150d <get_item+0x3dd>
mov    -0x8(%rbp),%rdi
lea    -0x110(%rbp),%rsi
mov    $0x1,%ecx
mov    %ecx,%edx
call   1050 <scan@plt>
jmp    150d <get_item+0x3dd>
jmp    150d <get_item+0x3dd>
xor    %eax,%eax
add    $0x160,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_item>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x100,%rsp
mov    %rdi,%rbx
mov    %rsp,%rbp
mov    %rbp,%rsi
mov    $0x10,%edx
xor    %ecx,%ecx
call   1050 <scan@plt>
movsbq (%rsp),%rax
movb   $0x0,0x1(%rax,%rbp,1)
lea    0x1(%rsp),%r14
lea    0xe96(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    $0x10,%edx
xor    %ecx,%ecx
call   1050 <scan@plt>
movsbq (%rsp),%rax
movb   $0x0,0x1(%rax,%rbp,1)
lea    0xe82(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%r14d
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    $0x2,%edx
mov    $0x1,%ecx
call   1050 <scan@plt>
mov    %rbp,%rdi
call   1030 <makeInteger@plt>
mov    %eax,%ebp
lea    0xe65(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x6,%ebp
ja     13b7 <get_item+0x287>
cmp    $0x4,%ebp
je     13b7 <get_item+0x287>
mov    %rsp,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x2,%edx
xor    %ecx,%ecx
call   1050 <scan@plt>
mov    %r14,%rdi
call   1030 <makeInteger@plt>
lea    0xe3f(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x2,%edx
xor    %ecx,%ecx
call   1050 <scan@plt>
mov    %r14,%rdi
call   1030 <makeInteger@plt>
lea    0xe2e(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x2,%edx
xor    %ecx,%ecx
call   1050 <scan@plt>
mov    %r14,%rdi
call   1030 <makeInteger@plt>
lea    0xe1d(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x4,%edx
mov    $0x1,%ecx
call   1050 <scan@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x2,%edx
xor    %ecx,%ecx
call   1050 <scan@plt>
mov    %r14,%rdi
call   1030 <makeInteger@plt>
mov    %eax,%r15d
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x2,%edx
xor    %ecx,%ecx
call   1050 <scan@plt>
mov    %r14,%rdi
call   1030 <makeInteger@plt>
mov    %eax,%r12d
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x2,%edx
xor    %ecx,%ecx
call   1050 <scan@plt>
mov    %r14,%rdi
call   1030 <makeInteger@plt>
mov    %eax,%ebp
lea    0xdbb(%rip),%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xdc3(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xdcb(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
imul   $0x2710,%r12d,%eax
add    %r15d,%eax
imul   $0x5f5e100,%ebp,%ecx
add    %eax,%ecx
movslq %ecx,%rsi
lea    0xdbf(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x6,%edx
mov    $0x1,%ecx
call   1050 <scan@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x1,%edx
mov    $0x1,%ecx
call   1050 <scan@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x7,%edx
mov    $0x1,%ecx
call   1050 <scan@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1050 <scan@plt>
movsbl (%rsp),%esi
lea    0xd76(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xd,%r14d
mov    %rsp,%rsi
mov    %rbx,%rdi
mov    %r14d,%edx
mov    $0x1,%ecx
call   1050 <scan@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
cmp    $0x5a,%ebp
je     1392 <get_item+0x262>
jmp    13a5 <get_item+0x275>

LLVM IR (-O0):
@.str = [25 x i8] c"Identified Name : %s\0A\00"
@.str.1 = [25 x i8] c"Un-identified Name : %s\0A\00"
@.str.2 = [25 x i8] c"Type : %d\0A\00"
@.str.3 = [25 x i8] c"Align : %d\0A\00"
@.str.4 = [25 x i8] c"Cursed : %d\0A\00"
@.str.5 = [25 x i8] c"Special : %d\0A\00"
@.str.6 = [25 x i8] c"low : %d\0A\00"
@.str.7 = [25 x i8] c"mid : %d\0A\00"
@.str.8 = [25 x i8] c"high : %d\0A\00"
@.str.9 = [26 x i8] c"Value : %ld\0A\00"
@.str.10 = [25 x i8] c"Armor Class : %d\0A\00"
define i32 @get_item(i32* %0) {
%2 = alloca i32*
%3 = alloca i8
%4 = alloca [256 x i8]
%5 = alloca i32
%6 = alloca i64
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %5
store i64 0, i64* %6
%14 = load i32*, i32** %2
%15 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%16 = call i32 @scan(i32* %14, i8* %15, i32 16, i32 0)
%17 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = add nsw i32 %19, 1
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %21
store i8 0, i8* %22
%23 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 1
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %23)
%25 = load i32*, i32** %2
%26 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%27 = call i32 @scan(i32* %25, i8* %26, i32 16, i32 0)
%28 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = add nsw i32 %30, 1
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %32
store i8 0, i8* %33
%34 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 1
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %34)
%36 = load i32*, i32** %2
%37 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%38 = call i32 @scan(i32* %36, i8* %37, i32 2, i32 1)
%39 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%40 = call i32 @makeInteger(i8* %39)
store i32 %40, i32* %7
%41 = load i32, i32* %7
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %41)
%43 = load i32, i32* %7
switch i32 %43, label %124 [
i32 0, label %44
i32 1, label %44
i32 2, label %44
i32 3, label %44
i32 5, label %44
i32 6, label %44
i32 90, label %120
]
44: ; preds = %1, %1, %1, %1, %1, %1
%45 = load i32*, i32** %2
%46 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%47 = call i32 @scan(i32* %45, i8* %46, i32 2, i32 0)
%48 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%49 = call i32 @makeInteger(i8* %48)
store i32 %49, i32* %11
%50 = load i32, i32* %11
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i32 %50)
%52 = load i32*, i32** %2
%53 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%54 = call i32 @scan(i32* %52, i8* %53, i32 2, i32 0)
%55 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%56 = call i32 @makeInteger(i8* %55)
store i32 %56, i32* %12
%57 = load i32, i32* %12
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 %57)
%59 = load i32*, i32** %2
%60 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%61 = call i32 @scan(i32* %59, i8* %60, i32 2, i32 0)
%62 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%63 = call i32 @makeInteger(i8* %62)
store i32 %63, i32* %13
%64 = load i32, i32* %13
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i32 %64)
%66 = load i32*, i32** %2
%67 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%68 = call i32 @scan(i32* %66, i8* %67, i32 4, i32 1)
%69 = load i32*, i32** %2
%70 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%71 = call i32 @scan(i32* %69, i8* %70, i32 2, i32 0)
%72 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%73 = call i32 @makeInteger(i8* %72)
store i32 %73, i32* %8
%74 = load i32*, i32** %2
%75 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%76 = call i32 @scan(i32* %74, i8* %75, i32 2, i32 0)
%77 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%78 = call i32 @makeInteger(i8* %77)
store i32 %78, i32* %9
%79 = load i32*, i32** %2
%80 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%81 = call i32 @scan(i32* %79, i8* %80, i32 2, i32 0)
%82 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%83 = call i32 @makeInteger(i8* %82)
store i32 %83, i32* %10
%84 = load i32, i32* %8
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0), i32 %84)
%86 = load i32, i32* %9
%87 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0), i32 %86)
%88 = load i32, i32* %10
%89 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.8, i64 0, i64 0), i32 %88)
%90 = load i32, i32* %8
%91 = load i32, i32* %9
%92 = mul nsw i32 %91, 10000
%93 = add nsw i32 %90, %92
%94 = load i32, i32* %10
%95 = mul nsw i32 %94, 10000
%96 = mul nsw i32 %95, 10000
%97 = add nsw i32 %93, %96
%98 = sext i32 %97 to i64
store i64 %98, i64* %6
%99 = load i64, i64* %6
%100 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.9, i64 0, i64 0), i64 %99)
%101 = load i32*, i32** %2
%102 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%103 = call i32 @scan(i32* %101, i8* %102, i32 6, i32 1)
%104 = load i32*, i32** %2
%105 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%106 = call i32 @scan(i32* %104, i8* %105, i32 1, i32 1)
%107 = load i32*, i32** %2
%108 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%109 = call i32 @scan(i32* %107, i8* %108, i32 7, i32 1)
%110 = load i32*, i32** %2
%111 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%112 = call i32 @scan(i32* %110, i8* %111, i32 1, i32 0)
%113 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%114 = load i8, i8* %113
%115 = sext i8 %114 to i32
%116 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.10, i64 0, i64 0), i32 %115)
%117 = load i32*, i32** %2
%118 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%119 = call i32 @scan(i32* %117, i8* %118, i32 13, i32 1)
br label %125
120: ; preds = %1
%121 = load i32*, i32** %2
%122 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%123 = call i32 @scan(i32* %121, i8* %122, i32 1, i32 1)
br label %125
124: ; preds = %1
br label %125
125: ; preds = %124, %120, %44
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"Identified Name : %s\0A\00"
@.str.1 = [25 x i8] c"Un-identified Name : %s\0A\00"
@.str.2 = [25 x i8] c"Type : %d\0A\00"
@.str.3 = [25 x i8] c"Align : %d\0A\00"
@.str.4 = [25 x i8] c"Cursed : %d\0A\00"
@.str.5 = [25 x i8] c"Special : %d\0A\00"
@.str.6 = [25 x i8] c"low : %d\0A\00"
@.str.7 = [25 x i8] c"mid : %d\0A\00"
@.str.8 = [25 x i8] c"high : %d\0A\00"
@.str.9 = [26 x i8] c"Value : %ld\0A\00"
@.str.10 = [25 x i8] c"Armor Class : %d\0A\00"
define i32 @get_item(i32* %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = call i32 @scan(i32* %0, i8* %3, i32 16, i32 0)
%5 = load i8, i8* %3
%6 = sext i8 %5 to i64
%7 = add nsw i64 %6, 1
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 %7
store i8 0, i8* %8
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 1
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = call i32 @scan(i32* %0, i8* %3, i32 16, i32 0)
%12 = load i8, i8* %3
%13 = sext i8 %12 to i64
%14 = add nsw i64 %13, 1
%15 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 %14
store i8 0, i8* %15
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%17 = call i32 @scan(i32* %0, i8* %3, i32 2, i32 1)
%18 = call i32 @makeInteger(i8* %3)
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %18)
switch i32 %18, label %56 [
i32 0, label %20
i32 1, label %20
i32 2, label %20
i32 3, label %20
i32 5, label %20
i32 6, label %20
i32 90, label %53
]
20: ; preds = %1, %1, %1, %1, %1, %1
%21 = call i32 @scan(i32* %0, i8* %3, i32 2, i32 0)
%22 = call i32 @makeInteger(i8* %3)
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i32 %22)
%24 = call i32 @scan(i32* %0, i8* %3, i32 2, i32 0)
%25 = call i32 @makeInteger(i8* %3)
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 %25)
%27 = call i32 @scan(i32* %0, i8* %3, i32 2, i32 0)
%28 = call i32 @makeInteger(i8* %3)
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i32 %28)
%30 = call i32 @scan(i32* %0, i8* %3, i32 4, i32 1)
%31 = call i32 @scan(i32* %0, i8* %3, i32 2, i32 0)
%32 = call i32 @makeInteger(i8* %3)
%33 = call i32 @scan(i32* %0, i8* %3, i32 2, i32 0)
%34 = call i32 @makeInteger(i8* %3)
%35 = call i32 @scan(i32* %0, i8* %3, i32 2, i32 0)
%36 = call i32 @makeInteger(i8* %3)
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0), i32 %32)
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0), i32 %34)
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.8, i64 0, i64 0), i32 %36)
%40 = mul nsw i32 %34, 10000
%41 = add nsw i32 %40, %32
%42 = mul i32 %36, 100000000
%43 = add nsw i32 %41, %42
%44 = sext i32 %43 to i64
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.9, i64 0, i64 0), i64 %44)
%46 = call i32 @scan(i32* %0, i8* %3, i32 6, i32 1)
%47 = call i32 @scan(i32* %0, i8* %3, i32 1, i32 1)
%48 = call i32 @scan(i32* %0, i8* %3, i32 7, i32 1)
%49 = call i32 @scan(i32* %0, i8* %3, i32 1, i32 0)
%50 = load i8, i8* %3
%51 = sext i8 %50 to i32
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.10, i64 0, i64 0), i32 %51)
br label %53
53: ; preds = %1, %20
%54 = phi i32 [ 13, %20 ], [ 1, %1 ]
%55 = call i32 @scan(i32* %0, i8* %3, i32 %54, i32 1)
br label %56
56: ; preds = %53, %1
ret i32 0
}