#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 /*<<< orphan*/ cleanStack(int **);
int /*<<< orphan*/ free(int **);
int /*<<< orphan*/ pop(int **);
int /*<<< orphan*/ print_stack(int **);
int /*<<< orphan*/ push(int **, int);
int main(void) {
  int **new_stack = NULL;
  push(new_stack, 10);
  push(new_stack, 20);
  push(new_stack, 30);
  push(new_stack, 40);
  push(new_stack, 50);
  push(new_stack, 60);
  print_stack(new_stack);
  pop(new_stack);
  pop(new_stack);
  cleanStack(new_stack);
  if (new_stack != NULL)
    free(new_stack);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1070 <push@plt>
mov    -0x10(%rbp),%rdi
mov    $0x14,%esi
call   1070 <push@plt>
mov    -0x10(%rbp),%rdi
mov    $0x1e,%esi
call   1070 <push@plt>
mov    -0x10(%rbp),%rdi
mov    $0x28,%esi
call   1070 <push@plt>
mov    -0x10(%rbp),%rdi
mov    $0x32,%esi
call   1070 <push@plt>
mov    -0x10(%rbp),%rdi
mov    $0x3c,%esi
call   1070 <push@plt>
mov    -0x10(%rbp),%rdi
call   1060 <print_stack@plt>
mov    -0x10(%rbp),%rdi
call   1050 <pop@plt>
mov    -0x10(%rbp),%rdi
call   1050 <pop@plt>
mov    -0x10(%rbp),%rdi
call   1040 <cleanStack@plt>
cmpq   $0x0,-0x10(%rbp)
je     11f3 <main+0xa3>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
mov    $0xa,%esi
call   1060 <push@plt>
xor    %edi,%edi
mov    $0x14,%esi
call   1060 <push@plt>
xor    %edi,%edi
mov    $0x1e,%esi
call   1060 <push@plt>
xor    %edi,%edi
mov    $0x28,%esi
call   1060 <push@plt>
xor    %edi,%edi
mov    $0x32,%esi
call   1060 <push@plt>
xor    %edi,%edi
mov    $0x3c,%esi
call   1060 <push@plt>
xor    %edi,%edi
call   1050 <print_stack@plt>
xor    %edi,%edi
call   1040 <pop@plt>
xor    %edi,%edi
call   1040 <pop@plt>
xor    %edi,%edi
call   1030 <cleanStack@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32**
store i32 0, i32* %1
store i32** null, i32*** %2
%3 = load i32**, i32*** %2
%4 = call i32 @push(i32** %3, i32 10)
%5 = load i32**, i32*** %2
%6 = call i32 @push(i32** %5, i32 20)
%7 = load i32**, i32*** %2
%8 = call i32 @push(i32** %7, i32 30)
%9 = load i32**, i32*** %2
%10 = call i32 @push(i32** %9, i32 40)
%11 = load i32**, i32*** %2
%12 = call i32 @push(i32** %11, i32 50)
%13 = load i32**, i32*** %2
%14 = call i32 @push(i32** %13, i32 60)
%15 = load i32**, i32*** %2
%16 = call i32 @print_stack(i32** %15)
%17 = load i32**, i32*** %2
%18 = call i32 @pop(i32** %17)
%19 = load i32**, i32*** %2
%20 = call i32 @pop(i32** %19)
%21 = load i32**, i32*** %2
%22 = call i32 @cleanStack(i32** %21)
%23 = load i32**, i32*** %2
%24 = icmp ne i32** %23, null
br i1 %24, label %25, label %28
25: ; preds = %0
%26 = load i32**, i32*** %2
%27 = call i32 @free(i32** %26)
br label %28
28: ; preds = %25, %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @push(i32** null, i32 10)
%2 = tail call i32 @push(i32** null, i32 20)
%3 = tail call i32 @push(i32** null, i32 30)
%4 = tail call i32 @push(i32** null, i32 40)
%5 = tail call i32 @push(i32** null, i32 50)
%6 = tail call i32 @push(i32** null, i32 60)
%7 = tail call i32 @print_stack(i32** null)
%8 = tail call i32 @pop(i32** null)
%9 = tail call i32 @pop(i32** null)
%10 = tail call i32 @cleanStack(i32** null)
ret i32 0
}