#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*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ morgan(char *, char *);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  int t;
  scanf("%d", &t);
  char a[5][100001];
  char b[5][100001];
  for (size_t i = 0; i < t; i++) {
    memset(a[i], 0, 100001);
    memset(b[i], 0, 100001);
    scanf("%s", a[i]);
    scanf("%s", b[i]);
  }
  for (size_t i = 0; i < t; i++) {
    morgan(a[i], b[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf4270,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movq   $0x0,-0xf4268(%rbp)
mov    -0xf4268(%rbp),%rax
movslq -0x8(%rbp),%rcx
cmp    %rcx,%rax
jae    1212 <main+0xe2>
lea    -0x7a130(%rbp),%rdi
imul   $0x186a1,-0xf4268(%rbp),%rax
add    %rax,%rdi
xor    %esi,%esi
mov    $0x186a1,%edx
call   1030 <memset@plt>
lea    -0xf4260(%rbp),%rdi
imul   $0x186a1,-0xf4268(%rbp),%rax
add    %rax,%rdi
xor    %esi,%esi
mov    $0x186a1,%edx
call   1030 <memset@plt>
lea    -0x7a130(%rbp),%rsi
imul   $0x186a1,-0xf4268(%rbp),%rax
add    %rax,%rsi
lea    0xe32(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    -0xf4260(%rbp),%rsi
imul   $0x186a1,-0xf4268(%rbp),%rax
add    %rax,%rsi
lea    0xe0f(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0xf4268(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xf4268(%rbp)
jmp    115f <main+0x2f>
movq   $0x0,-0xf4270(%rbp)
mov    -0xf4270(%rbp),%rax
movslq -0x8(%rbp),%rcx
cmp    %rcx,%rax
jae    1277 <main+0x147>
lea    -0x7a130(%rbp),%rdi
imul   $0x186a1,-0xf4270(%rbp),%rax
add    %rax,%rdi
lea    -0xf4260(%rbp),%rsi
imul   $0x186a1,-0xf4270(%rbp),%rax
add    %rax,%rsi
call   1050 <morgan@plt>
mov    -0xf4270(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xf4270(%rbp)
jmp    121d <main+0xed>
xor    %eax,%eax
add    $0xf4270,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0xf4268,%rsp
lea    0xebb(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
je     1217 <main+0xe7>
lea    0x7a140(%rsp),%r14
lea    0x10(%rsp),%rbx
lea    0xe93(%rip),%r15
xor    %r12d,%r12d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x186a1,%edx
call   1030 <memset@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x186a1,%edx
call   1030 <memset@plt>
mov    %r15,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
add    $0x1,%r12
movslq 0xc(%rsp),%rax
add    $0x186a1,%r14
add    $0x186a1,%rbx
cmp    %rax,%r12
jb     1180 <main+0x50>
test   %eax,%eax
je     1217 <main+0xe7>
lea    0x7a140(%rsp),%r14
lea    0x10(%rsp),%r15
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
call   1050 <morgan@plt>
add    $0x1,%rbx
movslq 0xc(%rsp),%rax
add    $0x186a1,%r14
add    $0x186a1,%r15
cmp    %rax,%rbx
jb     11f0 <main+0xc0>
xor    %eax,%eax
add    $0xf4268,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [5 x [100001 x i8]]
%4 = alloca [5 x [100001 x i8]]
%5 = alloca i64
%6 = alloca i64
store i32 0, i32* %1
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
store i64 0, i64* %5
br label %8
8: ; preds = %30, %0
%9 = load i64, i64* %5
%10 = load i32, i32* %2
%11 = sext i32 %10 to i64
%12 = icmp ult i64 %9, %11
br i1 %12, label %13, label %33
13: ; preds = %8
%14 = load i64, i64* %5
%15 = getelementptr inbounds [5 x [100001 x i8]], [5 x [100001 x i8]]* %3, i64 0, i64 %14
%16 = getelementptr inbounds [100001 x i8], [100001 x i8]* %15, i64 0, i64 0
%17 = call i32 @memset(i8* %16, i32 0, i32 100001)
%18 = load i64, i64* %5
%19 = getelementptr inbounds [5 x [100001 x i8]], [5 x [100001 x i8]]* %4, i64 0, i64 %18
%20 = getelementptr inbounds [100001 x i8], [100001 x i8]* %19, i64 0, i64 0
%21 = call i32 @memset(i8* %20, i32 0, i32 100001)
%22 = load i64, i64* %5
%23 = getelementptr inbounds [5 x [100001 x i8]], [5 x [100001 x i8]]* %3, i64 0, i64 %22
%24 = getelementptr inbounds [100001 x i8], [100001 x i8]* %23, i64 0, i64 0
%25 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %24)
%26 = load i64, i64* %5
%27 = getelementptr inbounds [5 x [100001 x i8]], [5 x [100001 x i8]]* %4, i64 0, i64 %26
%28 = getelementptr inbounds [100001 x i8], [100001 x i8]* %27, i64 0, i64 0
%29 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %28)
br label %30
30: ; preds = %13
%31 = load i64, i64* %5
%32 = add i64 %31, 1
store i64 %32, i64* %5
br label %8
33: ; preds = %8
store i64 0, i64* %6
br label %34
34: ; preds = %47, %33
%35 = load i64, i64* %6
%36 = load i32, i32* %2
%37 = sext i32 %36 to i64
%38 = icmp ult i64 %35, %37
br i1 %38, label %39, label %50
39: ; preds = %34
%40 = load i64, i64* %6
%41 = getelementptr inbounds [5 x [100001 x i8]], [5 x [100001 x i8]]* %3, i64 0, i64 %40
%42 = getelementptr inbounds [100001 x i8], [100001 x i8]* %41, i64 0, i64 0
%43 = load i64, i64* %6
%44 = getelementptr inbounds [5 x [100001 x i8]], [5 x [100001 x i8]]* %4, i64 0, i64 %43
%45 = getelementptr inbounds [100001 x i8], [100001 x i8]* %44, i64 0, i64 0
%46 = call i32 @morgan(i8* %42, i8* %45)
br label %47
47: ; preds = %39
%48 = load i64, i64* %6
%49 = add i64 %48, 1
store i64 %49, i64* %6
br label %34
50: ; preds = %34
ret i32 0
}

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