#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 a[101], i, t, x;
  scanf("%d", &t);
  printf("Lumberjacks:\n");
  while (t--) {
    x = 0;
    for (i = 0; i < 10; i++) {
      scanf("%d", &a[i]);
    }
    if (a[0] > a[1]) {
      for (i = 1; i < 10; i++) {
        if (a[i - 1] > a[i]) {
          x = x;
        } else {
          x++;
        }
      }
      if (x == 0) {
        printf("Ordered\n");
      } else {
        printf("Unordered\n");
      }
    } else if (a[0] < a[1]) {
      for (i = 1; i < 10; i++) {
        if (a[i - 1] < a[i]) {
          x = x;
        } else {
          x++;
        }
      }
      if (x == 0) {
        printf("Ordered\n");
      } else {
        printf("Unordered\n");
      }
    } else {
      printf("Unordered\n");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec7(%rip),%rdi
lea    -0x1a8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1a8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x1a8(%rbp)
cmp    $0x0,%eax
je     1345 <main+0x225>
movl   $0x0,-0x1ac(%rbp)
movl   $0x0,-0x1a4(%rbp)
cmpl   $0xa,-0x1a4(%rbp)
jge    11c1 <main+0xa1>
movslq -0x1a4(%rbp),%rax
lea    -0x1a0(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe58(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x1a4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1a4(%rbp)
jmp    117f <main+0x5f>
mov    -0x1a0(%rbp),%eax
cmp    -0x19c(%rbp),%eax
jle    1278 <main+0x158>
movl   $0x1,-0x1a4(%rbp)
cmpl   $0xa,-0x1a4(%rbp)
jge    1249 <main+0x129>
mov    -0x1a4(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0x1a0(%rbp,%rax,4),%eax
movslq -0x1a4(%rbp),%rcx
cmp    -0x1a0(%rbp,%rcx,4),%eax
jle    1221 <main+0x101>
mov    -0x1ac(%rbp),%eax
mov    %eax,-0x1ac(%rbp)
jmp    1230 <main+0x110>
mov    -0x1ac(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1ac(%rbp)
jmp    1235 <main+0x115>
mov    -0x1a4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1a4(%rbp)
jmp    11dd <main+0xbd>
cmpl   $0x0,-0x1ac(%rbp)
jne    1267 <main+0x147>
lea    0xdb4(%rip),%rdi
call   1030 <printf@plt>
jmp    1273 <main+0x153>
lea    0xdac(%rip),%rdi
call   1030 <printf@plt>
jmp    1340 <main+0x220>
mov    -0x1a0(%rbp),%eax
cmp    -0x19c(%rbp),%eax
jge    132f <main+0x20f>
movl   $0x1,-0x1a4(%rbp)
cmpl   $0xa,-0x1a4(%rbp)
jge    1300 <main+0x1e0>
mov    -0x1a4(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0x1a0(%rbp,%rax,4),%eax
movslq -0x1a4(%rbp),%rcx
cmp    -0x1a0(%rbp,%rcx,4),%eax
jge    12d8 <main+0x1b8>
mov    -0x1ac(%rbp),%eax
mov    %eax,-0x1ac(%rbp)
jmp    12e7 <main+0x1c7>
mov    -0x1ac(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1ac(%rbp)
jmp    12ec <main+0x1cc>
mov    -0x1a4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1a4(%rbp)
jmp    1294 <main+0x174>
cmpl   $0x0,-0x1ac(%rbp)
jne    131e <main+0x1fe>
lea    0xcfd(%rip),%rdi
call   1030 <printf@plt>
jmp    132a <main+0x20a>
lea    0xcf5(%rip),%rdi
call   1030 <printf@plt>
jmp    133b <main+0x21b>
lea    0xce4(%rip),%rdi
call   1030 <printf@plt>
jmp    1340 <main+0x220>
jmp    1151 <main+0x31>
xor    %eax,%eax
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1a8,%rsp
lea    0xec8(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
subl   $0x1,0xc(%rsp)
jae    1169 <main+0x49>
xor    %eax,%eax
add    $0x1a8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x30(%rsp),%r15
lea    0x34(%rsp),%r12
lea    0xe86(%rip),%r13
lea    0x10(%rsp),%r14
lea    0xe8a(%rip),%rbp
jmp    1230 <main+0x110>
nopl   0x0(%rax,%rax,1)
movdqu 0x18(%rsp),%xmm0
movd   %eax,%xmm1
punpcklqdq %xmm0,%xmm1
shufps $0x98,%xmm0,%xmm1
mov    0x28(%rsp),%edx
pshufd $0xff,%xmm0,%xmm2
movd   %xmm2,%ecx
xor    %eax,%eax
cmp    %edx,%ecx
setle  %al
mov    0x2c(%rsp),%edi
xor    %ecx,%ecx
cmp    %edi,%edx
setle  %cl
mov    0x30(%rsp),%edx
xor    %esi,%esi
cmp    %edx,%edi
setle  %sil
pcmpgtd %xmm0,%xmm1
movmskps %xmm1,%edi
xor    $0xf,%edi
mov    %edi,%ebx
shr    %bl
and    $0x5,%bl
sub    %bl,%dil
mov    %edi,%ebx
and    $0x33,%bl
shr    $0x2,%dil
and    $0x33,%dil
add    %bl,%dil
mov    %edi,%ebx
shr    $0x4,%bl
add    %dil,%bl
and    $0xf,%bl
movzbl %bl,%edi
add    %eax,%edi
add    %ecx,%edi
add    %esi,%edi
xor    %eax,%eax
cmp    0x34(%rsp),%edx
setle  %al
neg    %eax
cmp    %eax,%edi
mov    %rbp,%rdi
lea    0xdfe(%rip),%rax
cmove  %rax,%rdi
call   1030 <puts@plt>
subl   $0x1,0xc(%rsp)
jb     1155 <main+0x35>
mov    %r13,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
mov    %r13,%rdi
lea    0x14(%rsp),%rsi
call   1040 <scanf@plt>
mov    %r13,%rdi
lea    0x18(%rsp),%rsi
call   1040 <scanf@plt>
mov    %r13,%rdi
lea    0x1c(%rsp),%rsi
call   1040 <scanf@plt>
mov    %r13,%rdi
lea    0x20(%rsp),%rsi
call   1040 <scanf@plt>
mov    %r13,%rdi
lea    0x24(%rsp),%rsi
call   1040 <scanf@plt>
mov    %r13,%rdi
lea    0x28(%rsp),%rsi
call   1040 <scanf@plt>
mov    %r13,%rdi
lea    0x2c(%rsp),%rsi
call   1040 <scanf@plt>
mov    %r13,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
mov    %r13,%rdi
mov    %r12,%rsi
call   1040 <scanf@plt>
mov    0x14(%rsp),%eax
cmp    %eax,0x10(%rsp)
jg     1190 <main+0x70>
mov    %rbp,%rdi
jge    1220 <main+0x100>
movdqu 0x18(%rsp),%xmm0
movd   %eax,%xmm1
punpcklqdq %xmm0,%xmm1
shufps $0x98,%xmm0,%xmm1
mov    0x28(%rsp),%edx
pshufd $0xff,%xmm0,%xmm2
movd   %xmm2,%ecx
xor    %eax,%eax
cmp    %edx,%ecx
setge  %al
mov    0x2c(%rsp),%edi
xor    %ecx,%ecx
cmp    %edi,%edx
setge  %cl
mov    0x30(%rsp),%edx
xor    %esi,%esi
cmp    %edx,%edi
setge  %sil
pcmpgtd %xmm1,%xmm0
movmskps %xmm0,%edi
xor    $0xf,%edi
mov    %edi,%ebx
shr    %bl
and    $0x5,%bl
sub    %bl,%dil
mov    %edi,%ebx
and    $0x33,%bl
shr    $0x2,%dil
and    $0x33,%dil
add    %bl,%dil
mov    %edi,%ebx
shr    $0x4,%bl
add    %dil,%bl
and    $0xf,%bl
movzbl %bl,%edi
add    %eax,%edi
add    %ecx,%edi
add    %esi,%edi
xor    %eax,%eax
cmp    0x34(%rsp),%edx
setge  %al
jmp    120e <main+0xee>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [14 x i8] c"Lumberjacks:\0A\00"
@.str.2 = [9 x i8] c"Ordered\0A\00"
@.str.3 = [11 x i8] c"Unordered\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [101 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%7 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %103, %0
%9 = load i32, i32* %4
%10 = add nsw i32 %9, -1
store i32 %10, i32* %4
%11 = icmp ne i32 %9, 0
br i1 %11, label %12, label %104
12: ; preds = %8
store i32 0, i32* %5
store i32 0, i32* %3
br label %13
13: ; preds = %21, %12
%14 = load i32, i32* %3
%15 = icmp slt i32 %14, 10
br i1 %15, label %16, label %24
16: ; preds = %13
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [101 x i32], [101 x i32]* %2, i64 0, i64 %18
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %19)
br label %21
21: ; preds = %16
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
store i32 %23, i32* %3
br label %13
24: ; preds = %13
%25 = getelementptr inbounds [101 x i32], [101 x i32]* %2, i64 0, i64 0
%26 = load i32, i32* %25
%27 = getelementptr inbounds [101 x i32], [101 x i32]* %2, i64 0, i64 1
%28 = load i32, i32* %27
%29 = icmp sgt i32 %26, %28
br i1 %29, label %30, label %62
30: ; preds = %24
store i32 1, i32* %3
br label %31
31: ; preds = %51, %30
%32 = load i32, i32* %3
%33 = icmp slt i32 %32, 10
br i1 %33, label %34, label %54
34: ; preds = %31
%35 = load i32, i32* %3
%36 = sub nsw i32 %35, 1
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [101 x i32], [101 x i32]* %2, i64 0, i64 %37
%39 = load i32, i32* %38
%40 = load i32, i32* %3
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [101 x i32], [101 x i32]* %2, i64 0, i64 %41
%43 = load i32, i32* %42
%44 = icmp sgt i32 %39, %43
br i1 %44, label %45, label %47
45: ; preds = %34
%46 = load i32, i32* %5
store i32 %46, i32* %5
br label %50
47: ; preds = %34
%48 = load i32, i32* %5
%49 = add nsw i32 %48, 1
store i32 %49, i32* %5
br label %50
50: ; preds = %47, %45
br label %51
51: ; preds = %50
%52 = load i32, i32* %3
%53 = add nsw i32 %52, 1
store i32 %53, i32* %3
br label %31
54: ; preds = %31
%55 = load i32, i32* %5
%56 = icmp eq i32 %55, 0
br i1 %56, label %57, label %59
57: ; preds = %54
%58 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
br label %61
59: ; preds = %54
%60 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
br label %61
61: ; preds = %59, %57
br label %103
62: ; preds = %24
%63 = getelementptr inbounds [101 x i32], [101 x i32]* %2, i64 0, i64 0
%64 = load i32, i32* %63
%65 = getelementptr inbounds [101 x i32], [101 x i32]* %2, i64 0, i64 1
%66 = load i32, i32* %65
%67 = icmp slt i32 %64, %66
br i1 %67, label %68, label %100
68: ; preds = %62
store i32 1, i32* %3
br label %69
69: ; preds = %89, %68
%70 = load i32, i32* %3
%71 = icmp slt i32 %70, 10
br i1 %71, label %72, label %92
72: ; preds = %69
%73 = load i32, i32* %3
%74 = sub nsw i32 %73, 1
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds [101 x i32], [101 x i32]* %2, i64 0, i64 %75
%77 = load i32, i32* %76
%78 = load i32, i32* %3
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds [101 x i32], [101 x i32]* %2, i64 0, i64 %79
%81 = load i32, i32* %80
%82 = icmp slt i32 %77, %81
br i1 %82, label %83, label %85
83: ; preds = %72
%84 = load i32, i32* %5
store i32 %84, i32* %5
br label %88
85: ; preds = %72
%86 = load i32, i32* %5
%87 = add nsw i32 %86, 1
store i32 %87, i32* %5
br label %88
88: ; preds = %85, %83
br label %89
89: ; preds = %88
%90 = load i32, i32* %3
%91 = add nsw i32 %90, 1
store i32 %91, i32* %3
br label %69
92: ; preds = %69
%93 = load i32, i32* %5
%94 = icmp eq i32 %93, 0
br i1 %94, label %95, label %97
95: ; preds = %92
%96 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
br label %99
97: ; preds = %92
%98 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
br label %99
99: ; preds = %97, %95
br label %102
100: ; preds = %62
%101 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
br label %102
102: ; preds = %100, %99
br label %103
103: ; preds = %102, %61
br label %8
104: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [13 x i8] c"Lumberjacks:\00"
@str.7 = [10 x i8] c"Unordered\00"
@str.8 = [8 x i8] c"Ordered\00"
define i32 @main() {
%1 = alloca [101 x i32]
%2 = alloca i32
%3 = bitcast [101 x i32]* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%7 = load i32, i32* %2
%8 = add nsw i32 %7, -1
store i32 %8, i32* %2
%9 = icmp eq i32 %7, 0
br i1 %9, label %97, label %10
10: ; preds = %0
%11 = getelementptr inbounds [101 x i32], [101 x i32]* %1, i64 0, i64 0
%12 = getelementptr inbounds [101 x i32], [101 x i32]* %1, i64 0, i64 1
%13 = getelementptr inbounds [101 x i32], [101 x i32]* %1, i64 0, i64 2
%14 = getelementptr inbounds [101 x i32], [101 x i32]* %1, i64 0, i64 3
%15 = getelementptr inbounds [101 x i32], [101 x i32]* %1, i64 0, i64 4
%16 = getelementptr inbounds [101 x i32], [101 x i32]* %1, i64 0, i64 5
%17 = getelementptr inbounds [101 x i32], [101 x i32]* %1, i64 0, i64 6
%18 = getelementptr inbounds [101 x i32], [101 x i32]* %1, i64 0, i64 7
%19 = getelementptr inbounds [101 x i32], [101 x i32]* %1, i64 0, i64 8
%20 = getelementptr inbounds [101 x i32], [101 x i32]* %1, i64 0, i64 9
%21 = bitcast i32* %13 to <4 x i32>*
%22 = bitcast i32* %13 to <4 x i32>*
br label %23
23: ; preds = %10, %91
%24 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %11)
%25 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %12)
%26 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %13)
%27 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %14)
%28 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %15)
%29 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %16)
%30 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %17)
%31 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %18)
%32 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %19)
%33 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %20)
%34 = load i32, i32* %11
%35 = load i32, i32* %12
%36 = icmp sgt i32 %34, %35
br i1 %36, label %37, label %63
37: ; preds = %23
%38 = load <4 x i32>, <4 x i32>* %22
%39 = insertelement <4 x i32> poison, i32 %35, i64 0
%40 = shufflevector <4 x i32> %39, <4 x i32> %38, <4 x i32> <i32 0, i32 4, i32 5, i32 6>
%41 = icmp sle <4 x i32> %40, %38
%42 = load i32, i32* %17
%43 = extractelement <4 x i32> %38, i64 3
%44 = icmp sle i32 %43, %42
%45 = zext i1 %44 to i32
%46 = load i32, i32* %18
%47 = icmp sle i32 %42, %46
%48 = zext i1 %47 to i32
%49 = load i32, i32* %19
%50 = icmp sle i32 %46, %49
%51 = zext i1 %50 to i32
%52 = bitcast <4 x i1> %41 to i4
%53 = call i4 @llvm.ctpop.i4(i4 %52)
%54 = zext i4 %53 to i32
%55 = add nuw nsw i32 %54, %45
%56 = add nuw nsw i32 %55, %48
%57 = add nuw nsw i32 %56, %51
%58 = load i32, i32* %20
%59 = icmp sle i32 %49, %58
%60 = sext i1 %59 to i32
%61 = icmp eq i32 %57, %60
%62 = select i1 %61, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @str.8, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @str.7, i64 0, i64 0)
br label %91
63: ; preds = %23
%64 = icmp slt i32 %34, %35
br i1 %64, label %65, label %91
65: ; preds = %63
%66 = load <4 x i32>, <4 x i32>* %21
%67 = insertelement <4 x i32> poison, i32 %35, i64 0
%68 = shufflevector <4 x i32> %67, <4 x i32> %66, <4 x i32> <i32 0, i32 4, i32 5, i32 6>
%69 = icmp sge <4 x i32> %68, %66
%70 = load i32, i32* %17
%71 = extractelement <4 x i32> %66, i64 3
%72 = icmp sge i32 %71, %70
%73 = zext i1 %72 to i32
%74 = load i32, i32* %18
%75 = icmp sge i32 %70, %74
%76 = zext i1 %75 to i32
%77 = load i32, i32* %19
%78 = icmp sge i32 %74, %77
%79 = zext i1 %78 to i32
%80 = bitcast <4 x i1> %69 to i4
%81 = call i4 @llvm.ctpop.i4(i4 %80)
%82 = zext i4 %81 to i32
%83 = add nuw nsw i32 %82, %73
%84 = add nuw nsw i32 %83, %76
%85 = add nuw nsw i32 %84, %79
%86 = load i32, i32* %20
%87 = icmp sge i32 %77, %86
%88 = sext i1 %87 to i32
%89 = icmp eq i32 %85, %88
%90 = select i1 %89, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @str.8, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @str.7, i64 0, i64 0)
br label %91
91: ; preds = %63, %65, %37
%92 = phi i8* [ %62, %37 ], [ %90, %65 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @str.7, i64 0, i64 0), %63 ]
%93 = call i32 @puts(i8* dereferenceable(1) %92)
%94 = load i32, i32* %2
%95 = add nsw i32 %94, -1
store i32 %95, i32* %2
%96 = icmp eq i32 %94, 0
br i1 %96, label %97, label %23
97: ; preds = %91, %0
ret i32 0
}