#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);
void initialize_list(double **listval, int *listprop) {
  int i;
  listprop[0] = 0;
  listprop[1] = 1;
  listprop[2] = 2;
  listval[0] = (double *)malloc(2 * sizeof(double));
  for (i = 0; i < 2; i++) {
    listval[0][i] = 2.345e50;
  }
}


x86 assembly (clang, -O0):
<initialize_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x1,0x4(%rax)
mov    -0x10(%rbp),%rax
movl   $0x2,0x8(%rax)
mov    $0x10,%edi
call   1030 <malloc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x14(%rbp)
cmpl   $0x2,-0x14(%rbp)
jge    118b <initialize_list+0x7b>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movslq -0x14(%rbp),%rcx
movsd  0xe88(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    115b <initialize_list+0x4b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialize_list>:
push   %rbx
mov    %rdi,%rbx
movabs $0x100000000,%rax
mov    %rax,(%rsi)
movl   $0x2,0x8(%rsi)
mov    $0x10,%edi
call   1030 <malloc@plt>
mov    %rax,(%rbx)
movaps 0xec4(%rip),%xmm0
movups %xmm0,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define void @initialize_list(double** %0, i32* %1) {
%3 = alloca double**
%4 = alloca i32*
%5 = alloca i32
store double** %0, double*** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %4
%7 = getelementptr inbounds i32, i32* %6, i64 0
store i32 0, i32* %7
%8 = load i32*, i32** %4
%9 = getelementptr inbounds i32, i32* %8, i64 1
store i32 1, i32* %9
%10 = load i32*, i32** %4
%11 = getelementptr inbounds i32, i32* %10, i64 2
store i32 2, i32* %11
%12 = call i64 @malloc(i32 16)
%13 = inttoptr i64 %12 to double*
%14 = load double**, double*** %3
%15 = getelementptr inbounds double*, double** %14, i64 0
store double* %13, double** %15
store i32 0, i32* %5
br label %16
16: ; preds = %26, %2
%17 = load i32, i32* %5
%18 = icmp slt i32 %17, 2
br i1 %18, label %19, label %29
19: ; preds = %16
%20 = load double**, double*** %3
%21 = getelementptr inbounds double*, double** %20, i64 0
%22 = load double*, double** %21
%23 = load i32, i32* %5
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds double, double* %22, i64 %24
store double 2.345000e+50, double* %25
br label %26
26: ; preds = %19
%27 = load i32, i32* %5
%28 = add nsw i32 %27, 1
store i32 %28, i32* %5
br label %16
29: ; preds = %16
ret void
}

LLVM IR (-O2):
define void @initialize_list(double** nocapture %0, i32* nocapture writeonly %1) {
store i32 0, i32* %1
%3 = getelementptr inbounds i32, i32* %1, i64 1
store i32 1, i32* %3
%4 = getelementptr inbounds i32, i32* %1, i64 2
store i32 2, i32* %4
%5 = tail call i64 @malloc(i32 16)
%6 = inttoptr i64 %5 to double*
store double* %6, double** %0
%7 = inttoptr i64 %5 to <2 x double>*
store <2 x double> <double 2.345000e+50, double 2.345000e+50>, <2 x double>* %7
ret void
}