#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 */
struct Stack {
  int dummy;
};

/* Variables and functions */
struct Stack *createStack();
int /*<<< orphan*/ destroyStack(struct Stack **);
int /*<<< orphan*/ empty(struct Stack *);
int /*<<< orphan*/ pop(struct Stack *);
int /*<<< orphan*/ print(struct Stack *);
int /*<<< orphan*/ push(struct Stack *, int);
int main() {
  struct Stack *stack = NULL;
  pop(stack);
  stack = createStack();
  pop(stack);
  push(stack, 1);
  push(stack, 2);
  push(stack, 3);
  print(stack);
  pop(stack);
  print(stack);
  pop(stack);
  print(stack);
  pop(stack);
  print(stack);
  push(stack, 4);
  push(stack, 5);
  push(stack, 6);
  empty(stack);
  print(stack);
  empty(stack);
  push(stack, 7);
  push(stack, 8);
  push(stack, 9);
  empty(stack);
  destroyStack(&stack);
  print(stack);
  push(stack, 10);
  pop(stack);
  empty(stack);
  destroyStack(&stack);
  stack = createStack();
  push(stack, 1);
  push(stack, 2);
  push(stack, 3);
  print(stack);
  pop(stack);
  print(stack);
  pop(stack);
  print(stack);
  pop(stack);
  pop(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
call   1040 <pop@plt>
mov    $0x0,%al
call   1060 <createStack@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <pop@plt>
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1070 <push@plt>
mov    -0x10(%rbp),%rdi
mov    $0x2,%esi
call   1070 <push@plt>
mov    -0x10(%rbp),%rdi
mov    $0x3,%esi
call   1070 <push@plt>
mov    -0x10(%rbp),%rdi
call   1030 <print@plt>
mov    -0x10(%rbp),%rdi
call   1040 <pop@plt>
mov    -0x10(%rbp),%rdi
call   1030 <print@plt>
mov    -0x10(%rbp),%rdi
call   1040 <pop@plt>
mov    -0x10(%rbp),%rdi
call   1030 <print@plt>
mov    -0x10(%rbp),%rdi
call   1040 <pop@plt>
mov    -0x10(%rbp),%rdi
call   1030 <print@plt>
mov    -0x10(%rbp),%rdi
mov    $0x4,%esi
call   1070 <push@plt>
mov    -0x10(%rbp),%rdi
mov    $0x5,%esi
call   1070 <push@plt>
mov    -0x10(%rbp),%rdi
mov    $0x6,%esi
call   1070 <push@plt>
mov    -0x10(%rbp),%rdi
call   1050 <empty@plt>
mov    -0x10(%rbp),%rdi
call   1030 <print@plt>
mov    -0x10(%rbp),%rdi
call   1050 <empty@plt>
mov    -0x10(%rbp),%rdi
mov    $0x7,%esi
call   1070 <push@plt>
mov    -0x10(%rbp),%rdi
mov    $0x8,%esi
call   1070 <push@plt>
mov    -0x10(%rbp),%rdi
mov    $0x9,%esi
call   1070 <push@plt>
mov    -0x10(%rbp),%rdi
call   1050 <empty@plt>
lea    -0x10(%rbp),%rdi
call   1080 <destroyStack@plt>
mov    -0x10(%rbp),%rdi
call   1030 <print@plt>
mov    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1070 <push@plt>
mov    -0x10(%rbp),%rdi
call   1040 <pop@plt>
mov    -0x10(%rbp),%rdi
call   1050 <empty@plt>
lea    -0x10(%rbp),%rdi
call   1080 <destroyStack@plt>
mov    $0x0,%al
call   1060 <createStack@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1070 <push@plt>
mov    -0x10(%rbp),%rdi
mov    $0x2,%esi
call   1070 <push@plt>
mov    -0x10(%rbp),%rdi
mov    $0x3,%esi
call   1070 <push@plt>
mov    -0x10(%rbp),%rdi
call   1030 <print@plt>
mov    -0x10(%rbp),%rdi
call   1040 <pop@plt>
mov    -0x10(%rbp),%rdi
call   1030 <print@plt>
mov    -0x10(%rbp),%rdi
call   1040 <pop@plt>
mov    -0x10(%rbp),%rdi
call   1030 <print@plt>
mov    -0x10(%rbp),%rdi
call   1040 <pop@plt>
mov    -0x10(%rbp),%rdi
call   1040 <pop@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
xor    %edi,%edi
call   1040 <pop@plt>
xor    %eax,%eax
call   1060 <createStack@plt>
mov    %rax,%rbx
mov    %rax,0x8(%rsp)
mov    %rax,%rdi
call   1040 <pop@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1070 <push@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1070 <push@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1070 <push@plt>
mov    %rbx,%rdi
call   1030 <print@plt>
mov    %rbx,%rdi
call   1040 <pop@plt>
mov    %rbx,%rdi
call   1030 <print@plt>
mov    %rbx,%rdi
call   1040 <pop@plt>
mov    %rbx,%rdi
call   1030 <print@plt>
mov    %rbx,%rdi
call   1040 <pop@plt>
mov    %rbx,%rdi
call   1030 <print@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1070 <push@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1070 <push@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1070 <push@plt>
mov    %rbx,%rdi
call   1050 <empty@plt>
mov    %rbx,%rdi
call   1030 <print@plt>
mov    %rbx,%rdi
call   1050 <empty@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1070 <push@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1070 <push@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
call   1070 <push@plt>
mov    %rbx,%rdi
call   1050 <empty@plt>
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1080 <destroyStack@plt>
mov    0x8(%rsp),%rdi
call   1030 <print@plt>
mov    0x8(%rsp),%rdi
mov    $0xa,%esi
call   1070 <push@plt>
mov    0x8(%rsp),%rdi
call   1040 <pop@plt>
mov    0x8(%rsp),%rdi
call   1050 <empty@plt>
mov    %rbx,%rdi
call   1080 <destroyStack@plt>
xor    %eax,%eax
call   1060 <createStack@plt>
mov    %rax,0x8(%rsp)
mov    %rax,%rdi
mov    $0x1,%esi
call   1070 <push@plt>
mov    0x8(%rsp),%rdi
mov    $0x2,%esi
call   1070 <push@plt>
mov    0x8(%rsp),%rdi
mov    $0x3,%esi
call   1070 <push@plt>
mov    0x8(%rsp),%rdi
call   1030 <print@plt>
mov    0x8(%rsp),%rdi
call   1040 <pop@plt>
mov    0x8(%rsp),%rdi
call   1030 <print@plt>
mov    0x8(%rsp),%rdi
call   1040 <pop@plt>
mov    0x8(%rsp),%rdi
call   1030 <print@plt>
mov    0x8(%rsp),%rdi
call   1040 <pop@plt>
mov    0x8(%rsp),%rdi
call   1040 <pop@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.Stack = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.Stack*
store i32 0, i32* %1
store %struct.Stack* null, %struct.Stack** %2
%3 = load %struct.Stack*, %struct.Stack** %2
%4 = call i32 @pop(%struct.Stack* %3)
%5 = call %struct.Stack* (...) @createStack()
store %struct.Stack* %5, %struct.Stack** %2
%6 = load %struct.Stack*, %struct.Stack** %2
%7 = call i32 @pop(%struct.Stack* %6)
%8 = load %struct.Stack*, %struct.Stack** %2
%9 = call i32 @push(%struct.Stack* %8, i32 1)
%10 = load %struct.Stack*, %struct.Stack** %2
%11 = call i32 @push(%struct.Stack* %10, i32 2)
%12 = load %struct.Stack*, %struct.Stack** %2
%13 = call i32 @push(%struct.Stack* %12, i32 3)
%14 = load %struct.Stack*, %struct.Stack** %2
%15 = call i32 @print(%struct.Stack* %14)
%16 = load %struct.Stack*, %struct.Stack** %2
%17 = call i32 @pop(%struct.Stack* %16)
%18 = load %struct.Stack*, %struct.Stack** %2
%19 = call i32 @print(%struct.Stack* %18)
%20 = load %struct.Stack*, %struct.Stack** %2
%21 = call i32 @pop(%struct.Stack* %20)
%22 = load %struct.Stack*, %struct.Stack** %2
%23 = call i32 @print(%struct.Stack* %22)
%24 = load %struct.Stack*, %struct.Stack** %2
%25 = call i32 @pop(%struct.Stack* %24)
%26 = load %struct.Stack*, %struct.Stack** %2
%27 = call i32 @print(%struct.Stack* %26)
%28 = load %struct.Stack*, %struct.Stack** %2
%29 = call i32 @push(%struct.Stack* %28, i32 4)
%30 = load %struct.Stack*, %struct.Stack** %2
%31 = call i32 @push(%struct.Stack* %30, i32 5)
%32 = load %struct.Stack*, %struct.Stack** %2
%33 = call i32 @push(%struct.Stack* %32, i32 6)
%34 = load %struct.Stack*, %struct.Stack** %2
%35 = call i32 @empty(%struct.Stack* %34)
%36 = load %struct.Stack*, %struct.Stack** %2
%37 = call i32 @print(%struct.Stack* %36)
%38 = load %struct.Stack*, %struct.Stack** %2
%39 = call i32 @empty(%struct.Stack* %38)
%40 = load %struct.Stack*, %struct.Stack** %2
%41 = call i32 @push(%struct.Stack* %40, i32 7)
%42 = load %struct.Stack*, %struct.Stack** %2
%43 = call i32 @push(%struct.Stack* %42, i32 8)
%44 = load %struct.Stack*, %struct.Stack** %2
%45 = call i32 @push(%struct.Stack* %44, i32 9)
%46 = load %struct.Stack*, %struct.Stack** %2
%47 = call i32 @empty(%struct.Stack* %46)
%48 = call i32 @destroyStack(%struct.Stack** %2)
%49 = load %struct.Stack*, %struct.Stack** %2
%50 = call i32 @print(%struct.Stack* %49)
%51 = load %struct.Stack*, %struct.Stack** %2
%52 = call i32 @push(%struct.Stack* %51, i32 10)
%53 = load %struct.Stack*, %struct.Stack** %2
%54 = call i32 @pop(%struct.Stack* %53)
%55 = load %struct.Stack*, %struct.Stack** %2
%56 = call i32 @empty(%struct.Stack* %55)
%57 = call i32 @destroyStack(%struct.Stack** %2)
%58 = call %struct.Stack* (...) @createStack()
store %struct.Stack* %58, %struct.Stack** %2
%59 = load %struct.Stack*, %struct.Stack** %2
%60 = call i32 @push(%struct.Stack* %59, i32 1)
%61 = load %struct.Stack*, %struct.Stack** %2
%62 = call i32 @push(%struct.Stack* %61, i32 2)
%63 = load %struct.Stack*, %struct.Stack** %2
%64 = call i32 @push(%struct.Stack* %63, i32 3)
%65 = load %struct.Stack*, %struct.Stack** %2
%66 = call i32 @print(%struct.Stack* %65)
%67 = load %struct.Stack*, %struct.Stack** %2
%68 = call i32 @pop(%struct.Stack* %67)
%69 = load %struct.Stack*, %struct.Stack** %2
%70 = call i32 @print(%struct.Stack* %69)
%71 = load %struct.Stack*, %struct.Stack** %2
%72 = call i32 @pop(%struct.Stack* %71)
%73 = load %struct.Stack*, %struct.Stack** %2
%74 = call i32 @print(%struct.Stack* %73)
%75 = load %struct.Stack*, %struct.Stack** %2
%76 = call i32 @pop(%struct.Stack* %75)
%77 = load %struct.Stack*, %struct.Stack** %2
%78 = call i32 @pop(%struct.Stack* %77)
ret i32 0
}

LLVM IR (-O2):
%struct.Stack = type { i32 }
define i32 @main() {
%1 = alloca %struct.Stack*
%2 = bitcast %struct.Stack** %1 to i8*
%3 = tail call i32 @pop(%struct.Stack* null)
%4 = tail call %struct.Stack* (...) @createStack()
store %struct.Stack* %4, %struct.Stack** %1
%5 = tail call i32 @pop(%struct.Stack* %4)
%6 = tail call i32 @push(%struct.Stack* %4, i32 1)
%7 = tail call i32 @push(%struct.Stack* %4, i32 2)
%8 = tail call i32 @push(%struct.Stack* %4, i32 3)
%9 = tail call i32 @print(%struct.Stack* %4)
%10 = tail call i32 @pop(%struct.Stack* %4)
%11 = tail call i32 @print(%struct.Stack* %4)
%12 = tail call i32 @pop(%struct.Stack* %4)
%13 = tail call i32 @print(%struct.Stack* %4)
%14 = tail call i32 @pop(%struct.Stack* %4)
%15 = tail call i32 @print(%struct.Stack* %4)
%16 = tail call i32 @push(%struct.Stack* %4, i32 4)
%17 = tail call i32 @push(%struct.Stack* %4, i32 5)
%18 = tail call i32 @push(%struct.Stack* %4, i32 6)
%19 = tail call i32 @empty(%struct.Stack* %4)
%20 = tail call i32 @print(%struct.Stack* %4)
%21 = tail call i32 @empty(%struct.Stack* %4)
%22 = tail call i32 @push(%struct.Stack* %4, i32 7)
%23 = tail call i32 @push(%struct.Stack* %4, i32 8)
%24 = tail call i32 @push(%struct.Stack* %4, i32 9)
%25 = tail call i32 @empty(%struct.Stack* %4)
%26 = call i32 @destroyStack(%struct.Stack** %1)
%27 = load %struct.Stack*, %struct.Stack** %1
%28 = call i32 @print(%struct.Stack* %27)
%29 = load %struct.Stack*, %struct.Stack** %1
%30 = call i32 @push(%struct.Stack* %29, i32 10)
%31 = load %struct.Stack*, %struct.Stack** %1
%32 = call i32 @pop(%struct.Stack* %31)
%33 = load %struct.Stack*, %struct.Stack** %1
%34 = call i32 @empty(%struct.Stack* %33)
%35 = call i32 @destroyStack(%struct.Stack** %1)
%36 = call %struct.Stack* (...) @createStack()
store %struct.Stack* %36, %struct.Stack** %1
%37 = call i32 @push(%struct.Stack* %36, i32 1)
%38 = load %struct.Stack*, %struct.Stack** %1
%39 = call i32 @push(%struct.Stack* %38, i32 2)
%40 = load %struct.Stack*, %struct.Stack** %1
%41 = call i32 @push(%struct.Stack* %40, i32 3)
%42 = load %struct.Stack*, %struct.Stack** %1
%43 = call i32 @print(%struct.Stack* %42)
%44 = load %struct.Stack*, %struct.Stack** %1
%45 = call i32 @pop(%struct.Stack* %44)
%46 = load %struct.Stack*, %struct.Stack** %1
%47 = call i32 @print(%struct.Stack* %46)
%48 = load %struct.Stack*, %struct.Stack** %1
%49 = call i32 @pop(%struct.Stack* %48)
%50 = load %struct.Stack*, %struct.Stack** %1
%51 = call i32 @print(%struct.Stack* %50)
%52 = load %struct.Stack*, %struct.Stack** %1
%53 = call i32 @pop(%struct.Stack* %52)
%54 = load %struct.Stack*, %struct.Stack** %1
%55 = call i32 @pop(%struct.Stack* %54)
ret i32 0
}