#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 /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, int *);
int /*<<< orphan*/ printf(char *);
int confereSintaxeArquivoEntrada(FILE *file, int **n, int tam) {
  while (!feof(file)) {
    if (tam != 0) {
      fscanf(file, "%d\n", &(*n)[--tam]);
    } else {
      printf("Mais N's do que escrito na primeira linha\n");
      return 0;
    }
  }
  if (tam != 0) {
    printf("Menos N's do que escrito na primeira linha\n");
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<confereSintaxeArquivoEntrada>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1161 <confereSintaxeArquivoEntrada+0x31>
jmp    11b6 <confereSintaxeArquivoEntrada+0x86>
cmpl   $0x0,-0x1c(%rbp)
je     1199 <confereSintaxeArquivoEntrada+0x69>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%rdx
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
cltq
shl    $0x2,%rax
add    %rax,%rdx
lea    0xe71(%rip),%rsi
call   1040 <fscanf@plt>
jmp    11b1 <confereSintaxeArquivoEntrada+0x81>
lea    0xe64(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    11df <confereSintaxeArquivoEntrada+0xaf>
jmp    1143 <confereSintaxeArquivoEntrada+0x13>
cmpl   $0x0,-0x1c(%rbp)
je     11d8 <confereSintaxeArquivoEntrada+0xa8>
lea    0xe68(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    11df <confereSintaxeArquivoEntrada+0xaf>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<confereSintaxeArquivoEntrada>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rsi,%r13
mov    %rdi,%rbp
call   1050 <feof@plt>
test   %eax,%eax
je     1159 <confereSintaxeArquivoEntrada+0x29>
test   %ebx,%ebx
je     11b7 <confereSintaxeArquivoEntrada+0x87>
lea    0xead(%rip),%rdi
jmp    11c5 <confereSintaxeArquivoEntrada+0x95>
mov    %ebx,0x4(%rsp)
movslq %ebx,%r15
lea    -0x4(,%r15,4),%r14
ff
xor    %ebx,%ebx
lea    0xe8f(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmp    %rbx,%r15
je     11be <confereSintaxeArquivoEntrada+0x8e>
mov    0x0(%r13),%rdx
add    %r14,%rdx
mov    %rbp,%rdi
mov    %r12,%rsi
call   1040 <fscanf@plt>
mov    %rbp,%rdi
call   1050 <feof@plt>
add    $0x1,%rbx
add    $0xfffffffffffffffc,%r14
test   %eax,%eax
je     1180 <confereSintaxeArquivoEntrada+0x50>
mov    0x4(%rsp),%eax
sub    %ebx,%eax
mov    %eax,%ebx
test   %ebx,%ebx
jne    1150 <confereSintaxeArquivoEntrada+0x20>
mov    $0x1,%eax
jmp    11cc <confereSintaxeArquivoEntrada+0x9c>
lea    0xe6a(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [43 x i8] c"Mais N's do que escrito na primeira linha\0A\00"
@.str.2 = [44 x i8] c"Menos N's do que escrito na primeira linha\0A\00"
define i32 @confereSintaxeArquivoEntrada(i32* %0, i32** %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32**
%7 = alloca i32
store i32* %0, i32** %5
store i32** %1, i32*** %6
store i32 %2, i32* %7
br label %8
8: ; preds = %27, %3
%9 = load i32*, i32** %5
%10 = call i32 @feof(i32* %9)
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
br i1 %12, label %13, label %28
13: ; preds = %8
%14 = load i32, i32* %7
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %25
16: ; preds = %13
%17 = load i32*, i32** %5
%18 = load i32**, i32*** %6
%19 = load i32*, i32** %18
%20 = load i32, i32* %7
%21 = add nsw i32 %20, -1
store i32 %21, i32* %7
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i32, i32* %19, i64 %22
%24 = call i32 @fscanf(i32* %17, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %23)
br label %27
25: ; preds = %13
%26 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %4
br label %34
27: ; preds = %16
br label %8
28: ; preds = %8
%29 = load i32, i32* %7
%30 = icmp ne i32 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %28
%32 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %4
br label %34
33: ; preds = %28
store i32 1, i32* %4
br label %34
34: ; preds = %33, %31, %25
%35 = load i32, i32* %4
ret i32 %35
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@str = [43 x i8] c"Menos N's do que escrito na primeira linha\00"
@str.3 = [42 x i8] c"Mais N's do que escrito na primeira linha\00"
define i32 @confereSintaxeArquivoEntrada(i32* nocapture %0, i32** nocapture %1, i32 %2) {
%4 = tail call i32 @feof(i32* %0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %20
6: ; preds = %3
%7 = sext i32 %2 to i64
br label %8
8: ; preds = %6, %11
%9 = phi i64 [ %7, %6 ], [ %13, %11 ]
%10 = icmp eq i64 %9, 0
br i1 %10, label %23, label %11
11: ; preds = %8
%12 = load i32*, i32** %1
%13 = add nsw i64 %9, -1
%14 = getelementptr inbounds i32, i32* %12, i64 %13
%15 = tail call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %14)
%16 = tail call i32 @feof(i32* %0)
%17 = icmp eq i32 %16, 0
br i1 %17, label %8, label %18
18: ; preds = %11
%19 = trunc i64 %13 to i32
br label %20
20: ; preds = %18, %3
%21 = phi i32 [ %2, %3 ], [ %19, %18 ]
%22 = icmp eq i32 %21, 0
br i1 %22, label %26, label %23
23: ; preds = %8, %20
%24 = phi i8* [ getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0), %20 ], [ getelementptr inbounds ([42 x i8], [42 x i8]* @str.3, i64 0, i64 0), %8 ]
%25 = tail call i32 @puts(i8* dereferenceable(1) %24)
br label %26
26: ; preds = %23, %20
%27 = phi i32 [ 1, %20 ], [ 0, %23 ]
ret i32 %27
}