Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#include <string.h>

long gcd(long x, long y)
{
	return y ? gcd(y, x % y) : x;
}

long lcm(long x, long y)
{
	return x * y / gcd(x, y);
}

int main(void)
{
	char S[100001], T[100001];
	long N, M, Slength, Tlength, min, tmp, i;
	scanf("%ld%ld%s%s", &N, &M, S, T);
	Slength = strlen(S);
	Tlength = strlen(T);
	tmp = lcm(N, M);
	//if (Slength / (tmp / N) < Tlength / (tmp / M)) min = Slength / (tmp / N);
	//else min = Tlength / (tmp / M);

	long LCM = lcm(tmp / N, tmp / M);

	for (i = 0; S[i / (tmp / N)] != '\0' && T[i / (tmp / M)] != '\0'; i += LCM) {
		if (S[i / (tmp / N)] != T[i / (tmp / M)]) {
			puts("-1");
			return 0;
		}
	}
	printf("%ld", tmp);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	cmpq	$0, -16(%rbp)
	je	.L2
	movq	-8(%rbp), %rax
	cqto
	idivq	-16(%rbp)
	movq	-16(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	gcd
	jmp	.L4
.L2:
	movq	-8(%rbp), %rax
.L4:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	gcd, .-gcd
	.globl	lcm
	.type	lcm, @function
lcm:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 3, -24
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	imulq	-32(%rbp), %rax
	movq	%rax, %rbx
	movq	-32(%rbp), %rdx
	movq	-24(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	gcd
	movq	%rax, %rcx
	movq	%rbx, %rax
	cqto
	idivq	%rcx
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	lcm, .-lcm
	.section	.rodata
.LC0:
	.string	"%ld%ld%s%s"
.LC1:
	.string	"-1"
.LC2:
	.string	"%ld"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-196608(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3488, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-100016(%rbp), %rsi
	leaq	-200032(%rbp), %rcx
	leaq	-200080(%rbp), %rdx
	leaq	-200088(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-200032(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movq	%rax, -200064(%rbp)
	leaq	-100016(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movq	%rax, -200056(%rbp)
	movq	-200080(%rbp), %rdx
	movq	-200088(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	lcm
	movq	%rax, -200048(%rbp)
	movq	-200080(%rbp), %rsi
	movq	-200048(%rbp), %rax
	cqto
	idivq	%rsi
	movq	%rax, %rcx
	movq	-200088(%rbp), %rdi
	movq	-200048(%rbp), %rax
	cqto
	idivq	%rdi
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	lcm
	movq	%rax, -200040(%rbp)
	movq	$0, -200072(%rbp)
	jmp	.L8
.L12:
	movq	-200088(%rbp), %rcx
	movq	-200048(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rax, %rsi
	movq	-200072(%rbp), %rax
	cqto
	idivq	%rsi
	movzbl	-200032(%rbp,%rax), %ecx
	movq	-200080(%rbp), %rdi
	movq	-200048(%rbp), %rax
	cqto
	idivq	%rdi
	movq	%rax, %rsi
	movq	-200072(%rbp), %rax
	cqto
	idivq	%rsi
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	%al, %cl
	je	.L9
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L13
.L9:
	movq	-200040(%rbp), %rax
	addq	%rax, -200072(%rbp)
.L8:
	movq	-200088(%rbp), %rcx
	movq	-200048(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rax, %rcx
	movq	-200072(%rbp), %rax
	cqto
	idivq	%rcx
	movzbl	-200032(%rbp,%rax), %eax
	testb	%al, %al
	je	.L11
	movq	-200080(%rbp), %rdi
	movq	-200048(%rbp), %rax
	cqto
	idivq	%rdi
	movq	%rax, %rsi
	movq	-200072(%rbp), %rax
	cqto
	idivq	%rsi
	movzbl	-100016(%rbp,%rax), %eax
	testb	%al, %al
	jne	.L12
.L11:
	movq	-200048(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L13:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.p2align 4
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB35:
	.cfi_startproc
	endbr64
	movq	%rdi, %rax
	movq	%rsi, %r8
	testq	%rsi, %rsi
	jne	.L3
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%rdx, %r8
.L3:
	cqto
	idivq	%r8
	movq	%r8, %rax
	testq	%rdx, %rdx
	jne	.L5
	movq	%r8, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%rdi, %r8
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE35:
	.size	gcd, .-gcd
	.p2align 4
	.globl	lcm
	.type	lcm, @function
lcm:
.LFB36:
	.cfi_startproc
	endbr64
	movq	%rdi, %rcx
	movq	%rdi, %rax
	imulq	%rsi, %rcx
	testq	%rsi, %rsi
	jne	.L10
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L12:
	movq	%rdx, %rsi
.L10:
	cqto
	idivq	%rsi
	movq	%rsi, %rax
	testq	%rdx, %rdx
	jne	.L12
	movq	%rcx, %rax
	cqto
	idivq	%rsi
	ret
	.p2align 4,,10
	.p2align 3
.L13:
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE36:
	.size	lcm, .-lcm
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%ld%ld%s%s"
.LC1:
	.string	"-1"
.LC2:
	.string	"%ld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB37:
	.cfi_startproc
	endbr64
	leaq	-196608(%rsp), %r11
	.cfi_def_cfa 11, 196616
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3448, %rsp
	.cfi_def_cfa_offset 200064
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 200040(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	leaq	16(%rsp), %rcx
	leaq	8(%rsp), %rdx
	leaq	100032(%rsp), %r8
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rsi
	movq	(%rsp), %r8
	movq	%rsi, %r10
	imulq	%r8, %r10
	testq	%rsi, %rsi
	je	.L25
	movq	%r8, %rax
	movq	%rsi, %rcx
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L26:
	movq	%rdx, %rcx
.L16:
	cqto
	idivq	%rcx
	movq	%rcx, %rax
	testq	%rdx, %rdx
	jne	.L26
.L15:
	movq	%r10, %rax
	cqto
	idivq	%rcx
	cqto
	movq	%rax, %r10
	idivq	%rsi
	movq	%rax, %rdi
	movq	%r10, %rax
	cqto
	movq	%rdi, %r9
	idivq	%r8
	imulq	%rax, %r9
	movq	%rax, %r8
	testq	%rdi, %rdi
	je	.L27
	movq	%rdi, %rcx
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L28:
	movq	%rdx, %rcx
.L18:
	cqto
	idivq	%rcx
	movq	%rcx, %rax
	testq	%rdx, %rdx
	jne	.L28
.L17:
	movq	%r9, %rax
	movzbl	16(%rsp), %esi
	cqto
	idivq	%rcx
	xorl	%ecx, %ecx
	movq	%rax, %r9
	testb	%sil, %sil
	jne	.L19
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L23:
	cmpb	%sil, %dl
	jne	.L35
	addq	%r9, %rcx
	movq	%rcx, %rax
	cqto
	idivq	%r8
	movzbl	16(%rsp,%rax), %esi
	testb	%sil, %sil
	je	.L20
.L19:
	movq	%rcx, %rax
	cqto
	idivq	%rdi
	movzbl	100032(%rsp,%rax), %edx
	testb	%dl, %dl
	jne	.L23
.L20:
	movq	%r10, %rdx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L22:
	movq	200040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L36
	xorl	%eax, %eax
	addq	$200056, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L35:
	.cfi_restore_state
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L22
.L27:
	movq	%rax, %rcx
	jmp	.L17
.L25:
	movq	%r8, %rcx
	jmp	.L15
.L36:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE37:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.p2align 4
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB35:
	.cfi_startproc
	endbr64
	movq	%rdi, %rax
	movq	%rsi, %r8
	testq	%rsi, %rsi
	jne	.L3
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%rdx, %r8
.L3:
	cqto
	idivq	%r8
	movq	%r8, %rax
	testq	%rdx, %rdx
	jne	.L5
	movq	%r8, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%rdi, %r8
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE35:
	.size	gcd, .-gcd
	.p2align 4
	.globl	lcm
	.type	lcm, @function
lcm:
.LFB36:
	.cfi_startproc
	endbr64
	movq	%rdi, %rcx
	movq	%rdi, %rax
	imulq	%rsi, %rcx
	testq	%rsi, %rsi
	jne	.L10
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L12:
	movq	%rdx, %rsi
.L10:
	cqto
	idivq	%rsi
	movq	%rsi, %rax
	testq	%rdx, %rdx
	jne	.L12
	movq	%rcx, %rax
	cqto
	idivq	%rsi
	ret
	.p2align 4,,10
	.p2align 3
.L13:
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE36:
	.size	lcm, .-lcm
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%ld%ld%s%s"
.LC1:
	.string	"-1"
.LC2:
	.string	"%ld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB37:
	.cfi_startproc
	endbr64
	leaq	-196608(%rsp), %r11
	.cfi_def_cfa 11, 196616
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3448, %rsp
	.cfi_def_cfa_offset 200064
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 200040(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	leaq	16(%rsp), %rcx
	leaq	8(%rsp), %rdx
	leaq	100032(%rsp), %r8
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rsi
	movq	(%rsp), %r8
	movq	%rsi, %r10
	imulq	%r8, %r10
	testq	%rsi, %rsi
	je	.L25
	movq	%r8, %rax
	movq	%rsi, %rcx
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L26:
	movq	%rdx, %rcx
.L16:
	cqto
	idivq	%rcx
	movq	%rcx, %rax
	testq	%rdx, %rdx
	jne	.L26
.L15:
	movq	%r10, %rax
	cqto
	idivq	%rcx
	cqto
	movq	%rax, %r10
	idivq	%rsi
	movq	%rax, %rdi
	movq	%r10, %rax
	cqto
	movq	%rdi, %r9
	idivq	%r8
	imulq	%rax, %r9
	movq	%rax, %r8
	testq	%rdi, %rdi
	je	.L27
	movq	%rdi, %rcx
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L28:
	movq	%rdx, %rcx
.L18:
	cqto
	idivq	%rcx
	movq	%rcx, %rax
	testq	%rdx, %rdx
	jne	.L28
.L17:
	movq	%r9, %rax
	movzbl	16(%rsp), %esi
	cqto
	idivq	%rcx
	xorl	%ecx, %ecx
	movq	%rax, %r9
	testb	%sil, %sil
	jne	.L19
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L23:
	cmpb	%sil, %dl
	jne	.L35
	addq	%r9, %rcx
	movq	%rcx, %rax
	cqto
	idivq	%r8
	movzbl	16(%rsp,%rax), %esi
	testb	%sil, %sil
	je	.L20
.L19:
	movq	%rcx, %rax
	cqto
	idivq	%rdi
	movzbl	100032(%rsp,%rax), %edx
	testb	%dl, %dl
	jne	.L23
.L20:
	movq	%r10, %rdx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L22:
	movq	200040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L36
	xorl	%eax, %eax
	addq	$200056, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L35:
	.cfi_restore_state
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L22
.L27:
	movq	%rax, %rcx
	jmp	.L17
.L25:
	movq	%r8, %rcx
	jmp	.L15
.L36:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE37:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include <stdio.h>
#include <string.h>

long gcd(long x, long y)
{
	return y ? gcd(y, x % y) : x;
}

long lcm(long x, long y)
{
	return x * y / gcd(x, y);
}

int main(void)
{
	char S[100001], T[100001];
	long N, M, Slength, Tlength, min, tmp, i;
	scanf("%ld%ld%s%s", &N, &M, S, T);
	Slength = strlen(S);
	Tlength = strlen(T);
	tmp = lcm(N, M);
	//if (Slength / (tmp / N) < Tlength / (tmp / M)) min = Slength / (tmp / N);
	//else min = Tlength / (tmp / M);

	long LCM = lcm(tmp / N, tmp / M);

	for (i = 0; S[i / (tmp / N)] != '\0' && T[i / (tmp / M)] != '\0'; i += LCM) {
		if (S[i / (tmp / N)] != T[i / (tmp / M)]) {
			puts("-1");
			return 0;
		}
	}
	printf("%ld", tmp);
	return 0;
}
3 2
acq
ae
 3 3
abcdef
abc
 15 9
dnsusrayukuaiia
rujdunuma
 3 4
asiaukvyartuind
aumnudjus
 15 9
dnausrayukusiia
dujrunuma
 1 2
acq
ae
 4 1
abq
ae
 15 16
dnausrayukusiia
dujrunuma
 1 1
`br
`e
 5 4
aiiaukuyarsusod
amtntdjur

6 3 -1
 -1
 45 2 4 240 -1
 -1

Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#include <string.h>

long gcd(long x, long y)
{
	return y ? gcd(y, x % y) : x;
}

long lcm(long x, long y)
{
	return x * y / gcd(x, y);
}

int main(void)
{
	char S[100001], T[100001];
	long N, M, Slength, Tlength, min, tmp, i;
	scanf("%ld%ld%s%s", &N, &M, S, T);
	Slength = strlen(S);
	Tlength = strlen(T);
	tmp = lcm(N, M);
	//if (Slength / (tmp / N) < Tlength / (tmp / M)) min = Slength / (tmp / N);
	//else min = Tlength / (tmp / M);

	long LCM = lcm(tmp / N, tmp / M);

	for (i = 0; S[i / (tmp / N)] != '\0' && T[i / (tmp / M)] != '\0'; i += LCM) {
		if (S[i / (tmp / N)] != T[i / (tmp / M)]) {
			puts("-1");
			return 0;
		}
	}
	printf("%ld", tmp);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	cmpq	$0, -16(%rbp)
	je	.L2
	movq	-8(%rbp), %rax
	cqto
	idivq	-16(%rbp)
	movq	-16(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	gcd
	jmp	.L4
.L2:
	movq	-8(%rbp), %rax
.L4:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	gcd, .-gcd
	.globl	lcm
	.type	lcm, @function
lcm:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 3, -24
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	imulq	-32(%rbp), %rax
	movq	%rax, %rbx
	movq	-32(%rbp), %rdx
	movq	-24(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	gcd
	movq	%rax, %rcx
	movq	%rbx, %rax
	cqto
	idivq	%rcx
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	lcm, .-lcm
	.section	.rodata
.LC0:
	.string	"%ld%ld%s%s"
.LC1:
	.string	"-1"
.LC2:
	.string	"%ld"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-196608(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3488, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-100016(%rbp), %rsi
	leaq	-200032(%rbp), %rcx
	leaq	-200080(%rbp), %rdx
	leaq	-200088(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-200032(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movq	%rax, -200064(%rbp)
	leaq	-100016(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movq	%rax, -200056(%rbp)
	movq	-200080(%rbp), %rdx
	movq	-200088(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	lcm
	movq	%rax, -200048(%rbp)
	movq	-200080(%rbp), %rsi
	movq	-200048(%rbp), %rax
	cqto
	idivq	%rsi
	movq	%rax, %rcx
	movq	-200088(%rbp), %rdi
	movq	-200048(%rbp), %rax
	cqto
	idivq	%rdi
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	lcm
	movq	%rax, -200040(%rbp)
	movq	$0, -200072(%rbp)
	jmp	.L8
.L12:
	movq	-200088(%rbp), %rcx
	movq	-200048(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rax, %rsi
	movq	-200072(%rbp), %rax
	cqto
	idivq	%rsi
	movzbl	-200032(%rbp,%rax), %ecx
	movq	-200080(%rbp), %rdi
	movq	-200048(%rbp), %rax
	cqto
	idivq	%rdi
	movq	%rax, %rsi
	movq	-200072(%rbp), %rax
	cqto
	idivq	%rsi
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	%al, %cl
	je	.L9
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L13
.L9:
	movq	-200040(%rbp), %rax
	addq	%rax, -200072(%rbp)
.L8:
	movq	-200088(%rbp), %rcx
	movq	-200048(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rax, %rcx
	movq	-200072(%rbp), %rax
	cqto
	idivq	%rcx
	movzbl	-200032(%rbp,%rax), %eax
	testb	%al, %al
	je	.L11
	movq	-200080(%rbp), %rdi
	movq	-200048(%rbp), %rax
	cqto
	idivq	%rdi
	movq	%rax, %rsi
	movq	-200072(%rbp), %rax
	cqto
	idivq	%rsi
	movzbl	-100016(%rbp,%rax), %eax
	testb	%al, %al
	jne	.L12
.L11:
	movq	-200048(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L13:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	cmpq	$0, -16(%rbp)
	je	.L2
	movq	-8(%rbp), %rax
	cqto
	idivq	-16(%rbp)
	movq	-16(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	gcd
	jmp	.L4
.L2:
	movq	-8(%rbp), %rax
.L4:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	gcd, .-gcd
	.globl	lcm
	.type	lcm, @function
lcm:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 3, -24
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	imulq	-32(%rbp), %rax
	movq	%rax, %rbx
	movq	-32(%rbp), %rdx
	movq	-24(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	gcd
	movq	%rax, %rcx
	movq	%rbx, %rax
	cqto
	idivq	%rcx
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	lcm, .-lcm
	.section	.rodata
.LC0:
	.string	"%ld%ld%s%s"
.LC1:
	.string	"-1"
.LC2:
	.string	"%ld"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-196608(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3488, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-100016(%rbp), %rsi
	leaq	-200032(%rbp), %rcx
	leaq	-200080(%rbp), %rdx
	leaq	-200088(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-200032(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movq	%rax, -200064(%rbp)
	leaq	-100016(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movq	%rax, -200056(%rbp)
	movq	-200080(%rbp), %rdx
	movq	-200088(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	lcm
	movq	%rax, -200048(%rbp)
	movq	-200080(%rbp), %rsi
	movq	-200048(%rbp), %rax
	cqto
	idivq	%rsi
	movq	%rax, %rcx
	movq	-200088(%rbp), %rdi
	movq	-200048(%rbp), %rax
	cqto
	idivq	%rdi
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	lcm
	movq	%rax, -200040(%rbp)
	movq	$0, -200072(%rbp)
	jmp	.L8
.L12:
	movq	-200088(%rbp), %rcx
	movq	-200048(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rax, %rsi
	movq	-200072(%rbp), %rax
	cqto
	idivq	%rsi
	movzbl	-200032(%rbp,%rax), %ecx
	movq	-200080(%rbp), %rdi
	movq	-200048(%rbp), %rax
	cqto
	idivq	%rdi
	movq	%rax, %rsi
	movq	-200072(%rbp), %rax
	cqto
	idivq	%rsi
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	%al, %cl
	je	.L9
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L13
.L9:
	movq	-200040(%rbp), %rax
	addq	%rax, -200072(%rbp)
.L8:
	movq	-200088(%rbp), %rcx
	movq	-200048(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rax, %rcx
	movq	-200072(%rbp), %rax
	cqto
	idivq	%rcx
	movzbl	-200032(%rbp,%rax), %eax
	testb	%al, %al
	je	.L11
	movq	-200080(%rbp), %rdi
	movq	-200048(%rbp), %rax
	cqto
	idivq	%rdi
	movq	%rax, %rsi
	movq	-200072(%rbp), %rax
	cqto
	idivq	%rsi
	movzbl	-100016(%rbp,%rax), %eax
	testb	%al, %al
	jne	.L12
.L11:
	movq	-200048(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L13:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
