#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 */

/* Variables and functions */
unsigned long PEEK32(unsigned long);
int /*<<< orphan*/ POKE32(unsigned long, unsigned long);
void init_ADC(unsigned long adc_page, unsigned long syscon_page) {
  unsigned long val;
  val = PEEK32(syscon_page + 0x0090);
  POKE32(syscon_page + 0x00C0, 0xAA);
  POKE32(syscon_page + 0x0090, 0x80000000 | val);
  val = PEEK32(syscon_page + 0x0080);
  POKE32(syscon_page + 0x00C0, 0xAA);
  POKE32(syscon_page + 0x0080, val | 0x20000);
  val = PEEK32(syscon_page + 0x0080);
  POKE32(adc_page + 0x00C0, 0xAA);
  POKE32(syscon_page + 0x0080, val & ~0x04);
}


x86 assembly (clang, -O0):
<init_ADC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x90,%rdi
call   1030 <PEEK32@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
add    $0xc0,%rdi
mov    $0xaa,%esi
call   1040 <POKE32@plt>
mov    -0x10(%rbp),%rdi
add    $0x90,%rdi
movabs $0x80000000,%rsi
or     -0x18(%rbp),%rsi
call   1040 <POKE32@plt>
mov    -0x10(%rbp),%rdi
add    $0x80,%rdi
call   1030 <PEEK32@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
add    $0xc0,%rdi
mov    $0xaa,%esi
call   1040 <POKE32@plt>
mov    -0x10(%rbp),%rdi
add    $0x80,%rdi
mov    -0x18(%rbp),%rsi
or     $0x20000,%rsi
call   1040 <POKE32@plt>
mov    -0x10(%rbp),%rdi
add    $0x80,%rdi
call   1030 <PEEK32@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
add    $0xc0,%rdi
mov    $0xaa,%esi
call   1040 <POKE32@plt>
mov    -0x10(%rbp),%rdi
add    $0x80,%rdi
mov    -0x18(%rbp),%rsi
and    $0xfffffffffffffffb,%rsi
call   1040 <POKE32@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_ADC>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbp
mov    %rdi,%r14
lea    0x90(%rsi),%r15
mov    %r15,%rdi
call   1030 <PEEK32@plt>
mov    %rax,%r12
lea    0xc0(%rbp),%r13
mov    $0xaa,%esi
mov    %r13,%rdi
call   1040 <POKE32@plt>
mov    $0x80000000,%esi
or     %r12,%rsi
mov    %r15,%rdi
call   1040 <POKE32@plt>
sub    $0xffffffffffffff80,%rbp
mov    %rbp,%rdi
call   1030 <PEEK32@plt>
mov    %rax,%rbx
mov    $0xaa,%esi
mov    %r13,%rdi
call   1040 <POKE32@plt>
or     $0x20000,%rbx
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1040 <POKE32@plt>
mov    %rbp,%rdi
call   1030 <PEEK32@plt>
mov    %rax,%rbx
add    $0xc0,%r14
mov    $0xaa,%esi
mov    %r14,%rdi
call   1040 <POKE32@plt>
and    $0xfffffffffffffffb,%rbx
mov    %rbp,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <POKE32@plt>

LLVM IR (-O0):
define void @init_ADC(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = add i64 %6, 144
%8 = call i64 @PEEK32(i64 %7)
store i64 %8, i64* %5
%9 = load i64, i64* %4
%10 = add i64 %9, 192
%11 = call i32 @POKE32(i64 %10, i64 170)
%12 = load i64, i64* %4
%13 = add i64 %12, 144
%14 = load i64, i64* %5
%15 = or i64 2147483648, %14
%16 = call i32 @POKE32(i64 %13, i64 %15)
%17 = load i64, i64* %4
%18 = add i64 %17, 128
%19 = call i64 @PEEK32(i64 %18)
store i64 %19, i64* %5
%20 = load i64, i64* %4
%21 = add i64 %20, 192
%22 = call i32 @POKE32(i64 %21, i64 170)
%23 = load i64, i64* %4
%24 = add i64 %23, 128
%25 = load i64, i64* %5
%26 = or i64 %25, 131072
%27 = call i32 @POKE32(i64 %24, i64 %26)
%28 = load i64, i64* %4
%29 = add i64 %28, 128
%30 = call i64 @PEEK32(i64 %29)
store i64 %30, i64* %5
%31 = load i64, i64* %3
%32 = add i64 %31, 192
%33 = call i32 @POKE32(i64 %32, i64 170)
%34 = load i64, i64* %4
%35 = add i64 %34, 128
%36 = load i64, i64* %5
%37 = and i64 %36, -5
%38 = call i32 @POKE32(i64 %35, i64 %37)
ret void
}

LLVM IR (-O2):
define void @init_ADC(i64 %0, i64 %1) {
%3 = add i64 %1, 144
%4 = tail call i64 @PEEK32(i64 %3)
%5 = add i64 %1, 192
%6 = tail call i32 @POKE32(i64 %5, i64 170)
%7 = or i64 %4, 2147483648
%8 = tail call i32 @POKE32(i64 %3, i64 %7)
%9 = add i64 %1, 128
%10 = tail call i64 @PEEK32(i64 %9)
%11 = tail call i32 @POKE32(i64 %5, i64 170)
%12 = or i64 %10, 131072
%13 = tail call i32 @POKE32(i64 %9, i64 %12)
%14 = tail call i64 @PEEK32(i64 %9)
%15 = add i64 %0, 192
%16 = tail call i32 @POKE32(i64 %15, i64 170)
%17 = and i64 %14, -5
%18 = tail call i32 @POKE32(i64 %9, i64 %17)
ret void
}