int main01(void) {
  int *getp = geta2();
  *getp = 100;
  int array[10] = {0};
  int *p = (int *)malloc(sizeof(int) * 10000000);
  memset(p, 0, sizeof(int) * 10);
  int i;
  for (i = 0; i < 10; i++) {
    p[i] = i;
  }
  print_array(p, 10);
  char *p1 = malloc(sizeof(char) * 10);
  free(p);
  free(p1);
  printf("Hello World!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main01>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    $0x0,%al
call   1080 <geta2@plt>
cltq
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x64,(%rax)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1060 <memset@plt>
mov    $0x2625a00,%edi
call   1070 <malloc@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1060 <memset@plt>
movl   $0x0,-0x3c(%rbp)
cmpl   $0xa,-0x3c(%rbp)
jge    11da <main01+0x7a>
mov    -0x3c(%rbp),%edx
mov    -0x38(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    11b4 <main01+0x54>
mov    -0x38(%rbp),%rdi
mov    $0xa,%esi
mov    $0x0,%al
call   1040 <print_array@plt>
mov    $0xa,%edi
call   1070 <malloc@plt>
mov    %rax,-0x48(%rbp)
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
lea    0xdef(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main01>:
push   %rbx
xor    %eax,%eax
call   1070 <geta2@plt>
cltq
movl   $0x64,(%rax)
mov    $0x2625a00,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
movaps 0xe8c(%rip),%xmm0
movups %xmm0,(%rax)
movaps 0xe92(%rip),%xmm0
movups %xmm0,0x10(%rax)
movabs $0x900000008,%rax
mov    %rax,0x20(%rbx)
mov    %rbx,%rdi
mov    $0xa,%esi
xor    %eax,%eax
call   1050 <print_array@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
lea    0xe72(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World!\0A\00"
define i32 @main01() {
%1 = alloca i32*
%2 = alloca [10 x i32]
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i8*
%6 = call i32 (...) @geta2()
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
store i32* %8, i32** %1
%9 = load i32*, i32** %1
store i32 100, i32* %9
%10 = bitcast [10 x i32]* %2 to i8*
%11 = call i8* @malloc(i64 40000000)
%12 = bitcast i8* %11 to i32*
store i32* %12, i32** %3
%13 = load i32*, i32** %3
%14 = bitcast i32* %13 to i8*
store i32 0, i32* %4
br label %15
15: ; preds = %24, %0
%16 = load i32, i32* %4
%17 = icmp slt i32 %16, 10
br i1 %17, label %18, label %27
18: ; preds = %15
%19 = load i32, i32* %4
%20 = load i32*, i32** %3
%21 = load i32, i32* %4
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i32, i32* %20, i64 %22
store i32 %19, i32* %23
br label %24
24: ; preds = %18
%25 = load i32, i32* %4
%26 = add nsw i32 %25, 1
store i32 %26, i32* %4
br label %15
27: ; preds = %15
%28 = load i32*, i32** %3
%29 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @print_array to i32 (i32*, i32, ...)*)(i32* %28, i32 10)
%30 = call i8* @malloc(i64 10)
store i8* %30, i8** %5
%31 = load i32*, i32** %3
%32 = bitcast i32* %31 to i8*
%33 = load i8*, i8** %5
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello World!\00"
define i32 @main01() {
%1 = tail call i32 (...) @geta2()
%2 = sext i32 %1 to i64
%3 = inttoptr i64 %2 to i32*
store i32 100, i32* %3
%4 = tail call dereferenceable_or_null(40000000) i8* @malloc(i64 40000000)
%5 = bitcast i8* %4 to i32*
%6 = bitcast i8* %4 to <4 x i32>*
store <4 x i32> <i32 0, i32 1, i32 2, i32 3>, <4 x i32>* %6
%7 = getelementptr inbounds i32, i32* %5, i64 4
%8 = bitcast i32* %7 to <4 x i32>*
store <4 x i32> <i32 4, i32 5, i32 6, i32 7>, <4 x i32>* %8
%9 = getelementptr inbounds i32, i32* %5, i64 8
store i32 8, i32* %9
%10 = getelementptr inbounds i32, i32* %5, i64 9
store i32 9, i32* %10
%11 = tail call i32 (i32*, i32, ...) bitcast (i32 (...)* @print_array to i32 (i32*, i32, ...)*)(i32* %5, i32 10)
tail call void @free(i8* %4)
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}