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

/* Variables and functions */
int /*<<< orphan*/ assert(int);
struct llist *create_llist();
int /*<<< orphan*/ llist_add(struct llist *, int);
int /*<<< orphan*/ llist_dispose(struct llist *);
int llist_removeFirst(struct llist *);
void main0() {
  struct llist *l = create_llist();
  llist_add(l, 10);
  llist_add(l, 20);
  llist_add(l, 30);
  llist_add(l, 40);
  int x1 = llist_removeFirst(l);
  assert(x1 == 10);
  int x2 = llist_removeFirst(l);
  assert(x2 == 20);
  llist_dispose(l);
}


x86 assembly (clang, -O0):
<main0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <create_llist@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1060 <llist_add@plt>
mov    -0x8(%rbp),%rdi
mov    $0x14,%esi
call   1060 <llist_add@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1e,%esi
call   1060 <llist_add@plt>
mov    -0x8(%rbp),%rdi
mov    $0x28,%esi
call   1060 <llist_add@plt>
mov    -0x8(%rbp),%rdi
call   1070 <llist_removeFirst@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1070 <llist_removeFirst@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x14,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1030 <llist_dispose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main0>:
push   %rbx
xor    %eax,%eax
call   1050 <create_llist@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0xa,%esi
call   1060 <llist_add@plt>
mov    %rbx,%rdi
mov    $0x14,%esi
call   1060 <llist_add@plt>
mov    %rbx,%rdi
mov    $0x1e,%esi
call   1060 <llist_add@plt>
mov    %rbx,%rdi
mov    $0x28,%esi
call   1060 <llist_add@plt>
mov    %rbx,%rdi
call   1070 <llist_removeFirst@plt>
xor    %edi,%edi
cmp    $0xa,%eax
sete   %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
call   1070 <llist_removeFirst@plt>
xor    %edi,%edi
cmp    $0x14,%eax
sete   %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <llist_dispose@plt>

LLVM IR (-O0):
%struct.llist = type { i32 }
define void @main0() {
%1 = alloca %struct.llist*
%2 = alloca i32
%3 = alloca i32
%4 = call %struct.llist* (...) @create_llist()
store %struct.llist* %4, %struct.llist** %1
%5 = load %struct.llist*, %struct.llist** %1
%6 = call i32 @llist_add(%struct.llist* %5, i32 10)
%7 = load %struct.llist*, %struct.llist** %1
%8 = call i32 @llist_add(%struct.llist* %7, i32 20)
%9 = load %struct.llist*, %struct.llist** %1
%10 = call i32 @llist_add(%struct.llist* %9, i32 30)
%11 = load %struct.llist*, %struct.llist** %1
%12 = call i32 @llist_add(%struct.llist* %11, i32 40)
%13 = load %struct.llist*, %struct.llist** %1
%14 = call i32 @llist_removeFirst(%struct.llist* %13)
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 10
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
%19 = load %struct.llist*, %struct.llist** %1
%20 = call i32 @llist_removeFirst(%struct.llist* %19)
store i32 %20, i32* %3
%21 = load i32, i32* %3
%22 = icmp eq i32 %21, 20
%23 = zext i1 %22 to i32
%24 = call i32 @assert(i32 %23)
%25 = load %struct.llist*, %struct.llist** %1
%26 = call i32 @llist_dispose(%struct.llist* %25)
ret void
}

LLVM IR (-O2):
%struct.llist = type { i32 }
define void @main0() {
%1 = tail call %struct.llist* (...) @create_llist()
%2 = tail call i32 @llist_add(%struct.llist* %1, i32 10)
%3 = tail call i32 @llist_add(%struct.llist* %1, i32 20)
%4 = tail call i32 @llist_add(%struct.llist* %1, i32 30)
%5 = tail call i32 @llist_add(%struct.llist* %1, i32 40)
%6 = tail call i32 @llist_removeFirst(%struct.llist* %1)
%7 = icmp eq i32 %6, 10
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
%10 = tail call i32 @llist_removeFirst(%struct.llist* %1)
%11 = icmp eq i32 %10, 20
%12 = zext i1 %11 to i32
%13 = tail call i32 @assert(i32 %12)
%14 = tail call i32 @llist_dispose(%struct.llist* %1)
ret void
}