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>
int main (){
  char box[200];
  int a,b,sum=0;
  while(1){
    sum=0;
    scanf("%s",box);
    if(box[0] == '-')break;
    scanf("%d",&a);
    for(int i=0;i<a;i++){
      scanf("%d",&b);
      sum+=b;
    }
    sum=sum%(strlen(box));
    for(int i=sum;i<strlen(box);i++){
      printf("%c",box[i]);
    }
    for(int i=0;i<sum;i++){
      printf("%c",box[i]);
    }
    printf("\n");
  }
  return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"%d"
	.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
	pushq	%rbx
	subq	$248, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movl	$0, -240(%rbp)
.L10:
	movl	$0, -240(%rbp)
	leaq	-224(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movzbl	-224(%rbp), %eax
	cmpb	$45, %al
	je	.L14
	leaq	-248(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -236(%rbp)
	jmp	.L4
.L5:
	leaq	-244(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-244(%rbp), %eax
	addl	%eax, -240(%rbp)
	addl	$1, -236(%rbp)
.L4:
	movl	-248(%rbp), %eax
	cmpl	%eax, -236(%rbp)
	jl	.L5
	movl	-240(%rbp), %eax
	movslq	%eax, %rbx
	leaq	-224(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movq	%rax, %rcx
	movq	%rbx, %rax
	movl	$0, %edx
	divq	%rcx
	movq	%rdx, %rcx
	movq	%rcx, %rax
	movl	%eax, -240(%rbp)
	movl	-240(%rbp), %eax
	movl	%eax, -232(%rbp)
	jmp	.L6
.L7:
	movl	-232(%rbp), %eax
	cltq
	movzbl	-224(%rbp,%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar@PLT
	addl	$1, -232(%rbp)
.L6:
	movl	-232(%rbp), %eax
	movslq	%eax, %rbx
	leaq	-224(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	cmpq	%rax, %rbx
	jb	.L7
	movl	$0, -228(%rbp)
	jmp	.L8
.L9:
	movl	-228(%rbp), %eax
	cltq
	movzbl	-224(%rbp,%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar@PLT
	addl	$1, -228(%rbp)
.L8:
	movl	-228(%rbp), %eax
	cmpl	-240(%rbp), %eax
	jl	.L9
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L10
.L14:
	nop
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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	"%s"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.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
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	.LC1(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$232, %rsp
	.cfi_def_cfa_offset 288
	movq	%fs:40, %rax
	movq	%rax, 216(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L7:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%r13, %rdi
	call	__isoc99_scanf@PLT
	cmpb	$45, 16(%rsp)
	je	.L2
	leaq	8(%rsp), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %eax
	testl	%eax, %eax
	jle	.L3
	xorl	%ebx, %ebx
	xorl	%r14d, %r14d
	leaq	12(%rsp), %r15
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r15, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	addl	12(%rsp), %r14d
	cmpl	%ebx, 8(%rsp)
	jg	.L4
	movq	%rbp, %rdi
	call	strlen@PLT
	xorl	%edx, %edx
	movq	%rax, %r8
	movslq	%r14d, %rax
	divq	%r8
	movq	%rdx, %rbx
	movl	%edx, %r15d
	movq	%rdx, %r14
	.p2align 4,,10
	.p2align 3
.L5:
	movsbl	0(%rbp,%rbx), %edi
	addq	$1, %rbx
	call	putchar@PLT
	movq	%rbp, %rdi
	call	strlen@PLT
	cmpq	%rbx, %rax
	ja	.L5
	testl	%r15d, %r15d
	je	.L9
	leal	-1(%r14), %eax
	movq	%rbp, %rbx
	leaq	17(%rsp,%rax), %r14
	.p2align 4,,10
	.p2align 3
.L8:
	movsbl	(%rbx), %edi
	addq	$1, %rbx
	call	putchar@PLT
	cmpq	%rbx, %r14
	jne	.L8
.L9:
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L2:
	movq	216(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$232, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	movq	%rbp, %rdi
	xorl	%ebx, %ebx
	xorl	%r15d, %r15d
	xorl	%r14d, %r14d
	call	strlen@PLT
	testq	%rax, %rax
	jne	.L5
	jmp	.L9
.L19:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.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
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	.LC1(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$232, %rsp
	.cfi_def_cfa_offset 288
	movq	%fs:40, %rax
	movq	%rax, 216(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L7:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%r13, %rdi
	call	__isoc99_scanf@PLT
	cmpb	$45, 16(%rsp)
	je	.L2
	leaq	8(%rsp), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %eax
	testl	%eax, %eax
	jle	.L3
	xorl	%ebx, %ebx
	xorl	%r14d, %r14d
	leaq	12(%rsp), %r15
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r15, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	addl	12(%rsp), %r14d
	cmpl	%ebx, 8(%rsp)
	jg	.L4
	movq	%rbp, %rdi
	call	strlen@PLT
	xorl	%edx, %edx
	movq	%rax, %r8
	movslq	%r14d, %rax
	divq	%r8
	movq	%rdx, %rbx
	movl	%edx, %r15d
	movq	%rdx, %r14
	.p2align 4,,10
	.p2align 3
.L5:
	movsbl	0(%rbp,%rbx), %edi
	addq	$1, %rbx
	call	putchar@PLT
	movq	%rbp, %rdi
	call	strlen@PLT
	cmpq	%rbx, %rax
	ja	.L5
	testl	%r15d, %r15d
	je	.L9
	leal	-1(%r14), %eax
	movq	%rbp, %rbx
	leaq	17(%rsp,%rax), %r14
	.p2align 4,,10
	.p2align 3
.L8:
	movsbl	(%rbx), %edi
	addq	$1, %rbx
	call	putchar@PLT
	cmpq	%rbx, %r14
	jne	.L8
.L9:
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L2:
	movq	216(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$232, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	movq	%rbp, %rdi
	xorl	%ebx, %ebx
	xorl	%r15d, %r15d
	xorl	%r14d, %r14d
	call	strlen@PLT
	testq	%rax, %rax
	jne	.L5
	jmp	.L9
.L19:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include<stdio.h>
#include<string.h>
int main (){
  char box[200];
  int a,b,sum=0;
  while(1){
    sum=0;
    scanf("%s",box);
    if(box[0] == '-')break;
    scanf("%d",&a);
    for(int i=0;i<a;i++){
      scanf("%d",&b);
      sum+=b;
    }
    sum=sum%(strlen(box));
    for(int i=sum;i<strlen(box);i++){
      printf("%c",box[i]);
    }
    for(int i=0;i<sum;i++){
      printf("%c",box[i]);
    }
    printf("\n");
  }
  return 0;
}


aaac
3
1
2
1
vwxyz
2
3
4
-
 caaa
3
1
2
1
vwxyz
2
3
4
-
 caaa
3
1
2
2
vxxyz
2
3
4
-
 ca`a
3
1
2
2
vwxyz
2
3
4
-
 caaa
3
1
0
2
vwxyz
2
3
4
-
 caaa
3
1
-1
2
vwxyz
2
3
4
-
 aaac
3
1
2
1
vwxyz
2
2
4
-
 ca`a
3
1
2
1
vwxyz
2
3
4
-
 ca`a
3
1
2
2
vwxyz
2
2
4
-
 caaa
3
1
0
2
vwxyz
2
3
2
-

aaac
xyzvw
 caaa
xyzvw
 aaac
xyzvx
 a`ac
xyzvw
 acaa
xyzvw
 aaca
xyzvw
 aaac
wxyzv
 ca`a
xyzvw
 a`ac
wxyzv
 acaa
vwxyz

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>
int main (){
  char box[200];
  int a,b,sum=0;
  while(1){
    sum=0;
    scanf("%s",box);
    if(box[0] == '-')break;
    scanf("%d",&a);
    for(int i=0;i<a;i++){
      scanf("%d",&b);
      sum+=b;
    }
    sum=sum%(strlen(box));
    for(int i=sum;i<strlen(box);i++){
      printf("%c",box[i]);
    }
    for(int i=0;i<sum;i++){
      printf("%c",box[i]);
    }
    printf("\n");
  }
  return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"%d"
	.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
	pushq	%rbx
	subq	$248, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movl	$0, -240(%rbp)
.L10:
	movl	$0, -240(%rbp)
	leaq	-224(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movzbl	-224(%rbp), %eax
	cmpb	$45, %al
	je	.L14
	leaq	-248(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -236(%rbp)
	jmp	.L4
.L5:
	leaq	-244(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-244(%rbp), %eax
	addl	%eax, -240(%rbp)
	addl	$1, -236(%rbp)
.L4:
	movl	-248(%rbp), %eax
	cmpl	%eax, -236(%rbp)
	jl	.L5
	movl	-240(%rbp), %eax
	movslq	%eax, %rbx
	leaq	-224(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movq	%rax, %rcx
	movq	%rbx, %rax
	movl	$0, %edx
	divq	%rcx
	movq	%rdx, %rcx
	movq	%rcx, %rax
	movl	%eax, -240(%rbp)
	movl	-240(%rbp), %eax
	movl	%eax, -232(%rbp)
	jmp	.L6
.L7:
	movl	-232(%rbp), %eax
	cltq
	movzbl	-224(%rbp,%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar@PLT
	addl	$1, -232(%rbp)
.L6:
	movl	-232(%rbp), %eax
	movslq	%eax, %rbx
	leaq	-224(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	cmpq	%rax, %rbx
	jb	.L7
	movl	$0, -228(%rbp)
	jmp	.L8
.L9:
	movl	-228(%rbp), %eax
	cltq
	movzbl	-224(%rbp,%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar@PLT
	addl	$1, -228(%rbp)
.L8:
	movl	-228(%rbp), %eax
	cmpl	-240(%rbp), %eax
	jl	.L9
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L10
.L14:
	nop
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"%d"
	.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
	pushq	%rbx
	subq	$248, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movl	$0, -240(%rbp)
.L10:
	movl	$0, -240(%rbp)
	leaq	-224(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movzbl	-224(%rbp), %eax
	cmpb	$45, %al
	je	.L14
	leaq	-248(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -236(%rbp)
	jmp	.L4
.L5:
	leaq	-244(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-244(%rbp), %eax
	addl	%eax, -240(%rbp)
	addl	$1, -236(%rbp)
.L4:
	movl	-248(%rbp), %eax
	cmpl	%eax, -236(%rbp)
	jl	.L5
	movl	-240(%rbp), %eax
	movslq	%eax, %rbx
	leaq	-224(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movq	%rax, %rcx
	movq	%rbx, %rax
	movl	$0, %edx
	divq	%rcx
	movq	%rdx, %rcx
	movq	%rcx, %rax
	movl	%eax, -240(%rbp)
	movl	-240(%rbp), %eax
	movl	%eax, -232(%rbp)
	jmp	.L6
.L7:
	movl	-232(%rbp), %eax
	cltq
	movzbl	-224(%rbp,%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar@PLT
	addl	$1, -232(%rbp)
.L6:
	movl	-232(%rbp), %eax
	movslq	%eax, %rbx
	leaq	-224(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	cmpq	%rax, %rbx
	jb	.L7
	movl	$0, -228(%rbp)
	jmp	.L8
.L9:
	movl	-228(%rbp), %eax
	cltq
	movzbl	-224(%rbp,%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar@PLT
	addl	$1, -228(%rbp)
.L8:
	movl	-228(%rbp), %eax
	cmpl	-240(%rbp), %eax
	jl	.L9
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L10
.L14:
	nop
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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:
