void EINT_Handle() {
  unsigned long oft = (*(volatile unsigned long *)0x4A000014);
  unsigned long val;
  switch (oft) {
  case 0: {
    (*(volatile unsigned long *)0x56000054) |= (0x7 << 4);
    (*(volatile unsigned long *)0x56000054) &= ~(1 << 4);
    break;
  }
  case 2: {
    (*(volatile unsigned long *)0x56000054) |= (0x7 << 4);
    (*(volatile unsigned long *)0x56000054) &= ~(1 << 5);
    break;
  }
  case 5: {
    (*(volatile unsigned long *)0x56000054) |= (0x7 << 4);
    (*(volatile unsigned long *)0x56000054) &= ~(1 << 6);
    break;
  }
  default:
    break;
  }
  if (oft == 5)
    (*(volatile unsigned long *)0x560000a8) = (1 << 11);
  (*(volatile unsigned long *)0x4A000000) = 1 << oft;
  (*(volatile unsigned long *)0x4A000010) = 1 << oft;
}


x86 assembly (clang, -O0):
<EINT_Handle>:
push   %rbp
mov    %rsp,%rbp
mov    0x4a000014,%rax
4a
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
test   %rax,%rax
je     114c <EINT_Handle+0x4c>
jmp    1126 <EINT_Handle+0x26>
mov    -0x18(%rbp),%rax
sub    $0x2,%rax
je     1179 <EINT_Handle+0x79>
jmp    1139 <EINT_Handle+0x39>
mov    -0x18(%rbp),%rax
sub    $0x5,%rax
je     11a6 <EINT_Handle+0xa6>
jmp    11d3 <EINT_Handle+0xd3>
mov    $0x56000054,%eax
mov    (%rax),%rcx
or     $0x70,%rcx
mov    $0x56000054,%eax
mov    %rcx,(%rax)
mov    $0x56000054,%eax
mov    (%rax),%rcx
and    $0xffffffffffffffef,%rcx
mov    $0x56000054,%eax
mov    %rcx,(%rax)
jmp    11d8 <EINT_Handle+0xd8>
mov    $0x56000054,%eax
mov    (%rax),%rcx
or     $0x70,%rcx
mov    $0x56000054,%eax
mov    %rcx,(%rax)
mov    $0x56000054,%eax
mov    (%rax),%rcx
and    $0xffffffffffffffdf,%rcx
mov    $0x56000054,%eax
mov    %rcx,(%rax)
jmp    11d8 <EINT_Handle+0xd8>
mov    $0x56000054,%eax
mov    (%rax),%rcx
or     $0x70,%rcx
mov    $0x56000054,%eax
mov    %rcx,(%rax)
mov    $0x56000054,%eax
mov    (%rax),%rcx
and    $0xffffffffffffffbf,%rcx
mov    $0x56000054,%eax
mov    %rcx,(%rax)
jmp    11d8 <EINT_Handle+0xd8>
jmp    11d8 <EINT_Handle+0xd8>
cmpq   $0x5,-0x8(%rbp)
jne    11ef <EINT_Handle+0xef>
mov    $0x560000a8,%eax
movq   $0x800,(%rax)
mov    -0x8(%rbp),%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
movslq %eax,%rcx
mov    $0x4a000000,%eax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
movslq %eax,%rcx
mov    $0x4a000010,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<EINT_Handle>:
mov    0x4a000014,%rcx
4a
cmp    $0x5,%rcx
je     112d <EINT_Handle+0x2d>
cmp    $0x2,%rcx
je     114d <EINT_Handle+0x4d>
test   %rcx,%rcx
jne    115f <EINT_Handle+0x5f>
orq    $0x70,0x56000054
56 70
andq   $0xffffffffffffffef,0x56000054
56 ef
jmp    115f <EINT_Handle+0x5f>
orq    $0x70,0x56000054
56 70
andq   $0xffffffffffffffbf,0x56000054
56 bf
movq   $0x800,0x560000a8
jmp    115f <EINT_Handle+0x5f>
orq    $0x70,0x56000054
56 70
andq   $0xffffffffffffffdf,0x56000054
56 df
mov    $0x1,%eax
shl    %cl,%eax
cltq
mov    %rax,0x4a000000
4a
mov    %rax,0x4a000010
4a
ret

LLVM IR (-O0):
define void @EINT_Handle() {
%1 = alloca i64
%2 = alloca i64
%3 = load volatile i64, i64* inttoptr (i64 1241514004 to i64*)
store i64 %3, i64* %1
%4 = load i64, i64* %1
switch i64 %4, label %20 [
i64 0, label %5
i64 2, label %10
i64 5, label %15
]
5: ; preds = %0
%6 = load volatile i64, i64* inttoptr (i64 1442840660 to i64*)
%7 = or i64 %6, 112
store volatile i64 %7, i64* inttoptr (i64 1442840660 to i64*)
%8 = load volatile i64, i64* inttoptr (i64 1442840660 to i64*)
%9 = and i64 %8, -17
store volatile i64 %9, i64* inttoptr (i64 1442840660 to i64*)
br label %21
10: ; preds = %0
%11 = load volatile i64, i64* inttoptr (i64 1442840660 to i64*)
%12 = or i64 %11, 112
store volatile i64 %12, i64* inttoptr (i64 1442840660 to i64*)
%13 = load volatile i64, i64* inttoptr (i64 1442840660 to i64*)
%14 = and i64 %13, -33
store volatile i64 %14, i64* inttoptr (i64 1442840660 to i64*)
br label %21
15: ; preds = %0
%16 = load volatile i64, i64* inttoptr (i64 1442840660 to i64*)
%17 = or i64 %16, 112
store volatile i64 %17, i64* inttoptr (i64 1442840660 to i64*)
%18 = load volatile i64, i64* inttoptr (i64 1442840660 to i64*)
%19 = and i64 %18, -65
store volatile i64 %19, i64* inttoptr (i64 1442840660 to i64*)
br label %21
20: ; preds = %0
br label %21
21: ; preds = %20, %15, %10, %5
%22 = load i64, i64* %1
%23 = icmp eq i64 %22, 5
br i1 %23, label %24, label %25
24: ; preds = %21
store volatile i64 2048, i64* inttoptr (i64 1442840744 to i64*)
br label %25
25: ; preds = %24, %21
%26 = load i64, i64* %1
%27 = trunc i64 %26 to i32
%28 = shl i32 1, %27
%29 = sext i32 %28 to i64
store volatile i64 %29, i64* inttoptr (i64 1241513984 to i64*)
%30 = load i64, i64* %1
%31 = trunc i64 %30 to i32
%32 = shl i32 1, %31
%33 = sext i32 %32 to i64
store volatile i64 %33, i64* inttoptr (i64 1241514000 to i64*)
ret void
}

LLVM IR (-O2):
define void @EINT_Handle() {
%1 = load volatile i64, i64* inttoptr (i64 1241514004 to i64*)
switch i64 %1, label %17 [
i64 0, label %2
i64 2, label %7
i64 5, label %12
]
2: ; preds = %0
%3 = load volatile i64, i64* inttoptr (i64 1442840660 to i64*)
%4 = or i64 %3, 112
store volatile i64 %4, i64* inttoptr (i64 1442840660 to i64*)
%5 = load volatile i64, i64* inttoptr (i64 1442840660 to i64*)
%6 = and i64 %5, -17
store volatile i64 %6, i64* inttoptr (i64 1442840660 to i64*)
br label %17
7: ; preds = %0
%8 = load volatile i64, i64* inttoptr (i64 1442840660 to i64*)
%9 = or i64 %8, 112
store volatile i64 %9, i64* inttoptr (i64 1442840660 to i64*)
%10 = load volatile i64, i64* inttoptr (i64 1442840660 to i64*)
%11 = and i64 %10, -33
store volatile i64 %11, i64* inttoptr (i64 1442840660 to i64*)
br label %17
12: ; preds = %0
%13 = load volatile i64, i64* inttoptr (i64 1442840660 to i64*)
%14 = or i64 %13, 112
store volatile i64 %14, i64* inttoptr (i64 1442840660 to i64*)
%15 = load volatile i64, i64* inttoptr (i64 1442840660 to i64*)
%16 = and i64 %15, -65
store volatile i64 %16, i64* inttoptr (i64 1442840660 to i64*)
store volatile i64 2048, i64* inttoptr (i64 1442840744 to i64*)
br label %17
17: ; preds = %2, %7, %0, %12
%18 = trunc i64 %1 to i32
%19 = shl nuw i32 1, %18
%20 = sext i32 %19 to i64
store volatile i64 %20, i64* inttoptr (i64 1241513984 to i64*)
store volatile i64 %20, i64* inttoptr (i64 1241514000 to i64*)
ret void
}