#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 bin(char *);
int gcd(int, int);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int t, i, n, d;
  char str1[50], str2[50];
  scanf("%d", &t);
  getchar();
  for (i = 1; i <= t; i++) {
    gets(str1);
    gets(str2);
    n = bin(str1);
    d = bin(str2);
    if (gcd(n, d) == 1)
      printf("Pair #%d: Love is not all you need!\n", i);
    else
      printf("Pair #%d: All you need is love!\n", i);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe87(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1070 <scanf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1216 <main+0xb6>
lea    -0x50(%rbp),%rdi
call   1060 <gets@plt>
lea    -0x90(%rbp),%rdi
call   1060 <gets@plt>
lea    -0x50(%rbp),%rdi
call   1030 <bin@plt>
mov    %eax,-0x10(%rbp)
lea    -0x90(%rbp),%rdi
call   1030 <bin@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1080 <gcd@plt>
cmp    $0x1,%eax
jne    11f4 <main+0x94>
mov    -0xc(%rbp),%esi
lea    0xe19(%rip),%rdi
call   1040 <printf@plt>
jmp    1203 <main+0xa3>
mov    -0xc(%rbp),%esi
lea    0xe2a(%rip),%rdi
call   1040 <printf@plt>
jmp    1208 <main+0xa8>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1190 <main+0x30>
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [37 x i8] c"Pair #%d: Love is not all you need!\0A\00"
@.str.2 = [33 x i8] c"Pair #%d: All you need is love!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [50 x i8]
%3 = alloca [50 x i8]
%4 = bitcast i32* %1 to i8*
%5 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%8 = call i32 (...) @getchar()
%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 @gets(i8* %5)
%14 = call i32 @gets(i8* %6)
%15 = call i32 @bin(i8* %5)
%16 = call i32 @bin(i8* %6)
%17 = call i32 @gcd(i32 %15, i32 %16)
%18 = icmp eq i32 %17, 1
%19 = select i1 %18, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, 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
}