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

```c
// Aizu Vol-5 0578: Signboard
// 2017.8.31 bal4u@uu

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

char s[30], k[110];

int match(char *d, int dw, char *p)
{
	char *dp, *de, *pp;
	char c;
	int k;

	c = *p, de = d + dw;
    while (*d) {
        if (*d == c) {
			for (k = 1; k < dw; k++) {
		        dp = d, pp = p;
				while (*pp && dp < de) {
					if (*pp != *dp) break;
					pp++, dp+=k;
				}
				if (!*pp) return 1;
			}
		}
		d++, dw--;
    }
	return 0;
}

int main()
{
	int n, ans;

	scanf("%d%s", &n, s);
	ans = 0;
	while (n-- > 0) {
		scanf("%s", k);
		if (match(k, strlen(k), s)) ans++;
	}
	printf("%d\n", ans);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	s
	.bss
	.align 16
	.type	s, @object
	.size	s, 30
s:
	.zero	30
	.globl	k
	.align 32
	.type	k, @object
	.size	k, 110
k:
	.zero	110
	.text
	.globl	match
	.type	match, @function
match:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -40(%rbp)
	movl	%esi, -44(%rbp)
	movq	%rdx, -56(%rbp)
	movq	-56(%rbp), %rax
	movzbl	(%rax), %eax
	movb	%al, -29(%rbp)
	movl	-44(%rbp), %eax
	movslq	%eax, %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, -8(%rbp)
	jmp	.L2
.L12:
	movq	-40(%rbp), %rax
	movzbl	(%rax), %eax
	cmpb	%al, -29(%rbp)
	jne	.L3
	movl	$1, -28(%rbp)
	jmp	.L4
.L11:
	movq	-40(%rbp), %rax
	movq	%rax, -24(%rbp)
	movq	-56(%rbp), %rax
	movq	%rax, -16(%rbp)
	jmp	.L5
.L8:
	movq	-16(%rbp), %rax
	movzbl	(%rax), %edx
	movq	-24(%rbp), %rax
	movzbl	(%rax), %eax
	cmpb	%al, %dl
	jne	.L13
	addq	$1, -16(%rbp)
	movl	-28(%rbp), %eax
	cltq
	addq	%rax, -24(%rbp)
.L5:
	movq	-16(%rbp), %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	je	.L7
	movq	-24(%rbp), %rax
	cmpq	-8(%rbp), %rax
	jb	.L8
	jmp	.L7
.L13:
	nop
.L7:
	movq	-16(%rbp), %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L9
	movl	$1, %eax
	jmp	.L10
.L9:
	addl	$1, -28(%rbp)
.L4:
	movl	-28(%rbp), %eax
	cmpl	-44(%rbp), %eax
	jl	.L11
.L3:
	addq	$1, -40(%rbp)
	subl	$1, -44(%rbp)
.L2:
	movq	-40(%rbp), %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L12
	movl	$0, %eax
.L10:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	match, .-match
	.section	.rodata
.LC0:
	.string	"%d%s"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.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	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-16(%rbp), %rax
	leaq	s(%rip), %rdx
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12(%rbp)
	jmp	.L15
.L16:
	leaq	k(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	k(%rip), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, %ecx
	leaq	s(%rip), %rax
	movq	%rax, %rdx
	movl	%ecx, %esi
	leaq	k(%rip), %rax
	movq	%rax, %rdi
	call	match
	testl	%eax, %eax
	je	.L15
	addl	$1, -12(%rbp)
.L15:
	movl	-16(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -16(%rbp)
	testl	%eax, %eax
	jg	.L16
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	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
.LFE1:
	.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	match
	.type	match, @function
match:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movslq	%esi, %r8
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	(%rdi,%r8), %r11
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movzbl	(%rdi), %r10d
	movzbl	(%rdx), %ebp
	testb	%r10b, %r10b
	je	.L11
	movq	%rdi, %rcx
	leal	(%rsi,%rdi), %r12d
	leal	-2(%rsi,%rdi), %r13d
	movq	%rdx, %r9
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L4:
	movzbl	1(%rcx), %r10d
	addq	$1, %rcx
	subq	$1, %r8
	testb	%r10b, %r10b
	je	.L11
.L9:
	cmpb	%r10b, %bpl
	jne	.L4
	movl	%r12d, %eax
	subl	%ecx, %eax
	cmpl	$1, %eax
	jle	.L4
	movl	%r13d, %ebx
	movl	$1, %esi
	subl	%ecx, %ebx
	addq	$2, %rbx
	.p2align 4,,10
	.p2align 3
.L10:
	cmpq	%rcx, %r11
	jbe	.L6
	movl	%r10d, %edx
	xorl	%eax, %eax
	cmpq	$1, %rsi
	je	.L5
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L25:
	movzbl	1(%r9,%rax), %edx
	testb	%dl, %dl
	je	.L14
	addq	$1, %rax
	cmpq	%r8, %rax
	je	.L6
.L5:
	cmpb	%dl, (%rcx,%rax)
	je	.L25
.L6:
	addq	$1, %rsi
	cmpq	%rbx, %rsi
	jne	.L10
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L14:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	movl	$1, %eax
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L24:
	.cfi_restore_state
	movq	%r9, %rdi
	movq	%rcx, %rax
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L26:
	movzbl	1(%rdi), %edx
	addq	$1, %rdi
	addq	%rsi, %rax
	testb	%dl, %dl
	je	.L14
	cmpq	%rax, %r11
	jbe	.L6
.L7:
	cmpb	%dl, (%rax)
	je	.L26
	addq	$1, %rsi
	cmpq	%rbx, %rsi
	jne	.L10
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L11:
	popq	%rbx
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE35:
	.size	match, .-match
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%s"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB36:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	s(%rip), %rbx
	movq	%rbx, %rdx
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 4(%rsp)
	testl	%eax, %eax
	jle	.L28
	leaq	k(%rip), %r13
	leaq	.LC1(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L38:
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%r13, %rdi
	call	strlen@PLT
	movzbl	0(%r13), %r9d
	movzbl	(%rbx), %r14d
	movl	%eax, %r10d
	leaq	0(%r13,%rax), %rsi
	testb	%r9b, %r9b
	je	.L29
	leaq	k(%rip), %r8
	jmp	.L37
	.p2align 4,,10
	.p2align 3
.L31:
	movzbl	1(%r8), %r9d
	addq	$1, %r8
	subl	$1, %r10d
	testb	%r9b, %r9b
	je	.L29
.L37:
	cmpb	%r9b, %r14b
	jne	.L31
	cmpl	$1, %r10d
	jle	.L31
	movslq	%r10d, %r11
	movl	$1, %edi
	.p2align 4,,10
	.p2align 3
.L39:
	cmpq	%r8, %rsi
	jbe	.L33
	movl	%r9d, %ecx
	movq	%r8, %rax
	leaq	s(%rip), %rdx
	cmpq	$1, %rdi
	je	.L32
	jmp	.L35
	.p2align 4,,10
	.p2align 3
.L61:
	movzbl	1(%rdx), %ecx
	addq	$1, %rdx
	addq	$1, %rax
	testb	%cl, %cl
	je	.L34
	cmpq	%rax, %rsi
	je	.L33
.L32:
	cmpb	%cl, (%rax)
	je	.L61
.L33:
	addq	$1, %rdi
	cmpq	%r11, %rdi
	jne	.L39
	jmp	.L31
	.p2align 4,,10
	.p2align 3
.L62:
	movzbl	1(%rdx), %ecx
	addq	$1, %rdx
	addq	%rdi, %rax
	testb	%cl, %cl
	je	.L34
	cmpq	%rax, %rsi
	jbe	.L33
.L35:
	cmpb	%cl, (%rax)
	je	.L62
	jmp	.L33
	.p2align 4,,10
	.p2align 3
.L34:
	addl	$1, %r12d
.L29:
	movl	4(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 4(%rsp)
	testl	%eax, %eax
	jg	.L38
.L28:
	xorl	%eax, %eax
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L63
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L63:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE36:
	.size	main, .-main
	.globl	k
	.bss
	.align 32
	.type	k, @object
	.size	k, 110
k:
	.zero	110
	.globl	s
	.align 16
	.type	s, @object
	.size	s, 30
s:
	.zero	30
	.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	match
	.type	match, @function
match:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movslq	%esi, %r8
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	(%rdi,%r8), %r11
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movzbl	(%rdi), %r10d
	movzbl	(%rdx), %ebp
	testb	%r10b, %r10b
	je	.L11
	movq	%rdi, %rcx
	leal	(%rsi,%rdi), %r12d
	leal	-2(%rsi,%rdi), %r13d
	movq	%rdx, %r9
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L4:
	movzbl	1(%rcx), %r10d
	addq	$1, %rcx
	subq	$1, %r8
	testb	%r10b, %r10b
	je	.L11
.L9:
	cmpb	%r10b, %bpl
	jne	.L4
	movl	%r12d, %eax
	subl	%ecx, %eax
	cmpl	$1, %eax
	jle	.L4
	movl	%r13d, %ebx
	movl	$1, %esi
	subl	%ecx, %ebx
	addq	$2, %rbx
	.p2align 4,,10
	.p2align 3
.L10:
	cmpq	%rcx, %r11
	jbe	.L6
	movl	%r10d, %edx
	xorl	%eax, %eax
	cmpq	$1, %rsi
	je	.L5
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L25:
	movzbl	1(%r9,%rax), %edx
	testb	%dl, %dl
	je	.L14
	addq	$1, %rax
	cmpq	%r8, %rax
	je	.L6
.L5:
	cmpb	%dl, (%rcx,%rax)
	je	.L25
.L6:
	addq	$1, %rsi
	cmpq	%rbx, %rsi
	jne	.L10
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L14:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	movl	$1, %eax
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L24:
	.cfi_restore_state
	movq	%r9, %rdi
	movq	%rcx, %rax
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L26:
	movzbl	1(%rdi), %edx
	addq	$1, %rdi
	addq	%rsi, %rax
	testb	%dl, %dl
	je	.L14
	cmpq	%rax, %r11
	jbe	.L6
.L7:
	cmpb	%dl, (%rax)
	je	.L26
	addq	$1, %rsi
	cmpq	%rbx, %rsi
	jne	.L10
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L11:
	popq	%rbx
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE35:
	.size	match, .-match
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%s"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB36:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	s(%rip), %rbx
	movq	%rbx, %rdx
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 4(%rsp)
	testl	%eax, %eax
	jle	.L28
	leaq	k(%rip), %r13
	leaq	.LC1(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L38:
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%r13, %rdi
	call	strlen@PLT
	movzbl	0(%r13), %r9d
	movzbl	(%rbx), %r14d
	movl	%eax, %r10d
	leaq	0(%r13,%rax), %rsi
	testb	%r9b, %r9b
	je	.L29
	leaq	k(%rip), %r8
	jmp	.L37
	.p2align 4,,10
	.p2align 3
.L31:
	movzbl	1(%r8), %r9d
	addq	$1, %r8
	subl	$1, %r10d
	testb	%r9b, %r9b
	je	.L29
.L37:
	cmpb	%r9b, %r14b
	jne	.L31
	cmpl	$1, %r10d
	jle	.L31
	movslq	%r10d, %r11
	movl	$1, %edi
	.p2align 4,,10
	.p2align 3
.L39:
	cmpq	%r8, %rsi
	jbe	.L33
	movl	%r9d, %ecx
	movq	%r8, %rax
	leaq	s(%rip), %rdx
	cmpq	$1, %rdi
	je	.L32
	jmp	.L35
	.p2align 4,,10
	.p2align 3
.L61:
	movzbl	1(%rdx), %ecx
	addq	$1, %rdx
	addq	$1, %rax
	testb	%cl, %cl
	je	.L34
	cmpq	%rax, %rsi
	je	.L33
.L32:
	cmpb	%cl, (%rax)
	je	.L61
.L33:
	addq	$1, %rdi
	cmpq	%r11, %rdi
	jne	.L39
	jmp	.L31
	.p2align 4,,10
	.p2align 3
.L62:
	movzbl	1(%rdx), %ecx
	addq	$1, %rdx
	addq	%rdi, %rax
	testb	%cl, %cl
	je	.L34
	cmpq	%rax, %rsi
	jbe	.L33
.L35:
	cmpb	%cl, (%rax)
	je	.L62
	jmp	.L33
	.p2align 4,,10
	.p2align 3
.L34:
	addl	$1, %r12d
.L29:
	movl	4(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 4(%rsp)
	testl	%eax, %eax
	jg	.L38
.L28:
	xorl	%eax, %eax
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L63
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L63:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE36:
	.size	main, .-main
	.globl	k
	.bss
	.align 32
	.type	k, @object
	.size	k, 110
k:
	.zero	110
	.globl	s
	.align 16
	.type	s, @object
	.size	s, 30
s:
	.zero	30
	.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 Vol-5 0578: Signboard
// 2017.8.31 bal4u@uu

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

char s[30], k[110];

int match(char *d, int dw, char *p)
{
	char *dp, *de, *pp;
	char c;
	int k;

	c = *p, de = d + dw;
    while (*d) {
        if (*d == c) {
			for (k = 1; k < dw; k++) {
		        dp = d, pp = p;
				while (*pp && dp < de) {
					if (*pp != *dp) break;
					pp++, dp+=k;
				}
				if (!*pp) return 1;
			}
		}
		d++, dw--;
    }
	return 0;
}

int main()
{
	int n, ans;

	scanf("%d%s", &n, s);
	ans = 0;
	while (n-- > 0) {
		scanf("%s", k);
		if (match(k, strlen(k), s)) ans++;
	}
	printf("%d\n", ans);
	return 0;
}
4
bar
abracadabra
bear
bar
bbraxbara
 4
rab
abracadabra
bear
bar
bbraxbara
 4
rab
abracadabra
bear
bar
arabxarbb
 4
qab
abracadabra
bear
bar
arabxarbb
 4
qab
abracadabra
bear
bra
arabxarbb
 4
qab
abrbcadaara
bear
bra
arabxarbb
 4
qab
abrbcadaara
bear
bra
arbbxarbb
 4
qab
abrbcadaara
raeb
bra
arbbxarbb
 4
qab
abrbcadaara
rafb
bra
arbbxarbb
 4
baq
abrbcadaara
rafb
bra
arbbxarbb

3
 1
 2
 0
 0
 0
 0
 0
 0
 0

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

```c
// Aizu Vol-5 0578: Signboard
// 2017.8.31 bal4u@uu

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

char s[30], k[110];

int match(char *d, int dw, char *p)
{
	char *dp, *de, *pp;
	char c;
	int k;

	c = *p, de = d + dw;
    while (*d) {
        if (*d == c) {
			for (k = 1; k < dw; k++) {
		        dp = d, pp = p;
				while (*pp && dp < de) {
					if (*pp != *dp) break;
					pp++, dp+=k;
				}
				if (!*pp) return 1;
			}
		}
		d++, dw--;
    }
	return 0;
}

int main()
{
	int n, ans;

	scanf("%d%s", &n, s);
	ans = 0;
	while (n-- > 0) {
		scanf("%s", k);
		if (match(k, strlen(k), s)) ans++;
	}
	printf("%d\n", ans);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	s
	.bss
	.align 16
	.type	s, @object
	.size	s, 30
s:
	.zero	30
	.globl	k
	.align 32
	.type	k, @object
	.size	k, 110
k:
	.zero	110
	.text
	.globl	match
	.type	match, @function
match:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -40(%rbp)
	movl	%esi, -44(%rbp)
	movq	%rdx, -56(%rbp)
	movq	-56(%rbp), %rax
	movzbl	(%rax), %eax
	movb	%al, -29(%rbp)
	movl	-44(%rbp), %eax
	movslq	%eax, %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, -8(%rbp)
	jmp	.L2
.L12:
	movq	-40(%rbp), %rax
	movzbl	(%rax), %eax
	cmpb	%al, -29(%rbp)
	jne	.L3
	movl	$1, -28(%rbp)
	jmp	.L4
.L11:
	movq	-40(%rbp), %rax
	movq	%rax, -24(%rbp)
	movq	-56(%rbp), %rax
	movq	%rax, -16(%rbp)
	jmp	.L5
.L8:
	movq	-16(%rbp), %rax
	movzbl	(%rax), %edx
	movq	-24(%rbp), %rax
	movzbl	(%rax), %eax
	cmpb	%al, %dl
	jne	.L13
	addq	$1, -16(%rbp)
	movl	-28(%rbp), %eax
	cltq
	addq	%rax, -24(%rbp)
.L5:
	movq	-16(%rbp), %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	je	.L7
	movq	-24(%rbp), %rax
	cmpq	-8(%rbp), %rax
	jb	.L8
	jmp	.L7
.L13:
	nop
.L7:
	movq	-16(%rbp), %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L9
	movl	$1, %eax
	jmp	.L10
.L9:
	addl	$1, -28(%rbp)
.L4:
	movl	-28(%rbp), %eax
	cmpl	-44(%rbp), %eax
	jl	.L11
.L3:
	addq	$1, -40(%rbp)
	subl	$1, -44(%rbp)
.L2:
	movq	-40(%rbp), %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L12
	movl	$0, %eax
.L10:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	match, .-match
	.section	.rodata
.LC0:
	.string	"%d%s"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.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	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-16(%rbp), %rax
	leaq	s(%rip), %rdx
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12(%rbp)
	jmp	.L15
.L16:
	leaq	k(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	k(%rip), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, %ecx
	leaq	s(%rip), %rax
	movq	%rax, %rdx
	movl	%ecx, %esi
	leaq	k(%rip), %rax
	movq	%rax, %rdi
	call	match
	testl	%eax, %eax
	je	.L15
	addl	$1, -12(%rbp)
.L15:
	movl	-16(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -16(%rbp)
	testl	%eax, %eax
	jg	.L16
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	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
.LFE1:
	.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	s
	.bss
	.align 16
	.type	s, @object
	.size	s, 30
s:
	.zero	30
	.globl	k
	.align 32
	.type	k, @object
	.size	k, 110
k:
	.zero	110
	.text
	.globl	match
	.type	match, @function
match:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -40(%rbp)
	movl	%esi, -44(%rbp)
	movq	%rdx, -56(%rbp)
	movq	-56(%rbp), %rax
	movzbl	(%rax), %eax
	movb	%al, -29(%rbp)
	movl	-44(%rbp), %eax
	movslq	%eax, %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, -8(%rbp)
	jmp	.L2
.L12:
	movq	-40(%rbp), %rax
	movzbl	(%rax), %eax
	cmpb	%al, -29(%rbp)
	jne	.L3
	movl	$1, -28(%rbp)
	jmp	.L4
.L11:
	movq	-40(%rbp), %rax
	movq	%rax, -24(%rbp)
	movq	-56(%rbp), %rax
	movq	%rax, -16(%rbp)
	jmp	.L5
.L8:
	movq	-16(%rbp), %rax
	movzbl	(%rax), %edx
	movq	-24(%rbp), %rax
	movzbl	(%rax), %eax
	cmpb	%al, %dl
	jne	.L13
	addq	$1, -16(%rbp)
	movl	-28(%rbp), %eax
	cltq
	addq	%rax, -24(%rbp)
.L5:
	movq	-16(%rbp), %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	je	.L7
	movq	-24(%rbp), %rax
	cmpq	-8(%rbp), %rax
	jb	.L8
	jmp	.L7
.L13:
	nop
.L7:
	movq	-16(%rbp), %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L9
	movl	$1, %eax
	jmp	.L10
.L9:
	addl	$1, -28(%rbp)
.L4:
	movl	-28(%rbp), %eax
	cmpl	-44(%rbp), %eax
	jl	.L11
.L3:
	addq	$1, -40(%rbp)
	subl	$1, -44(%rbp)
.L2:
	movq	-40(%rbp), %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L12
	movl	$0, %eax
.L10:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	match, .-match
	.section	.rodata
.LC0:
	.string	"%d%s"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.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	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-16(%rbp), %rax
	leaq	s(%rip), %rdx
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12(%rbp)
	jmp	.L15
.L16:
	leaq	k(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	k(%rip), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, %ecx
	leaq	s(%rip), %rax
	movq	%rax, %rdx
	movl	%ecx, %esi
	leaq	k(%rip), %rax
	movq	%rax, %rdi
	call	match
	testl	%eax, %eax
	je	.L15
	addl	$1, -12(%rbp)
.L15:
	movl	-16(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -16(%rbp)
	testl	%eax, %eax
	jg	.L16
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	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
.LFE1:
	.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:
