#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 *);
int /*<<< orphan*/ scanf(char *, int *);
void frontenq(int a[], int *ffp, int *frp, int *n) {
  int k;
  if (*n >= 10)
    printf("OVERFLOW...!\n");
  else {
    if (*ffp == -1 && *frp == -1)
      *ffp = 0;
    *frp = *frp + 1;
    *n = *n + 1;
    printf("Enter data to insert : ");
    scanf("%d", &a[*frp]);
    printf("Data inserted successfully...\n");
  }
}


x86 assembly (clang, -O0):
<frontenq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpl   $0xa,(%rax)
jl     1156 <frontenq+0x36>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
jmp    11ce <frontenq+0xae>
mov    -0x10(%rbp),%rax
cmpl   $0xffffffff,(%rax)
jne    117a <frontenq+0x5a>
mov    -0x18(%rbp),%rax
cmpl   $0xffffffff,(%rax)
jne    117a <frontenq+0x5a>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
lea    0xe6f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rax
movslq (%rax),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe69(%rip),%rdi
call   1040 <scanf@plt>
lea    0xe60(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<frontenq>:
push   %r14
push   %rbx
push   %rax
cmpl   $0x9,(%rcx)
jle    1142 <frontenq+0x12>
lea    0xef9(%rip),%rdi
jmp    1184 <frontenq+0x54>
mov    %rdx,%rbx
mov    %rdi,%r14
cmpl   $0xffffffff,(%rsi)
jne    1158 <frontenq+0x28>
cmpl   $0xffffffff,(%rbx)
jne    1158 <frontenq+0x28>
movl   $0x0,(%rsi)
addl   $0x1,(%rbx)
addl   $0x1,(%rcx)
lea    0xe9b(%rip),%rdi
call   1040 <printf@plt>
movslq (%rbx),%rax
lea    (%r14,%rax,4),%rsi
lea    0xea0(%rip),%rdi
call   1050 <scanf@plt>
lea    0xe97(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"OVERFLOW...!\0A\00"
@.str.1 = [24 x i8] c"Enter data to insert : \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [31 x i8] c"Data inserted successfully...\0A\00"
define void @frontenq(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%10 = load i32*, i32** %8
%11 = load i32, i32* %10
%12 = icmp sge i32 %11, 10
br i1 %12, label %13, label %15
13: ; preds = %4
%14 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %42
15: ; preds = %4
%16 = load i32*, i32** %6
%17 = load i32, i32* %16
%18 = icmp eq i32 %17, -1
br i1 %18, label %19, label %25
19: ; preds = %15
%20 = load i32*, i32** %7
%21 = load i32, i32* %20
%22 = icmp eq i32 %21, -1
br i1 %22, label %23, label %25
23: ; preds = %19
%24 = load i32*, i32** %6
store i32 0, i32* %24
br label %25
25: ; preds = %23, %19, %15
%26 = load i32*, i32** %7
%27 = load i32, i32* %26
%28 = add nsw i32 %27, 1
%29 = load i32*, i32** %7
store i32 %28, i32* %29
%30 = load i32*, i32** %8
%31 = load i32, i32* %30
%32 = add nsw i32 %31, 1
%33 = load i32*, i32** %8
store i32 %32, i32* %33
%34 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%35 = load i32*, i32** %5
%36 = load i32*, i32** %7
%37 = load i32, i32* %36
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i32, i32* %35, i64 %38
%40 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %39)
%41 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
br label %42
42: ; preds = %25, %13
ret void
}

LLVM IR (-O2):
@.str.1 = [24 x i8] c"Enter data to insert : \00"
@.str.2 = [3 x i8] c"%d\00"
@str = [30 x i8] c"Data inserted successfully...\00"
@str.4 = [13 x i8] c"OVERFLOW...!\00"
define void @frontenq(i32* %0, i32* nocapture %1, i32* nocapture %2, i32* nocapture %3) {
%5 = load i32, i32* %3
%6 = icmp sgt i32 %5, 9
br i1 %6, label %24, label %7
7: ; preds = %4
%8 = load i32, i32* %1
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %14
10: ; preds = %7
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %14
13: ; preds = %10
store i32 0, i32* %1
br label %14
14: ; preds = %13, %10, %7
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
%19 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%20 = load i32, i32* %2
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i32, i32* %0, i64 %21
%23 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %22)
br label %24
24: ; preds = %4, %14
%25 = phi i8* [ getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0), %14 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @str.4, i64 0, i64 0), %4 ]
%26 = tail call i32 @puts(i8* dereferenceable(1) %25)
ret void
}