#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 */
int *corpFlightBookings(int **, int, int *, int, int *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int **in;
  int *tmp = (int *)malloc(sizeof(int) * 3);
  tmp[0] = 1;
  tmp[1] = 2;
  tmp[2] = 10;
  in[0] = tmp;
  tmp = (int *)malloc(sizeof(int) * 3);
  tmp[0] = 2;
  tmp[1] = 3;
  tmp[2] = 20;
  in[1] = tmp;
  tmp = (int *)malloc(sizeof(int) * 3);
  tmp[0] = 2;
  tmp[1] = 5;
  tmp[2] = 25;
  in[2] = tmp;
  int retsize = 0;
  int col = 3;
  int *a = corpFlightBookings(in, 3, &col, 5, &retsize);
  for (int i = 0; i < retsize; i++)
    printf("%d ", a[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xc,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x2,0x4(%rax)
mov    -0x18(%rbp),%rax
movl   $0xa,0x8(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    $0xc,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x2,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x3,0x4(%rax)
mov    -0x18(%rbp),%rax
movl   $0x14,0x8(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    $0xc,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x2,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x5,0x4(%rax)
mov    -0x18(%rbp),%rax
movl   $0x19,0x8(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,0x10(%rax)
movl   $0x0,-0x1c(%rbp)
movl   $0x3,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x3,%esi
lea    -0x20(%rbp),%rdx
mov    $0x5,%ecx
lea    -0x1c(%rbp),%r8
call   1050 <corpFlightBookings@plt>
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1251 <main+0x121>
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xdc2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1220 <main+0xf0>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xc,%edi
call   1030 <malloc@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32**
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
store i32 0, i32* %1
%8 = call i64 @malloc(i32 12)
%9 = inttoptr i64 %8 to i32*
store i32* %9, i32** %3
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i64 0
store i32 1, i32* %11
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 1
store i32 2, i32* %13
%14 = load i32*, i32** %3
%15 = getelementptr inbounds i32, i32* %14, i64 2
store i32 10, i32* %15
%16 = load i32*, i32** %3
%17 = load i32**, i32*** %2
%18 = getelementptr inbounds i32*, i32** %17, i64 0
store i32* %16, i32** %18
%19 = call i64 @malloc(i32 12)
%20 = inttoptr i64 %19 to i32*
store i32* %20, i32** %3
%21 = load i32*, i32** %3
%22 = getelementptr inbounds i32, i32* %21, i64 0
store i32 2, i32* %22
%23 = load i32*, i32** %3
%24 = getelementptr inbounds i32, i32* %23, i64 1
store i32 3, i32* %24
%25 = load i32*, i32** %3
%26 = getelementptr inbounds i32, i32* %25, i64 2
store i32 20, i32* %26
%27 = load i32*, i32** %3
%28 = load i32**, i32*** %2
%29 = getelementptr inbounds i32*, i32** %28, i64 1
store i32* %27, i32** %29
%30 = call i64 @malloc(i32 12)
%31 = inttoptr i64 %30 to i32*
store i32* %31, i32** %3
%32 = load i32*, i32** %3
%33 = getelementptr inbounds i32, i32* %32, i64 0
store i32 2, i32* %33
%34 = load i32*, i32** %3
%35 = getelementptr inbounds i32, i32* %34, i64 1
store i32 5, i32* %35
%36 = load i32*, i32** %3
%37 = getelementptr inbounds i32, i32* %36, i64 2
store i32 25, i32* %37
%38 = load i32*, i32** %3
%39 = load i32**, i32*** %2
%40 = getelementptr inbounds i32*, i32** %39, i64 2
store i32* %38, i32** %40
store i32 0, i32* %4
store i32 3, i32* %5
%41 = load i32**, i32*** %2
%42 = call i32* @corpFlightBookings(i32** %41, i32 3, i32* %5, i32 5, i32* %4)
store i32* %42, i32** %6
store i32 0, i32* %7
br label %43
43: ; preds = %54, %0
%44 = load i32, i32* %7
%45 = load i32, i32* %4
%46 = icmp slt i32 %44, %45
br i1 %46, label %47, label %57
47: ; preds = %43
%48 = load i32*, i32** %6
%49 = load i32, i32* %7
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds i32, i32* %48, i64 %50
%52 = load i32, i32* %51
%53 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %52)
br label %54
54: ; preds = %47
%55 = load i32, i32* %7
%56 = add nsw i32 %55, 1
store i32 %56, i32* %7
br label %43
57: ; preds = %43
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @malloc(i32 12)
unreachable
}