#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*/ assert_new_stack_is_empty();
int /*<<< orphan*/ assert_new_stack_will_return_no_elm_when_popped();
int /*<<< orphan*/ assert_pop_will_return_last_element_pushed();
int /*<<< orphan*/
assert_pop_will_return_last_element_pushed_with_multiple_elements();
int /*<<< orphan*/ assert_stack_is_empty_after_all_elements_are_popped();
int /*<<< orphan*/ assert_stack_is_not_empty_when_an_element_is_pushed();
int /*<<< orphan*/ printf(char *);
int main() {
  assert_new_stack_is_empty();
  assert_new_stack_will_return_no_elm_when_popped();
  assert_stack_is_not_empty_when_an_element_is_pushed();
  assert_pop_will_return_last_element_pushed();
  assert_pop_will_return_last_element_pushed_with_multiple_elements();
  assert_stack_is_empty_after_all_elements_are_popped();
  printf("Stack OK\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <assert_new_stack_is_empty@plt>
mov    $0x0,%al
call   1040 <assert_new_stack_will_return_no_elm_when_popped@plt>
mov    $0x0,%al
call   1090 <assert_stack_is_not_empty_when_an_element_is_pushed@plt>
mov    $0x0,%al
call   1070 <assert_pop_will_return_last_element_pushed@plt>
mov    $0x0,%al
call   1080 <assert_pop_will_return_last_element_pushed_with_multiple_elements@plt>
mov    $0x0,%al
call   1050 <assert_stack_is_empty_after_all_elements_are_popped@plt>
lea    0xe50(%rip),%rdi
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <assert_new_stack_is_empty@plt>
xor    %eax,%eax
call   1050 <assert_new_stack_will_return_no_elm_when_popped@plt>
xor    %eax,%eax
call   1090 <assert_stack_is_not_empty_when_an_element_is_pushed@plt>
xor    %eax,%eax
call   1070 <assert_pop_will_return_last_element_pushed@plt>
xor    %eax,%eax
call   1080 <assert_pop_will_return_last_element_pushed_with_multiple_elements@plt>
xor    %eax,%eax
call   1060 <assert_stack_is_empty_after_all_elements_are_popped@plt>
lea    0xe5e(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Stack OK\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @assert_new_stack_is_empty()
%3 = call i32 (...) @assert_new_stack_will_return_no_elm_when_popped()
%4 = call i32 (...) @assert_stack_is_not_empty_when_an_element_is_pushed()
%5 = call i32 (...) @assert_pop_will_return_last_element_pushed()
%6 = call i32 (...) @assert_pop_will_return_last_element_pushed_with_multiple_elements()
%7 = call i32 (...) @assert_stack_is_empty_after_all_elements_are_popped()
%8 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [9 x i8] c"Stack OK\00"
define i32 @main() {
%1 = tail call i32 (...) @assert_new_stack_is_empty()
%2 = tail call i32 (...) @assert_new_stack_will_return_no_elm_when_popped()
%3 = tail call i32 (...) @assert_stack_is_not_empty_when_an_element_is_pushed()
%4 = tail call i32 (...) @assert_pop_will_return_last_element_pushed()
%5 = tail call i32 (...) @assert_pop_will_return_last_element_pushed_with_multiple_elements()
%6 = tail call i32 (...) @assert_stack_is_empty_after_all_elements_are_popped()
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret i32 0
}