#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 findGcd(int, int);
int getDecimalVal(char *);
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, ...);
int main(void) {
  int T, caseId, valA, valB;
  char binary[30 + 1], trash[30 + 1];
  scanf("%d", &T);
  gets(trash);
  caseId = 1;
  while (caseId <= T) {
    scanf("%s", binary);
    valA = getDecimalVal(binary);
    scanf("%s", binary);
    valB = getDecimalVal(binary);
    if (findGcd(valA, valB) > 1)
      printf("Pair #%d: All you need is love!\n", caseId);
    else
      printf("Pair #%d: Love is not all you need!\n", caseId);
    caseId++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
lea    -0x60(%rbp),%rdi
call   1050 <gets@plt>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     120e <main+0xbe>
lea    -0x40(%rbp),%rsi
lea    0xe6b(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
lea    -0x40(%rbp),%rdi
call   1070 <getDecimalVal@plt>
mov    %eax,-0x10(%rbp)
lea    -0x40(%rbp),%rsi
lea    0xe4d(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
lea    -0x40(%rbp),%rdi
call   1070 <getDecimalVal@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <findGcd@plt>
cmp    $0x1,%eax
jle    11f1 <main+0xa1>
mov    -0xc(%rbp),%esi
lea    0xe1f(%rip),%rdi
call   1040 <printf@plt>
jmp    1200 <main+0xb0>
mov    -0xc(%rbp),%esi
lea    0xe2c(%rip),%rdi
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1181 <main+0x31>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
lea    0xe9b(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0x10(%rsp),%rdi
call   1050 <gets@plt>
cmpl   $0x0,0xc(%rsp)
jle    1201 <main+0xb1>
mov    $0x1,%ebx
lea    0xe75(%rip),%r14
lea    0x30(%rsp),%r15
lea    0xe6c(%rip),%r12
lea    0xe86(%rip),%r13
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    %r15,%rdi
call   1070 <getDecimalVal@plt>
mov    %eax,%ebp
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    %r15,%rdi
call   1070 <getDecimalVal@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1030 <findGcd@plt>
cmp    $0x2,%eax
mov    %r13,%rdi
cmovge %r12,%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
lea    0x1(%rbx),%eax
cmp    0xc(%rsp),%ebx
mov    %eax,%ebx
jl     11b0 <main+0x60>
xor    %eax,%eax
add    $0x58,%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 = [3 x i8] c"%s\00"
@.str.2 = [33 x i8] c"Pair #%d: All you need is love!\0A\00"
@.str.3 = [37 x i8] c"Pair #%d: Love is not all you need!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [31 x i8]
%7 = alloca [31 x 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* %2)
%9 = getelementptr inbounds [31 x i8], [31 x i8]* %7, i64 0, i64 0
%10 = call i32 @gets(i8* %9)
store i32 1, i32* %3
br label %11
11: ; preds = %34, %0
%12 = load i32, i32* %3
%13 = load i32, i32* %2
%14 = icmp sle i32 %12, %13
br i1 %14, label %15, label %37
15: ; preds = %11
%16 = getelementptr inbounds [31 x i8], [31 x i8]* %6, i64 0, i64 0
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %16)
%18 = getelementptr inbounds [31 x i8], [31 x i8]* %6, i64 0, i64 0
%19 = call i32 @getDecimalVal(i8* %18)
store i32 %19, i32* %4
%20 = getelementptr inbounds [31 x i8], [31 x i8]* %6, i64 0, i64 0
%21 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %20)
%22 = getelementptr inbounds [31 x i8], [31 x i8]* %6, i64 0, i64 0
%23 = call i32 @getDecimalVal(i8* %22)
store i32 %23, i32* %5
%24 = load i32, i32* %4
%25 = load i32, i32* %5
%26 = call i32 @findGcd(i32 %24, i32 %25)
%27 = icmp sgt i32 %26, 1
br i1 %27, label %28, label %31
28: ; preds = %15
%29 = load i32, i32* %3
%30 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 %29)
br label %34
31: ; preds = %15
%32 = load i32, i32* %3
%33 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0), i32 %32)
br label %34
34: ; preds = %31, %28
%35 = load i32, i32* %3
%36 = add nsw i32 %35, 1
store i32 %36, i32* %3
br label %11
37: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [33 x i8] c"Pair #%d: All you need is love!\0A\00"
@.str.3 = [37 x i8] c"Pair #%d: Love is not all you need!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [31 x i8]
%3 = alloca [31 x i8]
%4 = bitcast i32* %1 to i8*
%5 = getelementptr inbounds [31 x i8], [31 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [31 x i8], [31 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 = call i32 @gets(i8* %6)
%9 = load i32, i32* %1
%10 = icmp slt i32 %9, 1
br i1 %10, label %24, label %11
11: ; preds = %0, %11
%12 = phi i32 [ %21, %11 ], [ 1, %0 ]
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%14 = call i32 @getDecimalVal(i8* %5)
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%16 = call i32 @getDecimalVal(i8* %5)
%17 = call i32 @findGcd(i32 %14, i32 %16)
%18 = icmp sgt i32 %17, 1
%19 = select i1 %18, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0)
%20 = call i32 @printf(i8* %19, i32 %12)
%21 = add nuw nsw i32 %12, 1
%22 = load i32, i32* %1
%23 = icmp slt i32 %12, %22
br i1 %23, label %11, label %24
24: ; preds = %11, %0
ret i32 0
}