#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int fscanf(int /*<<< orphan*/ *, char *, int *);
int /*<<< orphan*/ stderr;
int lireSudoku(FILE *fich, int sudoku[9][9]) {
  int i, j, res;
  int val;
  for (i = 0; i < 9; i++)
    for (j = 0; j < 9; j++) {
      res = fscanf(fich, "%d", &val);
      if (res == EOF) {
        fprintf(stderr, "Fin de ficher atteinte: manque des coefficients\n");
        exit(-1);
      }
      sudoku[i][j] = val;
    }
  return (0);
}


x86 assembly (clang, -O0):
<lireSudoku>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x9,-0x14(%rbp)
jge    11e4 <lireSudoku+0xb4>
movl   $0x0,-0x18(%rbp)
cmpl   $0x9,-0x18(%rbp)
jge    11d1 <lireSudoku+0xa1>
mov    -0x8(%rbp),%rdi
lea    0xe93(%rip),%rsi
lea    -0x20(%rbp),%rdx
call   1030 <fscanf@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    0x2e65(%rip),%rcx
cmp    (%rcx),%eax
jne    11aa <lireSudoku+0x7a>
mov    0x2e46(%rip),%rax
mov    (%rax),%edi
lea    0xe68(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    -0x20(%rbp),%edx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
imul   $0x24,%rcx,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1158 <lireSudoku+0x28>
jmp    11d6 <lireSudoku+0xa6>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1147 <lireSudoku+0x17>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lireSudoku>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r13
mov    $0x20,%ebx
lea    0xeb3(%rip),%r15
lea    0x4(%rsp),%r12
mov    0x2e8f(%rip),%rbp
nopl   0x0(%rax)
mov    %r13,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1030 <fscanf@plt>
cmp    0x0(%rbp),%eax
je     1291 <lireSudoku+0x161>
mov    0x4(%rsp),%eax
mov    %eax,-0x20(%r14,%rbx,1)
mov    %r13,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1030 <fscanf@plt>
cmp    0x0(%rbp),%eax
je     1291 <lireSudoku+0x161>
mov    0x4(%rsp),%eax
mov    %eax,-0x1c(%r14,%rbx,1)
mov    %r13,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1030 <fscanf@plt>
cmp    0x0(%rbp),%eax
je     1291 <lireSudoku+0x161>
mov    0x4(%rsp),%eax
mov    %eax,-0x18(%r14,%rbx,1)
mov    %r13,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1030 <fscanf@plt>
cmp    0x0(%rbp),%eax
je     1291 <lireSudoku+0x161>
mov    0x4(%rsp),%eax
mov    %eax,-0x14(%r14,%rbx,1)
mov    %r13,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1030 <fscanf@plt>
cmp    0x0(%rbp),%eax
je     1291 <lireSudoku+0x161>
mov    0x4(%rsp),%eax
mov    %eax,-0x10(%r14,%rbx,1)
mov    %r13,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1030 <fscanf@plt>
cmp    0x0(%rbp),%eax
je     1291 <lireSudoku+0x161>
mov    0x4(%rsp),%eax
mov    %eax,-0xc(%r14,%rbx,1)
mov    %r13,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1030 <fscanf@plt>
cmp    0x0(%rbp),%eax
je     1291 <lireSudoku+0x161>
mov    0x4(%rsp),%eax
mov    %eax,-0x8(%r14,%rbx,1)
mov    %r13,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1030 <fscanf@plt>
cmp    0x0(%rbp),%eax
je     1291 <lireSudoku+0x161>
mov    0x4(%rsp),%eax
mov    %eax,-0x4(%r14,%rbx,1)
mov    %r13,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1030 <fscanf@plt>
cmp    0x0(%rbp),%eax
je     1291 <lireSudoku+0x161>
mov    0x4(%rsp),%eax
mov    %eax,(%r14,%rbx,1)
add    $0x24,%rbx
cmp    $0x164,%rbx
jne    1160 <lireSudoku+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2d40(%rip),%rax
mov    (%rax),%edi
lea    0xd62(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@EOF = global i32 0
@stderr = global i32 0
@.str.1 = [49 x i8] c"Fin de ficher atteinte: manque des coefficients\0A\00"
define i32 @lireSudoku(i32* %0, [9 x i32]* %1) {
%3 = alloca i32*
%4 = alloca [9 x i32]*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %3
store [9 x i32]* %1, [9 x i32]** %4
store i32 0, i32* %5
br label %9
9: ; preds = %39, %2
%10 = load i32, i32* %5
%11 = icmp slt i32 %10, 9
br i1 %11, label %12, label %42
12: ; preds = %9
store i32 0, i32* %6
br label %13
13: ; preds = %35, %12
%14 = load i32, i32* %6
%15 = icmp slt i32 %14, 9
br i1 %15, label %16, label %38
16: ; preds = %13
%17 = load i32*, i32** %3
%18 = call i32 @fscanf(i32* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %8)
store i32 %18, i32* %7
%19 = load i32, i32* %7
%20 = load i32, i32* @EOF
%21 = icmp eq i32 %19, %20
br i1 %21, label %22, label %26
22: ; preds = %16
%23 = load i32, i32* @stderr
%24 = call i32 @fprintf(i32 %23, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
%25 = call i32 @exit(i32 -1)
unreachable
26: ; preds = %16
%27 = load i32, i32* %8
%28 = load [9 x i32]*, [9 x i32]** %4
%29 = load i32, i32* %5
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [9 x i32], [9 x i32]* %28, i64 %30
%32 = load i32, i32* %6
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [9 x i32], [9 x i32]* %31, i64 0, i64 %33
store i32 %27, i32* %34
br label %35
35: ; preds = %26
%36 = load i32, i32* %6
%37 = add nsw i32 %36, 1
store i32 %37, i32* %6
br label %13
38: ; preds = %13
br label %39
39: ; preds = %38
%40 = load i32, i32* %5
%41 = add nsw i32 %40, 1
store i32 %41, i32* %5
br label %9
42: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@EOF = global i32 0
@stderr = global i32 0
@.str.1 = [49 x i8] c"Fin de ficher atteinte: manque des coefficients\0A\00"
define i32 @lireSudoku(i32* nocapture %0, [9 x i32]* nocapture writeonly %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
br label %5
5: ; preds = %2, %62
%6 = phi i64 [ 0, %2 ], [ %65, %62 ]
%7 = call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%8 = load i32, i32* @EOF
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %14
10: ; preds = %56, %50, %44, %38, %32, %26, %20, %14, %5
%11 = load i32, i32* @stderr
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 @exit(i32 -1)
unreachable
14: ; preds = %5
%15 = load i32, i32* %3
%16 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 %6, i64 0
store i32 %15, i32* %16
%17 = call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%18 = load i32, i32* @EOF
%19 = icmp eq i32 %17, %18
br i1 %19, label %10, label %20
20: ; preds = %14
%21 = load i32, i32* %3
%22 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 %6, i64 1
store i32 %21, i32* %22
%23 = call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%24 = load i32, i32* @EOF
%25 = icmp eq i32 %23, %24
br i1 %25, label %10, label %26
26: ; preds = %20
%27 = load i32, i32* %3
%28 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 %6, i64 2
store i32 %27, i32* %28
%29 = call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%30 = load i32, i32* @EOF
%31 = icmp eq i32 %29, %30
br i1 %31, label %10, label %32
32: ; preds = %26
%33 = load i32, i32* %3
%34 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 %6, i64 3
store i32 %33, i32* %34
%35 = call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%36 = load i32, i32* @EOF
%37 = icmp eq i32 %35, %36
br i1 %37, label %10, label %38
38: ; preds = %32
%39 = load i32, i32* %3
%40 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 %6, i64 4
store i32 %39, i32* %40
%41 = call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%42 = load i32, i32* @EOF
%43 = icmp eq i32 %41, %42
br i1 %43, label %10, label %44
44: ; preds = %38
%45 = load i32, i32* %3
%46 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 %6, i64 5
store i32 %45, i32* %46
%47 = call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%48 = load i32, i32* @EOF
%49 = icmp eq i32 %47, %48
br i1 %49, label %10, label %50
50: ; preds = %44
%51 = load i32, i32* %3
%52 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 %6, i64 6
store i32 %51, i32* %52
%53 = call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%54 = load i32, i32* @EOF
%55 = icmp eq i32 %53, %54
br i1 %55, label %10, label %56
56: ; preds = %50
%57 = load i32, i32* %3
%58 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 %6, i64 7
store i32 %57, i32* %58
%59 = call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%60 = load i32, i32* @EOF
%61 = icmp eq i32 %59, %60
br i1 %61, label %10, label %62
62: ; preds = %56
%63 = load i32, i32* %3
%64 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 %6, i64 8
store i32 %63, i32* %64
%65 = add nuw nsw i64 %6, 1
%66 = icmp eq i64 %65, 9
br i1 %66, label %67, label %5
67: ; preds = %62
ret i32 0
}