#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*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, int *);
int /*<<< orphan*/ printf(char *);
void Verificar(char *nome) {
  int v1, v2, erro = 0;
  FILE *f = fopen(nome, "r");
  fscanf(f, "%d", &v1);
  while (!feof(f)) {
    fscanf(f, "%d", &v2);
    if (v2 < v1) {
      erro = 1;
      break;
    }
  }
  fclose(f);
  if (erro)
    printf("Valores fora de ordem!\n");
  else
    printf("Arquivo corretamente ordenado!\n");
}


x86 assembly (clang, -O0):
<Verificar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe92(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xe80(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   1050 <fscanf@plt>
mov    -0x20(%rbp),%rdi
call   1060 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    11a9 <Verificar+0x59>
jmp    11da <Verificar+0x8a>
mov    -0x20(%rbp),%rdi
lea    0xe4e(%rip),%rsi
lea    -0x10(%rbp),%rdx
call   1050 <fscanf@plt>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11d5 <Verificar+0x85>
movl   $0x1,-0x14(%rbp)
jmp    11da <Verificar+0x8a>
jmp    118b <Verificar+0x3b>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
cmpl   $0x0,-0x14(%rbp)
je     11fe <Verificar+0xae>
lea    0xe11(%rip),%rdi
call   1040 <printf@plt>
jmp    120a <Verificar+0xba>
lea    0xe18(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Verificar>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xe9c(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,%rbx
lea    0xe8f(%rip),%r15
lea    0xc(%rsp),%rdx
mov    %rax,%rdi
mov    %r15,%rsi
call   1050 <fscanf@plt>
lea    0xe7b(%rip),%r14
lea    0x8(%rsp),%r12
lea    0xe8e(%rip),%r13
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1060 <feof@plt>
test   %eax,%eax
jne    11c7 <Verificar+0x77>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1050 <fscanf@plt>
mov    0x8(%rsp),%eax
cmp    0xc(%rsp),%eax
jge    11a0 <Verificar+0x50>
mov    %r13,%r14
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [24 x i8] c"Valores fora de ordem!\0A\00"
@.str.3 = [32 x i8] c"Arquivo corretamente ordenado!\0A\00"
define void @Verificar(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
store i8* %0, i8** %2
store i32 0, i32* %5
%7 = load i8*, i8** %2
%8 = call i32* @fopen(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %8, i32** %6
%9 = load i32*, i32** %6
%10 = call i32 @fscanf(i32* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
br label %11
11: ; preds = %23, %1
%12 = load i32*, i32** %6
%13 = call i32 @feof(i32* %12)
%14 = icmp ne i32 %13, 0
%15 = xor i1 %14, true
br i1 %15, label %16, label %24
16: ; preds = %11
%17 = load i32*, i32** %6
%18 = call i32 @fscanf(i32* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%19 = load i32, i32* %4
%20 = load i32, i32* %3
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %23
22: ; preds = %16
store i32 1, i32* %5
br label %24
23: ; preds = %16
br label %11
24: ; preds = %22, %11
%25 = load i32*, i32** %6
%26 = call i32 @fclose(i32* %25)
%27 = load i32, i32* %5
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %24
%30 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
br label %33
31: ; preds = %24
%32 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
br label %33
33: ; preds = %31, %29
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [3 x i8] c"%d\00"
@str = [31 x i8] c"Arquivo corretamente ordenado!\00"
@str.4 = [23 x i8] c"Valores fora de ordem!\00"
define void @Verificar(i8* nocapture %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @fscanf(i32* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
br label %8
8: ; preds = %11, %1
%9 = call i32 @feof(i32* %6)
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %8
%12 = call i32 @fscanf(i32* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%13 = load i32, i32* %3
%14 = load i32, i32* %2
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %8
16: ; preds = %8, %11
%17 = phi i8* [ getelementptr inbounds ([23 x i8], [23 x i8]* @str.4, i64 0, i64 0), %11 ], [ getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0), %8 ]
%18 = call i32 @fclose(i32* %6)
%19 = call i32 @puts(i8* dereferenceable(1) %17)
ret void
}