#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 uint32_t;

/* Variables and functions */
uint32_t AONRTCCompareValueGet(uint32_t ui32Channel) {
  uint32_t ui32Value = 0;

  ;
  if (ui32Channel & 0x1) {
    ui32Value = (*((volatile unsigned long *)(0x40092000 + 0x00000018)));
  }
  if (ui32Channel & 0x2) {
    ui32Value = (*((volatile unsigned long *)(0x40092000 + 0x0000001C)));
  }
  if (ui32Channel & 0x4) {
    ui32Value = (*((volatile unsigned long *)(0x40092000 + 0x00000020)));
  }
  return (ui32Value);
}


x86 assembly (clang, -O0):
<AONRTCCompareValueGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1128 <AONRTCCompareValueGet+0x28>
mov    $0x40092018,%eax
mov    (%rax),%rax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     1142 <AONRTCCompareValueGet+0x42>
mov    $0x4009201c,%eax
mov    (%rax),%rax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     115c <AONRTCCompareValueGet+0x5c>
mov    $0x40092020,%eax
mov    (%rax),%rax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AONRTCCompareValueGet>:
xor    %eax,%eax
test   $0x1,%dil
jne    1115 <AONRTCCompareValueGet+0x15>
test   $0x2,%dil
jne    1123 <AONRTCCompareValueGet+0x23>
test   $0x4,%dil
jne    1131 <AONRTCCompareValueGet+0x31>
ret
mov    0x40092018,%rax
40
test   $0x2,%dil
je     110e <AONRTCCompareValueGet+0xe>
mov    0x4009201c,%rax
40
test   $0x4,%dil
je     1114 <AONRTCCompareValueGet+0x14>
mov    0x40092020,%rax
40
ret

LLVM IR (-O0):
define i32 @AONRTCCompareValueGet(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = and i32 %4, 1
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load volatile i64, i64* inttoptr (i64 1074339864 to i64*)
%9 = trunc i64 %8 to i32
store i32 %9, i32* %3
br label %10
10: ; preds = %7, %1
%11 = load i32, i32* %2
%12 = and i32 %11, 2
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %10
%15 = load volatile i64, i64* inttoptr (i64 1074339868 to i64*)
%16 = trunc i64 %15 to i32
store i32 %16, i32* %3
br label %17
17: ; preds = %14, %10
%18 = load i32, i32* %2
%19 = and i32 %18, 4
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %17
%22 = load volatile i64, i64* inttoptr (i64 1074339872 to i64*)
%23 = trunc i64 %22 to i32
store i32 %23, i32* %3
br label %24
24: ; preds = %21, %17
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @AONRTCCompareValueGet(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = load volatile i64, i64* inttoptr (i64 1074339864 to i64*)
%6 = trunc i64 %5 to i32
br label %7
7: ; preds = %4, %1
%8 = phi i32 [ %6, %4 ], [ 0, %1 ]
%9 = and i32 %0, 2
%10 = icmp eq i32 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %7
%12 = load volatile i64, i64* inttoptr (i64 1074339868 to i64*)
%13 = trunc i64 %12 to i32
br label %14
14: ; preds = %11, %7
%15 = phi i32 [ %13, %11 ], [ %8, %7 ]
%16 = and i32 %0, 4
%17 = icmp eq i32 %16, 0
br i1 %17, label %21, label %18
18: ; preds = %14
%19 = load volatile i64, i64* inttoptr (i64 1074339872 to i64*)
%20 = trunc i64 %19 to i32
br label %21
21: ; preds = %18, %14
%22 = phi i32 [ %20, %18 ], [ %15, %14 ]
ret i32 %22
}