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 <stdlib.h>
#define MAX 100000

int gcd(long int a, long int b) {
  if (b == 0) {
    return a;
  }
  return gcd(b, a % b);
}

int main() {
  long int N, M;

  char S[MAX], T[MAX];

  long int i;

  long int g, m, n, L;

  scanf("%ld %ld", &N, &M);
  scanf("%s", S);
  scanf("%s", T);

  g = gcd(N, M);
  n = M / g;
  m = N / g;
  L = M * N / g;

  for (i = 0; i < g; i++) {
    if (S[i * m] != T[i * n]) {
      printf("-1\n");
      return 0;
    }
  }

  printf("%ld\n", L);

  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB6:
	.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)
	jne	.L2
	movq	-8(%rbp), %rax
	jmp	.L3
.L2:
	movq	-8(%rbp), %rax
	cqto
	idivq	-16(%rbp)
	movq	-16(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	gcd
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	gcd, .-gcd
	.section	.rodata
.LC0:
	.string	"%ld %ld"
.LC1:
	.string	"%s"
.LC2:
	.string	"-1"
.LC3:
	.string	"%ld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.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	$3472, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-200064(%rbp), %rdx
	leaq	-200072(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-200016(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-100016(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-200064(%rbp), %rdx
	movq	-200072(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	gcd
	cltq
	movq	%rax, -200048(%rbp)
	movq	-200064(%rbp), %rax
	cqto
	idivq	-200048(%rbp)
	movq	%rax, -200040(%rbp)
	movq	-200072(%rbp), %rax
	cqto
	idivq	-200048(%rbp)
	movq	%rax, -200032(%rbp)
	movq	-200064(%rbp), %rdx
	movq	-200072(%rbp), %rax
	imulq	%rdx, %rax
	cqto
	idivq	-200048(%rbp)
	movq	%rax, -200024(%rbp)
	movq	$0, -200056(%rbp)
	jmp	.L5
.L8:
	movq	-200056(%rbp), %rax
	imulq	-200032(%rbp), %rax
	movzbl	-200016(%rbp,%rax), %edx
	movq	-200056(%rbp), %rax
	imulq	-200040(%rbp), %rax
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	%al, %dl
	je	.L6
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L9
.L6:
	addq	$1, -200056(%rbp)
.L5:
	movq	-200056(%rbp), %rax
	cmpq	-200048(%rbp), %rax
	jl	.L8
	movq	-200024(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L9:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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:
.LFB39:
	.cfi_startproc
	endbr64
	movq	%rdi, %rax
	testq	%rsi, %rsi
	jne	.L2
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L11:
	movq	%rdx, %rsi
.L2:
	cqto
	idivq	%rsi
	movq	%rsi, %rax
	testq	%rdx, %rdx
	jne	.L11
	movl	%esi, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%rdi, %rsi
	movl	%esi, %eax
	ret
	.cfi_endproc
.LFE39:
	.size	gcd, .-gcd
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%ld %ld"
.LC1:
	.string	"%s"
.LC2:
	.string	"-1"
.LC3:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	-196608(%rsp), %r11
	.cfi_def_cfa 11, 196640
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3424, %rsp
	.cfi_def_cfa_offset 200064
	leaq	.LC0(%rip), %rdi
	leaq	.LC1(%rip), %r12
	movq	%fs:40, %rax
	movq	%rax, 200024(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rdx
	movq	%rsp, %rsi
	leaq	16(%rsp), %rbp
	leaq	100016(%rsp), %rbx
	call	__isoc99_scanf@PLT
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%rbx, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %r9
	movq	(%rsp), %r10
	movq	%r9, %rcx
	movq	%r10, %rax
	testq	%r9, %r9
	jne	.L13
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L31:
	movq	%rdx, %rcx
.L13:
	cqto
	idivq	%rcx
	movq	%rcx, %rax
	testq	%rdx, %rdx
	jne	.L31
.L16:
	movq	%r9, %rax
	movslq	%ecx, %rcx
	movq	%rbp, %rdi
	movq	%rbx, %rsi
	cqto
	xorl	%r8d, %r8d
	idivq	%rcx
	movq	%rax, %r11
	movq	%r10, %rax
	cqto
	idivq	%rcx
	testq	%rcx, %rcx
	jg	.L19
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L17:
	addq	$1, %r8
	addq	%rax, %rdi
	addq	%r11, %rsi
	cmpq	%r8, %rcx
	je	.L15
.L19:
	movzbl	(%rsi), %ebx
	cmpb	%bl, (%rdi)
	je	.L17
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L18
.L15:
	movq	%r9, %rax
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	imulq	%r10, %rax
	cqto
	idivq	%rcx
	movq	%rax, %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L18:
	movq	200024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L32
	addq	$200032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L30:
	.cfi_restore_state
	movq	%r10, %rcx
	jmp	.L16
.L32:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.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:
.LFB39:
	.cfi_startproc
	endbr64
	movq	%rdi, %rax
	testq	%rsi, %rsi
	jne	.L2
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L11:
	movq	%rdx, %rsi
.L2:
	cqto
	idivq	%rsi
	movq	%rsi, %rax
	testq	%rdx, %rdx
	jne	.L11
	movl	%esi, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%rdi, %rsi
	movl	%esi, %eax
	ret
	.cfi_endproc
.LFE39:
	.size	gcd, .-gcd
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%ld %ld"
.LC1:
	.string	"%s"
.LC2:
	.string	"-1"
.LC3:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	-196608(%rsp), %r11
	.cfi_def_cfa 11, 196640
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3424, %rsp
	.cfi_def_cfa_offset 200064
	leaq	.LC0(%rip), %rdi
	leaq	.LC1(%rip), %r12
	movq	%fs:40, %rax
	movq	%rax, 200024(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rdx
	movq	%rsp, %rsi
	leaq	16(%rsp), %rbp
	leaq	100016(%rsp), %rbx
	call	__isoc99_scanf@PLT
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%rbx, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %r9
	movq	(%rsp), %r10
	movq	%r9, %rcx
	movq	%r10, %rax
	testq	%r9, %r9
	jne	.L13
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L31:
	movq	%rdx, %rcx
.L13:
	cqto
	idivq	%rcx
	movq	%rcx, %rax
	testq	%rdx, %rdx
	jne	.L31
.L16:
	movq	%r9, %rax
	movslq	%ecx, %rcx
	movq	%rbp, %rdi
	movq	%rbx, %rsi
	cqto
	xorl	%r8d, %r8d
	idivq	%rcx
	movq	%rax, %r11
	movq	%r10, %rax
	cqto
	idivq	%rcx
	testq	%rcx, %rcx
	jg	.L19
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L17:
	addq	$1, %r8
	addq	%rax, %rdi
	addq	%r11, %rsi
	cmpq	%r8, %rcx
	je	.L15
.L19:
	movzbl	(%rsi), %ebx
	cmpb	%bl, (%rdi)
	je	.L17
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L18
.L15:
	movq	%r9, %rax
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	imulq	%r10, %rax
	cqto
	idivq	%rcx
	movq	%rax, %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L18:
	movq	200024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L32
	addq	$200032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L30:
	.cfi_restore_state
	movq	%r10, %rcx
	jmp	.L16
.L32:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.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 <stdlib.h>
#define MAX 100000

int gcd(long int a, long int b) {
  if (b == 0) {
    return a;
  }
  return gcd(b, a % b);
}

int main() {
  long int N, M;

  char S[MAX], T[MAX];

  long int i;

  long int g, m, n, L;

  scanf("%ld %ld", &N, &M);
  scanf("%s", S);
  scanf("%s", T);

  g = gcd(N, M);
  n = M / g;
  m = N / g;
  L = M * N / g;

  for (i = 0; i < g; i++) {
    if (S[i * m] != T[i * n]) {
      printf("-1\n");
      return 0;
    }
  }

  printf("%ld\n", L);

  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
 12
 45
 2
 4
 240
 1
 20

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 <stdlib.h>
#define MAX 100000

int gcd(long int a, long int b) {
  if (b == 0) {
    return a;
  }
  return gcd(b, a % b);
}

int main() {
  long int N, M;

  char S[MAX], T[MAX];

  long int i;

  long int g, m, n, L;

  scanf("%ld %ld", &N, &M);
  scanf("%s", S);
  scanf("%s", T);

  g = gcd(N, M);
  n = M / g;
  m = N / g;
  L = M * N / g;

  for (i = 0; i < g; i++) {
    if (S[i * m] != T[i * n]) {
      printf("-1\n");
      return 0;
    }
  }

  printf("%ld\n", L);

  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB6:
	.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)
	jne	.L2
	movq	-8(%rbp), %rax
	jmp	.L3
.L2:
	movq	-8(%rbp), %rax
	cqto
	idivq	-16(%rbp)
	movq	-16(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	gcd
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	gcd, .-gcd
	.section	.rodata
.LC0:
	.string	"%ld %ld"
.LC1:
	.string	"%s"
.LC2:
	.string	"-1"
.LC3:
	.string	"%ld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.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	$3472, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-200064(%rbp), %rdx
	leaq	-200072(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-200016(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-100016(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-200064(%rbp), %rdx
	movq	-200072(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	gcd
	cltq
	movq	%rax, -200048(%rbp)
	movq	-200064(%rbp), %rax
	cqto
	idivq	-200048(%rbp)
	movq	%rax, -200040(%rbp)
	movq	-200072(%rbp), %rax
	cqto
	idivq	-200048(%rbp)
	movq	%rax, -200032(%rbp)
	movq	-200064(%rbp), %rdx
	movq	-200072(%rbp), %rax
	imulq	%rdx, %rax
	cqto
	idivq	-200048(%rbp)
	movq	%rax, -200024(%rbp)
	movq	$0, -200056(%rbp)
	jmp	.L5
.L8:
	movq	-200056(%rbp), %rax
	imulq	-200032(%rbp), %rax
	movzbl	-200016(%rbp,%rax), %edx
	movq	-200056(%rbp), %rax
	imulq	-200040(%rbp), %rax
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	%al, %dl
	je	.L6
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L9
.L6:
	addq	$1, -200056(%rbp)
.L5:
	movq	-200056(%rbp), %rax
	cmpq	-200048(%rbp), %rax
	jl	.L8
	movq	-200024(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L9:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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:
.LFB6:
	.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)
	jne	.L2
	movq	-8(%rbp), %rax
	jmp	.L3
.L2:
	movq	-8(%rbp), %rax
	cqto
	idivq	-16(%rbp)
	movq	-16(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	gcd
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	gcd, .-gcd
	.section	.rodata
.LC0:
	.string	"%ld %ld"
.LC1:
	.string	"%s"
.LC2:
	.string	"-1"
.LC3:
	.string	"%ld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.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	$3472, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-200064(%rbp), %rdx
	leaq	-200072(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-200016(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-100016(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-200064(%rbp), %rdx
	movq	-200072(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	gcd
	cltq
	movq	%rax, -200048(%rbp)
	movq	-200064(%rbp), %rax
	cqto
	idivq	-200048(%rbp)
	movq	%rax, -200040(%rbp)
	movq	-200072(%rbp), %rax
	cqto
	idivq	-200048(%rbp)
	movq	%rax, -200032(%rbp)
	movq	-200064(%rbp), %rdx
	movq	-200072(%rbp), %rax
	imulq	%rdx, %rax
	cqto
	idivq	-200048(%rbp)
	movq	%rax, -200024(%rbp)
	movq	$0, -200056(%rbp)
	jmp	.L5
.L8:
	movq	-200056(%rbp), %rax
	imulq	-200032(%rbp), %rax
	movzbl	-200016(%rbp,%rax), %edx
	movq	-200056(%rbp), %rax
	imulq	-200040(%rbp), %rax
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	%al, %dl
	je	.L6
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L9
.L6:
	addq	$1, -200056(%rbp)
.L5:
	movq	-200056(%rbp), %rax
	cmpq	-200048(%rbp), %rax
	jl	.L8
	movq	-200024(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L9:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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:
