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

/* Variables and functions */
int /*<<< orphan*/ assert(int);
struct queue *create();
int dequeue(struct queue *);
int /*<<< orphan*/ dispose(struct queue *);
int /*<<< orphan*/ enqueue(struct queue *, int);
int main() {
  struct queue *q = create();
  enqueue(q, 10);
  enqueue(q, 20);
  int x1 = dequeue(q);
  assert(x1 == 10);
  int x2 = dequeue(q);
  assert(x2 == 20);
  dispose(q);
  return 0;
}


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

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

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

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