#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 gcd(long, long);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, ...);
long strtol(char *, int /*<<< orphan*/ *, int);
int main() {
  int N;
  int i;
  long a, b;
  char s[31];
  scanf("%d", &N);
  for (i = 0; i < N; ++i) {
    scanf("%s", s);
    a = strtol(s, NULL, 2);
    scanf("%s", s);
    b = strtol(s, NULL, 2);
    printf("Pair #%d: ", i + 1);
    if (gcd(a, b) == 1)
      puts("Love is not all you need!");
    else
      puts("All you need is love!");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    122c <main+0xdc>
lea    -0x40(%rbp),%rsi
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
lea    -0x40(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x2,%edx
call   1050 <strtol@plt>
mov    %rax,-0x18(%rbp)
lea    -0x40(%rbp),%rsi
lea    0xe4c(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
lea    -0x40(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x2,%edx
call   1050 <strtol@plt>
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%esi
add    $0x1,%esi
lea    0xe25(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1070 <gcd@plt>
cmp    $0x1,%eax
jne    120d <main+0xbd>
lea    0xe0e(%rip),%rdi
call   1030 <puts@plt>
jmp    1219 <main+0xc9>
lea    0xe17(%rip),%rdi
call   1030 <puts@plt>
jmp    121e <main+0xce>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1178 <main+0x28>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [11 x i8] c"Pair #%d: \00"
@.str.3 = [26 x i8] c"Love is not all you need!\00"
@.str.4 = [22 x i8] c"All you need is love!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [31 x i8]
%3 = bitcast i32* %1 to i8*
%4 = getelementptr inbounds [31 x i8], [31 x i8]* %2, i64 0, i64 0
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %22
8: ; preds = %0, %8
%9 = phi i32 [ %14, %8 ], [ 0, %0 ]
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%11 = call i64 @strtol(i8* nocapture %4, i32* null, i32 2)
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%13 = call i64 @strtol(i8* nocapture %4, i32* null, i32 2)
%14 = add nuw nsw i32 %9, 1
%15 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %14)
%16 = call i32 @gcd(i64 %11, i64 %13)
%17 = icmp eq i32 %16, 1
%18 = select i1 %17, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0)
%19 = call i32 @puts(i8* dereferenceable(1) %18)
%20 = load i32, i32* %1
%21 = icmp slt i32 %14, %20
br i1 %21, label %8, label %22
22: ; preds = %8, %0
ret i32 0
}