#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*/ scanf(char *, char *);
void readBoard(char s[3][3]) {
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 3; j++) {
      scanf("%c", &s[i][j]);
    }
  }
}


x86 assembly (clang, -O0):
<readBoard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    1181 <readBoard+0x71>
movl   $0x0,-0x10(%rbp)
cmpl   $0x3,-0x10(%rbp)
jge    116e <readBoard+0x5e>
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
imul   $0x3,%rax,%rax
add    %rax,%rsi
movslq -0x10(%rbp),%rax
add    %rax,%rsi
lea    0xea5(%rip),%rdi
call   1030 <scanf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <readBoard+0x24>
jmp    1173 <readBoard+0x63>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <readBoard+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readBoard>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xee2(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <scanf@plt>
lea    0x1(%rbx),%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
lea    0x2(%rbx),%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
lea    0x3(%rbx),%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
lea    0x4(%rbx),%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
lea    0x5(%rbx),%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
lea    0x6(%rbx),%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
lea    0x7(%rbx),%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
add    $0x8,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <scanf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define void @readBoard([3 x i8]* %0) {
%2 = alloca [3 x i8]*
%3 = alloca i32
%4 = alloca i32
store [3 x i8]* %0, [3 x i8]** %2
store i32 0, i32* %3
br label %5
5: ; preds = %25, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 3
br i1 %7, label %8, label %28
8: ; preds = %5
store i32 0, i32* %4
br label %9
9: ; preds = %21, %8
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, 3
br i1 %11, label %12, label %24
12: ; preds = %9
%13 = load [3 x i8]*, [3 x i8]** %2
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [3 x i8], [3 x i8]* %13, i64 %15
%17 = load i32, i32* %4
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [3 x i8], [3 x i8]* %16, i64 0, i64 %18
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %19)
br label %21
21: ; preds = %12
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
br label %9
24: ; preds = %9
br label %25
25: ; preds = %24
%26 = load i32, i32* %3
%27 = add nsw i32 %26, 1
store i32 %27, i32* %3
br label %5
28: ; preds = %5
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @readBoard([3 x i8]* %0) {
%2 = getelementptr inbounds [3 x i8], [3 x i8]* %0, i64 0, i64 0
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %0, i64 0, i64 1
%5 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [3 x i8], [3 x i8]* %0, i64 0, i64 2
%7 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds [3 x i8], [3 x i8]* %0, i64 1, i64 0
%9 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds [3 x i8], [3 x i8]* %0, i64 1, i64 1
%11 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = getelementptr inbounds [3 x i8], [3 x i8]* %0, i64 1, i64 2
%13 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = getelementptr inbounds [3 x i8], [3 x i8]* %0, i64 2, i64 0
%15 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = getelementptr inbounds [3 x i8], [3 x i8]* %0, i64 2, i64 1
%17 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %16)
%18 = getelementptr inbounds [3 x i8], [3 x i8]* %0, i64 2, i64 2
%19 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %18)
ret void
}