#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 node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ empty(struct node **);
int pop(struct node **);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ push(struct node **, int);
int /*<<< orphan*/ test();
int main(int argc, char **argv) {
  struct node *stack = NULL;
  test();
  push(&stack, 1);
  push(&stack, 2);
  push(&stack, 3);
  push(&stack, 4);
  printf("%d\n", pop(&stack));
  printf("%d\n", pop(&stack));
  empty(&stack);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    $0x0,%al
call   1070 <test@plt>
lea    -0x18(%rbp),%rdi
mov    $0x1,%esi
call   1060 <push@plt>
lea    -0x18(%rbp),%rdi
mov    $0x2,%esi
call   1060 <push@plt>
lea    -0x18(%rbp),%rdi
mov    $0x3,%esi
call   1060 <push@plt>
lea    -0x18(%rbp),%rdi
mov    $0x4,%esi
call   1060 <push@plt>
lea    -0x18(%rbp),%rdi
call   1040 <pop@plt>
mov    %eax,%esi
lea    0xe41(%rip),%rdi
call   1030 <printf@plt>
lea    -0x18(%rbp),%rdi
call   1040 <pop@plt>
mov    %eax,%esi
lea    0xe2a(%rip),%rdi
call   1030 <printf@plt>
lea    -0x18(%rbp),%rdi
call   1050 <empty@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movq   $0x0,(%rsp)
xor    %eax,%eax
call   1070 <test@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
call   1060 <push@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1060 <push@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1060 <push@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1060 <push@plt>
mov    %rbx,%rdi
call   1040 <pop@plt>
lea    0xe57(%rip),%r14
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <pop@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1050 <empty@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.node = type { i32 }
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.node*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store %struct.node* null, %struct.node** %6
%7 = call i32 (...) @test()
%8 = call i32 @push(%struct.node** %6, i32 1)
%9 = call i32 @push(%struct.node** %6, i32 2)
%10 = call i32 @push(%struct.node** %6, i32 3)
%11 = call i32 @push(%struct.node** %6, i32 4)
%12 = call i32 @pop(%struct.node** %6)
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = call i32 @pop(%struct.node** %6)
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = call i32 @empty(%struct.node** %6)
ret i32 0
}

LLVM IR (-O2):
%struct.node = type { i32 }
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca %struct.node*
%4 = bitcast %struct.node** %3 to i8*
store %struct.node* null, %struct.node** %3
%5 = tail call i32 (...) @test()
%6 = call i32 @push(%struct.node** %3, i32 1)
%7 = call i32 @push(%struct.node** %3, i32 2)
%8 = call i32 @push(%struct.node** %3, i32 3)
%9 = call i32 @push(%struct.node** %3, i32 4)
%10 = call i32 @pop(%struct.node** %3)
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = call i32 @pop(%struct.node** %3)
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = call i32 @empty(%struct.node** %3)
ret i32 0
}