#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_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ stderr;
int isSane(int *a, int n) {
  int flag = 0, m;
  for (m = 1; m < n; m++) {
    if (a[m - 1] > a[m]) {
      int j;
      puts("");
      for (j = m - 3; j < m + 3; j++) {
        printf("%d ", a[j]);
      }
      flag = 1;
    }
  }
  if (flag) {
    fprintf(stderr, "ERROR! Data not sorted!!!\n");
    return EXIT_FAILURE;
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<isSane>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11df <isSane+0xaf>
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x10(%rbp),%rcx
movslq -0x1c(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jle    11cc <isSane+0x9c>
lea    0xe9d(%rip),%rdi
call   1030 <puts@plt>
mov    -0x1c(%rbp),%eax
sub    $0x3,%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    -0x1c(%rbp),%ecx
add    $0x3,%ecx
cmp    %ecx,%eax
jge    11c5 <isSane+0x95>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe4e(%rip),%rdi
call   1040 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    118f <isSane+0x5f>
movl   $0x1,-0x18(%rbp)
jmp    11d1 <isSane+0xa1>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    114d <isSane+0x1d>
cmpl   $0x0,-0x18(%rbp)
je     120f <isSane+0xdf>
mov    0x2df0(%rip),%rax
mov    (%rax),%edi
lea    0xe0b(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2dd3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    121b <isSane+0xeb>
mov    0x2dba(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSane>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    0x2e8e(%rip),%rax
cmp    $0x2,%esi
jl     1216 <isSane+0xe6>
mov    %rdi,%r13
mov    %esi,%r12d
xor    %eax,%eax
mov    $0xfffffffffffffffe,%rbp
mov    $0x1,%ebx
lea    0xe9a(%rip),%r14
jmp    11dd <isSane+0xad>
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x0(%r13,%rbp,4),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
lea    0x1(%rbp),%r15
mov    0x4(%r13,%rbp,4),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
mov    0x8(%r13,%rbp,4),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
mov    0xc(%r13,%rbp,4),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
mov    0x10(%r13,%rbp,4),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
mov    0x14(%r13,%rbp,4),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
mov    $0x1,%eax
mov    %r15,%rbp
add    $0x1,%rbx
cmp    %rbx,%r12
je     11ef <isSane+0xbf>
mov    -0x4(%r13,%rbx,4),%ecx
cmp    0x0(%r13,%rbx,4),%ecx
jg     1170 <isSane+0x40>
add    $0x1,%rbp
jmp    11d4 <isSane+0xa4>
test   %eax,%eax
mov    0x2dd8(%rip),%rax
je     1216 <isSane+0xe6>
mov    0x2ddf(%rip),%rax
mov    (%rax),%edi
lea    0xdfa(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2dc2(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [4 x i8] c"%d \00"
@stderr = global i32 0
@.str.2 = [27 x i8] c"ERROR! Data not sorted!!!\0A\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @isSane(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 0, i32* %6
store i32 1, i32* %7
br label %9
9: ; preds = %47, %2
%10 = load i32, i32* %7
%11 = load i32, i32* %5
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %50
13: ; preds = %9
%14 = load i32*, i32** %4
%15 = load i32, i32* %7
%16 = sub nsw i32 %15, 1
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %14, i64 %17
%19 = load i32, i32* %18
%20 = load i32*, i32** %4
%21 = load i32, i32* %7
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i32, i32* %20, i64 %22
%24 = load i32, i32* %23
%25 = icmp sgt i32 %19, %24
br i1 %25, label %26, label %46
26: ; preds = %13
%27 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%28 = load i32, i32* %7
%29 = sub nsw i32 %28, 3
store i32 %29, i32* %8
br label %30
30: ; preds = %42, %26
%31 = load i32, i32* %8
%32 = load i32, i32* %7
%33 = add nsw i32 %32, 3
%34 = icmp slt i32 %31, %33
br i1 %34, label %35, label %45
35: ; preds = %30
%36 = load i32*, i32** %4
%37 = load i32, i32* %8
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i32, i32* %36, i64 %38
%40 = load i32, i32* %39
%41 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %40)
br label %42
42: ; preds = %35
%43 = load i32, i32* %8
%44 = add nsw i32 %43, 1
store i32 %44, i32* %8
br label %30
45: ; preds = %30
store i32 1, i32* %6
br label %46
46: ; preds = %45, %13
br label %47
47: ; preds = %46
%48 = load i32, i32* %7
%49 = add nsw i32 %48, 1
store i32 %49, i32* %7
br label %9
50: ; preds = %9
%51 = load i32, i32* %6
%52 = icmp ne i32 %51, 0
br i1 %52, label %53, label %57
53: ; preds = %50
%54 = load i32, i32* @stderr
%55 = call i32 @fprintf(i32 %54, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%56 = load i32, i32* @EXIT_FAILURE
store i32 %56, i32* %3
br label %59
57: ; preds = %50
%58 = load i32, i32* @EXIT_SUCCESS
store i32 %58, i32* %3
br label %59
59: ; preds = %57, %53
%60 = load i32, i32* %3
ret i32 %60
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%d \00"
@stderr = global i32 0
@.str.2 = [27 x i8] c"ERROR! Data not sorted!!!\0A\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @isSane(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %53
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %43
%7 = phi i64 [ 1, %4 ], [ %46, %43 ]
%8 = phi i64 [ -2, %4 ], [ %44, %43 ]
%9 = phi i32 [ 0, %4 ], [ %45, %43 ]
%10 = add nsw i64 %7, -1
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = getelementptr inbounds i32, i32* %0, i64 %7
%14 = load i32, i32* %13
%15 = icmp sgt i32 %12, %14
br i1 %15, label %18, label %16
16: ; preds = %6
%17 = add nsw i64 %8, 1
br label %43
18: ; preds = %6
%19 = tail call i32 @putchar(i32 10)
%20 = getelementptr inbounds i32, i32* %0, i64 %8
%21 = load i32, i32* %20
%22 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %21)
%23 = add nsw i64 %8, 1
%24 = getelementptr inbounds i32, i32* %0, i64 %23
%25 = load i32, i32* %24
%26 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %25)
%27 = add nsw i64 %8, 2
%28 = getelementptr inbounds i32, i32* %0, i64 %27
%29 = load i32, i32* %28
%30 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %29)
%31 = add nsw i64 %8, 3
%32 = getelementptr inbounds i32, i32* %0, i64 %31
%33 = load i32, i32* %32
%34 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %33)
%35 = add nsw i64 %8, 4
%36 = getelementptr inbounds i32, i32* %0, i64 %35
%37 = load i32, i32* %36
%38 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %37)
%39 = add nsw i64 %8, 5
%40 = getelementptr inbounds i32, i32* %0, i64 %39
%41 = load i32, i32* %40
%42 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %41)
br label %43
43: ; preds = %16, %18
%44 = phi i64 [ %17, %16 ], [ %23, %18 ]
%45 = phi i32 [ %9, %16 ], [ 1, %18 ]
%46 = add nuw nsw i64 %7, 1
%47 = icmp eq i64 %46, %5
br i1 %47, label %48, label %6
48: ; preds = %43
%49 = icmp eq i32 %45, 0
br i1 %49, label %53, label %50
50: ; preds = %48
%51 = load i32, i32* @stderr
%52 = tail call i32 @fprintf(i32 %51, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
br label %53
53: ; preds = %2, %48, %50
%54 = phi i32* [ @EXIT_FAILURE, %50 ], [ @EXIT_SUCCESS, %48 ], [ @EXIT_SUCCESS, %2 ]
%55 = load i32, i32* %54
ret i32 %55
}