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>
int contain(int *a, int n, int x)
{
    int i;
    for(i=0;i<n;++i) if (a[i]==x) return i;
    return -1;
}
int main(void)
{
    int a[30], L, k=0, i;
    while (scanf("%d%d", a, &L), L) {
        for(k=0;k<30;++k) {
            int c[10]={0}, t=a[k], min, max, j;
            for(i=0;i<L;++i) { ++c[t%10]; t/=10; }
            for(max=0,i=9;i>=0;--i) for(j=0;j<c[i];++j) max=max*10+i;
            for(min=0,i=0;i<=9;++i) for(j=0;j<c[i];++j) min=min*10+i;
            a[k+1]=max-min;
            if ((j=contain(a, k+1, a[k+1]))>=0) {
                printf("%d %d %d\n", j, a[j], k+1-j);
                break;
            }
        }
    }
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	contain
	.type	contain, @function
contain:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L2
.L5:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -32(%rbp)
	jne	.L3
	movl	-4(%rbp), %eax
	jmp	.L4
.L3:
	addl	$1, -4(%rbp)
.L2:
	movl	-4(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L5
	movl	$-1, %eax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	contain, .-contain
	.section	.rodata
.LC0:
	.string	"%d %d %d\n"
.LC1:
	.string	"%d%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$208, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -200(%rbp)
	jmp	.L7
.L21:
	movl	$0, -200(%rbp)
	jmp	.L8
.L20:
	movq	$0, -176(%rbp)
	movq	$0, -168(%rbp)
	movq	$0, -160(%rbp)
	movq	$0, -152(%rbp)
	movq	$0, -144(%rbp)
	movl	-200(%rbp), %eax
	cltq
	movl	-128(%rbp,%rax,4), %eax
	movl	%eax, -192(%rbp)
	movl	$0, -196(%rbp)
	jmp	.L9
.L10:
	movl	-192(%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
	movl	-176(%rbp,%rax,4), %eax
	leal	1(%rax), %ecx
	movslq	%edx, %rax
	movl	%ecx, -176(%rbp,%rax,4)
	movl	-192(%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, -192(%rbp)
	addl	$1, -196(%rbp)
.L9:
	movl	-204(%rbp), %eax
	cmpl	%eax, -196(%rbp)
	jl	.L10
	movl	$0, -184(%rbp)
	movl	$9, -196(%rbp)
	jmp	.L11
.L14:
	movl	$0, -180(%rbp)
	jmp	.L12
.L13:
	movl	-184(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movl	-196(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -184(%rbp)
	addl	$1, -180(%rbp)
.L12:
	movl	-196(%rbp), %eax
	cltq
	movl	-176(%rbp,%rax,4), %eax
	cmpl	%eax, -180(%rbp)
	jl	.L13
	subl	$1, -196(%rbp)
.L11:
	cmpl	$0, -196(%rbp)
	jns	.L14
	movl	$0, -188(%rbp)
	movl	$0, -196(%rbp)
	jmp	.L15
.L18:
	movl	$0, -180(%rbp)
	jmp	.L16
.L17:
	movl	-188(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movl	-196(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -188(%rbp)
	addl	$1, -180(%rbp)
.L16:
	movl	-196(%rbp), %eax
	cltq
	movl	-176(%rbp,%rax,4), %eax
	cmpl	%eax, -180(%rbp)
	jl	.L17
	addl	$1, -196(%rbp)
.L15:
	cmpl	$9, -196(%rbp)
	jle	.L18
	movl	-200(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-184(%rbp), %eax
	subl	-188(%rbp), %eax
	movl	%eax, %edx
	movslq	%ecx, %rax
	movl	%edx, -128(%rbp,%rax,4)
	movl	-200(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-128(%rbp,%rax,4), %edx
	movl	-200(%rbp), %eax
	leal	1(%rax), %ecx
	leaq	-128(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	contain
	movl	%eax, -180(%rbp)
	cmpl	$0, -180(%rbp)
	js	.L19
	movl	-200(%rbp), %eax
	addl	$1, %eax
	subl	-180(%rbp), %eax
	movl	%eax, %ecx
	movl	-180(%rbp), %eax
	cltq
	movl	-128(%rbp,%rax,4), %edx
	movl	-180(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L7
.L19:
	addl	$1, -200(%rbp)
.L8:
	cmpl	$29, -200(%rbp)
	jle	.L20
.L7:
	leaq	-204(%rbp), %rdx
	leaq	-128(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-204(%rbp), %eax
	testl	%eax, %eax
	jne	.L21
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.p2align 4
	.globl	contain
	.type	contain, @function
contain:
.LFB23:
	.cfi_startproc
	endbr64
	testl	%esi, %esi
	jle	.L4
	movslq	%esi, %rsi
	xorl	%eax, %eax
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L7:
	addq	$1, %rax
	cmpq	%rsi, %rax
	je	.L4
.L3:
	movl	%eax, %r8d
	cmpl	%edx, (%rdi,%rax,4)
	jne	.L7
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	movl	$-1, %r8d
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	contain, .-contain
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d %d %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	.LC1(%rip), %rbx
	subq	$200, %rsp
	.cfi_def_cfa_offset 240
	movq	%fs:40, %rax
	movq	%rax, 184(%rsp)
	xorl	%eax, %eax
	leaq	64(%rsp), %r13
	leaq	12(%rsp), %r12
.L9:
	movq	%r12, %rdx
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r9d
	testl	%r9d, %r9d
	je	.L39
	movl	$1, %edi
	leaq	16(%rsp), %rsi
	.p2align 4,,10
	.p2align 3
.L22:
	pxor	%xmm0, %xmm0
	movl	-4(%r13,%rdi,4), %edx
	xorl	%r8d, %r8d
	movq	$0, 48(%rsp)
	movaps	%xmm0, 16(%rsp)
	movaps	%xmm0, 32(%rsp)
	testl	%r9d, %r9d
	jle	.L11
	.p2align 4,,10
	.p2align 3
.L10:
	movslq	%edx, %rax
	movl	%edx, %ecx
	addl	$1, %r8d
	imulq	$1717986919, %rax, %rax
	sarl	$31, %ecx
	sarq	$34, %rax
	subl	%ecx, %eax
	leal	(%rax,%rax,4), %r10d
	movl	%eax, %ecx
	movl	%edx, %eax
	addl	%r10d, %r10d
	movl	%ecx, %edx
	subl	%r10d, %eax
	cltq
	addl	$1, 16(%rsp,%rax,4)
	cmpl	%r8d, %r9d
	jne	.L10
.L11:
	movl	$9, %r10d
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L13:
	movl	(%rsi,%r10,4), %ecx
	movl	%r10d, %r8d
	xorl	%edx, %edx
	testl	%ecx, %ecx
	jle	.L15
	.p2align 4,,10
	.p2align 3
.L12:
	leal	(%rax,%rax,4), %eax
	addl	$1, %edx
	leal	(%r8,%rax,2), %eax
	cmpl	%edx, %ecx
	jne	.L12
.L15:
	subq	$1, %r10
	jnb	.L13
	xorl	%r11d, %r11d
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L14:
	movl	(%rsi,%r11,4), %r8d
	movl	%r11d, %r10d
	xorl	%edx, %edx
	testl	%r8d, %r8d
	jle	.L18
	.p2align 4,,10
	.p2align 3
.L16:
	leal	(%rcx,%rcx,4), %ecx
	addl	$1, %edx
	leal	(%r10,%rcx,2), %ecx
	cmpl	%edx, %r8d
	jne	.L16
.L18:
	addq	$1, %r11
	cmpq	$10, %r11
	jne	.L14
	subl	%ecx, %eax
	movl	%edi, %r8d
	xorl	%edx, %edx
	movl	%eax, 0(%r13,%rdi,4)
	.p2align 4,,10
	.p2align 3
.L20:
	cmpl	0(%r13,%rdx,4), %eax
	je	.L19
	addq	$1, %rdx
	cmpq	%rdx, %rdi
	jne	.L20
	addq	$1, %rdi
	jmp	.L22
.L19:
	movslq	%edx, %rax
	subl	%edx, %r8d
	movq	%rbx, %rsi
	movl	$1, %edi
	movl	64(%rsp,%rax,4), %ecx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L9
.L39:
	movq	184(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L40
	addq	$200, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L40:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.p2align 4
	.globl	contain
	.type	contain, @function
contain:
.LFB23:
	.cfi_startproc
	endbr64
	testl	%esi, %esi
	jle	.L4
	movslq	%esi, %rsi
	xorl	%eax, %eax
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L7:
	addq	$1, %rax
	cmpq	%rsi, %rax
	je	.L4
.L3:
	movl	%eax, %r8d
	cmpl	%edx, (%rdi,%rax,4)
	jne	.L7
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	movl	$-1, %r8d
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	contain, .-contain
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d %d %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	.LC1(%rip), %rbx
	subq	$200, %rsp
	.cfi_def_cfa_offset 240
	movq	%fs:40, %rax
	movq	%rax, 184(%rsp)
	xorl	%eax, %eax
	leaq	64(%rsp), %r13
	leaq	12(%rsp), %r12
.L9:
	movq	%r12, %rdx
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r9d
	testl	%r9d, %r9d
	je	.L39
	movl	$1, %edi
	leaq	16(%rsp), %rsi
	.p2align 4,,10
	.p2align 3
.L22:
	pxor	%xmm0, %xmm0
	movl	-4(%r13,%rdi,4), %edx
	xorl	%r8d, %r8d
	movq	$0, 48(%rsp)
	movaps	%xmm0, 16(%rsp)
	movaps	%xmm0, 32(%rsp)
	testl	%r9d, %r9d
	jle	.L11
	.p2align 4,,10
	.p2align 3
.L10:
	movslq	%edx, %rax
	movl	%edx, %ecx
	addl	$1, %r8d
	imulq	$1717986919, %rax, %rax
	sarl	$31, %ecx
	sarq	$34, %rax
	subl	%ecx, %eax
	leal	(%rax,%rax,4), %r10d
	movl	%eax, %ecx
	movl	%edx, %eax
	addl	%r10d, %r10d
	movl	%ecx, %edx
	subl	%r10d, %eax
	cltq
	addl	$1, 16(%rsp,%rax,4)
	cmpl	%r8d, %r9d
	jne	.L10
.L11:
	movl	$9, %r10d
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L13:
	movl	(%rsi,%r10,4), %ecx
	movl	%r10d, %r8d
	xorl	%edx, %edx
	testl	%ecx, %ecx
	jle	.L15
	.p2align 4,,10
	.p2align 3
.L12:
	leal	(%rax,%rax,4), %eax
	addl	$1, %edx
	leal	(%r8,%rax,2), %eax
	cmpl	%edx, %ecx
	jne	.L12
.L15:
	subq	$1, %r10
	jnb	.L13
	xorl	%r11d, %r11d
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L14:
	movl	(%rsi,%r11,4), %r8d
	movl	%r11d, %r10d
	xorl	%edx, %edx
	testl	%r8d, %r8d
	jle	.L18
	.p2align 4,,10
	.p2align 3
.L16:
	leal	(%rcx,%rcx,4), %ecx
	addl	$1, %edx
	leal	(%r10,%rcx,2), %ecx
	cmpl	%edx, %r8d
	jne	.L16
.L18:
	addq	$1, %r11
	cmpq	$10, %r11
	jne	.L14
	subl	%ecx, %eax
	movl	%edi, %r8d
	xorl	%edx, %edx
	movl	%eax, 0(%r13,%rdi,4)
	.p2align 4,,10
	.p2align 3
.L20:
	cmpl	0(%r13,%rdx,4), %eax
	je	.L19
	addq	$1, %rdx
	cmpq	%rdx, %rdi
	jne	.L20
	addq	$1, %rdi
	jmp	.L22
.L19:
	movslq	%edx, %rax
	subl	%edx, %r8d
	movq	%rbx, %rsi
	movl	$1, %edi
	movl	64(%rsp,%rax,4), %ecx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L9
.L39:
	movq	184(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L40
	addq	$200, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L40:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include <stdio.h>
int contain(int *a, int n, int x)
{
    int i;
    for(i=0;i<n;++i) if (a[i]==x) return i;
    return -1;
}
int main(void)
{
    int a[30], L, k=0, i;
    while (scanf("%d%d", a, &L), L) {
        for(k=0;k<30;++k) {
            int c[10]={0}, t=a[k], min, max, j;
            for(i=0;i<L;++i) { ++c[t%10]; t/=10; }
            for(max=0,i=9;i>=0;--i) for(j=0;j<c[i];++j) max=max*10+i;
            for(min=0,i=0;i<=9;++i) for(j=0;j<c[i];++j) min=min*10+i;
            a[k+1]=max-min;
            if ((j=contain(a, k+1, a[k+1]))>=0) {
                printf("%d %d %d\n", j, a[j], k+1-j);
                break;
            }
        }
    }
    return 0;
}
2012 4
83268 3
1112 4
0 1
99 2
0 0
 2012 4
83268 6
1112 4
0 1
99 1
0 0
 2012 4
83268 3
1112 4
0 1
17 2
0 0
 2012 4
83268 6
1112 3
0 1
99 1
0 0
 2012 4
83268 6
1112 4
0 0
99 1
0 0
 2012 4
83268 3
1112 6
0 1
17 2
0 0
 2012 4
83268 3
1112 3
0 1
99 1
0 0
 338 4
83268 3
1112 6
0 1
17 2
0 0
 3214 4
83268 6
1112 4
1 0
99 1
0 0
 338 4
83268 5
125 6
0 1
17 2
0 0

3 6174 1
2 495 1
5 6174 1
0 0 1
1 0 1
 3 6174 1
1 862632 7
5 6174 1
0 0 1
1 0 1
 3 6174 1
2 495 1
5 6174 1
0 0 1
2 9 5
 3 6174 1
1 862632 7
6 495 1
0 0 1
1 0 1
 3 6174 1
1 862632 7
5 6174 1
 3 6174 1
2 495 1
9 851742 7
0 0 1
2 9 5
 3 6174 1
2 495 1
6 495 1
0 0 1
1 0 1
 6 6174 1
2 495 1
9 851742 7
0 0 1
2 9 5
 3 6174 1
1 862632 7
5 6174 1
 6 6174 1
5 74943 4
4 420876 7
0 0 1
2 9 5

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>
int contain(int *a, int n, int x)
{
    int i;
    for(i=0;i<n;++i) if (a[i]==x) return i;
    return -1;
}
int main(void)
{
    int a[30], L, k=0, i;
    while (scanf("%d%d", a, &L), L) {
        for(k=0;k<30;++k) {
            int c[10]={0}, t=a[k], min, max, j;
            for(i=0;i<L;++i) { ++c[t%10]; t/=10; }
            for(max=0,i=9;i>=0;--i) for(j=0;j<c[i];++j) max=max*10+i;
            for(min=0,i=0;i<=9;++i) for(j=0;j<c[i];++j) min=min*10+i;
            a[k+1]=max-min;
            if ((j=contain(a, k+1, a[k+1]))>=0) {
                printf("%d %d %d\n", j, a[j], k+1-j);
                break;
            }
        }
    }
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	contain
	.type	contain, @function
contain:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L2
.L5:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -32(%rbp)
	jne	.L3
	movl	-4(%rbp), %eax
	jmp	.L4
.L3:
	addl	$1, -4(%rbp)
.L2:
	movl	-4(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L5
	movl	$-1, %eax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	contain, .-contain
	.section	.rodata
.LC0:
	.string	"%d %d %d\n"
.LC1:
	.string	"%d%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$208, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -200(%rbp)
	jmp	.L7
.L21:
	movl	$0, -200(%rbp)
	jmp	.L8
.L20:
	movq	$0, -176(%rbp)
	movq	$0, -168(%rbp)
	movq	$0, -160(%rbp)
	movq	$0, -152(%rbp)
	movq	$0, -144(%rbp)
	movl	-200(%rbp), %eax
	cltq
	movl	-128(%rbp,%rax,4), %eax
	movl	%eax, -192(%rbp)
	movl	$0, -196(%rbp)
	jmp	.L9
.L10:
	movl	-192(%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
	movl	-176(%rbp,%rax,4), %eax
	leal	1(%rax), %ecx
	movslq	%edx, %rax
	movl	%ecx, -176(%rbp,%rax,4)
	movl	-192(%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, -192(%rbp)
	addl	$1, -196(%rbp)
.L9:
	movl	-204(%rbp), %eax
	cmpl	%eax, -196(%rbp)
	jl	.L10
	movl	$0, -184(%rbp)
	movl	$9, -196(%rbp)
	jmp	.L11
.L14:
	movl	$0, -180(%rbp)
	jmp	.L12
.L13:
	movl	-184(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movl	-196(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -184(%rbp)
	addl	$1, -180(%rbp)
.L12:
	movl	-196(%rbp), %eax
	cltq
	movl	-176(%rbp,%rax,4), %eax
	cmpl	%eax, -180(%rbp)
	jl	.L13
	subl	$1, -196(%rbp)
.L11:
	cmpl	$0, -196(%rbp)
	jns	.L14
	movl	$0, -188(%rbp)
	movl	$0, -196(%rbp)
	jmp	.L15
.L18:
	movl	$0, -180(%rbp)
	jmp	.L16
.L17:
	movl	-188(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movl	-196(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -188(%rbp)
	addl	$1, -180(%rbp)
.L16:
	movl	-196(%rbp), %eax
	cltq
	movl	-176(%rbp,%rax,4), %eax
	cmpl	%eax, -180(%rbp)
	jl	.L17
	addl	$1, -196(%rbp)
.L15:
	cmpl	$9, -196(%rbp)
	jle	.L18
	movl	-200(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-184(%rbp), %eax
	subl	-188(%rbp), %eax
	movl	%eax, %edx
	movslq	%ecx, %rax
	movl	%edx, -128(%rbp,%rax,4)
	movl	-200(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-128(%rbp,%rax,4), %edx
	movl	-200(%rbp), %eax
	leal	1(%rax), %ecx
	leaq	-128(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	contain
	movl	%eax, -180(%rbp)
	cmpl	$0, -180(%rbp)
	js	.L19
	movl	-200(%rbp), %eax
	addl	$1, %eax
	subl	-180(%rbp), %eax
	movl	%eax, %ecx
	movl	-180(%rbp), %eax
	cltq
	movl	-128(%rbp,%rax,4), %edx
	movl	-180(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L7
.L19:
	addl	$1, -200(%rbp)
.L8:
	cmpl	$29, -200(%rbp)
	jle	.L20
.L7:
	leaq	-204(%rbp), %rdx
	leaq	-128(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-204(%rbp), %eax
	testl	%eax, %eax
	jne	.L21
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.globl	contain
	.type	contain, @function
contain:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L2
.L5:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -32(%rbp)
	jne	.L3
	movl	-4(%rbp), %eax
	jmp	.L4
.L3:
	addl	$1, -4(%rbp)
.L2:
	movl	-4(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L5
	movl	$-1, %eax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	contain, .-contain
	.section	.rodata
.LC0:
	.string	"%d %d %d\n"
.LC1:
	.string	"%d%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$208, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -200(%rbp)
	jmp	.L7
.L21:
	movl	$0, -200(%rbp)
	jmp	.L8
.L20:
	movq	$0, -176(%rbp)
	movq	$0, -168(%rbp)
	movq	$0, -160(%rbp)
	movq	$0, -152(%rbp)
	movq	$0, -144(%rbp)
	movl	-200(%rbp), %eax
	cltq
	movl	-128(%rbp,%rax,4), %eax
	movl	%eax, -192(%rbp)
	movl	$0, -196(%rbp)
	jmp	.L9
.L10:
	movl	-192(%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
	movl	-176(%rbp,%rax,4), %eax
	leal	1(%rax), %ecx
	movslq	%edx, %rax
	movl	%ecx, -176(%rbp,%rax,4)
	movl	-192(%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, -192(%rbp)
	addl	$1, -196(%rbp)
.L9:
	movl	-204(%rbp), %eax
	cmpl	%eax, -196(%rbp)
	jl	.L10
	movl	$0, -184(%rbp)
	movl	$9, -196(%rbp)
	jmp	.L11
.L14:
	movl	$0, -180(%rbp)
	jmp	.L12
.L13:
	movl	-184(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movl	-196(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -184(%rbp)
	addl	$1, -180(%rbp)
.L12:
	movl	-196(%rbp), %eax
	cltq
	movl	-176(%rbp,%rax,4), %eax
	cmpl	%eax, -180(%rbp)
	jl	.L13
	subl	$1, -196(%rbp)
.L11:
	cmpl	$0, -196(%rbp)
	jns	.L14
	movl	$0, -188(%rbp)
	movl	$0, -196(%rbp)
	jmp	.L15
.L18:
	movl	$0, -180(%rbp)
	jmp	.L16
.L17:
	movl	-188(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movl	-196(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -188(%rbp)
	addl	$1, -180(%rbp)
.L16:
	movl	-196(%rbp), %eax
	cltq
	movl	-176(%rbp,%rax,4), %eax
	cmpl	%eax, -180(%rbp)
	jl	.L17
	addl	$1, -196(%rbp)
.L15:
	cmpl	$9, -196(%rbp)
	jle	.L18
	movl	-200(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-184(%rbp), %eax
	subl	-188(%rbp), %eax
	movl	%eax, %edx
	movslq	%ecx, %rax
	movl	%edx, -128(%rbp,%rax,4)
	movl	-200(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-128(%rbp,%rax,4), %edx
	movl	-200(%rbp), %eax
	leal	1(%rax), %ecx
	leaq	-128(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	contain
	movl	%eax, -180(%rbp)
	cmpl	$0, -180(%rbp)
	js	.L19
	movl	-200(%rbp), %eax
	addl	$1, %eax
	subl	-180(%rbp), %eax
	movl	%eax, %ecx
	movl	-180(%rbp), %eax
	cltq
	movl	-128(%rbp,%rax,4), %edx
	movl	-180(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L7
.L19:
	addl	$1, -200(%rbp)
.L8:
	cmpl	$29, -200(%rbp)
	jle	.L20
.L7:
	leaq	-204(%rbp), %rdx
	leaq	-128(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-204(%rbp), %eax
	testl	%eax, %eax
	jne	.L21
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
