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 sign;
char line[100000],line1[100000];
void set(char target[],char setline[]){
    int i=-1,t=0,sum=1;
    while(i++,target[i]){
        if(target[i] == target[i+1])
            sum++;
        else{
            t+=sprintf(setline+t,"%d%c",sum,target[i]);
            sum=1;
        }
    }
    sign=1-sign;
    setline[t]=0;
}
int main(void){
    int num,sum,n,i;
    for(;i=0,sign=1,scanf("%d",&num),num;){
        scanf("%c",&line[0]);
        fgets(line,1000000,stdin);
        while(line[i++])
            if(line[i] == '\n'){
                line[i]=0;
                break;
            }
        for(sum=0;sum!=num;sum++)sign?set(line,line1):set(line1,line);
        printf("%s\n",sign?line:line1);
    }
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	sign
	.bss
	.align 4
	.type	sign, @object
	.size	sign, 4
sign:
	.zero	4
	.globl	line
	.align 32
	.type	line, @object
	.size	line, 100000
line:
	.zero	100000
	.globl	line1
	.align 32
	.type	line1, @object
	.size	line1, 100000
line1:
	.zero	100000
	.section	.rodata
.LC0:
	.string	"%d%c"
	.text
	.globl	set
	.type	set, @function
set:
.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, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movl	$-1, -12(%rbp)
	movl	$0, -8(%rbp)
	movl	$1, -4(%rbp)
	jmp	.L2
.L4:
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %edx
	movl	-12(%rbp), %eax
	cltq
	leaq	1(%rax), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movzbl	(%rax), %eax
	cmpb	%al, %dl
	jne	.L3
	addl	$1, -4(%rbp)
	jmp	.L2
.L3:
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %edx
	movl	-8(%rbp), %eax
	movslq	%eax, %rcx
	movq	-32(%rbp), %rax
	leaq	(%rcx,%rax), %rdi
	movl	-4(%rbp), %eax
	movl	%edx, %ecx
	movl	%eax, %edx
	leaq	.LC0(%rip), %rax
	movq	%rax, %rsi
	movl	$0, %eax
	call	sprintf@PLT
	addl	%eax, -8(%rbp)
	movl	$1, -4(%rbp)
.L2:
	addl	$1, -12(%rbp)
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L4
	movl	sign(%rip), %edx
	movl	$1, %eax
	subl	%edx, %eax
	movl	%eax, sign(%rip)
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movb	$0, (%rax)
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	set, .-set
	.section	.rodata
.LC1:
	.string	"%c"
.LC2:
	.string	"%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	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L6
.L16:
	leaq	line(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	stdin(%rip), %rax
	movq	%rax, %rdx
	movl	$1000000, %esi
	leaq	line(%rip), %rax
	movq	%rax, %rdi
	call	fgets@PLT
	jmp	.L7
.L9:
	movl	-12(%rbp), %eax
	cltq
	leaq	line(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$10, %al
	jne	.L7
	movl	-12(%rbp), %eax
	cltq
	leaq	line(%rip), %rdx
	movb	$0, (%rax,%rdx)
	jmp	.L8
.L7:
	movl	-12(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -12(%rbp)
	cltq
	leaq	line(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	jne	.L9
.L8:
	movl	$0, -16(%rbp)
	jmp	.L10
.L13:
	movl	sign(%rip), %eax
	testl	%eax, %eax
	je	.L11
	leaq	line1(%rip), %rax
	movq	%rax, %rsi
	leaq	line(%rip), %rax
	movq	%rax, %rdi
	call	set
	jmp	.L12
.L11:
	leaq	line(%rip), %rax
	movq	%rax, %rsi
	leaq	line1(%rip), %rax
	movq	%rax, %rdi
	call	set
.L12:
	addl	$1, -16(%rbp)
.L10:
	movl	-20(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jne	.L13
	movl	sign(%rip), %eax
	testl	%eax, %eax
	je	.L14
	leaq	line(%rip), %rax
	jmp	.L15
.L14:
	leaq	line1(%rip), %rax
.L15:
	movq	%rax, %rdi
	call	puts@PLT
.L6:
	movl	$0, -12(%rbp)
	movl	$1, sign(%rip)
	leaq	-20(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-20(%rbp), %eax
	testl	%eax, %eax
	jne	.L16
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%c"
	.text
	.p2align 4
	.globl	set
	.type	set, @function
set:
.LFB23:
	.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
	movq	%rsi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	movsbl	(%rdi), %r9d
	testb	%r9b, %r9b
	je	.L2
	leaq	1(%rdi), %rbx
	movl	$1, %r8d
	xorl	%r13d, %r13d
	leaq	.LC0(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L6:
	cmpb	%r9b, (%rbx)
	jne	.L3
	movsbl	(%rbx), %r9d
	addq	$1, %rbx
	addl	$1, %r8d
	testb	%r9b, %r9b
	jne	.L6
.L5:
	movslq	%r13d, %r13
	addq	%r13, %rbp
.L2:
	movl	$1, %eax
	subl	sign(%rip), %eax
	movl	%eax, sign(%rip)
	movb	$0, 0(%rbp)
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	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
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	movslq	%r13d, %rdi
	movq	%r12, %rcx
	movq	$-1, %rdx
	xorl	%eax, %eax
	addq	%rbp, %rdi
	movl	$1, %esi
	addq	$1, %rbx
	call	__sprintf_chk@PLT
	movsbl	-1(%rbx), %r9d
	addl	%eax, %r13d
	testb	%r9b, %r9b
	je	.L5
	movl	$1, %r8d
	jmp	.L6
	.cfi_endproc
.LFE23:
	.size	set, .-set
	.section	.rodata.str1.1
.LC1:
	.string	"%c"
.LC2:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.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
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	line(%rip), %rbx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L16:
	movq	8(%rsp), %rsi
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rdi
	movl	$1, sign(%rip)
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %eax
	testl	%eax, %eax
	je	.L54
	movq	%rbx, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	stdin(%rip), %rcx
	movl	$1000000, %edx
	movq	%rbx, %rdi
	movl	$100000, %esi
	call	__fgets_chk@PLT
	movzbl	(%rbx), %edx
	movl	$1, %eax
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L20:
	movzbl	(%rbx,%rax), %edx
	addq	$1, %rax
	cmpb	$10, %dl
	je	.L55
.L17:
	movslq	%eax, %rcx
	testb	%dl, %dl
	jne	.L20
.L21:
	movl	20(%rsp), %eax
	movl	sign(%rip), %r14d
	xorl	%r13d, %r13d
	leaq	line1(%rip), %r12
	testl	%eax, %eax
	je	.L19
	.p2align 4,,10
	.p2align 3
.L18:
	testl	%r14d, %r14d
	jne	.L22
	movsbl	(%r12), %r9d
	movl	$1, %r8d
	xorl	%ecx, %ecx
	movq	%rbx, %rdx
	leaq	1+line1(%rip), %r15
	testb	%r9b, %r9b
	je	.L24
	.p2align 4,,10
	.p2align 3
.L34:
	cmpb	%r9b, (%r15)
	jne	.L31
	movsbl	(%r15), %r9d
	addq	$1, %r15
	addl	$1, %r8d
	testb	%r9b, %r9b
	jne	.L34
.L33:
	movslq	%r14d, %rdx
	movl	sign(%rip), %ecx
	movl	20(%rsp), %eax
	addq	%rbx, %rdx
.L24:
	movl	$1, %r11d
	movb	$0, (%rdx)
	subl	%ecx, %r11d
	movl	%r11d, sign(%rip)
	movl	%r11d, %r14d
.L30:
	addl	$1, %r13d
	cmpl	%eax, %r13d
	jne	.L18
.L19:
	testl	%r14d, %r14d
	leaq	line1(%rip), %rdi
	cmovne	%rbx, %rdi
	call	puts@PLT
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L31:
	movslq	%r14d, %rdi
	movq	%rbp, %rcx
	movq	$-1, %rdx
	xorl	%eax, %eax
	addq	%rbx, %rdi
	movl	$1, %esi
	addq	$1, %r15
	call	__sprintf_chk@PLT
	movsbl	-1(%r15), %r9d
	addl	%eax, %r14d
	testb	%r9b, %r9b
	je	.L33
	movl	$1, %r8d
	jmp	.L34
	.p2align 4,,10
	.p2align 3
.L22:
	movsbl	(%rbx), %r9d
	movq	%r12, %r10
	testb	%r9b, %r9b
	je	.L25
	leaq	1+line(%rip), %r14
	xorl	%r15d, %r15d
.L53:
	movl	$1, %r8d
.L29:
	cmpb	%r9b, (%r14)
	jne	.L26
	movsbl	(%r14), %r9d
	addq	$1, %r14
	addl	$1, %r8d
	testb	%r9b, %r9b
	jne	.L29
.L28:
	movslq	%r15d, %r10
	movl	sign(%rip), %r14d
	movl	20(%rsp), %eax
	addq	%r12, %r10
.L25:
	movl	$1, %edx
	movb	$0, (%r10)
	subl	%r14d, %edx
	movl	%edx, sign(%rip)
	movl	%edx, %r14d
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L26:
	movslq	%r15d, %rdi
	movq	%rbp, %rcx
	movq	$-1, %rdx
	xorl	%eax, %eax
	addq	%r12, %rdi
	movl	$1, %esi
	addq	$1, %r14
	call	__sprintf_chk@PLT
	movsbl	-1(%r14), %r9d
	addl	%eax, %r15d
	testb	%r9b, %r9b
	jne	.L53
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L55:
	movb	$0, (%rbx,%rcx)
	jmp	.L21
.L54:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L56
	addq	$40, %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
.L56:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	line1
	.bss
	.align 32
	.type	line1, @object
	.size	line1, 100000
line1:
	.zero	100000
	.globl	line
	.align 32
	.type	line, @object
	.size	line, 100000
line:
	.zero	100000
	.globl	sign
	.align 4
	.type	sign, @object
	.size	sign, 4
sign:
	.zero	4
	.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%c"
	.text
	.p2align 4
	.globl	set
	.type	set, @function
set:
.LFB23:
	.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
	movq	%rsi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	movsbl	(%rdi), %r9d
	testb	%r9b, %r9b
	je	.L2
	leaq	1(%rdi), %rbx
	movl	$1, %r8d
	xorl	%r13d, %r13d
	leaq	.LC0(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L6:
	cmpb	%r9b, (%rbx)
	jne	.L3
	movsbl	(%rbx), %r9d
	addq	$1, %rbx
	addl	$1, %r8d
	testb	%r9b, %r9b
	jne	.L6
.L5:
	movslq	%r13d, %r13
	addq	%r13, %rbp
.L2:
	movl	$1, %eax
	subl	sign(%rip), %eax
	movl	%eax, sign(%rip)
	movb	$0, 0(%rbp)
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	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
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	movslq	%r13d, %rdi
	movq	%r12, %rcx
	movq	$-1, %rdx
	xorl	%eax, %eax
	addq	%rbp, %rdi
	movl	$1, %esi
	addq	$1, %rbx
	call	__sprintf_chk@PLT
	movsbl	-1(%rbx), %r9d
	addl	%eax, %r13d
	testb	%r9b, %r9b
	je	.L5
	movl	$1, %r8d
	jmp	.L6
	.cfi_endproc
.LFE23:
	.size	set, .-set
	.section	.rodata.str1.1
.LC1:
	.string	"%c"
.LC2:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.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
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	line(%rip), %rbx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L16:
	movq	8(%rsp), %rsi
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rdi
	movl	$1, sign(%rip)
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %eax
	testl	%eax, %eax
	je	.L54
	movq	%rbx, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	stdin(%rip), %rcx
	movl	$1000000, %edx
	movq	%rbx, %rdi
	movl	$100000, %esi
	call	__fgets_chk@PLT
	movzbl	(%rbx), %edx
	movl	$1, %eax
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L20:
	movzbl	(%rbx,%rax), %edx
	addq	$1, %rax
	cmpb	$10, %dl
	je	.L55
.L17:
	movslq	%eax, %rcx
	testb	%dl, %dl
	jne	.L20
.L21:
	movl	20(%rsp), %eax
	movl	sign(%rip), %r14d
	xorl	%r13d, %r13d
	leaq	line1(%rip), %r12
	testl	%eax, %eax
	je	.L19
	.p2align 4,,10
	.p2align 3
.L18:
	testl	%r14d, %r14d
	jne	.L22
	movsbl	(%r12), %r9d
	movl	$1, %r8d
	xorl	%ecx, %ecx
	movq	%rbx, %rdx
	leaq	1+line1(%rip), %r15
	testb	%r9b, %r9b
	je	.L24
	.p2align 4,,10
	.p2align 3
.L34:
	cmpb	%r9b, (%r15)
	jne	.L31
	movsbl	(%r15), %r9d
	addq	$1, %r15
	addl	$1, %r8d
	testb	%r9b, %r9b
	jne	.L34
.L33:
	movslq	%r14d, %rdx
	movl	sign(%rip), %ecx
	movl	20(%rsp), %eax
	addq	%rbx, %rdx
.L24:
	movl	$1, %r11d
	movb	$0, (%rdx)
	subl	%ecx, %r11d
	movl	%r11d, sign(%rip)
	movl	%r11d, %r14d
.L30:
	addl	$1, %r13d
	cmpl	%eax, %r13d
	jne	.L18
.L19:
	testl	%r14d, %r14d
	leaq	line1(%rip), %rdi
	cmovne	%rbx, %rdi
	call	puts@PLT
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L31:
	movslq	%r14d, %rdi
	movq	%rbp, %rcx
	movq	$-1, %rdx
	xorl	%eax, %eax
	addq	%rbx, %rdi
	movl	$1, %esi
	addq	$1, %r15
	call	__sprintf_chk@PLT
	movsbl	-1(%r15), %r9d
	addl	%eax, %r14d
	testb	%r9b, %r9b
	je	.L33
	movl	$1, %r8d
	jmp	.L34
	.p2align 4,,10
	.p2align 3
.L22:
	movsbl	(%rbx), %r9d
	movq	%r12, %r10
	testb	%r9b, %r9b
	je	.L25
	leaq	1+line(%rip), %r14
	xorl	%r15d, %r15d
.L53:
	movl	$1, %r8d
.L29:
	cmpb	%r9b, (%r14)
	jne	.L26
	movsbl	(%r14), %r9d
	addq	$1, %r14
	addl	$1, %r8d
	testb	%r9b, %r9b
	jne	.L29
.L28:
	movslq	%r15d, %r10
	movl	sign(%rip), %r14d
	movl	20(%rsp), %eax
	addq	%r12, %r10
.L25:
	movl	$1, %edx
	movb	$0, (%r10)
	subl	%r14d, %edx
	movl	%edx, sign(%rip)
	movl	%edx, %r14d
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L26:
	movslq	%r15d, %rdi
	movq	%rbp, %rcx
	movq	$-1, %rdx
	xorl	%eax, %eax
	addq	%r12, %rdi
	movl	$1, %esi
	addq	$1, %r14
	call	__sprintf_chk@PLT
	movsbl	-1(%r14), %r9d
	addl	%eax, %r15d
	testb	%r9b, %r9b
	jne	.L53
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L55:
	movb	$0, (%rbx,%rcx)
	jmp	.L21
.L54:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L56
	addq	$40, %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
.L56:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	line1
	.bss
	.align 32
	.type	line1, @object
	.size	line1, 100000
line1:
	.zero	100000
	.globl	line
	.align 32
	.type	line, @object
	.size	line, 100000
line:
	.zero	100000
	.globl	sign
	.align 4
	.type	sign, @object
	.size	sign, 4
sign:
	.zero	4
	.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 sign;
char line[100000],line1[100000];
void set(char target[],char setline[]){
    int i=-1,t=0,sum=1;
    while(i++,target[i]){
        if(target[i] == target[i+1])
            sum++;
        else{
            t+=sprintf(setline+t,"%d%c",sum,target[i]);
            sum=1;
        }
    }
    sign=1-sign;
    setline[t]=0;
}
int main(void){
    int num,sum,n,i;
    for(;i=0,sign=1,scanf("%d",&num),num;){
        scanf("%c",&line[0]);
        fgets(line,1000000,stdin);
        while(line[i++])
            if(line[i] == '\n'){
                line[i]=0;
                break;
            }
        for(sum=0;sum!=num;sum++)sign?set(line,line1):set(line1,line);
        printf("%s\n",sign?line:line1);
    }
    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>
int sign;
char line[100000],line1[100000];
void set(char target[],char setline[]){
    int i=-1,t=0,sum=1;
    while(i++,target[i]){
        if(target[i] == target[i+1])
            sum++;
        else{
            t+=sprintf(setline+t,"%d%c",sum,target[i]);
            sum=1;
        }
    }
    sign=1-sign;
    setline[t]=0;
}
int main(void){
    int num,sum,n,i;
    for(;i=0,sign=1,scanf("%d",&num),num;){
        scanf("%c",&line[0]);
        fgets(line,1000000,stdin);
        while(line[i++])
            if(line[i] == '\n'){
                line[i]=0;
                break;
            }
        for(sum=0;sum!=num;sum++)sign?set(line,line1):set(line1,line);
        printf("%s\n",sign?line:line1);
    }
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	sign
	.bss
	.align 4
	.type	sign, @object
	.size	sign, 4
sign:
	.zero	4
	.globl	line
	.align 32
	.type	line, @object
	.size	line, 100000
line:
	.zero	100000
	.globl	line1
	.align 32
	.type	line1, @object
	.size	line1, 100000
line1:
	.zero	100000
	.section	.rodata
.LC0:
	.string	"%d%c"
	.text
	.globl	set
	.type	set, @function
set:
.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, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movl	$-1, -12(%rbp)
	movl	$0, -8(%rbp)
	movl	$1, -4(%rbp)
	jmp	.L2
.L4:
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %edx
	movl	-12(%rbp), %eax
	cltq
	leaq	1(%rax), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movzbl	(%rax), %eax
	cmpb	%al, %dl
	jne	.L3
	addl	$1, -4(%rbp)
	jmp	.L2
.L3:
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %edx
	movl	-8(%rbp), %eax
	movslq	%eax, %rcx
	movq	-32(%rbp), %rax
	leaq	(%rcx,%rax), %rdi
	movl	-4(%rbp), %eax
	movl	%edx, %ecx
	movl	%eax, %edx
	leaq	.LC0(%rip), %rax
	movq	%rax, %rsi
	movl	$0, %eax
	call	sprintf@PLT
	addl	%eax, -8(%rbp)
	movl	$1, -4(%rbp)
.L2:
	addl	$1, -12(%rbp)
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L4
	movl	sign(%rip), %edx
	movl	$1, %eax
	subl	%edx, %eax
	movl	%eax, sign(%rip)
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movb	$0, (%rax)
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	set, .-set
	.section	.rodata
.LC1:
	.string	"%c"
.LC2:
	.string	"%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	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L6
.L16:
	leaq	line(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	stdin(%rip), %rax
	movq	%rax, %rdx
	movl	$1000000, %esi
	leaq	line(%rip), %rax
	movq	%rax, %rdi
	call	fgets@PLT
	jmp	.L7
.L9:
	movl	-12(%rbp), %eax
	cltq
	leaq	line(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$10, %al
	jne	.L7
	movl	-12(%rbp), %eax
	cltq
	leaq	line(%rip), %rdx
	movb	$0, (%rax,%rdx)
	jmp	.L8
.L7:
	movl	-12(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -12(%rbp)
	cltq
	leaq	line(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	jne	.L9
.L8:
	movl	$0, -16(%rbp)
	jmp	.L10
.L13:
	movl	sign(%rip), %eax
	testl	%eax, %eax
	je	.L11
	leaq	line1(%rip), %rax
	movq	%rax, %rsi
	leaq	line(%rip), %rax
	movq	%rax, %rdi
	call	set
	jmp	.L12
.L11:
	leaq	line(%rip), %rax
	movq	%rax, %rsi
	leaq	line1(%rip), %rax
	movq	%rax, %rdi
	call	set
.L12:
	addl	$1, -16(%rbp)
.L10:
	movl	-20(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jne	.L13
	movl	sign(%rip), %eax
	testl	%eax, %eax
	je	.L14
	leaq	line(%rip), %rax
	jmp	.L15
.L14:
	leaq	line1(%rip), %rax
.L15:
	movq	%rax, %rdi
	call	puts@PLT
.L6:
	movl	$0, -12(%rbp)
	movl	$1, sign(%rip)
	leaq	-20(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-20(%rbp), %eax
	testl	%eax, %eax
	jne	.L16
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	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	sign
	.bss
	.align 4
	.type	sign, @object
	.size	sign, 4
sign:
	.zero	4
	.globl	line
	.align 32
	.type	line, @object
	.size	line, 100000
line:
	.zero	100000
	.globl	line1
	.align 32
	.type	line1, @object
	.size	line1, 100000
line1:
	.zero	100000
	.section	.rodata
.LC0:
	.string	"%d%c"
	.text
	.globl	set
	.type	set, @function
set:
.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, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movl	$-1, -12(%rbp)
	movl	$0, -8(%rbp)
	movl	$1, -4(%rbp)
	jmp	.L2
.L4:
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %edx
	movl	-12(%rbp), %eax
	cltq
	leaq	1(%rax), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movzbl	(%rax), %eax
	cmpb	%al, %dl
	jne	.L3
	addl	$1, -4(%rbp)
	jmp	.L2
.L3:
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %edx
	movl	-8(%rbp), %eax
	movslq	%eax, %rcx
	movq	-32(%rbp), %rax
	leaq	(%rcx,%rax), %rdi
	movl	-4(%rbp), %eax
	movl	%edx, %ecx
	movl	%eax, %edx
	leaq	.LC0(%rip), %rax
	movq	%rax, %rsi
	movl	$0, %eax
	call	sprintf@PLT
	addl	%eax, -8(%rbp)
	movl	$1, -4(%rbp)
.L2:
	addl	$1, -12(%rbp)
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L4
	movl	sign(%rip), %edx
	movl	$1, %eax
	subl	%edx, %eax
	movl	%eax, sign(%rip)
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movb	$0, (%rax)
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	set, .-set
	.section	.rodata
.LC1:
	.string	"%c"
.LC2:
	.string	"%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	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L6
.L16:
	leaq	line(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	stdin(%rip), %rax
	movq	%rax, %rdx
	movl	$1000000, %esi
	leaq	line(%rip), %rax
	movq	%rax, %rdi
	call	fgets@PLT
	jmp	.L7
.L9:
	movl	-12(%rbp), %eax
	cltq
	leaq	line(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$10, %al
	jne	.L7
	movl	-12(%rbp), %eax
	cltq
	leaq	line(%rip), %rdx
	movb	$0, (%rax,%rdx)
	jmp	.L8
.L7:
	movl	-12(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -12(%rbp)
	cltq
	leaq	line(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	jne	.L9
.L8:
	movl	$0, -16(%rbp)
	jmp	.L10
.L13:
	movl	sign(%rip), %eax
	testl	%eax, %eax
	je	.L11
	leaq	line1(%rip), %rax
	movq	%rax, %rsi
	leaq	line(%rip), %rax
	movq	%rax, %rdi
	call	set
	jmp	.L12
.L11:
	leaq	line(%rip), %rax
	movq	%rax, %rsi
	leaq	line1(%rip), %rax
	movq	%rax, %rdi
	call	set
.L12:
	addl	$1, -16(%rbp)
.L10:
	movl	-20(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jne	.L13
	movl	sign(%rip), %eax
	testl	%eax, %eax
	je	.L14
	leaq	line(%rip), %rax
	jmp	.L15
.L14:
	leaq	line1(%rip), %rax
.L15:
	movq	%rax, %rdi
	call	puts@PLT
.L6:
	movl	$0, -12(%rbp)
	movl	$1, sign(%rip)
	leaq	-20(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-20(%rbp), %eax
	testl	%eax, %eax
	jne	.L16
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	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:
