#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 greater_value(int, int);
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, int *);
int smaller_value(int, int);
int main(int argc, const char *argv[]) {
  int num, cont, maior, menor;
  puts("Informe um numero:");
  scanf("%d", &num);
  maior = num;
  menor = num;
  for (cont = 1; cont <= 49; cont++) {
    puts("Informe um numero:");
    scanf("%d", &num);
    maior = greater_value(maior, num);
    menor = smaller_value(menor, num);
  }
  printf("O maior valor é %d e o menor valor é %d", maior, menor);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe93(%rip),%rdi
call   1030 <puts@plt>
lea    0xec1(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1070 <scanf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
movl   $0x1,-0x18(%rbp)
cmpl   $0x31,-0x18(%rbp)
jg     11e5 <main+0x95>
lea    0xe5a(%rip),%rdi
call   1030 <puts@plt>
lea    0xe88(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1070 <scanf@plt>
mov    -0x1c(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1040 <greater_value@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x20(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1060 <smaller_value@plt>
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1195 <main+0x45>
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
lea    0xe21(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xe9e(%rip),%r14
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%r15
lea    0x4(%rsp),%r12
mov    %r15,%rdi
mov    %r12,%rsi
call   1070 <scanf@plt>
mov    $0x31,%ebx
mov    0x4(%rsp),%r13d
mov    %r13d,%ebp
xchg   %ax,%ax
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1070 <scanf@plt>
mov    0x4(%rsp),%esi
mov    %ebp,%edi
call   1040 <greater_value@plt>
mov    %eax,%ebp
mov    0x4(%rsp),%esi
mov    %r13d,%edi
call   1060 <smaller_value@plt>
mov    %eax,%r13d
add    $0xffffffff,%ebx
jne    1190 <main+0x40>
lea    0xe48(%rip),%rdi
mov    %ebp,%esi
mov    %r13d,%edx
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Informe um numero:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [42 x i8] c"O maior valor \C3\A9 %d e o menor valor \C3\A9 %d\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = call i32 @puts(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%12 = load i32, i32* %6
store i32 %12, i32* %8
%13 = load i32, i32* %6
store i32 %13, i32* %9
store i32 1, i32* %7
br label %14
14: ; preds = %26, %2
%15 = load i32, i32* %7
%16 = icmp sle i32 %15, 49
br i1 %16, label %17, label %29
17: ; preds = %14
%18 = call i32 @puts(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%20 = load i32, i32* %8
%21 = load i32, i32* %6
%22 = call i32 @greater_value(i32 %20, i32 %21)
store i32 %22, i32* %8
%23 = load i32, i32* %9
%24 = load i32, i32* %6
%25 = call i32 @smaller_value(i32 %23, i32 %24)
store i32 %25, i32* %9
br label %26
26: ; preds = %17
%27 = load i32, i32* %7
%28 = add nsw i32 %27, 1
store i32 %28, i32* %7
br label %14
29: ; preds = %14
%30 = load i32, i32* %8
%31 = load i32, i32* %9
%32 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), i32 %30, i32 %31)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"Informe um numero:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [42 x i8] c"O maior valor \C3\A9 %d e o menor valor \C3\A9 %d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
br label %8
8: ; preds = %2, %8
%9 = phi i32 [ %7, %2 ], [ %17, %8 ]
%10 = phi i32 [ %7, %2 ], [ %15, %8 ]
%11 = phi i32 [ 1, %2 ], [ %18, %8 ]
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%14 = load i32, i32* %3
%15 = call i32 @greater_value(i32 %10, i32 %14)
%16 = load i32, i32* %3
%17 = call i32 @smaller_value(i32 %9, i32 %16)
%18 = add nuw nsw i32 %11, 1
%19 = icmp eq i32 %18, 50
br i1 %19, label %20, label %8
20: ; preds = %8
%21 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), i32 %15, i32 %17)
ret i32 0
}