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

```c
/* AOJ 0140:Bus Line */
#include <stdio.h>
#include <string.h>
 
int main(){
  char a[]="6 7 8 9 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9";
  char *b,*c,*d,e,f;
  int h,i;
  scanf("%d\n",&h);
  for(i=0;i<h;i++){
    scanf("%c %c\n",&e,&f);
    b=strchr(a,e);
    c=strchr(b+1,e);
    d=strchr(b+1,f);
    if(c==NULL || c>d)c=b;
    for(;c<=d;c++) printf("%c",c[0]);
    printf("\n");
  }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%c %c\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$96, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movabsq	$2321922508316942390, %rax
	movabsq	$2319952162004934709, %rdx
	movq	%rax, -48(%rbp)
	movq	%rdx, -40(%rbp)
	movabsq	$2319952153414737969, %rax
	movabsq	$2321078070501711923, %rdx
	movq	%rax, -32(%rbp)
	movq	%rdx, -24(%rbp)
	movl	$540549175, -16(%rbp)
	movw	$57, -12(%rbp)
	leaq	-80(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -76(%rbp)
	jmp	.L2
.L7:
	leaq	-81(%rbp), %rdx
	leaq	-82(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movzbl	-82(%rbp), %eax
	movsbl	%al, %edx
	leaq	-48(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	strchr@PLT
	movq	%rax, -64(%rbp)
	movzbl	-82(%rbp), %eax
	movsbl	%al, %eax
	movq	-64(%rbp), %rdx
	addq	$1, %rdx
	movl	%eax, %esi
	movq	%rdx, %rdi
	call	strchr@PLT
	movq	%rax, -72(%rbp)
	movzbl	-81(%rbp), %eax
	movsbl	%al, %eax
	movq	-64(%rbp), %rdx
	addq	$1, %rdx
	movl	%eax, %esi
	movq	%rdx, %rdi
	call	strchr@PLT
	movq	%rax, -56(%rbp)
	cmpq	$0, -72(%rbp)
	je	.L3
	movq	-72(%rbp), %rax
	cmpq	-56(%rbp), %rax
	jbe	.L5
.L3:
	movq	-64(%rbp), %rax
	movq	%rax, -72(%rbp)
	jmp	.L5
.L6:
	movq	-72(%rbp), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar@PLT
	addq	$1, -72(%rbp)
.L5:
	movq	-72(%rbp), %rax
	cmpq	-56(%rbp), %rax
	jbe	.L6
	movl	$10, %edi
	call	putchar@PLT
	addl	$1, -76(%rbp)
.L2:
	movl	-80(%rbp), %eax
	cmpl	%eax, -76(%rbp)
	jl	.L7
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%c %c\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$57, %edx
	leaq	.LC0(%rip), %rdi
	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	$88, %rsp
	.cfi_def_cfa_offset 144
	movdqa	.LC2(%rip), %xmm0
	movq	%fs:40, %rax
	movq	%rax, 72(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	movl	$540549175, 64(%rsp)
	movaps	%xmm0, 32(%rsp)
	movdqa	.LC3(%rip), %xmm0
	movw	%dx, 68(%rsp)
	movaps	%xmm0, 48(%rsp)
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L2
	leaq	32(%rsp), %rax
	xorl	%ebp, %ebp
	leaq	27(%rsp), %r15
	movq	%rax, 8(%rsp)
	leaq	26(%rsp), %r14
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%r15, %rdx
	movq	%r14, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movsbl	26(%rsp), %r12d
	movq	8(%rsp), %rdi
	movl	%r12d, %esi
	call	strchr@PLT
	movl	%r12d, %esi
	leaq	1(%rax), %rbx
	movq	%rax, %r13
	movq	%rbx, %rdi
	call	strchr@PLT
	movsbl	27(%rsp), %esi
	movq	%rbx, %rdi
	movq	%rax, %r12
	call	strchr@PLT
	movq	%rax, %rbx
	testq	%r12, %r12
	je	.L9
	cmpq	%rax, %r12
	ja	.L9
	.p2align 4,,10
	.p2align 3
.L6:
	movsbl	(%r12), %edi
	addq	$1, %r12
	call	putchar@PLT
	cmpq	%r12, %rbx
	jnb	.L6
.L5:
	movl	$10, %edi
	addl	$1, %ebp
	call	putchar@PLT
	cmpl	%ebp, 28(%rsp)
	jg	.L7
.L2:
	movq	72(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$88, %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
	.p2align 4,,10
	.p2align 3
.L9:
	.cfi_restore_state
	cmpq	%rbx, %r13
	ja	.L5
	movq	%r13, %r12
	jmp	.L6
.L17:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC2:
	.quad	2321922508316942390
	.quad	2319952162004934709
	.align 16
.LC3:
	.quad	2319952153414737969
	.quad	2321078070501711923
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%c %c\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$57, %edx
	leaq	.LC0(%rip), %rdi
	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	$88, %rsp
	.cfi_def_cfa_offset 144
	movdqa	.LC2(%rip), %xmm0
	movq	%fs:40, %rax
	movq	%rax, 72(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	movl	$540549175, 64(%rsp)
	movaps	%xmm0, 32(%rsp)
	movdqa	.LC3(%rip), %xmm0
	movw	%dx, 68(%rsp)
	movaps	%xmm0, 48(%rsp)
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L2
	leaq	32(%rsp), %rax
	xorl	%ebp, %ebp
	leaq	27(%rsp), %r15
	movq	%rax, 8(%rsp)
	leaq	26(%rsp), %r14
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%r15, %rdx
	movq	%r14, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movsbl	26(%rsp), %r12d
	movq	8(%rsp), %rdi
	movl	%r12d, %esi
	call	strchr@PLT
	movl	%r12d, %esi
	leaq	1(%rax), %rbx
	movq	%rax, %r13
	movq	%rbx, %rdi
	call	strchr@PLT
	movsbl	27(%rsp), %esi
	movq	%rbx, %rdi
	movq	%rax, %r12
	call	strchr@PLT
	movq	%rax, %rbx
	testq	%r12, %r12
	je	.L9
	cmpq	%rax, %r12
	ja	.L9
	.p2align 4,,10
	.p2align 3
.L6:
	movsbl	(%r12), %edi
	addq	$1, %r12
	call	putchar@PLT
	cmpq	%r12, %rbx
	jnb	.L6
.L5:
	movl	$10, %edi
	addl	$1, %ebp
	call	putchar@PLT
	cmpl	%ebp, 28(%rsp)
	jg	.L7
.L2:
	movq	72(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$88, %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
	.p2align 4,,10
	.p2align 3
.L9:
	.cfi_restore_state
	cmpq	%rbx, %r13
	ja	.L5
	movq	%r13, %r12
	jmp	.L6
.L17:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC2:
	.quad	2321922508316942390
	.quad	2319952162004934709
	.align 16
.LC3:
	.quad	2319952153414737969
	.quad	2321078070501711923
	.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:

/* AOJ 0140:Bus Line */
#include <stdio.h>
#include <string.h>
 
int main(){
  char a[]="6 7 8 9 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9";
  char *b,*c,*d,e,f;
  int h,i;
  scanf("%d\n",&h);
  for(i=0;i<h;i++){
    scanf("%c %c\n",&e,&f);
    b=strchr(a,e);
    c=strchr(b+1,e);
    d=strchr(b+1,f);
    if(c==NULL || c>d)c=b;
    for(;c<=d;c++) printf("%c",c[0]);
    printf("\n");
  }
  return 0;
}
2
2 5
4 2
 2
2 1
4 2
 2
2 0
4 2
 2
1 4
4 2
 2
2 0
4 0
 2
2 0
4 1
 2
1 8
4 2
 2
2 0
3 0
 2
2 0
1 1
 2
1 8
4 0

2 3 4 5
4 3 2
 2 1
4 3 2
 2 1 0
4 3 2
 1 2 3 4
4 3 2
 2 1 0
4 3 2 1 0
 2 1 0
4 3 2 1
 1 2 3 4 5 6 7 8
4 3 2
 2 1 0
3 2 1 0
 2 1 0
1
 1 2 3 4 5 6 7 8
4 3 2 1 0

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

```c
/* AOJ 0140:Bus Line */
#include <stdio.h>
#include <string.h>
 
int main(){
  char a[]="6 7 8 9 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9";
  char *b,*c,*d,e,f;
  int h,i;
  scanf("%d\n",&h);
  for(i=0;i<h;i++){
    scanf("%c %c\n",&e,&f);
    b=strchr(a,e);
    c=strchr(b+1,e);
    d=strchr(b+1,f);
    if(c==NULL || c>d)c=b;
    for(;c<=d;c++) printf("%c",c[0]);
    printf("\n");
  }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%c %c\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$96, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movabsq	$2321922508316942390, %rax
	movabsq	$2319952162004934709, %rdx
	movq	%rax, -48(%rbp)
	movq	%rdx, -40(%rbp)
	movabsq	$2319952153414737969, %rax
	movabsq	$2321078070501711923, %rdx
	movq	%rax, -32(%rbp)
	movq	%rdx, -24(%rbp)
	movl	$540549175, -16(%rbp)
	movw	$57, -12(%rbp)
	leaq	-80(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -76(%rbp)
	jmp	.L2
.L7:
	leaq	-81(%rbp), %rdx
	leaq	-82(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movzbl	-82(%rbp), %eax
	movsbl	%al, %edx
	leaq	-48(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	strchr@PLT
	movq	%rax, -64(%rbp)
	movzbl	-82(%rbp), %eax
	movsbl	%al, %eax
	movq	-64(%rbp), %rdx
	addq	$1, %rdx
	movl	%eax, %esi
	movq	%rdx, %rdi
	call	strchr@PLT
	movq	%rax, -72(%rbp)
	movzbl	-81(%rbp), %eax
	movsbl	%al, %eax
	movq	-64(%rbp), %rdx
	addq	$1, %rdx
	movl	%eax, %esi
	movq	%rdx, %rdi
	call	strchr@PLT
	movq	%rax, -56(%rbp)
	cmpq	$0, -72(%rbp)
	je	.L3
	movq	-72(%rbp), %rax
	cmpq	-56(%rbp), %rax
	jbe	.L5
.L3:
	movq	-64(%rbp), %rax
	movq	%rax, -72(%rbp)
	jmp	.L5
.L6:
	movq	-72(%rbp), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar@PLT
	addq	$1, -72(%rbp)
.L5:
	movq	-72(%rbp), %rax
	cmpq	-56(%rbp), %rax
	jbe	.L6
	movl	$10, %edi
	call	putchar@PLT
	addl	$1, -76(%rbp)
.L2:
	movl	-80(%rbp), %eax
	cmpl	%eax, -76(%rbp)
	jl	.L7
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%c %c\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$96, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movabsq	$2321922508316942390, %rax
	movabsq	$2319952162004934709, %rdx
	movq	%rax, -48(%rbp)
	movq	%rdx, -40(%rbp)
	movabsq	$2319952153414737969, %rax
	movabsq	$2321078070501711923, %rdx
	movq	%rax, -32(%rbp)
	movq	%rdx, -24(%rbp)
	movl	$540549175, -16(%rbp)
	movw	$57, -12(%rbp)
	leaq	-80(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -76(%rbp)
	jmp	.L2
.L7:
	leaq	-81(%rbp), %rdx
	leaq	-82(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movzbl	-82(%rbp), %eax
	movsbl	%al, %edx
	leaq	-48(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	strchr@PLT
	movq	%rax, -64(%rbp)
	movzbl	-82(%rbp), %eax
	movsbl	%al, %eax
	movq	-64(%rbp), %rdx
	addq	$1, %rdx
	movl	%eax, %esi
	movq	%rdx, %rdi
	call	strchr@PLT
	movq	%rax, -72(%rbp)
	movzbl	-81(%rbp), %eax
	movsbl	%al, %eax
	movq	-64(%rbp), %rdx
	addq	$1, %rdx
	movl	%eax, %esi
	movq	%rdx, %rdi
	call	strchr@PLT
	movq	%rax, -56(%rbp)
	cmpq	$0, -72(%rbp)
	je	.L3
	movq	-72(%rbp), %rax
	cmpq	-56(%rbp), %rax
	jbe	.L5
.L3:
	movq	-64(%rbp), %rax
	movq	%rax, -72(%rbp)
	jmp	.L5
.L6:
	movq	-72(%rbp), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar@PLT
	addq	$1, -72(%rbp)
.L5:
	movq	-72(%rbp), %rax
	cmpq	-56(%rbp), %rax
	jbe	.L6
	movl	$10, %edi
	call	putchar@PLT
	addl	$1, -76(%rbp)
.L2:
	movl	-80(%rbp), %eax
	cmpl	%eax, -76(%rbp)
	jl	.L7
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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:
