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

```c
// Aizu Vol-5 0517: Longest Steps
// 2017.8.30 bal4u@uu

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

char c[100005];

int main()
{
	int n, k, a;
	int i, f, w, w0, ans;

	while (scanf("%d%d", &n, &k) && n) {
		memset(c, 0, n+3), f = 0;
		while (k-- > 0) {
			scanf("%d", &a);
			if (a == 0) f = 1;
			else c[a] = 1;
		}
		for (ans = w0 = w = 0, i = 1; i <= n; i++) {
			if (c[i]) w++;
			else if (w > 0) {
				if (w0 + w + f > ans) ans = w0 + w + f;
				if (f && c[i+1]) w0 = w; else w0 = 0;
				w = 0;
			}
		}
		if (w0 + w + f > ans) ans = w0 + w + f;
		printf("%d\n", ans);
	}
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d%d"
	.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
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	.LC2(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	c(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC0(%rip), %rbp
	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	16(%rsp), %r15
	leaq	12(%rsp), %r14
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%r15, %rdx
	movq	%r14, %rsi
	movq	%r13, %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L15
	movl	12(%rsp), %eax
	testl	%eax, %eax
	je	.L15
	addl	$3, %eax
	movl	$100005, %ecx
	xorl	%esi, %esi
	movq	%r12, %rdi
	movslq	%eax, %rdx
	xorl	%ebx, %ebx
	call	__memset_chk@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	leaq	20(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	20(%rsp), %rax
	testl	%eax, %eax
	jne	.L34
	movl	$1, %ebx
.L4:
	movl	16(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 16(%rsp)
	testl	%eax, %eax
	jg	.L5
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L19
	leaq	1+c(%rip), %rcx
	testl	%ebx, %ebx
	jne	.L7
	leal	-1(%rax), %esi
	leaq	1(%rcx), %rax
	xorl	%edx, %edx
	addq	%rax, %rsi
	xorl	%eax, %eax
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L36:
	testl	%eax, %eax
	je	.L9
	cmpl	%eax, %edx
	cmovl	%eax, %edx
	xorl	%eax, %eax
.L9:
	addq	$1, %rcx
	cmpq	%rsi, %rcx
	je	.L35
.L10:
	cmpb	$0, (%rcx)
	je	.L36
	addq	$1, %rcx
	addl	$1, %eax
	cmpq	%rsi, %rcx
	jne	.L10
.L35:
	xorl	%esi, %esi
.L11:
	addl	%eax, %esi
	addl	%esi, %ebx
.L6:
	cmpl	%ebx, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	cmovl	%ebx, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L34:
	movb	$1, (%r12,%rax)
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L7:
	leal	-1(%rax), %edi
	leaq	1(%rcx), %rax
	xorl	%edx, %edx
	xorl	%esi, %esi
	addq	%rax, %rdi
	xorl	%eax, %eax
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L37:
	addl	$1, %eax
.L13:
	addq	$1, %rcx
	cmpq	%rdi, %rcx
	je	.L11
.L14:
	cmpb	$0, (%rcx)
	jne	.L37
	testl	%eax, %eax
	je	.L13
	leal	1(%rsi,%rax), %esi
	cmpl	%esi, %edx
	cmovl	%esi, %edx
	cmpb	$0, 1(%rcx)
	jne	.L20
	xorl	%esi, %esi
	xorl	%eax, %eax
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L20:
	movl	%eax, %esi
	xorl	%eax, %eax
	jmp	.L13
.L15:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L38
	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
.L19:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L6
.L38:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	c
	.bss
	.align 32
	.type	c, @object
	.size	c, 100005
c:
	.zero	100005
	.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	"%d\n"
.LC2:
	.string	"%d%d"
	.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
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	.LC2(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	c(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC0(%rip), %rbp
	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	16(%rsp), %r15
	leaq	12(%rsp), %r14
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%r15, %rdx
	movq	%r14, %rsi
	movq	%r13, %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L15
	movl	12(%rsp), %eax
	testl	%eax, %eax
	je	.L15
	addl	$3, %eax
	movl	$100005, %ecx
	xorl	%esi, %esi
	movq	%r12, %rdi
	movslq	%eax, %rdx
	xorl	%ebx, %ebx
	call	__memset_chk@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	leaq	20(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	20(%rsp), %rax
	testl	%eax, %eax
	jne	.L34
	movl	$1, %ebx
.L4:
	movl	16(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 16(%rsp)
	testl	%eax, %eax
	jg	.L5
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L19
	leaq	1+c(%rip), %rcx
	testl	%ebx, %ebx
	jne	.L7
	leal	-1(%rax), %esi
	leaq	1(%rcx), %rax
	xorl	%edx, %edx
	addq	%rax, %rsi
	xorl	%eax, %eax
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L36:
	testl	%eax, %eax
	je	.L9
	cmpl	%eax, %edx
	cmovl	%eax, %edx
	xorl	%eax, %eax
.L9:
	addq	$1, %rcx
	cmpq	%rsi, %rcx
	je	.L35
.L10:
	cmpb	$0, (%rcx)
	je	.L36
	addq	$1, %rcx
	addl	$1, %eax
	cmpq	%rsi, %rcx
	jne	.L10
.L35:
	xorl	%esi, %esi
.L11:
	addl	%eax, %esi
	addl	%esi, %ebx
.L6:
	cmpl	%ebx, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	cmovl	%ebx, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L34:
	movb	$1, (%r12,%rax)
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L7:
	leal	-1(%rax), %edi
	leaq	1(%rcx), %rax
	xorl	%edx, %edx
	xorl	%esi, %esi
	addq	%rax, %rdi
	xorl	%eax, %eax
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L37:
	addl	$1, %eax
.L13:
	addq	$1, %rcx
	cmpq	%rdi, %rcx
	je	.L11
.L14:
	cmpb	$0, (%rcx)
	jne	.L37
	testl	%eax, %eax
	je	.L13
	leal	1(%rsi,%rax), %esi
	cmpl	%esi, %edx
	cmovl	%esi, %edx
	cmpb	$0, 1(%rcx)
	jne	.L20
	xorl	%esi, %esi
	xorl	%eax, %eax
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L20:
	movl	%eax, %esi
	xorl	%eax, %eax
	jmp	.L13
.L15:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L38
	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
.L19:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L6
.L38:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	c
	.bss
	.align 32
	.type	c, @object
	.size	c, 100005
c:
	.zero	100005
	.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	"%d\n"
.LC2:
	.string	"%d%d"
	.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
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	.LC2(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	c(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC0(%rip), %rbp
	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	16(%rsp), %r15
	leaq	12(%rsp), %r14
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%r15, %rdx
	movq	%r14, %rsi
	movq	%r13, %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L15
	movl	12(%rsp), %eax
	testl	%eax, %eax
	je	.L15
	addl	$3, %eax
	movl	$100005, %ecx
	xorl	%esi, %esi
	movq	%r12, %rdi
	movslq	%eax, %rdx
	xorl	%ebx, %ebx
	call	__memset_chk@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	leaq	20(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	20(%rsp), %rax
	testl	%eax, %eax
	jne	.L34
	movl	$1, %ebx
.L4:
	movl	16(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 16(%rsp)
	testl	%eax, %eax
	jg	.L5
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L19
	leaq	1+c(%rip), %rcx
	testl	%ebx, %ebx
	jne	.L7
	leal	-1(%rax), %esi
	leaq	1(%rcx), %rax
	xorl	%edx, %edx
	addq	%rax, %rsi
	xorl	%eax, %eax
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L36:
	testl	%eax, %eax
	je	.L9
	cmpl	%eax, %edx
	cmovl	%eax, %edx
	xorl	%eax, %eax
.L9:
	addq	$1, %rcx
	cmpq	%rsi, %rcx
	je	.L35
.L10:
	cmpb	$0, (%rcx)
	je	.L36
	addq	$1, %rcx
	addl	$1, %eax
	cmpq	%rsi, %rcx
	jne	.L10
.L35:
	xorl	%esi, %esi
.L11:
	addl	%eax, %esi
	addl	%esi, %ebx
.L6:
	cmpl	%ebx, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	cmovl	%ebx, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L34:
	movb	$1, (%r12,%rax)
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L7:
	leal	-1(%rax), %edi
	leaq	1(%rcx), %rax
	xorl	%edx, %edx
	xorl	%esi, %esi
	addq	%rax, %rdi
	xorl	%eax, %eax
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L37:
	addl	$1, %eax
.L13:
	addq	$1, %rcx
	cmpq	%rdi, %rcx
	je	.L11
.L14:
	cmpb	$0, (%rcx)
	jne	.L37
	testl	%eax, %eax
	je	.L13
	leal	1(%rsi,%rax), %esi
	cmpl	%esi, %edx
	cmovl	%esi, %edx
	cmpb	$0, 1(%rcx)
	jne	.L20
	xorl	%esi, %esi
	xorl	%eax, %eax
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L20:
	movl	%eax, %esi
	xorl	%eax, %eax
	jmp	.L13
.L15:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L38
	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
.L19:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L6
.L38:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	c
	.bss
	.align 32
	.type	c, @object
	.size	c, 100005
c:
	.zero	100005
	.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
// Aizu Vol-5 0517: Longest Steps
// 2017.8.30 bal4u@uu

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

char c[100005];

int main()
{
	int n, k, a;
	int i, f, w, w0, ans;

	while (scanf("%d%d", &n, &k) && n) {
		memset(c, 0, n+3), f = 0;
		while (k-- > 0) {
			scanf("%d", &a);
			if (a == 0) f = 1;
			else c[a] = 1;
		}
		for (ans = w0 = w = 0, i = 1; i <= n; i++) {
			if (c[i]) w++;
			else if (w > 0) {
				if (w0 + w + f > ans) ans = w0 + w + f;
				if (f && c[i+1]) w0 = w; else w0 = 0;
				w = 0;
			}
		}
		if (w0 + w + f > ans) ans = w0 + w + f;
		printf("%d\n", ans);
	}
	return 0;
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
// Aizu Vol-5 0517: Longest Steps
// 2017.8.30 bal4u@uu

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

char c[100005];

int main()
{
	int n, k, a;
	int i, f, w, w0, ans;

	while (scanf("%d%d", &n, &k) && n) {
		memset(c, 0, n+3), f = 0;
		while (k-- > 0) {
			scanf("%d", &a);
			if (a == 0) f = 1;
			else c[a] = 1;
		}
		for (ans = w0 = w = 0, i = 1; i <= n; i++) {
			if (c[i]) w++;
			else if (w > 0) {
				if (w0 + w + f > ans) ans = w0 + w + f;
				if (f && c[i+1]) w0 = w; else w0 = 0;
				w = 0;
			}
		}
		if (w0 + w + f > ans) ans = w0 + w + f;
		printf("%d\n", ans);
	}
	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:

7 5
6
2
4
7
1
7 5
5
2
0
4
7
0 0
 7 5
6
2
4
7
1
7 5
5
2
0
1
7
0 0
 9 5
6
2
4
7
1
7 5
5
2
1
4
7
0 0
 14 5
6
0
4
7
1
7 5
5
2
0
4
7
0 0
 7 5
6
2
3
7
1
7 5
6
2
0
4
7
0 0
 7 5
6
2
4
7
0
25 5
5
2
0
1
7
0 0
 14 5
5
3
4
7
1
7 5
5
2
1
4
7
0 0
 7 5
6
2
4
7
1
7 5
5
2
0
4
6
0 0
 9 5
6
2
4
3
1
7 5
5
2
1
4
7
0 0
 7 5
6
2
4
3
0
25 5
5
2
0
1
7
0 0

2
4
 2
3
 2
2
 4
4
 3
4
 4
3
 3
2
 2
5
 4
2
 5
3

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

```c
// Aizu Vol-5 0517: Longest Steps
// 2017.8.30 bal4u@uu

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

char c[100005];

int main()
{
	int n, k, a;
	int i, f, w, w0, ans;

	while (scanf("%d%d", &n, &k) && n) {
		memset(c, 0, n+3), f = 0;
		while (k-- > 0) {
			scanf("%d", &a);
			if (a == 0) f = 1;
			else c[a] = 1;
		}
		for (ans = w0 = w = 0, i = 1; i <= n; i++) {
			if (c[i]) w++;
			else if (w > 0) {
				if (w0 + w + f > ans) ans = w0 + w + f;
				if (f && c[i+1]) w0 = w; else w0 = 0;
				w = 0;
			}
		}
		if (w0 + w + f > ans) ans = w0 + w + f;
		printf("%d\n", ans);
	}
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d%d"
	.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
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	.LC2(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	c(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC0(%rip), %rbp
	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	16(%rsp), %r15
	leaq	12(%rsp), %r14
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%r15, %rdx
	movq	%r14, %rsi
	movq	%r13, %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L15
	movl	12(%rsp), %eax
	testl	%eax, %eax
	je	.L15
	addl	$3, %eax
	movl	$100005, %ecx
	xorl	%esi, %esi
	movq	%r12, %rdi
	movslq	%eax, %rdx
	xorl	%ebx, %ebx
	call	__memset_chk@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	leaq	20(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	20(%rsp), %rax
	testl	%eax, %eax
	jne	.L34
	movl	$1, %ebx
.L4:
	movl	16(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 16(%rsp)
	testl	%eax, %eax
	jg	.L5
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L19
	leaq	1+c(%rip), %rcx
	testl	%ebx, %ebx
	jne	.L7
	leal	-1(%rax), %esi
	leaq	1(%rcx), %rax
	xorl	%edx, %edx
	addq	%rax, %rsi
	xorl	%eax, %eax
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L36:
	testl	%eax, %eax
	je	.L9
	cmpl	%eax, %edx
	cmovl	%eax, %edx
	xorl	%eax, %eax
.L9:
	addq	$1, %rcx
	cmpq	%rsi, %rcx
	je	.L35
.L10:
	cmpb	$0, (%rcx)
	je	.L36
	addq	$1, %rcx
	addl	$1, %eax
	cmpq	%rsi, %rcx
	jne	.L10
.L35:
	xorl	%esi, %esi
.L11:
	addl	%eax, %esi
	addl	%esi, %ebx
.L6:
	cmpl	%ebx, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	cmovl	%ebx, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L34:
	movb	$1, (%r12,%rax)
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L7:
	leal	-1(%rax), %edi
	leaq	1(%rcx), %rax
	xorl	%edx, %edx
	xorl	%esi, %esi
	addq	%rax, %rdi
	xorl	%eax, %eax
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L37:
	addl	$1, %eax
.L13:
	addq	$1, %rcx
	cmpq	%rdi, %rcx
	je	.L11
.L14:
	cmpb	$0, (%rcx)
	jne	.L37
	testl	%eax, %eax
	je	.L13
	leal	1(%rsi,%rax), %esi
	cmpl	%esi, %edx
	cmovl	%esi, %edx
	cmpb	$0, 1(%rcx)
	jne	.L20
	xorl	%esi, %esi
	xorl	%eax, %eax
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L20:
	movl	%eax, %esi
	xorl	%eax, %eax
	jmp	.L13
.L15:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L38
	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
.L19:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L6
.L38:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	c
	.bss
	.align 32
	.type	c, @object
	.size	c, 100005
c:
	.zero	100005
	.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	"%d\n"
.LC2:
	.string	"%d%d"
	.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
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	.LC2(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	c(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC0(%rip), %rbp
	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	16(%rsp), %r15
	leaq	12(%rsp), %r14
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%r15, %rdx
	movq	%r14, %rsi
	movq	%r13, %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L15
	movl	12(%rsp), %eax
	testl	%eax, %eax
	je	.L15
	addl	$3, %eax
	movl	$100005, %ecx
	xorl	%esi, %esi
	movq	%r12, %rdi
	movslq	%eax, %rdx
	xorl	%ebx, %ebx
	call	__memset_chk@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	leaq	20(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	20(%rsp), %rax
	testl	%eax, %eax
	jne	.L34
	movl	$1, %ebx
.L4:
	movl	16(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 16(%rsp)
	testl	%eax, %eax
	jg	.L5
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L19
	leaq	1+c(%rip), %rcx
	testl	%ebx, %ebx
	jne	.L7
	leal	-1(%rax), %esi
	leaq	1(%rcx), %rax
	xorl	%edx, %edx
	addq	%rax, %rsi
	xorl	%eax, %eax
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L36:
	testl	%eax, %eax
	je	.L9
	cmpl	%eax, %edx
	cmovl	%eax, %edx
	xorl	%eax, %eax
.L9:
	addq	$1, %rcx
	cmpq	%rsi, %rcx
	je	.L35
.L10:
	cmpb	$0, (%rcx)
	je	.L36
	addq	$1, %rcx
	addl	$1, %eax
	cmpq	%rsi, %rcx
	jne	.L10
.L35:
	xorl	%esi, %esi
.L11:
	addl	%eax, %esi
	addl	%esi, %ebx
.L6:
	cmpl	%ebx, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	cmovl	%ebx, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L34:
	movb	$1, (%r12,%rax)
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L7:
	leal	-1(%rax), %edi
	leaq	1(%rcx), %rax
	xorl	%edx, %edx
	xorl	%esi, %esi
	addq	%rax, %rdi
	xorl	%eax, %eax
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L37:
	addl	$1, %eax
.L13:
	addq	$1, %rcx
	cmpq	%rdi, %rcx
	je	.L11
.L14:
	cmpb	$0, (%rcx)
	jne	.L37
	testl	%eax, %eax
	je	.L13
	leal	1(%rsi,%rax), %esi
	cmpl	%esi, %edx
	cmovl	%esi, %edx
	cmpb	$0, 1(%rcx)
	jne	.L20
	xorl	%esi, %esi
	xorl	%eax, %eax
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L20:
	movl	%eax, %esi
	xorl	%eax, %eax
	jmp	.L13
.L15:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L38
	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
.L19:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L6
.L38:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	c
	.bss
	.align 32
	.type	c, @object
	.size	c, 100005
c:
	.zero	100005
	.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:
```