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

```c
#include<stdio.h>
int main(){
	long long int a,b,bai[1000]={},yaku[1000]={},kai[1000]={},e,f=0,g,bosu,j=0,m,n;
	while(scanf("%lld %lld",&a,&b)!=EOF){
		kai[j]=1;
		if(a==0&&b==0)break;
		if(a>b){
		m=a;
		n=b;}else{m=b;n=a;}
		while(m%n!=0){
			g=n;
			n=m%n;
			m=g;
			kai[j]++;
		}
		yaku[j]=n;
		bosu=a*b;
		bai[j]=bosu/yaku[j];
		j++;
	}
	for(e=0;e<j;e++){
		printf("%lld %lld\n",yaku[e],kai[e]);
	}
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld %lld"
.LC1:
	.string	"%lld %lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$4096, %rsp
	.cfi_def_cfa_offset 4152
	orq	$0, (%rsp)
	subq	$4096, %rsp
	.cfi_def_cfa_offset 8248
	orq	$0, (%rsp)
	subq	$4096, %rsp
	.cfi_def_cfa_offset 12344
	orq	$0, (%rsp)
	subq	$3752, %rsp
	.cfi_def_cfa_offset 16096
	movl	$1000, %ecx
	xorl	%r15d, %r15d
	leaq	.LC0(%rip), %r12
	movq	%fs:40, %rax
	movq	%rax, 16024(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rbp
	leaq	8(%rsp), %r14
	movq	%rsp, %r13
	movq	%rbp, %rdi
	leaq	8016(%rsp), %rbx
	rep stosq
	movl	$1000, %ecx
	movq	%rbx, %rdi
	rep stosq
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L24:
	testq	%rsi, %rsi
	je	.L10
	movq	%rsi, %rcx
	testq	%rsi, %rsi
	js	.L7
	movq	%rsi, %rax
	cqto
	idivq	%rdi
	movq	%rdx, %rcx
	testq	%rdx, %rdx
	je	.L7
	movl	$2, %r8d
.L12:
	movq	%r8, (%rbx,%r15,8)
.L7:
	movq	%rcx, 0(%rbp,%r15,8)
	addq	$1, %r15
.L2:
	xorl	%eax, %eax
	movq	%r14, %rdx
	movq	%r13, %rsi
	movq	%r12, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L10
	movq	(%rsp), %rdi
	movq	$1, (%rbx,%r15,8)
	movq	8(%rsp), %rsi
	testq	%rdi, %rdi
	je	.L24
	cmpq	%rsi, %rdi
	jle	.L25
.L6:
	movq	%rdi, %rax
	cqto
	idivq	%rsi
	movq	%rdx, %rcx
	testq	%rdx, %rdx
	je	.L15
	movl	$2, %edi
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L16:
	movq	%rdx, %rcx
.L8:
	movq	%rsi, %rax
	movq	%rdi, %r8
	movq	%rcx, %rsi
	addq	$1, %rdi
	cqto
	idivq	%rcx
	testq	%rdx, %rdx
	jne	.L16
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L25:
	movq	%rdi, %rax
	movq	%rsi, %rdi
	movq	%rax, %rsi
	jmp	.L6
.L10:
	xorl	%r12d, %r12d
	leaq	.LC1(%rip), %r13
	testq	%r15, %r15
	je	.L11
	.p2align 4,,10
	.p2align 3
.L5:
	movq	(%rbx,%r12,8), %rcx
	movq	0(%rbp,%r12,8), %rdx
	movq	%r13, %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	addq	$1, %r12
	call	__printf_chk@PLT
	cmpq	%r12, %r15
	jne	.L5
.L11:
	movq	16024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L26
	addq	$16040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L15:
	.cfi_restore_state
	movq	%rsi, %rcx
	jmp	.L7
.L26:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld %lld"
.LC1:
	.string	"%lld %lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$4096, %rsp
	.cfi_def_cfa_offset 4152
	orq	$0, (%rsp)
	subq	$4096, %rsp
	.cfi_def_cfa_offset 8248
	orq	$0, (%rsp)
	subq	$4096, %rsp
	.cfi_def_cfa_offset 12344
	orq	$0, (%rsp)
	subq	$3752, %rsp
	.cfi_def_cfa_offset 16096
	movl	$1000, %ecx
	xorl	%r15d, %r15d
	leaq	.LC0(%rip), %r12
	movq	%fs:40, %rax
	movq	%rax, 16024(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rbp
	leaq	8(%rsp), %r14
	movq	%rsp, %r13
	movq	%rbp, %rdi
	leaq	8016(%rsp), %rbx
	rep stosq
	movl	$1000, %ecx
	movq	%rbx, %rdi
	rep stosq
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L24:
	testq	%rsi, %rsi
	je	.L10
	movq	%rsi, %rcx
	testq	%rsi, %rsi
	js	.L7
	movq	%rsi, %rax
	cqto
	idivq	%rdi
	movq	%rdx, %rcx
	testq	%rdx, %rdx
	je	.L7
	movl	$2, %r8d
.L12:
	movq	%r8, (%rbx,%r15,8)
.L7:
	movq	%rcx, 0(%rbp,%r15,8)
	addq	$1, %r15
.L2:
	xorl	%eax, %eax
	movq	%r14, %rdx
	movq	%r13, %rsi
	movq	%r12, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L10
	movq	(%rsp), %rdi
	movq	$1, (%rbx,%r15,8)
	movq	8(%rsp), %rsi
	testq	%rdi, %rdi
	je	.L24
	cmpq	%rsi, %rdi
	jle	.L25
.L6:
	movq	%rdi, %rax
	cqto
	idivq	%rsi
	movq	%rdx, %rcx
	testq	%rdx, %rdx
	je	.L15
	movl	$2, %edi
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L16:
	movq	%rdx, %rcx
.L8:
	movq	%rsi, %rax
	movq	%rdi, %r8
	movq	%rcx, %rsi
	addq	$1, %rdi
	cqto
	idivq	%rcx
	testq	%rdx, %rdx
	jne	.L16
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L25:
	movq	%rdi, %rax
	movq	%rsi, %rdi
	movq	%rax, %rsi
	jmp	.L6
.L10:
	xorl	%r12d, %r12d
	leaq	.LC1(%rip), %r13
	testq	%r15, %r15
	je	.L11
	.p2align 4,,10
	.p2align 3
.L5:
	movq	(%rbx,%r12,8), %rcx
	movq	0(%rbp,%r12,8), %rdx
	movq	%r13, %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	addq	$1, %r12
	call	__printf_chk@PLT
	cmpq	%r12, %r15
	jne	.L5
.L11:
	movq	16024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L26
	addq	$16040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L15:
	.cfi_restore_state
	movq	%rsi, %rcx
	jmp	.L7
.L26:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld %lld"
.LC1:
	.string	"%lld %lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$4096, %rsp
	.cfi_def_cfa_offset 4152
	orq	$0, (%rsp)
	subq	$4096, %rsp
	.cfi_def_cfa_offset 8248
	orq	$0, (%rsp)
	subq	$4096, %rsp
	.cfi_def_cfa_offset 12344
	orq	$0, (%rsp)
	subq	$3752, %rsp
	.cfi_def_cfa_offset 16096
	movl	$1000, %ecx
	xorl	%r15d, %r15d
	leaq	.LC0(%rip), %r12
	movq	%fs:40, %rax
	movq	%rax, 16024(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rbp
	leaq	8(%rsp), %r14
	movq	%rsp, %r13
	movq	%rbp, %rdi
	leaq	8016(%rsp), %rbx
	rep stosq
	movl	$1000, %ecx
	movq	%rbx, %rdi
	rep stosq
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L24:
	testq	%rsi, %rsi
	je	.L10
	movq	%rsi, %rcx
	testq	%rsi, %rsi
	js	.L7
	movq	%rsi, %rax
	cqto
	idivq	%rdi
	movq	%rdx, %rcx
	testq	%rdx, %rdx
	je	.L7
	movl	$2, %r8d
.L12:
	movq	%r8, (%rbx,%r15,8)
.L7:
	movq	%rcx, 0(%rbp,%r15,8)
	addq	$1, %r15
.L2:
	xorl	%eax, %eax
	movq	%r14, %rdx
	movq	%r13, %rsi
	movq	%r12, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L10
	movq	(%rsp), %rdi
	movq	$1, (%rbx,%r15,8)
	movq	8(%rsp), %rsi
	testq	%rdi, %rdi
	je	.L24
	cmpq	%rsi, %rdi
	jle	.L25
.L6:
	movq	%rdi, %rax
	cqto
	idivq	%rsi
	movq	%rdx, %rcx
	testq	%rdx, %rdx
	je	.L15
	movl	$2, %edi
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L16:
	movq	%rdx, %rcx
.L8:
	movq	%rsi, %rax
	movq	%rdi, %r8
	movq	%rcx, %rsi
	addq	$1, %rdi
	cqto
	idivq	%rcx
	testq	%rdx, %rdx
	jne	.L16
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L25:
	movq	%rdi, %rax
	movq	%rsi, %rdi
	movq	%rax, %rsi
	jmp	.L6
.L10:
	xorl	%r12d, %r12d
	leaq	.LC1(%rip), %r13
	testq	%r15, %r15
	je	.L11
	.p2align 4,,10
	.p2align 3
.L5:
	movq	(%rbx,%r12,8), %rcx
	movq	0(%rbp,%r12,8), %rdx
	movq	%r13, %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	addq	$1, %r12
	call	__printf_chk@PLT
	cmpq	%r12, %r15
	jne	.L5
.L11:
	movq	16024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L26
	addq	$16040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L15:
	.cfi_restore_state
	movq	%rsi, %rcx
	jmp	.L7
.L26:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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:
```
```c
#include<stdio.h>
int main(){
	long long int a,b,bai[1000]={},yaku[1000]={},kai[1000]={},e,f=0,g,bosu,j=0,m,n;
	while(scanf("%lld %lld",&a,&b)!=EOF){
		kai[j]=1;
		if(a==0&&b==0)break;
		if(a>b){
		m=a;
		n=b;}else{m=b;n=a;}
		while(m%n!=0){
			g=n;
			n=m%n;
			m=g;
			kai[j]++;
		}
		yaku[j]=n;
		bosu=a*b;
		bai[j]=bosu/yaku[j];
		j++;
	}
	for(e=0;e<j;e++){
		printf("%lld %lld\n",yaku[e],kai[e]);
	}
	return 0;
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
int main(){
	long long int a,b,bai[1000]={},yaku[1000]={},kai[1000]={},e,f=0,g,bosu,j=0,m,n;
	while(scanf("%lld %lld",&a,&b)!=EOF){
		kai[j]=1;
		if(a==0&&b==0)break;
		if(a>b){
		m=a;
		n=b;}else{m=b;n=a;}
		while(m%n!=0){
			g=n;
			n=m%n;
			m=g;
			kai[j]++;
		}
		yaku[j]=n;
		bosu=a*b;
		bai[j]=bosu/yaku[j];
		j++;
	}
	for(e=0;e<j;e++){
		printf("%lld %lld\n",yaku[e],kai[e]);
	}
	return 0;
}```

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.
Optimized Assembly Code:

1071 1029
5 3
0 0
 1251 1029
5 3
0 0
 1251 1802
5 3
0 0
 1071 446
5 3
0 0
 1071 2
5 3
0 0
 1071 1029
2 3
0 0
 1251 3458
5 3
0 0
 826 2
5 3
0 0
 1251 3458
10 3
0 0
 1164 1029
4 3
0 0

21 3
1 3
 3 8
1 3
 1 9
1 3
 1 5
1 3
 1 2
1 3
 21 3
1 2
 1 7
1 3
 2 1
1 3
 1 7
1 2
 3 8
1 2

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

```c
#include<stdio.h>
int main(){
	long long int a,b,bai[1000]={},yaku[1000]={},kai[1000]={},e,f=0,g,bosu,j=0,m,n;
	while(scanf("%lld %lld",&a,&b)!=EOF){
		kai[j]=1;
		if(a==0&&b==0)break;
		if(a>b){
		m=a;
		n=b;}else{m=b;n=a;}
		while(m%n!=0){
			g=n;
			n=m%n;
			m=g;
			kai[j]++;
		}
		yaku[j]=n;
		bosu=a*b;
		bai[j]=bosu/yaku[j];
		j++;
	}
	for(e=0;e<j;e++){
		printf("%lld %lld\n",yaku[e],kai[e]);
	}
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld %lld"
.LC1:
	.string	"%lld %lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$4096, %rsp
	.cfi_def_cfa_offset 4152
	orq	$0, (%rsp)
	subq	$4096, %rsp
	.cfi_def_cfa_offset 8248
	orq	$0, (%rsp)
	subq	$4096, %rsp
	.cfi_def_cfa_offset 12344
	orq	$0, (%rsp)
	subq	$3752, %rsp
	.cfi_def_cfa_offset 16096
	movl	$1000, %ecx
	xorl	%r15d, %r15d
	leaq	.LC0(%rip), %r12
	movq	%fs:40, %rax
	movq	%rax, 16024(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rbp
	leaq	8(%rsp), %r14
	movq	%rsp, %r13
	movq	%rbp, %rdi
	leaq	8016(%rsp), %rbx
	rep stosq
	movl	$1000, %ecx
	movq	%rbx, %rdi
	rep stosq
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L24:
	testq	%rsi, %rsi
	je	.L10
	movq	%rsi, %rcx
	testq	%rsi, %rsi
	js	.L7
	movq	%rsi, %rax
	cqto
	idivq	%rdi
	movq	%rdx, %rcx
	testq	%rdx, %rdx
	je	.L7
	movl	$2, %r8d
.L12:
	movq	%r8, (%rbx,%r15,8)
.L7:
	movq	%rcx, 0(%rbp,%r15,8)
	addq	$1, %r15
.L2:
	xorl	%eax, %eax
	movq	%r14, %rdx
	movq	%r13, %rsi
	movq	%r12, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L10
	movq	(%rsp), %rdi
	movq	$1, (%rbx,%r15,8)
	movq	8(%rsp), %rsi
	testq	%rdi, %rdi
	je	.L24
	cmpq	%rsi, %rdi
	jle	.L25
.L6:
	movq	%rdi, %rax
	cqto
	idivq	%rsi
	movq	%rdx, %rcx
	testq	%rdx, %rdx
	je	.L15
	movl	$2, %edi
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L16:
	movq	%rdx, %rcx
.L8:
	movq	%rsi, %rax
	movq	%rdi, %r8
	movq	%rcx, %rsi
	addq	$1, %rdi
	cqto
	idivq	%rcx
	testq	%rdx, %rdx
	jne	.L16
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L25:
	movq	%rdi, %rax
	movq	%rsi, %rdi
	movq	%rax, %rsi
	jmp	.L6
.L10:
	xorl	%r12d, %r12d
	leaq	.LC1(%rip), %r13
	testq	%r15, %r15
	je	.L11
	.p2align 4,,10
	.p2align 3
.L5:
	movq	(%rbx,%r12,8), %rcx
	movq	0(%rbp,%r12,8), %rdx
	movq	%r13, %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	addq	$1, %r12
	call	__printf_chk@PLT
	cmpq	%r12, %r15
	jne	.L5
.L11:
	movq	16024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L26
	addq	$16040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L15:
	.cfi_restore_state
	movq	%rsi, %rcx
	jmp	.L7
.L26:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld %lld"
.LC1:
	.string	"%lld %lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$4096, %rsp
	.cfi_def_cfa_offset 4152
	orq	$0, (%rsp)
	subq	$4096, %rsp
	.cfi_def_cfa_offset 8248
	orq	$0, (%rsp)
	subq	$4096, %rsp
	.cfi_def_cfa_offset 12344
	orq	$0, (%rsp)
	subq	$3752, %rsp
	.cfi_def_cfa_offset 16096
	movl	$1000, %ecx
	xorl	%r15d, %r15d
	leaq	.LC0(%rip), %r12
	movq	%fs:40, %rax
	movq	%rax, 16024(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rbp
	leaq	8(%rsp), %r14
	movq	%rsp, %r13
	movq	%rbp, %rdi
	leaq	8016(%rsp), %rbx
	rep stosq
	movl	$1000, %ecx
	movq	%rbx, %rdi
	rep stosq
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L24:
	testq	%rsi, %rsi
	je	.L10
	movq	%rsi, %rcx
	testq	%rsi, %rsi
	js	.L7
	movq	%rsi, %rax
	cqto
	idivq	%rdi
	movq	%rdx, %rcx
	testq	%rdx, %rdx
	je	.L7
	movl	$2, %r8d
.L12:
	movq	%r8, (%rbx,%r15,8)
.L7:
	movq	%rcx, 0(%rbp,%r15,8)
	addq	$1, %r15
.L2:
	xorl	%eax, %eax
	movq	%r14, %rdx
	movq	%r13, %rsi
	movq	%r12, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L10
	movq	(%rsp), %rdi
	movq	$1, (%rbx,%r15,8)
	movq	8(%rsp), %rsi
	testq	%rdi, %rdi
	je	.L24
	cmpq	%rsi, %rdi
	jle	.L25
.L6:
	movq	%rdi, %rax
	cqto
	idivq	%rsi
	movq	%rdx, %rcx
	testq	%rdx, %rdx
	je	.L15
	movl	$2, %edi
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L16:
	movq	%rdx, %rcx
.L8:
	movq	%rsi, %rax
	movq	%rdi, %r8
	movq	%rcx, %rsi
	addq	$1, %rdi
	cqto
	idivq	%rcx
	testq	%rdx, %rdx
	jne	.L16
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L25:
	movq	%rdi, %rax
	movq	%rsi, %rdi
	movq	%rax, %rsi
	jmp	.L6
.L10:
	xorl	%r12d, %r12d
	leaq	.LC1(%rip), %r13
	testq	%r15, %r15
	je	.L11
	.p2align 4,,10
	.p2align 3
.L5:
	movq	(%rbx,%r12,8), %rcx
	movq	0(%rbp,%r12,8), %rdx
	movq	%r13, %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	addq	$1, %r12
	call	__printf_chk@PLT
	cmpq	%r12, %r15
	jne	.L5
.L11:
	movq	16024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L26
	addq	$16040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L15:
	.cfi_restore_state
	movq	%rsi, %rcx
	jmp	.L7
.L26:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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:
```