#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 LCD_WriteCmd(uint32_t cmdbyte) {
  (*(volatile unsigned long *)(0x3FFFC000 + 0x20)) = 0x000000;
  (*(volatile unsigned long *)(0x3FFFC000 + 0x1C)) = (1 << 22) | (1 << 13);
  (*(volatile unsigned long *)(0x3FFFC000 + 0x18)) = (1 << 12);
  (*(volatile unsigned long *)(0x3FFFC000 + 0x18)) = (1 << 19);
  (*(volatile unsigned long *)(0x3FFFC000 + 0x18)) = (1 << 18);
  (*(volatile unsigned long *)(0x3FFFC000 + 0x34));
  (*(volatile unsigned long *)(0x3FFFC000 + 0x34));
  (*(volatile unsigned long *)(0x3FFFC000 + 0x34));
  (*(volatile unsigned long *)(0x3FFFC000 + 0x34));
  (*(volatile unsigned long *)(0x3FFFC000 + 0x34));
  (*(volatile unsigned long *)(0x3FFFC000 + 0x34));
  while ((*(volatile unsigned long *)(0x3FFFC000 + 0x34)) & 0x800000)
    ;
  ;
  (*(volatile unsigned long *)(0x3FFFC000 + 0x1C)) = (1 << 12);
  (*(volatile unsigned long *)(0x3FFFC000 + 0x1C)) = (1 << 18);
  (*(volatile unsigned long *)(0x3FFFC000 + 0x34));
  (*(volatile unsigned long *)(0x3FFFC000 + 0x34));
  (*(volatile unsigned long *)(0x3FFFC000 + 0x34));
  (*(volatile unsigned long *)(0x3FFFC000 + 0x34));
  (*(volatile unsigned long *)(0x3FFFC000 + 0x34));
  (*(volatile unsigned long *)(0x3FFFC000 + 0x34));
  (*(volatile unsigned long *)(0x3FFFC000 + 0x34));
  (*(volatile unsigned long *)(0x3FFFC000 + 0x34));
  (*(volatile unsigned long *)(0x3FFFC000 + 0x18)) = (1 << 13);
  (*(volatile unsigned long *)(0x3FFFC000 + 0x18)) = (1 << 18);
  (*(volatile unsigned long *)(0x3FFFC000 + 0x34));
  (*(volatile unsigned long *)(0x3FFFC000 + 0x34));
  (*(volatile unsigned long *)(0x3FFFC000 + 0x34));
  (*(volatile unsigned long *)(0x3FFFC000 + 0x34));
  (*(volatile unsigned long *)(0x3FFFC000 + 0x34));
  (*(volatile unsigned long *)(0x3FFFC000 + 0x34));
  while ((*(volatile unsigned long *)(0x3FFFC000 + 0x34)) & 0x800000)
    ;
  ;
  (*(volatile unsigned long *)(0x3FFFC000 + 0x1C)) = (1 << 19) | (1 << 18);
  (*(volatile unsigned long *)(0x3FFFC000 + 0x20)) = 0xff0000;
  (*(volatile unsigned long *)(0x3FFFC000 + 0x18)) = (1 << 12) | (1 << 13);
  (*(volatile unsigned long *)(0x3FFFC000 + 0x34)) = cmdbyte << 16;
  (*(volatile unsigned long *)(0x3FFFC000 + 0x34));
  (*(volatile unsigned long *)(0x3FFFC000 + 0x34));
  (*(volatile unsigned long *)(0x3FFFC000 + 0x34));
  (*(volatile unsigned long *)(0x3FFFC000 + 0x34));
  (*(volatile unsigned long *)(0x3FFFC000 + 0x34));
  (*(volatile unsigned long *)(0x3FFFC000 + 0x34));
  (*(volatile unsigned long *)(0x3FFFC000 + 0x18)) = (1 << 18);
  (*(volatile unsigned long *)(0x3FFFC000 + 0x34));
  (*(volatile unsigned long *)(0x3FFFC000 + 0x34));
  (*(volatile unsigned long *)(0x3FFFC000 + 0x34));
  (*(volatile unsigned long *)(0x3FFFC000 + 0x34));
  (*(volatile unsigned long *)(0x3FFFC000 + 0x34));
  (*(volatile unsigned long *)(0x3FFFC000 + 0x34));
  (*(volatile unsigned long *)(0x3FFFC000 + 0x34));
  (*(volatile unsigned long *)(0x3FFFC000 + 0x34));
  (*(volatile unsigned long *)(0x3FFFC000 + 0x34));
  (*(volatile unsigned long *)(0x3FFFC000 + 0x1C)) = (1 << 18);
  (*(volatile unsigned long *)(0x3FFFC000 + 0x34));
  (*(volatile unsigned long *)(0x3FFFC000 + 0x34));
  (*(volatile unsigned long *)(0x3FFFC000 + 0x34));
  (*(volatile unsigned long *)(0x3FFFC000 + 0x34));
  (*(volatile unsigned long *)(0x3FFFC000 + 0x34));
  (*(volatile unsigned long *)(0x3FFFC000 + 0x34));
  (*(volatile unsigned long *)(0x3FFFC000 + 0x18)) = (1 << 22);
}


x86 assembly (clang, -O0):
<LCD_WriteCmd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x3fffc020,%eax
movq   $0x0,(%rax)
mov    $0x3fffc01c,%eax
movq   $0x402000,(%rax)
mov    $0x3fffc018,%eax
movq   $0x1000,(%rax)
mov    $0x3fffc018,%eax
movq   $0x80000,(%rax)
mov    $0x3fffc018,%eax
movq   $0x40000,(%rax)
mov    $0x3fffc034,%eax
mov    (%rax),%rax
mov    $0x3fffc034,%eax
mov    (%rax),%rax
mov    $0x3fffc034,%eax
mov    (%rax),%rax
mov    $0x3fffc034,%eax
mov    (%rax),%rax
mov    $0x3fffc034,%eax
mov    (%rax),%rax
mov    $0x3fffc034,%eax
mov    (%rax),%rax
mov    $0x3fffc034,%eax
mov    (%rax),%rax
and    $0x800000,%rax
cmp    $0x0,%rax
je     1190 <LCD_WriteCmd+0x90>
jmp    1173 <LCD_WriteCmd+0x73>
mov    $0x3fffc01c,%eax
movq   $0x1000,(%rax)
mov    $0x3fffc01c,%eax
movq   $0x40000,(%rax)
mov    $0x3fffc034,%eax
mov    (%rax),%rax
mov    $0x3fffc034,%eax
mov    (%rax),%rax
mov    $0x3fffc034,%eax
mov    (%rax),%rax
mov    $0x3fffc034,%eax
mov    (%rax),%rax
mov    $0x3fffc034,%eax
mov    (%rax),%rax
mov    $0x3fffc034,%eax
mov    (%rax),%rax
mov    $0x3fffc034,%eax
mov    (%rax),%rax
mov    $0x3fffc034,%eax
mov    (%rax),%rax
mov    $0x3fffc018,%eax
movq   $0x2000,(%rax)
mov    $0x3fffc018,%eax
movq   $0x40000,(%rax)
mov    $0x3fffc034,%eax
mov    (%rax),%rax
mov    $0x3fffc034,%eax
mov    (%rax),%rax
mov    $0x3fffc034,%eax
mov    (%rax),%rax
mov    $0x3fffc034,%eax
mov    (%rax),%rax
mov    $0x3fffc034,%eax
mov    (%rax),%rax
mov    $0x3fffc034,%eax
mov    (%rax),%rax
mov    $0x3fffc034,%eax
mov    (%rax),%rax
and    $0x800000,%rax
cmp    $0x0,%rax
je     124d <LCD_WriteCmd+0x14d>
jmp    1230 <LCD_WriteCmd+0x130>
mov    $0x3fffc01c,%eax
movq   $0xc0000,(%rax)
mov    $0x3fffc020,%eax
movq   $0xff0000,(%rax)
mov    $0x3fffc018,%eax
movq   $0x3000,(%rax)
mov    -0x4(%rbp),%eax
shl    $0x10,%eax
movslq %eax,%rcx
mov    $0x3fffc034,%eax
mov    %rcx,(%rax)
mov    $0x3fffc034,%eax
mov    (%rax),%rax
mov    $0x3fffc034,%eax
mov    (%rax),%rax
mov    $0x3fffc034,%eax
mov    (%rax),%rax
mov    $0x3fffc034,%eax
mov    (%rax),%rax
mov    $0x3fffc034,%eax
mov    (%rax),%rax
mov    $0x3fffc034,%eax
mov    (%rax),%rax
mov    $0x3fffc018,%eax
movq   $0x40000,(%rax)
mov    $0x3fffc034,%eax
mov    (%rax),%rax
mov    $0x3fffc034,%eax
mov    (%rax),%rax
mov    $0x3fffc034,%eax
mov    (%rax),%rax
mov    $0x3fffc034,%eax
mov    (%rax),%rax
mov    $0x3fffc034,%eax
mov    (%rax),%rax
mov    $0x3fffc034,%eax
mov    (%rax),%rax
mov    $0x3fffc034,%eax
mov    (%rax),%rax
mov    $0x3fffc034,%eax
mov    (%rax),%rax
mov    $0x3fffc034,%eax
mov    (%rax),%rax
mov    $0x3fffc01c,%eax
movq   $0x40000,(%rax)
mov    $0x3fffc034,%eax
mov    (%rax),%rax
mov    $0x3fffc034,%eax
mov    (%rax),%rax
mov    $0x3fffc034,%eax
mov    (%rax),%rax
mov    $0x3fffc034,%eax
mov    (%rax),%rax
mov    $0x3fffc034,%eax
mov    (%rax),%rax
mov    $0x3fffc034,%eax
mov    (%rax),%rax
mov    $0x3fffc018,%eax
movq   $0x400000,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCD_WriteCmd>:
movq   $0x0,0x3fffc020
movq   $0x402000,0x3fffc01c
movq   $0x1000,0x3fffc018
movq   $0x80000,0x3fffc018
movq   $0x40000,0x3fffc018
mov    0x3fffc034,%rax
3f
mov    0x3fffc034,%rax
3f
mov    0x3fffc034,%rax
3f
mov    0x3fffc034,%rax
3f
mov    0x3fffc034,%rax
3f
mov    0x3fffc034,%rax
3f
nopl   0x0(%rax)
testq  $0x800000,0x3fffc034
jne    1170 <LCD_WriteCmd+0x70>
movq   $0x1000,0x3fffc01c
movq   $0x40000,0x3fffc01c
mov    0x3fffc034,%rax
3f
mov    0x3fffc034,%rax
3f
mov    0x3fffc034,%rax
3f
mov    0x3fffc034,%rax
3f
mov    0x3fffc034,%rax
3f
mov    0x3fffc034,%rax
3f
mov    0x3fffc034,%rax
3f
mov    0x3fffc034,%rax
3f
movq   $0x2000,0x3fffc018
movq   $0x40000,0x3fffc018
mov    0x3fffc034,%rax
3f
mov    0x3fffc034,%rax
3f
mov    0x3fffc034,%rax
3f
mov    0x3fffc034,%rax
3f
mov    0x3fffc034,%rax
3f
mov    0x3fffc034,%rax
3f
xchg   %ax,%ax
testq  $0x800000,0x3fffc034
jne    1220 <LCD_WriteCmd+0x120>
movq   $0xc0000,0x3fffc01c
movq   $0xff0000,0x3fffc020
movq   $0x3000,0x3fffc018
shl    $0x10,%edi
movslq %edi,%rax
mov    %rax,0x3fffc034
3f
mov    0x3fffc034,%rax
3f
mov    0x3fffc034,%rax
3f
mov    0x3fffc034,%rax
3f
mov    0x3fffc034,%rax
3f
mov    0x3fffc034,%rax
3f
mov    0x3fffc034,%rax
3f
movq   $0x40000,0x3fffc018
mov    0x3fffc034,%rax
3f
mov    0x3fffc034,%rax
3f
mov    0x3fffc034,%rax
3f
mov    0x3fffc034,%rax
3f
mov    0x3fffc034,%rax
3f
mov    0x3fffc034,%rax
3f
mov    0x3fffc034,%rax
3f
mov    0x3fffc034,%rax
3f
mov    0x3fffc034,%rax
3f
movq   $0x40000,0x3fffc01c
mov    0x3fffc034,%rax
3f
mov    0x3fffc034,%rax
3f
mov    0x3fffc034,%rax
3f
mov    0x3fffc034,%rax
3f
mov    0x3fffc034,%rax
3f
mov    0x3fffc034,%rax
3f
movq   $0x400000,0x3fffc018
ret

LLVM IR (-O0):
define void @LCD_WriteCmd(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
store volatile i64 0, i64* inttoptr (i64 1073725472 to i64*)
store volatile i64 4202496, i64* inttoptr (i64 1073725468 to i64*)
store volatile i64 4096, i64* inttoptr (i64 1073725464 to i64*)
store volatile i64 524288, i64* inttoptr (i64 1073725464 to i64*)
store volatile i64 262144, i64* inttoptr (i64 1073725464 to i64*)
%3 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%4 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%5 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%6 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%7 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%8 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
br label %9
9: ; preds = %13, %1
%10 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%11 = and i64 %10, 8388608
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %9
br label %9
14: ; preds = %9
store volatile i64 4096, i64* inttoptr (i64 1073725468 to i64*)
store volatile i64 262144, i64* inttoptr (i64 1073725468 to i64*)
%15 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%16 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%17 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%18 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%19 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%20 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%21 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%22 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
store volatile i64 8192, i64* inttoptr (i64 1073725464 to i64*)
store volatile i64 262144, i64* inttoptr (i64 1073725464 to i64*)
%23 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%24 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%25 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%26 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%27 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%28 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
br label %29
29: ; preds = %33, %14
%30 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%31 = and i64 %30, 8388608
%32 = icmp ne i64 %31, 0
br i1 %32, label %33, label %34
33: ; preds = %29
br label %29
34: ; preds = %29
store volatile i64 786432, i64* inttoptr (i64 1073725468 to i64*)
store volatile i64 16711680, i64* inttoptr (i64 1073725472 to i64*)
store volatile i64 12288, i64* inttoptr (i64 1073725464 to i64*)
%35 = load i32, i32* %2
%36 = shl i32 %35, 16
%37 = sext i32 %36 to i64
store volatile i64 %37, i64* inttoptr (i64 1073725492 to i64*)
%38 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%39 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%40 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%41 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%42 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%43 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
store volatile i64 262144, i64* inttoptr (i64 1073725464 to i64*)
%44 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%45 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%46 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%47 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%48 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%49 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%50 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%51 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%52 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
store volatile i64 262144, i64* inttoptr (i64 1073725468 to i64*)
%53 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%54 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%55 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%56 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%57 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%58 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
store volatile i64 4194304, i64* inttoptr (i64 1073725464 to i64*)
ret void
}

LLVM IR (-O2):
define void @LCD_WriteCmd(i32 %0) {
store volatile i64 0, i64* inttoptr (i64 1073725472 to i64*)
store volatile i64 4202496, i64* inttoptr (i64 1073725468 to i64*)
store volatile i64 4096, i64* inttoptr (i64 1073725464 to i64*)
store volatile i64 524288, i64* inttoptr (i64 1073725464 to i64*)
store volatile i64 262144, i64* inttoptr (i64 1073725464 to i64*)
%2 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%3 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%4 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%5 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%6 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%7 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
br label %8
8: ; preds = %8, %1
%9 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%10 = and i64 %9, 8388608
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %8
12: ; preds = %8
store volatile i64 4096, i64* inttoptr (i64 1073725468 to i64*)
store volatile i64 262144, i64* inttoptr (i64 1073725468 to i64*)
%13 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%14 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%15 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%16 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%17 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%18 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%19 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%20 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
store volatile i64 8192, i64* inttoptr (i64 1073725464 to i64*)
store volatile i64 262144, i64* inttoptr (i64 1073725464 to i64*)
%21 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%22 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%23 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%24 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%25 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%26 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
br label %27
27: ; preds = %27, %12
%28 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%29 = and i64 %28, 8388608
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %27
31: ; preds = %27
store volatile i64 786432, i64* inttoptr (i64 1073725468 to i64*)
store volatile i64 16711680, i64* inttoptr (i64 1073725472 to i64*)
store volatile i64 12288, i64* inttoptr (i64 1073725464 to i64*)
%32 = shl i32 %0, 16
%33 = sext i32 %32 to i64
store volatile i64 %33, i64* inttoptr (i64 1073725492 to i64*)
%34 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%35 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%36 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%37 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%38 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%39 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
store volatile i64 262144, i64* inttoptr (i64 1073725464 to i64*)
%40 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%41 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%42 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%43 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%44 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%45 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%46 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%47 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%48 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
store volatile i64 262144, i64* inttoptr (i64 1073725468 to i64*)
%49 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%50 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%51 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%52 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%53 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
%54 = load volatile i64, i64* inttoptr (i64 1073725492 to i64*)
store volatile i64 4194304, i64* inttoptr (i64 1073725464 to i64*)
ret void
}