#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*/ gdb_recursion_test_ptr(int, int, int, int, int, int, int);
void gdb_recursion_test(int depth, int q1, int q2, int q3, int q4, int q5,
                        int q6) {
  int q = q1;
  q1 = q2;
  q2 = q3;
  q3 = q4;
  q4 = q5;
  q5 = q6;
  q6 = q;
  if (depth--)
    gdb_recursion_test_ptr(depth, q1, q2, q3, q4, q5, q6);
}


x86 assembly (clang, -O0):
<gdb_recursion_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     118c <gdb_recursion_test+0x7c>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    0x10(%rbp),%eax
mov    %eax,(%rsp)
call   1030 <gdb_recursion_test_ptr@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdb_recursion_test>:
test   %edi,%edi
je     1132 <gdb_recursion_test+0x22>
push   %rax
mov    0x10(%rsp),%eax
add    $0xffffffff,%edi
mov    %esi,(%rsp)
mov    %edx,%esi
mov    %ecx,%edx
mov    %r8d,%ecx
mov    %r9d,%r8d
mov    %eax,%r9d
call   1030 <gdb_recursion_test_ptr@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @gdb_recursion_test(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%16 = load i32, i32* %9
store i32 %16, i32* %15
%17 = load i32, i32* %10
store i32 %17, i32* %9
%18 = load i32, i32* %11
store i32 %18, i32* %10
%19 = load i32, i32* %12
store i32 %19, i32* %11
%20 = load i32, i32* %13
store i32 %20, i32* %12
%21 = load i32, i32* %14
store i32 %21, i32* %13
%22 = load i32, i32* %15
store i32 %22, i32* %14
%23 = load i32, i32* %8
%24 = add nsw i32 %23, -1
store i32 %24, i32* %8
%25 = icmp ne i32 %23, 0
br i1 %25, label %26, label %35
26: ; preds = %7
%27 = load i32, i32* %8
%28 = load i32, i32* %9
%29 = load i32, i32* %10
%30 = load i32, i32* %11
%31 = load i32, i32* %12
%32 = load i32, i32* %13
%33 = load i32, i32* %14
%34 = call i32 @gdb_recursion_test_ptr(i32 %27, i32 %28, i32 %29, i32 %30, i32 %31, i32 %32, i32 %33)
br label %35
35: ; preds = %26, %7
ret void
}

LLVM IR (-O2):
define void @gdb_recursion_test(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = icmp eq i32 %0, 0
br i1 %8, label %12, label %9
9: ; preds = %7
%10 = add nsw i32 %0, -1
%11 = tail call i32 @gdb_recursion_test_ptr(i32 %10, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %1)
br label %12
12: ; preds = %9, %7
ret void
}