#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__ rom_present(char *);
int rivatnt2_available(void) {
  return rom_present(L"roms/video/nv_riva128/NV5diamond.bin") ||
         rom_present(L"roms/video/nv_riva128/inno3d64bit.BIN") ||
         rom_present(L"roms/video/nv_riva128/creative.BIN");
}


x86 assembly (clang, -O0):
<rivatnt2_available>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <rom_present@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x1(%rbp)
jne    116a <rivatnt2_available+0x5a>
lea    0xf57(%rip),%rdi
call   1030 <rom_present@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x1(%rbp)
jne    116a <rivatnt2_available+0x5a>
lea    0xfd1(%rip),%rdi
call   1030 <rom_present@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rivatnt2_available>:
push   %rbx
lea    0xee8(%rip),%rdi
call   1030 <rom_present@plt>
mov    $0x1,%ebx
test   %rax,%rax
jne    114c <rivatnt2_available+0x3c>
lea    0xf66(%rip),%rdi
call   1030 <rom_present@plt>
test   %rax,%rax
jne    114c <rivatnt2_available+0x3c>
lea    0xfed(%rip),%rdi
call   1030 <rom_present@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [37 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 110, i32 118, i32 95, i32 114, i32 105, i32 118, i32 97, i32 49, i32 50, i32 56, i32 47, i32 78, i32 86, i32 53, i32 100, i32 105, i32 97, i32 109, i32 111, i32 110, i32 100, i32 46, i32 98, i32 105, i32 110, i32 0]
@.str.1 = [38 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 110, i32 118, i32 95, i32 114, i32 105, i32 118, i32 97, i32 49, i32 50, i32 56, i32 47, i32 105, i32 110, i32 110, i32 111, i32 51, i32 100, i32 54, i32 52, i32 98, i32 105, i32 116, i32 46, i32 66, i32 73, i32 78, i32 0]
@.str.2 = [35 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 110, i32 118, i32 95, i32 114, i32 105, i32 118, i32 97, i32 49, i32 50, i32 56, i32 47, i32 99, i32 114, i32 101, i32 97, i32 116, i32 105, i32 118, i32 101, i32 46, i32 66, i32 73, i32 78, i32 0]
define i32 @rivatnt2_available() {
%1 = call i64 @rom_present(i8* bitcast ([37 x i32]* @.str to i8*))
%2 = icmp ne i64 %1, 0
br i1 %2, label %9, label %3
3: ; preds = %0
%4 = call i64 @rom_present(i8* bitcast ([38 x i32]* @.str.1 to i8*))
%5 = icmp ne i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = call i64 @rom_present(i8* bitcast ([35 x i32]* @.str.2 to i8*))
%8 = icmp ne i64 %7, 0
br label %9
9: ; preds = %6, %3, %0
%10 = phi i1 [ true, %3 ], [ true, %0 ], [ %8, %6 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
@.str = [37 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 110, i32 118, i32 95, i32 114, i32 105, i32 118, i32 97, i32 49, i32 50, i32 56, i32 47, i32 78, i32 86, i32 53, i32 100, i32 105, i32 97, i32 109, i32 111, i32 110, i32 100, i32 46, i32 98, i32 105, i32 110, i32 0]
@.str.1 = [38 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 110, i32 118, i32 95, i32 114, i32 105, i32 118, i32 97, i32 49, i32 50, i32 56, i32 47, i32 105, i32 110, i32 110, i32 111, i32 51, i32 100, i32 54, i32 52, i32 98, i32 105, i32 116, i32 46, i32 66, i32 73, i32 78, i32 0]
@.str.2 = [35 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 110, i32 118, i32 95, i32 114, i32 105, i32 118, i32 97, i32 49, i32 50, i32 56, i32 47, i32 99, i32 114, i32 101, i32 97, i32 116, i32 105, i32 118, i32 101, i32 46, i32 66, i32 73, i32 78, i32 0]
define i32 @rivatnt2_available() {
%1 = tail call i64 @rom_present(i8* bitcast ([37 x i32]* @.str to i8*))
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %10
3: ; preds = %0
%4 = tail call i64 @rom_present(i8* bitcast ([38 x i32]* @.str.1 to i8*))
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i64 @rom_present(i8* bitcast ([35 x i32]* @.str.2 to i8*))
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %3, %0
%11 = phi i32 [ 1, %3 ], [ 1, %0 ], [ %9, %6 ]
ret i32 %11
}