#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 */
scalar_t__ isOrdered(int *, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int arr[10], T, i;
  scanf("%d", &T);
  printf("Lumberjacks:\n");
  while (T) {
    for (i = 0; i < 10; i++)
      scanf("%d", &arr[i]);
    if (isOrdered(arr, 10))
      printf("Ordered\n");
    else
      printf("Unordered\n");
    T--;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x34(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
cmpl   $0x0,-0x34(%rbp)
je     11e2 <main+0xb2>
movl   $0x0,-0x38(%rbp)
cmpl   $0xa,-0x38(%rbp)
jge    119f <main+0x6f>
movslq -0x38(%rbp),%rax
lea    -0x30(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe74(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    116c <main+0x3c>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1030 <isOrdered@plt>
cmp    $0x0,%rax
je     11c8 <main+0x98>
lea    0xe53(%rip),%rdi
call   1040 <printf@plt>
jmp    11d4 <main+0xa4>
lea    0xe4b(%rip),%rdi
call   1040 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x34(%rbp)
jmp    115b <main+0x2b>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
lea    0xebb(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
lea    0xead(%rip),%rdi
call   1040 <puts@plt>
cmpl   $0x0,0xc(%rsp)
je     1233 <main+0x103>
lea    0x30(%rsp),%r15
lea    0x34(%rsp),%r12
lea    0xe89(%rip),%r13
lea    0x10(%rsp),%rbx
lea    0xe8d(%rip),%rbp
lea    0xe90(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    %r13,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %r13,%rdi
lea    0x14(%rsp),%rsi
call   1050 <scanf@plt>
mov    %r13,%rdi
lea    0x18(%rsp),%rsi
call   1050 <scanf@plt>
mov    %r13,%rdi
lea    0x1c(%rsp),%rsi
call   1050 <scanf@plt>
mov    %r13,%rdi
lea    0x20(%rsp),%rsi
call   1050 <scanf@plt>
mov    %r13,%rdi
lea    0x24(%rsp),%rsi
call   1050 <scanf@plt>
mov    %r13,%rdi
lea    0x28(%rsp),%rsi
call   1050 <scanf@plt>
mov    %r13,%rdi
lea    0x2c(%rsp),%rsi
call   1050 <scanf@plt>
mov    %r13,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
mov    %r13,%rdi
mov    %r12,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <isOrdered@plt>
test   %rax,%rax
mov    %r14,%rdi
cmove  %rbp,%rdi
call   1040 <puts@plt>
addl   $0xffffffff,0xc(%rsp)
jne    1190 <main+0x60>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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 [10 x i32]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %30, %0
%8 = load i32, i32* %3
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %33
10: ; preds = %7
store i32 0, i32* %4
br label %11
11: ; preds = %19, %10
%12 = load i32, i32* %4
%13 = icmp slt i32 %12, 10
br i1 %13, label %14, label %22
14: ; preds = %11
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %16
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %17)
br label %19
19: ; preds = %14
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
store i32 %21, i32* %4
br label %11
22: ; preds = %11
%23 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%24 = call i64 @isOrdered(i32* %23, i32 10)
%25 = icmp ne i64 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %22
%27 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
br label %30
28: ; preds = %22
%29 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
br label %30
30: ; preds = %28, %26
%31 = load i32, i32* %3
%32 = add nsw i32 %31, -1
store i32 %32, i32* %3
br label %7
33: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [13 x i8] c"Lumberjacks:\00"
@str.4 = [10 x i8] c"Unordered\00"
@str.5 = [8 x i8] c"Ordered\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = alloca i32
%3 = bitcast [10 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 = icmp eq i32 %7, 0
br i1 %8, label %38, label %9
9: ; preds = %0
%10 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%11 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 1
%12 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 2
%13 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 3
%14 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 4
%15 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 5
%16 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 6
%17 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 7
%18 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 8
%19 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 9
br label %20
20: ; preds = %9, %20
%21 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %10)
%22 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %11)
%23 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %12)
%24 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %13)
%25 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %14)
%26 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %15)
%27 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %16)
%28 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %17)
%29 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %18)
%30 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %19)
%31 = call i64 @isOrdered(i32* %10, i32 10)
%32 = icmp eq i64 %31, 0
%33 = select i1 %32, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @str.4, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @str.5, i64 0, i64 0)
%34 = call i32 @puts(i8* dereferenceable(1) %33)
%35 = load i32, i32* %2
%36 = add nsw i32 %35, -1
store i32 %36, i32* %2
%37 = icmp eq i32 %36, 0
br i1 %37, label %38, label %20
38: ; preds = %20, %0
ret i32 0
}