#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 abs(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n[3], i, menor;
  for (i = 0; i < 3; i++) {
    printf("Ingrese el %der numero: ", i + 1);
    scanf("%d", &(n[i]));
  }
  int cumple = 1;
  i = 0;
  while (cumple && i < 3 - 1) {
    cumple = (abs(n[i] - n[++i]) == 1);
  }
  printf("La lista %s esta ordenada", (cumple ? "SI" : "NO"));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
jge    118d <main+0x5d>
mov    -0x14(%rbp),%esi
add    $0x1,%esi
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movslq -0x14(%rbp),%rax
lea    -0x10(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe9f(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1146 <main+0x16>
movl   $0x1,-0x1c(%rbp)
movl   $0x0,-0x14(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x1c(%rbp)
mov    %al,-0x1d(%rbp)
je     11b4 <main+0x84>
cmpl   $0x2,-0x14(%rbp)
setl   %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
test   $0x1,%al
jne    11c4 <main+0x94>
jmp    11f3 <main+0xc3>
movslq -0x14(%rbp),%rax
mov    -0x10(%rbp,%rax,4),%edi
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
cltq
sub    -0x10(%rbp,%rax,4),%edi
call   1030 <abs@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
jmp    119b <main+0x6b>
mov    -0x1c(%rbp),%ecx
lea    0xe3c(%rip),%rsi
lea    0xe32(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0xe0a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xed2(%rip),%r14
mov    %r14,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed5(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    %r14,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    %r14,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%ecx
mov    0x10(%rsp),%eax
sub    %eax,%ecx
mov    %ecx,%edx
neg    %edx
cmovs  %ecx,%edx
cmp    $0x1,%edx
sete   %cl
jne    11b3 <main+0x93>
sub    0x14(%rsp),%eax
mov    %eax,%ecx
neg    %ecx
cmovs  %eax,%ecx
cmp    $0x1,%ecx
sete   %cl
lea    0xe7c(%rip),%rax
lea    0xe78(%rip),%rsi
test   %cl,%cl
cmovne %rax,%rsi
lea    0xe4e(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Ingrese el %der numero: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [26 x i8] c"La lista %s esta ordenada\00"
@.str.3 = [3 x i8] c"SI\00"
@.str.4 = [3 x i8] c"NO\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %6
6: ; preds = %17, %0
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 3
br i1 %8, label %9, label %20
9: ; preds = %6
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 %14
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %15)
br label %17
17: ; preds = %9
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %6
20: ; preds = %6
store i32 1, i32* %5
store i32 0, i32* %3
br label %21
21: ; preds = %29, %20
%22 = load i32, i32* %5
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %27
24: ; preds = %21
%25 = load i32, i32* %3
%26 = icmp slt i32 %25, 2
br label %27
27: ; preds = %24, %21
%28 = phi i1 [ false, %21 ], [ %26, %24 ]
br i1 %28, label %29, label %43
29: ; preds = %27
%30 = load i32, i32* %3
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 %31
%33 = load i32, i32* %32
%34 = load i32, i32* %3
%35 = add nsw i32 %34, 1
store i32 %35, i32* %3
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 %36
%38 = load i32, i32* %37
%39 = sub nsw i32 %33, %38
%40 = call i32 @abs(i32 %39)
%41 = icmp eq i32 %40, 1
%42 = zext i1 %41 to i32
store i32 %42, i32* %5
br label %21
43: ; preds = %27
%44 = load i32, i32* %5
%45 = icmp ne i32 %44, 0
%46 = zext i1 %45 to i64
%47 = select i1 %45, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0)
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8* %47)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"Ingrese el %der numero: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [26 x i8] c"La lista %s esta ordenada\00"
@.str.3 = [3 x i8] c"SI\00"
@.str.4 = [3 x i8] c"NO\00"
define i32 @main() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 2)
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 1
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 3)
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 2
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %10)
%12 = load i32, i32* %4
%13 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 1
%14 = load i32, i32* %13
%15 = sub nsw i32 %12, %14
%16 = call i32 @llvm.abs.i32(i32 %15, i1 true)
%17 = icmp eq i32 %16, 1
br i1 %17, label %18, label %24
18: ; preds = %0
%19 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 2
%20 = load i32, i32* %19
%21 = sub nsw i32 %14, %20
%22 = call i32 @llvm.abs.i32(i32 %21, i1 true)
%23 = icmp eq i32 %22, 1
br label %24
24: ; preds = %18, %0
%25 = phi i1 [ %17, %0 ], [ %23, %18 ]
%26 = select i1 %25, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0)
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8* %26)
ret i32 0
}