#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 convert(char *);
int gcd(int, int);
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  char line[32];
  int S1, S2;
  int num_cases, i;
  scanf("%d\n", &num_cases);
  for (i = 1; i <= num_cases; i++) {
    gets(line);
    S1 = convert(line);
    gets(line);
    S2 = convert(line);
    if (gcd(S1, S2) != 1) {
      printf("Pair #%d: All you need is love!\n", i);
    } else {
      printf("Pair #%d: Love is not all you need!\n", i);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
lea    -0x3c(%rbp),%rsi
call   1060 <scanf@plt>
movl   $0x1,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jg     11f6 <main+0xa6>
lea    -0x30(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x30(%rbp),%rdi
call   1030 <convert@plt>
mov    %eax,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x30(%rbp),%rdi
call   1030 <convert@plt>
mov    %eax,-0x38(%rbp)
mov    -0x34(%rbp),%edi
mov    -0x38(%rbp),%esi
call   1070 <gcd@plt>
cmp    $0x1,%eax
je     11d4 <main+0x84>
mov    -0x40(%rbp),%esi
lea    0xe3a(%rip),%rdi
call   1040 <printf@plt>
jmp    11e3 <main+0x93>
mov    -0x40(%rbp),%esi
lea    0xe47(%rip),%rdi
call   1040 <printf@plt>
jmp    11e8 <main+0x98>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    1176 <main+0x26>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x30,%rsp
lea    0xe9d(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1060 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    11d7 <main+0x87>
mov    $0x1,%ebx
lea    0x10(%rsp),%r14
lea    0xea0(%rip),%r15
lea    0xe78(%rip),%r12
nopl   0x0(%rax)
mov    %r14,%rdi
call   1050 <gets@plt>
mov    %r14,%rdi
call   1030 <convert@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1050 <gets@plt>
mov    %r14,%rdi
call   1030 <convert@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1070 <gcd@plt>
cmp    $0x1,%eax
mov    %r12,%rdi
cmove  %r15,%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
lea    0x1(%rbx),%eax
cmp    0xc(%rsp),%ebx
mov    %eax,%ebx
jl     1190 <main+0x40>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [33 x i8] c"Pair #%d: All you need is love!\0A\00"
@.str.2 = [37 x i8] c"Pair #%d: Love is not all you need!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [32 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %5)
store i32 1, i32* %6
br label %8
8: ; preds = %32, %0
%9 = load i32, i32* %6
%10 = load i32, i32* %5
%11 = icmp sle i32 %9, %10
br i1 %11, label %12, label %35
12: ; preds = %8
%13 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%14 = call i32 @gets(i8* %13)
%15 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%16 = call i32 @convert(i8* %15)
store i32 %16, i32* %3
%17 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%18 = call i32 @gets(i8* %17)
%19 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%20 = call i32 @convert(i8* %19)
store i32 %20, i32* %4
%21 = load i32, i32* %3
%22 = load i32, i32* %4
%23 = call i32 @gcd(i32 %21, i32 %22)
%24 = icmp ne i32 %23, 1
br i1 %24, label %25, label %28
25: ; preds = %12
%26 = load i32, i32* %6
%27 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32 %26)
br label %31
28: ; preds = %12
%29 = load i32, i32* %6
%30 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i32 %29)
br label %31
31: ; preds = %28, %25
br label %32
32: ; preds = %31
%33 = load i32, i32* %6
%34 = add nsw i32 %33, 1
store i32 %34, i32* %6
br label %8
35: ; preds = %8
ret i32 0
}

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