#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*/ uart_puts(char *);
void init_uart(void) {
  (*(volatile unsigned int *)(0x7F008000)) =
      ((*(volatile unsigned int *)(0x7F008000)) & ~0xFF) | 0x22;
  (*(volatile unsigned int *)(0x7F005028)) = 34;
  (*(volatile unsigned int *)(0x7F00502C)) = 0xDFDD;
  (*(volatile unsigned int *)(0x7F005000)) = 3;
  (*(volatile unsigned int *)(0x7F005004)) =
      ((*(volatile unsigned int *)(0x7F005004)) & ~0xFFF) | 0xB05;
  (*(volatile unsigned int *)(0x7F005008)) = 0;
  (*(volatile unsigned int *)(0x7F00500C)) = 0;
  (*(volatile unsigned int *)(0x7F005038)) = 0xF;
  (*(volatile unsigned int *)(0x7F005438)) = 0xF;
  (*(volatile unsigned int *)(0x7F005838)) = 0xF;
  (*(volatile unsigned int *)(0x7F005C38)) = 0xF;
  uart_puts("");
  return;
}


x86 assembly (clang, -O0):
<init_uart>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7f008000,%eax
mov    (%rax),%ecx
and    $0xffffff00,%ecx
or     $0x22,%ecx
mov    $0x7f008000,%eax
mov    %ecx,(%rax)
mov    $0x7f005028,%eax
movl   $0x22,(%rax)
mov    $0x7f00502c,%eax
movl   $0xdfdd,(%rax)
mov    $0x7f005000,%eax
movl   $0x3,(%rax)
mov    $0x7f005004,%eax
mov    (%rax),%ecx
and    $0xfffff000,%ecx
or     $0xb05,%ecx
mov    $0x7f005004,%eax
mov    %ecx,(%rax)
mov    $0x7f005008,%eax
movl   $0x0,(%rax)
mov    $0x7f00500c,%eax
movl   $0x0,(%rax)
mov    $0x7f005038,%eax
movl   $0xf,(%rax)
mov    $0x7f005438,%eax
movl   $0xf,(%rax)
mov    $0x7f005838,%eax
movl   $0xf,(%rax)
mov    $0x7f005c38,%eax
movl   $0xf,(%rax)
lea    0xe51(%rip),%rdi
call   1030 <uart_puts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_uart>:
mov    $0xffffff00,%eax
and    0x7f008000,%eax
or     $0x22,%eax
mov    %eax,0x7f008000
movl   $0x22,0x7f005028
movl   $0xdfdd,0x7f00502c
movl   $0x3,0x7f005000
mov    $0xfffff000,%eax
and    0x7f005004,%eax
or     $0xb05,%eax
mov    %eax,0x7f005004
movl   $0x0,0x7f005008
movl   $0x0,0x7f00500c
movl   $0xf,0x7f005038
movl   $0xf,0x7f005438
movl   $0xf,0x7f005838
movl   $0xf,0x7f005c38
lea    0xe58(%rip),%rdi
jmp    1030 <uart_puts@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @init_uart() {
%1 = load volatile i32, i32* inttoptr (i64 2130739200 to i32*)
%2 = and i32 %1, -256
%3 = or i32 %2, 34
store volatile i32 %3, i32* inttoptr (i64 2130739200 to i32*)
store volatile i32 34, i32* inttoptr (i64 2130726952 to i32*)
store volatile i32 57309, i32* inttoptr (i64 2130726956 to i32*)
store volatile i32 3, i32* inttoptr (i64 2130726912 to i32*)
%4 = load volatile i32, i32* inttoptr (i64 2130726916 to i32*)
%5 = and i32 %4, -4096
%6 = or i32 %5, 2821
store volatile i32 %6, i32* inttoptr (i64 2130726916 to i32*)
store volatile i32 0, i32* inttoptr (i64 2130726920 to i32*)
store volatile i32 0, i32* inttoptr (i64 2130726924 to i32*)
store volatile i32 15, i32* inttoptr (i64 2130726968 to i32*)
store volatile i32 15, i32* inttoptr (i64 2130727992 to i32*)
store volatile i32 15, i32* inttoptr (i64 2130729016 to i32*)
store volatile i32 15, i32* inttoptr (i64 2130730040 to i32*)
%7 = call i32 @uart_puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @init_uart() {
%1 = load volatile i32, i32* inttoptr (i64 2130739200 to i32*)
%2 = and i32 %1, -256
%3 = or i32 %2, 34
store volatile i32 %3, i32* inttoptr (i64 2130739200 to i32*)
store volatile i32 34, i32* inttoptr (i64 2130726952 to i32*)
store volatile i32 57309, i32* inttoptr (i64 2130726956 to i32*)
store volatile i32 3, i32* inttoptr (i64 2130726912 to i32*)
%4 = load volatile i32, i32* inttoptr (i64 2130726916 to i32*)
%5 = and i32 %4, -4096
%6 = or i32 %5, 2821
store volatile i32 %6, i32* inttoptr (i64 2130726916 to i32*)
store volatile i32 0, i32* inttoptr (i64 2130726920 to i32*)
store volatile i32 0, i32* inttoptr (i64 2130726924 to i32*)
store volatile i32 15, i32* inttoptr (i64 2130726968 to i32*)
store volatile i32 15, i32* inttoptr (i64 2130727992 to i32*)
store volatile i32 15, i32* inttoptr (i64 2130729016 to i32*)
store volatile i32 15, i32* inttoptr (i64 2130730040 to i32*)
%7 = tail call i32 @uart_puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}