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<math.h>

int main(void){
	int l,i,j,a[6],count;
	long n,tmp,max,min,b[20],f=0;
	
	scanf("%ld %d",&n,&l);
	
	while(1){
		
		if(n==0 && l==0)break;
		
		max=0;
		min=0;
		tmp=0;
		count=0;
		f=0;
		for(i=0;i<20;i++){
			b[i]=0;
		}
		
		for(i=0;i<l;i++){
			a[i]=0;
		}
		
		
		while(f!=1){
			
			max=0;
			min=0;
			
			//if(f==1)break;
			
			if(count==0){
				b[count]=n;
			}else{
			
			for(i=0;i<count;i++){
				if(n==b[i] || i>=19){
					
					printf("%d %ld %d\n",i,b[i],count-i);
					
					f=1;
					break;
				}
				
			}
			}
		
		for(i=0;i<l;i++){
			a[i]=n%10;
			n=n/10;
			//if(max<a[i]) max=a[i];
			//if(min>a[i]) min=a[i];
			
			//fprintf(fout,"%d\n",a[i]);
		}
		
		for(i=0;i<l-1;i++){
			for(j=i+1;j<l;j++){
				if(a[i]<a[j]){
					tmp=a[i];
					a[i]=a[j];
					a[j]=tmp;
				}
			}
		}
		
		for(i=0;i<l;i++){
			max+=a[i]*pow(10,(l-i-1));
			min+=a[i]*pow(10,i);
		}
		
		count++;
		
		n=max-min;
		
		b[count]=n;
		
		//fprintf(fout,"max=%ld, min=%ld\n",max,min);
		
		}
		
		scanf("%ld %d",&n,&l);
	}

	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%ld %d"
.LC1:
	.string	"%d %ld %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$288, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -224(%rbp)
	leaq	-264(%rbp), %rdx
	leaq	-248(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
.L25:
	movq	-248(%rbp), %rax
	testq	%rax, %rax
	jne	.L2
	movl	-264(%rbp), %eax
	testl	%eax, %eax
	je	.L29
.L2:
	movq	$0, -240(%rbp)
	movq	$0, -232(%rbp)
	movq	$0, -216(%rbp)
	movl	$0, -252(%rbp)
	movq	$0, -224(%rbp)
	movl	$0, -260(%rbp)
	jmp	.L4
.L5:
	movl	-260(%rbp), %eax
	cltq
	movq	$0, -176(%rbp,%rax,8)
	addl	$1, -260(%rbp)
.L4:
	cmpl	$19, -260(%rbp)
	jle	.L5
	movl	$0, -260(%rbp)
	jmp	.L6
.L7:
	movl	-260(%rbp), %eax
	cltq
	movl	$0, -208(%rbp,%rax,4)
	addl	$1, -260(%rbp)
.L6:
	movl	-264(%rbp), %eax
	cmpl	%eax, -260(%rbp)
	jl	.L7
	jmp	.L8
.L24:
	movq	$0, -240(%rbp)
	movq	$0, -232(%rbp)
	cmpl	$0, -252(%rbp)
	jne	.L9
	movq	-248(%rbp), %rdx
	movl	-252(%rbp), %eax
	cltq
	movq	%rdx, -176(%rbp,%rax,8)
	jmp	.L10
.L9:
	movl	$0, -260(%rbp)
	jmp	.L11
.L14:
	movl	-260(%rbp), %eax
	cltq
	movq	-176(%rbp,%rax,8), %rdx
	movq	-248(%rbp), %rax
	cmpq	%rax, %rdx
	je	.L12
	cmpl	$18, -260(%rbp)
	jle	.L13
.L12:
	movl	-252(%rbp), %eax
	subl	-260(%rbp), %eax
	movl	%eax, %ecx
	movl	-260(%rbp), %eax
	cltq
	movq	-176(%rbp,%rax,8), %rdx
	movl	-260(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	$1, -224(%rbp)
	jmp	.L10
.L13:
	addl	$1, -260(%rbp)
.L11:
	movl	-260(%rbp), %eax
	cmpl	-252(%rbp), %eax
	jl	.L14
.L10:
	movl	$0, -260(%rbp)
	jmp	.L15
.L16:
	movq	-248(%rbp), %rcx
	movabsq	$7378697629483820647, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	movq	%rdx, %rax
	sarq	$2, %rax
	movq	%rcx, %rsi
	sarq	$63, %rsi
	subq	%rsi, %rax
	movq	%rax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	subq	%rax, %rcx
	movq	%rcx, %rdx
	movl	-260(%rbp), %eax
	cltq
	movl	%edx, -208(%rbp,%rax,4)
	movq	-248(%rbp), %rcx
	movabsq	$7378697629483820647, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	movq	%rdx, %rax
	sarq	$2, %rax
	sarq	$63, %rcx
	movq	%rcx, %rdx
	subq	%rdx, %rax
	movq	%rax, -248(%rbp)
	addl	$1, -260(%rbp)
.L15:
	movl	-264(%rbp), %eax
	cmpl	%eax, -260(%rbp)
	jl	.L16
	movl	$0, -260(%rbp)
	jmp	.L17
.L21:
	movl	-260(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -256(%rbp)
	jmp	.L18
.L20:
	movl	-260(%rbp), %eax
	cltq
	movl	-208(%rbp,%rax,4), %edx
	movl	-256(%rbp), %eax
	cltq
	movl	-208(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jge	.L19
	movl	-260(%rbp), %eax
	cltq
	movl	-208(%rbp,%rax,4), %eax
	cltq
	movq	%rax, -216(%rbp)
	movl	-256(%rbp), %eax
	cltq
	movl	-208(%rbp,%rax,4), %edx
	movl	-260(%rbp), %eax
	cltq
	movl	%edx, -208(%rbp,%rax,4)
	movq	-216(%rbp), %rax
	movl	%eax, %edx
	movl	-256(%rbp), %eax
	cltq
	movl	%edx, -208(%rbp,%rax,4)
.L19:
	addl	$1, -256(%rbp)
.L18:
	movl	-264(%rbp), %eax
	cmpl	%eax, -256(%rbp)
	jl	.L20
	addl	$1, -260(%rbp)
.L17:
	movl	-264(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -260(%rbp)
	jl	.L21
	movl	$0, -260(%rbp)
	jmp	.L22
.L23:
	movl	-260(%rbp), %eax
	cltq
	movl	-208(%rbp,%rax,4), %eax
	pxor	%xmm2, %xmm2
	cvtsi2sdl	%eax, %xmm2
	movsd	%xmm2, -280(%rbp)
	movl	-264(%rbp), %eax
	subl	-260(%rbp), %eax
	subl	$1, %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movq	.LC2(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movsd	-280(%rbp), %xmm1
	mulsd	%xmm0, %xmm1
	pxor	%xmm0, %xmm0
	cvtsi2sdq	-240(%rbp), %xmm0
	addsd	%xmm1, %xmm0
	cvttsd2siq	%xmm0, %rax
	movq	%rax, -240(%rbp)
	movl	-260(%rbp), %eax
	cltq
	movl	-208(%rbp,%rax,4), %eax
	pxor	%xmm3, %xmm3
	cvtsi2sdl	%eax, %xmm3
	movsd	%xmm3, -280(%rbp)
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-260(%rbp), %xmm0
	movq	.LC2(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movsd	-280(%rbp), %xmm1
	mulsd	%xmm0, %xmm1
	pxor	%xmm0, %xmm0
	cvtsi2sdq	-232(%rbp), %xmm0
	addsd	%xmm1, %xmm0
	cvttsd2siq	%xmm0, %rax
	movq	%rax, -232(%rbp)
	addl	$1, -260(%rbp)
.L22:
	movl	-264(%rbp), %eax
	cmpl	%eax, -260(%rbp)
	jl	.L23
	addl	$1, -252(%rbp)
	movq	-240(%rbp), %rax
	subq	-232(%rbp), %rax
	movq	%rax, -248(%rbp)
	movq	-248(%rbp), %rdx
	movl	-252(%rbp), %eax
	cltq
	movq	%rdx, -176(%rbp,%rax,8)
.L8:
	cmpq	$1, -224(%rbp)
	jne	.L24
	leaq	-264(%rbp), %rdx
	leaq	-248(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L25
.L29:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L27
	call	__stack_chk_fail@PLT
.L27:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC2:
	.long	0
	.long	1076101120
	.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	"%ld %d"
.LC1:
	.string	"%d %ld %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$280, %rsp
	.cfi_def_cfa_offset 336
	movq	%fs:40, %rax
	movq	%rax, 264(%rsp)
	xorl	%eax, %eax
	leaq	56(%rsp), %rax
	leaq	52(%rsp), %rdx
	movq	%rax, 40(%rsp)
	movq	%rax, %rsi
	xorl	%eax, %eax
	movq	%rdx, 32(%rsp)
	call	__isoc99_scanf@PLT
.L70:
	movq	56(%rsp), %rbx
	movl	52(%rsp), %r15d
	testq	%rbx, %rbx
	jne	.L2
	testl	%r15d, %r15d
	je	.L3
.L2:
	leaq	96(%rsp), %rdi
	movl	$20, %ecx
	xorl	%eax, %eax
	movq	%rdi, 8(%rsp)
	rep stosq
	testl	%r15d, %r15d
	jle	.L6
	movslq	%r15d, %rdx
	leaq	64(%rsp), %r12
	xorl	%esi, %esi
	salq	$2, %rdx
	movq	%r12, %rdi
	call	memset@PLT
.L6:
	movq	$0, 16(%rsp)
	.p2align 4,,10
	.p2align 3
.L5:
	movq	16(%rsp), %rax
	movl	%eax, %r8d
	testq	%rax, %rax
	jne	.L7
	movq	%rbx, 96(%rsp)
	movq	$0, 24(%rsp)
.L8:
	leal	-1(%r15), %ebp
	testl	%r15d, %r15d
	jle	.L11
.L149:
	movabsq	$7378697629483820647, %rax
	movq	56(%rsp), %rcx
	imulq	%rcx
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$2, %rdx
	movq	%rdx, %rsi
	subq	%rax, %rsi
	leaq	(%rsi,%rsi,4), %rax
	addq	%rax, %rax
	subq	%rax, %rcx
	movl	%ecx, 64(%rsp)
	cmpl	$1, %r15d
	je	.L12
	movabsq	$7378697629483820647, %rax
	imulq	%rsi
	movq	%rsi, %rax
	sarq	$63, %rax
	sarq	$2, %rdx
	movq	%rdx, %rcx
	subq	%rax, %rcx
	leaq	(%rcx,%rcx,4), %rax
	addq	%rax, %rax
	subq	%rax, %rsi
	movl	%esi, 68(%rsp)
	cmpl	$2, %r15d
	je	.L13
	movabsq	$7378697629483820647, %rax
	imulq	%rcx
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$2, %rdx
	subq	%rax, %rdx
	leaq	(%rdx,%rdx,4), %rax
	addq	%rax, %rax
	subq	%rax, %rcx
	movl	%ecx, 72(%rsp)
	movq	%rdx, %rcx
	cmpl	$3, %r15d
	je	.L13
	movabsq	$7378697629483820647, %rax
	imulq	%rdx
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$2, %rdx
	subq	%rax, %rdx
	leaq	(%rdx,%rdx,4), %rax
	addq	%rax, %rax
	subq	%rax, %rcx
	movl	%ecx, 76(%rsp)
	movq	%rdx, %rcx
	cmpl	$4, %r15d
	je	.L13
	movabsq	$7378697629483820647, %rax
	imulq	%rdx
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$2, %rdx
	subq	%rax, %rdx
	leaq	(%rdx,%rdx,4), %rax
	addq	%rax, %rax
	subq	%rax, %rcx
	movl	%ecx, 80(%rsp)
	movq	%rdx, %rcx
	cmpl	$5, %r15d
	je	.L13
	movabsq	$7378697629483820647, %rax
	imulq	%rdx
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$2, %rdx
	subq	%rax, %rdx
	leaq	(%rdx,%rdx,4), %rax
	addq	%rax, %rax
	subq	%rax, %rcx
	movl	%ecx, 84(%rsp)
	movq	%rdx, %rcx
.L13:
	movq	%rcx, 56(%rsp)
	testl	%ebp, %ebp
	jle	.L66
	movq	64(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm3
	movd	%xmm0, %edx
	movd	%xmm3, %eax
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %edx
	jge	.L24
	movq	%xmm1, 64(%rsp)
.L24:
	cmpl	$2, %r15d
	je	.L14
	movl	64(%rsp), %eax
	movl	72(%rsp), %edx
	cmpl	%edx, %eax
	jge	.L23
	movl	%edx, 64(%rsp)
	movl	%eax, 72(%rsp)
.L23:
	cmpl	$3, %r15d
	je	.L16
	movl	64(%rsp), %eax
	movl	76(%rsp), %edx
	cmpl	%edx, %eax
	jge	.L22
	movl	%edx, 64(%rsp)
	movl	%eax, 76(%rsp)
.L22:
	cmpl	$4, %r15d
	je	.L16
	movl	64(%rsp), %eax
	movl	80(%rsp), %edx
	cmpl	%edx, %eax
	jge	.L21
	movl	%edx, 64(%rsp)
	movl	%eax, 80(%rsp)
.L21:
	cmpl	$5, %r15d
	je	.L16
	movl	64(%rsp), %eax
	movl	84(%rsp), %edx
	cmpl	%edx, %eax
	jge	.L16
	movl	%edx, 64(%rsp)
	movl	%eax, 84(%rsp)
.L16:
	cmpl	$1, %ebp
	je	.L66
.L76:
	movq	68(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm4
	movd	%xmm0, %edx
	movd	%xmm4, %eax
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %edx
	jge	.L37
	movq	%xmm1, 68(%rsp)
.L37:
	cmpl	$3, %r15d
	jle	.L27
	movl	68(%rsp), %eax
	movl	76(%rsp), %edx
	cmpl	%edx, %eax
	jge	.L36
	movl	%edx, 68(%rsp)
	movl	%eax, 76(%rsp)
.L36:
	cmpl	$4, %r15d
	je	.L29
	movl	68(%rsp), %eax
	movl	80(%rsp), %edx
	cmpl	%edx, %eax
	jge	.L35
	movl	%edx, 68(%rsp)
	movl	%eax, 80(%rsp)
.L35:
	cmpl	$5, %r15d
	je	.L29
	movl	68(%rsp), %eax
	movl	84(%rsp), %edx
	cmpl	%edx, %eax
	jge	.L34
	movl	%edx, 68(%rsp)
	movl	%eax, 84(%rsp)
.L34:
	cmpl	$6, %r15d
	je	.L29
	movl	68(%rsp), %eax
	movl	88(%rsp), %edx
	cmpl	%edx, %eax
	jge	.L29
	movl	%edx, 68(%rsp)
	movl	%eax, 88(%rsp)
.L29:
	cmpl	$2, %ebp
	jle	.L66
.L75:
	movq	72(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm5
	movd	%xmm0, %edx
	movd	%xmm5, %eax
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %edx
	jge	.L52
	movq	%xmm1, 72(%rsp)
.L52:
	cmpl	$4, %r15d
	jle	.L41
	movl	72(%rsp), %eax
	movl	80(%rsp), %edx
	cmpl	%edx, %eax
	jge	.L51
	movl	%edx, 72(%rsp)
	movl	%eax, 80(%rsp)
.L51:
	cmpl	$5, %r15d
	je	.L43
	movl	72(%rsp), %eax
	movl	84(%rsp), %edx
	cmpl	%edx, %eax
	jge	.L50
	movl	%edx, 72(%rsp)
	movl	%eax, 84(%rsp)
.L50:
	cmpl	$6, %r15d
	je	.L43
	movl	72(%rsp), %eax
	movl	88(%rsp), %edx
	cmpl	%edx, %eax
	jge	.L49
	movl	%edx, 72(%rsp)
	movl	%eax, 88(%rsp)
.L49:
	cmpl	$7, %r15d
	je	.L43
	movl	72(%rsp), %eax
	movl	92(%rsp), %edx
	cmpl	%edx, %eax
	jge	.L43
	movl	%edx, 72(%rsp)
	movl	%eax, 92(%rsp)
.L43:
	cmpl	$3, %ebp
	jle	.L66
.L73:
	movq	76(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm6
	movd	%xmm0, %eax
	movd	%xmm6, %edx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %edx
	jle	.L65
	movq	%xmm1, 76(%rsp)
.L65:
	cmpl	$5, %r15d
	jle	.L55
	movl	76(%rsp), %eax
	movl	84(%rsp), %edx
	cmpl	%edx, %eax
	jge	.L64
	movl	%edx, 76(%rsp)
	movl	%eax, 84(%rsp)
.L64:
	cmpl	$6, %r15d
	je	.L57
	movl	76(%rsp), %eax
	movl	88(%rsp), %edx
	cmpl	%edx, %eax
	jge	.L63
	movl	%edx, 76(%rsp)
	movl	%eax, 88(%rsp)
.L63:
	cmpl	$7, %r15d
	je	.L57
	movl	76(%rsp), %eax
	movl	92(%rsp), %edx
	cmpl	%edx, %eax
	jge	.L62
	movl	%edx, 76(%rsp)
	movl	%eax, 92(%rsp)
.L62:
	cmpl	$8, %r15d
	je	.L57
	movl	76(%rsp), %eax
	movl	96(%rsp), %edx
	cmpl	%edx, %eax
	jge	.L57
	movl	%edx, 76(%rsp)
	movl	%eax, 96(%rsp)
.L57:
	cmpl	$4, %ebp
	jle	.L66
	movq	80(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm7
	movd	%xmm0, %eax
	movd	%xmm7, %edx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %edx
	jle	.L66
	movq	%xmm1, 80(%rsp)
	.p2align 4,,10
	.p2align 3
.L66:
	xorl	%r13d, %r13d
	xorl	%r14d, %r14d
	leaq	64(%rsp), %r12
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L69:
	movl	%ebp, %ecx
	pxor	%xmm2, %xmm2
	pxor	%xmm1, %xmm1
	movq	.LC2(%rip), %rax
	subl	%r13d, %ecx
	cvtsi2sdl	(%r12,%r13,4), %xmm2
	cvtsi2sdl	%ecx, %xmm1
	movq	%rax, %xmm0
	movsd	%xmm2, (%rsp)
	call	pow@PLT
	pxor	%xmm1, %xmm1
	movq	.LC2(%rip), %rax
	mulsd	(%rsp), %xmm0
	cvtsi2sdq	%rbx, %xmm1
	addsd	%xmm0, %xmm1
	movq	%rax, %xmm0
	cvttsd2siq	%xmm1, %rbx
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%r13d, %xmm1
	addq	$1, %r13
	call	pow@PLT
	mulsd	(%rsp), %xmm0
	pxor	%xmm1, %xmm1
	cvtsi2sdq	%r14, %xmm1
	addsd	%xmm0, %xmm1
	cvttsd2siq	%xmm1, %r14
	cmpl	%r13d, %r15d
	jg	.L69
	subq	%r14, %rbx
.L68:
	movq	16(%rsp), %rax
	movq	8(%rsp), %rdi
	movq	%rbx, 56(%rsp)
	movq	%rbx, 8(%rdi,%rax,8)
	addq	$1, %rax
	cmpq	$1, 24(%rsp)
	movq	%rax, 16(%rsp)
	jne	.L5
	movq	32(%rsp), %rdx
	movq	40(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	jmp	.L70
.L7:
	leal	-1(%rax), %ecx
	movq	8(%rsp), %rdi
	xorl	%eax, %eax
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L91:
	movq	%rdx, %rax
.L10:
	movl	%eax, %edx
	cmpq	%rbx, (%rdi,%rax,8)
	je	.L148
	leaq	1(%rax), %rdx
	cmpq	%rcx, %rax
	jne	.L91
	movq	$0, 24(%rsp)
	leal	-1(%r15), %ebp
	testl	%r15d, %r15d
	jg	.L149
.L11:
	testl	%ebp, %ebp
	jle	.L72
	cmpl	$1, %ebp
	jle	.L72
	cmpl	$2, %r15d
	jg	.L76
.L25:
	cmpl	$2, %ebp
	jle	.L38
	cmpl	$3, %r15d
	jg	.L75
.L39:
	cmpl	$3, %ebp
	jg	.L150
.L38:
	testl	%r15d, %r15d
	jg	.L66
.L72:
	xorl	%ebx, %ebx
	jmp	.L68
.L148:
	subl	%eax, %r8d
	movq	%rbx, %rcx
	movl	$1, %edi
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movl	52(%rsp), %r15d
	movq	$1, 24(%rsp)
	jmp	.L8
.L12:
	movq	%rsi, 56(%rsp)
	testl	%ebp, %ebp
	jle	.L66
	cmpl	$1, %ebp
	jg	.L25
	jmp	.L66
	.p2align 4,,10
	.p2align 3
.L14:
	cmpl	$1, %ebp
	je	.L66
	cmpl	$2, %ebp
	jle	.L66
	cmpl	$3, %ebp
	jle	.L38
.L150:
	cmpl	$4, %r15d
	jg	.L73
	jmp	.L38
.L27:
	cmpl	$2, %ebp
	jg	.L39
	jmp	.L38
.L41:
	cmpl	$3, %ebp
	jg	.L38
	jmp	.L66
.L55:
	cmpl	$4, %ebp
	jle	.L66
	jmp	.L38
	.p2align 4,,10
	.p2align 3
.L3:
	movq	264(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L151
	addq	$280, %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
.L151:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC2:
	.long	0
	.long	1076101120
	.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	"%ld %d"
.LC1:
	.string	"%d %ld %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$280, %rsp
	.cfi_def_cfa_offset 336
	movq	%fs:40, %rax
	movq	%rax, 264(%rsp)
	xorl	%eax, %eax
	leaq	56(%rsp), %rax
	leaq	52(%rsp), %rdx
	movq	%rax, 40(%rsp)
	movq	%rax, %rsi
	xorl	%eax, %eax
	movq	%rdx, 32(%rsp)
	call	__isoc99_scanf@PLT
.L70:
	movq	56(%rsp), %rbx
	movl	52(%rsp), %r15d
	testq	%rbx, %rbx
	jne	.L2
	testl	%r15d, %r15d
	je	.L3
.L2:
	leaq	96(%rsp), %rdi
	movl	$20, %ecx
	xorl	%eax, %eax
	movq	%rdi, 8(%rsp)
	rep stosq
	testl	%r15d, %r15d
	jle	.L6
	movslq	%r15d, %rdx
	leaq	64(%rsp), %r12
	xorl	%esi, %esi
	salq	$2, %rdx
	movq	%r12, %rdi
	call	memset@PLT
.L6:
	movq	$0, 16(%rsp)
	.p2align 4,,10
	.p2align 3
.L5:
	movq	16(%rsp), %rax
	movl	%eax, %r8d
	testq	%rax, %rax
	jne	.L7
	movq	%rbx, 96(%rsp)
	movq	$0, 24(%rsp)
.L8:
	leal	-1(%r15), %ebp
	testl	%r15d, %r15d
	jle	.L11
.L149:
	movabsq	$7378697629483820647, %rax
	movq	56(%rsp), %rcx
	imulq	%rcx
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$2, %rdx
	movq	%rdx, %rsi
	subq	%rax, %rsi
	leaq	(%rsi,%rsi,4), %rax
	addq	%rax, %rax
	subq	%rax, %rcx
	movl	%ecx, 64(%rsp)
	cmpl	$1, %r15d
	je	.L12
	movabsq	$7378697629483820647, %rax
	imulq	%rsi
	movq	%rsi, %rax
	sarq	$63, %rax
	sarq	$2, %rdx
	movq	%rdx, %rcx
	subq	%rax, %rcx
	leaq	(%rcx,%rcx,4), %rax
	addq	%rax, %rax
	subq	%rax, %rsi
	movl	%esi, 68(%rsp)
	cmpl	$2, %r15d
	je	.L13
	movabsq	$7378697629483820647, %rax
	imulq	%rcx
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$2, %rdx
	subq	%rax, %rdx
	leaq	(%rdx,%rdx,4), %rax
	addq	%rax, %rax
	subq	%rax, %rcx
	movl	%ecx, 72(%rsp)
	movq	%rdx, %rcx
	cmpl	$3, %r15d
	je	.L13
	movabsq	$7378697629483820647, %rax
	imulq	%rdx
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$2, %rdx
	subq	%rax, %rdx
	leaq	(%rdx,%rdx,4), %rax
	addq	%rax, %rax
	subq	%rax, %rcx
	movl	%ecx, 76(%rsp)
	movq	%rdx, %rcx
	cmpl	$4, %r15d
	je	.L13
	movabsq	$7378697629483820647, %rax
	imulq	%rdx
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$2, %rdx
	subq	%rax, %rdx
	leaq	(%rdx,%rdx,4), %rax
	addq	%rax, %rax
	subq	%rax, %rcx
	movl	%ecx, 80(%rsp)
	movq	%rdx, %rcx
	cmpl	$5, %r15d
	je	.L13
	movabsq	$7378697629483820647, %rax
	imulq	%rdx
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$2, %rdx
	subq	%rax, %rdx
	leaq	(%rdx,%rdx,4), %rax
	addq	%rax, %rax
	subq	%rax, %rcx
	movl	%ecx, 84(%rsp)
	movq	%rdx, %rcx
.L13:
	movq	%rcx, 56(%rsp)
	testl	%ebp, %ebp
	jle	.L66
	movq	64(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm3
	movd	%xmm0, %edx
	movd	%xmm3, %eax
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %edx
	jge	.L24
	movq	%xmm1, 64(%rsp)
.L24:
	cmpl	$2, %r15d
	je	.L14
	movl	64(%rsp), %eax
	movl	72(%rsp), %edx
	cmpl	%edx, %eax
	jge	.L23
	movl	%edx, 64(%rsp)
	movl	%eax, 72(%rsp)
.L23:
	cmpl	$3, %r15d
	je	.L16
	movl	64(%rsp), %eax
	movl	76(%rsp), %edx
	cmpl	%edx, %eax
	jge	.L22
	movl	%edx, 64(%rsp)
	movl	%eax, 76(%rsp)
.L22:
	cmpl	$4, %r15d
	je	.L16
	movl	64(%rsp), %eax
	movl	80(%rsp), %edx
	cmpl	%edx, %eax
	jge	.L21
	movl	%edx, 64(%rsp)
	movl	%eax, 80(%rsp)
.L21:
	cmpl	$5, %r15d
	je	.L16
	movl	64(%rsp), %eax
	movl	84(%rsp), %edx
	cmpl	%edx, %eax
	jge	.L16
	movl	%edx, 64(%rsp)
	movl	%eax, 84(%rsp)
.L16:
	cmpl	$1, %ebp
	je	.L66
.L76:
	movq	68(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm4
	movd	%xmm0, %edx
	movd	%xmm4, %eax
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %edx
	jge	.L37
	movq	%xmm1, 68(%rsp)
.L37:
	cmpl	$3, %r15d
	jle	.L27
	movl	68(%rsp), %eax
	movl	76(%rsp), %edx
	cmpl	%edx, %eax
	jge	.L36
	movl	%edx, 68(%rsp)
	movl	%eax, 76(%rsp)
.L36:
	cmpl	$4, %r15d
	je	.L29
	movl	68(%rsp), %eax
	movl	80(%rsp), %edx
	cmpl	%edx, %eax
	jge	.L35
	movl	%edx, 68(%rsp)
	movl	%eax, 80(%rsp)
.L35:
	cmpl	$5, %r15d
	je	.L29
	movl	68(%rsp), %eax
	movl	84(%rsp), %edx
	cmpl	%edx, %eax
	jge	.L34
	movl	%edx, 68(%rsp)
	movl	%eax, 84(%rsp)
.L34:
	cmpl	$6, %r15d
	je	.L29
	movl	68(%rsp), %eax
	movl	88(%rsp), %edx
	cmpl	%edx, %eax
	jge	.L29
	movl	%edx, 68(%rsp)
	movl	%eax, 88(%rsp)
.L29:
	cmpl	$2, %ebp
	jle	.L66
.L75:
	movq	72(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm5
	movd	%xmm0, %edx
	movd	%xmm5, %eax
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %edx
	jge	.L52
	movq	%xmm1, 72(%rsp)
.L52:
	cmpl	$4, %r15d
	jle	.L41
	movl	72(%rsp), %eax
	movl	80(%rsp), %edx
	cmpl	%edx, %eax
	jge	.L51
	movl	%edx, 72(%rsp)
	movl	%eax, 80(%rsp)
.L51:
	cmpl	$5, %r15d
	je	.L43
	movl	72(%rsp), %eax
	movl	84(%rsp), %edx
	cmpl	%edx, %eax
	jge	.L50
	movl	%edx, 72(%rsp)
	movl	%eax, 84(%rsp)
.L50:
	cmpl	$6, %r15d
	je	.L43
	movl	72(%rsp), %eax
	movl	88(%rsp), %edx
	cmpl	%edx, %eax
	jge	.L49
	movl	%edx, 72(%rsp)
	movl	%eax, 88(%rsp)
.L49:
	cmpl	$7, %r15d
	je	.L43
	movl	72(%rsp), %eax
	movl	92(%rsp), %edx
	cmpl	%edx, %eax
	jge	.L43
	movl	%edx, 72(%rsp)
	movl	%eax, 92(%rsp)
.L43:
	cmpl	$3, %ebp
	jle	.L66
.L73:
	movq	76(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm6
	movd	%xmm0, %eax
	movd	%xmm6, %edx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %edx
	jle	.L65
	movq	%xmm1, 76(%rsp)
.L65:
	cmpl	$5, %r15d
	jle	.L55
	movl	76(%rsp), %eax
	movl	84(%rsp), %edx
	cmpl	%edx, %eax
	jge	.L64
	movl	%edx, 76(%rsp)
	movl	%eax, 84(%rsp)
.L64:
	cmpl	$6, %r15d
	je	.L57
	movl	76(%rsp), %eax
	movl	88(%rsp), %edx
	cmpl	%edx, %eax
	jge	.L63
	movl	%edx, 76(%rsp)
	movl	%eax, 88(%rsp)
.L63:
	cmpl	$7, %r15d
	je	.L57
	movl	76(%rsp), %eax
	movl	92(%rsp), %edx
	cmpl	%edx, %eax
	jge	.L62
	movl	%edx, 76(%rsp)
	movl	%eax, 92(%rsp)
.L62:
	cmpl	$8, %r15d
	je	.L57
	movl	76(%rsp), %eax
	movl	96(%rsp), %edx
	cmpl	%edx, %eax
	jge	.L57
	movl	%edx, 76(%rsp)
	movl	%eax, 96(%rsp)
.L57:
	cmpl	$4, %ebp
	jle	.L66
	movq	80(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm7
	movd	%xmm0, %eax
	movd	%xmm7, %edx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %edx
	jle	.L66
	movq	%xmm1, 80(%rsp)
	.p2align 4,,10
	.p2align 3
.L66:
	xorl	%r13d, %r13d
	xorl	%r14d, %r14d
	leaq	64(%rsp), %r12
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L69:
	movl	%ebp, %ecx
	pxor	%xmm2, %xmm2
	pxor	%xmm1, %xmm1
	movq	.LC2(%rip), %rax
	subl	%r13d, %ecx
	cvtsi2sdl	(%r12,%r13,4), %xmm2
	cvtsi2sdl	%ecx, %xmm1
	movq	%rax, %xmm0
	movsd	%xmm2, (%rsp)
	call	pow@PLT
	pxor	%xmm1, %xmm1
	movq	.LC2(%rip), %rax
	mulsd	(%rsp), %xmm0
	cvtsi2sdq	%rbx, %xmm1
	addsd	%xmm0, %xmm1
	movq	%rax, %xmm0
	cvttsd2siq	%xmm1, %rbx
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%r13d, %xmm1
	addq	$1, %r13
	call	pow@PLT
	mulsd	(%rsp), %xmm0
	pxor	%xmm1, %xmm1
	cvtsi2sdq	%r14, %xmm1
	addsd	%xmm0, %xmm1
	cvttsd2siq	%xmm1, %r14
	cmpl	%r13d, %r15d
	jg	.L69
	subq	%r14, %rbx
.L68:
	movq	16(%rsp), %rax
	movq	8(%rsp), %rdi
	movq	%rbx, 56(%rsp)
	movq	%rbx, 8(%rdi,%rax,8)
	addq	$1, %rax
	cmpq	$1, 24(%rsp)
	movq	%rax, 16(%rsp)
	jne	.L5
	movq	32(%rsp), %rdx
	movq	40(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	jmp	.L70
.L7:
	leal	-1(%rax), %ecx
	movq	8(%rsp), %rdi
	xorl	%eax, %eax
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L91:
	movq	%rdx, %rax
.L10:
	movl	%eax, %edx
	cmpq	%rbx, (%rdi,%rax,8)
	je	.L148
	leaq	1(%rax), %rdx
	cmpq	%rcx, %rax
	jne	.L91
	movq	$0, 24(%rsp)
	leal	-1(%r15), %ebp
	testl	%r15d, %r15d
	jg	.L149
.L11:
	testl	%ebp, %ebp
	jle	.L72
	cmpl	$1, %ebp
	jle	.L72
	cmpl	$2, %r15d
	jg	.L76
.L25:
	cmpl	$2, %ebp
	jle	.L38
	cmpl	$3, %r15d
	jg	.L75
.L39:
	cmpl	$3, %ebp
	jg	.L150
.L38:
	testl	%r15d, %r15d
	jg	.L66
.L72:
	xorl	%ebx, %ebx
	jmp	.L68
.L148:
	subl	%eax, %r8d
	movq	%rbx, %rcx
	movl	$1, %edi
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movl	52(%rsp), %r15d
	movq	$1, 24(%rsp)
	jmp	.L8
.L12:
	movq	%rsi, 56(%rsp)
	testl	%ebp, %ebp
	jle	.L66
	cmpl	$1, %ebp
	jg	.L25
	jmp	.L66
	.p2align 4,,10
	.p2align 3
.L14:
	cmpl	$1, %ebp
	je	.L66
	cmpl	$2, %ebp
	jle	.L66
	cmpl	$3, %ebp
	jle	.L38
.L150:
	cmpl	$4, %r15d
	jg	.L73
	jmp	.L38
.L27:
	cmpl	$2, %ebp
	jg	.L39
	jmp	.L38
.L41:
	cmpl	$3, %ebp
	jg	.L38
	jmp	.L66
.L55:
	cmpl	$4, %ebp
	jle	.L66
	jmp	.L38
	.p2align 4,,10
	.p2align 3
.L3:
	movq	264(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L151
	addq	$280, %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
.L151:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC2:
	.long	0
	.long	1076101120
	.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<math.h>

int main(void){
	int l,i,j,a[6],count;
	long n,tmp,max,min,b[20],f=0;
	
	scanf("%ld %d",&n,&l);
	
	while(1){
		
		if(n==0 && l==0)break;
		
		max=0;
		min=0;
		tmp=0;
		count=0;
		f=0;
		for(i=0;i<20;i++){
			b[i]=0;
		}
		
		for(i=0;i<l;i++){
			a[i]=0;
		}
		
		
		while(f!=1){
			
			max=0;
			min=0;
			
			//if(f==1)break;
			
			if(count==0){
				b[count]=n;
			}else{
			
			for(i=0;i<count;i++){
				if(n==b[i] || i>=19){
					
					printf("%d %ld %d\n",i,b[i],count-i);
					
					f=1;
					break;
				}
				
			}
			}
		
		for(i=0;i<l;i++){
			a[i]=n%10;
			n=n/10;
			//if(max<a[i]) max=a[i];
			//if(min>a[i]) min=a[i];
			
			//fprintf(fout,"%d\n",a[i]);
		}
		
		for(i=0;i<l-1;i++){
			for(j=i+1;j<l;j++){
				if(a[i]<a[j]){
					tmp=a[i];
					a[i]=a[j];
					a[j]=tmp;
				}
			}
		}
		
		for(i=0;i<l;i++){
			max+=a[i]*pow(10,(l-i-1));
			min+=a[i]*pow(10,i);
		}
		
		count++;
		
		n=max-min;
		
		b[count]=n;
		
		//fprintf(fout,"max=%ld, min=%ld\n",max,min);
		
		}
		
		scanf("%ld %d",&n,&l);
	}

	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
1 0 1
1 0 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>
#include<math.h>

int main(void){
	int l,i,j,a[6],count;
	long n,tmp,max,min,b[20],f=0;
	
	scanf("%ld %d",&n,&l);
	
	while(1){
		
		if(n==0 && l==0)break;
		
		max=0;
		min=0;
		tmp=0;
		count=0;
		f=0;
		for(i=0;i<20;i++){
			b[i]=0;
		}
		
		for(i=0;i<l;i++){
			a[i]=0;
		}
		
		
		while(f!=1){
			
			max=0;
			min=0;
			
			//if(f==1)break;
			
			if(count==0){
				b[count]=n;
			}else{
			
			for(i=0;i<count;i++){
				if(n==b[i] || i>=19){
					
					printf("%d %ld %d\n",i,b[i],count-i);
					
					f=1;
					break;
				}
				
			}
			}
		
		for(i=0;i<l;i++){
			a[i]=n%10;
			n=n/10;
			//if(max<a[i]) max=a[i];
			//if(min>a[i]) min=a[i];
			
			//fprintf(fout,"%d\n",a[i]);
		}
		
		for(i=0;i<l-1;i++){
			for(j=i+1;j<l;j++){
				if(a[i]<a[j]){
					tmp=a[i];
					a[i]=a[j];
					a[j]=tmp;
				}
			}
		}
		
		for(i=0;i<l;i++){
			max+=a[i]*pow(10,(l-i-1));
			min+=a[i]*pow(10,i);
		}
		
		count++;
		
		n=max-min;
		
		b[count]=n;
		
		//fprintf(fout,"max=%ld, min=%ld\n",max,min);
		
		}
		
		scanf("%ld %d",&n,&l);
	}

	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%ld %d"
.LC1:
	.string	"%d %ld %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$288, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -224(%rbp)
	leaq	-264(%rbp), %rdx
	leaq	-248(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
.L25:
	movq	-248(%rbp), %rax
	testq	%rax, %rax
	jne	.L2
	movl	-264(%rbp), %eax
	testl	%eax, %eax
	je	.L29
.L2:
	movq	$0, -240(%rbp)
	movq	$0, -232(%rbp)
	movq	$0, -216(%rbp)
	movl	$0, -252(%rbp)
	movq	$0, -224(%rbp)
	movl	$0, -260(%rbp)
	jmp	.L4
.L5:
	movl	-260(%rbp), %eax
	cltq
	movq	$0, -176(%rbp,%rax,8)
	addl	$1, -260(%rbp)
.L4:
	cmpl	$19, -260(%rbp)
	jle	.L5
	movl	$0, -260(%rbp)
	jmp	.L6
.L7:
	movl	-260(%rbp), %eax
	cltq
	movl	$0, -208(%rbp,%rax,4)
	addl	$1, -260(%rbp)
.L6:
	movl	-264(%rbp), %eax
	cmpl	%eax, -260(%rbp)
	jl	.L7
	jmp	.L8
.L24:
	movq	$0, -240(%rbp)
	movq	$0, -232(%rbp)
	cmpl	$0, -252(%rbp)
	jne	.L9
	movq	-248(%rbp), %rdx
	movl	-252(%rbp), %eax
	cltq
	movq	%rdx, -176(%rbp,%rax,8)
	jmp	.L10
.L9:
	movl	$0, -260(%rbp)
	jmp	.L11
.L14:
	movl	-260(%rbp), %eax
	cltq
	movq	-176(%rbp,%rax,8), %rdx
	movq	-248(%rbp), %rax
	cmpq	%rax, %rdx
	je	.L12
	cmpl	$18, -260(%rbp)
	jle	.L13
.L12:
	movl	-252(%rbp), %eax
	subl	-260(%rbp), %eax
	movl	%eax, %ecx
	movl	-260(%rbp), %eax
	cltq
	movq	-176(%rbp,%rax,8), %rdx
	movl	-260(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	$1, -224(%rbp)
	jmp	.L10
.L13:
	addl	$1, -260(%rbp)
.L11:
	movl	-260(%rbp), %eax
	cmpl	-252(%rbp), %eax
	jl	.L14
.L10:
	movl	$0, -260(%rbp)
	jmp	.L15
.L16:
	movq	-248(%rbp), %rcx
	movabsq	$7378697629483820647, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	movq	%rdx, %rax
	sarq	$2, %rax
	movq	%rcx, %rsi
	sarq	$63, %rsi
	subq	%rsi, %rax
	movq	%rax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	subq	%rax, %rcx
	movq	%rcx, %rdx
	movl	-260(%rbp), %eax
	cltq
	movl	%edx, -208(%rbp,%rax,4)
	movq	-248(%rbp), %rcx
	movabsq	$7378697629483820647, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	movq	%rdx, %rax
	sarq	$2, %rax
	sarq	$63, %rcx
	movq	%rcx, %rdx
	subq	%rdx, %rax
	movq	%rax, -248(%rbp)
	addl	$1, -260(%rbp)
.L15:
	movl	-264(%rbp), %eax
	cmpl	%eax, -260(%rbp)
	jl	.L16
	movl	$0, -260(%rbp)
	jmp	.L17
.L21:
	movl	-260(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -256(%rbp)
	jmp	.L18
.L20:
	movl	-260(%rbp), %eax
	cltq
	movl	-208(%rbp,%rax,4), %edx
	movl	-256(%rbp), %eax
	cltq
	movl	-208(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jge	.L19
	movl	-260(%rbp), %eax
	cltq
	movl	-208(%rbp,%rax,4), %eax
	cltq
	movq	%rax, -216(%rbp)
	movl	-256(%rbp), %eax
	cltq
	movl	-208(%rbp,%rax,4), %edx
	movl	-260(%rbp), %eax
	cltq
	movl	%edx, -208(%rbp,%rax,4)
	movq	-216(%rbp), %rax
	movl	%eax, %edx
	movl	-256(%rbp), %eax
	cltq
	movl	%edx, -208(%rbp,%rax,4)
.L19:
	addl	$1, -256(%rbp)
.L18:
	movl	-264(%rbp), %eax
	cmpl	%eax, -256(%rbp)
	jl	.L20
	addl	$1, -260(%rbp)
.L17:
	movl	-264(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -260(%rbp)
	jl	.L21
	movl	$0, -260(%rbp)
	jmp	.L22
.L23:
	movl	-260(%rbp), %eax
	cltq
	movl	-208(%rbp,%rax,4), %eax
	pxor	%xmm2, %xmm2
	cvtsi2sdl	%eax, %xmm2
	movsd	%xmm2, -280(%rbp)
	movl	-264(%rbp), %eax
	subl	-260(%rbp), %eax
	subl	$1, %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movq	.LC2(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movsd	-280(%rbp), %xmm1
	mulsd	%xmm0, %xmm1
	pxor	%xmm0, %xmm0
	cvtsi2sdq	-240(%rbp), %xmm0
	addsd	%xmm1, %xmm0
	cvttsd2siq	%xmm0, %rax
	movq	%rax, -240(%rbp)
	movl	-260(%rbp), %eax
	cltq
	movl	-208(%rbp,%rax,4), %eax
	pxor	%xmm3, %xmm3
	cvtsi2sdl	%eax, %xmm3
	movsd	%xmm3, -280(%rbp)
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-260(%rbp), %xmm0
	movq	.LC2(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movsd	-280(%rbp), %xmm1
	mulsd	%xmm0, %xmm1
	pxor	%xmm0, %xmm0
	cvtsi2sdq	-232(%rbp), %xmm0
	addsd	%xmm1, %xmm0
	cvttsd2siq	%xmm0, %rax
	movq	%rax, -232(%rbp)
	addl	$1, -260(%rbp)
.L22:
	movl	-264(%rbp), %eax
	cmpl	%eax, -260(%rbp)
	jl	.L23
	addl	$1, -252(%rbp)
	movq	-240(%rbp), %rax
	subq	-232(%rbp), %rax
	movq	%rax, -248(%rbp)
	movq	-248(%rbp), %rdx
	movl	-252(%rbp), %eax
	cltq
	movq	%rdx, -176(%rbp,%rax,8)
.L8:
	cmpq	$1, -224(%rbp)
	jne	.L24
	leaq	-264(%rbp), %rdx
	leaq	-248(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L25
.L29:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L27
	call	__stack_chk_fail@PLT
.L27:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC2:
	.long	0
	.long	1076101120
	.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	"%ld %d"
.LC1:
	.string	"%d %ld %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$288, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -224(%rbp)
	leaq	-264(%rbp), %rdx
	leaq	-248(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
.L25:
	movq	-248(%rbp), %rax
	testq	%rax, %rax
	jne	.L2
	movl	-264(%rbp), %eax
	testl	%eax, %eax
	je	.L29
.L2:
	movq	$0, -240(%rbp)
	movq	$0, -232(%rbp)
	movq	$0, -216(%rbp)
	movl	$0, -252(%rbp)
	movq	$0, -224(%rbp)
	movl	$0, -260(%rbp)
	jmp	.L4
.L5:
	movl	-260(%rbp), %eax
	cltq
	movq	$0, -176(%rbp,%rax,8)
	addl	$1, -260(%rbp)
.L4:
	cmpl	$19, -260(%rbp)
	jle	.L5
	movl	$0, -260(%rbp)
	jmp	.L6
.L7:
	movl	-260(%rbp), %eax
	cltq
	movl	$0, -208(%rbp,%rax,4)
	addl	$1, -260(%rbp)
.L6:
	movl	-264(%rbp), %eax
	cmpl	%eax, -260(%rbp)
	jl	.L7
	jmp	.L8
.L24:
	movq	$0, -240(%rbp)
	movq	$0, -232(%rbp)
	cmpl	$0, -252(%rbp)
	jne	.L9
	movq	-248(%rbp), %rdx
	movl	-252(%rbp), %eax
	cltq
	movq	%rdx, -176(%rbp,%rax,8)
	jmp	.L10
.L9:
	movl	$0, -260(%rbp)
	jmp	.L11
.L14:
	movl	-260(%rbp), %eax
	cltq
	movq	-176(%rbp,%rax,8), %rdx
	movq	-248(%rbp), %rax
	cmpq	%rax, %rdx
	je	.L12
	cmpl	$18, -260(%rbp)
	jle	.L13
.L12:
	movl	-252(%rbp), %eax
	subl	-260(%rbp), %eax
	movl	%eax, %ecx
	movl	-260(%rbp), %eax
	cltq
	movq	-176(%rbp,%rax,8), %rdx
	movl	-260(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	$1, -224(%rbp)
	jmp	.L10
.L13:
	addl	$1, -260(%rbp)
.L11:
	movl	-260(%rbp), %eax
	cmpl	-252(%rbp), %eax
	jl	.L14
.L10:
	movl	$0, -260(%rbp)
	jmp	.L15
.L16:
	movq	-248(%rbp), %rcx
	movabsq	$7378697629483820647, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	movq	%rdx, %rax
	sarq	$2, %rax
	movq	%rcx, %rsi
	sarq	$63, %rsi
	subq	%rsi, %rax
	movq	%rax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	subq	%rax, %rcx
	movq	%rcx, %rdx
	movl	-260(%rbp), %eax
	cltq
	movl	%edx, -208(%rbp,%rax,4)
	movq	-248(%rbp), %rcx
	movabsq	$7378697629483820647, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	movq	%rdx, %rax
	sarq	$2, %rax
	sarq	$63, %rcx
	movq	%rcx, %rdx
	subq	%rdx, %rax
	movq	%rax, -248(%rbp)
	addl	$1, -260(%rbp)
.L15:
	movl	-264(%rbp), %eax
	cmpl	%eax, -260(%rbp)
	jl	.L16
	movl	$0, -260(%rbp)
	jmp	.L17
.L21:
	movl	-260(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -256(%rbp)
	jmp	.L18
.L20:
	movl	-260(%rbp), %eax
	cltq
	movl	-208(%rbp,%rax,4), %edx
	movl	-256(%rbp), %eax
	cltq
	movl	-208(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jge	.L19
	movl	-260(%rbp), %eax
	cltq
	movl	-208(%rbp,%rax,4), %eax
	cltq
	movq	%rax, -216(%rbp)
	movl	-256(%rbp), %eax
	cltq
	movl	-208(%rbp,%rax,4), %edx
	movl	-260(%rbp), %eax
	cltq
	movl	%edx, -208(%rbp,%rax,4)
	movq	-216(%rbp), %rax
	movl	%eax, %edx
	movl	-256(%rbp), %eax
	cltq
	movl	%edx, -208(%rbp,%rax,4)
.L19:
	addl	$1, -256(%rbp)
.L18:
	movl	-264(%rbp), %eax
	cmpl	%eax, -256(%rbp)
	jl	.L20
	addl	$1, -260(%rbp)
.L17:
	movl	-264(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -260(%rbp)
	jl	.L21
	movl	$0, -260(%rbp)
	jmp	.L22
.L23:
	movl	-260(%rbp), %eax
	cltq
	movl	-208(%rbp,%rax,4), %eax
	pxor	%xmm2, %xmm2
	cvtsi2sdl	%eax, %xmm2
	movsd	%xmm2, -280(%rbp)
	movl	-264(%rbp), %eax
	subl	-260(%rbp), %eax
	subl	$1, %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movq	.LC2(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movsd	-280(%rbp), %xmm1
	mulsd	%xmm0, %xmm1
	pxor	%xmm0, %xmm0
	cvtsi2sdq	-240(%rbp), %xmm0
	addsd	%xmm1, %xmm0
	cvttsd2siq	%xmm0, %rax
	movq	%rax, -240(%rbp)
	movl	-260(%rbp), %eax
	cltq
	movl	-208(%rbp,%rax,4), %eax
	pxor	%xmm3, %xmm3
	cvtsi2sdl	%eax, %xmm3
	movsd	%xmm3, -280(%rbp)
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-260(%rbp), %xmm0
	movq	.LC2(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movsd	-280(%rbp), %xmm1
	mulsd	%xmm0, %xmm1
	pxor	%xmm0, %xmm0
	cvtsi2sdq	-232(%rbp), %xmm0
	addsd	%xmm1, %xmm0
	cvttsd2siq	%xmm0, %rax
	movq	%rax, -232(%rbp)
	addl	$1, -260(%rbp)
.L22:
	movl	-264(%rbp), %eax
	cmpl	%eax, -260(%rbp)
	jl	.L23
	addl	$1, -252(%rbp)
	movq	-240(%rbp), %rax
	subq	-232(%rbp), %rax
	movq	%rax, -248(%rbp)
	movq	-248(%rbp), %rdx
	movl	-252(%rbp), %eax
	cltq
	movq	%rdx, -176(%rbp,%rax,8)
.L8:
	cmpq	$1, -224(%rbp)
	jne	.L24
	leaq	-264(%rbp), %rdx
	leaq	-248(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L25
.L29:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L27
	call	__stack_chk_fail@PLT
.L27:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC2:
	.long	0
	.long	1076101120
	.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:
