#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 insertQueue(int Q[], int *front, int *rear, int key) {
  if (*rear == 5) {
    printf("\n\tOverflow");
    return;
  }
  *rear = *rear + 1;
  Q[*rear] = key;
  if (*front == -1)
    *front = 0;
}


x86 assembly (clang, -O0):
<insertQueue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
cmpl   $0x5,(%rax)
jne    1145 <insertQueue+0x35>
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
jmp    117c <insertQueue+0x6c>
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movslq (%rcx),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%rax
cmpl   $0xffffffff,(%rax)
jne    117c <insertQueue+0x6c>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<insertQueue>:
movslq (%rdx),%r8
cmp    $0x5,%r8
jne    1125 <insertQueue+0x15>
lea    0xee0(%rip),%rdi
jmp    1030 <printf@plt>
lea    0x1(%r8),%rax
mov    %eax,(%rdx)
mov    %ecx,0x4(%rdi,%r8,4)
cmpl   $0xffffffff,(%rsi)
je     1136 <insertQueue+0x26>
ret
movl   $0x0,(%rsi)
ret

LLVM IR (-O0):
@.str = [11 x i8] c"\0A\09Overflow\00"
define void @insertQueue(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** %7
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, 5
br i1 %11, label %12, label %14
12: ; preds = %4
%13 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %30
14: ; preds = %4
%15 = load i32*, i32** %7
%16 = load i32, i32* %15
%17 = add nsw i32 %16, 1
%18 = load i32*, i32** %7
store i32 %17, i32* %18
%19 = load i32, i32* %8
%20 = load i32*, i32** %5
%21 = load i32*, i32** %7
%22 = load i32, i32* %21
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i32, i32* %20, i64 %23
store i32 %19, i32* %24
%25 = load i32*, i32** %6
%26 = load i32, i32* %25
%27 = icmp eq i32 %26, -1
br i1 %27, label %28, label %30
28: ; preds = %14
%29 = load i32*, i32** %6
store i32 0, i32* %29
br label %30
30: ; preds = %12, %28, %14
ret void
}

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