#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*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int ej1() {
  int num1, num2, num3;
  printf("Ingresar tres números: \n");
  scanf("%d%d%d", &num1, &num2, &num3);
  if (((num1 < num2) && (num2 < num3)) || ((num3 < num2) && (num2 < num1))) {
    printf("%d es el valor central\n", num2);
  } else if (((num2 < num1) && (num1 < num3)) ||
             ((num3 < num1) && (num1 < num2))) {
    printf("%d es el valor central\n", num1);
  } else if (((num1 < num3) && (num3 < num2)) ||
             ((num2 < num3) && (num3 < num1))) {
    printf("%d es el valor central\n", num3);
  } else {
    printf("Algunos de los valores son iguales\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<ej1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
lea    -0xc(%rbp),%rcx
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1166 <ej1+0x46>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     117e <ej1+0x5e>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1194 <ej1+0x74>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1194 <ej1+0x74>
mov    -0x8(%rbp),%esi
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1238 <ej1+0x118>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11ac <ej1+0x8c>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     11c4 <ej1+0xa4>
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11da <ej1+0xba>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11da <ej1+0xba>
mov    -0x4(%rbp),%esi
lea    0xe53(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1233 <ej1+0x113>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11f2 <ej1+0xd2>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     120a <ej1+0xea>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1220 <ej1+0x100>
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1220 <ej1+0x100>
mov    -0xc(%rbp),%esi
lea    0xe0d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    122e <ej1+0x10e>
lea    0xe12(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1233 <ej1+0x113>
jmp    1238 <ej1+0x118>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ej1>:
sub    $0x18,%rsp
lea    0xee4(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb9(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1050 <scanf@plt>
mov    0x14(%rsp),%esi
mov    0x10(%rsp),%ecx
mov    0xc(%rsp),%eax
cmp    %ecx,%esi
jge    116f <ej1+0x3f>
cmp    %eax,%ecx
jl     1177 <ej1+0x47>
cmp    %ecx,%eax
jge    118e <ej1+0x5e>
cmp    %esi,%ecx
jge    118e <ej1+0x5e>
lea    0xe89(%rip),%rdi
mov    %ecx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret
cmp    %esi,%ecx
jge    1196 <ej1+0x66>
cmp    %eax,%esi
jl     119e <ej1+0x6e>
cmp    %esi,%eax
jge    11a7 <ej1+0x77>
cmp    %ecx,%esi
jge    11a7 <ej1+0x77>
lea    0xe62(%rip),%rdi
jmp    1180 <ej1+0x50>
cmp    %eax,%esi
jge    11af <ej1+0x7f>
cmp    %ecx,%eax
jl     11b7 <ej1+0x87>
cmp    %eax,%ecx
jge    11c2 <ej1+0x92>
cmp    %esi,%eax
jge    11c2 <ej1+0x92>
lea    0xe49(%rip),%rdi
mov    %eax,%esi
jmp    1180 <ej1+0x50>
lea    0xe6f(%rip),%rdi
call   1030 <puts@plt>
jmp    1187 <ej1+0x57>

LLVM IR (-O0):
@.str = [26 x i8] c"Ingresar tres n\C3\BAmeros: \0A\00"
@.str.1 = [7 x i8] c"%d%d%d\00"
@.str.2 = [24 x i8] c"%d es el valor central\0A\00"
@.str.3 = [36 x i8] c"Algunos de los valores son iguales\0A\00"
define i32 @ej1() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %13
9: ; preds = %0
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = icmp slt i32 %10, %11
br i1 %12, label %21, label %13
13: ; preds = %9, %0
%14 = load i32, i32* %3
%15 = load i32, i32* %2
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %24
17: ; preds = %13
%18 = load i32, i32* %2
%19 = load i32, i32* %1
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %24
21: ; preds = %17, %9
%22 = load i32, i32* %2
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %22)
br label %66
24: ; preds = %17, %13
%25 = load i32, i32* %2
%26 = load i32, i32* %1
%27 = icmp slt i32 %25, %26
br i1 %27, label %28, label %32
28: ; preds = %24
%29 = load i32, i32* %1
%30 = load i32, i32* %3
%31 = icmp slt i32 %29, %30
br i1 %31, label %40, label %32
32: ; preds = %28, %24
%33 = load i32, i32* %3
%34 = load i32, i32* %1
%35 = icmp slt i32 %33, %34
br i1 %35, label %36, label %43
36: ; preds = %32
%37 = load i32, i32* %1
%38 = load i32, i32* %2
%39 = icmp slt i32 %37, %38
br i1 %39, label %40, label %43
40: ; preds = %36, %28
%41 = load i32, i32* %1
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %41)
br label %65
43: ; preds = %36, %32
%44 = load i32, i32* %1
%45 = load i32, i32* %3
%46 = icmp slt i32 %44, %45
br i1 %46, label %47, label %51
47: ; preds = %43
%48 = load i32, i32* %3
%49 = load i32, i32* %2
%50 = icmp slt i32 %48, %49
br i1 %50, label %59, label %51
51: ; preds = %47, %43
%52 = load i32, i32* %2
%53 = load i32, i32* %3
%54 = icmp slt i32 %52, %53
br i1 %54, label %55, label %62
55: ; preds = %51
%56 = load i32, i32* %3
%57 = load i32, i32* %1
%58 = icmp slt i32 %56, %57
br i1 %58, label %59, label %62
59: ; preds = %55, %47
%60 = load i32, i32* %3
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %60)
br label %64
62: ; preds = %55, %51
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
br label %64
64: ; preds = %62, %59
br label %65
65: ; preds = %64, %40
br label %66
66: ; preds = %65, %21
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [7 x i8] c"%d%d%d\00"
@.str.2 = [24 x i8] c"%d es el valor central\0A\00"
@str = [25 x i8] c"Ingresar tres n\C3\BAmeros: \00"
@str.4 = [35 x i8] c"Algunos de los valores son iguales\00"
define i32 @ej1() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = icmp slt i32 %9, %10
%12 = load i32, i32* %3
%13 = icmp slt i32 %10, %12
%14 = select i1 %11, i1 %13, i1 false
br i1 %14, label %19, label %15
15: ; preds = %0
%16 = icmp slt i32 %12, %10
%17 = icmp slt i32 %10, %9
%18 = select i1 %16, i1 %17, i1 false
br i1 %18, label %19, label %21
19: ; preds = %15, %0
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %10)
br label %37
21: ; preds = %15
%22 = icmp slt i32 %9, %12
%23 = select i1 %17, i1 %22, i1 false
br i1 %23, label %27, label %24
24: ; preds = %21
%25 = icmp slt i32 %12, %9
%26 = select i1 %25, i1 %11, i1 false
br i1 %26, label %27, label %29
27: ; preds = %24, %21
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %9)
br label %37
29: ; preds = %24
%30 = select i1 %22, i1 %16, i1 false
br i1 %30, label %33, label %31
31: ; preds = %29
%32 = select i1 %13, i1 %25, i1 false
br i1 %32, label %33, label %35
33: ; preds = %31, %29
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %12)
br label %37
35: ; preds = %31
%36 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.4, i64 0, i64 0))
br label %37
37: ; preds = %27, %35, %33, %19
ret i32 0
}