#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 main() {
  int n1 = 0, n3 = 0, n2 = 0, crescente = 0, i = 0;
  printf("N1: ");
  scanf("%d", &n1);
  printf("N2: ");
  scanf("%d", &n2);
  if (n1 > n2) {
    i = 1;
  }
  printf("N3: ");
  scanf("%d", &n3);
  if (n3 < n2 && i == 1) {
    printf("%d %d %d\n", n3, n2, n1);
  } else if (n3 > n2 && i == 1) {
    printf("%d %d %d\n", n2, n1, n3);
  } else if (n3 < n1) {
    printf("%d %d %d\n", n3, n1, n2);
  } else if (n3 < n2 && i == 0) {
    printf("%d %d %d\n", n1, n3, n2);
  } else {
    printf("%d %d %d\n", n1, n2, n3);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe9e(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe80(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    11a1 <main+0x81>
movl   $0x1,-0x18(%rbp)
lea    0xe65(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe4f(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11f1 <main+0xd1>
cmpl   $0x1,-0x18(%rbp)
jne    11f1 <main+0xd1>
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xe2d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12a3 <main+0x183>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1223 <main+0x103>
cmpl   $0x1,-0x18(%rbp)
jne    1223 <main+0x103>
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xdfb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    129e <main+0x17e>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    124b <main+0x12b>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xdd3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1299 <main+0x179>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    127d <main+0x15d>
cmpl   $0x0,-0x18(%rbp)
jne    127d <main+0x15d>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xda1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1294 <main+0x174>
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xd85(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1299 <main+0x179>
jmp    129e <main+0x17e>
jmp    12a3 <main+0x183>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
movl   $0x0,0xc(%rsp)
movl   $0x0,0x14(%rsp)
movl   $0x0,0x10(%rsp)
lea    0xeb7(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeae(%rip),%r15
lea    0xc(%rsp),%rsi
mov    %r15,%rdi
call   1040 <scanf@plt>
lea    0xe9d(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x10(%rsp),%rsi
mov    %r15,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%ebp
mov    0x10(%rsp),%ebx
cmp    %ebx,%ebp
setle  %r14b
lea    0xe79(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x14(%rsp),%rsi
mov    %r15,%rdi
call   1040 <scanf@plt>
mov    0x14(%rsp),%eax
mov    0x10(%rsp),%r8d
cmp    %r8d,%eax
jge    11cc <main+0xac>
cmp    %ebx,%ebp
jle    11cc <main+0xac>
mov    0xc(%rsp),%ecx
lea    0xe4d(%rip),%rdi
mov    %eax,%esi
mov    %r8d,%edx
jmp    121a <main+0xfa>
mov    0xc(%rsp),%edx
cmp    %r8d,%eax
jle    11e5 <main+0xc5>
cmp    %ebx,%ebp
jle    11e5 <main+0xc5>
lea    0xe32(%rip),%rdi
mov    %r8d,%esi
jmp    1218 <main+0xf8>
cmp    %edx,%eax
jge    11f7 <main+0xd7>
lea    0xe22(%rip),%rdi
mov    %eax,%esi
mov    %r8d,%ecx
jmp    121a <main+0xfa>
cmp    %r8d,%eax
setl   %cl
and    %r14b,%cl
lea    0xe0b(%rip),%rdi
mov    %edx,%esi
cmp    $0x1,%cl
jne    1215 <main+0xf5>
mov    %eax,%edx
mov    %r8d,%ecx
jmp    121a <main+0xfa>
mov    %r8d,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"N1: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [5 x i8] c"N2: \00"
@.str.3 = [5 x i8] c"N3: \00"
@.str.4 = [10 x i8] c"%d %d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%5 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%6 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%11 = load i32, i32* %1
%12 = load i32, i32* %3
%13 = icmp sgt i32 %11, %12
%14 = xor i1 %13, true
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%17 = load i32, i32* %2
%18 = load i32, i32* %3
%19 = icmp slt i32 %17, %18
%20 = select i1 %19, i1 %13, i1 false
br i1 %20, label %21, label %24
21: ; preds = %0
%22 = load i32, i32* %1
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %17, i32 %18, i32 %22)
br label %40
24: ; preds = %0
%25 = icmp sgt i32 %17, %18
%26 = select i1 %25, i1 %13, i1 false
%27 = load i32, i32* %1
br i1 %26, label %28, label %30
28: ; preds = %24
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %18, i32 %27, i32 %17)
br label %40
30: ; preds = %24
%31 = icmp slt i32 %17, %27
br i1 %31, label %32, label %34
32: ; preds = %30
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %17, i32 %27, i32 %18)
br label %40
34: ; preds = %30
%35 = select i1 %19, i1 %14, i1 false
br i1 %35, label %36, label %38
36: ; preds = %34
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %27, i32 %17, i32 %18)
br label %40
38: ; preds = %34
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %27, i32 %18, i32 %17)
br label %40
40: ; preds = %28, %36, %38, %32, %21
ret i32 0
}