#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 *, int *);
void read_matrix(int **m) {
  int i, j;
  for (i = 0; i < 9; i++)
    for (j = 0; j < 9; j++)
      scanf("%d", &m[i][j]);
}


x86 assembly (clang, -O0):
<read_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x9,-0xc(%rbp)
jge    1182 <read_matrix+0x72>
movl   $0x0,-0x10(%rbp)
cmpl   $0x9,-0x10(%rbp)
jge    116f <read_matrix+0x5f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xea4(%rip),%rdi
call   1030 <scanf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <read_matrix+0x24>
jmp    1174 <read_matrix+0x64>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <read_matrix+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_matrix>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
xor    %ebx,%ebx
lea    0xedf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
mov    (%r15,%rbx,8),%rsi
add    $0x4,%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
mov    (%r15,%rbx,8),%rsi
add    $0x8,%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
mov    (%r15,%rbx,8),%rsi
add    $0xc,%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
mov    (%r15,%rbx,8),%rsi
add    $0x10,%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
mov    (%r15,%rbx,8),%rsi
add    $0x14,%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
mov    (%r15,%rbx,8),%rsi
add    $0x18,%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
mov    (%r15,%rbx,8),%rsi
add    $0x1c,%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
mov    (%r15,%rbx,8),%rsi
add    $0x20,%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
add    $0x1,%rbx
cmp    $0x9,%rbx
jne    1130 <read_matrix+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @read_matrix(i32** nocapture %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i64 [ 0, %1 ], [ %31, %2 ]
%4 = getelementptr inbounds i32*, i32** %0, i64 %3
%5 = load i32*, i32** %4
%6 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
%7 = load i32*, i32** %4
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %8)
%10 = load i32*, i32** %4
%11 = getelementptr inbounds i32, i32* %10, i64 2
%12 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %11)
%13 = load i32*, i32** %4
%14 = getelementptr inbounds i32, i32* %13, i64 3
%15 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %14)
%16 = load i32*, i32** %4
%17 = getelementptr inbounds i32, i32* %16, i64 4
%18 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %17)
%19 = load i32*, i32** %4
%20 = getelementptr inbounds i32, i32* %19, i64 5
%21 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %20)
%22 = load i32*, i32** %4
%23 = getelementptr inbounds i32, i32* %22, i64 6
%24 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %23)
%25 = load i32*, i32** %4
%26 = getelementptr inbounds i32, i32* %25, i64 7
%27 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %26)
%28 = load i32*, i32** %4
%29 = getelementptr inbounds i32, i32* %28, i64 8
%30 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %29)
%31 = add nuw nsw i64 %3, 1
%32 = icmp eq i64 %31, 9
br i1 %32, label %33, label %2
33: ; preds = %2
ret void
}