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>
#define SIZE 100
#define GOLD 100
int main()
{
  int n,m,p;
  int i;
  int x,num;
  int sum;
  while(1)
    {
      scanf("%d%d%d",&n,&m,&p);
      if((n==0)&&(m==0)&&(p==0)) break;
      sum=0;
      for(i=1;i<=n;i++)
	{
	  scanf("%d",&x);
	  sum+=x;
	  if(i==m) num=x;
	}
      if(num==0) printf("0\n");
      else printf("%d\n",sum*(100-p)*GOLD/(100*num));
    }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"0"
.LC3:
	.string	"%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	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L9:
	leaq	-28(%rbp), %rcx
	leaq	-32(%rbp), %rdx
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-36(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	-32(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	-28(%rbp), %eax
	testl	%eax, %eax
	je	.L13
.L2:
	movl	$0, -12(%rbp)
	movl	$1, -20(%rbp)
	jmp	.L4
.L6:
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24(%rbp), %eax
	addl	%eax, -12(%rbp)
	movl	-32(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jne	.L5
	movl	-24(%rbp), %eax
	movl	%eax, -16(%rbp)
.L5:
	addl	$1, -20(%rbp)
.L4:
	movl	-36(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jle	.L6
	cmpl	$0, -16(%rbp)
	jne	.L7
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L9
.L7:
	movl	-28(%rbp), %edx
	movl	$100, %eax
	subl	%edx, %eax
	imull	-12(%rbp), %eax
	imull	$100, %eax, %eax
	movl	-16(%rbp), %edx
	imull	$100, %edx, %ecx
	cltd
	idivl	%ecx
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L9
.L13:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	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	"%d%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"0"
.LC3:
	.string	"%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
	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	.LC1(%rip), %rbx
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rax
	leaq	32(%rsp), %r15
	movq	%rax, 8(%rsp)
	leaq	24(%rsp), %rax
	leaq	36(%rsp), %rbp
	movq	%rax, (%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	8(%rsp), %rdx
	movq	(%rsp), %rsi
	movq	%r15, %rcx
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %r13d
	testl	%r13d, %r13d
	jne	.L3
	movl	28(%rsp), %eax
	orl	32(%rsp), %eax
	je	.L16
.L5:
	testl	%r12d, %r12d
	jne	.L9
.L18:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L3:
	movl	$0, %r13d
	jle	.L5
	movl	$1, %r14d
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	36(%rsp), %eax
	addl	%eax, %r13d
	cmpl	%r14d, 28(%rsp)
	je	.L17
	addl	$1, %r14d
	cmpl	%r14d, 24(%rsp)
	jge	.L8
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L17:
	addl	$1, %r14d
	movl	%eax, %r12d
	cmpl	%r14d, 24(%rsp)
	jge	.L8
	testl	%r12d, %r12d
	je	.L18
.L9:
	movl	$100, %eax
	subl	32(%rsp), %eax
	movl	$1, %edi
	imull	%r13d, %eax
	leaq	.LC3(%rip), %rsi
	imull	$100, %r12d, %ecx
	imull	$100, %eax, %eax
	cltd
	idivl	%ecx
	movl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
.L16:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$56, %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
.L19:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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	"%d%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"0"
.LC3:
	.string	"%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
	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	.LC1(%rip), %rbx
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rax
	leaq	32(%rsp), %r15
	movq	%rax, 8(%rsp)
	leaq	24(%rsp), %rax
	leaq	36(%rsp), %rbp
	movq	%rax, (%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	8(%rsp), %rdx
	movq	(%rsp), %rsi
	movq	%r15, %rcx
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %r13d
	testl	%r13d, %r13d
	jne	.L3
	movl	28(%rsp), %eax
	orl	32(%rsp), %eax
	je	.L16
.L5:
	testl	%r12d, %r12d
	jne	.L9
.L18:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L3:
	movl	$0, %r13d
	jle	.L5
	movl	$1, %r14d
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	36(%rsp), %eax
	addl	%eax, %r13d
	cmpl	%r14d, 28(%rsp)
	je	.L17
	addl	$1, %r14d
	cmpl	%r14d, 24(%rsp)
	jge	.L8
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L17:
	addl	$1, %r14d
	movl	%eax, %r12d
	cmpl	%r14d, 24(%rsp)
	jge	.L8
	testl	%r12d, %r12d
	je	.L18
.L9:
	movl	$100, %eax
	subl	32(%rsp), %eax
	movl	$1, %edi
	imull	%r13d, %eax
	leaq	.LC3(%rip), %rsi
	imull	$100, %r12d, %ecx
	imull	$100, %eax, %eax
	cltd
	idivl	%ecx
	movl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
.L16:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$56, %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
.L19:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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>
#define SIZE 100
#define GOLD 100
int main()
{
  int n,m,p;
  int i;
  int x,num;
  int sum;
  while(1)
    {
      scanf("%d%d%d",&n,&m,&p);
      if((n==0)&&(m==0)&&(p==0)) break;
      sum=0;
      for(i=1;i<=n;i++)
	{
	  scanf("%d",&x);
	  sum+=x;
	  if(i==m) num=x;
	}
      if(num==0) printf("0\n");
      else printf("%d\n",sum*(100-p)*GOLD/(100*num));
    }
  return 0;
}
3 2 50
1
2
3
4 4 65
1
2
3
0
3 1 10
8
1
1
0 0 0
 3 2 50
1
2
3
4 4 65
1
2
3
0
3 1 10
8
2
1
0 0 0
 3 2 50
1
2
1
4 4 65
1
2
3
0
3 1 10
8
2
1
0 0 0
 3 2 50
1
2
3
4 4 65
1
2
3
0
3 1 10
8
0
1
0 0 0
 3 2 50
1
2
3
4 4 65
1
2
3
0
3 1 16
8
0
1
0 0 0
 3 2 50
1
2
3
4 4 65
1
2
3
0
3 1 16
8
0
2
0 0 0
 3 2 50
1
2
3
4 4 75
1
2
3
1
3 1 10
8
1
1
0 0 0
 3 2 50
1
4
3
4 4 65
1
2
3
0
3 1 2
8
2
1
0 0 0
 3 2 50
1
2
3
4 4 65
1
2
3
0
3 1 22
8
0
2
0 0 0
 3 2 94
1
2
3
4 4 65
1
2
3
0
3 1 10
8
2
1
0 0 0

150
0
112
 150
0
123
 100
0
123
 150
0
101
 150
0
94
 150
0
105
 150
175
112
 100
0
134
 150
0
97
 18
0
123

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>
#define SIZE 100
#define GOLD 100
int main()
{
  int n,m,p;
  int i;
  int x,num;
  int sum;
  while(1)
    {
      scanf("%d%d%d",&n,&m,&p);
      if((n==0)&&(m==0)&&(p==0)) break;
      sum=0;
      for(i=1;i<=n;i++)
	{
	  scanf("%d",&x);
	  sum+=x;
	  if(i==m) num=x;
	}
      if(num==0) printf("0\n");
      else printf("%d\n",sum*(100-p)*GOLD/(100*num));
    }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"0"
.LC3:
	.string	"%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	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L9:
	leaq	-28(%rbp), %rcx
	leaq	-32(%rbp), %rdx
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-36(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	-32(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	-28(%rbp), %eax
	testl	%eax, %eax
	je	.L13
.L2:
	movl	$0, -12(%rbp)
	movl	$1, -20(%rbp)
	jmp	.L4
.L6:
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24(%rbp), %eax
	addl	%eax, -12(%rbp)
	movl	-32(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jne	.L5
	movl	-24(%rbp), %eax
	movl	%eax, -16(%rbp)
.L5:
	addl	$1, -20(%rbp)
.L4:
	movl	-36(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jle	.L6
	cmpl	$0, -16(%rbp)
	jne	.L7
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L9
.L7:
	movl	-28(%rbp), %edx
	movl	$100, %eax
	subl	%edx, %eax
	imull	-12(%rbp), %eax
	imull	$100, %eax, %eax
	movl	-16(%rbp), %edx
	imull	$100, %edx, %ecx
	cltd
	idivl	%ecx
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L9
.L13:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	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	"%d%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"0"
.LC3:
	.string	"%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	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L9:
	leaq	-28(%rbp), %rcx
	leaq	-32(%rbp), %rdx
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-36(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	-32(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	-28(%rbp), %eax
	testl	%eax, %eax
	je	.L13
.L2:
	movl	$0, -12(%rbp)
	movl	$1, -20(%rbp)
	jmp	.L4
.L6:
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24(%rbp), %eax
	addl	%eax, -12(%rbp)
	movl	-32(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jne	.L5
	movl	-24(%rbp), %eax
	movl	%eax, -16(%rbp)
.L5:
	addl	$1, -20(%rbp)
.L4:
	movl	-36(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jle	.L6
	cmpl	$0, -16(%rbp)
	jne	.L7
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L9
.L7:
	movl	-28(%rbp), %edx
	movl	$100, %eax
	subl	%edx, %eax
	imull	-12(%rbp), %eax
	imull	$100, %eax, %eax
	movl	-16(%rbp), %edx
	imull	$100, %edx, %ecx
	cltd
	idivl	%ecx
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L9
.L13:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	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:
