#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 *, int *);
void user_play(char **matrix) {
  int user_rowno = 0;
  int user_colno = 0;
  printf("\nUsage: To Select the Position: Row 1, Column 2:: Type on Terminal: "
         "1 2 (enter)\n");
  printf("\nSelect Your Choice: (ROWNO COLNO)\n\n");
  scanf("%d %d", &user_rowno, &user_colno);
  if ((*(*(matrix + user_rowno) + user_colno) != 'O')) {
    printf("\nInvalid User I/P, Try Again\n");
    user_play(matrix);
  } else {
    *(*(matrix + user_rowno) + user_colno) = 'X';
  }
}


x86 assembly (clang, -O0):
<user_play>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
lea    0xef4(%rip),%rdi
call   1030 <printf@plt>
lea    0xf0d(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x4f,%eax
je     11ad <user_play+0x7d>
lea    0xee2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <user_play@plt>
jmp    11c1 <user_play+0x91>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x10(%rbp),%rcx
movb   $0x58,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<user_play>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
lea    0xeb7(%rip),%rdi
call   1030 <puts@plt>
lea    0xefb(%rip),%rdi
call   1030 <puts@plt>
lea    0xe99(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1050 <scanf@plt>
movslq 0xc(%rsp),%rax
mov    (%rbx,%rax,8),%rax
movslq 0x8(%rsp),%rcx
cmpb   $0x4f,(%rax,%rcx,1)
jne    1190 <user_play+0x60>
movb   $0x58,(%rax,%rcx,1)
jmp    11a4 <user_play+0x74>
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1040 <user_play@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [81 x i8] c"\0AUsage: To Select the Position: Row 1, Column 2:: Type on Terminal: 1 2 (enter)\0A\00"
@.str.1 = [37 x i8] c"\0ASelect Your Choice: (ROWNO COLNO)\0A\0A\00"
@.str.2 = [6 x i8] c"%d %d\00"
@.str.3 = [30 x i8] c"\0AInvalid User I/P, Try Again\0A\00"
define void @user_play(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
%4 = alloca i32
store i8** %0, i8*** %2
store i32 0, i32* %3
store i32 0, i32* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32* %3, i32* %4)
%8 = load i8**, i8*** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8*, i8** %8, i64 %10
%12 = load i8*, i8** %11
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp ne i32 %17, 79
br i1 %18, label %19, label %22
19: ; preds = %1
%20 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
%21 = load i8**, i8*** %2
br label %31
22: ; preds = %1
%23 = load i8**, i8*** %2
%24 = load i32, i32* %3
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8*, i8** %23, i64 %25
%27 = load i8*, i8** %26
%28 = load i32, i32* %4
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8, i8* %27, i64 %29
store i8 88, i8* %30
br label %31
31: ; preds = %22, %19
ret void
}

LLVM IR (-O2):
@.str.2 = [6 x i8] c"%d %d\00"
@str = [80 x i8] c"\0AUsage: To Select the Position: Row 1, Column 2:: Type on Terminal: 1 2 (enter)\00"
@str.4 = [36 x i8] c"\0ASelect Your Choice: (ROWNO COLNO)\0A\00"
@str.5 = [29 x i8] c"\0AInvalid User I/P, Try Again\00"
define void @user_play(i8** nocapture %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([80 x i8], [80 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.4, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32* %2, i32* %3)
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8*, i8** %0, i64 %10
%12 = load i8*, i8** %11
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 79
br i1 %17, label %20, label %18
18: ; preds = %1
%19 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.5, i64 0, i64 0))
br label %21
20: ; preds = %1
store i8 88, i8* %15
br label %21
21: ; preds = %20, %18
ret void
}