#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__ malloc(int);
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  const int size = 125;
  int *array_a = (int *)malloc(sizeof(int) * size);
  for (int i = 0; i < size; ++i) {
    array_a[i] = 7;
  }
  printf("hej=%d %d\n", *array_a, *(array_a + size - 1));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x7d,-0x8(%rbp)
mov    $0x1f4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x7d,-0x14(%rbp)
jge    1172 <main+0x52>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movl   $0x7,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114b <main+0x2b>
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rax
mov    0x1f0(%rax),%edx
lea    0xe77(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1f4,%edi
call   1040 <malloc@plt>
movaps 0xece(%rip),%xmm0
movups %xmm0,(%rax)
movups %xmm0,0x10(%rax)
movups %xmm0,0x20(%rax)
movups %xmm0,0x30(%rax)
movups %xmm0,0x40(%rax)
movups %xmm0,0x50(%rax)
movups %xmm0,0x60(%rax)
movups %xmm0,0x70(%rax)
movups %xmm0,0x80(%rax)
movups %xmm0,0x90(%rax)
movups %xmm0,0xa0(%rax)
movups %xmm0,0xb0(%rax)
movups %xmm0,0xc0(%rax)
movups %xmm0,0xd0(%rax)
movups %xmm0,0xe0(%rax)
movups %xmm0,0xf0(%rax)
movups %xmm0,0x100(%rax)
movups %xmm0,0x110(%rax)
movups %xmm0,0x120(%rax)
movups %xmm0,0x130(%rax)
movups %xmm0,0x140(%rax)
movups %xmm0,0x150(%rax)
movups %xmm0,0x160(%rax)
movups %xmm0,0x170(%rax)
movups %xmm0,0x180(%rax)
movups %xmm0,0x190(%rax)
movups %xmm0,0x1a0(%rax)
movups %xmm0,0x1b0(%rax)
movups %xmm0,0x1c0(%rax)
movups %xmm0,0x1d0(%rax)
movups %xmm0,0x1e0(%rax)
movl   $0x7,0x1f0(%rax)
mov    (%rax),%esi
lea    0xe0b(%rip),%rdi
mov    $0x7,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"hej=%d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
store i32 0, i32* %1
store i32 125, i32* %2
%5 = call i64 @malloc(i32 500)
%6 = inttoptr i64 %5 to i32*
store i32* %6, i32** %3
store i32 0, i32* %4
br label %7
7: ; preds = %15, %0
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 125
br i1 %9, label %10, label %18
10: ; preds = %7
%11 = load i32*, i32** %3
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
store i32 7, i32* %14
br label %15
15: ; preds = %10
%16 = load i32, i32* %4
%17 = add nsw i32 %16, 1
store i32 %17, i32* %4
br label %7
18: ; preds = %7
%19 = load i32*, i32** %3
%20 = load i32, i32* %19
%21 = load i32*, i32** %3
%22 = getelementptr inbounds i32, i32* %21, i64 125
%23 = getelementptr inbounds i32, i32* %22, i64 -1
%24 = load i32, i32* %23
%25 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %20, i32 %24)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"hej=%d %d\0A\00"
define i32 @main() {
%1 = tail call i64 @malloc(i32 500)
%2 = inttoptr i64 %1 to i32*
%3 = inttoptr i64 %1 to <4 x i32>*
store <4 x i32> <i32 7, i32 7, i32 7, i32 7>, <4 x i32>* %3
%4 = getelementptr inbounds i32, i32* %2, i64 4
%5 = bitcast i32* %4 to <4 x i32>*
store <4 x i32> <i32 7, i32 7, i32 7, i32 7>, <4 x i32>* %5
%6 = getelementptr inbounds i32, i32* %2, i64 8
%7 = bitcast i32* %6 to <4 x i32>*
store <4 x i32> <i32 7, i32 7, i32 7, i32 7>, <4 x i32>* %7
%8 = getelementptr inbounds i32, i32* %2, i64 12
%9 = bitcast i32* %8 to <4 x i32>*
store <4 x i32> <i32 7, i32 7, i32 7, i32 7>, <4 x i32>* %9
%10 = getelementptr inbounds i32, i32* %2, i64 16
%11 = bitcast i32* %10 to <4 x i32>*
store <4 x i32> <i32 7, i32 7, i32 7, i32 7>, <4 x i32>* %11
%12 = getelementptr inbounds i32, i32* %2, i64 20
%13 = bitcast i32* %12 to <4 x i32>*
store <4 x i32> <i32 7, i32 7, i32 7, i32 7>, <4 x i32>* %13
%14 = getelementptr inbounds i32, i32* %2, i64 24
%15 = bitcast i32* %14 to <4 x i32>*
store <4 x i32> <i32 7, i32 7, i32 7, i32 7>, <4 x i32>* %15
%16 = getelementptr inbounds i32, i32* %2, i64 28
%17 = bitcast i32* %16 to <4 x i32>*
store <4 x i32> <i32 7, i32 7, i32 7, i32 7>, <4 x i32>* %17
%18 = getelementptr inbounds i32, i32* %2, i64 32
%19 = bitcast i32* %18 to <4 x i32>*
store <4 x i32> <i32 7, i32 7, i32 7, i32 7>, <4 x i32>* %19
%20 = getelementptr inbounds i32, i32* %2, i64 36
%21 = bitcast i32* %20 to <4 x i32>*
store <4 x i32> <i32 7, i32 7, i32 7, i32 7>, <4 x i32>* %21
%22 = getelementptr inbounds i32, i32* %2, i64 40
%23 = bitcast i32* %22 to <4 x i32>*
store <4 x i32> <i32 7, i32 7, i32 7, i32 7>, <4 x i32>* %23
%24 = getelementptr inbounds i32, i32* %2, i64 44
%25 = bitcast i32* %24 to <4 x i32>*
store <4 x i32> <i32 7, i32 7, i32 7, i32 7>, <4 x i32>* %25
%26 = getelementptr inbounds i32, i32* %2, i64 48
%27 = bitcast i32* %26 to <4 x i32>*
store <4 x i32> <i32 7, i32 7, i32 7, i32 7>, <4 x i32>* %27
%28 = getelementptr inbounds i32, i32* %2, i64 52
%29 = bitcast i32* %28 to <4 x i32>*
store <4 x i32> <i32 7, i32 7, i32 7, i32 7>, <4 x i32>* %29
%30 = getelementptr inbounds i32, i32* %2, i64 56
%31 = bitcast i32* %30 to <4 x i32>*
store <4 x i32> <i32 7, i32 7, i32 7, i32 7>, <4 x i32>* %31
%32 = getelementptr inbounds i32, i32* %2, i64 60
%33 = bitcast i32* %32 to <4 x i32>*
store <4 x i32> <i32 7, i32 7, i32 7, i32 7>, <4 x i32>* %33
%34 = getelementptr inbounds i32, i32* %2, i64 64
%35 = bitcast i32* %34 to <4 x i32>*
store <4 x i32> <i32 7, i32 7, i32 7, i32 7>, <4 x i32>* %35
%36 = getelementptr inbounds i32, i32* %2, i64 68
%37 = bitcast i32* %36 to <4 x i32>*
store <4 x i32> <i32 7, i32 7, i32 7, i32 7>, <4 x i32>* %37
%38 = getelementptr inbounds i32, i32* %2, i64 72
%39 = bitcast i32* %38 to <4 x i32>*
store <4 x i32> <i32 7, i32 7, i32 7, i32 7>, <4 x i32>* %39
%40 = getelementptr inbounds i32, i32* %2, i64 76
%41 = bitcast i32* %40 to <4 x i32>*
store <4 x i32> <i32 7, i32 7, i32 7, i32 7>, <4 x i32>* %41
%42 = getelementptr inbounds i32, i32* %2, i64 80
%43 = bitcast i32* %42 to <4 x i32>*
store <4 x i32> <i32 7, i32 7, i32 7, i32 7>, <4 x i32>* %43
%44 = getelementptr inbounds i32, i32* %2, i64 84
%45 = bitcast i32* %44 to <4 x i32>*
store <4 x i32> <i32 7, i32 7, i32 7, i32 7>, <4 x i32>* %45
%46 = getelementptr inbounds i32, i32* %2, i64 88
%47 = bitcast i32* %46 to <4 x i32>*
store <4 x i32> <i32 7, i32 7, i32 7, i32 7>, <4 x i32>* %47
%48 = getelementptr inbounds i32, i32* %2, i64 92
%49 = bitcast i32* %48 to <4 x i32>*
store <4 x i32> <i32 7, i32 7, i32 7, i32 7>, <4 x i32>* %49
%50 = getelementptr inbounds i32, i32* %2, i64 96
%51 = bitcast i32* %50 to <4 x i32>*
store <4 x i32> <i32 7, i32 7, i32 7, i32 7>, <4 x i32>* %51
%52 = getelementptr inbounds i32, i32* %2, i64 100
%53 = bitcast i32* %52 to <4 x i32>*
store <4 x i32> <i32 7, i32 7, i32 7, i32 7>, <4 x i32>* %53
%54 = getelementptr inbounds i32, i32* %2, i64 104
%55 = bitcast i32* %54 to <4 x i32>*
store <4 x i32> <i32 7, i32 7, i32 7, i32 7>, <4 x i32>* %55
%56 = getelementptr inbounds i32, i32* %2, i64 108
%57 = bitcast i32* %56 to <4 x i32>*
store <4 x i32> <i32 7, i32 7, i32 7, i32 7>, <4 x i32>* %57
%58 = getelementptr inbounds i32, i32* %2, i64 112
%59 = bitcast i32* %58 to <4 x i32>*
store <4 x i32> <i32 7, i32 7, i32 7, i32 7>, <4 x i32>* %59
%60 = getelementptr inbounds i32, i32* %2, i64 116
%61 = bitcast i32* %60 to <4 x i32>*
store <4 x i32> <i32 7, i32 7, i32 7, i32 7>, <4 x i32>* %61
%62 = getelementptr inbounds i32, i32* %2, i64 120
%63 = bitcast i32* %62 to <4 x i32>*
store <4 x i32> <i32 7, i32 7, i32 7, i32 7>, <4 x i32>* %63
%64 = getelementptr inbounds i32, i32* %2, i64 124
store i32 7, i32* %64
%65 = load i32, i32* %2
%66 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %65, i32 7)
ret i32 0
}