#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 int Get32(int);
int /*<<< orphan*/ Set32(int, unsigned int);
int /*<<< orphan*/ delay(unsigned int);
void uart_init(void) {
  Set32(0x20201030u, 0u);
  Set32(0x20200004u, Get32(0x20200004u) | (4u << ((14u % 10u) * 3u)));
  Set32(0x20200004u, Get32(0x20200004u) | (4u << ((15u % 10u) * 3u)));
  Set32(0x20200094u, 0u);
  delay(150u);
  Set32(0x20200098u, (1u << 14u) | (1u << 15u));
  delay(150u);
  Set32(0x20200094u, 0u);
  Set32(0x20200098u, 0u);
  Set32(0x2020102Cu, 0u);
  Set32(0x20201044u, 0u);
  Set32(0x20201024u, 1u);
  Set32(0x20201028u, 40u);
  Set32(0x2020102Cu, (3u << 5u));
  Set32(0x20201034u, 0u);
  Set32(0x20201038u, (1u << 1u) | (1u << 4u) | (1u << 5u) | (1u << 6u) |
                         (1u << 7u) | (1u << 8u) | (1u << 9u) | (1u << 10u));
  Set32(0x20201030u, (1u << 0u) | (1u << 8u) | (1u << 9u));
}


x86 assembly (clang, -O0):
<uart_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20201030,%edi
xor    %esi,%esi
call   1050 <Set32@plt>
mov    $0x20200004,%edi
call   1040 <Get32@plt>
mov    %eax,%esi
or     $0x4000,%esi
mov    $0x20200004,%edi
call   1050 <Set32@plt>
mov    $0x20200004,%edi
call   1040 <Get32@plt>
mov    %eax,%esi
or     $0x20000,%esi
mov    $0x20200004,%edi
call   1050 <Set32@plt>
mov    $0x20200094,%edi
xor    %esi,%esi
call   1050 <Set32@plt>
mov    $0x96,%edi
call   1030 <delay@plt>
mov    $0x20200098,%edi
mov    $0xc000,%esi
call   1050 <Set32@plt>
mov    $0x96,%edi
call   1030 <delay@plt>
mov    $0x20200094,%edi
xor    %esi,%esi
call   1050 <Set32@plt>
mov    $0x20200098,%edi
xor    %esi,%esi
call   1050 <Set32@plt>
mov    $0x2020102c,%edi
xor    %esi,%esi
call   1050 <Set32@plt>
mov    $0x20201044,%edi
xor    %esi,%esi
call   1050 <Set32@plt>
mov    $0x20201024,%edi
mov    $0x1,%esi
call   1050 <Set32@plt>
mov    $0x20201028,%edi
mov    $0x28,%esi
call   1050 <Set32@plt>
mov    $0x2020102c,%edi
mov    $0x60,%esi
call   1050 <Set32@plt>
mov    $0x20201034,%edi
xor    %esi,%esi
call   1050 <Set32@plt>
mov    $0x20201038,%edi
mov    $0x7f2,%esi
call   1050 <Set32@plt>
mov    $0x20201030,%edi
mov    $0x301,%esi
call   1050 <Set32@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_init>:
push   %rax
mov    $0x20201030,%edi
xor    %esi,%esi
call   1050 <Set32@plt>
mov    $0x20200004,%edi
call   1040 <Get32@plt>
or     $0x4000,%eax
mov    $0x20200004,%edi
mov    %eax,%esi
call   1050 <Set32@plt>
mov    $0x20200004,%edi
call   1040 <Get32@plt>
or     $0x20000,%eax
mov    $0x20200004,%edi
mov    %eax,%esi
call   1050 <Set32@plt>
mov    $0x20200094,%edi
xor    %esi,%esi
call   1050 <Set32@plt>
mov    $0x96,%edi
call   1030 <delay@plt>
mov    $0x20200098,%edi
mov    $0xc000,%esi
call   1050 <Set32@plt>
mov    $0x96,%edi
call   1030 <delay@plt>
mov    $0x20200094,%edi
xor    %esi,%esi
call   1050 <Set32@plt>
mov    $0x20200098,%edi
xor    %esi,%esi
call   1050 <Set32@plt>
mov    $0x2020102c,%edi
xor    %esi,%esi
call   1050 <Set32@plt>
mov    $0x20201044,%edi
xor    %esi,%esi
call   1050 <Set32@plt>
mov    $0x20201024,%edi
mov    $0x1,%esi
call   1050 <Set32@plt>
mov    $0x20201028,%edi
mov    $0x28,%esi
call   1050 <Set32@plt>
mov    $0x2020102c,%edi
mov    $0x60,%esi
call   1050 <Set32@plt>
mov    $0x20201034,%edi
xor    %esi,%esi
call   1050 <Set32@plt>
mov    $0x20201038,%edi
mov    $0x7f2,%esi
call   1050 <Set32@plt>
mov    $0x20201030,%edi
mov    $0x301,%esi
pop    %rax
jmp    1050 <Set32@plt>

LLVM IR (-O0):
define void @uart_init() {
%1 = call i32 @Set32(i32 538972208, i32 0)
%2 = call i32 @Get32(i32 538968068)
%3 = or i32 %2, 16384
%4 = call i32 @Set32(i32 538968068, i32 %3)
%5 = call i32 @Get32(i32 538968068)
%6 = or i32 %5, 131072
%7 = call i32 @Set32(i32 538968068, i32 %6)
%8 = call i32 @Set32(i32 538968212, i32 0)
%9 = call i32 @delay(i32 150)
%10 = call i32 @Set32(i32 538968216, i32 49152)
%11 = call i32 @delay(i32 150)
%12 = call i32 @Set32(i32 538968212, i32 0)
%13 = call i32 @Set32(i32 538968216, i32 0)
%14 = call i32 @Set32(i32 538972204, i32 0)
%15 = call i32 @Set32(i32 538972228, i32 0)
%16 = call i32 @Set32(i32 538972196, i32 1)
%17 = call i32 @Set32(i32 538972200, i32 40)
%18 = call i32 @Set32(i32 538972204, i32 96)
%19 = call i32 @Set32(i32 538972212, i32 0)
%20 = call i32 @Set32(i32 538972216, i32 2034)
%21 = call i32 @Set32(i32 538972208, i32 769)
ret void
}

LLVM IR (-O2):
define void @uart_init() {
%1 = tail call i32 @Set32(i32 538972208, i32 0)
%2 = tail call i32 @Get32(i32 538968068)
%3 = or i32 %2, 16384
%4 = tail call i32 @Set32(i32 538968068, i32 %3)
%5 = tail call i32 @Get32(i32 538968068)
%6 = or i32 %5, 131072
%7 = tail call i32 @Set32(i32 538968068, i32 %6)
%8 = tail call i32 @Set32(i32 538968212, i32 0)
%9 = tail call i32 @delay(i32 150)
%10 = tail call i32 @Set32(i32 538968216, i32 49152)
%11 = tail call i32 @delay(i32 150)
%12 = tail call i32 @Set32(i32 538968212, i32 0)
%13 = tail call i32 @Set32(i32 538968216, i32 0)
%14 = tail call i32 @Set32(i32 538972204, i32 0)
%15 = tail call i32 @Set32(i32 538972228, i32 0)
%16 = tail call i32 @Set32(i32 538972196, i32 1)
%17 = tail call i32 @Set32(i32 538972200, i32 40)
%18 = tail call i32 @Set32(i32 538972204, i32 96)
%19 = tail call i32 @Set32(i32 538972212, i32 0)
%20 = tail call i32 @Set32(i32 538972216, i32 2034)
%21 = tail call i32 @Set32(i32 538972208, i32 769)
ret void
}