#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 *, char *);
void readMatrix(int matrix[5][5]) {
  int row, column;
  char space_character;
  for (row = 0; row < 5; row++) {
    for (column = 0; column < 5; column++) {
      scanf("%d%c", &matrix[row][column], &space_character);
      if (space_character == '\n') {
        return;
      }
    }
  }
}


x86 assembly (clang, -O0):
<readMatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    11a0 <readMatrix+0x90>
movl   $0x0,-0x10(%rbp)
cmpl   $0x5,-0x10(%rbp)
jge    118d <readMatrix+0x7d>
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
imul   $0x14,%rax,%rax
add    %rax,%rsi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xea1(%rip),%rdi
lea    -0x11(%rbp),%rdx
call   1030 <scanf@plt>
movsbl -0x11(%rbp),%eax
cmp    $0xa,%eax
jne    117a <readMatrix+0x6a>
jmp    11a0 <readMatrix+0x90>
jmp    117f <readMatrix+0x6f>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <readMatrix+0x24>
jmp    1192 <readMatrix+0x82>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <readMatrix+0x13>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readMatrix>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x4,%r12d
lea    0xed8(%rip),%r14
lea    0x7(%rsp),%r15
nopl   (%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
call   1030 <scanf@plt>
cmpb   $0xa,0x7(%rsp)
je     11ac <readMatrix+0x9c>
lea    0x4(%rbx),%rsi
mov    %r14,%rdi
mov    %r15,%rdx
call   1030 <scanf@plt>
cmpb   $0xa,0x7(%rsp)
je     11ac <readMatrix+0x9c>
lea    0x8(%rbx),%rsi
mov    %r14,%rdi
mov    %r15,%rdx
call   1030 <scanf@plt>
cmpb   $0xa,0x7(%rsp)
je     11ac <readMatrix+0x9c>
lea    0xc(%rbx),%rsi
mov    %r14,%rdi
mov    %r15,%rdx
call   1030 <scanf@plt>
cmpb   $0xa,0x7(%rsp)
je     11ac <readMatrix+0x9c>
lea    0x10(%rbx),%rsi
mov    %r14,%rdi
mov    %r15,%rdx
call   1030 <scanf@plt>
sub    $0x1,%r12
setb   %al
cmpb   $0xa,0x7(%rsp)
je     11ac <readMatrix+0x9c>
add    $0x14,%rbx
test   %al,%al
je     1130 <readMatrix+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

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