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

```c
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h> // int64_t

#define max(a,b) ((a) > (b) ? (a) : (b))
#define min(a,b) ((a) > (b) ? (b) : (a))

int get_int(void) {
  int num;
  scanf("%d", &num);
  return num;
}

int get_int2(int *a1, int *a2) {
  scanf("%d %d", a1, a2);
  return 0;
}

int get_int3(int *a1, int *a2, int *a3) {
  scanf("%d %d %d", a1, a2, a3);
  return 0;
}

int get_int4(int *a1, int *a2, int *a3, int *a4) {
  scanf("%d %d %d %d", a1, a2, a3, a4);
  return 0;
}

int get_int5(int *a1, int *a2, int *a3, int *a4, int *a5) {
  scanf("%d %d %d %d %d", a1, a2, a3, a4, a5);
  return 0;
}

// <arr[0]> <arr[1]> .. <arr[size-1]>
int fget_array(int *arr, int size) {
    int i;
    for(i = 0; i < size; i++) {
        scanf("%d", &arr[i]);
    }
    return 0;
}

#define DIGITS_MAX 10
#define NUM_MAX 1000000

void calc_digit(int num, int *map) {
    while(num) {
        map[num%10] = 1;
        num /= 10;
    }
    return;
}

int main(void) {
    int num, k;
    get_int2(&num, &k);
    int arr[DIGITS_MAX];
    fget_array(arr, k);
    static int xs[10];
    int i, j;
    for(i = 0; i < k; i++) xs[arr[i]] = 1;
    int ans = 0;
    for(i = num; i <= NUM_MAX; i++) {
        int map[10] = {0};
        calc_digit(i, map);
        int flag = 1;
        for(j = 0; j < 10; j++) {
            if(xs[j] == 1 && map[j] == 1) flag = 0;
        }
        if(flag) {
            ans = i;
            break;
        }
    }

    printf("%d\n", ans);
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	get_int
	.type	get_int, @function
get_int:
.LFB6:
	.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	-12(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-12(%rbp), %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L3
	call	__stack_chk_fail@PLT
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	get_int, .-get_int
	.section	.rodata
.LC1:
	.string	"%d %d"
	.text
	.globl	get_int2
	.type	get_int2, @function
get_int2:
.LFB7:
	.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	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rdx
	movq	-8(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	get_int2, .-get_int2
	.section	.rodata
.LC2:
	.string	"%d %d %d"
	.text
	.globl	get_int3
	.type	get_int3, @function
get_int3:
.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	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	%rdx, -24(%rbp)
	movq	-24(%rbp), %rcx
	movq	-16(%rbp), %rdx
	movq	-8(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	get_int3, .-get_int3
	.section	.rodata
.LC3:
	.string	"%d %d %d %d"
	.text
	.globl	get_int4
	.type	get_int4, @function
get_int4:
.LFB9:
	.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	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	%rdx, -24(%rbp)
	movq	%rcx, -32(%rbp)
	movq	-32(%rbp), %rsi
	movq	-24(%rbp), %rcx
	movq	-16(%rbp), %rdx
	movq	-8(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	get_int4, .-get_int4
	.section	.rodata
.LC4:
	.string	"%d %d %d %d %d"
	.text
	.globl	get_int5
	.type	get_int5, @function
get_int5:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	%rdx, -24(%rbp)
	movq	%rcx, -32(%rbp)
	movq	%r8, -40(%rbp)
	movq	-40(%rbp), %rdi
	movq	-32(%rbp), %rsi
	movq	-24(%rbp), %rcx
	movq	-16(%rbp), %rdx
	movq	-8(%rbp), %rax
	movq	%rdi, %r9
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	get_int5, .-get_int5
	.globl	fget_array
	.type	fget_array, @function
fget_array:
.LFB11:
	.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	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L13
.L14:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -4(%rbp)
.L13:
	movl	-4(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L14
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	fget_array, .-fget_array
	.globl	calc_digit
	.type	calc_digit, @function
calc_digit:
.LFB12:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movq	%rsi, -16(%rbp)
	jmp	.L17
.L18:
	movl	-4(%rbp), %ecx
	movslq	%ecx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%ecx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	$1, (%rax)
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -4(%rbp)
.L17:
	cmpl	$0, -4(%rbp)
	jne	.L18
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	calc_digit, .-calc_digit
	.section	.rodata
.LC5:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB13:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	addq	$-128, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-116(%rbp), %rdx
	leaq	-120(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	get_int2
	movl	-116(%rbp), %edx
	leaq	-96(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	fget_array
	movl	$0, -112(%rbp)
	jmp	.L21
.L22:
	movl	-112(%rbp), %eax
	cltq
	movl	-96(%rbp,%rax,4), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	xs.0(%rip), %rax
	movl	$1, (%rdx,%rax)
	addl	$1, -112(%rbp)
.L21:
	movl	-116(%rbp), %eax
	cmpl	%eax, -112(%rbp)
	jl	.L22
	movl	$0, -104(%rbp)
	movl	-120(%rbp), %eax
	movl	%eax, -112(%rbp)
	jmp	.L23
.L29:
	movq	$0, -48(%rbp)
	movq	$0, -40(%rbp)
	movq	$0, -32(%rbp)
	movq	$0, -24(%rbp)
	movq	$0, -16(%rbp)
	leaq	-48(%rbp), %rdx
	movl	-112(%rbp), %eax
	movq	%rdx, %rsi
	movl	%eax, %edi
	call	calc_digit
	movl	$1, -100(%rbp)
	movl	$0, -108(%rbp)
	jmp	.L24
.L26:
	movl	-108(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	xs.0(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L25
	movl	-108(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	jne	.L25
	movl	$0, -100(%rbp)
.L25:
	addl	$1, -108(%rbp)
.L24:
	cmpl	$9, -108(%rbp)
	jle	.L26
	cmpl	$0, -100(%rbp)
	je	.L27
	movl	-112(%rbp), %eax
	movl	%eax, -104(%rbp)
	jmp	.L28
.L27:
	addl	$1, -112(%rbp)
.L23:
	cmpl	$1000000, -112(%rbp)
	jle	.L29
.L28:
	movl	-104(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L31
	call	__stack_chk_fail@PLT
.L31:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	main, .-main
	.local	xs.0
	.comm	xs.0,40,32
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.text
	.p2align 4
	.globl	get_int
	.type	get_int, @function
get_int:
.LFB51:
	.cfi_startproc
	endbr64
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	movq	8(%rsp), %rdx
	subq	%fs:40, %rdx
	jne	.L5
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L5:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.size	get_int, .-get_int
	.section	.rodata.str1.1
.LC1:
	.string	"%d %d"
	.text
	.p2align 4
	.globl	get_int2
	.type	get_int2, @function
get_int2:
.LFB52:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	movq	%rsi, %rdx
	xorl	%eax, %eax
	movq	%rdi, %rsi
	leaq	.LC1(%rip), %rdi
	call	__isoc99_scanf@PLT
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE52:
	.size	get_int2, .-get_int2
	.section	.rodata.str1.1
.LC2:
	.string	"%d %d %d"
	.text
	.p2align 4
	.globl	get_int3
	.type	get_int3, @function
get_int3:
.LFB53:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	movq	%rdx, %rcx
	xorl	%eax, %eax
	movq	%rsi, %rdx
	movq	%rdi, %rsi
	leaq	.LC2(%rip), %rdi
	call	__isoc99_scanf@PLT
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE53:
	.size	get_int3, .-get_int3
	.section	.rodata.str1.1
.LC3:
	.string	"%d %d %d %d"
	.text
	.p2align 4
	.globl	get_int4
	.type	get_int4, @function
get_int4:
.LFB54:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	movq	%rcx, %r8
	xorl	%eax, %eax
	movq	%rdx, %rcx
	movq	%rsi, %rdx
	movq	%rdi, %rsi
	leaq	.LC3(%rip), %rdi
	call	__isoc99_scanf@PLT
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE54:
	.size	get_int4, .-get_int4
	.section	.rodata.str1.1
.LC4:
	.string	"%d %d %d %d %d"
	.text
	.p2align 4
	.globl	get_int5
	.type	get_int5, @function
get_int5:
.LFB55:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movq	%r8, %r9
	xorl	%eax, %eax
	movq	%rcx, %r8
	movq	%rdx, %rcx
	movq	%rsi, %rdx
	movq	%rdi, %rsi
	leaq	.LC4(%rip), %rdi
	call	__isoc99_scanf@PLT
	xorl	%eax, %eax
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE55:
	.size	get_int5, .-get_int5
	.p2align 4
	.globl	fget_array
	.type	fget_array, @function
fget_array:
.LFB56:
	.cfi_startproc
	endbr64
	testl	%esi, %esi
	jle	.L19
	leal	-1(%rsi), %eax
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	4(%rdi,%rax,4), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	%rdi, %rbx
	.p2align 4,,10
	.p2align 3
.L16:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__isoc99_scanf@PLT
	cmpq	%r12, %rbx
	jne	.L16
	popq	%rbx
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L19:
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE56:
	.size	fget_array, .-fget_array
	.p2align 4
	.globl	calc_digit
	.type	calc_digit, @function
calc_digit:
.LFB57:
	.cfi_startproc
	endbr64
	jmp	.L29
	.p2align 4,,10
	.p2align 3
.L24:
	movslq	%edi, %rax
	movl	%edi, %edx
	imulq	$1717986919, %rax, %rax
	sarl	$31, %edx
	sarq	$34, %rax
	subl	%edx, %eax
	leal	(%rax,%rax,4), %edx
	addl	%edx, %edx
	subl	%edx, %edi
	movslq	%edi, %rdi
	movl	$1, (%rsi,%rdi,4)
	movl	%eax, %edi
.L29:
	testl	%edi, %edi
	jne	.L24
	ret
	.cfi_endproc
.LFE57:
	.size	calc_digit, .-calc_digit
	.section	.rodata.str1.1
.LC5:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB58:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC1(%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
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$120, %rsp
	.cfi_def_cfa_offset 176
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rdx
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L35
	subl	$1, %eax
	leaq	16(%rsp), %rbx
	leaq	.LC0(%rip), %rbp
	leaq	20(%rsp,%rax,4), %r12
	.p2align 4,,10
	.p2align 3
.L34:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__isoc99_scanf@PLT
	cmpq	%rbx, %r12
	jne	.L34
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L35
	movslq	16(%rsp), %rcx
	leaq	xs.0(%rip), %rdx
	movl	$1, (%rdx,%rcx,4)
	cmpl	$1, %eax
	je	.L35
	movslq	20(%rsp), %rcx
	movl	$1, (%rdx,%rcx,4)
	cmpl	$2, %eax
	je	.L35
	movslq	24(%rsp), %rcx
	movl	$1, (%rdx,%rcx,4)
	cmpl	$3, %eax
	je	.L35
	movslq	28(%rsp), %rcx
	movl	$1, (%rdx,%rcx,4)
	cmpl	$4, %eax
	je	.L35
	movslq	32(%rsp), %rcx
	movl	$1, (%rdx,%rcx,4)
	cmpl	$5, %eax
	je	.L35
	movslq	36(%rsp), %rcx
	movl	$1, (%rdx,%rcx,4)
	cmpl	$6, %eax
	je	.L35
	movslq	40(%rsp), %rcx
	movl	$1, (%rdx,%rcx,4)
	cmpl	$7, %eax
	je	.L35
	movslq	44(%rsp), %rcx
	movl	$1, (%rdx,%rcx,4)
	cmpl	$8, %eax
	je	.L35
	movslq	48(%rsp), %rcx
	movl	$1, (%rdx,%rcx,4)
	cmpl	$9, %eax
	je	.L35
	movslq	52(%rsp), %rax
	movl	$1, (%rdx,%rax,4)
.L35:
	movl	8(%rsp), %r8d
	cmpl	$1000000, %r8d
	jg	.L33
	movl	xs.0(%rip), %r14d
	movl	4+xs.0(%rip), %r13d
	xorl	%esi, %esi
	movl	8+xs.0(%rip), %r12d
	movl	12+xs.0(%rip), %ebp
	movl	16+xs.0(%rip), %ebx
	movl	20+xs.0(%rip), %r11d
	movl	24+xs.0(%rip), %r10d
	movl	28+xs.0(%rip), %r9d
	movl	36+xs.0(%rip), %r15d
	movl	32+xs.0(%rip), %edi
	.p2align 4,,10
	.p2align 3
.L53:
	movq	$0, 96(%rsp)
	pxor	%xmm0, %xmm0
	movl	%r8d, %edx
	movaps	%xmm0, 64(%rsp)
	movaps	%xmm0, 80(%rsp)
	testl	%r8d, %r8d
	je	.L41
	.p2align 4,,10
	.p2align 3
.L38:
	movslq	%edx, %rax
	movl	%edx, %ecx
	imulq	$1717986919, %rax, %rax
	sarl	$31, %ecx
	sarq	$34, %rax
	subl	%ecx, %eax
	leal	(%rax,%rax,4), %ecx
	addl	%ecx, %ecx
	subl	%ecx, %edx
	movslq	%edx, %rdx
	movl	$1, 64(%rsp,%rdx,4)
	movl	%eax, %edx
	testl	%eax, %eax
	jne	.L38
.L41:
	movl	$1, %eax
	cmpl	$1, %r14d
	jne	.L40
	xorl	%eax, %eax
	cmpl	$1, 64(%rsp)
	setne	%al
.L40:
	cmpl	$1, %r13d
	jne	.L42
	cmpl	$1, 68(%rsp)
	cmove	%esi, %eax
.L42:
	cmpl	$1, %r12d
	jne	.L43
	cmpl	$1, 72(%rsp)
	cmove	%esi, %eax
.L43:
	cmpl	$1, %ebp
	jne	.L44
	cmpl	$1, 76(%rsp)
	cmove	%esi, %eax
.L44:
	cmpl	$1, %ebx
	jne	.L45
	cmpl	$1, 80(%rsp)
	cmove	%esi, %eax
.L45:
	cmpl	$1, %r11d
	jne	.L46
	cmpl	$1, 84(%rsp)
	cmove	%esi, %eax
.L46:
	cmpl	$1, %r10d
	jne	.L47
	cmpl	$1, 88(%rsp)
	cmove	%esi, %eax
.L47:
	cmpl	$1, %r9d
	je	.L92
.L48:
	cmpl	$1, %edi
	je	.L49
	cmpl	$1, %r15d
	je	.L93
.L52:
	testl	%eax, %eax
	jne	.L37
.L50:
	addl	$1, %r8d
	cmpl	$1000001, %r8d
	jne	.L53
.L33:
	xorl	%r8d, %r8d
.L37:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movl	$1, %edi
	leaq	.LC5(%rip), %rsi
	call	__printf_chk@PLT
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L94
	addq	$120, %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
	.p2align 4,,10
	.p2align 3
.L92:
	.cfi_restore_state
	cmpl	$1, 92(%rsp)
	jne	.L48
	cmpl	$1, %edi
	jne	.L50
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L49:
	cmpl	$1, 96(%rsp)
	je	.L50
	cmpl	$1, %r15d
	jne	.L52
.L93:
	cmpl	$1, 100(%rsp)
	jne	.L52
	jmp	.L50
.L94:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE58:
	.size	main, .-main
	.local	xs.0
	.comm	xs.0,40,32
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.text
	.p2align 4
	.globl	get_int
	.type	get_int, @function
get_int:
.LFB51:
	.cfi_startproc
	endbr64
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	movq	8(%rsp), %rdx
	subq	%fs:40, %rdx
	jne	.L5
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L5:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.size	get_int, .-get_int
	.section	.rodata.str1.1
.LC1:
	.string	"%d %d"
	.text
	.p2align 4
	.globl	get_int2
	.type	get_int2, @function
get_int2:
.LFB52:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	movq	%rsi, %rdx
	xorl	%eax, %eax
	movq	%rdi, %rsi
	leaq	.LC1(%rip), %rdi
	call	__isoc99_scanf@PLT
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE52:
	.size	get_int2, .-get_int2
	.section	.rodata.str1.1
.LC2:
	.string	"%d %d %d"
	.text
	.p2align 4
	.globl	get_int3
	.type	get_int3, @function
get_int3:
.LFB53:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	movq	%rdx, %rcx
	xorl	%eax, %eax
	movq	%rsi, %rdx
	movq	%rdi, %rsi
	leaq	.LC2(%rip), %rdi
	call	__isoc99_scanf@PLT
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE53:
	.size	get_int3, .-get_int3
	.section	.rodata.str1.1
.LC3:
	.string	"%d %d %d %d"
	.text
	.p2align 4
	.globl	get_int4
	.type	get_int4, @function
get_int4:
.LFB54:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	movq	%rcx, %r8
	xorl	%eax, %eax
	movq	%rdx, %rcx
	movq	%rsi, %rdx
	movq	%rdi, %rsi
	leaq	.LC3(%rip), %rdi
	call	__isoc99_scanf@PLT
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE54:
	.size	get_int4, .-get_int4
	.section	.rodata.str1.1
.LC4:
	.string	"%d %d %d %d %d"
	.text
	.p2align 4
	.globl	get_int5
	.type	get_int5, @function
get_int5:
.LFB55:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movq	%r8, %r9
	xorl	%eax, %eax
	movq	%rcx, %r8
	movq	%rdx, %rcx
	movq	%rsi, %rdx
	movq	%rdi, %rsi
	leaq	.LC4(%rip), %rdi
	call	__isoc99_scanf@PLT
	xorl	%eax, %eax
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE55:
	.size	get_int5, .-get_int5
	.p2align 4
	.globl	fget_array
	.type	fget_array, @function
fget_array:
.LFB56:
	.cfi_startproc
	endbr64
	testl	%esi, %esi
	jle	.L19
	leal	-1(%rsi), %eax
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	4(%rdi,%rax,4), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	%rdi, %rbx
	.p2align 4,,10
	.p2align 3
.L16:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__isoc99_scanf@PLT
	cmpq	%r12, %rbx
	jne	.L16
	popq	%rbx
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L19:
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE56:
	.size	fget_array, .-fget_array
	.p2align 4
	.globl	calc_digit
	.type	calc_digit, @function
calc_digit:
.LFB57:
	.cfi_startproc
	endbr64
	jmp	.L29
	.p2align 4,,10
	.p2align 3
.L24:
	movslq	%edi, %rax
	movl	%edi, %edx
	imulq	$1717986919, %rax, %rax
	sarl	$31, %edx
	sarq	$34, %rax
	subl	%edx, %eax
	leal	(%rax,%rax,4), %edx
	addl	%edx, %edx
	subl	%edx, %edi
	movslq	%edi, %rdi
	movl	$1, (%rsi,%rdi,4)
	movl	%eax, %edi
.L29:
	testl	%edi, %edi
	jne	.L24
	ret
	.cfi_endproc
.LFE57:
	.size	calc_digit, .-calc_digit
	.section	.rodata.str1.1
.LC5:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB58:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC1(%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
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$120, %rsp
	.cfi_def_cfa_offset 176
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rdx
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L35
	subl	$1, %eax
	leaq	16(%rsp), %rbx
	leaq	.LC0(%rip), %rbp
	leaq	20(%rsp,%rax,4), %r12
	.p2align 4,,10
	.p2align 3
.L34:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__isoc99_scanf@PLT
	cmpq	%rbx, %r12
	jne	.L34
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L35
	movslq	16(%rsp), %rcx
	leaq	xs.0(%rip), %rdx
	movl	$1, (%rdx,%rcx,4)
	cmpl	$1, %eax
	je	.L35
	movslq	20(%rsp), %rcx
	movl	$1, (%rdx,%rcx,4)
	cmpl	$2, %eax
	je	.L35
	movslq	24(%rsp), %rcx
	movl	$1, (%rdx,%rcx,4)
	cmpl	$3, %eax
	je	.L35
	movslq	28(%rsp), %rcx
	movl	$1, (%rdx,%rcx,4)
	cmpl	$4, %eax
	je	.L35
	movslq	32(%rsp), %rcx
	movl	$1, (%rdx,%rcx,4)
	cmpl	$5, %eax
	je	.L35
	movslq	36(%rsp), %rcx
	movl	$1, (%rdx,%rcx,4)
	cmpl	$6, %eax
	je	.L35
	movslq	40(%rsp), %rcx
	movl	$1, (%rdx,%rcx,4)
	cmpl	$7, %eax
	je	.L35
	movslq	44(%rsp), %rcx
	movl	$1, (%rdx,%rcx,4)
	cmpl	$8, %eax
	je	.L35
	movslq	48(%rsp), %rcx
	movl	$1, (%rdx,%rcx,4)
	cmpl	$9, %eax
	je	.L35
	movslq	52(%rsp), %rax
	movl	$1, (%rdx,%rax,4)
.L35:
	movl	8(%rsp), %r8d
	cmpl	$1000000, %r8d
	jg	.L33
	movl	xs.0(%rip), %r14d
	movl	4+xs.0(%rip), %r13d
	xorl	%esi, %esi
	movl	8+xs.0(%rip), %r12d
	movl	12+xs.0(%rip), %ebp
	movl	16+xs.0(%rip), %ebx
	movl	20+xs.0(%rip), %r11d
	movl	24+xs.0(%rip), %r10d
	movl	28+xs.0(%rip), %r9d
	movl	36+xs.0(%rip), %r15d
	movl	32+xs.0(%rip), %edi
	.p2align 4,,10
	.p2align 3
.L53:
	movq	$0, 96(%rsp)
	pxor	%xmm0, %xmm0
	movl	%r8d, %edx
	movaps	%xmm0, 64(%rsp)
	movaps	%xmm0, 80(%rsp)
	testl	%r8d, %r8d
	je	.L41
	.p2align 4,,10
	.p2align 3
.L38:
	movslq	%edx, %rax
	movl	%edx, %ecx
	imulq	$1717986919, %rax, %rax
	sarl	$31, %ecx
	sarq	$34, %rax
	subl	%ecx, %eax
	leal	(%rax,%rax,4), %ecx
	addl	%ecx, %ecx
	subl	%ecx, %edx
	movslq	%edx, %rdx
	movl	$1, 64(%rsp,%rdx,4)
	movl	%eax, %edx
	testl	%eax, %eax
	jne	.L38
.L41:
	movl	$1, %eax
	cmpl	$1, %r14d
	jne	.L40
	xorl	%eax, %eax
	cmpl	$1, 64(%rsp)
	setne	%al
.L40:
	cmpl	$1, %r13d
	jne	.L42
	cmpl	$1, 68(%rsp)
	cmove	%esi, %eax
.L42:
	cmpl	$1, %r12d
	jne	.L43
	cmpl	$1, 72(%rsp)
	cmove	%esi, %eax
.L43:
	cmpl	$1, %ebp
	jne	.L44
	cmpl	$1, 76(%rsp)
	cmove	%esi, %eax
.L44:
	cmpl	$1, %ebx
	jne	.L45
	cmpl	$1, 80(%rsp)
	cmove	%esi, %eax
.L45:
	cmpl	$1, %r11d
	jne	.L46
	cmpl	$1, 84(%rsp)
	cmove	%esi, %eax
.L46:
	cmpl	$1, %r10d
	jne	.L47
	cmpl	$1, 88(%rsp)
	cmove	%esi, %eax
.L47:
	cmpl	$1, %r9d
	je	.L92
.L48:
	cmpl	$1, %edi
	je	.L49
	cmpl	$1, %r15d
	je	.L93
.L52:
	testl	%eax, %eax
	jne	.L37
.L50:
	addl	$1, %r8d
	cmpl	$1000001, %r8d
	jne	.L53
.L33:
	xorl	%r8d, %r8d
.L37:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movl	$1, %edi
	leaq	.LC5(%rip), %rsi
	call	__printf_chk@PLT
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L94
	addq	$120, %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
	.p2align 4,,10
	.p2align 3
.L92:
	.cfi_restore_state
	cmpl	$1, 92(%rsp)
	jne	.L48
	cmpl	$1, %edi
	jne	.L50
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L49:
	cmpl	$1, 96(%rsp)
	je	.L50
	cmpl	$1, %r15d
	jne	.L52
.L93:
	cmpl	$1, 100(%rsp)
	jne	.L52
	jmp	.L50
.L94:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE58:
	.size	main, .-main
	.local	xs.0
	.comm	xs.0,40,32
	.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:

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h> // int64_t

#define max(a,b) ((a) > (b) ? (a) : (b))
#define min(a,b) ((a) > (b) ? (b) : (a))

int get_int(void) {
  int num;
  scanf("%d", &num);
  return num;
}

int get_int2(int *a1, int *a2) {
  scanf("%d %d", a1, a2);
  return 0;
}

int get_int3(int *a1, int *a2, int *a3) {
  scanf("%d %d %d", a1, a2, a3);
  return 0;
}

int get_int4(int *a1, int *a2, int *a3, int *a4) {
  scanf("%d %d %d %d", a1, a2, a3, a4);
  return 0;
}

int get_int5(int *a1, int *a2, int *a3, int *a4, int *a5) {
  scanf("%d %d %d %d %d", a1, a2, a3, a4, a5);
  return 0;
}

// <arr[0]> <arr[1]> .. <arr[size-1]>
int fget_array(int *arr, int size) {
    int i;
    for(i = 0; i < size; i++) {
        scanf("%d", &arr[i]);
    }
    return 0;
}

#define DIGITS_MAX 10
#define NUM_MAX 1000000

void calc_digit(int num, int *map) {
    while(num) {
        map[num%10] = 1;
        num /= 10;
    }
    return;
}

int main(void) {
    int num, k;
    get_int2(&num, &k);
    int arr[DIGITS_MAX];
    fget_array(arr, k);
    static int xs[10];
    int i, j;
    for(i = 0; i < k; i++) xs[arr[i]] = 1;
    int ans = 0;
    for(i = num; i <= NUM_MAX; i++) {
        int map[10] = {0};
        calc_digit(i, map);
        int flag = 1;
        for(j = 0; j < 10; j++) {
            if(xs[j] == 1 && map[j] == 1) flag = 0;
        }
        if(flag) {
            ans = i;
            break;
        }
    }

    printf("%d\n", ans);
    return 0;
}
1000 8
1 3 4 5 6 7 8 9

2000

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

```c
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h> // int64_t

#define max(a,b) ((a) > (b) ? (a) : (b))
#define min(a,b) ((a) > (b) ? (b) : (a))

int get_int(void) {
  int num;
  scanf("%d", &num);
  return num;
}

int get_int2(int *a1, int *a2) {
  scanf("%d %d", a1, a2);
  return 0;
}

int get_int3(int *a1, int *a2, int *a3) {
  scanf("%d %d %d", a1, a2, a3);
  return 0;
}

int get_int4(int *a1, int *a2, int *a3, int *a4) {
  scanf("%d %d %d %d", a1, a2, a3, a4);
  return 0;
}

int get_int5(int *a1, int *a2, int *a3, int *a4, int *a5) {
  scanf("%d %d %d %d %d", a1, a2, a3, a4, a5);
  return 0;
}

// <arr[0]> <arr[1]> .. <arr[size-1]>
int fget_array(int *arr, int size) {
    int i;
    for(i = 0; i < size; i++) {
        scanf("%d", &arr[i]);
    }
    return 0;
}

#define DIGITS_MAX 10
#define NUM_MAX 1000000

void calc_digit(int num, int *map) {
    while(num) {
        map[num%10] = 1;
        num /= 10;
    }
    return;
}

int main(void) {
    int num, k;
    get_int2(&num, &k);
    int arr[DIGITS_MAX];
    fget_array(arr, k);
    static int xs[10];
    int i, j;
    for(i = 0; i < k; i++) xs[arr[i]] = 1;
    int ans = 0;
    for(i = num; i <= NUM_MAX; i++) {
        int map[10] = {0};
        calc_digit(i, map);
        int flag = 1;
        for(j = 0; j < 10; j++) {
            if(xs[j] == 1 && map[j] == 1) flag = 0;
        }
        if(flag) {
            ans = i;
            break;
        }
    }

    printf("%d\n", ans);
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	get_int
	.type	get_int, @function
get_int:
.LFB6:
	.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	-12(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-12(%rbp), %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L3
	call	__stack_chk_fail@PLT
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	get_int, .-get_int
	.section	.rodata
.LC1:
	.string	"%d %d"
	.text
	.globl	get_int2
	.type	get_int2, @function
get_int2:
.LFB7:
	.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	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rdx
	movq	-8(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	get_int2, .-get_int2
	.section	.rodata
.LC2:
	.string	"%d %d %d"
	.text
	.globl	get_int3
	.type	get_int3, @function
get_int3:
.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	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	%rdx, -24(%rbp)
	movq	-24(%rbp), %rcx
	movq	-16(%rbp), %rdx
	movq	-8(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	get_int3, .-get_int3
	.section	.rodata
.LC3:
	.string	"%d %d %d %d"
	.text
	.globl	get_int4
	.type	get_int4, @function
get_int4:
.LFB9:
	.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	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	%rdx, -24(%rbp)
	movq	%rcx, -32(%rbp)
	movq	-32(%rbp), %rsi
	movq	-24(%rbp), %rcx
	movq	-16(%rbp), %rdx
	movq	-8(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	get_int4, .-get_int4
	.section	.rodata
.LC4:
	.string	"%d %d %d %d %d"
	.text
	.globl	get_int5
	.type	get_int5, @function
get_int5:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	%rdx, -24(%rbp)
	movq	%rcx, -32(%rbp)
	movq	%r8, -40(%rbp)
	movq	-40(%rbp), %rdi
	movq	-32(%rbp), %rsi
	movq	-24(%rbp), %rcx
	movq	-16(%rbp), %rdx
	movq	-8(%rbp), %rax
	movq	%rdi, %r9
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	get_int5, .-get_int5
	.globl	fget_array
	.type	fget_array, @function
fget_array:
.LFB11:
	.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	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L13
.L14:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -4(%rbp)
.L13:
	movl	-4(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L14
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	fget_array, .-fget_array
	.globl	calc_digit
	.type	calc_digit, @function
calc_digit:
.LFB12:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movq	%rsi, -16(%rbp)
	jmp	.L17
.L18:
	movl	-4(%rbp), %ecx
	movslq	%ecx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%ecx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	$1, (%rax)
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -4(%rbp)
.L17:
	cmpl	$0, -4(%rbp)
	jne	.L18
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	calc_digit, .-calc_digit
	.section	.rodata
.LC5:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB13:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	addq	$-128, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-116(%rbp), %rdx
	leaq	-120(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	get_int2
	movl	-116(%rbp), %edx
	leaq	-96(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	fget_array
	movl	$0, -112(%rbp)
	jmp	.L21
.L22:
	movl	-112(%rbp), %eax
	cltq
	movl	-96(%rbp,%rax,4), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	xs.0(%rip), %rax
	movl	$1, (%rdx,%rax)
	addl	$1, -112(%rbp)
.L21:
	movl	-116(%rbp), %eax
	cmpl	%eax, -112(%rbp)
	jl	.L22
	movl	$0, -104(%rbp)
	movl	-120(%rbp), %eax
	movl	%eax, -112(%rbp)
	jmp	.L23
.L29:
	movq	$0, -48(%rbp)
	movq	$0, -40(%rbp)
	movq	$0, -32(%rbp)
	movq	$0, -24(%rbp)
	movq	$0, -16(%rbp)
	leaq	-48(%rbp), %rdx
	movl	-112(%rbp), %eax
	movq	%rdx, %rsi
	movl	%eax, %edi
	call	calc_digit
	movl	$1, -100(%rbp)
	movl	$0, -108(%rbp)
	jmp	.L24
.L26:
	movl	-108(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	xs.0(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L25
	movl	-108(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	jne	.L25
	movl	$0, -100(%rbp)
.L25:
	addl	$1, -108(%rbp)
.L24:
	cmpl	$9, -108(%rbp)
	jle	.L26
	cmpl	$0, -100(%rbp)
	je	.L27
	movl	-112(%rbp), %eax
	movl	%eax, -104(%rbp)
	jmp	.L28
.L27:
	addl	$1, -112(%rbp)
.L23:
	cmpl	$1000000, -112(%rbp)
	jle	.L29
.L28:
	movl	-104(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L31
	call	__stack_chk_fail@PLT
.L31:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	main, .-main
	.local	xs.0
	.comm	xs.0,40,32
	.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
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	get_int
	.type	get_int, @function
get_int:
.LFB6:
	.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	-12(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-12(%rbp), %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L3
	call	__stack_chk_fail@PLT
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	get_int, .-get_int
	.section	.rodata
.LC1:
	.string	"%d %d"
	.text
	.globl	get_int2
	.type	get_int2, @function
get_int2:
.LFB7:
	.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	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rdx
	movq	-8(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	get_int2, .-get_int2
	.section	.rodata
.LC2:
	.string	"%d %d %d"
	.text
	.globl	get_int3
	.type	get_int3, @function
get_int3:
.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	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	%rdx, -24(%rbp)
	movq	-24(%rbp), %rcx
	movq	-16(%rbp), %rdx
	movq	-8(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	get_int3, .-get_int3
	.section	.rodata
.LC3:
	.string	"%d %d %d %d"
	.text
	.globl	get_int4
	.type	get_int4, @function
get_int4:
.LFB9:
	.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	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	%rdx, -24(%rbp)
	movq	%rcx, -32(%rbp)
	movq	-32(%rbp), %rsi
	movq	-24(%rbp), %rcx
	movq	-16(%rbp), %rdx
	movq	-8(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	get_int4, .-get_int4
	.section	.rodata
.LC4:
	.string	"%d %d %d %d %d"
	.text
	.globl	get_int5
	.type	get_int5, @function
get_int5:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	%rdx, -24(%rbp)
	movq	%rcx, -32(%rbp)
	movq	%r8, -40(%rbp)
	movq	-40(%rbp), %rdi
	movq	-32(%rbp), %rsi
	movq	-24(%rbp), %rcx
	movq	-16(%rbp), %rdx
	movq	-8(%rbp), %rax
	movq	%rdi, %r9
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	get_int5, .-get_int5
	.globl	fget_array
	.type	fget_array, @function
fget_array:
.LFB11:
	.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	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L13
.L14:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -4(%rbp)
.L13:
	movl	-4(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L14
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	fget_array, .-fget_array
	.globl	calc_digit
	.type	calc_digit, @function
calc_digit:
.LFB12:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movq	%rsi, -16(%rbp)
	jmp	.L17
.L18:
	movl	-4(%rbp), %ecx
	movslq	%ecx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%ecx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	$1, (%rax)
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -4(%rbp)
.L17:
	cmpl	$0, -4(%rbp)
	jne	.L18
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	calc_digit, .-calc_digit
	.section	.rodata
.LC5:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB13:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	addq	$-128, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-116(%rbp), %rdx
	leaq	-120(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	get_int2
	movl	-116(%rbp), %edx
	leaq	-96(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	fget_array
	movl	$0, -112(%rbp)
	jmp	.L21
.L22:
	movl	-112(%rbp), %eax
	cltq
	movl	-96(%rbp,%rax,4), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	xs.0(%rip), %rax
	movl	$1, (%rdx,%rax)
	addl	$1, -112(%rbp)
.L21:
	movl	-116(%rbp), %eax
	cmpl	%eax, -112(%rbp)
	jl	.L22
	movl	$0, -104(%rbp)
	movl	-120(%rbp), %eax
	movl	%eax, -112(%rbp)
	jmp	.L23
.L29:
	movq	$0, -48(%rbp)
	movq	$0, -40(%rbp)
	movq	$0, -32(%rbp)
	movq	$0, -24(%rbp)
	movq	$0, -16(%rbp)
	leaq	-48(%rbp), %rdx
	movl	-112(%rbp), %eax
	movq	%rdx, %rsi
	movl	%eax, %edi
	call	calc_digit
	movl	$1, -100(%rbp)
	movl	$0, -108(%rbp)
	jmp	.L24
.L26:
	movl	-108(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	xs.0(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L25
	movl	-108(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	jne	.L25
	movl	$0, -100(%rbp)
.L25:
	addl	$1, -108(%rbp)
.L24:
	cmpl	$9, -108(%rbp)
	jle	.L26
	cmpl	$0, -100(%rbp)
	je	.L27
	movl	-112(%rbp), %eax
	movl	%eax, -104(%rbp)
	jmp	.L28
.L27:
	addl	$1, -112(%rbp)
.L23:
	cmpl	$1000000, -112(%rbp)
	jle	.L29
.L28:
	movl	-104(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L31
	call	__stack_chk_fail@PLT
.L31:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	main, .-main
	.local	xs.0
	.comm	xs.0,40,32
	.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:
