#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 deq();
int /*<<< orphan*/ enq(int);
scalar_t__ isEmpty();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ q_print();
int main() {
  int i;
  printf("is queue empty? \n");
  printf("%s\n", (isEmpty()) ? "true" : "false");
  enq(10);
  enq(11);
  enq(12);
  enq(15);
  i = deq();
  printf("first in queue is %d\n", i);
  q_print();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1060 <isEmpty@plt>
mov    %rax,%rcx
lea    0xe9d(%rip),%rsi
lea    0xe91(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rsi
lea    0xe7e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xa,%edi
call   1070 <enq@plt>
mov    $0xb,%edi
call   1070 <enq@plt>
mov    $0xc,%edi
call   1070 <enq@plt>
mov    $0xf,%edi
call   1070 <enq@plt>
mov    $0x0,%al
call   1040 <deq@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe4a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <q_print@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb9(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1070 <isEmpty@plt>
test   %rax,%rax
lea    0xe87(%rip),%rax
lea    0xe7b(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
mov    $0xa,%edi
call   1080 <enq@plt>
mov    $0xb,%edi
call   1080 <enq@plt>
mov    $0xc,%edi
call   1080 <enq@plt>
mov    $0xf,%edi
call   1080 <enq@plt>
xor    %eax,%eax
call   1050 <deq@plt>
lea    0xe47(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <q_print@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"is queue empty? \0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [5 x i8] c"true\00"
@.str.3 = [6 x i8] c"false\00"
@.str.4 = [22 x i8] c"first in queue is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = call i64 (...) @isEmpty()
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = call i32 @enq(i32 10)
%10 = call i32 @enq(i32 11)
%11 = call i32 @enq(i32 12)
%12 = call i32 @enq(i32 15)
%13 = call i32 (...) @deq()
store i32 %13, i32* %2
%14 = load i32, i32* %2
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i32 %14)
%16 = call i32 (...) @q_print()
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [5 x i8] c"true\00"
@.str.3 = [6 x i8] c"false\00"
@.str.4 = [22 x i8] c"first in queue is %d\0A\00"
@str = [17 x i8] c"is queue empty? \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%2 = tail call i64 (...) @isEmpty()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0)
%5 = tail call i32 @puts(i8* dereferenceable(1) %4)
%6 = tail call i32 @enq(i32 10)
%7 = tail call i32 @enq(i32 11)
%8 = tail call i32 @enq(i32 12)
%9 = tail call i32 @enq(i32 15)
%10 = tail call i32 (...) @deq()
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i32 %10)
%12 = tail call i32 (...) @q_print()
ret i32 0
}