#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 */
int /*<<< orphan*/ nand_reset();
void nand_init(void) {
  (*((volatile unsigned long *)0x7E00F120)) &= ~(1 << 1);
  (*((volatile unsigned long *)0x70200000)) &=
      ~((1 << 30) | (7 << 12) | (7 << 8) | (7 << 4));
  (*((volatile unsigned long *)0x70200000)) |=
      ((0 << 12) | (1 << 8) | (0 << 4));
  (*((volatile unsigned long *)0x70200004)) |= 1;
  (*((volatile unsigned long *)0x70200004)) &= ~(1 << 16);
  nand_reset();
}


x86 assembly (clang, -O0):
<nand_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7e00f120,%eax
mov    (%rax),%rcx
and    $0xfffffffffffffffd,%rcx
mov    $0x7e00f120,%eax
mov    %rcx,(%rax)
mov    $0x70200000,%eax
mov    (%rax),%rcx
and    $0xffffffffbfff888f,%rcx
mov    $0x70200000,%eax
mov    %rcx,(%rax)
mov    $0x70200000,%eax
mov    (%rax),%rcx
or     $0x100,%rcx
mov    $0x70200000,%eax
mov    %rcx,(%rax)
mov    $0x70200004,%eax
mov    (%rax),%rcx
or     $0x1,%rcx
mov    $0x70200004,%eax
mov    %rcx,(%rax)
mov    $0x70200004,%eax
mov    (%rax),%rcx
and    $0xfffffffffffeffff,%rcx
mov    $0x70200004,%eax
mov    %rcx,(%rax)
mov    $0x0,%al
call   1030 <nand_reset@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nand_init>:
andq   $0xfffffffffffffffd,0x7e00f120
7e fd
andq   $0xffffffffbfff888f,0x70200000
70 8f 88 ff bf
orq    $0x100,0x70200000
orq    $0x1,0x70200004
70 01
andq   $0xfffffffffffeffff,0x70200004
70 ff ff fe ff
xor    %eax,%eax
jmp    1030 <nand_reset@plt>

LLVM IR (-O0):
define void @nand_init() {
%1 = load volatile i64, i64* inttoptr (i64 2113990944 to i64*)
%2 = and i64 %1, -3
store volatile i64 %2, i64* inttoptr (i64 2113990944 to i64*)
%3 = load volatile i64, i64* inttoptr (i64 1881145344 to i64*)
%4 = and i64 %3, -1073772401
store volatile i64 %4, i64* inttoptr (i64 1881145344 to i64*)
%5 = load volatile i64, i64* inttoptr (i64 1881145344 to i64*)
%6 = or i64 %5, 256
store volatile i64 %6, i64* inttoptr (i64 1881145344 to i64*)
%7 = load volatile i64, i64* inttoptr (i64 1881145348 to i64*)
%8 = or i64 %7, 1
store volatile i64 %8, i64* inttoptr (i64 1881145348 to i64*)
%9 = load volatile i64, i64* inttoptr (i64 1881145348 to i64*)
%10 = and i64 %9, -65537
store volatile i64 %10, i64* inttoptr (i64 1881145348 to i64*)
%11 = call i32 (...) @nand_reset()
ret void
}

LLVM IR (-O2):
define void @nand_init() {
%1 = load volatile i64, i64* inttoptr (i64 2113990944 to i64*)
%2 = and i64 %1, -3
store volatile i64 %2, i64* inttoptr (i64 2113990944 to i64*)
%3 = load volatile i64, i64* inttoptr (i64 1881145344 to i64*)
%4 = and i64 %3, -1073772401
store volatile i64 %4, i64* inttoptr (i64 1881145344 to i64*)
%5 = load volatile i64, i64* inttoptr (i64 1881145344 to i64*)
%6 = or i64 %5, 256
store volatile i64 %6, i64* inttoptr (i64 1881145344 to i64*)
%7 = load volatile i64, i64* inttoptr (i64 1881145348 to i64*)
%8 = or i64 %7, 1
store volatile i64 %8, i64* inttoptr (i64 1881145348 to i64*)
%9 = load volatile i64, i64* inttoptr (i64 1881145348 to i64*)
%10 = and i64 %9, -65537
store volatile i64 %10, i64* inttoptr (i64 1881145348 to i64*)
%11 = tail call i32 (...) @nand_reset()
ret void
}