Given the following C code and assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
int main() {
  int n, i;
  double a[20], sum = 0;
  char s[4];
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%lf %s", &a[i], s);
    if(s[0] == 'B')
    a[i] = a[i] * 380000;
    sum = sum + a[i];
  }
  printf("%f\n", sum);
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d"
.LC2:
	.string	"%lf %s"
.LC4:
	.string	"%f\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC1(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$216, %rsp
	.cfi_def_cfa_offset 256
	movq	%fs:40, %rax
	movq	%rax, 200(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L7
	leaq	32(%rsp), %rbx
	pxor	%xmm0, %xmm0
	xorl	%ebp, %ebp
	leaq	196(%rsp), %r13
	leaq	.LC2(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L5:
	xorl	%eax, %eax
	movq	%r13, %rdx
	movq	%rbx, %rsi
	movq	%r12, %rdi
	movsd	%xmm0, 8(%rsp)
	call	__isoc99_scanf@PLT
	cmpb	$66, 196(%rsp)
	movsd	8(%rsp), %xmm0
	je	.L3
	addsd	(%rbx), %xmm0
	addl	$1, %ebp
	addq	$8, %rbx
	cmpl	28(%rsp), %ebp
	jl	.L5
.L2:
	leaq	.LC4(%rip), %rsi
	movl	$1, %edi
	movl	$1, %eax
	call	__printf_chk@PLT
	movq	200(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L10
	addq	$216, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	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
	movsd	.LC3(%rip), %xmm1
	mulsd	(%rbx), %xmm1
	addl	$1, %ebp
	addq	$8, %rbx
	movsd	%xmm1, -8(%rbx)
	addsd	%xmm1, %xmm0
	cmpl	%ebp, 28(%rsp)
	jg	.L5
	jmp	.L2
.L7:
	pxor	%xmm0, %xmm0
	jmp	.L2
.L10:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC3:
	.long	0
	.long	1092039040
	.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.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d"
.LC2:
	.string	"%lf %s"
.LC4:
	.string	"%f\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC1(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$216, %rsp
	.cfi_def_cfa_offset 256
	movq	%fs:40, %rax
	movq	%rax, 200(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L7
	leaq	32(%rsp), %rbx
	pxor	%xmm0, %xmm0
	xorl	%ebp, %ebp
	leaq	196(%rsp), %r13
	leaq	.LC2(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L5:
	xorl	%eax, %eax
	movq	%r13, %rdx
	movq	%rbx, %rsi
	movq	%r12, %rdi
	movsd	%xmm0, 8(%rsp)
	call	__isoc99_scanf@PLT
	cmpb	$66, 196(%rsp)
	movsd	8(%rsp), %xmm0
	je	.L3
	addsd	(%rbx), %xmm0
	addl	$1, %ebp
	addq	$8, %rbx
	cmpl	28(%rsp), %ebp
	jl	.L5
.L2:
	leaq	.LC4(%rip), %rsi
	movl	$1, %edi
	movl	$1, %eax
	call	__printf_chk@PLT
	movq	200(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L10
	addq	$216, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	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
	movsd	.LC3(%rip), %xmm1
	mulsd	(%rbx), %xmm1
	addl	$1, %ebp
	addq	$8, %rbx
	movsd	%xmm1, -8(%rbx)
	addsd	%xmm1, %xmm0
	cmpl	%ebp, 28(%rsp)
	jg	.L5
	jmp	.L2
.L7:
	pxor	%xmm0, %xmm0
	jmp	.L2
.L10:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC3:
	.long	0
	.long	1092039040
	.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
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d"
.LC2:
	.string	"%lf %s"
.LC4:
	.string	"%f\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC1(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$216, %rsp
	.cfi_def_cfa_offset 256
	movq	%fs:40, %rax
	movq	%rax, 200(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L7
	leaq	32(%rsp), %rbx
	pxor	%xmm0, %xmm0
	xorl	%ebp, %ebp
	leaq	196(%rsp), %r13
	leaq	.LC2(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L5:
	xorl	%eax, %eax
	movq	%r13, %rdx
	movq	%rbx, %rsi
	movq	%r12, %rdi
	movsd	%xmm0, 8(%rsp)
	call	__isoc99_scanf@PLT
	cmpb	$66, 196(%rsp)
	movsd	8(%rsp), %xmm0
	je	.L3
	addsd	(%rbx), %xmm0
	addl	$1, %ebp
	addq	$8, %rbx
	cmpl	28(%rsp), %ebp
	jl	.L5
.L2:
	leaq	.LC4(%rip), %rsi
	movl	$1, %edi
	movl	$1, %eax
	call	__printf_chk@PLT
	movq	200(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L10
	addq	$216, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	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
	movsd	.LC3(%rip), %xmm1
	mulsd	(%rbx), %xmm1
	addl	$1, %ebp
	addq	$8, %rbx
	movsd	%xmm1, -8(%rbx)
	addsd	%xmm1, %xmm0
	cmpl	%ebp, 28(%rsp)
	jg	.L5
	jmp	.L2
.L7:
	pxor	%xmm0, %xmm0
	jmp	.L2
.L10:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC3:
	.long	0
	.long	1092039040
	.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:
```
```c
#include <stdio.h>
int main() {
  int n, i;
  double a[20], sum = 0;
  char s[4];
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%lf %s", &a[i], s);
    if(s[0] == 'B')
    a[i] = a[i] * 380000;
    sum = sum + a[i];
  }
  printf("%f\n", sum);
}
```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
int main() {
  int n, i;
  double a[20], sum = 0;
  char s[4];
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%lf %s", &a[i], s);
    if(s[0] == 'B')
    a[i] = a[i] * 380000;
    sum = sum + a[i];
  }
  printf("%f\n", sum);
}
```

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.
Optimized Assembly Code:

2
00000 JPY
0.10000000 BTC
 2
00000 JPY
0.7411383442474536 BTC
 2
10000 JPY
0.7411383442474536 BTC
 2
01000 JPY
0.10000000 BTC
 2
00010 JPY
0.7411383442474536 BTC
 2
10000 JPY
1.729349410778393 BTC
 2
10000 JPY
0.17314902569100102 BTC
 3
100000000 JPY
100.00000000 BTC
0.3694804465533971 BTC
 2
00000 JPY
0.10189738901396564 BTC
 2
00000 JPY
1.673334956965359 BTC

38000.000000
 281632.570814
 291632.570814
 39000.000000
 281642.570814
 667152.776096
 75796.629763
 138140402.569690
 38721.007825
 635867.283647

Given the following C code and assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
int main() {
  int n, i;
  double a[20], sum = 0;
  char s[4];
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%lf %s", &a[i], s);
    if(s[0] == 'B')
    a[i] = a[i] * 380000;
    sum = sum + a[i];
  }
  printf("%f\n", sum);
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d"
.LC2:
	.string	"%lf %s"
.LC4:
	.string	"%f\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC1(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$216, %rsp
	.cfi_def_cfa_offset 256
	movq	%fs:40, %rax
	movq	%rax, 200(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L7
	leaq	32(%rsp), %rbx
	pxor	%xmm0, %xmm0
	xorl	%ebp, %ebp
	leaq	196(%rsp), %r13
	leaq	.LC2(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L5:
	xorl	%eax, %eax
	movq	%r13, %rdx
	movq	%rbx, %rsi
	movq	%r12, %rdi
	movsd	%xmm0, 8(%rsp)
	call	__isoc99_scanf@PLT
	cmpb	$66, 196(%rsp)
	movsd	8(%rsp), %xmm0
	je	.L3
	addsd	(%rbx), %xmm0
	addl	$1, %ebp
	addq	$8, %rbx
	cmpl	28(%rsp), %ebp
	jl	.L5
.L2:
	leaq	.LC4(%rip), %rsi
	movl	$1, %edi
	movl	$1, %eax
	call	__printf_chk@PLT
	movq	200(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L10
	addq	$216, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	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
	movsd	.LC3(%rip), %xmm1
	mulsd	(%rbx), %xmm1
	addl	$1, %ebp
	addq	$8, %rbx
	movsd	%xmm1, -8(%rbx)
	addsd	%xmm1, %xmm0
	cmpl	%ebp, 28(%rsp)
	jg	.L5
	jmp	.L2
.L7:
	pxor	%xmm0, %xmm0
	jmp	.L2
.L10:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC3:
	.long	0
	.long	1092039040
	.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.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d"
.LC2:
	.string	"%lf %s"
.LC4:
	.string	"%f\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC1(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$216, %rsp
	.cfi_def_cfa_offset 256
	movq	%fs:40, %rax
	movq	%rax, 200(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L7
	leaq	32(%rsp), %rbx
	pxor	%xmm0, %xmm0
	xorl	%ebp, %ebp
	leaq	196(%rsp), %r13
	leaq	.LC2(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L5:
	xorl	%eax, %eax
	movq	%r13, %rdx
	movq	%rbx, %rsi
	movq	%r12, %rdi
	movsd	%xmm0, 8(%rsp)
	call	__isoc99_scanf@PLT
	cmpb	$66, 196(%rsp)
	movsd	8(%rsp), %xmm0
	je	.L3
	addsd	(%rbx), %xmm0
	addl	$1, %ebp
	addq	$8, %rbx
	cmpl	28(%rsp), %ebp
	jl	.L5
.L2:
	leaq	.LC4(%rip), %rsi
	movl	$1, %edi
	movl	$1, %eax
	call	__printf_chk@PLT
	movq	200(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L10
	addq	$216, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	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
	movsd	.LC3(%rip), %xmm1
	mulsd	(%rbx), %xmm1
	addl	$1, %ebp
	addq	$8, %rbx
	movsd	%xmm1, -8(%rbx)
	addsd	%xmm1, %xmm0
	cmpl	%ebp, 28(%rsp)
	jg	.L5
	jmp	.L2
.L7:
	pxor	%xmm0, %xmm0
	jmp	.L2
.L10:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC3:
	.long	0
	.long	1092039040
	.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:
```