#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*/ LeggiDati(char *, int *, int **, int *);
int /*<<< orphan*/ printf(char *, int);
scalar_t__ risolvi(int, int **, int *);
int /*<<< orphan*/ scanf(char *, char *);
scalar_t__ verificaCorretto(int, int **);
int main() {
  char nomeFile[14];
  int dim;
  int matrice[10][10];
  int valoriEsterni[40];
  scanf("%s", nomeFile);
  if (!LeggiDati(nomeFile, &dim, matrice, valoriEsterni)) {
    return 0;
  }
  printf("%d\n", verificaCorretto(dim, matrice) &&
                     risolvi(dim, matrice, valoriEsterni));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x260,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x12(%rbp),%rsi
lea    0xe93(%rip),%rdi
call   1060 <scanf@plt>
lea    -0x12(%rbp),%rdi
lea    -0x1b0(%rbp),%rdx
lea    -0x250(%rbp),%rcx
lea    -0x18(%rbp),%rsi
call   1050 <LeggiDati@plt>
cmp    $0x0,%eax
jne    11a2 <main+0x52>
movl   $0x0,-0x4(%rbp)
jmp    1207 <main+0xb7>
mov    -0x18(%rbp),%edi
lea    -0x1b0(%rbp),%rsi
call   1070 <verificaCorretto@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x251(%rbp)
je     11e9 <main+0x99>
mov    -0x18(%rbp),%edi
lea    -0x1b0(%rbp),%rsi
lea    -0x250(%rbp),%rdx
call   1030 <risolvi@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x251(%rbp)
mov    -0x251(%rbp),%al
and    $0x1,%al
movzbl %al,%esi
lea    0xe08(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x260,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x250,%rsp
lea    0xea1(%rip),%rdi
lea    0x12(%rsp),%rbx
mov    %rbx,%rsi
call   1060 <scanf@plt>
lea    0xc(%rsp),%rsi
lea    0xc0(%rsp),%rdx
lea    0x20(%rsp),%rcx
mov    %rbx,%rdi
call   1050 <LeggiDati@plt>
test   %eax,%eax
je     11cf <main+0x7f>
mov    0xc(%rsp),%edi
lea    0xc0(%rsp),%rsi
call   1070 <verificaCorretto@plt>
test   %rax,%rax
je     11c1 <main+0x71>
mov    0xc(%rsp),%edi
lea    0xc0(%rsp),%rsi
lea    0x20(%rsp),%rdx
call   1030 <risolvi@plt>
xor    %esi,%esi
test   %rax,%rax
setne  %sil
jmp    11c3 <main+0x73>
xor    %esi,%esi
lea    0xe39(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x250,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [14 x i8]
%3 = alloca i32
%4 = alloca [10 x [10 x i32]]
%5 = alloca [40 x i32]
store i32 0, i32* %1
%6 = getelementptr inbounds [14 x i8], [14 x i8]* %2, i64 0, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds [14 x i8], [14 x i8]* %2, i64 0, i64 0
%9 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %4, i64 0, i64 0
%10 = bitcast [10 x i32]* %9 to i32**
%11 = getelementptr inbounds [40 x i32], [40 x i32]* %5, i64 0, i64 0
%12 = call i32 @LeggiDati(i8* %8, i32* %3, i32** %10, i32* %11)
%13 = icmp ne i32 %12, 0
br i1 %13, label %15, label %14
14: ; preds = %0
store i32 0, i32* %1
br label %32
15: ; preds = %0
%16 = load i32, i32* %3
%17 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %4, i64 0, i64 0
%18 = bitcast [10 x i32]* %17 to i32**
%19 = call i64 @verificaCorretto(i32 %16, i32** %18)
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %28
21: ; preds = %15
%22 = load i32, i32* %3
%23 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %4, i64 0, i64 0
%24 = bitcast [10 x i32]* %23 to i32**
%25 = getelementptr inbounds [40 x i32], [40 x i32]* %5, i64 0, i64 0
%26 = call i64 @risolvi(i32 %22, i32** %24, i32* %25)
%27 = icmp ne i64 %26, 0
br label %28
28: ; preds = %21, %15
%29 = phi i1 [ false, %15 ], [ %27, %21 ]
%30 = zext i1 %29 to i32
%31 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %30)
store i32 0, i32* %1
br label %32
32: ; preds = %28, %14
%33 = load i32, i32* %1
ret i32 %33
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [14 x i8]
%2 = alloca i32
%3 = alloca [10 x [10 x i32]]
%4 = alloca [40 x i32]
%5 = getelementptr inbounds [14 x i8], [14 x i8]* %1, i64 0, i64 0
%6 = bitcast i32* %2 to i8*
%7 = bitcast [10 x [10 x i32]]* %3 to i8*
%8 = bitcast [40 x i32]* %4 to i8*
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
%10 = bitcast [10 x [10 x i32]]* %3 to i32**
%11 = getelementptr inbounds [40 x i32], [40 x i32]* %4, i64 0, i64 0
%12 = call i32 @LeggiDati(i8* %5, i32* %2, i32** %10, i32* %11)
%13 = icmp eq i32 %12, 0
br i1 %13, label %26, label %14
14: ; preds = %0
%15 = load i32, i32* %2
%16 = call i64 @verificaCorretto(i32 %15, i32** %10)
%17 = icmp eq i64 %16, 0
br i1 %17, label %23, label %18
18: ; preds = %14
%19 = load i32, i32* %2
%20 = call i64 @risolvi(i32 %19, i32** %10, i32* %11)
%21 = icmp ne i64 %20, 0
%22 = zext i1 %21 to i32
br label %23
23: ; preds = %18, %14
%24 = phi i32 [ 0, %14 ], [ %22, %18 ]
%25 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %24)
br label %26
26: ; preds = %0, %23
ret i32 0
}