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>
#include <stdlib.h>
#include <math.h>
#include <string.h>

int main(){
  int i,j,N;
  double a=0.0,sum=0.0;
   scanf("%d",&N);
  char b[3];
  for(i=0;i<N;i++){
    scanf("%lf %s",&a,&b);
  //  printf("%lf %s\n",a,b);
  if(strcmp(b,"JPY")==0)
    sum+=a;
  else if(strcmp("BTC",b)==0)
    sum+=a*380000.0;
    }
   printf("%lf",sum);
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d"
.LC2:
	.string	"%lf %s"
.LC3:
	.string	"%lf"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.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	$40, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	movq	$0x000000000, 8(%rsp)
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	xorl	%ebx, %ebx
	leaq	21(%rsp), %r13
	leaq	8(%rsp), %r12
	leaq	.LC2(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	addl	$1, %ebx
	cmpl	%ebx, 4(%rsp)
	jg	.L3
.L2:
	pxor	%xmm0, %xmm0
	movl	$1, %edi
	movl	$1, %eax
	leaq	.LC3(%rip), %rsi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L8
	addq	$40, %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
.L8:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d"
.LC2:
	.string	"%lf %s"
.LC3:
	.string	"%lf"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.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	$40, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	movq	$0x000000000, 8(%rsp)
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	xorl	%ebx, %ebx
	leaq	21(%rsp), %r13
	leaq	8(%rsp), %r12
	leaq	.LC2(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	addl	$1, %ebx
	cmpl	%ebx, 4(%rsp)
	jg	.L3
.L2:
	pxor	%xmm0, %xmm0
	movl	$1, %edi
	movl	$1, %eax
	leaq	.LC3(%rip), %rsi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L8
	addq	$40, %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
.L8:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d"
.LC2:
	.string	"%lf %s"
.LC3:
	.string	"%lf"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.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	$40, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	movq	$0x000000000, 8(%rsp)
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	xorl	%ebx, %ebx
	leaq	21(%rsp), %r13
	leaq	8(%rsp), %r12
	leaq	.LC2(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	addl	$1, %ebx
	cmpl	%ebx, 4(%rsp)
	jg	.L3
.L2:
	pxor	%xmm0, %xmm0
	movl	$1, %edi
	movl	$1, %eax
	leaq	.LC3(%rip), %rsi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L8
	addq	$40, %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
.L8:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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:
```
```c
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>

int main(){
  int i,j,N;
  double a=0.0,sum=0.0;
   scanf("%d",&N);
  char b[3];
  for(i=0;i<N;i++){
    scanf("%lf %s",&a,&b);
  //  printf("%lf %s\n",a,b);
  if(strcmp(b,"JPY")==0)
    sum+=a;
  else if(strcmp("BTC",b)==0)
    sum+=a*380000.0;
    }
   printf("%lf",sum);
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>

int main(){
  int i,j,N;
  double a=0.0,sum=0.0;
   scanf("%d",&N);
  char b[3];
  for(i=0;i<N;i++){
    scanf("%lf %s",&a,&b);
  //  printf("%lf %s\n",a,b);
  if(strcmp(b,"JPY")==0)
    sum+=a;
  else if(strcmp("BTC",b)==0)
    sum+=a*380000.0;
    }
   printf("%lf",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>
#include <stdlib.h>
#include <math.h>
#include <string.h>

int main(){
  int i,j,N;
  double a=0.0,sum=0.0;
   scanf("%d",&N);
  char b[3];
  for(i=0;i<N;i++){
    scanf("%lf %s",&a,&b);
  //  printf("%lf %s\n",a,b);
  if(strcmp(b,"JPY")==0)
    sum+=a;
  else if(strcmp("BTC",b)==0)
    sum+=a*380000.0;
    }
   printf("%lf",sum);
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d"
.LC2:
	.string	"%lf %s"
.LC3:
	.string	"%lf"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.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	$40, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	movq	$0x000000000, 8(%rsp)
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	xorl	%ebx, %ebx
	leaq	21(%rsp), %r13
	leaq	8(%rsp), %r12
	leaq	.LC2(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	addl	$1, %ebx
	cmpl	%ebx, 4(%rsp)
	jg	.L3
.L2:
	pxor	%xmm0, %xmm0
	movl	$1, %edi
	movl	$1, %eax
	leaq	.LC3(%rip), %rsi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L8
	addq	$40, %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
.L8:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d"
.LC2:
	.string	"%lf %s"
.LC3:
	.string	"%lf"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.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	$40, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	movq	$0x000000000, 8(%rsp)
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	xorl	%ebx, %ebx
	leaq	21(%rsp), %r13
	leaq	8(%rsp), %r12
	leaq	.LC2(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	addl	$1, %ebx
	cmpl	%ebx, 4(%rsp)
	jg	.L3
.L2:
	pxor	%xmm0, %xmm0
	movl	$1, %edi
	movl	$1, %eax
	leaq	.LC3(%rip), %rsi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L8
	addq	$40, %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
.L8:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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:
```