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>
#include <string.h>

char a[25], buf[100];

int main() {
    int i, cnt = 0;
    int j, k, l, L, M, N;
    scanf("%d", &N);
    scanf("%s", a);
    L = strlen(a);
next:
    while (i++<N) {
        scanf("%s", buf);
        M = strlen(buf);
        for (j=0; j<M; j++)
            for (k=1; j+k*(L-1)<M; k++) {
                for (l=0; l<L && a[l]==buf[j+k*l]; l++);
                if (l>=L) {
                    cnt++;
                    goto next;
                }
            }
    }
    printf("%d\n", cnt);
}

```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\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
	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
	leaq	a(%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	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movq	%r12, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%r12, %rdi
	call	strlen@PLT
	movl	20(%rsp), %edx
	testl	%edx, %edx
	jle	.L14
	leal	-1(%rax), %r13d
	movq	%rax, %r12
	leal	(%rax,%rax), %eax
	xorl	%r15d, %r15d
	movl	%eax, 12(%rsp)
	leaq	buf(%rip), %rbx
	movl	%r13d, %r14d
	movl	$0, 8(%rsp)
.L11:
	movq	%rbx, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%rbx, %rdi
	call	strlen@PLT
	movl	%eax, %r8d
	testq	%rax, %rax
	je	.L3
	movl	12(%rsp), %eax
	movl	%r14d, %esi
	leaq	buf(%rip), %r9
	xorl	%r10d, %r10d
	leal	-2(%rax), %r11d
	leaq	1+a(%rip), %rax
	addq	%rax, %rsi
.L4:
	leal	(%r14,%r10), %eax
	leal	(%r11,%r10), %edi
	movl	$1, %ecx
	cmpl	%eax, %r8d
	jle	.L10
	testq	%r12, %r12
	je	.L5
	.p2align 4,,10
	.p2align 3
.L32:
	leaq	a(%rip), %rax
	movq	%r9, %rdx
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L6:
	addq	$1, %rax
	addq	%rcx, %rdx
	cmpq	%rsi, %rax
	je	.L5
.L8:
	movzbl	(%rdx), %ebp
	cmpb	%bpl, (%rax)
	je	.L6
	leal	0(%r13,%rdi), %eax
	addq	$1, %rcx
	cmpl	%edi, %r8d
	jle	.L10
	movl	%eax, %edi
	testq	%r12, %r12
	jne	.L32
	.p2align 4,,10
	.p2align 3
.L5:
	addl	$1, 8(%rsp)
.L3:
	addl	$1, %r15d
	cmpl	%r15d, 20(%rsp)
	jg	.L11
.L2:
	movl	8(%rsp), %edx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L33
	addq	$40, %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
.L10:
	.cfi_restore_state
	addl	$1, %r10d
	addq	$1, %r9
	cmpl	%r10d, %r8d
	jne	.L4
	jmp	.L3
.L14:
	movl	$0, 8(%rsp)
	jmp	.L2
.L33:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	buf
	.bss
	.align 32
	.type	buf, @object
	.size	buf, 100
buf:
	.zero	100
	.globl	a
	.align 16
	.type	a, @object
	.size	a, 25
a:
	.zero	25
	.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	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\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
	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
	leaq	a(%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	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movq	%r12, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%r12, %rdi
	call	strlen@PLT
	movl	20(%rsp), %edx
	testl	%edx, %edx
	jle	.L14
	leal	-1(%rax), %r13d
	movq	%rax, %r12
	leal	(%rax,%rax), %eax
	xorl	%r15d, %r15d
	movl	%eax, 12(%rsp)
	leaq	buf(%rip), %rbx
	movl	%r13d, %r14d
	movl	$0, 8(%rsp)
.L11:
	movq	%rbx, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%rbx, %rdi
	call	strlen@PLT
	movl	%eax, %r8d
	testq	%rax, %rax
	je	.L3
	movl	12(%rsp), %eax
	movl	%r14d, %esi
	leaq	buf(%rip), %r9
	xorl	%r10d, %r10d
	leal	-2(%rax), %r11d
	leaq	1+a(%rip), %rax
	addq	%rax, %rsi
.L4:
	leal	(%r14,%r10), %eax
	leal	(%r11,%r10), %edi
	movl	$1, %ecx
	cmpl	%eax, %r8d
	jle	.L10
	testq	%r12, %r12
	je	.L5
	.p2align 4,,10
	.p2align 3
.L32:
	leaq	a(%rip), %rax
	movq	%r9, %rdx
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L6:
	addq	$1, %rax
	addq	%rcx, %rdx
	cmpq	%rsi, %rax
	je	.L5
.L8:
	movzbl	(%rdx), %ebp
	cmpb	%bpl, (%rax)
	je	.L6
	leal	0(%r13,%rdi), %eax
	addq	$1, %rcx
	cmpl	%edi, %r8d
	jle	.L10
	movl	%eax, %edi
	testq	%r12, %r12
	jne	.L32
	.p2align 4,,10
	.p2align 3
.L5:
	addl	$1, 8(%rsp)
.L3:
	addl	$1, %r15d
	cmpl	%r15d, 20(%rsp)
	jg	.L11
.L2:
	movl	8(%rsp), %edx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L33
	addq	$40, %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
.L10:
	.cfi_restore_state
	addl	$1, %r10d
	addq	$1, %r9
	cmpl	%r10d, %r8d
	jne	.L4
	jmp	.L3
.L14:
	movl	$0, 8(%rsp)
	jmp	.L2
.L33:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	buf
	.bss
	.align 32
	.type	buf, @object
	.size	buf, 100
buf:
	.zero	100
	.globl	a
	.align 16
	.type	a, @object
	.size	a, 25
a:
	.zero	25
	.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	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\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
	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
	leaq	a(%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	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movq	%r12, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%r12, %rdi
	call	strlen@PLT
	movl	20(%rsp), %edx
	testl	%edx, %edx
	jle	.L14
	leal	-1(%rax), %r13d
	movq	%rax, %r12
	leal	(%rax,%rax), %eax
	xorl	%r15d, %r15d
	movl	%eax, 12(%rsp)
	leaq	buf(%rip), %rbx
	movl	%r13d, %r14d
	movl	$0, 8(%rsp)
.L11:
	movq	%rbx, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%rbx, %rdi
	call	strlen@PLT
	movl	%eax, %r8d
	testq	%rax, %rax
	je	.L3
	movl	12(%rsp), %eax
	movl	%r14d, %esi
	leaq	buf(%rip), %r9
	xorl	%r10d, %r10d
	leal	-2(%rax), %r11d
	leaq	1+a(%rip), %rax
	addq	%rax, %rsi
.L4:
	leal	(%r14,%r10), %eax
	leal	(%r11,%r10), %edi
	movl	$1, %ecx
	cmpl	%eax, %r8d
	jle	.L10
	testq	%r12, %r12
	je	.L5
	.p2align 4,,10
	.p2align 3
.L32:
	leaq	a(%rip), %rax
	movq	%r9, %rdx
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L6:
	addq	$1, %rax
	addq	%rcx, %rdx
	cmpq	%rsi, %rax
	je	.L5
.L8:
	movzbl	(%rdx), %ebp
	cmpb	%bpl, (%rax)
	je	.L6
	leal	0(%r13,%rdi), %eax
	addq	$1, %rcx
	cmpl	%edi, %r8d
	jle	.L10
	movl	%eax, %edi
	testq	%r12, %r12
	jne	.L32
	.p2align 4,,10
	.p2align 3
.L5:
	addl	$1, 8(%rsp)
.L3:
	addl	$1, %r15d
	cmpl	%r15d, 20(%rsp)
	jg	.L11
.L2:
	movl	8(%rsp), %edx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L33
	addq	$40, %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
.L10:
	.cfi_restore_state
	addl	$1, %r10d
	addq	$1, %r9
	cmpl	%r10d, %r8d
	jne	.L4
	jmp	.L3
.L14:
	movl	$0, 8(%rsp)
	jmp	.L2
.L33:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	buf
	.bss
	.align 32
	.type	buf, @object
	.size	buf, 100
buf:
	.zero	100
	.globl	a
	.align 16
	.type	a, @object
	.size	a, 25
a:
	.zero	25
	.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>
#include <string.h>

char a[25], buf[100];

int main() {
    int i, cnt = 0;
    int j, k, l, L, M, N;
    scanf("%d", &N);
    scanf("%s", a);
    L = strlen(a);
next:
    while (i++<N) {
        scanf("%s", buf);
        M = strlen(buf);
        for (j=0; j<M; j++)
            for (k=1; j+k*(L-1)<M; k++) {
                for (l=0; l<L && a[l]==buf[j+k*l]; l++);
                if (l>=L) {
                    cnt++;
                    goto next;
                }
            }
    }
    printf("%d\n", cnt);
}

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

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

char a[25], buf[100];

int main() {
    int i, cnt = 0;
    int j, k, l, L, M, N;
    scanf("%d", &N);
    scanf("%s", a);
    L = strlen(a);
next:
    while (i++<N) {
        scanf("%s", buf);
        M = strlen(buf);
        for (j=0; j<M; j++)
            for (k=1; j+k*(L-1)<M; k++) {
                for (l=0; l<L && a[l]==buf[j+k*l]; l++);
                if (l>=L) {
                    cnt++;
                    goto next;
                }
            }
    }
    printf("%d\n", cnt);
}

```

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:

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 assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

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

char a[25], buf[100];

int main() {
    int i, cnt = 0;
    int j, k, l, L, M, N;
    scanf("%d", &N);
    scanf("%s", a);
    L = strlen(a);
next:
    while (i++<N) {
        scanf("%s", buf);
        M = strlen(buf);
        for (j=0; j<M; j++)
            for (k=1; j+k*(L-1)<M; k++) {
                for (l=0; l<L && a[l]==buf[j+k*l]; l++);
                if (l>=L) {
                    cnt++;
                    goto next;
                }
            }
    }
    printf("%d\n", cnt);
}

```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\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
	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
	leaq	a(%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	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movq	%r12, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%r12, %rdi
	call	strlen@PLT
	movl	20(%rsp), %edx
	testl	%edx, %edx
	jle	.L14
	leal	-1(%rax), %r13d
	movq	%rax, %r12
	leal	(%rax,%rax), %eax
	xorl	%r15d, %r15d
	movl	%eax, 12(%rsp)
	leaq	buf(%rip), %rbx
	movl	%r13d, %r14d
	movl	$0, 8(%rsp)
.L11:
	movq	%rbx, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%rbx, %rdi
	call	strlen@PLT
	movl	%eax, %r8d
	testq	%rax, %rax
	je	.L3
	movl	12(%rsp), %eax
	movl	%r14d, %esi
	leaq	buf(%rip), %r9
	xorl	%r10d, %r10d
	leal	-2(%rax), %r11d
	leaq	1+a(%rip), %rax
	addq	%rax, %rsi
.L4:
	leal	(%r14,%r10), %eax
	leal	(%r11,%r10), %edi
	movl	$1, %ecx
	cmpl	%eax, %r8d
	jle	.L10
	testq	%r12, %r12
	je	.L5
	.p2align 4,,10
	.p2align 3
.L32:
	leaq	a(%rip), %rax
	movq	%r9, %rdx
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L6:
	addq	$1, %rax
	addq	%rcx, %rdx
	cmpq	%rsi, %rax
	je	.L5
.L8:
	movzbl	(%rdx), %ebp
	cmpb	%bpl, (%rax)
	je	.L6
	leal	0(%r13,%rdi), %eax
	addq	$1, %rcx
	cmpl	%edi, %r8d
	jle	.L10
	movl	%eax, %edi
	testq	%r12, %r12
	jne	.L32
	.p2align 4,,10
	.p2align 3
.L5:
	addl	$1, 8(%rsp)
.L3:
	addl	$1, %r15d
	cmpl	%r15d, 20(%rsp)
	jg	.L11
.L2:
	movl	8(%rsp), %edx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L33
	addq	$40, %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
.L10:
	.cfi_restore_state
	addl	$1, %r10d
	addq	$1, %r9
	cmpl	%r10d, %r8d
	jne	.L4
	jmp	.L3
.L14:
	movl	$0, 8(%rsp)
	jmp	.L2
.L33:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	buf
	.bss
	.align 32
	.type	buf, @object
	.size	buf, 100
buf:
	.zero	100
	.globl	a
	.align 16
	.type	a, @object
	.size	a, 25
a:
	.zero	25
	.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	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\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
	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
	leaq	a(%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	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movq	%r12, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%r12, %rdi
	call	strlen@PLT
	movl	20(%rsp), %edx
	testl	%edx, %edx
	jle	.L14
	leal	-1(%rax), %r13d
	movq	%rax, %r12
	leal	(%rax,%rax), %eax
	xorl	%r15d, %r15d
	movl	%eax, 12(%rsp)
	leaq	buf(%rip), %rbx
	movl	%r13d, %r14d
	movl	$0, 8(%rsp)
.L11:
	movq	%rbx, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%rbx, %rdi
	call	strlen@PLT
	movl	%eax, %r8d
	testq	%rax, %rax
	je	.L3
	movl	12(%rsp), %eax
	movl	%r14d, %esi
	leaq	buf(%rip), %r9
	xorl	%r10d, %r10d
	leal	-2(%rax), %r11d
	leaq	1+a(%rip), %rax
	addq	%rax, %rsi
.L4:
	leal	(%r14,%r10), %eax
	leal	(%r11,%r10), %edi
	movl	$1, %ecx
	cmpl	%eax, %r8d
	jle	.L10
	testq	%r12, %r12
	je	.L5
	.p2align 4,,10
	.p2align 3
.L32:
	leaq	a(%rip), %rax
	movq	%r9, %rdx
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L6:
	addq	$1, %rax
	addq	%rcx, %rdx
	cmpq	%rsi, %rax
	je	.L5
.L8:
	movzbl	(%rdx), %ebp
	cmpb	%bpl, (%rax)
	je	.L6
	leal	0(%r13,%rdi), %eax
	addq	$1, %rcx
	cmpl	%edi, %r8d
	jle	.L10
	movl	%eax, %edi
	testq	%r12, %r12
	jne	.L32
	.p2align 4,,10
	.p2align 3
.L5:
	addl	$1, 8(%rsp)
.L3:
	addl	$1, %r15d
	cmpl	%r15d, 20(%rsp)
	jg	.L11
.L2:
	movl	8(%rsp), %edx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L33
	addq	$40, %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
.L10:
	.cfi_restore_state
	addl	$1, %r10d
	addq	$1, %r9
	cmpl	%r10d, %r8d
	jne	.L4
	jmp	.L3
.L14:
	movl	$0, 8(%rsp)
	jmp	.L2
.L33:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	buf
	.bss
	.align 32
	.type	buf, @object
	.size	buf, 100
buf:
	.zero	100
	.globl	a
	.align 16
	.type	a, @object
	.size	a, 25
a:
	.zero	25
	.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:
```