#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 EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char **argv) {
  int i, num, max, min;
  int vector[50];
  do {
    printf("Quantos numero quieres introducir? ");
    scanf("%d", &num);
  } while (num < 1 || num > 50);
  printf("\nIntroduce los %d numeros enteros: ", num);
  scanf("%d", &vector[0]);
  max = min = vector[0];
  for (i = 1; i < num; i++) {
    printf("\nIntroduce numeros: ");
    scanf("%d", &vector[i]);
    if (vector[i] > max)
      max = vector[i];
    if (vector[i] < min)
      min = vector[i];
  }
  printf("\nMáximo: %d", max);
  printf("\nMínimo: %d", min);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf26(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
mov    $0x1,%al
cmpl   $0x1,-0x18(%rbp)
mov    %al,-0xf1(%rbp)
jl     1176 <main+0x56>
cmpl   $0x32,-0x18(%rbp)
setg   %al
mov    %al,-0xf1(%rbp)
mov    -0xf1(%rbp),%al
test   $0x1,%al
jne    1139 <main+0x19>
mov    -0x18(%rbp),%esi
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xf0(%rbp),%rsi
lea    0xed1(%rip),%rdi
call   1040 <scanf@plt>
mov    -0xf0(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    %eax,-0x1c(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    124a <main+0x12a>
lea    0xe7a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x14(%rbp),%rax
lea    -0xf0(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe86(%rip),%rdi
call   1040 <scanf@plt>
movslq -0x14(%rbp),%rax
mov    -0xf0(%rbp,%rax,4),%eax
cmp    -0x1c(%rbp),%eax
jle    1215 <main+0xf5>
movslq -0x14(%rbp),%rax
mov    -0xf0(%rbp,%rax,4),%eax
mov    %eax,-0x1c(%rbp)
movslq -0x14(%rbp),%rax
mov    -0xf0(%rbp,%rax,4),%eax
cmp    -0x20(%rbp),%eax
jge    1237 <main+0x117>
movslq -0x14(%rbp),%rax
mov    -0xf0(%rbp,%rax,4),%eax
mov    %eax,-0x20(%rbp)
jmp    123c <main+0x11c>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11bb <main+0x9b>
mov    -0x1c(%rbp),%esi
lea    0xe09(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%esi
lea    0xe05(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2d6d(%rip),%rax
mov    (%rax),%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xd8,%rsp
lea    0xec8(%rip),%r14
lea    0xf35(%rip),%rbp
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
lea    -0x33(%rsi),%eax
cmp    $0xffffffce,%eax
jb     1150 <main+0x30>
lea    0xeac(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeee(%rip),%rdi
lea    0x10(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x10(%rsp),%r14d
cmpl   $0x2,0xc(%rsp)
jl     11f9 <main+0xd9>
lea    0x14(%rsp),%rbx
mov    $0x1,%ebp
lea    0xe9b(%rip),%r15
lea    0xec0(%rip),%r12
mov    %r14d,%r13d
nopw   0x0(%rax,%rax,1)
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    (%rbx),%eax
cmp    %r13d,%eax
cmovg  %eax,%r13d
cmp    %r14d,%eax
cmovl  %eax,%r14d
add    $0x1,%rbp
movslq 0xc(%rsp),%rax
add    $0x4,%rbx
cmp    %rax,%rbp
jl     11c0 <main+0xa0>
jmp    11fc <main+0xdc>
mov    %r14d,%r13d
lea    0xe5a(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe56(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2dbb(%rip),%rax
mov    (%rax),%eax
add    $0xd8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [36 x i8] c"Quantos numero quieres introducir? \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [36 x i8] c"\0AIntroduce los %d numeros enteros: \00"
@.str.3 = [21 x i8] c"\0AIntroduce numeros: \00"
@.str.4 = [13 x i8] c"\0AM\C3\A1ximo: %d\00"
@.str.5 = [13 x i8] c"\0AM\C3\ADnimo: %d\00"
@EXIT_SUCCESS = global i32 0
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
%10 = alloca [50 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %11
11: ; preds = %20, %2
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 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* %7)
br label %14
14: ; preds = %11
%15 = load i32, i32* %7
%16 = icmp slt i32 %15, 1
br i1 %16, label %20, label %17
17: ; preds = %14
%18 = load i32, i32* %7
%19 = icmp sgt i32 %18, 50
br label %20
20: ; preds = %17, %14
%21 = phi i1 [ true, %14 ], [ %19, %17 ]
br i1 %21, label %11, label %22
22: ; preds = %20
%23 = load i32, i32* %7
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i32 %23)
%25 = getelementptr inbounds [50 x i32], [50 x i32]* %10, i64 0, i64 0
%26 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %25)
%27 = getelementptr inbounds [50 x i32], [50 x i32]* %10, i64 0, i64 0
%28 = load i32, i32* %27
store i32 %28, i32* %9
store i32 %28, i32* %8
store i32 1, i32* %6
br label %29
29: ; preds = %63, %22
%30 = load i32, i32* %6
%31 = load i32, i32* %7
%32 = icmp slt i32 %30, %31
br i1 %32, label %33, label %66
33: ; preds = %29
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%35 = load i32, i32* %6
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [50 x i32], [50 x i32]* %10, i64 0, i64 %36
%38 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %37)
%39 = load i32, i32* %6
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [50 x i32], [50 x i32]* %10, i64 0, i64 %40
%42 = load i32, i32* %41
%43 = load i32, i32* %8
%44 = icmp sgt i32 %42, %43
br i1 %44, label %45, label %50
45: ; preds = %33
%46 = load i32, i32* %6
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [50 x i32], [50 x i32]* %10, i64 0, i64 %47
%49 = load i32, i32* %48
store i32 %49, i32* %8
br label %50
50: ; preds = %45, %33
%51 = load i32, i32* %6
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds [50 x i32], [50 x i32]* %10, i64 0, i64 %52
%54 = load i32, i32* %53
%55 = load i32, i32* %9
%56 = icmp slt i32 %54, %55
br i1 %56, label %57, label %62
57: ; preds = %50
%58 = load i32, i32* %6
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [50 x i32], [50 x i32]* %10, i64 0, i64 %59
%61 = load i32, i32* %60
store i32 %61, i32* %9
br label %62
62: ; preds = %57, %50
br label %63
63: ; preds = %62
%64 = load i32, i32* %6
%65 = add nsw i32 %64, 1
store i32 %65, i32* %6
br label %29
66: ; preds = %29
%67 = load i32, i32* %8
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 %67)
%69 = load i32, i32* %9
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i32 %69)
%71 = load i32, i32* @EXIT_SUCCESS
ret i32 %71
}

LLVM IR (-O2):
@.str = [36 x i8] c"Quantos numero quieres introducir? \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [36 x i8] c"\0AIntroduce los %d numeros enteros: \00"
@.str.3 = [21 x i8] c"\0AIntroduce numeros: \00"
@.str.4 = [13 x i8] c"\0AM\C3\A1ximo: %d\00"
@.str.5 = [13 x i8] c"\0AM\C3\ADnimo: %d\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca [50 x i32]
%5 = bitcast i32* %3 to i8*
%6 = bitcast [50 x i32]* %4 to i8*
br label %7
7: ; preds = %7, %2
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%10 = load i32, i32* %3
%11 = add i32 %10, -51
%12 = icmp ult i32 %11, -50
br i1 %12, label %7, label %13
13: ; preds = %7
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i32 %10)
%15 = getelementptr inbounds [50 x i32], [50 x i32]* %4, i64 0, i64 0
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %15)
%17 = load i32, i32* %15
%18 = load i32, i32* %3
%19 = icmp sgt i32 %18, 1
br i1 %19, label %20, label %36
20: ; preds = %13, %20
%21 = phi i64 [ %32, %20 ], [ 1, %13 ]
%22 = phi i32 [ %31, %20 ], [ %17, %13 ]
%23 = phi i32 [ %29, %20 ], [ %17, %13 ]
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%25 = getelementptr inbounds [50 x i32], [50 x i32]* %4, i64 0, i64 %21
%26 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %25)
%27 = load i32, i32* %25
%28 = icmp sgt i32 %27, %23
%29 = select i1 %28, i32 %27, i32 %23
%30 = icmp slt i32 %27, %22
%31 = select i1 %30, i32 %27, i32 %22
%32 = add nuw nsw i64 %21, 1
%33 = load i32, i32* %3
%34 = sext i32 %33 to i64
%35 = icmp slt i64 %32, %34
br i1 %35, label %20, label %36
36: ; preds = %20, %13
%37 = phi i32 [ %17, %13 ], [ %29, %20 ]
%38 = phi i32 [ %17, %13 ], [ %31, %20 ]
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 %37)
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i32 %38)
%41 = load i32, i32* @EXIT_SUCCESS
ret i32 %41
}