#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 */
typedef int uint32_t;

/* Variables and functions */
void usart2_init(void) {
  uint32_t reg;
  (*(volatile uint32_t *)((0x40021000UL) + 0x4C)) |= (1 << 3) | (1 << 0);
  reg =
      (*((volatile uint32_t *)((0x48000C00UL) + 0x00))) & ~(0x03 << ((6) * 2));
  (*((volatile uint32_t *)((0x48000C00UL) + 0x00))) = reg | (0x02 << ((6) * 2));
  reg =
      (*((volatile uint32_t *)((0x48000000UL) + 0x00))) & ~(0x03 << ((2) * 2));
  (*((volatile uint32_t *)((0x48000000UL) + 0x00))) = reg | (0x02 << ((2) * 2));
  reg =
      (*((volatile uint32_t *)((0x48000C00UL) + 0x20))) & ~(0xf << (((6)) * 4));
  (*((volatile uint32_t *)((0x48000C00UL) + 0x20))) = reg | (7 << (((6)) * 4));
  reg =
      (*((volatile uint32_t *)((0x48000000UL) + 0x20))) & ~(0xf << (((2)) * 4));
  (*((volatile uint32_t *)((0x48000000UL) + 0x20))) = reg | (7 << (((2)) * 4));
  (*(volatile uint32_t *)((0x40021000UL) + 0x58)) |= (1 << 17);
}


x86 assembly (clang, -O0):
<usart2_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4002104c,%eax
mov    (%rax),%ecx
or     $0x9,%ecx
mov    $0x4002104c,%eax
mov    %ecx,(%rax)
mov    $0x48000c00,%eax
mov    (%rax),%eax
and    $0xffffcfff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
or     $0x2000,%ecx
mov    $0x48000c00,%eax
mov    %ecx,(%rax)
mov    $0x48000000,%eax
mov    (%rax),%eax
and    $0xffffffcf,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
or     $0x20,%ecx
mov    $0x48000000,%eax
mov    %ecx,(%rax)
mov    $0x48000c20,%eax
mov    (%rax),%eax
and    $0xf0ffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
or     $0x7000000,%ecx
mov    $0x48000c20,%eax
mov    %ecx,(%rax)
mov    $0x48000020,%eax
mov    (%rax),%eax
and    $0xfffff0ff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
or     $0x700,%ecx
mov    $0x48000020,%eax
mov    %ecx,(%rax)
mov    $0x40021058,%eax
mov    (%rax),%ecx
or     $0x20000,%ecx
mov    $0x40021058,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<usart2_init>:
orl    $0x9,0x4002104c
09
mov    $0xffffcfff,%eax
and    0x48000c00,%eax
or     $0x2000,%eax
mov    %eax,0x48000c00
mov    0x48000000,%eax
and    $0xffffffcf,%eax
or     $0x20,%eax
mov    %eax,0x48000000
mov    $0xf0ffffff,%eax
and    0x48000c20,%eax
or     $0x7000000,%eax
mov    %eax,0x48000c20
mov    $0xfffff0ff,%eax
and    0x48000020,%eax
or     $0x700,%eax
mov    %eax,0x48000020
orl    $0x20000,0x40021058
ret

LLVM IR (-O0):
define void @usart2_init() {
%1 = alloca i32
%2 = load volatile i32, i32* inttoptr (i64 1073877068 to i32*)
%3 = or i32 %2, 9
store volatile i32 %3, i32* inttoptr (i64 1073877068 to i32*)
%4 = load volatile i32, i32* inttoptr (i64 1207962624 to i32*)
%5 = and i32 %4, -12289
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = or i32 %6, 8192
store volatile i32 %7, i32* inttoptr (i64 1207962624 to i32*)
%8 = load volatile i32, i32* inttoptr (i64 1207959552 to i32*)
%9 = and i32 %8, -49
store i32 %9, i32* %1
%10 = load i32, i32* %1
%11 = or i32 %10, 32
store volatile i32 %11, i32* inttoptr (i64 1207959552 to i32*)
%12 = load volatile i32, i32* inttoptr (i64 1207962656 to i32*)
%13 = and i32 %12, -251658241
store i32 %13, i32* %1
%14 = load i32, i32* %1
%15 = or i32 %14, 117440512
store volatile i32 %15, i32* inttoptr (i64 1207962656 to i32*)
%16 = load volatile i32, i32* inttoptr (i64 1207959584 to i32*)
%17 = and i32 %16, -3841
store i32 %17, i32* %1
%18 = load i32, i32* %1
%19 = or i32 %18, 1792
store volatile i32 %19, i32* inttoptr (i64 1207959584 to i32*)
%20 = load volatile i32, i32* inttoptr (i64 1073877080 to i32*)
%21 = or i32 %20, 131072
store volatile i32 %21, i32* inttoptr (i64 1073877080 to i32*)
ret void
}

LLVM IR (-O2):
define void @usart2_init() {
%1 = load volatile i32, i32* inttoptr (i64 1073877068 to i32*)
%2 = or i32 %1, 9
store volatile i32 %2, i32* inttoptr (i64 1073877068 to i32*)
%3 = load volatile i32, i32* inttoptr (i64 1207962624 to i32*)
%4 = and i32 %3, -12289
%5 = or i32 %4, 8192
store volatile i32 %5, i32* inttoptr (i64 1207962624 to i32*)
%6 = load volatile i32, i32* inttoptr (i64 1207959552 to i32*)
%7 = and i32 %6, -49
%8 = or i32 %7, 32
store volatile i32 %8, i32* inttoptr (i64 1207959552 to i32*)
%9 = load volatile i32, i32* inttoptr (i64 1207962656 to i32*)
%10 = and i32 %9, -251658241
%11 = or i32 %10, 117440512
store volatile i32 %11, i32* inttoptr (i64 1207962656 to i32*)
%12 = load volatile i32, i32* inttoptr (i64 1207959584 to i32*)
%13 = and i32 %12, -3841
%14 = or i32 %13, 1792
store volatile i32 %14, i32* inttoptr (i64 1207959584 to i32*)
%15 = load volatile i32, i32* inttoptr (i64 1073877080 to i32*)
%16 = or i32 %15, 131072
store volatile i32 %16, i32* inttoptr (i64 1073877080 to i32*)
ret void
}