#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*/ delay(int);
int /*<<< orphan*/ enableirqminiuart();
int /*<<< orphan*/ outw(int, int);
int /*<<< orphan*/ setgpiofunc(int, int);
void uartinit(void) {
  outw(0xFE215004, 1);
  outw(0xFE215060, 0);
  outw(0xFE21504C, 0x3);
  outw(0xFE215050, 0);
  outw(0xFE215044, 0x1);
  outw(0xFE215048, 0xC7);
  outw(0xFE215068, 270);
  setgpiofunc(14, 2);
  setgpiofunc(15, 2);
  outw(0xFE200094, 0);
  delay(10);
  outw(0xFE200098, (1 << 14) | (1 << 15));
  delay(10);
  outw(0xFE200098, 0);
  outw(0xFE215060, 3);
  enableirqminiuart();
}


x86 assembly (clang, -O0):
<uartinit>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfe215004,%edi
mov    $0x1,%esi
call   1050 <outw@plt>
mov    $0xfe215060,%edi
xor    %esi,%esi
call   1050 <outw@plt>
mov    $0xfe21504c,%edi
mov    $0x3,%esi
call   1050 <outw@plt>
mov    $0xfe215050,%edi
xor    %esi,%esi
call   1050 <outw@plt>
mov    $0xfe215044,%edi
mov    $0x1,%esi
call   1050 <outw@plt>
mov    $0xfe215048,%edi
mov    $0xc7,%esi
call   1050 <outw@plt>
mov    $0xfe215068,%edi
mov    $0x10e,%esi
call   1050 <outw@plt>
mov    $0xe,%edi
mov    $0x2,%esi
call   1030 <setgpiofunc@plt>
mov    $0xf,%edi
mov    $0x2,%esi
call   1030 <setgpiofunc@plt>
mov    $0xfe200094,%edi
xor    %esi,%esi
call   1050 <outw@plt>
mov    $0xa,%edi
call   1040 <delay@plt>
mov    $0xfe200098,%edi
mov    $0xc000,%esi
call   1050 <outw@plt>
mov    $0xa,%edi
call   1040 <delay@plt>
mov    $0xfe200098,%edi
xor    %esi,%esi
call   1050 <outw@plt>
mov    $0xfe215060,%edi
mov    $0x3,%esi
call   1050 <outw@plt>
mov    $0x0,%al
call   1060 <enableirqminiuart@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<uartinit>:
push   %rax
mov    $0xfe215004,%edi
mov    $0x1,%esi
call   1050 <outw@plt>
mov    $0xfe215060,%edi
xor    %esi,%esi
call   1050 <outw@plt>
mov    $0xfe21504c,%edi
mov    $0x3,%esi
call   1050 <outw@plt>
mov    $0xfe215050,%edi
xor    %esi,%esi
call   1050 <outw@plt>
mov    $0xfe215044,%edi
mov    $0x1,%esi
call   1050 <outw@plt>
mov    $0xfe215048,%edi
mov    $0xc7,%esi
call   1050 <outw@plt>
mov    $0xfe215068,%edi
mov    $0x10e,%esi
call   1050 <outw@plt>
mov    $0xe,%edi
mov    $0x2,%esi
call   1030 <setgpiofunc@plt>
mov    $0xf,%edi
mov    $0x2,%esi
call   1030 <setgpiofunc@plt>
mov    $0xfe200094,%edi
xor    %esi,%esi
call   1050 <outw@plt>
mov    $0xa,%edi
call   1040 <delay@plt>
mov    $0xfe200098,%edi
mov    $0xc000,%esi
call   1050 <outw@plt>
mov    $0xa,%edi
call   1040 <delay@plt>
mov    $0xfe200098,%edi
xor    %esi,%esi
call   1050 <outw@plt>
mov    $0xfe215060,%edi
mov    $0x3,%esi
call   1050 <outw@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <enableirqminiuart@plt>

LLVM IR (-O0):
define void @uartinit() {
%1 = call i32 @outw(i32 -31371260, i32 1)
%2 = call i32 @outw(i32 -31371168, i32 0)
%3 = call i32 @outw(i32 -31371188, i32 3)
%4 = call i32 @outw(i32 -31371184, i32 0)
%5 = call i32 @outw(i32 -31371196, i32 1)
%6 = call i32 @outw(i32 -31371192, i32 199)
%7 = call i32 @outw(i32 -31371160, i32 270)
%8 = call i32 @setgpiofunc(i32 14, i32 2)
%9 = call i32 @setgpiofunc(i32 15, i32 2)
%10 = call i32 @outw(i32 -31457132, i32 0)
%11 = call i32 @delay(i32 10)
%12 = call i32 @outw(i32 -31457128, i32 49152)
%13 = call i32 @delay(i32 10)
%14 = call i32 @outw(i32 -31457128, i32 0)
%15 = call i32 @outw(i32 -31371168, i32 3)
%16 = call i32 (...) @enableirqminiuart()
ret void
}

LLVM IR (-O2):
define void @uartinit() {
%1 = tail call i32 @outw(i32 -31371260, i32 1)
%2 = tail call i32 @outw(i32 -31371168, i32 0)
%3 = tail call i32 @outw(i32 -31371188, i32 3)
%4 = tail call i32 @outw(i32 -31371184, i32 0)
%5 = tail call i32 @outw(i32 -31371196, i32 1)
%6 = tail call i32 @outw(i32 -31371192, i32 199)
%7 = tail call i32 @outw(i32 -31371160, i32 270)
%8 = tail call i32 @setgpiofunc(i32 14, i32 2)
%9 = tail call i32 @setgpiofunc(i32 15, i32 2)
%10 = tail call i32 @outw(i32 -31457132, i32 0)
%11 = tail call i32 @delay(i32 10)
%12 = tail call i32 @outw(i32 -31457128, i32 49152)
%13 = tail call i32 @delay(i32 10)
%14 = tail call i32 @outw(i32 -31457128, i32 0)
%15 = tail call i32 @outw(i32 -31371168, i32 3)
%16 = tail call i32 (...) @enableirqminiuart()
ret void
}