#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 */
int psfdrv();
int psfdrv_entry(void) {
  int *a = ((int *)((0x80010000)));
  int *b = ((int *)((0x80010000) + (0x00000800)));
  int c = 0;
  while (a < b) {
    c += (*a++);
  }
  return c + psfdrv();
}


x86 assembly (clang, -O0):
<psfdrv_entry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x80010000,%eax
mov    %rax,-0x8(%rbp)
mov    $0x80010800,%eax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    115b <psfdrv_entry+0x4b>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1131 <psfdrv_entry+0x21>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <psfdrv@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psfdrv_entry>:
push   %rbx
pxor   %xmm0,%xmm0
mov    $0x80010070,%eax
xor    %ecx,%ecx
pxor   %xmm1,%xmm1
paddd  -0x70(%rax,%rcx,4),%xmm0
paddd  -0x60(%rax,%rcx,4),%xmm1
paddd  -0x50(%rax,%rcx,4),%xmm0
paddd  -0x40(%rax,%rcx,4),%xmm1
paddd  -0x30(%rax,%rcx,4),%xmm0
paddd  -0x20(%rax,%rcx,4),%xmm1
paddd  -0x10(%rax,%rcx,4),%xmm0
paddd  (%rax,%rcx,4),%xmm1
add    $0x20,%rcx
cmp    $0x200,%rcx
jne    1120 <psfdrv_entry+0x10>
paddd  %xmm0,%xmm1
pshufd $0xee,%xmm1,%xmm0
paddd  %xmm1,%xmm0
pshufd $0x55,%xmm0,%xmm1
paddd  %xmm0,%xmm1
movd   %xmm1,%ebx
xor    %eax,%eax
call   1030 <psfdrv@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @psfdrv_entry() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
store i32* inttoptr (i64 2147549184 to i32*), i32** %1
store i32* inttoptr (i64 2147551232 to i32*), i32** %2
store i32 0, i32* %3
br label %4
4: ; preds = %8, %0
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = icmp ult i32* %5, %6
br i1 %7, label %8, label %14
8: ; preds = %4
%9 = load i32*, i32** %1
%10 = getelementptr inbounds i32, i32* %9, i32 1
store i32* %10, i32** %1
%11 = load i32, i32* %9
%12 = load i32, i32* %3
%13 = add nsw i32 %12, %11
store i32 %13, i32* %3
br label %4
14: ; preds = %4
%15 = load i32, i32* %3
%16 = call i32 (...) @psfdrv()
%17 = add nsw i32 %15, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @psfdrv_entry() {
br label %1
1: ; preds = %1, %0
%2 = phi i64 [ 0, %0 ], [ %40, %1 ]
%3 = phi <4 x i32> [ zeroinitializer, %0 ], [ %38, %1 ]
%4 = phi <4 x i32> [ zeroinitializer, %0 ], [ %39, %1 ]
%5 = getelementptr i32, i32* inttoptr (i64 2147549184 to i32*), i64 %2
%6 = bitcast i32* %5 to <4 x i32>*
%7 = load <4 x i32>, <4 x i32>* %6
%8 = getelementptr i32, i32* %5, i64 4
%9 = bitcast i32* %8 to <4 x i32>*
%10 = load <4 x i32>, <4 x i32>* %9
%11 = add <4 x i32> %7, %3
%12 = add <4 x i32> %10, %4
%13 = or i64 %2, 8
%14 = getelementptr i32, i32* inttoptr (i64 2147549184 to i32*), i64 %13
%15 = bitcast i32* %14 to <4 x i32>*
%16 = load <4 x i32>, <4 x i32>* %15
%17 = getelementptr i32, i32* %14, i64 4
%18 = bitcast i32* %17 to <4 x i32>*
%19 = load <4 x i32>, <4 x i32>* %18
%20 = add <4 x i32> %16, %11
%21 = add <4 x i32> %19, %12
%22 = or i64 %2, 16
%23 = getelementptr i32, i32* inttoptr (i64 2147549184 to i32*), i64 %22
%24 = bitcast i32* %23 to <4 x i32>*
%25 = load <4 x i32>, <4 x i32>* %24
%26 = getelementptr i32, i32* %23, i64 4
%27 = bitcast i32* %26 to <4 x i32>*
%28 = load <4 x i32>, <4 x i32>* %27
%29 = add <4 x i32> %25, %20
%30 = add <4 x i32> %28, %21
%31 = or i64 %2, 24
%32 = getelementptr i32, i32* inttoptr (i64 2147549184 to i32*), i64 %31
%33 = bitcast i32* %32 to <4 x i32>*
%34 = load <4 x i32>, <4 x i32>* %33
%35 = getelementptr i32, i32* %32, i64 4
%36 = bitcast i32* %35 to <4 x i32>*
%37 = load <4 x i32>, <4 x i32>* %36
%38 = add <4 x i32> %34, %29
%39 = add <4 x i32> %37, %30
%40 = add nuw nsw i64 %2, 32
%41 = icmp eq i64 %40, 512
br i1 %41, label %42, label %1
42: ; preds = %1
%43 = add <4 x i32> %39, %38
%44 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %43)
%45 = tail call i32 (...) @psfdrv()
%46 = add nsw i32 %45, %44
ret i32 %46
}