#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*/ access();
scalar_t__ counter();
int min();
int /*<<< orphan*/ setBoard(int, int);
int queenDigui() {
  int m;
  static int count = 0;
  if (count > 8) {
    count = 0;
  }
  if (counter() != 0) {
    access();
    m = min();
    setBoard(m / 10, m % 10);
    queenDigui();
    count++;
  }
  if (count > 7) {
    return 0;
  }
  return count;
}


x86 assembly (clang, -O0):
<queenDigui>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cmpl   $0x8,0x2eed(%rip)
jle    116f <queenDigui+0x1f>
movl   $0x0,0x2edd(%rip)
mov    $0x0,%al
call   1060 <counter@plt>
cmp    $0x0,%rax
je     11c4 <queenDigui+0x74>
mov    $0x0,%al
call   1070 <access@plt>
mov    $0x0,%al
call   1030 <min@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
call   1050 <setBoard@plt>
call   1040 <queenDigui@plt>
mov    0x2e91(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2e88(%rip)
cmpl   $0x7,0x2e81(%rip)
jle    11dd <queenDigui+0x8d>
movl   $0x0,-0x4(%rbp)
jmp    11e6 <queenDigui+0x96>
mov    0x2e69(%rip),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<queenDigui>:
push   %rax
cmpl   $0x9,0x2ef4(%rip)
jl     1164 <queenDigui+0x14>
movl   $0x0,0x2ee8(%rip)
xor    %eax,%eax
call   1060 <counter@plt>
test   %rax,%rax
je     11b8 <queenDigui+0x68>
xor    %eax,%eax
call   1070 <access@plt>
xor    %eax,%eax
call   1030 <min@plt>
movslq %eax,%rsi
imul   $0x66666667,%rsi,%rdi
mov    %rdi,%rax
shr    $0x3f,%rax
sar    $0x22,%rdi
add    %eax,%edi
lea    (%rdi,%rdi,1),%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%esi
call   1050 <setBoard@plt>
call   1040 <queenDigui@plt>
mov    0x2e9f(%rip),%ecx
add    $0x1,%ecx
mov    %ecx,0x2e96(%rip)
jmp    11be <queenDigui+0x6e>
mov    0x2e8e(%rip),%ecx
xor    %eax,%eax
cmp    $0x8,%ecx
cmovl  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@queenDigui.count = internal global i32 0
define i32 @queenDigui() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @queenDigui.count
%4 = icmp sgt i32 %3, 8
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 0, i32* @queenDigui.count
br label %6
6: ; preds = %5, %0
%7 = call i64 (...) @counter()
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %20
9: ; preds = %6
%10 = call i32 (...) @access()
%11 = call i32 (...) @min()
store i32 %11, i32* %2
%12 = load i32, i32* %2
%13 = sdiv i32 %12, 10
%14 = load i32, i32* %2
%15 = srem i32 %14, 10
%16 = call i32 @setBoard(i32 %13, i32 %15)
%17 = call i32 @queenDigui()
%18 = load i32, i32* @queenDigui.count
%19 = add nsw i32 %18, 1
store i32 %19, i32* @queenDigui.count
br label %20
20: ; preds = %9, %6
%21 = load i32, i32* @queenDigui.count
%22 = icmp sgt i32 %21, 7
br i1 %22, label %23, label %24
23: ; preds = %20
store i32 0, i32* %1
br label %26
24: ; preds = %20
%25 = load i32, i32* @queenDigui.count
store i32 %25, i32* %1
br label %26
26: ; preds = %24, %23
%27 = load i32, i32* %1
ret i32 %27
}

LLVM IR (-O2):
@queenDigui.count = internal unnamed_addr global i32 0
define i32 @queenDigui() {
%1 = load i32, i32* @queenDigui.count
%2 = icmp sgt i32 %1, 8
br i1 %2, label %3, label %4
3: ; preds = %0
store i32 0, i32* @queenDigui.count
br label %4
4: ; preds = %3, %0
%5 = tail call i64 (...) @counter()
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = load i32, i32* @queenDigui.count
br label %18
9: ; preds = %4
%10 = tail call i32 (...) @access()
%11 = tail call i32 (...) @min()
%12 = sdiv i32 %11, 10
%13 = srem i32 %11, 10
%14 = tail call i32 @setBoard(i32 %12, i32 %13)
%15 = tail call i32 @queenDigui()
%16 = load i32, i32* @queenDigui.count
%17 = add nsw i32 %16, 1
store i32 %17, i32* @queenDigui.count
br label %18
18: ; preds = %7, %9
%19 = phi i32 [ %8, %7 ], [ %17, %9 ]
%20 = icmp sgt i32 %19, 7
%21 = select i1 %20, i32 0, i32 %19
ret i32 %21
}