#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 */
scalar_t__ sceGeEdramGetAddr();
void display_clear() {
  unsigned int *vram =
      (unsigned int *)(0x40000000 | (unsigned int)sceGeEdramGetAddr());
  for (int x = 0; x < (512 * 272); x++)
    *vram++ = 0x00ff00ff;
}


x86 assembly (clang, -O0):
<display_clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <sceGeEdramGetAddr@plt>
or     $0x40000000,%eax
mov    %eax,%eax
mov    %rax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x22000,-0xc(%rbp)
jge    1161 <display_clear+0x51>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
movl   $0xff00ff,(%rax)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1131 <display_clear+0x21>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_clear>:
push   %rax
xor    %eax,%eax
call   1030 <sceGeEdramGetAddr@plt>
or     $0x40000000,%eax
mov    $0x3c,%ecx
movaps 0xed7(%rip),%xmm0
nopl   0x0(%rax)
movups %xmm0,-0xf0(%rax,%rcx,4)
ff
movups %xmm0,-0xe0(%rax,%rcx,4)
ff
movups %xmm0,-0xd0(%rax,%rcx,4)
ff
movups %xmm0,-0xc0(%rax,%rcx,4)
ff
movups %xmm0,-0xb0(%rax,%rcx,4)
ff
movups %xmm0,-0xa0(%rax,%rcx,4)
ff
movups %xmm0,-0x90(%rax,%rcx,4)
ff
movups %xmm0,-0x80(%rax,%rcx,4)
movups %xmm0,-0x70(%rax,%rcx,4)
movups %xmm0,-0x60(%rax,%rcx,4)
movups %xmm0,-0x50(%rax,%rcx,4)
movups %xmm0,-0x40(%rax,%rcx,4)
movups %xmm0,-0x30(%rax,%rcx,4)
movups %xmm0,-0x20(%rax,%rcx,4)
movups %xmm0,-0x10(%rax,%rcx,4)
movups %xmm0,(%rax,%rcx,4)
add    $0x40,%rcx
cmp    $0x2203c,%rcx
jne    1130 <display_clear+0x20>
pop    %rax
ret

LLVM IR (-O0):
define void @display_clear() {
%1 = alloca i32*
%2 = alloca i32
%3 = call i64 (...) @sceGeEdramGetAddr()
%4 = trunc i64 %3 to i32
%5 = or i32 1073741824, %4
%6 = zext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
store i32* %7, i32** %1
store i32 0, i32* %2
br label %8
8: ; preds = %14, %0
%9 = load i32, i32* %2
%10 = icmp slt i32 %9, 139264
br i1 %10, label %11, label %17
11: ; preds = %8
%12 = load i32*, i32** %1
%13 = getelementptr inbounds i32, i32* %12, i32 1
store i32* %13, i32** %1
store i32 16711935, i32* %12
br label %14
14: ; preds = %11
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
br label %8
17: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @display_clear() {
%1 = tail call i64 (...) @sceGeEdramGetAddr()
%2 = and i64 %1, 3221225471
%3 = or i64 %2, 1073741824
%4 = inttoptr i64 %3 to i32*
br label %5
5: ; preds = %5, %0
%6 = phi i64 [ 0, %0 ], [ %46, %5 ]
%7 = getelementptr i32, i32* %4, i64 %6
%8 = bitcast i32* %7 to <4 x i32>*
store <4 x i32> <i32 16711935, i32 16711935, i32 16711935, i32 16711935>, <4 x i32>* %8
%9 = getelementptr i32, i32* %7, i64 4
%10 = bitcast i32* %9 to <4 x i32>*
store <4 x i32> <i32 16711935, i32 16711935, i32 16711935, i32 16711935>, <4 x i32>* %10
%11 = or i64 %6, 8
%12 = getelementptr i32, i32* %4, i64 %11
%13 = bitcast i32* %12 to <4 x i32>*
store <4 x i32> <i32 16711935, i32 16711935, i32 16711935, i32 16711935>, <4 x i32>* %13
%14 = getelementptr i32, i32* %12, i64 4
%15 = bitcast i32* %14 to <4 x i32>*
store <4 x i32> <i32 16711935, i32 16711935, i32 16711935, i32 16711935>, <4 x i32>* %15
%16 = or i64 %6, 16
%17 = getelementptr i32, i32* %4, i64 %16
%18 = bitcast i32* %17 to <4 x i32>*
store <4 x i32> <i32 16711935, i32 16711935, i32 16711935, i32 16711935>, <4 x i32>* %18
%19 = getelementptr i32, i32* %17, i64 4
%20 = bitcast i32* %19 to <4 x i32>*
store <4 x i32> <i32 16711935, i32 16711935, i32 16711935, i32 16711935>, <4 x i32>* %20
%21 = or i64 %6, 24
%22 = getelementptr i32, i32* %4, i64 %21
%23 = bitcast i32* %22 to <4 x i32>*
store <4 x i32> <i32 16711935, i32 16711935, i32 16711935, i32 16711935>, <4 x i32>* %23
%24 = getelementptr i32, i32* %22, i64 4
%25 = bitcast i32* %24 to <4 x i32>*
store <4 x i32> <i32 16711935, i32 16711935, i32 16711935, i32 16711935>, <4 x i32>* %25
%26 = or i64 %6, 32
%27 = getelementptr i32, i32* %4, i64 %26
%28 = bitcast i32* %27 to <4 x i32>*
store <4 x i32> <i32 16711935, i32 16711935, i32 16711935, i32 16711935>, <4 x i32>* %28
%29 = getelementptr i32, i32* %27, i64 4
%30 = bitcast i32* %29 to <4 x i32>*
store <4 x i32> <i32 16711935, i32 16711935, i32 16711935, i32 16711935>, <4 x i32>* %30
%31 = or i64 %6, 40
%32 = getelementptr i32, i32* %4, i64 %31
%33 = bitcast i32* %32 to <4 x i32>*
store <4 x i32> <i32 16711935, i32 16711935, i32 16711935, i32 16711935>, <4 x i32>* %33
%34 = getelementptr i32, i32* %32, i64 4
%35 = bitcast i32* %34 to <4 x i32>*
store <4 x i32> <i32 16711935, i32 16711935, i32 16711935, i32 16711935>, <4 x i32>* %35
%36 = or i64 %6, 48
%37 = getelementptr i32, i32* %4, i64 %36
%38 = bitcast i32* %37 to <4 x i32>*
store <4 x i32> <i32 16711935, i32 16711935, i32 16711935, i32 16711935>, <4 x i32>* %38
%39 = getelementptr i32, i32* %37, i64 4
%40 = bitcast i32* %39 to <4 x i32>*
store <4 x i32> <i32 16711935, i32 16711935, i32 16711935, i32 16711935>, <4 x i32>* %40
%41 = or i64 %6, 56
%42 = getelementptr i32, i32* %4, i64 %41
%43 = bitcast i32* %42 to <4 x i32>*
store <4 x i32> <i32 16711935, i32 16711935, i32 16711935, i32 16711935>, <4 x i32>* %43
%44 = getelementptr i32, i32* %42, i64 4
%45 = bitcast i32* %44 to <4 x i32>*
store <4 x i32> <i32 16711935, i32 16711935, i32 16711935, i32 16711935>, <4 x i32>* %45
%46 = add nuw nsw i64 %6, 64
%47 = icmp eq i64 %46, 139264
br i1 %47, label %48, label %5
48: ; preds = %5
ret void
}