unsigned long intc_getvicirqstatus() {
  if ((*((volatile unsigned long *)((0xF2000000) + 0x00))))
    return (*((volatile unsigned long *)((0xF2000000) + 0x00)));
  else if ((*((volatile unsigned long *)((0xF2100000) + 0x00))))
    return (*((volatile unsigned long *)((0xF2100000) + 0x00))) + 32;
  else if ((*((volatile unsigned long *)((0xF2200000) + 0x00))))
    return (*((volatile unsigned long *)((0xF2200000) + 0x00))) + 64;
  else if ((*((volatile unsigned long *)((0xF2300000) + 0x00))))
    return (*((volatile unsigned long *)((0xF2300000) + 0x00))) + 96;
  else
    return -1;
}


x86 assembly (clang, -O0):
<intc_getvicirqstatus>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf2000000,%eax
mov    (%rax),%rax
cmp    $0x0,%rax
je     1127 <intc_getvicirqstatus+0x27>
mov    $0xf2000000,%eax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    11a4 <intc_getvicirqstatus+0xa4>
mov    $0xf2100000,%eax
mov    (%rax),%rax
cmp    $0x0,%rax
je     114e <intc_getvicirqstatus+0x4e>
mov    $0xf2100000,%eax
mov    (%rax),%rax
add    $0x20,%rax
mov    %rax,-0x8(%rbp)
jmp    11a4 <intc_getvicirqstatus+0xa4>
mov    $0xf2200000,%eax
mov    (%rax),%rax
cmp    $0x0,%rax
je     1175 <intc_getvicirqstatus+0x75>
mov    $0xf2200000,%eax
mov    (%rax),%rax
add    $0x40,%rax
mov    %rax,-0x8(%rbp)
jmp    11a4 <intc_getvicirqstatus+0xa4>
mov    $0xf2300000,%eax
mov    (%rax),%rax
cmp    $0x0,%rax
je     119c <intc_getvicirqstatus+0x9c>
mov    $0xf2300000,%eax
mov    (%rax),%rax
add    $0x60,%rax
mov    %rax,-0x8(%rbp)
jmp    11a4 <intc_getvicirqstatus+0xa4>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intc_getvicirqstatus>:
mov    $0xf2000000,%eax
cmpq   $0x0,(%rax)
je     110f <intc_getvicirqstatus+0xf>
mov    (%rax),%rax
ret
cmpq   $0x0,0x100000(%rax)
je     1125 <intc_getvicirqstatus+0x25>
mov    0x100000(%rax),%rax
add    $0x20,%rax
ret
cmpq   $0x0,0x200000(%rax)
je     113b <intc_getvicirqstatus+0x3b>
mov    0x200000(%rax),%rax
add    $0x40,%rax
ret
cmpq   $0x0,0x300000(%rax)
je     1151 <intc_getvicirqstatus+0x51>
mov    0x300000(%rax),%rax
add    $0x60,%rax
ret
mov    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i64 @intc_getvicirqstatus() {
%1 = alloca i64
%2 = load volatile i64, i64* inttoptr (i64 4060086272 to i64*)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = load volatile i64, i64* inttoptr (i64 4060086272 to i64*)
store i64 %5, i64* %1
br label %25
6: ; preds = %0
%7 = load volatile i64, i64* inttoptr (i64 4061134848 to i64*)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load volatile i64, i64* inttoptr (i64 4061134848 to i64*)
%11 = add i64 %10, 32
store i64 %11, i64* %1
br label %25
12: ; preds = %6
%13 = load volatile i64, i64* inttoptr (i64 4062183424 to i64*)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load volatile i64, i64* inttoptr (i64 4062183424 to i64*)
%17 = add i64 %16, 64
store i64 %17, i64* %1
br label %25
18: ; preds = %12
%19 = load volatile i64, i64* inttoptr (i64 4063232000 to i64*)
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %18
%22 = load volatile i64, i64* inttoptr (i64 4063232000 to i64*)
%23 = add i64 %22, 96
store i64 %23, i64* %1
br label %25
24: ; preds = %18
store i64 -1, i64* %1
br label %25
25: ; preds = %24, %21, %15, %9, %4
%26 = load i64, i64* %1
ret i64 %26
}

LLVM IR (-O2):
define i64 @intc_getvicirqstatus() {
%1 = load volatile i64, i64* inttoptr (i64 4060086272 to i64*)
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = load volatile i64, i64* inttoptr (i64 4060086272 to i64*)
br label %23
5: ; preds = %0
%6 = load volatile i64, i64* inttoptr (i64 4061134848 to i64*)
%7 = icmp eq i64 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %5
%9 = load volatile i64, i64* inttoptr (i64 4061134848 to i64*)
%10 = add i64 %9, 32
br label %23
11: ; preds = %5
%12 = load volatile i64, i64* inttoptr (i64 4062183424 to i64*)
%13 = icmp eq i64 %12, 0
br i1 %13, label %17, label %14
14: ; preds = %11
%15 = load volatile i64, i64* inttoptr (i64 4062183424 to i64*)
%16 = add i64 %15, 64
br label %23
17: ; preds = %11
%18 = load volatile i64, i64* inttoptr (i64 4063232000 to i64*)
%19 = icmp eq i64 %18, 0
br i1 %19, label %23, label %20
20: ; preds = %17
%21 = load volatile i64, i64* inttoptr (i64 4063232000 to i64*)
%22 = add i64 %21, 96
br label %23
23: ; preds = %17, %20, %14, %8, %3
%24 = phi i64 [ %4, %3 ], [ %10, %8 ], [ %16, %14 ], [ %22, %20 ], [ -1, %17 ]
ret i64 %24
}