#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 */
double **getData(char *, int, int);
void readInData(double ***trainingData, double ***testData) {
  char trainingDataPath[100] = "../../input/train.csv";
  char testDataPath[100] = "../../input/test.csv";
  int trainingPicNum = 42000;
  int testPicNum = 28000;
  (*trainingData) = getData(trainingDataPath, trainingPicNum, 785);
  (*testData) = getData(testDataPath, testPicNum, 784);
}


x86 assembly (clang, -O0):
<readInData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x80(%rbp),%rdi
lea    0xec2(%rip),%rsi
mov    $0x64,%edx
call   1040 <memcpy@plt>
lea    -0xf0(%rbp),%rdi
lea    0xf1a(%rip),%rsi
mov    $0x64,%edx
call   1040 <memcpy@plt>
movl   $0xa410,-0xf4(%rbp)
movl   $0x6d60,-0xf8(%rbp)
lea    -0x80(%rbp),%rdi
mov    -0xf4(%rbp),%esi
mov    $0x311,%edx
call   1030 <getData@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
lea    -0xf0(%rbp),%rdi
mov    -0xf8(%rbp),%esi
mov    $0x310,%edx
call   1030 <getData@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readInData>:
push   %r14
push   %rbx
sub    $0xd8,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movaps 0xf29(%rip),%xmm0
movaps %xmm0,0xc0(%rsp)
movaps 0xf0a(%rip),%xmm0
movaps %xmm0,0xb0(%rsp)
movaps 0xeeb(%rip),%xmm0
movaps %xmm0,0xa0(%rsp)
movaps 0xecc(%rip),%xmm0
movaps %xmm0,0x90(%rsp)
movaps 0xead(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps 0xe8e(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movl   $0x0,0xd0(%rsp)
movaps 0xf37(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xf1b(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xeff(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xee3(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xec7(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeab(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x0,0x60(%rsp)
lea    0x70(%rsp),%rdi
mov    $0xa410,%esi
mov    $0x311,%edx
call   1030 <getData@plt>
mov    %rax,(%rbx)
mov    %rsp,%rdi
mov    $0x6d60,%esi
mov    $0x310,%edx
call   1030 <getData@plt>
mov    %rax,(%r14)
add    $0xd8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.readInData.trainingDataPath = [100 x i8] c"../../input/train.csv\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.readInData.testDataPath = [100 x i8] c"../../input/test.csv\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
define void @readInData(double*** %0, double*** %1) {
%3 = alloca double***
%4 = alloca double***
%5 = alloca [100 x i8]
%6 = alloca [100 x i8]
%7 = alloca i32
%8 = alloca i32
store double*** %0, double**** %3
store double*** %1, double**** %4
%9 = bitcast [100 x i8]* %5 to i8*
%10 = bitcast [100 x i8]* %6 to i8*
store i32 42000, i32* %7
store i32 28000, i32* %8
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%12 = load i32, i32* %7
%13 = call double** @getData(i8* %11, i32 %12, i32 785)
%14 = load double***, double**** %3
store double** %13, double*** %14
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%16 = load i32, i32* %8
%17 = call double** @getData(i8* %15, i32 %16, i32 784)
%18 = load double***, double**** %4
store double** %17, double*** %18
ret void
}

LLVM IR (-O2):
@__const.readInData.trainingDataPath = [100 x i8] c"../../input/train.csv\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.readInData.testDataPath = [100 x i8] c"../../input/test.csv\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
define void @readInData(double*** nocapture writeonly %0, double*** nocapture writeonly %1) {
%3 = alloca [100 x i8]
%4 = alloca [100 x i8]
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%7 = call double** @getData(i8* %5, i32 42000, i32 785)
store double** %7, double*** %0
%8 = call double** @getData(i8* %6, i32 28000, i32 784)
store double** %8, double*** %1
ret void
}