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>

char s[100000];
int n;

void num_to_char( char *s, int *n, int num )
{
	if ( num / 10 > 0 ) num_to_char( s, n, num / 10 );
	s[(*n)++] = '0' + num % 10;
}

int main(void)
{
	int sn;
	int cn;
	char s2[100000];
	int s2n;
	
	while ( 1 ) {
		
		scanf( "%d", &n );
		if ( n == 0 ) break;
		scanf( "%s", s );
		
		while ( n-- ) {
		
			sn = 0;
			s2n = 0;
			cn = 1;
			while ( s[sn] != '\0' ) {
				
				if ( s[sn] == s[sn+1] ) cn++;
				else {
					num_to_char( s2, &s2n, cn );
					s2[s2n++] = s[sn];
					cn = 1;
				}
				
				sn++;
			}
			
			s2[s2n] = '\0';
			
			strcpy( s, s2 );
		}
		
		printf( "%s", s );
		putchar( '\n' );
	}
	
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	s
	.bss
	.align 32
	.type	s, @object
	.size	s, 100000
s:
	.zero	100000
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.text
	.globl	num_to_char
	.type	num_to_char, @function
num_to_char:
.LFB0:
	.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)
	movl	%edx, -20(%rbp)
	cmpl	$9, -20(%rbp)
	jle	.L2
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	subl	%eax, %edx
	movq	-16(%rbp), %rcx
	movq	-8(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	num_to_char
.L2:
	movl	-20(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%edx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %ecx
	movl	%ecx, %eax
	sall	$2, %eax
	addl	%ecx, %eax
	addl	%eax, %eax
	movl	%edx, %ecx
	subl	%eax, %ecx
	movl	%ecx, %eax
	leal	48(%rax), %esi
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	leal	1(%rax), %ecx
	movq	-16(%rbp), %rdx
	movl	%ecx, (%rdx)
	movslq	%eax, %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	movl	%esi, %edx
	movb	%dl, (%rax)
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	num_to_char, .-num_to_char
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
	.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
	leaq	-98304(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1728, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L12:
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	n(%rip), %eax
	testl	%eax, %eax
	je	.L16
	leaq	s(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L6
.L11:
	movl	$0, -100024(%rbp)
	movl	$0, -100028(%rbp)
	movl	$1, -100020(%rbp)
	jmp	.L7
.L10:
	movl	-100024(%rbp), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %edx
	movl	-100024(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	s(%rip), %rcx
	movzbl	(%rax,%rcx), %eax
	cmpb	%al, %dl
	jne	.L8
	addl	$1, -100020(%rbp)
	jmp	.L9
.L8:
	movl	-100020(%rbp), %edx
	leaq	-100028(%rbp), %rcx
	leaq	-100016(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	num_to_char
	movl	-100028(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -100028(%rbp)
	movl	-100024(%rbp), %edx
	movslq	%edx, %rdx
	leaq	s(%rip), %rcx
	movzbl	(%rdx,%rcx), %edx
	cltq
	movb	%dl, -100016(%rbp,%rax)
	movl	$1, -100020(%rbp)
.L9:
	addl	$1, -100024(%rbp)
.L7:
	movl	-100024(%rbp), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	jne	.L10
	movl	-100028(%rbp), %eax
	cltq
	movb	$0, -100016(%rbp,%rax)
	leaq	-100016(%rbp), %rax
	movq	%rax, %rsi
	leaq	s(%rip), %rax
	movq	%rax, %rdi
	call	strcpy@PLT
.L6:
	movl	n(%rip), %eax
	leal	-1(%rax), %edx
	movl	%edx, n(%rip)
	testl	%eax, %eax
	jne	.L11
	leaq	s(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L12
.L16:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	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	num_to_char
	.type	num_to_char, @function
num_to_char:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%rsi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movslq	%edx, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rbp, %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	cmpl	$9, %ebp
	jg	.L10
.L2:
	movl	(%r12), %eax
	movl	%ebx, %ecx
	sarl	$31, %ecx
	leal	1(%rax), %edx
	movl	%edx, (%r12)
	movslq	%eax, %rdx
	imulq	$1717986919, %rbp, %rax
	sarq	$34, %rax
	subl	%ecx, %eax
	leal	(%rax,%rax,4), %eax
	addl	%eax, %eax
	subl	%eax, %ebx
	addl	$48, %ebx
	movb	%bl, (%rdi,%rdx)
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L10:
	.cfi_restore_state
	imulq	$1717986919, %rbp, %r14
	movl	%ebp, %eax
	sarl	$31, %eax
	sarq	$34, %r14
	subl	%eax, %r14d
	movl	%r14d, %r15d
	cmpl	$99, %ebp
	jg	.L11
.L3:
	movl	(%r12), %eax
	leal	1(%rax), %edx
	movl	%edx, (%r12)
	movslq	%eax, %rdx
	movl	$3435973837, %eax
	imulq	%r15, %rax
	shrq	$35, %rax
	leal	(%rax,%rax,4), %eax
	addl	%eax, %eax
	subl	%eax, %r14d
	addl	$48, %r14d
	movb	%r14b, (%rdi,%rdx)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L11:
	movl	$3435973837, %edx
	movq	%r15, %rax
	imulq	%rdx, %rax
	shrq	$35, %rax
	movl	%eax, %r13d
	cmpl	$999, %ebp
	jg	.L12
.L4:
	movl	(%r12), %edx
	leal	1(%rdx), %esi
	movl	%esi, (%r12)
	movslq	%edx, %rsi
	movl	$3435973837, %edx
	imulq	%r13, %rdx
	shrq	$35, %rdx
	leal	(%rdx,%rdx,4), %edx
	addl	%edx, %edx
	subl	%edx, %eax
	addl	$48, %eax
	movb	%al, (%rdi,%rsi)
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L12:
	imulq	%r13, %rdx
	movl	%eax, 12(%rsp)
	movq	%rdi, (%rsp)
	shrq	$35, %rdx
	call	num_to_char
	movl	12(%rsp), %eax
	movq	(%rsp), %rdi
	jmp	.L4
	.cfi_endproc
.LFE35:
	.size	num_to_char, .-num_to_char
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB36:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	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
	leaq	-98304(%rsp), %r11
	.cfi_def_cfa 11, 98360
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1784, %rsp
	.cfi_def_cfa_offset 100144
	leaq	s(%rip), %r15
	movl	$3435973837, %r14d
	movq	%fs:40, %rax
	movq	%rax, 100072(%rsp)
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L16:
	leaq	n(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	n(%rip), %eax
	testl	%eax, %eax
	je	.L14
	movq	%r15, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	n(%rip), %eax
	leaq	64(%rsp), %r13
	movq	%r13, %r12
	leal	-1(%rax), %edx
	movl	%edx, n(%rip)
	testl	%eax, %eax
	je	.L34
	.p2align 4,,10
	.p2align 3
.L15:
	movzbl	(%r15), %eax
	movl	$0, 60(%rsp)
	testb	%al, %al
	je	.L36
	leaq	1+s(%rip), %r9
.L43:
	movzbl	(%r9), %ecx
	movl	$1, %r13d
	cmpb	%al, %cl
	jne	.L18
.L44:
	movzbl	1(%r9), %ecx
	addq	$1, %r9
	addl	$1, %r13d
	cmpb	%al, %cl
	je	.L44
.L18:
	cmpl	$9, %r13d
	jg	.L20
	movl	60(%rsp), %esi
	movl	%eax, %edx
	movl	%r13d, %r8d
	movl	%ecx, %eax
.L21:
	imulq	%r14, %r8
	movslq	%esi, %rdi
	addq	$1, %r9
	shrq	$35, %r8
	leal	(%r8,%r8,4), %r8d
	addl	%r8d, %r8d
	subl	%r8d, %r13d
	addl	$48, %r13d
	movb	%r13b, 64(%rsp,%rdi)
	leal	2(%rsi), %edi
	addl	$1, %esi
	movslq	%esi, %rsi
	movl	%edi, 60(%rsp)
	movb	%dl, 64(%rsp,%rsi)
	testb	%cl, %cl
	jne	.L43
	movl	n(%rip), %ebx
.L17:
	movslq	%edi, %rdi
	movl	$100000, %edx
	movq	%r12, %rsi
	movb	$0, 64(%rsp,%rdi)
	movq	%r15, %rdi
	call	__strcpy_chk@PLT
	leal	-1(%rbx), %edx
	movl	%edx, n(%rip)
	testl	%ebx, %ebx
	jne	.L15
.L34:
	movq	%r15, %rdx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	stdout(%rip), %rsi
	movl	$10, %edi
	call	putc@PLT
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L20:
	movl	%r13d, %r8d
	movq	%r8, %r10
	imulq	%r14, %r10
	shrq	$35, %r10
	cmpl	$99, %r13d
	jg	.L22
	movl	60(%rsp), %edi
	movl	%eax, %edx
	movl	%r10d, %r11d
	movl	%ecx, %eax
.L23:
	imulq	%r14, %r11
	leal	1(%rdi), %esi
	movslq	%edi, %rdi
	shrq	$35, %r11
	leal	(%r11,%r11,4), %r11d
	addl	%r11d, %r11d
	subl	%r11d, %r10d
	addl	$48, %r10d
	movb	%r10b, 64(%rsp,%rdi)
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L22:
	movl	%r10d, %r11d
	movq	%r11, %rdx
	imulq	%r14, %rdx
	shrq	$35, %rdx
	movl	%edx, (%rsp)
	movq	%rdx, %rbx
	cmpl	$999, %r13d
	jg	.L24
	movl	60(%rsp), %esi
	movl	%eax, %edx
	movl	%ebx, %ebx
	movl	%ecx, %eax
.L25:
	imulq	%r14, %rbx
	leal	1(%rsi), %edi
	movslq	%esi, %rsi
	shrq	$35, %rbx
	leal	(%rbx,%rbx,4), %ebp
	movl	(%rsp), %ebx
	addl	%ebp, %ebp
	subl	%ebp, %ebx
	addl	$48, %ebx
	movb	%bl, 64(%rsp,%rsi)
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L24:
	movl	(%rsp), %ebx
	movq	%rbx, %rdx
	imulq	%r14, %rdx
	shrq	$35, %rdx
	movl	%edx, 4(%rsp)
	movq	%rdx, %rsi
	cmpl	$9999, %r13d
	jg	.L26
	movl	%esi, %esi
	movl	60(%rsp), %edi
	movl	%eax, %edx
	movl	%ecx, %eax
	movq	%rsi, 16(%rsp)
.L27:
	leal	1(%rdi), %esi
	movslq	%edi, %rdi
	movq	%rdi, 8(%rsp)
	movq	16(%rsp), %rdi
	imulq	%r14, %rdi
	shrq	$35, %rdi
	leal	(%rdi,%rdi,4), %ebp
	movl	4(%rsp), %edi
	addl	%ebp, %ebp
	subl	%ebp, %edi
	movq	8(%rsp), %rbp
	addl	$48, %edi
	movb	%dil, 64(%rsp,%rbp)
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L36:
	movl	%edx, %ebx
	xorl	%edi, %edi
	jmp	.L17
.L26:
	movl	4(%rsp), %edx
	movq	%rdx, 16(%rsp)
	imulq	%r14, %rdx
	shrq	$35, %rdx
	movl	%edx, 8(%rsp)
	movq	%rdx, %rdi
	cmpl	$99999, %r13d
	jg	.L28
	movl	%edi, %edi
	movl	60(%rsp), %esi
	movl	%eax, %edx
	movl	%ecx, %eax
	movq	%rdi, 32(%rsp)
.L29:
	leal	1(%rsi), %edi
	movslq	%esi, %rsi
	movl	8(%rsp), %ebp
	movq	%rsi, 24(%rsp)
	movq	32(%rsp), %rsi
	imulq	%r14, %rsi
	shrq	$35, %rsi
	leal	(%rsi,%rsi,4), %esi
	addl	%esi, %esi
	subl	%esi, %ebp
	movl	%ebp, %esi
	movq	24(%rsp), %rbp
	addl	$48, %esi
	movb	%sil, 64(%rsp,%rbp)
	jmp	.L27
.L14:
	movq	100072(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L45
	addq	$100088, %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
.L28:
	.cfi_restore_state
	movl	8(%rsp), %edx
	movl	60(%rsp), %edi
	movq	%rdx, 32(%rsp)
	imulq	%r14, %rdx
	shrq	$35, %rdx
	movq	%rdx, %rbp
	cmpl	$999999, %r13d
	jg	.L46
.L30:
	movl	%ebp, %edx
	leal	1(%rdi), %esi
	movslq	%edi, %rdi
	imulq	%r14, %rdx
	shrq	$35, %rdx
	leal	(%rdx,%rdx,4), %edx
	addl	%edx, %edx
	subl	%edx, %ebp
	movl	%ebp, %edx
	addl	$48, %edx
	movb	%dl, 64(%rsp,%rdi)
	movl	%eax, %edx
	movl	%ecx, %eax
	jmp	.L29
.L46:
	movl	%edx, %eax
	movl	$10, %esi
	cltd
	idivl	%esi
	movl	%eax, 24(%rsp)
	cmpl	$9999999, %r13d
	jg	.L47
.L31:
	movl	60(%rsp), %edi
	movl	$10, %esi
	movslq	%edi, %rax
	addl	$1, %edi
	movq	%rax, 40(%rsp)
	movl	24(%rsp), %eax
	movl	%edi, 60(%rsp)
	cltd
	idivl	%esi
	movl	%edx, %eax
	movq	40(%rsp), %rdx
	addl	$48, %eax
	movb	%al, 64(%rsp,%rdx)
	movzbl	-1(%r9), %eax
	jmp	.L30
.L47:
	cltd
	movq	%r12, %rdi
	idivl	%esi
	leaq	60(%rsp), %rsi
	movl	%eax, %edx
	call	num_to_char
	movzbl	(%r9), %ecx
	jmp	.L31
.L45:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE36:
	.size	main, .-main
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 100000
s:
	.zero	100000
	.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	num_to_char
	.type	num_to_char, @function
num_to_char:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%rsi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movslq	%edx, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rbp, %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	cmpl	$9, %ebp
	jg	.L10
.L2:
	movl	(%r12), %eax
	movl	%ebx, %ecx
	sarl	$31, %ecx
	leal	1(%rax), %edx
	movl	%edx, (%r12)
	movslq	%eax, %rdx
	imulq	$1717986919, %rbp, %rax
	sarq	$34, %rax
	subl	%ecx, %eax
	leal	(%rax,%rax,4), %eax
	addl	%eax, %eax
	subl	%eax, %ebx
	addl	$48, %ebx
	movb	%bl, (%rdi,%rdx)
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L10:
	.cfi_restore_state
	imulq	$1717986919, %rbp, %r14
	movl	%ebp, %eax
	sarl	$31, %eax
	sarq	$34, %r14
	subl	%eax, %r14d
	movl	%r14d, %r15d
	cmpl	$99, %ebp
	jg	.L11
.L3:
	movl	(%r12), %eax
	leal	1(%rax), %edx
	movl	%edx, (%r12)
	movslq	%eax, %rdx
	movl	$3435973837, %eax
	imulq	%r15, %rax
	shrq	$35, %rax
	leal	(%rax,%rax,4), %eax
	addl	%eax, %eax
	subl	%eax, %r14d
	addl	$48, %r14d
	movb	%r14b, (%rdi,%rdx)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L11:
	movl	$3435973837, %edx
	movq	%r15, %rax
	imulq	%rdx, %rax
	shrq	$35, %rax
	movl	%eax, %r13d
	cmpl	$999, %ebp
	jg	.L12
.L4:
	movl	(%r12), %edx
	leal	1(%rdx), %esi
	movl	%esi, (%r12)
	movslq	%edx, %rsi
	movl	$3435973837, %edx
	imulq	%r13, %rdx
	shrq	$35, %rdx
	leal	(%rdx,%rdx,4), %edx
	addl	%edx, %edx
	subl	%edx, %eax
	addl	$48, %eax
	movb	%al, (%rdi,%rsi)
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L12:
	imulq	%r13, %rdx
	movl	%eax, 12(%rsp)
	movq	%rdi, (%rsp)
	shrq	$35, %rdx
	call	num_to_char
	movl	12(%rsp), %eax
	movq	(%rsp), %rdi
	jmp	.L4
	.cfi_endproc
.LFE35:
	.size	num_to_char, .-num_to_char
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB36:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	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
	leaq	-98304(%rsp), %r11
	.cfi_def_cfa 11, 98360
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1784, %rsp
	.cfi_def_cfa_offset 100144
	leaq	s(%rip), %r15
	movl	$3435973837, %r14d
	movq	%fs:40, %rax
	movq	%rax, 100072(%rsp)
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L16:
	leaq	n(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	n(%rip), %eax
	testl	%eax, %eax
	je	.L14
	movq	%r15, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	n(%rip), %eax
	leaq	64(%rsp), %r13
	movq	%r13, %r12
	leal	-1(%rax), %edx
	movl	%edx, n(%rip)
	testl	%eax, %eax
	je	.L34
	.p2align 4,,10
	.p2align 3
.L15:
	movzbl	(%r15), %eax
	movl	$0, 60(%rsp)
	testb	%al, %al
	je	.L36
	leaq	1+s(%rip), %r9
.L43:
	movzbl	(%r9), %ecx
	movl	$1, %r13d
	cmpb	%al, %cl
	jne	.L18
.L44:
	movzbl	1(%r9), %ecx
	addq	$1, %r9
	addl	$1, %r13d
	cmpb	%al, %cl
	je	.L44
.L18:
	cmpl	$9, %r13d
	jg	.L20
	movl	60(%rsp), %esi
	movl	%eax, %edx
	movl	%r13d, %r8d
	movl	%ecx, %eax
.L21:
	imulq	%r14, %r8
	movslq	%esi, %rdi
	addq	$1, %r9
	shrq	$35, %r8
	leal	(%r8,%r8,4), %r8d
	addl	%r8d, %r8d
	subl	%r8d, %r13d
	addl	$48, %r13d
	movb	%r13b, 64(%rsp,%rdi)
	leal	2(%rsi), %edi
	addl	$1, %esi
	movslq	%esi, %rsi
	movl	%edi, 60(%rsp)
	movb	%dl, 64(%rsp,%rsi)
	testb	%cl, %cl
	jne	.L43
	movl	n(%rip), %ebx
.L17:
	movslq	%edi, %rdi
	movl	$100000, %edx
	movq	%r12, %rsi
	movb	$0, 64(%rsp,%rdi)
	movq	%r15, %rdi
	call	__strcpy_chk@PLT
	leal	-1(%rbx), %edx
	movl	%edx, n(%rip)
	testl	%ebx, %ebx
	jne	.L15
.L34:
	movq	%r15, %rdx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	stdout(%rip), %rsi
	movl	$10, %edi
	call	putc@PLT
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L20:
	movl	%r13d, %r8d
	movq	%r8, %r10
	imulq	%r14, %r10
	shrq	$35, %r10
	cmpl	$99, %r13d
	jg	.L22
	movl	60(%rsp), %edi
	movl	%eax, %edx
	movl	%r10d, %r11d
	movl	%ecx, %eax
.L23:
	imulq	%r14, %r11
	leal	1(%rdi), %esi
	movslq	%edi, %rdi
	shrq	$35, %r11
	leal	(%r11,%r11,4), %r11d
	addl	%r11d, %r11d
	subl	%r11d, %r10d
	addl	$48, %r10d
	movb	%r10b, 64(%rsp,%rdi)
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L22:
	movl	%r10d, %r11d
	movq	%r11, %rdx
	imulq	%r14, %rdx
	shrq	$35, %rdx
	movl	%edx, (%rsp)
	movq	%rdx, %rbx
	cmpl	$999, %r13d
	jg	.L24
	movl	60(%rsp), %esi
	movl	%eax, %edx
	movl	%ebx, %ebx
	movl	%ecx, %eax
.L25:
	imulq	%r14, %rbx
	leal	1(%rsi), %edi
	movslq	%esi, %rsi
	shrq	$35, %rbx
	leal	(%rbx,%rbx,4), %ebp
	movl	(%rsp), %ebx
	addl	%ebp, %ebp
	subl	%ebp, %ebx
	addl	$48, %ebx
	movb	%bl, 64(%rsp,%rsi)
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L24:
	movl	(%rsp), %ebx
	movq	%rbx, %rdx
	imulq	%r14, %rdx
	shrq	$35, %rdx
	movl	%edx, 4(%rsp)
	movq	%rdx, %rsi
	cmpl	$9999, %r13d
	jg	.L26
	movl	%esi, %esi
	movl	60(%rsp), %edi
	movl	%eax, %edx
	movl	%ecx, %eax
	movq	%rsi, 16(%rsp)
.L27:
	leal	1(%rdi), %esi
	movslq	%edi, %rdi
	movq	%rdi, 8(%rsp)
	movq	16(%rsp), %rdi
	imulq	%r14, %rdi
	shrq	$35, %rdi
	leal	(%rdi,%rdi,4), %ebp
	movl	4(%rsp), %edi
	addl	%ebp, %ebp
	subl	%ebp, %edi
	movq	8(%rsp), %rbp
	addl	$48, %edi
	movb	%dil, 64(%rsp,%rbp)
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L36:
	movl	%edx, %ebx
	xorl	%edi, %edi
	jmp	.L17
.L26:
	movl	4(%rsp), %edx
	movq	%rdx, 16(%rsp)
	imulq	%r14, %rdx
	shrq	$35, %rdx
	movl	%edx, 8(%rsp)
	movq	%rdx, %rdi
	cmpl	$99999, %r13d
	jg	.L28
	movl	%edi, %edi
	movl	60(%rsp), %esi
	movl	%eax, %edx
	movl	%ecx, %eax
	movq	%rdi, 32(%rsp)
.L29:
	leal	1(%rsi), %edi
	movslq	%esi, %rsi
	movl	8(%rsp), %ebp
	movq	%rsi, 24(%rsp)
	movq	32(%rsp), %rsi
	imulq	%r14, %rsi
	shrq	$35, %rsi
	leal	(%rsi,%rsi,4), %esi
	addl	%esi, %esi
	subl	%esi, %ebp
	movl	%ebp, %esi
	movq	24(%rsp), %rbp
	addl	$48, %esi
	movb	%sil, 64(%rsp,%rbp)
	jmp	.L27
.L14:
	movq	100072(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L45
	addq	$100088, %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
.L28:
	.cfi_restore_state
	movl	8(%rsp), %edx
	movl	60(%rsp), %edi
	movq	%rdx, 32(%rsp)
	imulq	%r14, %rdx
	shrq	$35, %rdx
	movq	%rdx, %rbp
	cmpl	$999999, %r13d
	jg	.L46
.L30:
	movl	%ebp, %edx
	leal	1(%rdi), %esi
	movslq	%edi, %rdi
	imulq	%r14, %rdx
	shrq	$35, %rdx
	leal	(%rdx,%rdx,4), %edx
	addl	%edx, %edx
	subl	%edx, %ebp
	movl	%ebp, %edx
	addl	$48, %edx
	movb	%dl, 64(%rsp,%rdi)
	movl	%eax, %edx
	movl	%ecx, %eax
	jmp	.L29
.L46:
	movl	%edx, %eax
	movl	$10, %esi
	cltd
	idivl	%esi
	movl	%eax, 24(%rsp)
	cmpl	$9999999, %r13d
	jg	.L47
.L31:
	movl	60(%rsp), %edi
	movl	$10, %esi
	movslq	%edi, %rax
	addl	$1, %edi
	movq	%rax, 40(%rsp)
	movl	24(%rsp), %eax
	movl	%edi, 60(%rsp)
	cltd
	idivl	%esi
	movl	%edx, %eax
	movq	40(%rsp), %rdx
	addl	$48, %eax
	movb	%al, 64(%rsp,%rdx)
	movzbl	-1(%r9), %eax
	jmp	.L30
.L47:
	cltd
	movq	%r12, %rdi
	idivl	%esi
	leaq	60(%rsp), %rsi
	movl	%eax, %edx
	call	num_to_char
	movzbl	(%r9), %ecx
	jmp	.L31
.L45:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE36:
	.size	main, .-main
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 100000
s:
	.zero	100000
	.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>

char s[100000];
int n;

void num_to_char( char *s, int *n, int num )
{
	if ( num / 10 > 0 ) num_to_char( s, n, num / 10 );
	s[(*n)++] = '0' + num % 10;
}

int main(void)
{
	int sn;
	int cn;
	char s2[100000];
	int s2n;
	
	while ( 1 ) {
		
		scanf( "%d", &n );
		if ( n == 0 ) break;
		scanf( "%s", s );
		
		while ( n-- ) {
		
			sn = 0;
			s2n = 0;
			cn = 1;
			while ( s[sn] != '\0' ) {
				
				if ( s[sn] == s[sn+1] ) cn++;
				else {
					num_to_char( s2, &s2n, cn );
					s2[s2n++] = s[sn];
					cn = 1;
				}
				
				sn++;
			}
			
			s2[s2n] = '\0';
			
			strcpy( s, s2 );
		}
		
		printf( "%s", s );
		putchar( '\n' );
	}
	
	return 0;
}
5
11
5
21
0
 5
18
5
21
0
 5
18
5
1
0
 5
18
6
1
0
 5
28
6
1
0
 5
28
11
1
0
 5
28
3
1
0
 5
43
3
1
0
 5
43
3
0
0
 5
11
5
15
0

13112221
1113213211
 311311222118
1113213211
 311311222118
312211
 311311222118
13112221
 11131221121113122118
13112221
 11131221121113122118
3113112221232112111312211312113211
 11131221121113122118
1211
 11131221141113122113
1211
 11131221141113122113
3110
 13112221
311311222115

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>

char s[100000];
int n;

void num_to_char( char *s, int *n, int num )
{
	if ( num / 10 > 0 ) num_to_char( s, n, num / 10 );
	s[(*n)++] = '0' + num % 10;
}

int main(void)
{
	int sn;
	int cn;
	char s2[100000];
	int s2n;
	
	while ( 1 ) {
		
		scanf( "%d", &n );
		if ( n == 0 ) break;
		scanf( "%s", s );
		
		while ( n-- ) {
		
			sn = 0;
			s2n = 0;
			cn = 1;
			while ( s[sn] != '\0' ) {
				
				if ( s[sn] == s[sn+1] ) cn++;
				else {
					num_to_char( s2, &s2n, cn );
					s2[s2n++] = s[sn];
					cn = 1;
				}
				
				sn++;
			}
			
			s2[s2n] = '\0';
			
			strcpy( s, s2 );
		}
		
		printf( "%s", s );
		putchar( '\n' );
	}
	
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	s
	.bss
	.align 32
	.type	s, @object
	.size	s, 100000
s:
	.zero	100000
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.text
	.globl	num_to_char
	.type	num_to_char, @function
num_to_char:
.LFB0:
	.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)
	movl	%edx, -20(%rbp)
	cmpl	$9, -20(%rbp)
	jle	.L2
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	subl	%eax, %edx
	movq	-16(%rbp), %rcx
	movq	-8(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	num_to_char
.L2:
	movl	-20(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%edx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %ecx
	movl	%ecx, %eax
	sall	$2, %eax
	addl	%ecx, %eax
	addl	%eax, %eax
	movl	%edx, %ecx
	subl	%eax, %ecx
	movl	%ecx, %eax
	leal	48(%rax), %esi
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	leal	1(%rax), %ecx
	movq	-16(%rbp), %rdx
	movl	%ecx, (%rdx)
	movslq	%eax, %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	movl	%esi, %edx
	movb	%dl, (%rax)
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	num_to_char, .-num_to_char
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
	.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
	leaq	-98304(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1728, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L12:
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	n(%rip), %eax
	testl	%eax, %eax
	je	.L16
	leaq	s(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L6
.L11:
	movl	$0, -100024(%rbp)
	movl	$0, -100028(%rbp)
	movl	$1, -100020(%rbp)
	jmp	.L7
.L10:
	movl	-100024(%rbp), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %edx
	movl	-100024(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	s(%rip), %rcx
	movzbl	(%rax,%rcx), %eax
	cmpb	%al, %dl
	jne	.L8
	addl	$1, -100020(%rbp)
	jmp	.L9
.L8:
	movl	-100020(%rbp), %edx
	leaq	-100028(%rbp), %rcx
	leaq	-100016(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	num_to_char
	movl	-100028(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -100028(%rbp)
	movl	-100024(%rbp), %edx
	movslq	%edx, %rdx
	leaq	s(%rip), %rcx
	movzbl	(%rdx,%rcx), %edx
	cltq
	movb	%dl, -100016(%rbp,%rax)
	movl	$1, -100020(%rbp)
.L9:
	addl	$1, -100024(%rbp)
.L7:
	movl	-100024(%rbp), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	jne	.L10
	movl	-100028(%rbp), %eax
	cltq
	movb	$0, -100016(%rbp,%rax)
	leaq	-100016(%rbp), %rax
	movq	%rax, %rsi
	leaq	s(%rip), %rax
	movq	%rax, %rdi
	call	strcpy@PLT
.L6:
	movl	n(%rip), %eax
	leal	-1(%rax), %edx
	movl	%edx, n(%rip)
	testl	%eax, %eax
	jne	.L11
	leaq	s(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L12
.L16:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	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	s
	.bss
	.align 32
	.type	s, @object
	.size	s, 100000
s:
	.zero	100000
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.text
	.globl	num_to_char
	.type	num_to_char, @function
num_to_char:
.LFB0:
	.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)
	movl	%edx, -20(%rbp)
	cmpl	$9, -20(%rbp)
	jle	.L2
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	subl	%eax, %edx
	movq	-16(%rbp), %rcx
	movq	-8(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	num_to_char
.L2:
	movl	-20(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%edx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %ecx
	movl	%ecx, %eax
	sall	$2, %eax
	addl	%ecx, %eax
	addl	%eax, %eax
	movl	%edx, %ecx
	subl	%eax, %ecx
	movl	%ecx, %eax
	leal	48(%rax), %esi
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	leal	1(%rax), %ecx
	movq	-16(%rbp), %rdx
	movl	%ecx, (%rdx)
	movslq	%eax, %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	movl	%esi, %edx
	movb	%dl, (%rax)
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	num_to_char, .-num_to_char
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
	.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
	leaq	-98304(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1728, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L12:
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	n(%rip), %eax
	testl	%eax, %eax
	je	.L16
	leaq	s(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L6
.L11:
	movl	$0, -100024(%rbp)
	movl	$0, -100028(%rbp)
	movl	$1, -100020(%rbp)
	jmp	.L7
.L10:
	movl	-100024(%rbp), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %edx
	movl	-100024(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	s(%rip), %rcx
	movzbl	(%rax,%rcx), %eax
	cmpb	%al, %dl
	jne	.L8
	addl	$1, -100020(%rbp)
	jmp	.L9
.L8:
	movl	-100020(%rbp), %edx
	leaq	-100028(%rbp), %rcx
	leaq	-100016(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	num_to_char
	movl	-100028(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -100028(%rbp)
	movl	-100024(%rbp), %edx
	movslq	%edx, %rdx
	leaq	s(%rip), %rcx
	movzbl	(%rdx,%rcx), %edx
	cltq
	movb	%dl, -100016(%rbp,%rax)
	movl	$1, -100020(%rbp)
.L9:
	addl	$1, -100024(%rbp)
.L7:
	movl	-100024(%rbp), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	jne	.L10
	movl	-100028(%rbp), %eax
	cltq
	movb	$0, -100016(%rbp,%rax)
	leaq	-100016(%rbp), %rax
	movq	%rax, %rsi
	leaq	s(%rip), %rax
	movq	%rax, %rdi
	call	strcpy@PLT
.L6:
	movl	n(%rip), %eax
	leal	-1(%rax), %edx
	movl	%edx, n(%rip)
	testl	%eax, %eax
	jne	.L11
	leaq	s(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L12
.L16:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	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:
