void BSP_Timer_ClearInterruptFlag(unsigned int timerIndex) {
  if (timerIndex == 0) {
    (*(volatile unsigned *)0x4a000000) = (0x1 << 10);
    (*(volatile unsigned *)0x4a000010) = (0x1 << 10);
  } else if (timerIndex == 1) {
    (*(volatile unsigned *)0x4a000000) = (0x1 << 11);
    (*(volatile unsigned *)0x4a000010) = (0x1 << 11);
  } else if (timerIndex == 2) {
    (*(volatile unsigned *)0x4a000000) = (0x1 << 12);
    (*(volatile unsigned *)0x4a000010) = (0x1 << 12);
  } else if (timerIndex == 3) {
    (*(volatile unsigned *)0x4a000000) = (0x1 << 13);
    (*(volatile unsigned *)0x4a000010) = (0x1 << 13);
  } else {
    (*(volatile unsigned *)0x4a000000) = (0x1 << 14);
    (*(volatile unsigned *)0x4a000010) = (0x1 << 14);
  }
}


x86 assembly (clang, -O0):
<BSP_Timer_ClearInterruptFlag>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    112c <BSP_Timer_ClearInterruptFlag+0x2c>
mov    $0x4a000000,%eax
movl   $0x400,(%rax)
mov    $0x4a000010,%eax
movl   $0x400,(%rax)
jmp    11c0 <BSP_Timer_ClearInterruptFlag+0xc0>
cmpl   $0x1,-0x4(%rbp)
jne    1151 <BSP_Timer_ClearInterruptFlag+0x51>
mov    $0x4a000000,%eax
movl   $0x800,(%rax)
mov    $0x4a000010,%eax
movl   $0x800,(%rax)
jmp    11bb <BSP_Timer_ClearInterruptFlag+0xbb>
cmpl   $0x2,-0x4(%rbp)
jne    1176 <BSP_Timer_ClearInterruptFlag+0x76>
mov    $0x4a000000,%eax
movl   $0x1000,(%rax)
mov    $0x4a000010,%eax
movl   $0x1000,(%rax)
jmp    11b6 <BSP_Timer_ClearInterruptFlag+0xb6>
cmpl   $0x3,-0x4(%rbp)
jne    119b <BSP_Timer_ClearInterruptFlag+0x9b>
mov    $0x4a000000,%eax
movl   $0x2000,(%rax)
mov    $0x4a000010,%eax
movl   $0x2000,(%rax)
jmp    11b1 <BSP_Timer_ClearInterruptFlag+0xb1>
mov    $0x4a000000,%eax
movl   $0x4000,(%rax)
mov    $0x4a000010,%eax
movl   $0x4000,(%rax)
jmp    11b6 <BSP_Timer_ClearInterruptFlag+0xb6>
jmp    11bb <BSP_Timer_ClearInterruptFlag+0xbb>
jmp    11c0 <BSP_Timer_ClearInterruptFlag+0xc0>
pop    %rbp
ret

x86 assembly (clang, -O2):
<BSP_Timer_ClearInterruptFlag>:
mov    $0x4000,%eax
cmp    $0x3,%edi
ja     1117 <BSP_Timer_ClearInterruptFlag+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
mov    %eax,0x4a000000
mov    %eax,0x4a000010
ret

LLVM IR (-O0):
define void @BSP_Timer_ClearInterruptFlag(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
store volatile i32 1024, i32* inttoptr (i64 1241513984 to i32*)
store volatile i32 1024, i32* inttoptr (i64 1241514000 to i32*)
br label %22
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %10
9: ; preds = %6
store volatile i32 2048, i32* inttoptr (i64 1241513984 to i32*)
store volatile i32 2048, i32* inttoptr (i64 1241514000 to i32*)
br label %21
10: ; preds = %6
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, 2
br i1 %12, label %13, label %14
13: ; preds = %10
store volatile i32 4096, i32* inttoptr (i64 1241513984 to i32*)
store volatile i32 4096, i32* inttoptr (i64 1241514000 to i32*)
br label %20
14: ; preds = %10
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 3
br i1 %16, label %17, label %18
17: ; preds = %14
store volatile i32 8192, i32* inttoptr (i64 1241513984 to i32*)
store volatile i32 8192, i32* inttoptr (i64 1241514000 to i32*)
br label %19
18: ; preds = %14
store volatile i32 16384, i32* inttoptr (i64 1241513984 to i32*)
store volatile i32 16384, i32* inttoptr (i64 1241514000 to i32*)
br label %19
19: ; preds = %18, %17
br label %20
20: ; preds = %19, %13
br label %21
21: ; preds = %20, %9
br label %22
22: ; preds = %21, %5
ret void
}

LLVM IR (-O2):
@switch.table.BSP_Timer_ClearInterruptFlag = [4 x i32] [i32 1024, i32 2048, i32 4096, i32 8192]
define void @BSP_Timer_ClearInterruptFlag(i32 %0) {
%2 = icmp ult i32 %0, 4
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [4 x i32], [4 x i32]* @switch.table.BSP_Timer_ClearInterruptFlag, i64 0, i64 %4
%6 = load i32, i32* %5
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 16384, %1 ]
store volatile i32 %8, i32* inttoptr (i64 1241513984 to i32*)
store volatile i32 %8, i32* inttoptr (i64 1241514000 to i32*)
ret void
}