#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 */
long *malloc(int);
int /*<<< orphan*/ printf(char *, ...);
void main() {
  long *a;
  long i;
  a = malloc(8 * 20);
  for (i = 0; i < 20; i = i + 1) {
    a[i] = 3 * i;
  }
  printf("Ok so far\n");
  for (i = 0; i < 20; i = i + 1) {
    printf("%d: %d\n", i, a[i]);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xa0,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x14,-0x10(%rbp)
jge    116b <main+0x4b>
imul   $0x3,-0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    113e <main+0x1e>
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movq   $0x0,-0x10(%rbp)
cmpq   $0x14,-0x10(%rbp)
jge    11bb <main+0x9b>
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xe68(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1181 <main+0x61>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0xa0,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
movaps 0xeb8(%rip),%xmm0
movups %xmm0,(%rax)
movaps 0xebe(%rip),%xmm0
movups %xmm0,0x10(%rax)
movaps 0xec3(%rip),%xmm0
movups %xmm0,0x20(%rax)
movaps 0xec8(%rip),%xmm0
movups %xmm0,0x30(%rax)
movaps 0xecd(%rip),%xmm0
movups %xmm0,0x40(%rax)
movaps 0xed2(%rip),%xmm0
movups %xmm0,0x50(%rax)
movaps 0xed7(%rip),%xmm0
movups %xmm0,0x60(%rax)
movaps 0xedc(%rip),%xmm0
movups %xmm0,0x70(%rax)
movaps 0xee1(%rip),%xmm0
movups %xmm0,0x80(%rax)
movaps 0xee3(%rip),%xmm0
movups %xmm0,0x90(%rax)
lea    0xeed(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%rdx
lea    0xed6(%rip),%r14
mov    %r14,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rbx),%rdx
mov    $0x1,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rbx),%rdx
mov    $0x2,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x18(%rbx),%rdx
mov    $0x3,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x20(%rbx),%rdx
mov    $0x4,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x28(%rbx),%rdx
mov    $0x5,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x30(%rbx),%rdx
mov    $0x6,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x38(%rbx),%rdx
mov    $0x7,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x40(%rbx),%rdx
mov    $0x8,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x48(%rbx),%rdx
mov    $0x9,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x50(%rbx),%rdx
mov    $0xa,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x58(%rbx),%rdx
mov    $0xb,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x60(%rbx),%rdx
mov    $0xc,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x68(%rbx),%rdx
mov    $0xd,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x70(%rbx),%rdx
mov    $0xe,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x78(%rbx),%rdx
mov    $0xf,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x80(%rbx),%rdx
mov    $0x10,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x88(%rbx),%rdx
mov    $0x11,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x90(%rbx),%rdx
mov    $0x12,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x98(%rbx),%rdx
mov    $0x13,%esi
mov    %r14,%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str.1 = [8 x i8] c"%d: %d\0A\00"
@str = [10 x i8] c"Ok so far\00"
define void @main() {
%1 = tail call i64* @malloc(i32 160)
%2 = getelementptr inbounds i64, i64* %1, i64 1
%3 = bitcast i64* %1 to <2 x i64>*
store <2 x i64> <i64 0, i64 3>, <2 x i64>* %3
%4 = getelementptr inbounds i64, i64* %1, i64 2
%5 = getelementptr inbounds i64, i64* %1, i64 3
%6 = bitcast i64* %4 to <2 x i64>*
store <2 x i64> <i64 6, i64 9>, <2 x i64>* %6
%7 = getelementptr inbounds i64, i64* %1, i64 4
%8 = getelementptr inbounds i64, i64* %1, i64 5
%9 = bitcast i64* %7 to <2 x i64>*
store <2 x i64> <i64 12, i64 15>, <2 x i64>* %9
%10 = getelementptr inbounds i64, i64* %1, i64 6
%11 = getelementptr inbounds i64, i64* %1, i64 7
%12 = bitcast i64* %10 to <2 x i64>*
store <2 x i64> <i64 18, i64 21>, <2 x i64>* %12
%13 = getelementptr inbounds i64, i64* %1, i64 8
%14 = getelementptr inbounds i64, i64* %1, i64 9
%15 = bitcast i64* %13 to <2 x i64>*
store <2 x i64> <i64 24, i64 27>, <2 x i64>* %15
%16 = getelementptr inbounds i64, i64* %1, i64 10
%17 = getelementptr inbounds i64, i64* %1, i64 11
%18 = bitcast i64* %16 to <2 x i64>*
store <2 x i64> <i64 30, i64 33>, <2 x i64>* %18
%19 = getelementptr inbounds i64, i64* %1, i64 12
%20 = getelementptr inbounds i64, i64* %1, i64 13
%21 = bitcast i64* %19 to <2 x i64>*
store <2 x i64> <i64 36, i64 39>, <2 x i64>* %21
%22 = getelementptr inbounds i64, i64* %1, i64 14
%23 = getelementptr inbounds i64, i64* %1, i64 15
%24 = bitcast i64* %22 to <2 x i64>*
store <2 x i64> <i64 42, i64 45>, <2 x i64>* %24
%25 = getelementptr inbounds i64, i64* %1, i64 16
%26 = getelementptr inbounds i64, i64* %1, i64 17
%27 = bitcast i64* %25 to <2 x i64>*
store <2 x i64> <i64 48, i64 51>, <2 x i64>* %27
%28 = getelementptr inbounds i64, i64* %1, i64 18
%29 = getelementptr inbounds i64, i64* %1, i64 19
%30 = bitcast i64* %28 to <2 x i64>*
store <2 x i64> <i64 54, i64 57>, <2 x i64>* %30
%31 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%32 = load i64, i64* %1
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i64 0, i64 %32)
%34 = load i64, i64* %2
%35 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i64 1, i64 %34)
%36 = load i64, i64* %4
%37 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i64 2, i64 %36)
%38 = load i64, i64* %5
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i64 3, i64 %38)
%40 = load i64, i64* %7
%41 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i64 4, i64 %40)
%42 = load i64, i64* %8
%43 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i64 5, i64 %42)
%44 = load i64, i64* %10
%45 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i64 6, i64 %44)
%46 = load i64, i64* %11
%47 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i64 7, i64 %46)
%48 = load i64, i64* %13
%49 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i64 8, i64 %48)
%50 = load i64, i64* %14
%51 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i64 9, i64 %50)
%52 = load i64, i64* %16
%53 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i64 10, i64 %52)
%54 = load i64, i64* %17
%55 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i64 11, i64 %54)
%56 = load i64, i64* %19
%57 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i64 12, i64 %56)
%58 = load i64, i64* %20
%59 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i64 13, i64 %58)
%60 = load i64, i64* %22
%61 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i64 14, i64 %60)
%62 = load i64, i64* %23
%63 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i64 15, i64 %62)
%64 = load i64, i64* %25
%65 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i64 16, i64 %64)
%66 = load i64, i64* %26
%67 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i64 17, i64 %66)
%68 = load i64, i64* %28
%69 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i64 18, i64 %68)
%70 = load i64, i64* %29
%71 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i64 19, i64 %70)
ret void
}