#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 check_seq(int *, int);
int /*<<< orphan*/ free(int *);
int *malloc(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int e;
    scanf("%d", &e);
    int *arr = malloc(e * sizeof(int));
    for (int j = 0; j < e; j++) {
      scanf("%d", (arr + j));
    }
    if (check_seq(arr, e) == true) {
      printf("yes\n");
    } else {
      printf("no\n");
    }
    free(arr);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1070 <scanf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    122a <main+0xda>
lea    0xe77(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1070 <scanf@plt>
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11e1 <main+0x91>
mov    -0x18(%rbp),%rsi
movslq -0x1c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe32(%rip),%rdi
call   1070 <scanf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11ac <main+0x5c>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1050 <check_seq@plt>
cmp    $0x1,%eax
jne    1207 <main+0xb7>
lea    0xe06(%rip),%rdi
call   1040 <printf@plt>
jmp    1213 <main+0xc3>
lea    0xdfa(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1176 <main+0x26>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xe9e(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1070 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
jle    120e <main+0xbe>
xor    %ebp,%ebp
lea    0xe80(%rip),%r12
jmp    11c6 <main+0x76>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r15,%rdi
mov    %r13d,%esi
call   1050 <check_seq@plt>
cmp    $0x1,%eax
lea    0xe5e(%rip),%rdi
lea    0xe5a(%rip),%rax
cmove  %rax,%rdi
call   1040 <puts@plt>
mov    %r15,%rdi
call   1030 <free@plt>
add    $0x1,%ebp
cmp    0x4(%rsp),%ebp
jge    120e <main+0xbe>
mov    %r12,%rdi
mov    %rsp,%rsi
call   1070 <scanf@plt>
mov    (%rsp),%r13d
lea    0x0(,%r13,4),%edi
call   1060 <malloc@plt>
mov    %rax,%r15
test   %r13d,%r13d
jle    1190 <main+0x40>
mov    %r15,%rbx
xor    %r14d,%r14d
mov    %r12,%rdi
mov    %rbx,%rsi
call   1070 <scanf@plt>
add    $0x1,%r14
movslq (%rsp),%r13
add    $0x4,%rbx
cmp    %r13,%r14
jl     11f0 <main+0xa0>
jmp    1190 <main+0x40>
xor    %eax,%eax
add    $0x8,%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 = [5 x i8] c"yes\0A\00"
@.str.2 = [4 x i8] c"no\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
store i32 0, i32* %1
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 0, i32* %3
br label %8
8: ; preds = %44, %0
%9 = load i32, i32* %3
%10 = load i32, i32* %2
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %47
12: ; preds = %8
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%14 = load i32, i32* %4
%15 = sext i32 %14 to i64
%16 = mul i64 %15, 4
%17 = trunc i64 %16 to i32
%18 = call i32* @malloc(i32 %17)
store i32* %18, i32** %5
store i32 0, i32* %6
br label %19
19: ; preds = %29, %12
%20 = load i32, i32* %6
%21 = load i32, i32* %4
%22 = icmp slt i32 %20, %21
br i1 %22, label %23, label %32
23: ; preds = %19
%24 = load i32*, i32** %5
%25 = load i32, i32* %6
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i32, i32* %24, i64 %26
%28 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %27)
br label %29
29: ; preds = %23
%30 = load i32, i32* %6
%31 = add nsw i32 %30, 1
store i32 %31, i32* %6
br label %19
32: ; preds = %19
%33 = load i32*, i32** %5
%34 = load i32, i32* %4
%35 = call i32 @check_seq(i32* %33, i32 %34)
%36 = icmp eq i32 %35, 1
br i1 %36, label %37, label %39
37: ; preds = %32
%38 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %41
39: ; preds = %32
%40 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %41
41: ; preds = %39, %37
%42 = load i32*, i32** %5
%43 = call i32 @free(i32* %42)
br label %44
44: ; preds = %41
%45 = load i32, i32* %3
%46 = add nsw i32 %45, 1
store i32 %46, i32* %3
br label %8
47: ; preds = %8
%48 = load i32, i32* %1
ret i32 %48
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [3 x i8] c"no\00"
@str.3 = [4 x i8] c"yes\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = bitcast i32* %2 to i8*
br label %10
9: ; preds = %17, %0
ret i32 0
10: ; preds = %7, %17
%11 = phi i32 [ 0, %7 ], [ %24, %17 ]
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%13 = load i32, i32* %2
%14 = shl i32 %13, 2
%15 = call i32* @malloc(i32 %14)
%16 = icmp sgt i32 %13, 0
br i1 %16, label %27, label %17
17: ; preds = %27, %10
%18 = phi i32 [ %13, %10 ], [ %32, %27 ]
%19 = call i32 @check_seq(i32* %15, i32 %18)
%20 = icmp eq i32 %19, 1
%21 = select i1 %20, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0)
%22 = call i32 @puts(i8* dereferenceable(1) %21)
%23 = call i32 @free(i32* %15)
%24 = add nuw nsw i32 %11, 1
%25 = load i32, i32* %1
%26 = icmp slt i32 %24, %25
br i1 %26, label %10, label %9
27: ; preds = %10, %27
%28 = phi i64 [ %31, %27 ], [ 0, %10 ]
%29 = getelementptr inbounds i32, i32* %15, i64 %28
%30 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %29)
%31 = add nuw nsw i64 %28, 1
%32 = load i32, i32* %2
%33 = sext i32 %32 to i64
%34 = icmp slt i64 %31, %33
br i1 %34, label %27, label %17
}