#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ stdin;
int main(int argc, char *argv[]) {
  int i, n, number[10], count1, count2, flag = 1;
  fflush(stdin);
  scanf("%d", &n);
  while (n--) {
    for (i = 0; i < 10; i++)
      scanf("%d", &number[i]);
    count1 = count2 = 0;
    for (i = 0; i < 10 - 1; i++) {
      if (number[i] < number[i + 1])
        count1++;
      else
        count2++;
    }
    if (flag-- > 0)
      printf("Lumberjacks:\n");
    if (count1 == 9 || count2 == 9)
      printf("Ordered\n");
    else
      printf("Unordered\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x4c(%rbp)
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
lea    0xe9e(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x18(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x18(%rbp)
cmp    $0x0,%eax
je     1273 <main+0x143>
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    11b9 <main+0x89>
movslq -0x14(%rbp),%rax
lea    -0x40(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe5a(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1186 <main+0x56>
movl   $0x0,-0x48(%rbp)
movl   $0x0,-0x44(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x9,-0x14(%rbp)
jge    121d <main+0xed>
movslq -0x14(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%eax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
cmp    -0x40(%rbp,%rcx,4),%eax
jge    1201 <main+0xd1>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    120a <main+0xda>
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    120f <main+0xdf>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11ce <main+0x9e>
mov    -0x4c(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4c(%rbp)
cmp    $0x0,%eax
jle    123d <main+0x10d>
lea    0xdcb(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x9,-0x44(%rbp)
je     1251 <main+0x121>
cmpl   $0x9,-0x48(%rbp)
jne    1262 <main+0x132>
lea    0xdb9(%rip),%rdi
call   1030 <printf@plt>
jmp    126e <main+0x13e>
lea    0xdb1(%rip),%rdi
call   1030 <printf@plt>
jmp    116b <main+0x3b>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
lea    0xead(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
subl   $0x1,0x4(%rsp)
jae    1175 <main+0x45>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x1,%ebp
jmp    11ac <main+0x7c>
nopl   0x0(%rax)
cmp    $0x9,%r12d
lea    0xe78(%rip),%rdi
lea    0xe7b(%rip),%rax
cmove  %rax,%rdi
cmp    $0x9,%ebx
cmove  %rax,%rdi
call   1030 <puts@plt>
add    $0xffffffff,%ebp
subl   $0x1,0x4(%rsp)
jb     1164 <main+0x34>
mov    %ebp,0xc(%rsp)
lea    0xe49(%rip),%rbx
mov    %rbx,%rdi
lea    0x10(%rsp),%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
lea    0x14(%rsp),%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
lea    0x18(%rsp),%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
lea    0x1c(%rsp),%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
lea    0x20(%rsp),%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
lea    0x24(%rsp),%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
lea    0x28(%rsp),%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
lea    0x2c(%rsp),%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
lea    0x30(%rsp),%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
lea    0x34(%rsp),%rsi
call   1050 <scanf@plt>
movups 0x24(%rsp),%xmm0
movdqu 0x14(%rsp),%xmm1
movd   %xmm1,%eax
xor    %ecx,%ecx
xor    %r12d,%r12d
cmp    %eax,0x10(%rsp)
setge  %cl
mov    %ecx,0x8(%rsp)
setl   %r12b
movss  0x34(%rsp),%xmm2
shufps $0xf4,%xmm0,%xmm2
movaps %xmm0,%xmm3
shufps $0x29,%xmm2,%xmm3
pcmpgtd %xmm0,%xmm3
shufps $0x30,%xmm1,%xmm0
movaps %xmm1,%xmm2
shufps $0x29,%xmm0,%xmm2
pcmpgtd %xmm1,%xmm2
packssdw %xmm3,%xmm2
packsswb %xmm2,%xmm2
pmovmskb %xmm2,%ebp
mov    %ebp,%r10d
and    $0x80,%r10b
mov    %r10d,%eax
shr    $0x7,%al
mov    %al,0x3(%rsp)
mov    %ebp,%r9d
and    $0x40,%r9b
mov    %r9d,%eax
shr    $0x6,%al
mov    %al,0x2(%rsp)
mov    %ebp,%r11d
and    $0x20,%r11b
mov    %r11d,%r8d
shr    $0x5,%r8b
mov    %ebp,%ebx
and    $0x10,%bl
mov    %ebx,%esi
shr    $0x4,%sil
mov    %ebp,%r15d
and    $0x8,%r15b
mov    %r15d,%r13d
shr    $0x3,%r13b
mov    %ebp,%r14d
and    $0x4,%r14b
mov    %r14d,%edi
shr    $0x2,%dil
mov    %ebp,%ecx
and    $0x2,%cl
mov    %ecx,%edx
shr    %dl
mov    %ebp,%eax
and    $0x1,%eax
add    %r12d,%eax
not    %bpl
movzbl %bpl,%r12d
mov    0xc(%rsp),%ebp
and    $0x1,%r12d
add    0x8(%rsp),%r12d
movzbl %dl,%edx
add    %eax,%edx
cmp    $0x1,%cl
adc    $0x0,%r12d
movzbl %dil,%eax
add    %edx,%eax
cmp    $0x1,%r14b
adc    $0x0,%r12d
movzbl %r13b,%ecx
add    %eax,%ecx
cmp    $0x1,%r15b
adc    $0x0,%r12d
movzbl %sil,%eax
add    %ecx,%eax
cmp    $0x1,%bl
adc    $0x0,%r12d
movzbl %r8b,%ecx
add    %eax,%ecx
cmp    $0x1,%r11b
adc    $0x0,%r12d
movzbl 0x2(%rsp),%eax
add    %ecx,%eax
cmp    $0x1,%r9b
adc    $0x0,%r12d
movzbl 0x3(%rsp),%ebx
add    %eax,%ebx
cmp    $0x1,%r10b
adc    $0x0,%r12d
test   %ebp,%ebp
jle    1180 <main+0x50>
lea    0xc9d(%rip),%rdi
call   1030 <puts@plt>
jmp    1180 <main+0x50>

LLVM IR (-O0):
@stdin = global i32 0
@.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(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca [10 x i32]
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %11
%12 = load i32, i32* @stdin
%13 = call i32 @fflush(i32 %12)
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %7)
br label %15
15: ; preds = %72, %2
%16 = load i32, i32* %7
%17 = add nsw i32 %16, -1
store i32 %17, i32* %7
%18 = icmp ne i32 %16, 0
br i1 %18, label %19, label %73
19: ; preds = %15
store i32 0, i32* %6
br label %20
20: ; preds = %28, %19
%21 = load i32, i32* %6
%22 = icmp slt i32 %21, 10
br i1 %22, label %23, label %31
23: ; preds = %20
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [10 x i32], [10 x i32]* %8, i64 0, i64 %25
%27 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %26)
br label %28
28: ; preds = %23
%29 = load i32, i32* %6
%30 = add nsw i32 %29, 1
store i32 %30, i32* %6
br label %20
31: ; preds = %20
store i32 0, i32* %10
store i32 0, i32* %9
store i32 0, i32* %6
br label %32
32: ; preds = %53, %31
%33 = load i32, i32* %6
%34 = icmp slt i32 %33, 9
br i1 %34, label %35, label %56
35: ; preds = %32
%36 = load i32, i32* %6
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [10 x i32], [10 x i32]* %8, i64 0, i64 %37
%39 = load i32, i32* %38
%40 = load i32, i32* %6
%41 = add nsw i32 %40, 1
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [10 x i32], [10 x i32]* %8, i64 0, i64 %42
%44 = load i32, i32* %43
%45 = icmp slt i32 %39, %44
br i1 %45, label %46, label %49
46: ; preds = %35
%47 = load i32, i32* %9
%48 = add nsw i32 %47, 1
store i32 %48, i32* %9
br label %52
49: ; preds = %35
%50 = load i32, i32* %10
%51 = add nsw i32 %50, 1
store i32 %51, i32* %10
br label %52
52: ; preds = %49, %46
br label %53
53: ; preds = %52
%54 = load i32, i32* %6
%55 = add nsw i32 %54, 1
store i32 %55, i32* %6
br label %32
56: ; preds = %32
%57 = load i32, i32* %11
%58 = add nsw i32 %57, -1
store i32 %58, i32* %11
%59 = icmp sgt i32 %57, 0
br i1 %59, label %60, label %62
60: ; preds = %56
%61 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
br label %62
62: ; preds = %60, %56
%63 = load i32, i32* %9
%64 = icmp eq i32 %63, 9
br i1 %64, label %68, label %65
65: ; preds = %62
%66 = load i32, i32* %10
%67 = icmp eq i32 %66, 9
br i1 %67, label %68, label %70
68: ; preds = %65, %62
%69 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
br label %72
70: ; preds = %65
%71 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
br label %72
72: ; preds = %70, %68
br label %15
73: ; preds = %15
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [3 x i8] c"%d\00"
@str = [10 x i8] c"Unordered\00"
@str.4 = [8 x i8] c"Ordered\00"
@str.5 = [13 x i8] c"Lumberjacks:\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca [10 x i32]
%5 = bitcast i32* %3 to i8*
%6 = bitcast [10 x i32]* %4 to i8*
%7 = load i32, i32* @stdin
%8 = tail call i32 @fflush(i32 %7)
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%10 = load i32, i32* %3
%11 = add nsw i32 %10, -1
store i32 %11, i32* %3
%12 = icmp eq i32 %10, 0
br i1 %12, label %122, label %13
13: ; preds = %2
%14 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 0
%15 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 1
%16 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 2
%17 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 3
%18 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 4
%19 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 5
%20 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 6
%21 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 7
%22 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 8
%23 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 9
%24 = bitcast i32* %15 to <8 x i32>*
br label %25
25: ; preds = %13, %113
%26 = phi i32 [ %109, %113 ], [ 1, %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 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %21)
%35 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %22)
%36 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %23)
%37 = load i32, i32* %14
%38 = load <8 x i32>, <8 x i32>* %24
%39 = extractelement <8 x i32> %38, i64 0
%40 = icmp slt i32 %37, %39
%41 = zext i1 %40 to i32
%42 = xor i1 %40, true
%43 = zext i1 %42 to i32
%44 = load i32, i32* %23
%45 = extractelement <8 x i32> %38, i64 1
%46 = insertelement <8 x i32> poison, i32 %45, i64 0
%47 = extractelement <8 x i32> %38, i64 2
%48 = insertelement <8 x i32> %46, i32 %47, i64 1
%49 = extractelement <8 x i32> %38, i64 3
%50 = insertelement <8 x i32> %48, i32 %49, i64 2
%51 = extractelement <8 x i32> %38, i64 4
%52 = insertelement <8 x i32> %50, i32 %51, i64 3
%53 = extractelement <8 x i32> %38, i64 5
%54 = insertelement <8 x i32> %52, i32 %53, i64 4
%55 = extractelement <8 x i32> %38, i64 6
%56 = insertelement <8 x i32> %54, i32 %55, i64 5
%57 = extractelement <8 x i32> %38, i64 7
%58 = insertelement <8 x i32> %56, i32 %57, i64 6
%59 = insertelement <8 x i32> %58, i32 %44, i64 7
%60 = icmp slt <8 x i32> %38, %59
%61 = extractelement <8 x i1> %60, i64 0
%62 = zext i1 %61 to i32
%63 = add nuw nsw i32 %41, %62
%64 = xor i1 %61, true
%65 = zext i1 %64 to i32
%66 = add nuw nsw i32 %43, %65
%67 = extractelement <8 x i1> %60, i64 1
%68 = zext i1 %67 to i32
%69 = add nuw nsw i32 %63, %68
%70 = xor i1 %67, true
%71 = zext i1 %70 to i32
%72 = add nuw nsw i32 %66, %71
%73 = extractelement <8 x i1> %60, i64 2
%74 = zext i1 %73 to i32
%75 = add nuw nsw i32 %69, %74
%76 = xor i1 %73, true
%77 = zext i1 %76 to i32
%78 = add nuw nsw i32 %72, %77
%79 = extractelement <8 x i1> %60, i64 3
%80 = zext i1 %79 to i32
%81 = add nuw nsw i32 %75, %80
%82 = xor i1 %79, true
%83 = zext i1 %82 to i32
%84 = add nuw nsw i32 %78, %83
%85 = extractelement <8 x i1> %60, i64 4
%86 = zext i1 %85 to i32
%87 = add nuw nsw i32 %81, %86
%88 = xor i1 %85, true
%89 = zext i1 %88 to i32
%90 = add nuw nsw i32 %84, %89
%91 = extractelement <8 x i1> %60, i64 5
%92 = zext i1 %91 to i32
%93 = add nuw nsw i32 %87, %92
%94 = xor i1 %91, true
%95 = zext i1 %94 to i32
%96 = add nuw nsw i32 %90, %95
%97 = extractelement <8 x i1> %60, i64 6
%98 = zext i1 %97 to i32
%99 = add nuw nsw i32 %93, %98
%100 = xor i1 %97, true
%101 = zext i1 %100 to i32
%102 = add nuw nsw i32 %96, %101
%103 = extractelement <8 x i1> %60, i64 7
%104 = zext i1 %103 to i32
%105 = add nuw nsw i32 %99, %104
%106 = xor i1 %103, true
%107 = zext i1 %106 to i32
%108 = add nuw nsw i32 %102, %107
%109 = add nsw i32 %26, -1
%110 = icmp sgt i32 %26, 0
br i1 %110, label %111, label %113
111: ; preds = %25
%112 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.5, i64 0, i64 0))
br label %113
113: ; preds = %111, %25
%114 = icmp eq i32 %105, 9
%115 = icmp eq i32 %108, 9
%116 = select i1 %114, i1 true, i1 %115
%117 = select i1 %116, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @str.4, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0)
%118 = call i32 @puts(i8* dereferenceable(1) %117)
%119 = load i32, i32* %3
%120 = add nsw i32 %119, -1
store i32 %120, i32* %3
%121 = icmp eq i32 %119, 0
br i1 %121, label %122, label %25
122: ; preds = %113, %2
ret i32 0
}