#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 /*<<< orphan*/ strlen(char *);
char *strrev(char *);
scalar_t__ subrseq(char *, char *, int /*<<< orphan*/);
scalar_t__ subseq(char *, char *);
int main(void) {
  int i, n, f;
  char s1[101], s2[101];
  char *s3;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%s %s", s1, s2);
    s3 = strrev(s2);
    printf((subseq(s1, s3) || subrseq(s1, s2, strlen(s2))) ? "YES\n" : "NO\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe87(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    125d <main+0xfd>
lea    -0x80(%rbp),%rsi
lea    -0xf0(%rbp),%rdx
lea    0xe5a(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
lea    -0xf0(%rbp),%rdi
call   1070 <strrev@plt>
mov    %rax,-0xf8(%rbp)
lea    -0x80(%rbp),%rdi
mov    -0xf8(%rbp),%rsi
call   1080 <subseq@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0xf9(%rbp)
jne    122f <main+0xcf>
lea    -0x80(%rbp),%rax
mov    %rax,-0x110(%rbp)
lea    -0xf0(%rbp),%rax
mov    %rax,-0x108(%rbp)
lea    -0xf0(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x110(%rbp),%rdi
mov    -0x108(%rbp),%rsi
mov    %eax,%edx
call   1050 <subrseq@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0xf9(%rbp)
mov    -0xf9(%rbp),%cl
lea    0xdd2(%rip),%rdi
lea    0xdc6(%rip),%rax
test   $0x1,%cl
cmovne %rax,%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    118b <main+0x2b>
mov    -0x4(%rbp),%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xe8,%rsp
lea    0xe88(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    1218 <main+0xb8>
lea    0xe6d(%rip),%r14
lea    0x80(%rsp),%r15
lea    0x10(%rsp),%rbx
lea    0xe64(%rip),%r12
lea    0xe58(%rip),%r13
xor    %ebp,%ebp
jmp    11d1 <main+0x71>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r13,%rdi
call   1040 <printf@plt>
add    $0x1,%ebp
cmp    0xc(%rsp),%ebp
jge    1218 <main+0xb8>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1060 <scanf@plt>
mov    %rbx,%rdi
call   1070 <strrev@plt>
mov    %r15,%rdi
mov    %rax,%rsi
call   1080 <subseq@plt>
test   %rax,%rax
jne    11c0 <main+0x60>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1050 <subrseq@plt>
mov    %r12,%rdi
test   %rax,%rax
jne    11c0 <main+0x60>
jmp    11c3 <main+0x63>
xor    %eax,%eax
add    $0xe8,%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 = [6 x i8] c"%s %s\00"
@.str.2 = [5 x i8] c"YES\0A\00"
@.str.3 = [4 x i8] c"NO\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [101 x i8]
%6 = alloca [101 x i8]
%7 = alloca i8*
store i32 0, i32* %1
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
store i32 0, i32* %2
br label %9
9: ; preds = %35, %0
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %38
13: ; preds = %9
%14 = getelementptr inbounds [101 x i8], [101 x i8]* %5, i64 0, i64 0
%15 = getelementptr inbounds [101 x i8], [101 x i8]* %6, i64 0, i64 0
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %14, i8* %15)
%17 = getelementptr inbounds [101 x i8], [101 x i8]* %6, i64 0, i64 0
%18 = call i8* @strrev(i8* %17)
store i8* %18, i8** %7
%19 = getelementptr inbounds [101 x i8], [101 x i8]* %5, i64 0, i64 0
%20 = load i8*, i8** %7
%21 = call i64 @subseq(i8* %19, i8* %20)
%22 = icmp ne i64 %21, 0
br i1 %22, label %30, label %23
23: ; preds = %13
%24 = getelementptr inbounds [101 x i8], [101 x i8]* %5, i64 0, i64 0
%25 = getelementptr inbounds [101 x i8], [101 x i8]* %6, i64 0, i64 0
%26 = getelementptr inbounds [101 x i8], [101 x i8]* %6, i64 0, i64 0
%27 = call i32 @strlen(i8* %26)
%28 = call i64 @subrseq(i8* %24, i8* %25, i32 %27)
%29 = icmp ne i64 %28, 0
br label %30
30: ; preds = %23, %13
%31 = phi i1 [ true, %13 ], [ %29, %23 ]
%32 = zext i1 %31 to i64
%33 = select i1 %31, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0)
%34 = call i32 @printf(i8* %33)
br label %35
35: ; preds = %30
%36 = load i32, i32* %2
%37 = add nsw i32 %36, 1
store i32 %37, i32* %2
br label %9
38: ; preds = %9
%39 = load i32, i32* %1
ret i32 %39
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c"%s %s\00"
@.str.2 = [5 x i8] c"YES\0A\00"
@.str.3 = [4 x i8] c"NO\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [101 x i8]
%3 = alloca [101 x i8]
%4 = bitcast i32* %1 to i8*
%5 = getelementptr inbounds [101 x i8], [101 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [101 x i8], [101 x i8]* %3, i64 0, i64 0
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%8 = load i32, i32* %1
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %27
10: ; preds = %0, %21
%11 = phi i32 [ %24, %21 ], [ 0, %0 ]
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %5, i8* %6)
%13 = call i8* @strrev(i8* %6)
%14 = call i64 @subseq(i8* %5, i8* %13)
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %10
%17 = call i32 @strlen(i8* %6)
%18 = call i64 @subrseq(i8* %5, i8* %6, i32 %17)
%19 = icmp eq i64 %18, 0
br i1 %19, label %21, label %20
20: ; preds = %10, %16
br label %21
21: ; preds = %16, %20
%22 = phi i8* [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), %20 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), %16 ]
%23 = call i32 @printf(i8* dereferenceable(1) %22)
%24 = add nuw nsw i32 %11, 1
%25 = load i32, i32* %1
%26 = icmp slt i32 %24, %25
br i1 %26, label %10, label %27
27: ; preds = %21, %0
ret i32 0
}