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>
int a[110];
int main(){
	int x,n;
	scanf("%d%d",&x,&n);
	for(int i=0;i<n;i++)scanf("%d",a+i);
	
	for(int d=0;;d++)for(int e=-1;e<2;e+=2){
		int dd=d*e;
		int flag=0;
		for(int i=0;i<n;i++)flag|=a[i]==x+dd;
		if(!flag){
			printf("%d",x+dd);
			return 0;
		}
	}
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	leaq	a(%rip), %rbx
	xorl	%r12d, %r12d
	leaq	.LC1(%rip), %rbp
	movq	%rbx, %r13
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %ecx
	addq	$4, %r13
	cmpl	%r12d, %ecx
	jg	.L3
	movl	%ecx, %eax
	movl	(%rsp), %r9d
	movl	%ecx, %r8d
	leal	-1(%rcx), %r10d
	shrl	$2, %eax
	movdqa	.LC2(%rip), %xmm2
	andl	$-4, %r8d
	leal	-1(%rax), %edx
	leaq	16+a(%rip), %rax
	movl	%r9d, %esi
	movl	%r9d, %edi
	salq	$4, %rdx
	addq	%rax, %rdx
	.p2align 4,,10
	.p2align 3
.L13:
	movl	%r9d, %r11d
	movl	%r9d, %r13d
	subl	%esi, %r11d
	subl	%edi, %r13d
	testl	%ecx, %ecx
	jle	.L9
	cmpl	$2, %r10d
	jbe	.L17
	movd	%esi, %xmm5
	pxor	%xmm0, %xmm0
	movdqa	%xmm2, %xmm3
	movq	%rbx, %rax
	pshufd	$0, %xmm5, %xmm4
	.p2align 4,,10
	.p2align 3
.L6:
	movdqa	%xmm4, %xmm1
	addq	$16, %rax
	pcmpeqd	-16(%rax), %xmm1
	pand	%xmm2, %xmm1
	por	%xmm1, %xmm0
	cmpq	%rdx, %rax
	jne	.L6
	movdqa	%xmm0, %xmm1
	movl	%r8d, %r12d
	psrldq	$8, %xmm1
	por	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	por	%xmm1, %xmm0
	movd	%xmm0, %eax
	cmpl	%r8d, %ecx
	je	.L32
.L5:
	movslq	%r12d, %r14
	cmpl	%esi, (%rbx,%r14,4)
	sete	%r14b
	movzbl	%r14b, %r14d
	orl	%r14d, %eax
	leal	1(%r12), %r14d
	cmpl	%r14d, %ecx
	jle	.L8
	movslq	%r14d, %r14
	cmpl	%esi, (%rbx,%r14,4)
	sete	%r14b
	addl	$2, %r12d
	movzbl	%r14b, %r14d
	orl	%r14d, %eax
	cmpl	%r12d, %ecx
	jle	.L8
	movslq	%r12d, %r12
	cmpl	%esi, (%rbx,%r12,4)
	sete	%r12b
	movzbl	%r12b, %r12d
	orl	%r12d, %eax
.L8:
	testl	%eax, %eax
	je	.L9
	cmpl	$2, %r10d
	jbe	.L18
	movdqa	%xmm2, %xmm3
.L14:
	movd	%edi, %xmm6
	movq	%rbx, %rax
	pxor	%xmm1, %xmm1
	pshufd	$0, %xmm6, %xmm4
	.p2align 4,,10
	.p2align 3
.L11:
	movdqa	%xmm4, %xmm0
	addq	$16, %rax
	pcmpeqd	-16(%rax), %xmm0
	pand	%xmm3, %xmm0
	por	%xmm0, %xmm1
	cmpq	%rax, %rdx
	jne	.L11
	movdqa	%xmm1, %xmm0
	movl	%r8d, %r12d
	psrldq	$8, %xmm0
	por	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	psrldq	$4, %xmm0
	por	%xmm0, %xmm1
	movd	%xmm1, %eax
	cmpl	%r8d, %ecx
	je	.L12
.L10:
	movslq	%r12d, %r13
	cmpl	%edi, (%rbx,%r13,4)
	sete	%r13b
	movzbl	%r13b, %r13d
	orl	%r13d, %eax
	leal	1(%r12), %r13d
	cmpl	%r13d, %ecx
	jle	.L12
	movslq	%r13d, %r13
	cmpl	%edi, (%rbx,%r13,4)
	sete	%r13b
	addl	$2, %r12d
	movzbl	%r13b, %r13d
	orl	%r13d, %eax
	cmpl	%r12d, %ecx
	jle	.L12
	movslq	%r12d, %r12
	cmpl	%edi, (%rbx,%r12,4)
	sete	%r12b
	movzbl	%r12b, %r12d
	orl	%r12d, %eax
.L12:
	addl	$1, %edi
	subl	$1, %esi
	testl	%eax, %eax
	jne	.L13
	movl	%r11d, %r13d
.L9:
	xorl	%eax, %eax
	leal	0(%r13,%r9), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L33
	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
	.p2align 4,,10
	.p2align 3
.L32:
	.cfi_restore_state
	testl	%eax, %eax
	jne	.L14
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L18:
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	jmp	.L10
.L17:
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	jmp	.L5
.L2:
	movl	(%rsp), %r9d
	xorl	%r13d, %r13d
	leaq	.LC1(%rip), %rbp
	jmp	.L9
.L33:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 440
a:
	.zero	440
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC2:
	.long	1
	.long	1
	.long	1
	.long	1
	.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%d"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	leaq	a(%rip), %rbx
	xorl	%r12d, %r12d
	leaq	.LC1(%rip), %rbp
	movq	%rbx, %r13
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %ecx
	addq	$4, %r13
	cmpl	%r12d, %ecx
	jg	.L3
	movl	%ecx, %eax
	movl	(%rsp), %r9d
	movl	%ecx, %r8d
	leal	-1(%rcx), %r10d
	shrl	$2, %eax
	movdqa	.LC2(%rip), %xmm2
	andl	$-4, %r8d
	leal	-1(%rax), %edx
	leaq	16+a(%rip), %rax
	movl	%r9d, %esi
	movl	%r9d, %edi
	salq	$4, %rdx
	addq	%rax, %rdx
	.p2align 4,,10
	.p2align 3
.L13:
	movl	%r9d, %r11d
	movl	%r9d, %r13d
	subl	%esi, %r11d
	subl	%edi, %r13d
	testl	%ecx, %ecx
	jle	.L9
	cmpl	$2, %r10d
	jbe	.L17
	movd	%esi, %xmm5
	pxor	%xmm0, %xmm0
	movdqa	%xmm2, %xmm3
	movq	%rbx, %rax
	pshufd	$0, %xmm5, %xmm4
	.p2align 4,,10
	.p2align 3
.L6:
	movdqa	%xmm4, %xmm1
	addq	$16, %rax
	pcmpeqd	-16(%rax), %xmm1
	pand	%xmm2, %xmm1
	por	%xmm1, %xmm0
	cmpq	%rdx, %rax
	jne	.L6
	movdqa	%xmm0, %xmm1
	movl	%r8d, %r12d
	psrldq	$8, %xmm1
	por	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	por	%xmm1, %xmm0
	movd	%xmm0, %eax
	cmpl	%r8d, %ecx
	je	.L32
.L5:
	movslq	%r12d, %r14
	cmpl	%esi, (%rbx,%r14,4)
	sete	%r14b
	movzbl	%r14b, %r14d
	orl	%r14d, %eax
	leal	1(%r12), %r14d
	cmpl	%r14d, %ecx
	jle	.L8
	movslq	%r14d, %r14
	cmpl	%esi, (%rbx,%r14,4)
	sete	%r14b
	addl	$2, %r12d
	movzbl	%r14b, %r14d
	orl	%r14d, %eax
	cmpl	%r12d, %ecx
	jle	.L8
	movslq	%r12d, %r12
	cmpl	%esi, (%rbx,%r12,4)
	sete	%r12b
	movzbl	%r12b, %r12d
	orl	%r12d, %eax
.L8:
	testl	%eax, %eax
	je	.L9
	cmpl	$2, %r10d
	jbe	.L18
	movdqa	%xmm2, %xmm3
.L14:
	movd	%edi, %xmm6
	movq	%rbx, %rax
	pxor	%xmm1, %xmm1
	pshufd	$0, %xmm6, %xmm4
	.p2align 4,,10
	.p2align 3
.L11:
	movdqa	%xmm4, %xmm0
	addq	$16, %rax
	pcmpeqd	-16(%rax), %xmm0
	pand	%xmm3, %xmm0
	por	%xmm0, %xmm1
	cmpq	%rax, %rdx
	jne	.L11
	movdqa	%xmm1, %xmm0
	movl	%r8d, %r12d
	psrldq	$8, %xmm0
	por	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	psrldq	$4, %xmm0
	por	%xmm0, %xmm1
	movd	%xmm1, %eax
	cmpl	%r8d, %ecx
	je	.L12
.L10:
	movslq	%r12d, %r13
	cmpl	%edi, (%rbx,%r13,4)
	sete	%r13b
	movzbl	%r13b, %r13d
	orl	%r13d, %eax
	leal	1(%r12), %r13d
	cmpl	%r13d, %ecx
	jle	.L12
	movslq	%r13d, %r13
	cmpl	%edi, (%rbx,%r13,4)
	sete	%r13b
	addl	$2, %r12d
	movzbl	%r13b, %r13d
	orl	%r13d, %eax
	cmpl	%r12d, %ecx
	jle	.L12
	movslq	%r12d, %r12
	cmpl	%edi, (%rbx,%r12,4)
	sete	%r12b
	movzbl	%r12b, %r12d
	orl	%r12d, %eax
.L12:
	addl	$1, %edi
	subl	$1, %esi
	testl	%eax, %eax
	jne	.L13
	movl	%r11d, %r13d
.L9:
	xorl	%eax, %eax
	leal	0(%r13,%r9), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L33
	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
	.p2align 4,,10
	.p2align 3
.L32:
	.cfi_restore_state
	testl	%eax, %eax
	jne	.L14
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L18:
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	jmp	.L10
.L17:
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	jmp	.L5
.L2:
	movl	(%rsp), %r9d
	xorl	%r13d, %r13d
	leaq	.LC1(%rip), %rbp
	jmp	.L9
.L33:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 440
a:
	.zero	440
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC2:
	.long	1
	.long	1
	.long	1
	.long	1
	.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%d"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	leaq	a(%rip), %rbx
	xorl	%r12d, %r12d
	leaq	.LC1(%rip), %rbp
	movq	%rbx, %r13
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %ecx
	addq	$4, %r13
	cmpl	%r12d, %ecx
	jg	.L3
	movl	%ecx, %eax
	movl	(%rsp), %r9d
	movl	%ecx, %r8d
	leal	-1(%rcx), %r10d
	shrl	$2, %eax
	movdqa	.LC2(%rip), %xmm2
	andl	$-4, %r8d
	leal	-1(%rax), %edx
	leaq	16+a(%rip), %rax
	movl	%r9d, %esi
	movl	%r9d, %edi
	salq	$4, %rdx
	addq	%rax, %rdx
	.p2align 4,,10
	.p2align 3
.L13:
	movl	%r9d, %r11d
	movl	%r9d, %r13d
	subl	%esi, %r11d
	subl	%edi, %r13d
	testl	%ecx, %ecx
	jle	.L9
	cmpl	$2, %r10d
	jbe	.L17
	movd	%esi, %xmm5
	pxor	%xmm0, %xmm0
	movdqa	%xmm2, %xmm3
	movq	%rbx, %rax
	pshufd	$0, %xmm5, %xmm4
	.p2align 4,,10
	.p2align 3
.L6:
	movdqa	%xmm4, %xmm1
	addq	$16, %rax
	pcmpeqd	-16(%rax), %xmm1
	pand	%xmm2, %xmm1
	por	%xmm1, %xmm0
	cmpq	%rdx, %rax
	jne	.L6
	movdqa	%xmm0, %xmm1
	movl	%r8d, %r12d
	psrldq	$8, %xmm1
	por	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	por	%xmm1, %xmm0
	movd	%xmm0, %eax
	cmpl	%r8d, %ecx
	je	.L32
.L5:
	movslq	%r12d, %r14
	cmpl	%esi, (%rbx,%r14,4)
	sete	%r14b
	movzbl	%r14b, %r14d
	orl	%r14d, %eax
	leal	1(%r12), %r14d
	cmpl	%r14d, %ecx
	jle	.L8
	movslq	%r14d, %r14
	cmpl	%esi, (%rbx,%r14,4)
	sete	%r14b
	addl	$2, %r12d
	movzbl	%r14b, %r14d
	orl	%r14d, %eax
	cmpl	%r12d, %ecx
	jle	.L8
	movslq	%r12d, %r12
	cmpl	%esi, (%rbx,%r12,4)
	sete	%r12b
	movzbl	%r12b, %r12d
	orl	%r12d, %eax
.L8:
	testl	%eax, %eax
	je	.L9
	cmpl	$2, %r10d
	jbe	.L18
	movdqa	%xmm2, %xmm3
.L14:
	movd	%edi, %xmm6
	movq	%rbx, %rax
	pxor	%xmm1, %xmm1
	pshufd	$0, %xmm6, %xmm4
	.p2align 4,,10
	.p2align 3
.L11:
	movdqa	%xmm4, %xmm0
	addq	$16, %rax
	pcmpeqd	-16(%rax), %xmm0
	pand	%xmm3, %xmm0
	por	%xmm0, %xmm1
	cmpq	%rax, %rdx
	jne	.L11
	movdqa	%xmm1, %xmm0
	movl	%r8d, %r12d
	psrldq	$8, %xmm0
	por	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	psrldq	$4, %xmm0
	por	%xmm0, %xmm1
	movd	%xmm1, %eax
	cmpl	%r8d, %ecx
	je	.L12
.L10:
	movslq	%r12d, %r13
	cmpl	%edi, (%rbx,%r13,4)
	sete	%r13b
	movzbl	%r13b, %r13d
	orl	%r13d, %eax
	leal	1(%r12), %r13d
	cmpl	%r13d, %ecx
	jle	.L12
	movslq	%r13d, %r13
	cmpl	%edi, (%rbx,%r13,4)
	sete	%r13b
	addl	$2, %r12d
	movzbl	%r13b, %r13d
	orl	%r13d, %eax
	cmpl	%r12d, %ecx
	jle	.L12
	movslq	%r12d, %r12
	cmpl	%edi, (%rbx,%r12,4)
	sete	%r12b
	movzbl	%r12b, %r12d
	orl	%r12d, %eax
.L12:
	addl	$1, %edi
	subl	$1, %esi
	testl	%eax, %eax
	jne	.L13
	movl	%r11d, %r13d
.L9:
	xorl	%eax, %eax
	leal	0(%r13,%r9), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L33
	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
	.p2align 4,,10
	.p2align 3
.L32:
	.cfi_restore_state
	testl	%eax, %eax
	jne	.L14
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L18:
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	jmp	.L10
.L17:
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	jmp	.L5
.L2:
	movl	(%rsp), %r9d
	xorl	%r13d, %r13d
	leaq	.LC1(%rip), %rbp
	jmp	.L9
.L33:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 440
a:
	.zero	440
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC2:
	.long	1
	.long	1
	.long	1
	.long	1
	.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>
int a[110];
int main(){
	int x,n;
	scanf("%d%d",&x,&n);
	for(int i=0;i<n;i++)scanf("%d",a+i);
	
	for(int d=0;;d++)for(int e=-1;e<2;e+=2){
		int dd=d*e;
		int flag=0;
		for(int i=0;i<n;i++)flag|=a[i]==x+dd;
		if(!flag){
			printf("%d",x+dd);
			return 0;
		}
	}
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
int a[110];
int main(){
	int x,n;
	scanf("%d%d",&x,&n);
	for(int i=0;i<n;i++)scanf("%d",a+i);
	
	for(int d=0;;d++)for(int e=-1;e<2;e+=2){
		int dd=d*e;
		int flag=0;
		for(int i=0;i<n;i++)flag|=a[i]==x+dd;
		if(!flag){
			printf("%d",x+dd);
			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:

6 2
4 7 10 6 5
 10 3
4 7 10 6 5
 6 2
4 7 10 8 5
 10 3
4 7 9 6 5
 15 3
7 5 3 6 5
 12 1
2 5 3 16 11
 2 1
4 5 0 16 4
 6 5
3 7 10 6 5
 19 5
4 7 10 6 5
 101 0

6 9 6 10 15 12 2 4 19 101
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>
int a[110];
int main(){
	int x,n;
	scanf("%d%d",&x,&n);
	for(int i=0;i<n;i++)scanf("%d",a+i);
	
	for(int d=0;;d++)for(int e=-1;e<2;e+=2){
		int dd=d*e;
		int flag=0;
		for(int i=0;i<n;i++)flag|=a[i]==x+dd;
		if(!flag){
			printf("%d",x+dd);
			return 0;
		}
	}
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	leaq	a(%rip), %rbx
	xorl	%r12d, %r12d
	leaq	.LC1(%rip), %rbp
	movq	%rbx, %r13
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %ecx
	addq	$4, %r13
	cmpl	%r12d, %ecx
	jg	.L3
	movl	%ecx, %eax
	movl	(%rsp), %r9d
	movl	%ecx, %r8d
	leal	-1(%rcx), %r10d
	shrl	$2, %eax
	movdqa	.LC2(%rip), %xmm2
	andl	$-4, %r8d
	leal	-1(%rax), %edx
	leaq	16+a(%rip), %rax
	movl	%r9d, %esi
	movl	%r9d, %edi
	salq	$4, %rdx
	addq	%rax, %rdx
	.p2align 4,,10
	.p2align 3
.L13:
	movl	%r9d, %r11d
	movl	%r9d, %r13d
	subl	%esi, %r11d
	subl	%edi, %r13d
	testl	%ecx, %ecx
	jle	.L9
	cmpl	$2, %r10d
	jbe	.L17
	movd	%esi, %xmm5
	pxor	%xmm0, %xmm0
	movdqa	%xmm2, %xmm3
	movq	%rbx, %rax
	pshufd	$0, %xmm5, %xmm4
	.p2align 4,,10
	.p2align 3
.L6:
	movdqa	%xmm4, %xmm1
	addq	$16, %rax
	pcmpeqd	-16(%rax), %xmm1
	pand	%xmm2, %xmm1
	por	%xmm1, %xmm0
	cmpq	%rdx, %rax
	jne	.L6
	movdqa	%xmm0, %xmm1
	movl	%r8d, %r12d
	psrldq	$8, %xmm1
	por	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	por	%xmm1, %xmm0
	movd	%xmm0, %eax
	cmpl	%r8d, %ecx
	je	.L32
.L5:
	movslq	%r12d, %r14
	cmpl	%esi, (%rbx,%r14,4)
	sete	%r14b
	movzbl	%r14b, %r14d
	orl	%r14d, %eax
	leal	1(%r12), %r14d
	cmpl	%r14d, %ecx
	jle	.L8
	movslq	%r14d, %r14
	cmpl	%esi, (%rbx,%r14,4)
	sete	%r14b
	addl	$2, %r12d
	movzbl	%r14b, %r14d
	orl	%r14d, %eax
	cmpl	%r12d, %ecx
	jle	.L8
	movslq	%r12d, %r12
	cmpl	%esi, (%rbx,%r12,4)
	sete	%r12b
	movzbl	%r12b, %r12d
	orl	%r12d, %eax
.L8:
	testl	%eax, %eax
	je	.L9
	cmpl	$2, %r10d
	jbe	.L18
	movdqa	%xmm2, %xmm3
.L14:
	movd	%edi, %xmm6
	movq	%rbx, %rax
	pxor	%xmm1, %xmm1
	pshufd	$0, %xmm6, %xmm4
	.p2align 4,,10
	.p2align 3
.L11:
	movdqa	%xmm4, %xmm0
	addq	$16, %rax
	pcmpeqd	-16(%rax), %xmm0
	pand	%xmm3, %xmm0
	por	%xmm0, %xmm1
	cmpq	%rax, %rdx
	jne	.L11
	movdqa	%xmm1, %xmm0
	movl	%r8d, %r12d
	psrldq	$8, %xmm0
	por	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	psrldq	$4, %xmm0
	por	%xmm0, %xmm1
	movd	%xmm1, %eax
	cmpl	%r8d, %ecx
	je	.L12
.L10:
	movslq	%r12d, %r13
	cmpl	%edi, (%rbx,%r13,4)
	sete	%r13b
	movzbl	%r13b, %r13d
	orl	%r13d, %eax
	leal	1(%r12), %r13d
	cmpl	%r13d, %ecx
	jle	.L12
	movslq	%r13d, %r13
	cmpl	%edi, (%rbx,%r13,4)
	sete	%r13b
	addl	$2, %r12d
	movzbl	%r13b, %r13d
	orl	%r13d, %eax
	cmpl	%r12d, %ecx
	jle	.L12
	movslq	%r12d, %r12
	cmpl	%edi, (%rbx,%r12,4)
	sete	%r12b
	movzbl	%r12b, %r12d
	orl	%r12d, %eax
.L12:
	addl	$1, %edi
	subl	$1, %esi
	testl	%eax, %eax
	jne	.L13
	movl	%r11d, %r13d
.L9:
	xorl	%eax, %eax
	leal	0(%r13,%r9), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L33
	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
	.p2align 4,,10
	.p2align 3
.L32:
	.cfi_restore_state
	testl	%eax, %eax
	jne	.L14
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L18:
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	jmp	.L10
.L17:
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	jmp	.L5
.L2:
	movl	(%rsp), %r9d
	xorl	%r13d, %r13d
	leaq	.LC1(%rip), %rbp
	jmp	.L9
.L33:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 440
a:
	.zero	440
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC2:
	.long	1
	.long	1
	.long	1
	.long	1
	.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%d"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	leaq	a(%rip), %rbx
	xorl	%r12d, %r12d
	leaq	.LC1(%rip), %rbp
	movq	%rbx, %r13
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %ecx
	addq	$4, %r13
	cmpl	%r12d, %ecx
	jg	.L3
	movl	%ecx, %eax
	movl	(%rsp), %r9d
	movl	%ecx, %r8d
	leal	-1(%rcx), %r10d
	shrl	$2, %eax
	movdqa	.LC2(%rip), %xmm2
	andl	$-4, %r8d
	leal	-1(%rax), %edx
	leaq	16+a(%rip), %rax
	movl	%r9d, %esi
	movl	%r9d, %edi
	salq	$4, %rdx
	addq	%rax, %rdx
	.p2align 4,,10
	.p2align 3
.L13:
	movl	%r9d, %r11d
	movl	%r9d, %r13d
	subl	%esi, %r11d
	subl	%edi, %r13d
	testl	%ecx, %ecx
	jle	.L9
	cmpl	$2, %r10d
	jbe	.L17
	movd	%esi, %xmm5
	pxor	%xmm0, %xmm0
	movdqa	%xmm2, %xmm3
	movq	%rbx, %rax
	pshufd	$0, %xmm5, %xmm4
	.p2align 4,,10
	.p2align 3
.L6:
	movdqa	%xmm4, %xmm1
	addq	$16, %rax
	pcmpeqd	-16(%rax), %xmm1
	pand	%xmm2, %xmm1
	por	%xmm1, %xmm0
	cmpq	%rdx, %rax
	jne	.L6
	movdqa	%xmm0, %xmm1
	movl	%r8d, %r12d
	psrldq	$8, %xmm1
	por	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	por	%xmm1, %xmm0
	movd	%xmm0, %eax
	cmpl	%r8d, %ecx
	je	.L32
.L5:
	movslq	%r12d, %r14
	cmpl	%esi, (%rbx,%r14,4)
	sete	%r14b
	movzbl	%r14b, %r14d
	orl	%r14d, %eax
	leal	1(%r12), %r14d
	cmpl	%r14d, %ecx
	jle	.L8
	movslq	%r14d, %r14
	cmpl	%esi, (%rbx,%r14,4)
	sete	%r14b
	addl	$2, %r12d
	movzbl	%r14b, %r14d
	orl	%r14d, %eax
	cmpl	%r12d, %ecx
	jle	.L8
	movslq	%r12d, %r12
	cmpl	%esi, (%rbx,%r12,4)
	sete	%r12b
	movzbl	%r12b, %r12d
	orl	%r12d, %eax
.L8:
	testl	%eax, %eax
	je	.L9
	cmpl	$2, %r10d
	jbe	.L18
	movdqa	%xmm2, %xmm3
.L14:
	movd	%edi, %xmm6
	movq	%rbx, %rax
	pxor	%xmm1, %xmm1
	pshufd	$0, %xmm6, %xmm4
	.p2align 4,,10
	.p2align 3
.L11:
	movdqa	%xmm4, %xmm0
	addq	$16, %rax
	pcmpeqd	-16(%rax), %xmm0
	pand	%xmm3, %xmm0
	por	%xmm0, %xmm1
	cmpq	%rax, %rdx
	jne	.L11
	movdqa	%xmm1, %xmm0
	movl	%r8d, %r12d
	psrldq	$8, %xmm0
	por	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	psrldq	$4, %xmm0
	por	%xmm0, %xmm1
	movd	%xmm1, %eax
	cmpl	%r8d, %ecx
	je	.L12
.L10:
	movslq	%r12d, %r13
	cmpl	%edi, (%rbx,%r13,4)
	sete	%r13b
	movzbl	%r13b, %r13d
	orl	%r13d, %eax
	leal	1(%r12), %r13d
	cmpl	%r13d, %ecx
	jle	.L12
	movslq	%r13d, %r13
	cmpl	%edi, (%rbx,%r13,4)
	sete	%r13b
	addl	$2, %r12d
	movzbl	%r13b, %r13d
	orl	%r13d, %eax
	cmpl	%r12d, %ecx
	jle	.L12
	movslq	%r12d, %r12
	cmpl	%edi, (%rbx,%r12,4)
	sete	%r12b
	movzbl	%r12b, %r12d
	orl	%r12d, %eax
.L12:
	addl	$1, %edi
	subl	$1, %esi
	testl	%eax, %eax
	jne	.L13
	movl	%r11d, %r13d
.L9:
	xorl	%eax, %eax
	leal	0(%r13,%r9), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L33
	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
	.p2align 4,,10
	.p2align 3
.L32:
	.cfi_restore_state
	testl	%eax, %eax
	jne	.L14
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L18:
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	jmp	.L10
.L17:
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	jmp	.L5
.L2:
	movl	(%rsp), %r9d
	xorl	%r13d, %r13d
	leaq	.LC1(%rip), %rbp
	jmp	.L9
.L33:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 440
a:
	.zero	440
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC2:
	.long	1
	.long	1
	.long	1
	.long	1
	.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:
```