#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 rearenq(int a[], int *rfp, int *rrp, int *n) {
  int k;
  if (*n >= 10)
    printf("OVERFLOW...!\n");
  else {
    if (*rfp == -1 && *rrp == -1) {
      *rfp = 9;
      *rrp = 10;
    }
    *rrp = *rrp - 1;
    *n = *n + 1;
    printf("Enter data to insert : ");
    scanf("%d", &a[*rrp]);
    printf("Data inserted successfully...\n");
  }
}


x86 assembly (clang, -O0):
<rearenq>:
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 <rearenq+0x36>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
jmp    11d8 <rearenq+0xb8>
mov    -0x10(%rbp),%rax
cmpl   $0xffffffff,(%rax)
jne    1184 <rearenq+0x64>
mov    -0x18(%rbp),%rax
cmpl   $0xffffffff,(%rax)
jne    1184 <rearenq+0x64>
mov    -0x10(%rbp),%rax
movl   $0x9,(%rax)
mov    -0x18(%rbp),%rax
movl   $0xa,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
sub    $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    0xe65(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rax
movslq (%rax),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe5f(%rip),%rdi
call   1040 <scanf@plt>
lea    0xe56(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rearenq>:
push   %r14
push   %rbx
push   %rax
cmpl   $0x9,(%rcx)
jle    1142 <rearenq+0x12>
lea    0xef9(%rip),%rdi
jmp    118d <rearenq+0x5d>
mov    %rdx,%rbx
mov    %rdi,%r14
cmpl   $0xffffffff,(%rsi)
mov    (%rdx),%eax
jne    115f <rearenq+0x2f>
cmp    $0xffffffff,%eax
jne    115f <rearenq+0x2f>
movl   $0x9,(%rsi)
mov    $0xa,%eax
add    $0xffffffff,%eax
mov    %eax,(%rbx)
addl   $0x1,(%rcx)
lea    0xe92(%rip),%rdi
call   1040 <printf@plt>
movslq (%rbx),%rax
lea    (%r14,%rax,4),%rsi
lea    0xe97(%rip),%rdi
call   1050 <scanf@plt>
lea    0xe8e(%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 @rearenq(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 %43
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 %26
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 %26
23: ; preds = %19
%24 = load i32*, i32** %6
store i32 9, i32* %24
%25 = load i32*, i32** %7
store i32 10, i32* %25
br label %26
26: ; preds = %23, %19, %15
%27 = load i32*, i32** %7
%28 = load i32, i32* %27
%29 = sub nsw i32 %28, 1
%30 = load i32*, i32** %7
store i32 %29, i32* %30
%31 = load i32*, i32** %8
%32 = load i32, i32* %31
%33 = add nsw i32 %32, 1
%34 = load i32*, i32** %8
store i32 %33, i32* %34
%35 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%36 = load i32*, i32** %5
%37 = load i32*, i32** %7
%38 = load i32, i32* %37
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds i32, i32* %36, i64 %39
%41 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %40)
%42 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
br label %43
43: ; preds = %26, %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 @rearenq(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
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, -1
%12 = select i1 %9, i1 %11, i1 false
br i1 %12, label %13, label %14
13: ; preds = %7
store i32 9, i32* %1
br label %14
14: ; preds = %7, %13
%15 = phi i32 [ 10, %13 ], [ %10, %7 ]
%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
}