#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 askUserX(int *userX, char chip) {
  int tempX = 0;
  do {
    printf("%c turn, enter row: ", chip);
    scanf("%d", &tempX);
    printf("\n");
  } while (tempX <= 0 || tempX > 9);
  *userX = tempX - 1;
}


x86 assembly (clang, -O0):
<askUserX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
movsbl -0x9(%rbp),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec3(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%al
cmpl   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
jle    1182 <askUserX+0x62>
cmpl   $0x9,-0x10(%rbp)
setg   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1139 <askUserX+0x19>
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<askUserX>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebp
mov    %rdi,%r14
movl   $0x0,0xc(%rsp)
lea    0xeb0(%rip),%r15
lea    0xebe(%rip),%r12
lea    0xc(%rsp),%rbx
nopl   0x0(%rax)
mov    %r15,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0xc(%rsp),%eax
lea    -0xa(%rax),%ecx
cmp    $0xfffffff7,%ecx
jb     1160 <askUserX+0x30>
add    $0xffffffff,%eax
mov    %eax,(%r14)
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [21 x i8] c"%c turn, enter row: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @askUserX(i32* %0, i8 signext %1) {
%3 = alloca i32*
%4 = alloca i8
%5 = alloca i32
store i32* %0, i32** %3
store i8 %1, i8* %4
store i32 0, i32* %5
br label %6
6: ; preds = %18, %2
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %12
12: ; preds = %6
%13 = load i32, i32* %5
%14 = icmp sle i32 %13, 0
br i1 %14, label %18, label %15
15: ; preds = %12
%16 = load i32, i32* %5
%17 = icmp sgt i32 %16, 9
br label %18
18: ; preds = %15, %12
%19 = phi i1 [ true, %12 ], [ %17, %15 ]
br i1 %19, label %6, label %20
20: ; preds = %18
%21 = load i32, i32* %5
%22 = sub nsw i32 %21, 1
%23 = load i32*, i32** %3
store i32 %22, i32* %23
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"%c turn, enter row: \00"
@.str.1 = [3 x i8] c"%d\00"
define void @askUserX(i32* nocapture writeonly %0, i8 signext %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = sext i8 %1 to i32
br label %6
6: ; preds = %6, %2
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %5)
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%9 = call i32 @putchar(i32 10)
%10 = load i32, i32* %3
%11 = add i32 %10, -10
%12 = icmp ult i32 %11, -9
br i1 %12, label %6, label %13
13: ; preds = %6
%14 = add nsw i32 %10, -1
store i32 %14, i32* %0
ret void
}