#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*/ RPI_esperarMicroSeconds(int);
int /*<<< orphan*/ mmio_write(int, int);
void uart_init() {
  mmio_write((0x20201000 + 0x30), 0x00000000);
  mmio_write((0x20200000 + 0x94), 0x00000000);
  RPI_esperarMicroSeconds(150);
  mmio_write((0x20200000 + 0x98), (1 << 14) | (1 << 15));
  RPI_esperarMicroSeconds(150);
  mmio_write((0x20200000 + 0x98), 0x00000000);
  mmio_write((0x20201000 + 0x44), 0x7FF);
  mmio_write((0x20201000 + 0x24), 1);
  mmio_write((0x20201000 + 0x28), 40);
  mmio_write((0x20201000 + 0x2C), (3 << 5) | (1 << 6));
  mmio_write((0x20201000 + 0x38), 0x0010);
  mmio_write((0x20201000 + 0x30), (1 << 0) | (1 << 8) | (1 << 9));
}


x86 assembly (clang, -O0):
<uart_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20201030,%edi
xor    %esi,%esi
call   1040 <mmio_write@plt>
mov    $0x20200094,%edi
xor    %esi,%esi
call   1040 <mmio_write@plt>
mov    $0x96,%edi
call   1030 <RPI_esperarMicroSeconds@plt>
mov    $0x20200098,%edi
mov    $0xc000,%esi
call   1040 <mmio_write@plt>
mov    $0x96,%edi
call   1030 <RPI_esperarMicroSeconds@plt>
mov    $0x20200098,%edi
xor    %esi,%esi
call   1040 <mmio_write@plt>
mov    $0x20201044,%edi
mov    $0x7ff,%esi
call   1040 <mmio_write@plt>
mov    $0x20201024,%edi
mov    $0x1,%esi
call   1040 <mmio_write@plt>
mov    $0x20201028,%edi
mov    $0x28,%esi
call   1040 <mmio_write@plt>
mov    $0x2020102c,%edi
mov    $0x60,%esi
call   1040 <mmio_write@plt>
mov    $0x20201038,%edi
mov    $0x10,%esi
call   1040 <mmio_write@plt>
mov    $0x20201030,%edi
mov    $0x301,%esi
call   1040 <mmio_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_init>:
push   %rax
mov    $0x20201030,%edi
xor    %esi,%esi
call   1040 <mmio_write@plt>
mov    $0x20200094,%edi
xor    %esi,%esi
call   1040 <mmio_write@plt>
mov    $0x96,%edi
call   1030 <RPI_esperarMicroSeconds@plt>
mov    $0x20200098,%edi
mov    $0xc000,%esi
call   1040 <mmio_write@plt>
mov    $0x96,%edi
call   1030 <RPI_esperarMicroSeconds@plt>
mov    $0x20200098,%edi
xor    %esi,%esi
call   1040 <mmio_write@plt>
mov    $0x20201044,%edi
mov    $0x7ff,%esi
call   1040 <mmio_write@plt>
mov    $0x20201024,%edi
mov    $0x1,%esi
call   1040 <mmio_write@plt>
mov    $0x20201028,%edi
mov    $0x28,%esi
call   1040 <mmio_write@plt>
mov    $0x2020102c,%edi
mov    $0x60,%esi
call   1040 <mmio_write@plt>
mov    $0x20201038,%edi
mov    $0x10,%esi
call   1040 <mmio_write@plt>
mov    $0x20201030,%edi
mov    $0x301,%esi
pop    %rax
jmp    1040 <mmio_write@plt>

LLVM IR (-O0):
define void @uart_init() {
%1 = call i32 @mmio_write(i32 538972208, i32 0)
%2 = call i32 @mmio_write(i32 538968212, i32 0)
%3 = call i32 @RPI_esperarMicroSeconds(i32 150)
%4 = call i32 @mmio_write(i32 538968216, i32 49152)
%5 = call i32 @RPI_esperarMicroSeconds(i32 150)
%6 = call i32 @mmio_write(i32 538968216, i32 0)
%7 = call i32 @mmio_write(i32 538972228, i32 2047)
%8 = call i32 @mmio_write(i32 538972196, i32 1)
%9 = call i32 @mmio_write(i32 538972200, i32 40)
%10 = call i32 @mmio_write(i32 538972204, i32 96)
%11 = call i32 @mmio_write(i32 538972216, i32 16)
%12 = call i32 @mmio_write(i32 538972208, i32 769)
ret void
}

LLVM IR (-O2):
define void @uart_init() {
%1 = tail call i32 @mmio_write(i32 538972208, i32 0)
%2 = tail call i32 @mmio_write(i32 538968212, i32 0)
%3 = tail call i32 @RPI_esperarMicroSeconds(i32 150)
%4 = tail call i32 @mmio_write(i32 538968216, i32 49152)
%5 = tail call i32 @RPI_esperarMicroSeconds(i32 150)
%6 = tail call i32 @mmio_write(i32 538968216, i32 0)
%7 = tail call i32 @mmio_write(i32 538972228, i32 2047)
%8 = tail call i32 @mmio_write(i32 538972196, i32 1)
%9 = tail call i32 @mmio_write(i32 538972200, i32 40)
%10 = tail call i32 @mmio_write(i32 538972204, i32 96)
%11 = tail call i32 @mmio_write(i32 538972216, i32 16)
%12 = tail call i32 @mmio_write(i32 538972208, i32 769)
ret void
}