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

```c
// Aizu 2242: Era Name
// 2017.9.23 bal4u@uu

#include <stdio.h>
#include <stdlib.h>

#define MAX 1001
typedef struct { char nm[17]; int e, w; } ERA;	// ??´???, ??????????????´????????????????\????????????´
ERA era[MAX]; int n;	// ??´?????????????????????????????????
 
int cmp(ERA *a, ERA *b) { return a->w - b->w; }

// ?????????????????????
int bsch(int x)
{
	int m, l = 0, r = n;

    while (l < r) {
        m = (l + r) >> 1;
        if (era[m].w < x) l = m + 1; else r = m;
    }
	return l;
}

int main()
{
	int q, i, y;

	while (scanf("%d%d", &n, &q) && n > 0) {
		// ?????±?????????????????¨??´????????????????????????
		for (i = 0; i < n; i++) scanf("%s%d%d", era[i].nm, &era[i].e, &era[i].w);
		qsort(era, n, sizeof(ERA), cmp);

		while (q-- > 0) {
			scanf("%d", &y);
			i = bsch(y);		// ?????????????????????
			if (i >= 0 && i < n && era[i].w-era[i].e+1 <= y && y <= era[i].w)
				printf("%s %d\n", era[i].nm, y-era[i].w+era[i].e);
			else puts("Unknown");
		}
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	era
	.bss
	.align 32
	.type	era, @object
	.size	era, 28028
era:
	.zero	28028
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.text
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	24(%rax), %edx
	movq	-16(%rbp), %rax
	movl	24(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	cmp, .-cmp
	.globl	bsch
	.type	bsch, @function
bsch:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	$0, -12(%rbp)
	movl	n(%rip), %eax
	movl	%eax, -8(%rbp)
	jmp	.L4
.L6:
	movl	-12(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	24+era(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -20(%rbp)
	jle	.L5
	movl	-4(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -12(%rbp)
	jmp	.L4
.L5:
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
.L4:
	movl	-12(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jl	.L6
	movl	-12(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	bsch, .-bsch
	.section	.rodata
.LC0:
	.string	"%s%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%s %d\n"
.LC3:
	.string	"Unknown"
.LC4:
	.string	"%d%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L9
.L16:
	movl	$0, -12(%rbp)
	jmp	.L10
.L11:
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$2, %rax
	leaq	16(%rax), %rdx
	leaq	era(%rip), %rax
	addq	%rdx, %rax
	leaq	8(%rax), %rcx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$2, %rax
	leaq	16(%rax), %rdx
	leaq	era(%rip), %rax
	addq	%rdx, %rax
	leaq	4(%rax), %rdx
	movl	-12(%rbp), %eax
	movslq	%eax, %rsi
	movq	%rsi, %rax
	salq	$3, %rax
	subq	%rsi, %rax
	salq	$2, %rax
	leaq	era(%rip), %rsi
	addq	%rsi, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -12(%rbp)
.L10:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L11
	movl	n(%rip), %eax
	cltq
	leaq	cmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$28, %edx
	movq	%rax, %rsi
	leaq	era(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	jmp	.L12
.L14:
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-16(%rbp), %eax
	movl	%eax, %edi
	call	bsch
	movl	%eax, -12(%rbp)
	cmpl	$0, -12(%rbp)
	js	.L13
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jge	.L13
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	24+era(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	20+era(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	movl	-16(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L13
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	24+era(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-16(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L13
	movl	-16(%rbp), %ecx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	24+era(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	%eax, %ecx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	20+era(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	(%rcx,%rax), %edx
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$3, %rax
	subq	%rcx, %rax
	salq	$2, %rax
	leaq	era(%rip), %rcx
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L12
.L13:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L12:
	movl	-20(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -20(%rbp)
	testl	%eax, %eax
	jg	.L14
.L9:
	leaq	-20(%rbp), %rax
	movq	%rax, %rdx
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L15
	movl	n(%rip), %eax
	testl	%eax, %eax
	jg	.L16
.L15:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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	cmp
	.type	cmp, @function
cmp:
.LFB39:
	.cfi_startproc
	endbr64
	movl	24(%rdi), %eax
	subl	24(%rsi), %eax
	ret
	.cfi_endproc
.LFE39:
	.size	cmp, .-cmp
	.p2align 4
	.globl	bsch
	.type	bsch, @function
bsch:
.LFB40:
	.cfi_startproc
	endbr64
	movl	n(%rip), %ecx
	xorl	%r8d, %r8d
	leaq	era(%rip), %r9
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L6:
	leal	(%rcx,%r8), %eax
	sarl	%eax
	movslq	%eax, %rsi
	leaq	0(,%rsi,8), %rdx
	subq	%rsi, %rdx
	cmpl	%edi, 24(%r9,%rdx,4)
	jl	.L8
	movl	%eax, %ecx
.L5:
	cmpl	%r8d, %ecx
	jg	.L6
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L8:
	leal	1(%rax), %r8d
	jmp	.L5
	.cfi_endproc
.LFE40:
	.size	bsch, .-bsch
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%s %d\n"
.LC3:
	.string	"Unknown"
.LC4:
	.string	"%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB41:
	.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
	leaq	era(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	.LC3(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %r15
.L10:
	xorl	%eax, %eax
	movq	%r15, %rdx
	leaq	n(%rip), %rsi
	leaq	.LC4(%rip), %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L19
	movl	n(%rip), %eax
	testl	%eax, %eax
	jle	.L19
	leaq	era(%rip), %rbx
	xorl	%ebp, %ebp
	.p2align 4,,10
	.p2align 3
.L11:
	leaq	24(%rbx), %rcx
	leaq	20(%rbx), %rdx
	movq	%rbx, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	addq	$28, %rbx
	call	__isoc99_scanf@PLT
	movl	n(%rip), %eax
	cmpl	%ebp, %eax
	jg	.L11
	movslq	%eax, %rsi
	movl	$28, %edx
	leaq	4(%rsp), %rbp
	movq	%r14, %rdi
	leaq	cmp(%rip), %rcx
	leaq	.LC1(%rip), %rbx
	call	qsort@PLT
	movl	(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, (%rsp)
	testl	%eax, %eax
	jle	.L10
	.p2align 4,,10
	.p2align 3
.L12:
	movq	%rbx, %rdi
	movq	%rbp, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	n(%rip), %r9d
	movl	4(%rsp), %r8d
	xorl	%edi, %edi
	movl	%r9d, %ecx
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L15:
	leal	(%rcx,%rdi), %eax
	sarl	%eax
	movslq	%eax, %rsi
	leaq	0(,%rsi,8), %rdx
	subq	%rsi, %rdx
	cmpl	24(%r14,%rdx,4), %r8d
	jg	.L37
	movl	%eax, %ecx
.L14:
	cmpl	%edi, %ecx
	jg	.L15
	cmpl	%edi, %r9d
	jle	.L16
	movslq	%edi, %rdi
	leaq	0(,%rdi,8), %rax
	subq	%rdi, %rax
	leaq	(%r14,%rax,4), %rdx
	movl	24(%rdx), %eax
	movl	20(%rdx), %ecx
	movl	%eax, %esi
	subl	%ecx, %esi
	cmpl	%esi, %r8d
	jle	.L16
	cmpl	%eax, %r8d
	jle	.L38
	.p2align 4,,10
	.p2align 3
.L16:
	movq	%r13, %rdi
	call	puts@PLT
.L17:
	movl	(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, (%rsp)
	testl	%eax, %eax
	jg	.L12
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L37:
	leal	1(%rax), %edi
	jmp	.L14
.L38:
	subl	%eax, %r8d
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addl	%r8d, %ecx
	call	__printf_chk@PLT
	jmp	.L17
.L19:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L39
	addq	$24, %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
.L39:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE41:
	.size	main, .-main
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	era
	.align 32
	.type	era, @object
	.size	era, 28028
era:
	.zero	28028
	.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	cmp
	.type	cmp, @function
cmp:
.LFB39:
	.cfi_startproc
	endbr64
	movl	24(%rdi), %eax
	subl	24(%rsi), %eax
	ret
	.cfi_endproc
.LFE39:
	.size	cmp, .-cmp
	.p2align 4
	.globl	bsch
	.type	bsch, @function
bsch:
.LFB40:
	.cfi_startproc
	endbr64
	movl	n(%rip), %ecx
	xorl	%r8d, %r8d
	leaq	era(%rip), %r9
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L6:
	leal	(%rcx,%r8), %eax
	sarl	%eax
	movslq	%eax, %rsi
	leaq	0(,%rsi,8), %rdx
	subq	%rsi, %rdx
	cmpl	%edi, 24(%r9,%rdx,4)
	jl	.L8
	movl	%eax, %ecx
.L5:
	cmpl	%r8d, %ecx
	jg	.L6
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L8:
	leal	1(%rax), %r8d
	jmp	.L5
	.cfi_endproc
.LFE40:
	.size	bsch, .-bsch
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%s %d\n"
.LC3:
	.string	"Unknown"
.LC4:
	.string	"%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB41:
	.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
	leaq	era(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	.LC3(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %r15
.L10:
	xorl	%eax, %eax
	movq	%r15, %rdx
	leaq	n(%rip), %rsi
	leaq	.LC4(%rip), %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L19
	movl	n(%rip), %eax
	testl	%eax, %eax
	jle	.L19
	leaq	era(%rip), %rbx
	xorl	%ebp, %ebp
	.p2align 4,,10
	.p2align 3
.L11:
	leaq	24(%rbx), %rcx
	leaq	20(%rbx), %rdx
	movq	%rbx, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	addq	$28, %rbx
	call	__isoc99_scanf@PLT
	movl	n(%rip), %eax
	cmpl	%ebp, %eax
	jg	.L11
	movslq	%eax, %rsi
	movl	$28, %edx
	leaq	4(%rsp), %rbp
	movq	%r14, %rdi
	leaq	cmp(%rip), %rcx
	leaq	.LC1(%rip), %rbx
	call	qsort@PLT
	movl	(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, (%rsp)
	testl	%eax, %eax
	jle	.L10
	.p2align 4,,10
	.p2align 3
.L12:
	movq	%rbx, %rdi
	movq	%rbp, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	n(%rip), %r9d
	movl	4(%rsp), %r8d
	xorl	%edi, %edi
	movl	%r9d, %ecx
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L15:
	leal	(%rcx,%rdi), %eax
	sarl	%eax
	movslq	%eax, %rsi
	leaq	0(,%rsi,8), %rdx
	subq	%rsi, %rdx
	cmpl	24(%r14,%rdx,4), %r8d
	jg	.L37
	movl	%eax, %ecx
.L14:
	cmpl	%edi, %ecx
	jg	.L15
	cmpl	%edi, %r9d
	jle	.L16
	movslq	%edi, %rdi
	leaq	0(,%rdi,8), %rax
	subq	%rdi, %rax
	leaq	(%r14,%rax,4), %rdx
	movl	24(%rdx), %eax
	movl	20(%rdx), %ecx
	movl	%eax, %esi
	subl	%ecx, %esi
	cmpl	%esi, %r8d
	jle	.L16
	cmpl	%eax, %r8d
	jle	.L38
	.p2align 4,,10
	.p2align 3
.L16:
	movq	%r13, %rdi
	call	puts@PLT
.L17:
	movl	(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, (%rsp)
	testl	%eax, %eax
	jg	.L12
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L37:
	leal	1(%rax), %edi
	jmp	.L14
.L38:
	subl	%eax, %r8d
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addl	%r8d, %ecx
	call	__printf_chk@PLT
	jmp	.L17
.L19:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L39
	addq	$24, %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
.L39:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE41:
	.size	main, .-main
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	era
	.align 32
	.type	era, @object
	.size	era, 28028
era:
	.zero	28028
	.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:

// Aizu 2242: Era Name
// 2017.9.23 bal4u@uu

#include <stdio.h>
#include <stdlib.h>

#define MAX 1001
typedef struct { char nm[17]; int e, w; } ERA;	// ??´???, ??????????????´????????????????\????????????´
ERA era[MAX]; int n;	// ??´?????????????????????????????????
 
int cmp(ERA *a, ERA *b) { return a->w - b->w; }

// ?????????????????????
int bsch(int x)
{
	int m, l = 0, r = n;

    while (l < r) {
        m = (l + r) >> 1;
        if (era[m].w < x) l = m + 1; else r = m;
    }
	return l;
}

int main()
{
	int q, i, y;

	while (scanf("%d%d", &n, &q) && n > 0) {
		// ?????±?????????????????¨??´????????????????????????
		for (i = 0; i < n; i++) scanf("%s%d%d", era[i].nm, &era[i].e, &era[i].w);
		qsort(era, n, sizeof(ERA), cmp);

		while (q-- > 0) {
			scanf("%d", &y);
			i = bsch(y);		// ?????????????????????
			if (i >= 0 && i < n && era[i].w-era[i].e+1 <= y && y <= era[i].w)
				printf("%s %d\n", era[i].nm, y-era[i].w+era[i].e);
			else puts("Unknown");
		}
	}
	return 0;
}
4 3
meiji 10 1877
taisho 6 1917
showa 62 1987
heisei 22 2010
2046
1917
1988
1 1
universalcentury 123 2168
2010
0 0
 4 3
meiji 10 1877
taisho 6 1917
showa 62 1987
geisei 22 2010
1868
1917
1988
1 1
universalcentury 123 2168
2010
0 0
 4 3
meiji 10 1877
taisho 6 1917
showa 62 1987
heisei 25 2010
2046
1917
1988
1 1
universalcentury 123 2168
2010
0 0
 4 3
meiji 10 1877
taisho 6 1917
saowh 62 1987
heisei 33 2010
2046
1917
1988
1 1
universalcentury 123 2168
2010
0 0
 4 3
meiji 10 1877
taisho 6 1198
sgowa 62 1987
heisei 22 2010
1868
1917
1988
1 1
universalcentury 123 2168
2010
0 0
 4 3
meiji 20 1877
taisho 6 899
showa 62 1987
heisei 25 2010
1126
1917
1988
1 1
universalcemtury 123 2168
681
0 0
 4 3
meiji 10 1877
tahsho 6 1917
showa 62 1987
heisei 22 2010
1868
1917
1988
1 1
universalcentury 123 2168
2010
0 0
 4 3
meiji 10 1877
taisho 6 1917
saowh 62 1987
heisei 22 2010
2046
2671
1988
1 1
universalcentury 123 2168
2010
0 0
 4 3
meiji 10 1877
taisho 6 1917
sgowa 62 1987
heisei 33 2010
1868
1917
1988
1 1
universalcentury 123 2168
2010
0 0
 4 3
meiji 10 1877
taisho 7 1917
showa 62 1987
geisei 22 2010
1868
1917
1988
1 1
universalcentury 123 2168
2611
0 0

Unknown
taisho 6
Unknown
Unknown
 meiji 1
taisho 6
Unknown
Unknown
 Unknown
taisho 6
heisei 3
Unknown
 Unknown
taisho 6
heisei 11
Unknown
 meiji 1
Unknown
Unknown
Unknown
 Unknown
Unknown
heisei 3
Unknown
 meiji 1
tahsho 6
Unknown
Unknown
 Unknown
Unknown
Unknown
Unknown
 meiji 1
taisho 6
heisei 11
Unknown
 meiji 1
taisho 7
Unknown
Unknown

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

```c
// Aizu 2242: Era Name
// 2017.9.23 bal4u@uu

#include <stdio.h>
#include <stdlib.h>

#define MAX 1001
typedef struct { char nm[17]; int e, w; } ERA;	// ??´???, ??????????????´????????????????\????????????´
ERA era[MAX]; int n;	// ??´?????????????????????????????????
 
int cmp(ERA *a, ERA *b) { return a->w - b->w; }

// ?????????????????????
int bsch(int x)
{
	int m, l = 0, r = n;

    while (l < r) {
        m = (l + r) >> 1;
        if (era[m].w < x) l = m + 1; else r = m;
    }
	return l;
}

int main()
{
	int q, i, y;

	while (scanf("%d%d", &n, &q) && n > 0) {
		// ?????±?????????????????¨??´????????????????????????
		for (i = 0; i < n; i++) scanf("%s%d%d", era[i].nm, &era[i].e, &era[i].w);
		qsort(era, n, sizeof(ERA), cmp);

		while (q-- > 0) {
			scanf("%d", &y);
			i = bsch(y);		// ?????????????????????
			if (i >= 0 && i < n && era[i].w-era[i].e+1 <= y && y <= era[i].w)
				printf("%s %d\n", era[i].nm, y-era[i].w+era[i].e);
			else puts("Unknown");
		}
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	era
	.bss
	.align 32
	.type	era, @object
	.size	era, 28028
era:
	.zero	28028
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.text
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	24(%rax), %edx
	movq	-16(%rbp), %rax
	movl	24(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	cmp, .-cmp
	.globl	bsch
	.type	bsch, @function
bsch:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	$0, -12(%rbp)
	movl	n(%rip), %eax
	movl	%eax, -8(%rbp)
	jmp	.L4
.L6:
	movl	-12(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	24+era(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -20(%rbp)
	jle	.L5
	movl	-4(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -12(%rbp)
	jmp	.L4
.L5:
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
.L4:
	movl	-12(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jl	.L6
	movl	-12(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	bsch, .-bsch
	.section	.rodata
.LC0:
	.string	"%s%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%s %d\n"
.LC3:
	.string	"Unknown"
.LC4:
	.string	"%d%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L9
.L16:
	movl	$0, -12(%rbp)
	jmp	.L10
.L11:
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$2, %rax
	leaq	16(%rax), %rdx
	leaq	era(%rip), %rax
	addq	%rdx, %rax
	leaq	8(%rax), %rcx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$2, %rax
	leaq	16(%rax), %rdx
	leaq	era(%rip), %rax
	addq	%rdx, %rax
	leaq	4(%rax), %rdx
	movl	-12(%rbp), %eax
	movslq	%eax, %rsi
	movq	%rsi, %rax
	salq	$3, %rax
	subq	%rsi, %rax
	salq	$2, %rax
	leaq	era(%rip), %rsi
	addq	%rsi, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -12(%rbp)
.L10:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L11
	movl	n(%rip), %eax
	cltq
	leaq	cmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$28, %edx
	movq	%rax, %rsi
	leaq	era(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	jmp	.L12
.L14:
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-16(%rbp), %eax
	movl	%eax, %edi
	call	bsch
	movl	%eax, -12(%rbp)
	cmpl	$0, -12(%rbp)
	js	.L13
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jge	.L13
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	24+era(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	20+era(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	movl	-16(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L13
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	24+era(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-16(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L13
	movl	-16(%rbp), %ecx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	24+era(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	%eax, %ecx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	20+era(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	(%rcx,%rax), %edx
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$3, %rax
	subq	%rcx, %rax
	salq	$2, %rax
	leaq	era(%rip), %rcx
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L12
.L13:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L12:
	movl	-20(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -20(%rbp)
	testl	%eax, %eax
	jg	.L14
.L9:
	leaq	-20(%rbp), %rax
	movq	%rax, %rdx
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L15
	movl	n(%rip), %eax
	testl	%eax, %eax
	jg	.L16
.L15:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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	era
	.bss
	.align 32
	.type	era, @object
	.size	era, 28028
era:
	.zero	28028
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.text
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	24(%rax), %edx
	movq	-16(%rbp), %rax
	movl	24(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	cmp, .-cmp
	.globl	bsch
	.type	bsch, @function
bsch:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	$0, -12(%rbp)
	movl	n(%rip), %eax
	movl	%eax, -8(%rbp)
	jmp	.L4
.L6:
	movl	-12(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	24+era(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -20(%rbp)
	jle	.L5
	movl	-4(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -12(%rbp)
	jmp	.L4
.L5:
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
.L4:
	movl	-12(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jl	.L6
	movl	-12(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	bsch, .-bsch
	.section	.rodata
.LC0:
	.string	"%s%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%s %d\n"
.LC3:
	.string	"Unknown"
.LC4:
	.string	"%d%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L9
.L16:
	movl	$0, -12(%rbp)
	jmp	.L10
.L11:
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$2, %rax
	leaq	16(%rax), %rdx
	leaq	era(%rip), %rax
	addq	%rdx, %rax
	leaq	8(%rax), %rcx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$2, %rax
	leaq	16(%rax), %rdx
	leaq	era(%rip), %rax
	addq	%rdx, %rax
	leaq	4(%rax), %rdx
	movl	-12(%rbp), %eax
	movslq	%eax, %rsi
	movq	%rsi, %rax
	salq	$3, %rax
	subq	%rsi, %rax
	salq	$2, %rax
	leaq	era(%rip), %rsi
	addq	%rsi, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -12(%rbp)
.L10:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L11
	movl	n(%rip), %eax
	cltq
	leaq	cmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$28, %edx
	movq	%rax, %rsi
	leaq	era(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	jmp	.L12
.L14:
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-16(%rbp), %eax
	movl	%eax, %edi
	call	bsch
	movl	%eax, -12(%rbp)
	cmpl	$0, -12(%rbp)
	js	.L13
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jge	.L13
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	24+era(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	20+era(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	movl	-16(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L13
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	24+era(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-16(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L13
	movl	-16(%rbp), %ecx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	24+era(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	%eax, %ecx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	20+era(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	(%rcx,%rax), %edx
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$3, %rax
	subq	%rcx, %rax
	salq	$2, %rax
	leaq	era(%rip), %rcx
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L12
.L13:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L12:
	movl	-20(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -20(%rbp)
	testl	%eax, %eax
	jg	.L14
.L9:
	leaq	-20(%rbp), %rax
	movq	%rax, %rdx
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L15
	movl	n(%rip), %eax
	testl	%eax, %eax
	jg	.L16
.L15:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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:
