#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*/ compressQueue(int *, int, int);
int /*<<< orphan*/ showSucess(int);
void removeInto(int *queue, int *begin, int *end) {
  if (*begin < *end) {
    *begin = *begin + 1;
  } else if (*begin == *end) {
    if (*begin != 0) {
      compressQueue(queue, *begin, *end);
    }
    *begin = -1;
    *end = -1;
    showSucess(1);
    return;
  }
}


x86 assembly (clang, -O0):
<removeInto>:
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
jge    115a <removeInto+0x3a>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
jmp    11b6 <removeInto+0x96>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jne    11b1 <removeInto+0x91>
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
je     118e <removeInto+0x6e>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
call   1040 <compressQueue@plt>
mov    -0x10(%rbp),%rax
movl   $0xffffffff,(%rax)
mov    -0x18(%rbp),%rax
movl   $0xffffffff,(%rax)
mov    $0x1,%edi
call   1030 <showSucess@plt>
jmp    11b6 <removeInto+0x96>
jmp    11b6 <removeInto+0x96>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<removeInto>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    (%rsi),%edx
cmp    (%r14),%edx
jge    1138 <removeInto+0x18>
add    $0x1,%edx
mov    %edx,(%rbx)
jmp    1163 <removeInto+0x43>
jne    1163 <removeInto+0x43>
test   %edx,%edx
je     1145 <removeInto+0x25>
mov    %edx,%esi
call   1040 <compressQueue@plt>
movl   $0xffffffff,(%rbx)
movl   $0xffffffff,(%r14)
mov    $0x1,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <showSucess@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @removeInto(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 slt i32 %8, %10
br i1 %11, label %12, label %17
12: ; preds = %3
%13 = load i32*, i32** %5
%14 = load i32, i32* %13
%15 = add nsw i32 %14, 1
%16 = load i32*, i32** %5
store i32 %15, i32* %16
br label %39
17: ; preds = %3
%18 = load i32*, i32** %5
%19 = load i32, i32* %18
%20 = load i32*, i32** %6
%21 = load i32, i32* %20
%22 = icmp eq i32 %19, %21
br i1 %22, label %23, label %38
23: ; preds = %17
%24 = load i32*, i32** %5
%25 = load i32, i32* %24
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %34
27: ; preds = %23
%28 = load i32*, i32** %4
%29 = load i32*, i32** %5
%30 = load i32, i32* %29
%31 = load i32*, i32** %6
%32 = load i32, i32* %31
%33 = call i32 @compressQueue(i32* %28, i32 %30, i32 %32)
br label %34
34: ; preds = %27, %23
%35 = load i32*, i32** %5
store i32 -1, i32* %35
%36 = load i32*, i32** %6
store i32 -1, i32* %36
%37 = call i32 @showSucess(i32 1)
br label %39
38: ; preds = %17
br label %39
39: ; preds = %34, %38, %12
ret void
}

LLVM IR (-O2):
define void @removeInto(i32* %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = icmp slt i32 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = add nsw i32 %4, 1
store i32 %8, i32* %1
br label %17
9: ; preds = %3
%10 = icmp eq i32 %4, %5
br i1 %10, label %11, label %17
11: ; preds = %9
%12 = icmp eq i32 %4, 0
br i1 %12, label %15, label %13
13: ; preds = %11
%14 = tail call i32 @compressQueue(i32* %0, i32 %4, i32 %4)
br label %15
15: ; preds = %13, %11
store i32 -1, i32* %1
store i32 -1, i32* %2
%16 = tail call i32 @showSucess(i32 1)
br label %17
17: ; preds = %9, %15, %7
ret void
}