#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 *);
void main() {
  int a, b, c, meio;
  printf("Digite 3 inteiros distintos: ");
  scanf("%d %d %d", &a, &b, &c);
  if ((a > b && a < c) || (a < b && a > c))
    meio = a;
  else if ((b > a && b < c) || (b < a && b > c))
    meio = b;
  else
    meio = c;
  printf("O numero do meio eh o %d\n", meio);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee1(%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
jle    1166 <main+0x46>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     117e <main+0x5e>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1189 <main+0x69>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1189 <main+0x69>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    11cf <main+0xaf>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jle    11a1 <main+0x81>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     11b9 <main+0x99>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11c4 <main+0xa4>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    11c4 <main+0xa4>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    11ca <main+0xaa>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    11cf <main+0xaf>
mov    -0x10(%rbp),%esi
lea    0xe4e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
lea    0xc(%rsp),%rbx
lea    0x4(%rsp),%r15
lea    0x8(%rsp),%r14
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
mov    0x4(%rsp),%ecx
mov    0x8(%rsp),%edx
cmp    %ecx,%eax
jle    116f <main+0x4f>
cmp    %edx,%eax
jl     1193 <main+0x73>
cmp    %ecx,%eax
jge    1177 <main+0x57>
cmp    %edx,%eax
jg     1193 <main+0x73>
cmp    %ecx,%eax
jge    1182 <main+0x62>
mov    %r15,%rbx
cmp    %edx,%ecx
jl     1193 <main+0x73>
cmp    %edx,%ecx
lea    0x4(%rsp),%rbx
cmovle %r14,%rbx
cmp    %ecx,%eax
cmovle %r14,%rbx
mov    (%rbx),%esi
lea    0xe8b(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Digite 3 inteiros distintos: \00"
@.str.1 = [9 x i8] c"%d %d %d\00"
@.str.2 = [26 x i8] c"O numero do meio eh o %d\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = icmp sgt i32 %7, %8
br i1 %9, label %10, label %14
10: ; preds = %0
%11 = load i32, i32* %1
%12 = load i32, i32* %3
%13 = icmp slt i32 %11, %12
br i1 %13, label %22, label %14
14: ; preds = %10, %0
%15 = load i32, i32* %1
%16 = load i32, i32* %2
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %24
18: ; preds = %14
%19 = load i32, i32* %1
%20 = load i32, i32* %3
%21 = icmp sgt i32 %19, %20
br i1 %21, label %22, label %24
22: ; preds = %18, %10
%23 = load i32, i32* %1
store i32 %23, i32* %4
br label %45
24: ; preds = %18, %14
%25 = load i32, i32* %2
%26 = load i32, i32* %1
%27 = icmp sgt i32 %25, %26
br i1 %27, label %28, label %32
28: ; preds = %24
%29 = load i32, i32* %2
%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* %2
%34 = load i32, i32* %1
%35 = icmp slt i32 %33, %34
br i1 %35, label %36, label %42
36: ; preds = %32
%37 = load i32, i32* %2
%38 = load i32, i32* %3
%39 = icmp sgt i32 %37, %38
br i1 %39, label %40, label %42
40: ; preds = %36, %28
%41 = load i32, i32* %2
store i32 %41, i32* %4
br label %44
42: ; preds = %36, %32
%43 = load i32, i32* %3
store i32 %43, i32* %4
br label %44
44: ; preds = %42, %40
br label %45
45: ; preds = %44, %22
%46 = load i32, i32* %4
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %46)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"Digite 3 inteiros distintos: \00"
@.str.1 = [9 x i8] c"%d %d %d\00"
@.str.2 = [26 x i8] c"O numero do meio eh o %d\0A\00"
define void @main() {
%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 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 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 sgt i32 %9, %10
%12 = load i32, i32* %3
%13 = icmp slt i32 %9, %12
%14 = select i1 %11, i1 %13, i1 false
br i1 %14, label %26, label %15
15: ; preds = %0
%16 = icmp slt i32 %9, %10
%17 = icmp sgt i32 %9, %12
%18 = select i1 %16, i1 %17, i1 false
br i1 %18, label %26, label %19
19: ; preds = %15
%20 = icmp slt i32 %10, %12
%21 = select i1 %16, i1 %20, i1 false
br i1 %21, label %26, label %22
22: ; preds = %19
%23 = icmp sgt i32 %10, %12
%24 = select i1 %11, i1 %23, i1 false
%25 = select i1 %24, i32* %2, i32* %3
br label %26
26: ; preds = %22, %19, %0, %15
%27 = phi i32* [ %1, %15 ], [ %1, %0 ], [ %2, %19 ], [ %25, %22 ]
%28 = load i32, i32* %27
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %28)
ret void
}