void setup_adc() {
  (*((volatile unsigned int *)(0x40012400 + 8))) |= ((1 << 0));
  while (!((*((volatile unsigned int *)(0x40012400 + 0))) & (1 << 0)))
    ;
  (*((volatile unsigned int *)(0x40012400 + 0x28))) = ((1 << 5));
  (*((volatile unsigned int *)(0x40012400 + 0x0c))) |= ((1 << 12) | (1 << 16));
  (*((volatile unsigned int *)(0x40012400 + 0x14))) |=
      ((1 << 1) | (1 << 2) | (1 << 3));
  (*((volatile unsigned int *)(0x40012400 + 4))) |= ((1 << 2));
  (*((volatile unsigned int *)(0xe000e100 + 0))) |= ((1 << 12));
  (*((volatile unsigned int *)(0xe000e100 + 0x30c))) |= 96;
  while (!((*((volatile unsigned int *)(0x40012400 + 0))) & (1 << 0)))
    ;
  (*((volatile unsigned int *)(0x40012400 + 8))) |= ((1 << 2));
}


x86 assembly (clang, -O0):
<setup_adc>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40012408,%eax
mov    (%rax),%ecx
or     $0x1,%ecx
mov    $0x40012408,%eax
mov    %ecx,(%rax)
mov    $0x40012400,%eax
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1134 <setup_adc+0x34>
jmp    1139 <setup_adc+0x39>
jmp    1115 <setup_adc+0x15>
mov    $0x40012428,%eax
movl   $0x20,(%rax)
mov    $0x4001240c,%eax
mov    (%rax),%ecx
or     $0x11000,%ecx
mov    $0x4001240c,%eax
mov    %ecx,(%rax)
mov    $0x40012414,%eax
mov    (%rax),%ecx
or     $0xe,%ecx
mov    $0x40012414,%eax
mov    %ecx,(%rax)
mov    $0x40012404,%eax
mov    (%rax),%ecx
or     $0x4,%ecx
mov    $0x40012404,%eax
mov    %ecx,(%rax)
mov    $0xe000e100,%eax
mov    (%rax),%ecx
or     $0x1000,%ecx
mov    $0xe000e100,%eax
mov    %ecx,(%rax)
mov    $0xe000e40c,%eax
mov    (%rax),%ecx
or     $0x60,%ecx
mov    $0xe000e40c,%eax
mov    %ecx,(%rax)
mov    $0x40012400,%eax
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    11be <setup_adc+0xbe>
jmp    11c3 <setup_adc+0xc3>
jmp    119f <setup_adc+0x9f>
mov    $0x40012408,%eax
mov    (%rax),%ecx
or     $0x4,%ecx
mov    $0x40012408,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup_adc>:
orl    $0x1,0x40012408
01
nopl   0x0(%rax,%rax,1)
testl  $0x1,0x40012400
je     1110 <setup_adc+0x10>
movl   $0x20,0x40012428
orl    $0x11000,0x4001240c
orl    $0xe,0x40012414
0e
orl    $0x4,0x40012404
04
mov    $0xe000e100,%eax
orl    $0x1000,(%rax)
orl    $0x60,0x30c(%rax)
cs nopw 0x0(%rax,%rax,1)
nop
testl  $0x1,0x40012400
je     1160 <setup_adc+0x60>
orl    $0x4,0x40012408
04
ret

LLVM IR (-O0):
define void @setup_adc() {
%1 = load volatile i32, i32* inttoptr (i64 1073816584 to i32*)
%2 = or i32 %1, 1
store volatile i32 %2, i32* inttoptr (i64 1073816584 to i32*)
br label %3
3: ; preds = %8, %0
%4 = load volatile i32, i32* inttoptr (i64 1073816576 to i32*)
%5 = and i32 %4, 1
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
br i1 %7, label %8, label %9
8: ; preds = %3
br label %3
9: ; preds = %3
store volatile i32 32, i32* inttoptr (i64 1073816616 to i32*)
%10 = load volatile i32, i32* inttoptr (i64 1073816588 to i32*)
%11 = or i32 %10, 69632
store volatile i32 %11, i32* inttoptr (i64 1073816588 to i32*)
%12 = load volatile i32, i32* inttoptr (i64 1073816596 to i32*)
%13 = or i32 %12, 14
store volatile i32 %13, i32* inttoptr (i64 1073816596 to i32*)
%14 = load volatile i32, i32* inttoptr (i64 1073816580 to i32*)
%15 = or i32 %14, 4
store volatile i32 %15, i32* inttoptr (i64 1073816580 to i32*)
%16 = load volatile i32, i32* inttoptr (i64 3758153984 to i32*)
%17 = or i32 %16, 4096
store volatile i32 %17, i32* inttoptr (i64 3758153984 to i32*)
%18 = load volatile i32, i32* inttoptr (i64 3758154764 to i32*)
%19 = or i32 %18, 96
store volatile i32 %19, i32* inttoptr (i64 3758154764 to i32*)
br label %20
20: ; preds = %25, %9
%21 = load volatile i32, i32* inttoptr (i64 1073816576 to i32*)
%22 = and i32 %21, 1
%23 = icmp ne i32 %22, 0
%24 = xor i1 %23, true
br i1 %24, label %25, label %26
25: ; preds = %20
br label %20
26: ; preds = %20
%27 = load volatile i32, i32* inttoptr (i64 1073816584 to i32*)
%28 = or i32 %27, 4
store volatile i32 %28, i32* inttoptr (i64 1073816584 to i32*)
ret void
}

LLVM IR (-O2):
define void @setup_adc() {
%1 = load volatile i32, i32* inttoptr (i64 1073816584 to i32*)
%2 = or i32 %1, 1
store volatile i32 %2, i32* inttoptr (i64 1073816584 to i32*)
br label %3
3: ; preds = %3, %0
%4 = load volatile i32, i32* inttoptr (i64 1073816576 to i32*)
%5 = and i32 %4, 1
%6 = icmp eq i32 %5, 0
br i1 %6, label %3, label %7
7: ; preds = %3
store volatile i32 32, i32* inttoptr (i64 1073816616 to i32*)
%8 = load volatile i32, i32* inttoptr (i64 1073816588 to i32*)
%9 = or i32 %8, 69632
store volatile i32 %9, i32* inttoptr (i64 1073816588 to i32*)
%10 = load volatile i32, i32* inttoptr (i64 1073816596 to i32*)
%11 = or i32 %10, 14
store volatile i32 %11, i32* inttoptr (i64 1073816596 to i32*)
%12 = load volatile i32, i32* inttoptr (i64 1073816580 to i32*)
%13 = or i32 %12, 4
store volatile i32 %13, i32* inttoptr (i64 1073816580 to i32*)
%14 = load volatile i32, i32* inttoptr (i64 3758153984 to i32*)
%15 = or i32 %14, 4096
store volatile i32 %15, i32* inttoptr (i64 3758153984 to i32*)
%16 = load volatile i32, i32* inttoptr (i64 3758154764 to i32*)
%17 = or i32 %16, 96
store volatile i32 %17, i32* inttoptr (i64 3758154764 to i32*)
br label %18
18: ; preds = %18, %7
%19 = load volatile i32, i32* inttoptr (i64 1073816576 to i32*)
%20 = and i32 %19, 1
%21 = icmp eq i32 %20, 0
br i1 %21, label %18, label %22
22: ; preds = %18
%23 = load volatile i32, i32* inttoptr (i64 1073816584 to i32*)
%24 = or i32 %23, 4
store volatile i32 %24, i32* inttoptr (i64 1073816584 to i32*)
ret void
}