#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 MappedEventGet(int);
void MappedDspIntsGet(int *array) {
  int i;
  for (i = 4; i < 16; i++)
    array[i - 4] = MappedEventGet(i);
}


x86 assembly (clang, -O0):
<MappedDspIntsGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
cmpl   $0x10,-0xc(%rbp)
jge    1155 <MappedDspIntsGet+0x45>
mov    -0xc(%rbp),%edi
call   1030 <MappedEventGet@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x4,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <MappedDspIntsGet+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MappedDspIntsGet>:
push   %rbx
mov    %rdi,%rbx
mov    $0x4,%edi
call   1030 <MappedEventGet@plt>
mov    %eax,(%rbx)
mov    $0x5,%edi
call   1030 <MappedEventGet@plt>
mov    %eax,0x4(%rbx)
mov    $0x6,%edi
call   1030 <MappedEventGet@plt>
mov    %eax,0x8(%rbx)
mov    $0x7,%edi
call   1030 <MappedEventGet@plt>
mov    %eax,0xc(%rbx)
mov    $0x8,%edi
call   1030 <MappedEventGet@plt>
mov    %eax,0x10(%rbx)
mov    $0x9,%edi
call   1030 <MappedEventGet@plt>
mov    %eax,0x14(%rbx)
mov    $0xa,%edi
call   1030 <MappedEventGet@plt>
mov    %eax,0x18(%rbx)
mov    $0xb,%edi
call   1030 <MappedEventGet@plt>
mov    %eax,0x1c(%rbx)
mov    $0xc,%edi
call   1030 <MappedEventGet@plt>
mov    %eax,0x20(%rbx)
mov    $0xd,%edi
call   1030 <MappedEventGet@plt>
mov    %eax,0x24(%rbx)
mov    $0xe,%edi
call   1030 <MappedEventGet@plt>
mov    %eax,0x28(%rbx)
mov    $0xf,%edi
call   1030 <MappedEventGet@plt>
mov    %eax,0x2c(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @MappedDspIntsGet(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 4, i32* %3
br label %4
4: ; preds = %15, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 16
br i1 %6, label %7, label %18
7: ; preds = %4
%8 = load i32, i32* %3
%9 = call i32 @MappedEventGet(i32 %8)
%10 = load i32*, i32** %2
%11 = load i32, i32* %3
%12 = sub nsw i32 %11, 4
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %10, i64 %13
store i32 %9, i32* %14
br label %15
15: ; preds = %7
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %4
18: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @MappedDspIntsGet(i32* nocapture writeonly %0) {
%2 = tail call i32 @MappedEventGet(i32 4)
store i32 %2, i32* %0
%3 = tail call i32 @MappedEventGet(i32 5)
%4 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %3, i32* %4
%5 = tail call i32 @MappedEventGet(i32 6)
%6 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %5, i32* %6
%7 = tail call i32 @MappedEventGet(i32 7)
%8 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %7, i32* %8
%9 = tail call i32 @MappedEventGet(i32 8)
%10 = getelementptr inbounds i32, i32* %0, i64 4
store i32 %9, i32* %10
%11 = tail call i32 @MappedEventGet(i32 9)
%12 = getelementptr inbounds i32, i32* %0, i64 5
store i32 %11, i32* %12
%13 = tail call i32 @MappedEventGet(i32 10)
%14 = getelementptr inbounds i32, i32* %0, i64 6
store i32 %13, i32* %14
%15 = tail call i32 @MappedEventGet(i32 11)
%16 = getelementptr inbounds i32, i32* %0, i64 7
store i32 %15, i32* %16
%17 = tail call i32 @MappedEventGet(i32 12)
%18 = getelementptr inbounds i32, i32* %0, i64 8
store i32 %17, i32* %18
%19 = tail call i32 @MappedEventGet(i32 13)
%20 = getelementptr inbounds i32, i32* %0, i64 9
store i32 %19, i32* %20
%21 = tail call i32 @MappedEventGet(i32 14)
%22 = getelementptr inbounds i32, i32* %0, i64 10
store i32 %21, i32* %22
%23 = tail call i32 @MappedEventGet(i32 15)
%24 = getelementptr inbounds i32, i32* %0, i64 11
store i32 %23, i32* %24
ret void
}