#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 frontdeq(int a[], int *ffp, int *frp, int *n) {
  if (*ffp == -1)
    printf("UNDERFLOW...!\n");
  else {
    if (*ffp == *frp) {
      *ffp = *frp = -1;
    } else {
      *ffp = *ffp + 1;
      printf("Item deleted Successfully...\n");
    }
  }
}


x86 assembly (clang, -O0):
<frontdeq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0xffffffff,(%rax)
jne    1146 <frontdeq+0x36>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
jmp    1191 <frontdeq+0x81>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jne    1171 <frontdeq+0x61>
mov    -0x18(%rbp),%rax
movl   $0xffffffff,(%rax)
mov    -0x10(%rbp),%rax
movl   $0xffffffff,(%rax)
jmp    118c <frontdeq+0x7c>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
jmp    1191 <frontdeq+0x81>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<frontdeq>:
mov    (%rsi),%eax
cmp    $0xffffffff,%eax
je     1128 <frontdeq+0x18>
cmp    (%rdx),%eax
jne    1134 <frontdeq+0x24>
movl   $0xffffffff,(%rdx)
movl   $0xffffffff,(%rsi)
ret
lea    0xeee(%rip),%rdi
jmp    1030 <puts@plt>
add    $0x1,%eax
mov    %eax,(%rsi)
lea    0xec0(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [29 x i8] c"Item deleted Successfully...\00"
@str.2 = [14 x i8] c"UNDERFLOW...!\00"
define void @frontdeq(i32* nocapture readnone %0, i32* nocapture %1, i32* nocapture %2, i32* nocapture readnone %3) {
%5 = load i32, i32* %1
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.2, i64 0, i64 0))
br label %16
9: ; preds = %4
%10 = load i32, i32* %2
%11 = icmp eq i32 %5, %10
br i1 %11, label %12, label %13
12: ; preds = %9
store i32 -1, i32* %2
store i32 -1, i32* %1
br label %16
13: ; preds = %9
%14 = add nuw nsw i32 %5, 1
store i32 %14, i32* %1
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
br label %16
16: ; preds = %12, %13, %7
ret void
}