#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 /*<<< orphan*/ printf(char *, ...);
void dequeue(int *arr, int *start, int *end) {
  if (*start == *end)
    printf("\nUnderflow");
  else {
    printf("\n%d Dequeued", *(arr + *start));
    *start = *start + 1;
  }
}


x86 assembly (clang, -O0):
<dequeue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jne    1149 <dequeue+0x39>
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1174 <dequeue+0x64>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dequeue>:
push   %rbx
movslq (%rsi),%rax
cmp    (%rdx),%eax
jne    1127 <dequeue+0x17>
lea    0xee1(%rip),%rdi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>
mov    %rsi,%rbx
mov    (%rdi,%rax,4),%esi
lea    0xed7(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
addl   $0x1,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"\0AUnderflow\00"
@.str.1 = [13 x i8] c"\0A%d Dequeued\00"
define void @dequeue(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %5
%8 = load i32, i32* %7
%9 = load i32*, i32** %6
%10 = load i32, i32* %9
%11 = icmp eq i32 %8, %10
br i1 %11, label %12, label %14
12: ; preds = %3
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %26
14: ; preds = %3
%15 = load i32*, i32** %4
%16 = load i32*, i32** %5
%17 = load i32, i32* %16
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* %15, i64 %18
%20 = load i32, i32* %19
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %20)
%22 = load i32*, i32** %5
%23 = load i32, i32* %22
%24 = add nsw i32 %23, 1
%25 = load i32*, i32** %5
store i32 %24, i32* %25
br label %26
26: ; preds = %14, %12
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"\0AUnderflow\00"
@.str.1 = [13 x i8] c"\0A%d Dequeued\00"
define void @dequeue(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = icmp eq i32 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %16
9: ; preds = %3
%10 = sext i32 %4 to i64
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %1
%15 = add nsw i32 %14, 1
store i32 %15, i32* %1
br label %16
16: ; preds = %9, %7
ret void
}