#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 */
scalar_t__ CheckInventory(char *);
int CheckSuperWeaponPickup(void) {
  if (CheckInventory("Death Staff") || CheckInventory("Razorfang") ||
      CheckInventory("Sun Staff") || CheckInventory("Soul Reaver"))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<CheckSuperWeaponPickup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <CheckInventory@plt>
cmp    $0x0,%rax
jne    1170 <CheckSuperWeaponPickup+0x60>
lea    0xed7(%rip),%rdi
call   1030 <CheckInventory@plt>
cmp    $0x0,%rax
jne    1170 <CheckSuperWeaponPickup+0x60>
lea    0xecb(%rip),%rdi
call   1030 <CheckInventory@plt>
cmp    $0x0,%rax
jne    1170 <CheckSuperWeaponPickup+0x60>
lea    0xebf(%rip),%rdi
call   1030 <CheckInventory@plt>
cmp    $0x0,%rax
je     117c <CheckSuperWeaponPickup+0x6c>
movl   $0x1,-0x4(%rbp)
jmp    1183 <CheckSuperWeaponPickup+0x73>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CheckSuperWeaponPickup>:
push   %rbx
lea    0xee8(%rip),%rdi
call   1030 <CheckInventory@plt>
mov    $0x1,%ebx
test   %rax,%rax
jne    115d <CheckSuperWeaponPickup+0x4d>
lea    0xede(%rip),%rdi
call   1030 <CheckInventory@plt>
test   %rax,%rax
jne    115d <CheckSuperWeaponPickup+0x4d>
lea    0xed7(%rip),%rdi
call   1030 <CheckInventory@plt>
test   %rax,%rax
jne    115d <CheckSuperWeaponPickup+0x4d>
lea    0xed0(%rip),%rdi
call   1030 <CheckInventory@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Death Staff\00"
@.str.1 = [10 x i8] c"Razorfang\00"
@.str.2 = [10 x i8] c"Sun Staff\00"
@.str.3 = [12 x i8] c"Soul Reaver\00"
define i32 @CheckSuperWeaponPickup() {
%1 = alloca i32
%2 = call i64 @CheckInventory(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i64 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %0
%5 = call i64 @CheckInventory(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp ne i64 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %4
%8 = call i64 @CheckInventory(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%9 = icmp ne i64 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %7
%11 = call i64 @CheckInventory(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %10, %7, %4, %0
store i32 1, i32* %1
br label %15
14: ; preds = %10
store i32 0, i32* %1
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
@.str = [12 x i8] c"Death Staff\00"
@.str.1 = [10 x i8] c"Razorfang\00"
@.str.2 = [10 x i8] c"Sun Staff\00"
@.str.3 = [12 x i8] c"Soul Reaver\00"
define i32 @CheckSuperWeaponPickup() {
%1 = tail call i64 @CheckInventory(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %13
3: ; preds = %0
%4 = tail call i64 @CheckInventory(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = tail call i64 @CheckInventory(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = tail call i64 @CheckInventory(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%11 = icmp ne i64 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %9, %0, %3, %6
%14 = phi i32 [ 1, %6 ], [ 1, %3 ], [ 1, %0 ], [ %12, %9 ]
ret i32 %14
}