#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 */
int /*<<< orphan*/ wait(int);
void application() {
  uint32_t ra;
  (*(volatile uint32_t *)(0x40023800 + 0x30)) |= (1 << 3);
  ra = (*(volatile uint32_t *)(0x40020C00 + 0x00));
  ra &= 0x00FFFFFF;
  ra |= 0x55000000;
  (*(volatile uint32_t *)(0x40020C00 + 0x00)) = ra;
  ra = (*(volatile uint32_t *)(0x40020C00 + 0x04));
  ra &= 0xFFFF0FFF;
  (*(volatile uint32_t *)(0x40020C00 + 0x04)) = ra;
  while (true) {
    (*(volatile uint32_t *)(0x40020C00 + 0x18)) = 0xE0001000;
    wait(10);
    (*(volatile uint32_t *)(0x40020C00 + 0x18)) = 0xB0004000;
    wait(8);
  }
}


x86 assembly (clang, -O0):
<application>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x40023830,%eax
mov    (%rax),%ecx
or     $0x8,%ecx
mov    $0x40023830,%eax
mov    %ecx,(%rax)
mov    $0x40020c00,%eax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     $0x55000000,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x40020c00,%eax
mov    %ecx,(%rax)
mov    $0x40020c04,%eax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff0fff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x40020c04,%eax
mov    %ecx,(%rax)
mov    $0x40020c18,%eax
movl   $0xe0001000,(%rax)
mov    $0xa,%edi
call   1030 <wait@plt>
mov    $0x40020c18,%eax
movl   $0xb0004000,(%rax)
mov    $0x8,%edi
call   1030 <wait@plt>
jmp    1172 <application+0x62>

x86 assembly (clang, -O2):
<application>:
push   %rax
orl    $0x8,0x40023830
08
mov    $0xffffff,%eax
and    0x40020c00,%eax
or     $0x55000000,%eax
mov    %eax,0x40020c00
andl   $0xffff0fff,0x40020c04
ff 0f ff ff
nopl   0x0(%rax)
movl   $0xe0001000,0x40020c18
mov    $0xa,%edi
call   1030 <wait@plt>
movl   $0xb0004000,0x40020c18
mov    $0x8,%edi
call   1030 <wait@plt>
jmp    1140 <application+0x30>

LLVM IR (-O0):
define void @application() {
%1 = alloca i32
%2 = load volatile i32, i32* inttoptr (i64 1073887280 to i32*)
%3 = or i32 %2, 8
store volatile i32 %3, i32* inttoptr (i64 1073887280 to i32*)
%4 = load volatile i32, i32* inttoptr (i64 1073875968 to i32*)
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = and i32 %5, 16777215
store i32 %6, i32* %1
%7 = load i32, i32* %1
%8 = or i32 %7, 1426063360
store i32 %8, i32* %1
%9 = load i32, i32* %1
store volatile i32 %9, i32* inttoptr (i64 1073875968 to i32*)
%10 = load volatile i32, i32* inttoptr (i64 1073875972 to i32*)
store i32 %10, i32* %1
%11 = load i32, i32* %1
%12 = and i32 %11, -61441
store i32 %12, i32* %1
%13 = load i32, i32* %1
store volatile i32 %13, i32* inttoptr (i64 1073875972 to i32*)
br label %14
14: ; preds = %0, %14
store volatile i32 -536866816, i32* inttoptr (i64 1073875992 to i32*)
%15 = call i32 @wait(i32 10)
store volatile i32 -1342160896, i32* inttoptr (i64 1073875992 to i32*)
%16 = call i32 @wait(i32 8)
br label %14
}

LLVM IR (-O2):
define void @application() {
%1 = load volatile i32, i32* inttoptr (i64 1073887280 to i32*)
%2 = or i32 %1, 8
store volatile i32 %2, i32* inttoptr (i64 1073887280 to i32*)
%3 = load volatile i32, i32* inttoptr (i64 1073875968 to i32*)
%4 = and i32 %3, 16777215
%5 = or i32 %4, 1426063360
store volatile i32 %5, i32* inttoptr (i64 1073875968 to i32*)
%6 = load volatile i32, i32* inttoptr (i64 1073875972 to i32*)
%7 = and i32 %6, -61441
store volatile i32 %7, i32* inttoptr (i64 1073875972 to i32*)
br label %8
8: ; preds = %8, %0
store volatile i32 -536866816, i32* inttoptr (i64 1073875992 to i32*)
%9 = tail call i32 @wait(i32 10)
store volatile i32 -1342160896, i32* inttoptr (i64 1073875992 to i32*)
%10 = tail call i32 @wait(i32 8)
br label %8
}