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>

void mD(char C, int *D) {
  switch (C) {
    int t;
  case 'N':
    t = D[0]; D[0] = D[1]; D[1] = D[5]; D[5] = D[4]; D[4] = t;
    break;
  case 'S':
    t = D[0]; D[0] = D[4]; D[4] = D[5]; D[5] = D[1]; D[1] = t;
    break;
  case 'E':
    t = D[0]; D[0] = D[3]; D[3] = D[5]; D[5] = D[2]; D[2] = t;
    break;
  case 'W':
    t = D[0]; D[0] = D[2]; D[2] = D[5]; D[5] = D[3]; D[3] = t;
    break;
  }
  return;
}

int main(void) {
  int D[6], d;
  char C[101];int c;
  for(d=0;d<6;d++)
    scanf("%d",&D[d]);
  scanf("%s",C);
  for (c=0;c<strlen(C);c++) {
    mD(C[c], D);
  }
  printf("%d\n",D[0]);

  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	mD
	.type	mD, @function
mD:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, %eax
	movq	%rsi, -32(%rbp)
	movb	%al, -20(%rbp)
	movsbl	-20(%rbp), %eax
	cmpl	$87, %eax
	je	.L2
	cmpl	$87, %eax
	jg	.L7
	cmpl	$83, %eax
	je	.L4
	cmpl	$83, %eax
	jg	.L7
	cmpl	$69, %eax
	je	.L5
	cmpl	$78, %eax
	jne	.L7
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movq	-32(%rbp), %rax
	movl	4(%rax), %edx
	movq	-32(%rbp), %rax
	movl	%edx, (%rax)
	movq	-32(%rbp), %rax
	leaq	4(%rax), %rdx
	movq	-32(%rbp), %rax
	movl	20(%rax), %eax
	movl	%eax, (%rdx)
	movq	-32(%rbp), %rax
	leaq	20(%rax), %rdx
	movq	-32(%rbp), %rax
	movl	16(%rax), %eax
	movl	%eax, (%rdx)
	movq	-32(%rbp), %rax
	leaq	16(%rax), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rdx)
	jmp	.L3
.L4:
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movq	-32(%rbp), %rax
	movl	16(%rax), %edx
	movq	-32(%rbp), %rax
	movl	%edx, (%rax)
	movq	-32(%rbp), %rax
	leaq	16(%rax), %rdx
	movq	-32(%rbp), %rax
	movl	20(%rax), %eax
	movl	%eax, (%rdx)
	movq	-32(%rbp), %rax
	leaq	20(%rax), %rdx
	movq	-32(%rbp), %rax
	movl	4(%rax), %eax
	movl	%eax, (%rdx)
	movq	-32(%rbp), %rax
	leaq	4(%rax), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rdx)
	jmp	.L3
.L5:
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movq	-32(%rbp), %rax
	movl	12(%rax), %edx
	movq	-32(%rbp), %rax
	movl	%edx, (%rax)
	movq	-32(%rbp), %rax
	leaq	12(%rax), %rdx
	movq	-32(%rbp), %rax
	movl	20(%rax), %eax
	movl	%eax, (%rdx)
	movq	-32(%rbp), %rax
	leaq	20(%rax), %rdx
	movq	-32(%rbp), %rax
	movl	8(%rax), %eax
	movl	%eax, (%rdx)
	movq	-32(%rbp), %rax
	leaq	8(%rax), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rdx)
	jmp	.L3
.L2:
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movq	-32(%rbp), %rax
	movl	8(%rax), %edx
	movq	-32(%rbp), %rax
	movl	%edx, (%rax)
	movq	-32(%rbp), %rax
	leaq	8(%rax), %rdx
	movq	-32(%rbp), %rax
	movl	20(%rax), %eax
	movl	%eax, (%rdx)
	movq	-32(%rbp), %rax
	leaq	20(%rax), %rdx
	movq	-32(%rbp), %rax
	movl	12(%rax), %eax
	movl	%eax, (%rdx)
	movq	-32(%rbp), %rax
	leaq	12(%rax), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rdx)
	nop
.L3:
	nop
.L7:
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	mD, .-mD
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.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
	pushq	%rbx
	subq	$168, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movl	$0, -168(%rbp)
	jmp	.L9
.L10:
	leaq	-160(%rbp), %rdx
	movl	-168(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -168(%rbp)
.L9:
	cmpl	$5, -168(%rbp)
	jle	.L10
	leaq	-128(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -164(%rbp)
	jmp	.L11
.L12:
	movl	-164(%rbp), %eax
	cltq
	movzbl	-128(%rbp,%rax), %eax
	movsbl	%al, %eax
	leaq	-160(%rbp), %rdx
	movq	%rdx, %rsi
	movl	%eax, %edi
	call	mD
	addl	$1, -164(%rbp)
.L11:
	movl	-164(%rbp), %eax
	movslq	%eax, %rbx
	leaq	-128(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	cmpq	%rax, %rbx
	jb	.L12
	movl	-160(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	movq	-8(%rbp), %rbx
	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
	.p2align 4
	.globl	mD
	.type	mD, @function
mD:
.LFB35:
	.cfi_startproc
	endbr64
	cmpb	$83, %dil
	je	.L2
	jg	.L3
	cmpb	$69, %dil
	je	.L4
	cmpb	$78, %dil
	jne	.L9
	movq	(%rsi), %xmm0
	movq	16(%rsi), %xmm1
	movdqa	%xmm0, %xmm2
	punpckldq	%xmm1, %xmm0
	punpckldq	%xmm1, %xmm2
	movq	%xmm0, 16(%rsi)
	pshufd	$14, %xmm2, %xmm2
	movq	%xmm2, (%rsi)
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	cmpb	$87, %dil
	jne	.L10
	movl	(%rsi), %edx
	movd	20(%rsi), %xmm0
	movl	8(%rsi), %ecx
	movd	%edx, %xmm4
	movl	12(%rsi), %edx
	punpckldq	%xmm4, %xmm0
	movl	%ecx, (%rsi)
	movl	%edx, 20(%rsi)
	movq	%xmm0, 8(%rsi)
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	movl	12(%rsi), %edx
	movd	(%rsi), %xmm0
	movd	20(%rsi), %xmm3
	movl	%edx, (%rsi)
	movl	8(%rsi), %edx
	punpckldq	%xmm3, %xmm0
	movl	%edx, 20(%rsi)
	movq	%xmm0, 8(%rsi)
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	movq	16(%rsi), %xmm0
	movq	(%rsi), %xmm1
	movdqa	%xmm0, %xmm2
	punpckldq	%xmm1, %xmm0
	punpckldq	%xmm1, %xmm2
	movq	%xmm0, (%rsi)
	pshufd	$14, %xmm2, %xmm2
	movq	%xmm2, 16(%rsi)
	ret
.L9:
	ret
	.cfi_endproc
.LFE35:
	.size	mD, .-mD
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB36:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$144, %rsp
	.cfi_def_cfa_offset 176
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbx
	leaq	24(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L12:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__isoc99_scanf@PLT
	cmpq	%rbx, %r12
	jne	.L12
	leaq	32(%rsp), %rbp
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	xorl	%ebx, %ebx
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	movl	(%rsp), %r12d
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L25:
	cmpb	$78, %al
	jne	.L18
	movd	4(%rsp), %xmm1
	movd	20(%rsp), %xmm3
	movd	%r12d, %xmm0
	movd	16(%rsp), %xmm4
	punpckldq	%xmm3, %xmm1
	punpckldq	%xmm4, %xmm0
	movq	%xmm1, (%rsp)
	movd	%xmm1, %r12d
	movq	%xmm0, 16(%rsp)
	.p2align 4,,10
	.p2align 3
.L18:
	addq	$1, %rbx
.L13:
	movq	%rbp, %rdi
	call	strlen@PLT
	cmpq	%rbx, %rax
	jbe	.L24
	movzbl	0(%rbp,%rbx), %eax
	cmpb	$83, %al
	je	.L14
	jg	.L15
	cmpb	$69, %al
	jne	.L25
	movd	20(%rsp), %xmm7
	movl	12(%rsp), %eax
	movd	%r12d, %xmm0
	movl	8(%rsp), %edx
	punpckldq	%xmm7, %xmm0
	movl	%eax, (%rsp)
	movl	%eax, %r12d
	movl	%edx, 20(%rsp)
	movq	%xmm0, 8(%rsp)
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L15:
	cmpb	$87, %al
	jne	.L18
	movd	20(%rsp), %xmm0
	movl	8(%rsp), %eax
	movd	%r12d, %xmm3
	movl	12(%rsp), %edx
	punpckldq	%xmm3, %xmm0
	movl	%eax, (%rsp)
	movl	%eax, %r12d
	movl	%edx, 20(%rsp)
	movq	%xmm0, 8(%rsp)
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L14:
	movd	16(%rsp), %xmm2
	movd	20(%rsp), %xmm0
	movd	%r12d, %xmm5
	movd	4(%rsp), %xmm6
	punpckldq	%xmm5, %xmm2
	punpckldq	%xmm6, %xmm0
	movd	%xmm2, %r12d
	movq	%xmm2, (%rsp)
	movq	%xmm0, 16(%rsp)
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L24:
	xorl	%eax, %eax
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L26
	addq	$144, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L26:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE36:
	.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
	.p2align 4
	.globl	mD
	.type	mD, @function
mD:
.LFB35:
	.cfi_startproc
	endbr64
	cmpb	$83, %dil
	je	.L2
	jg	.L3
	cmpb	$69, %dil
	je	.L4
	cmpb	$78, %dil
	jne	.L9
	movq	(%rsi), %xmm0
	movq	16(%rsi), %xmm1
	movdqa	%xmm0, %xmm2
	punpckldq	%xmm1, %xmm0
	punpckldq	%xmm1, %xmm2
	movq	%xmm0, 16(%rsi)
	pshufd	$14, %xmm2, %xmm2
	movq	%xmm2, (%rsi)
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	cmpb	$87, %dil
	jne	.L10
	movl	(%rsi), %edx
	movd	20(%rsi), %xmm0
	movl	8(%rsi), %ecx
	movd	%edx, %xmm4
	movl	12(%rsi), %edx
	punpckldq	%xmm4, %xmm0
	movl	%ecx, (%rsi)
	movl	%edx, 20(%rsi)
	movq	%xmm0, 8(%rsi)
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	movl	12(%rsi), %edx
	movd	(%rsi), %xmm0
	movd	20(%rsi), %xmm3
	movl	%edx, (%rsi)
	movl	8(%rsi), %edx
	punpckldq	%xmm3, %xmm0
	movl	%edx, 20(%rsi)
	movq	%xmm0, 8(%rsi)
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	movq	16(%rsi), %xmm0
	movq	(%rsi), %xmm1
	movdqa	%xmm0, %xmm2
	punpckldq	%xmm1, %xmm0
	punpckldq	%xmm1, %xmm2
	movq	%xmm0, (%rsi)
	pshufd	$14, %xmm2, %xmm2
	movq	%xmm2, 16(%rsi)
	ret
.L9:
	ret
	.cfi_endproc
.LFE35:
	.size	mD, .-mD
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB36:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$144, %rsp
	.cfi_def_cfa_offset 176
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbx
	leaq	24(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L12:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__isoc99_scanf@PLT
	cmpq	%rbx, %r12
	jne	.L12
	leaq	32(%rsp), %rbp
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	xorl	%ebx, %ebx
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	movl	(%rsp), %r12d
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L25:
	cmpb	$78, %al
	jne	.L18
	movd	4(%rsp), %xmm1
	movd	20(%rsp), %xmm3
	movd	%r12d, %xmm0
	movd	16(%rsp), %xmm4
	punpckldq	%xmm3, %xmm1
	punpckldq	%xmm4, %xmm0
	movq	%xmm1, (%rsp)
	movd	%xmm1, %r12d
	movq	%xmm0, 16(%rsp)
	.p2align 4,,10
	.p2align 3
.L18:
	addq	$1, %rbx
.L13:
	movq	%rbp, %rdi
	call	strlen@PLT
	cmpq	%rbx, %rax
	jbe	.L24
	movzbl	0(%rbp,%rbx), %eax
	cmpb	$83, %al
	je	.L14
	jg	.L15
	cmpb	$69, %al
	jne	.L25
	movd	20(%rsp), %xmm7
	movl	12(%rsp), %eax
	movd	%r12d, %xmm0
	movl	8(%rsp), %edx
	punpckldq	%xmm7, %xmm0
	movl	%eax, (%rsp)
	movl	%eax, %r12d
	movl	%edx, 20(%rsp)
	movq	%xmm0, 8(%rsp)
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L15:
	cmpb	$87, %al
	jne	.L18
	movd	20(%rsp), %xmm0
	movl	8(%rsp), %eax
	movd	%r12d, %xmm3
	movl	12(%rsp), %edx
	punpckldq	%xmm3, %xmm0
	movl	%eax, (%rsp)
	movl	%eax, %r12d
	movl	%edx, 20(%rsp)
	movq	%xmm0, 8(%rsp)
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L14:
	movd	16(%rsp), %xmm2
	movd	20(%rsp), %xmm0
	movd	%r12d, %xmm5
	movd	4(%rsp), %xmm6
	punpckldq	%xmm5, %xmm2
	punpckldq	%xmm6, %xmm0
	movd	%xmm2, %r12d
	movq	%xmm2, (%rsp)
	movq	%xmm0, 16(%rsp)
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L24:
	xorl	%eax, %eax
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L26
	addq	$144, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L26:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE36:
	.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>

void mD(char C, int *D) {
  switch (C) {
    int t;
  case 'N':
    t = D[0]; D[0] = D[1]; D[1] = D[5]; D[5] = D[4]; D[4] = t;
    break;
  case 'S':
    t = D[0]; D[0] = D[4]; D[4] = D[5]; D[5] = D[1]; D[1] = t;
    break;
  case 'E':
    t = D[0]; D[0] = D[3]; D[3] = D[5]; D[5] = D[2]; D[2] = t;
    break;
  case 'W':
    t = D[0]; D[0] = D[2]; D[2] = D[5]; D[5] = D[3]; D[3] = t;
    break;
  }
  return;
}

int main(void) {
  int D[6], d;
  char C[101];int c;
  for(d=0;d<6;d++)
    scanf("%d",&D[d]);
  scanf("%s",C);
  for (c=0;c<strlen(C);c++) {
    mD(C[c], D);
  }
  printf("%d\n",D[0]);

  return 0;
}
0 2 4 8 16 32
EESWN
 1 2 4 6 16 32
SE
 0 2 4 8 16 30
EESWN
 1 2 4 0 16 32
SE
 1 2 4 -1 16 32
SE
 0 2 0 8 16 23
EESWN
 1 2 4 8 16 32
ES
 1 2 4 8 27 32
ES
 0 4 4 8 16 5
EESWN
 1 4 4 -1 24 32
ES

32
 6
 30
 0
 -1
 23
 16
 27
 5
 24

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>

void mD(char C, int *D) {
  switch (C) {
    int t;
  case 'N':
    t = D[0]; D[0] = D[1]; D[1] = D[5]; D[5] = D[4]; D[4] = t;
    break;
  case 'S':
    t = D[0]; D[0] = D[4]; D[4] = D[5]; D[5] = D[1]; D[1] = t;
    break;
  case 'E':
    t = D[0]; D[0] = D[3]; D[3] = D[5]; D[5] = D[2]; D[2] = t;
    break;
  case 'W':
    t = D[0]; D[0] = D[2]; D[2] = D[5]; D[5] = D[3]; D[3] = t;
    break;
  }
  return;
}

int main(void) {
  int D[6], d;
  char C[101];int c;
  for(d=0;d<6;d++)
    scanf("%d",&D[d]);
  scanf("%s",C);
  for (c=0;c<strlen(C);c++) {
    mD(C[c], D);
  }
  printf("%d\n",D[0]);

  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	mD
	.type	mD, @function
mD:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, %eax
	movq	%rsi, -32(%rbp)
	movb	%al, -20(%rbp)
	movsbl	-20(%rbp), %eax
	cmpl	$87, %eax
	je	.L2
	cmpl	$87, %eax
	jg	.L7
	cmpl	$83, %eax
	je	.L4
	cmpl	$83, %eax
	jg	.L7
	cmpl	$69, %eax
	je	.L5
	cmpl	$78, %eax
	jne	.L7
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movq	-32(%rbp), %rax
	movl	4(%rax), %edx
	movq	-32(%rbp), %rax
	movl	%edx, (%rax)
	movq	-32(%rbp), %rax
	leaq	4(%rax), %rdx
	movq	-32(%rbp), %rax
	movl	20(%rax), %eax
	movl	%eax, (%rdx)
	movq	-32(%rbp), %rax
	leaq	20(%rax), %rdx
	movq	-32(%rbp), %rax
	movl	16(%rax), %eax
	movl	%eax, (%rdx)
	movq	-32(%rbp), %rax
	leaq	16(%rax), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rdx)
	jmp	.L3
.L4:
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movq	-32(%rbp), %rax
	movl	16(%rax), %edx
	movq	-32(%rbp), %rax
	movl	%edx, (%rax)
	movq	-32(%rbp), %rax
	leaq	16(%rax), %rdx
	movq	-32(%rbp), %rax
	movl	20(%rax), %eax
	movl	%eax, (%rdx)
	movq	-32(%rbp), %rax
	leaq	20(%rax), %rdx
	movq	-32(%rbp), %rax
	movl	4(%rax), %eax
	movl	%eax, (%rdx)
	movq	-32(%rbp), %rax
	leaq	4(%rax), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rdx)
	jmp	.L3
.L5:
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movq	-32(%rbp), %rax
	movl	12(%rax), %edx
	movq	-32(%rbp), %rax
	movl	%edx, (%rax)
	movq	-32(%rbp), %rax
	leaq	12(%rax), %rdx
	movq	-32(%rbp), %rax
	movl	20(%rax), %eax
	movl	%eax, (%rdx)
	movq	-32(%rbp), %rax
	leaq	20(%rax), %rdx
	movq	-32(%rbp), %rax
	movl	8(%rax), %eax
	movl	%eax, (%rdx)
	movq	-32(%rbp), %rax
	leaq	8(%rax), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rdx)
	jmp	.L3
.L2:
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movq	-32(%rbp), %rax
	movl	8(%rax), %edx
	movq	-32(%rbp), %rax
	movl	%edx, (%rax)
	movq	-32(%rbp), %rax
	leaq	8(%rax), %rdx
	movq	-32(%rbp), %rax
	movl	20(%rax), %eax
	movl	%eax, (%rdx)
	movq	-32(%rbp), %rax
	leaq	20(%rax), %rdx
	movq	-32(%rbp), %rax
	movl	12(%rax), %eax
	movl	%eax, (%rdx)
	movq	-32(%rbp), %rax
	leaq	12(%rax), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rdx)
	nop
.L3:
	nop
.L7:
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	mD, .-mD
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.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
	pushq	%rbx
	subq	$168, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movl	$0, -168(%rbp)
	jmp	.L9
.L10:
	leaq	-160(%rbp), %rdx
	movl	-168(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -168(%rbp)
.L9:
	cmpl	$5, -168(%rbp)
	jle	.L10
	leaq	-128(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -164(%rbp)
	jmp	.L11
.L12:
	movl	-164(%rbp), %eax
	cltq
	movzbl	-128(%rbp,%rax), %eax
	movsbl	%al, %eax
	leaq	-160(%rbp), %rdx
	movq	%rdx, %rsi
	movl	%eax, %edi
	call	mD
	addl	$1, -164(%rbp)
.L11:
	movl	-164(%rbp), %eax
	movslq	%eax, %rbx
	leaq	-128(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	cmpq	%rax, %rbx
	jb	.L12
	movl	-160(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	movq	-8(%rbp), %rbx
	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	mD
	.type	mD, @function
mD:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, %eax
	movq	%rsi, -32(%rbp)
	movb	%al, -20(%rbp)
	movsbl	-20(%rbp), %eax
	cmpl	$87, %eax
	je	.L2
	cmpl	$87, %eax
	jg	.L7
	cmpl	$83, %eax
	je	.L4
	cmpl	$83, %eax
	jg	.L7
	cmpl	$69, %eax
	je	.L5
	cmpl	$78, %eax
	jne	.L7
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movq	-32(%rbp), %rax
	movl	4(%rax), %edx
	movq	-32(%rbp), %rax
	movl	%edx, (%rax)
	movq	-32(%rbp), %rax
	leaq	4(%rax), %rdx
	movq	-32(%rbp), %rax
	movl	20(%rax), %eax
	movl	%eax, (%rdx)
	movq	-32(%rbp), %rax
	leaq	20(%rax), %rdx
	movq	-32(%rbp), %rax
	movl	16(%rax), %eax
	movl	%eax, (%rdx)
	movq	-32(%rbp), %rax
	leaq	16(%rax), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rdx)
	jmp	.L3
.L4:
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movq	-32(%rbp), %rax
	movl	16(%rax), %edx
	movq	-32(%rbp), %rax
	movl	%edx, (%rax)
	movq	-32(%rbp), %rax
	leaq	16(%rax), %rdx
	movq	-32(%rbp), %rax
	movl	20(%rax), %eax
	movl	%eax, (%rdx)
	movq	-32(%rbp), %rax
	leaq	20(%rax), %rdx
	movq	-32(%rbp), %rax
	movl	4(%rax), %eax
	movl	%eax, (%rdx)
	movq	-32(%rbp), %rax
	leaq	4(%rax), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rdx)
	jmp	.L3
.L5:
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movq	-32(%rbp), %rax
	movl	12(%rax), %edx
	movq	-32(%rbp), %rax
	movl	%edx, (%rax)
	movq	-32(%rbp), %rax
	leaq	12(%rax), %rdx
	movq	-32(%rbp), %rax
	movl	20(%rax), %eax
	movl	%eax, (%rdx)
	movq	-32(%rbp), %rax
	leaq	20(%rax), %rdx
	movq	-32(%rbp), %rax
	movl	8(%rax), %eax
	movl	%eax, (%rdx)
	movq	-32(%rbp), %rax
	leaq	8(%rax), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rdx)
	jmp	.L3
.L2:
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movq	-32(%rbp), %rax
	movl	8(%rax), %edx
	movq	-32(%rbp), %rax
	movl	%edx, (%rax)
	movq	-32(%rbp), %rax
	leaq	8(%rax), %rdx
	movq	-32(%rbp), %rax
	movl	20(%rax), %eax
	movl	%eax, (%rdx)
	movq	-32(%rbp), %rax
	leaq	20(%rax), %rdx
	movq	-32(%rbp), %rax
	movl	12(%rax), %eax
	movl	%eax, (%rdx)
	movq	-32(%rbp), %rax
	leaq	12(%rax), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rdx)
	nop
.L3:
	nop
.L7:
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	mD, .-mD
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.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
	pushq	%rbx
	subq	$168, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movl	$0, -168(%rbp)
	jmp	.L9
.L10:
	leaq	-160(%rbp), %rdx
	movl	-168(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -168(%rbp)
.L9:
	cmpl	$5, -168(%rbp)
	jle	.L10
	leaq	-128(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -164(%rbp)
	jmp	.L11
.L12:
	movl	-164(%rbp), %eax
	cltq
	movzbl	-128(%rbp,%rax), %eax
	movsbl	%al, %eax
	leaq	-160(%rbp), %rdx
	movq	%rdx, %rsi
	movl	%eax, %edi
	call	mD
	addl	$1, -164(%rbp)
.L11:
	movl	-164(%rbp), %eax
	movslq	%eax, %rbx
	leaq	-128(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	cmpq	%rax, %rbx
	jb	.L12
	movl	-160(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	movq	-8(%rbp), %rbx
	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:
