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

/* Variables and functions */
int /*<<< orphan*/ assert(int);
struct list *create_list();
int /*<<< orphan*/ list_dispose(struct list *);
int list_pop(struct list *);
int /*<<< orphan*/ list_push(struct list *, int);
int main() {
  struct list *s = create_list();
  list_push(s, 10);
  list_push(s, 20);
  int x = list_pop(s);
  assert(x == 20);
  int y = list_pop(s);
  assert(y == 10);
  list_dispose(s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <create_list@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1070 <list_push@plt>
mov    -0x10(%rbp),%rdi
mov    $0x14,%esi
call   1070 <list_push@plt>
mov    -0x10(%rbp),%rdi
call   1040 <list_pop@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x14,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x10(%rbp),%rdi
call   1040 <list_pop@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0xa,-0x18(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x10(%rbp),%rdi
call   1030 <list_dispose@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <create_list@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0xa,%esi
call   1070 <list_push@plt>
mov    %rbx,%rdi
mov    $0x14,%esi
call   1070 <list_push@plt>
mov    %rbx,%rdi
call   1040 <list_pop@plt>
xor    %edi,%edi
cmp    $0x14,%eax
sete   %dil
call   1060 <assert@plt>
mov    %rbx,%rdi
call   1040 <list_pop@plt>
xor    %edi,%edi
cmp    $0xa,%eax
sete   %dil
call   1060 <assert@plt>
mov    %rbx,%rdi
call   1030 <list_dispose@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.list = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.list*
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call %struct.list* (...) @create_list()
store %struct.list* %5, %struct.list** %2
%6 = load %struct.list*, %struct.list** %2
%7 = call i32 @list_push(%struct.list* %6, i32 10)
%8 = load %struct.list*, %struct.list** %2
%9 = call i32 @list_push(%struct.list* %8, i32 20)
%10 = load %struct.list*, %struct.list** %2
%11 = call i32 @list_pop(%struct.list* %10)
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = icmp eq i32 %12, 20
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = load %struct.list*, %struct.list** %2
%17 = call i32 @list_pop(%struct.list* %16)
store i32 %17, i32* %4
%18 = load i32, i32* %4
%19 = icmp eq i32 %18, 10
%20 = zext i1 %19 to i32
%21 = call i32 @assert(i32 %20)
%22 = load %struct.list*, %struct.list** %2
%23 = call i32 @list_dispose(%struct.list* %22)
ret i32 0
}

LLVM IR (-O2):
%struct.list = type { i32 }
define i32 @main() {
%1 = tail call %struct.list* (...) @create_list()
%2 = tail call i32 @list_push(%struct.list* %1, i32 10)
%3 = tail call i32 @list_push(%struct.list* %1, i32 20)
%4 = tail call i32 @list_pop(%struct.list* %1)
%5 = icmp eq i32 %4, 20
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = tail call i32 @list_pop(%struct.list* %1)
%9 = icmp eq i32 %8, 10
%10 = zext i1 %9 to i32
%11 = tail call i32 @assert(i32 %10)
%12 = tail call i32 @list_dispose(%struct.list* %1)
ret i32 0
}