#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 clearScreens(void) {
  for (uint32_t i = 0; i < ((400 * 240 * 3 / 4)); i++) {
    *((volatile uint32_t *)0x18300000 + i) = 0;
  }
  for (uint32_t i = 0; i < ((320 * 240 * 3 / 4)); i++) {
    *((volatile uint32_t *)0x18346500 + i) = 0;
  }
}


x86 assembly (clang, -O0):
<clearScreens>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x11940,-0x4(%rbp)
jge    1136 <clearScreens+0x36>
movslq -0x4(%rbp),%rcx
mov    $0x18300000,%eax
movl   $0x0,(%rax,%rcx,4)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <clearScreens+0xb>
movl   $0x0,-0x8(%rbp)
cmpl   $0xe100,-0x8(%rbp)
jge    1168 <clearScreens+0x68>
movslq -0x8(%rbp),%rcx
mov    $0x18346500,%eax
movl   $0x0,(%rax,%rcx,4)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <clearScreens+0x3d>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearScreens>:
mov    $0x7,%ecx
mov    $0x18300000,%eax
nopw   0x0(%rax,%rax,1)
movl   $0x0,-0x1c(%rax,%rcx,4)
movl   $0x0,-0x18(%rax,%rcx,4)
movl   $0x0,-0x14(%rax,%rcx,4)
movl   $0x0,-0x10(%rax,%rcx,4)
movl   $0x0,-0xc(%rax,%rcx,4)
movl   $0x0,-0x8(%rax,%rcx,4)
movl   $0x0,-0x4(%rax,%rcx,4)
movl   $0x0,(%rax,%rcx,4)
add    $0x8,%rcx
cmp    $0x11947,%rcx
jne    1110 <clearScreens+0x10>
mov    $0x7,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movl   $0x0,0x464e4(%rax,%rcx,4)
movl   $0x0,0x464e8(%rax,%rcx,4)
movl   $0x0,0x464ec(%rax,%rcx,4)
movl   $0x0,0x464f0(%rax,%rcx,4)
movl   $0x0,0x464f4(%rax,%rcx,4)
movl   $0x0,0x464f8(%rax,%rcx,4)
movl   $0x0,0x464fc(%rax,%rcx,4)
movl   $0x0,0x46500(%rax,%rcx,4)
add    $0x8,%rcx
cmp    $0xe107,%rcx
jne    1170 <clearScreens+0x70>
ret

LLVM IR (-O0):
define void @clearScreens() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %10, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 72000
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = load i32, i32* %1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* inttoptr (i64 405798912 to i32*), i64 %8
store volatile i32 0, i32* %9
br label %10
10: ; preds = %6
%11 = load i32, i32* %1
%12 = add nsw i32 %11, 1
store i32 %12, i32* %1
br label %3
13: ; preds = %3
store i32 0, i32* %2
br label %14
14: ; preds = %21, %13
%15 = load i32, i32* %2
%16 = icmp slt i32 %15, 57600
br i1 %16, label %17, label %24
17: ; preds = %14
%18 = load i32, i32* %2
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* inttoptr (i64 406086912 to i32*), i64 %19
store volatile i32 0, i32* %20
br label %21
21: ; preds = %17
%22 = load i32, i32* %2
%23 = add nsw i32 %22, 1
store i32 %23, i32* %2
br label %14
24: ; preds = %14
ret void
}

LLVM IR (-O2):
define void @clearScreens() {
br label %1
1: ; preds = %1, %0
%2 = phi i64 [ 0, %0 ], [ %18, %1 ]
%3 = getelementptr inbounds i32, i32* inttoptr (i64 405798912 to i32*), i64 %2
store volatile i32 0, i32* %3
%4 = or i64 %2, 1
%5 = getelementptr inbounds i32, i32* inttoptr (i64 405798912 to i32*), i64 %4
store volatile i32 0, i32* %5
%6 = or i64 %2, 2
%7 = getelementptr inbounds i32, i32* inttoptr (i64 405798912 to i32*), i64 %6
store volatile i32 0, i32* %7
%8 = or i64 %2, 3
%9 = getelementptr inbounds i32, i32* inttoptr (i64 405798912 to i32*), i64 %8
store volatile i32 0, i32* %9
%10 = or i64 %2, 4
%11 = getelementptr inbounds i32, i32* inttoptr (i64 405798912 to i32*), i64 %10
store volatile i32 0, i32* %11
%12 = or i64 %2, 5
%13 = getelementptr inbounds i32, i32* inttoptr (i64 405798912 to i32*), i64 %12
store volatile i32 0, i32* %13
%14 = or i64 %2, 6
%15 = getelementptr inbounds i32, i32* inttoptr (i64 405798912 to i32*), i64 %14
store volatile i32 0, i32* %15
%16 = or i64 %2, 7
%17 = getelementptr inbounds i32, i32* inttoptr (i64 405798912 to i32*), i64 %16
store volatile i32 0, i32* %17
%18 = add nuw nsw i64 %2, 8
%19 = icmp eq i64 %18, 72000
br i1 %19, label %21, label %1
20: ; preds = %21
ret void
21: ; preds = %1, %21
%22 = phi i64 [ %38, %21 ], [ 0, %1 ]
%23 = getelementptr inbounds i32, i32* inttoptr (i64 406086912 to i32*), i64 %22
store volatile i32 0, i32* %23
%24 = or i64 %22, 1
%25 = getelementptr inbounds i32, i32* inttoptr (i64 406086912 to i32*), i64 %24
store volatile i32 0, i32* %25
%26 = or i64 %22, 2
%27 = getelementptr inbounds i32, i32* inttoptr (i64 406086912 to i32*), i64 %26
store volatile i32 0, i32* %27
%28 = or i64 %22, 3
%29 = getelementptr inbounds i32, i32* inttoptr (i64 406086912 to i32*), i64 %28
store volatile i32 0, i32* %29
%30 = or i64 %22, 4
%31 = getelementptr inbounds i32, i32* inttoptr (i64 406086912 to i32*), i64 %30
store volatile i32 0, i32* %31
%32 = or i64 %22, 5
%33 = getelementptr inbounds i32, i32* inttoptr (i64 406086912 to i32*), i64 %32
store volatile i32 0, i32* %33
%34 = or i64 %22, 6
%35 = getelementptr inbounds i32, i32* inttoptr (i64 406086912 to i32*), i64 %34
store volatile i32 0, i32* %35
%36 = or i64 %22, 7
%37 = getelementptr inbounds i32, i32* inttoptr (i64 406086912 to i32*), i64 %36
store volatile i32 0, i32* %37
%38 = add nuw nsw i64 %22, 8
%39 = icmp eq i64 %38, 57600
br i1 %39, label %20, label %21
}