double **createVars(int nvars, int nts) {
  double *array = (double *)Malloc(
      __func__,
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/AZed/cdo/refs/heads/master/src/cdotest.c",
      157, (nvars * nts * sizeof(double)));
  double **vars = (double **)Malloc(
      __func__,
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/AZed/cdo/refs/heads/master/src/cdotest.c",
      158, (nvars * sizeof(double *)));
  int i;
  for (i = 0; i < nvars; ++i)
    vars[i] = &array[i * nts];
  return vars;
}


x86 assembly (clang, -O0):
<createVars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
movslq %eax,%rcx
shl    $0x3,%rcx
lea    0xecd(%rip),%rdi
lea    0xed1(%rip),%rsi
mov    $0x9d,%edx
mov    $0x0,%al
call   1030 <Malloc@plt>
cltq
mov    %rax,-0x10(%rbp)
movslq -0x4(%rbp),%rcx
shl    $0x3,%rcx
lea    0xea5(%rip),%rdi
lea    0xea9(%rip),%rsi
mov    $0x9e,%edx
mov    $0x0,%al
call   1030 <Malloc@plt>
cltq
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11b5 <createVars+0xa5>
mov    -0x10(%rbp),%rdx
mov    -0x1c(%rbp),%eax
imul   -0x8(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rdx
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    117b <createVars+0x6b>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createVars>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %esi,%r13d
mov    %edi,%ebp
mov    %esi,%eax
imul   %edi,%eax
movslq %eax,%rcx
shl    $0x3,%rcx
lea    0xecd(%rip),%r15
lea    0xed1(%rip),%r12
mov    %r15,%rdi
mov    %r12,%rsi
mov    $0x9d,%edx
xor    %eax,%eax
call   1030 <Malloc@plt>
mov    %eax,%r14d
movslq %ebp,%rbx
lea    0x0(,%rbx,8),%rcx
mov    %r15,%rdi
mov    %r12,%rsi
mov    $0x9e,%edx
xor    %eax,%eax
call   1030 <Malloc@plt>
cltq
test   %ebx,%ebx
jle    1220 <createVars+0x110>
movslq %r14d,%r8
movslq %r13d,%r9
mov    %ebp,%r11d
lea    -0x1(%r11),%rcx
mov    %r11d,%r10d
and    $0x3,%r10d
cmp    $0x3,%rcx
jae    1194 <createVars+0x84>
xor    %ebp,%ebp
jmp    11eb <createVars+0xdb>
and    $0xfffffffc,%r11d
mov    %r9,%r14
shl    $0x4,%r14
mov    %r9,%rsi
shl    $0x5,%rsi
lea    0x0(,%r9,8),%rbx
lea    (%rbx,%rbx,2),%rdx
xor    %ebp,%ebp
mov    %r8,%rdi
nopw   0x0(%rax,%rax,1)
mov    %rdi,(%rax,%rbp,8)
lea    (%rdi,%rbx,1),%rcx
mov    %rcx,0x8(%rax,%rbp,8)
lea    (%rdi,%r14,1),%rcx
mov    %rcx,0x10(%rax,%rbp,8)
lea    (%rdi,%rdx,1),%rcx
mov    %rcx,0x18(%rax,%rbp,8)
add    $0x4,%rbp
add    %rsi,%rdi
cmp    %rbp,%r11
jne    11c0 <createVars+0xb0>
test   %r10,%r10
je     1220 <createVars+0x110>
lea    (%rax,%rbp,8),%rcx
imul   %r9,%rbp
lea    (%r8,%rbp,8),%rdx
shl    $0x3,%r9
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rdx,(%rcx,%rsi,8)
add    $0x1,%rsi
add    %r9,%rdx
cmp    %rsi,%r10
jne    1210 <createVars+0x100>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__func__.createVars = [11 x i8] c"createVars\00"
@.str = [131 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AZed/cdo/refs/heads/master/src/cdotest.c\00"
define double** @createVars(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double*
%6 = alloca double**
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = mul nsw i32 %8, %9
%11 = sext i32 %10 to i64
%12 = mul i64 %11, 8
%13 = call i32 (i8*, i8*, i32, i64, ...) bitcast (i32 (...)* @Malloc to i32 (i8*, i8*, i32, i64, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__func__.createVars, i64 0, i64 0), i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str, i64 0, i64 0), i32 157, i64 %12)
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to double*
store double* %15, double** %5
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = mul i64 %17, 8
%19 = call i32 (i8*, i8*, i32, i64, ...) bitcast (i32 (...)* @Malloc to i32 (i8*, i8*, i32, i64, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__func__.createVars, i64 0, i64 0), i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str, i64 0, i64 0), i32 158, i64 %18)
%20 = sext i32 %19 to i64
%21 = inttoptr i64 %20 to double**
store double** %21, double*** %6
store i32 0, i32* %7
br label %22
22: ; preds = %37, %2
%23 = load i32, i32* %7
%24 = load i32, i32* %3
%25 = icmp slt i32 %23, %24
br i1 %25, label %26, label %40
26: ; preds = %22
%27 = load double*, double** %5
%28 = load i32, i32* %7
%29 = load i32, i32* %4
%30 = mul nsw i32 %28, %29
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds double, double* %27, i64 %31
%33 = load double**, double*** %6
%34 = load i32, i32* %7
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds double*, double** %33, i64 %35
store double* %32, double** %36
br label %37
37: ; preds = %26
%38 = load i32, i32* %7
%39 = add nsw i32 %38, 1
store i32 %39, i32* %7
br label %22
40: ; preds = %22
%41 = load double**, double*** %6
ret double** %41
}

LLVM IR (-O2):
@__func__.createVars = [11 x i8] c"createVars\00"
@.str = [131 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AZed/cdo/refs/heads/master/src/cdotest.c\00"
define double** @createVars(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = sext i32 %3 to i64
%5 = shl nsw i64 %4, 3
%6 = tail call i32 (i8*, i8*, i32, i64, ...) bitcast (i32 (...)* @Malloc to i32 (i8*, i8*, i32, i64, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__func__.createVars, i64 0, i64 0), i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str, i64 0, i64 0), i32 157, i64 %5)
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to double*
%9 = sext i32 %0 to i64
%10 = shl nsw i64 %9, 3
%11 = tail call i32 (i8*, i8*, i32, i64, ...) bitcast (i32 (...)* @Malloc to i32 (i8*, i8*, i32, i64, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__func__.createVars, i64 0, i64 0), i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str, i64 0, i64 0), i32 158, i64 %10)
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to double**
%14 = icmp sgt i32 %0, 0
br i1 %14, label %15, label %56
15: ; preds = %2
%16 = sext i32 %1 to i64
%17 = zext i32 %0 to i64
%18 = add nsw i64 %17, -1
%19 = and i64 %17, 3
%20 = icmp ult i64 %18, 3
br i1 %20, label %44, label %21
21: ; preds = %15
%22 = and i64 %17, 4294967292
br label %23
23: ; preds = %23, %21
%24 = phi i64 [ 0, %21 ], [ %41, %23 ]
%25 = phi i64 [ 0, %21 ], [ %42, %23 ]
%26 = mul nsw i64 %24, %16
%27 = getelementptr inbounds double, double* %8, i64 %26
%28 = getelementptr inbounds double*, double** %13, i64 %24
store double* %27, double** %28
%29 = or i64 %24, 1
%30 = mul nsw i64 %29, %16
%31 = getelementptr inbounds double, double* %8, i64 %30
%32 = getelementptr inbounds double*, double** %13, i64 %29
store double* %31, double** %32
%33 = or i64 %24, 2
%34 = mul nsw i64 %33, %16
%35 = getelementptr inbounds double, double* %8, i64 %34
%36 = getelementptr inbounds double*, double** %13, i64 %33
store double* %35, double** %36
%37 = or i64 %24, 3
%38 = mul nsw i64 %37, %16
%39 = getelementptr inbounds double, double* %8, i64 %38
%40 = getelementptr inbounds double*, double** %13, i64 %37
store double* %39, double** %40
%41 = add nuw nsw i64 %24, 4
%42 = add i64 %25, 4
%43 = icmp eq i64 %42, %22
br i1 %43, label %44, label %23
44: ; preds = %23, %15
%45 = phi i64 [ 0, %15 ], [ %41, %23 ]
%46 = icmp eq i64 %19, 0
br i1 %46, label %56, label %47
47: ; preds = %44, %47
%48 = phi i64 [ %53, %47 ], [ %45, %44 ]
%49 = phi i64 [ %54, %47 ], [ 0, %44 ]
%50 = mul nsw i64 %48, %16
%51 = getelementptr inbounds double, double* %8, i64 %50
%52 = getelementptr inbounds double*, double** %13, i64 %48
store double* %51, double** %52
%53 = add nuw nsw i64 %48, 1
%54 = add i64 %49, 1
%55 = icmp eq i64 %54, %19
br i1 %55, label %56, label %47
56: ; preds = %44, %47, %2
ret double** %13
}