#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 */
unsigned long getZeroU32();
void clearBuffer(unsigned char *bmp_buffer) {
  unsigned long *src;
  unsigned short i;
  const unsigned long v = getZeroU32();
  src = (unsigned long *)bmp_buffer;
  i = ((1 << (5 + 2)) * (20 * (1 << 3))) / (4 * 8);
  while (i--) {
    *src++ = v;
    *src++ = v;
    *src++ = v;
    *src++ = v;
    *src++ = v;
    *src++ = v;
    *src++ = v;
    *src++ = v;
  }
}


x86 assembly (clang, -O0):
<clearBuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getZeroU32@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movw   $0x280,-0x12(%rbp)
mov    -0x12(%rbp),%ax
mov    %ax,%cx
add    $0xffff,%cx
mov    %cx,-0x12(%rbp)
cmp    $0x0,%ax
je     1203 <clearBuffer+0xf3>
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x8,%rdx
mov    %rdx,-0x10(%rbp)
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x8,%rdx
mov    %rdx,-0x10(%rbp)
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x8,%rdx
mov    %rdx,-0x10(%rbp)
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x8,%rdx
mov    %rdx,-0x10(%rbp)
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x8,%rdx
mov    %rdx,-0x10(%rbp)
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x8,%rdx
mov    %rdx,-0x10(%rbp)
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x8,%rdx
mov    %rdx,-0x10(%rbp)
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x8,%rdx
mov    %rdx,-0x10(%rbp)
mov    %rcx,(%rax)
jmp    1135 <clearBuffer+0x25>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearBuffer>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <getZeroU32@plt>
mov    $0xfd80,%cx
nop
mov    %rax,(%rbx)
mov    %rax,0x8(%rbx)
mov    %rax,0x10(%rbx)
mov    %rax,0x18(%rbx)
mov    %rax,0x20(%rbx)
mov    %rax,0x28(%rbx)
mov    %rax,0x30(%rbx)
mov    %rax,0x38(%rbx)
mov    %rax,0x40(%rbx)
mov    %rax,0x48(%rbx)
mov    %rax,0x50(%rbx)
mov    %rax,0x58(%rbx)
mov    %rax,0x60(%rbx)
mov    %rax,0x68(%rbx)
mov    %rax,0x70(%rbx)
mov    %rax,0x78(%rbx)
sub    $0xffffffffffffff80,%rbx
add    $0x2,%cx
jne    1120 <clearBuffer+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @clearBuffer(i8* %0) {
%2 = alloca i8*
%3 = alloca i64*
%4 = alloca i16
%5 = alloca i64
store i8* %0, i8** %2
%6 = call i64 (...) @getZeroU32()
store i64 %6, i64* %5
%7 = load i8*, i8** %2
%8 = bitcast i8* %7 to i64*
store i64* %8, i64** %3
store i16 640, i16* %4
br label %9
9: ; preds = %13, %1
%10 = load i16, i16* %4
%11 = add i16 %10, -1
store i16 %11, i16* %4
%12 = icmp ne i16 %10, 0
br i1 %12, label %13, label %38
13: ; preds = %9
%14 = load i64, i64* %5
%15 = load i64*, i64** %3
%16 = getelementptr inbounds i64, i64* %15, i32 1
store i64* %16, i64** %3
store i64 %14, i64* %15
%17 = load i64, i64* %5
%18 = load i64*, i64** %3
%19 = getelementptr inbounds i64, i64* %18, i32 1
store i64* %19, i64** %3
store i64 %17, i64* %18
%20 = load i64, i64* %5
%21 = load i64*, i64** %3
%22 = getelementptr inbounds i64, i64* %21, i32 1
store i64* %22, i64** %3
store i64 %20, i64* %21
%23 = load i64, i64* %5
%24 = load i64*, i64** %3
%25 = getelementptr inbounds i64, i64* %24, i32 1
store i64* %25, i64** %3
store i64 %23, i64* %24
%26 = load i64, i64* %5
%27 = load i64*, i64** %3
%28 = getelementptr inbounds i64, i64* %27, i32 1
store i64* %28, i64** %3
store i64 %26, i64* %27
%29 = load i64, i64* %5
%30 = load i64*, i64** %3
%31 = getelementptr inbounds i64, i64* %30, i32 1
store i64* %31, i64** %3
store i64 %29, i64* %30
%32 = load i64, i64* %5
%33 = load i64*, i64** %3
%34 = getelementptr inbounds i64, i64* %33, i32 1
store i64* %34, i64** %3
store i64 %32, i64* %33
%35 = load i64, i64* %5
%36 = load i64*, i64** %3
%37 = getelementptr inbounds i64, i64* %36, i32 1
store i64* %37, i64** %3
store i64 %35, i64* %36
br label %9
38: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @clearBuffer(i8* nocapture writeonly %0) {
%2 = tail call i64 (...) @getZeroU32()
%3 = bitcast i8* %0 to i64*
br label %4
4: ; preds = %4, %1
%5 = phi i64* [ %3, %1 ], [ %23, %4 ]
%6 = phi i16 [ 640, %1 ], [ %15, %4 ]
%7 = getelementptr inbounds i64, i64* %5, i64 1
store i64 %2, i64* %5
%8 = getelementptr inbounds i64, i64* %5, i64 2
store i64 %2, i64* %7
%9 = getelementptr inbounds i64, i64* %5, i64 3
store i64 %2, i64* %8
%10 = getelementptr inbounds i64, i64* %5, i64 4
store i64 %2, i64* %9
%11 = getelementptr inbounds i64, i64* %5, i64 5
store i64 %2, i64* %10
%12 = getelementptr inbounds i64, i64* %5, i64 6
store i64 %2, i64* %11
%13 = getelementptr inbounds i64, i64* %5, i64 7
store i64 %2, i64* %12
%14 = getelementptr inbounds i64, i64* %5, i64 8
store i64 %2, i64* %13
%15 = add nsw i16 %6, -2
%16 = getelementptr inbounds i64, i64* %5, i64 9
store i64 %2, i64* %14
%17 = getelementptr inbounds i64, i64* %5, i64 10
store i64 %2, i64* %16
%18 = getelementptr inbounds i64, i64* %5, i64 11
store i64 %2, i64* %17
%19 = getelementptr inbounds i64, i64* %5, i64 12
store i64 %2, i64* %18
%20 = getelementptr inbounds i64, i64* %5, i64 13
store i64 %2, i64* %19
%21 = getelementptr inbounds i64, i64* %5, i64 14
store i64 %2, i64* %20
%22 = getelementptr inbounds i64, i64* %5, i64 15
store i64 %2, i64* %21
%23 = getelementptr inbounds i64, i64* %5, i64 16
store i64 %2, i64* %22
%24 = icmp eq i16 %15, 0
br i1 %24, label %25, label %4
25: ; preds = %4
ret void
}