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(void){
    // Your code here!
    char str[200001];
    char *pstr = str;
    int len = 0;
    
    scanf("%200000s",str);
    
    while(*pstr){
        pstr++;
        len++;
    }
    
    for(int i = len-1; i >= 0; i--){
        if(str[i] == '?'){
            if(i == len -1){
                str[i] = 'D';
            }
            else if(str[i+1] == 'P'){
                str[i] = 'D';
            }
            else if(str[i+1] == 'D'){
                str[i] = 'D';
            }
        }
    }
    
    printf("%s\n",str);
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%200000s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	-196608(%rsp), %r11
	.cfi_def_cfa 11, 196624
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3408, %rsp
	.cfi_def_cfa_offset 200032
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 200008(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbp
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	xorl	%eax, %eax
	cmpb	$0, (%rsp)
	je	.L7
	.p2align 4,,10
	.p2align 3
.L2:
	movl	%eax, %ecx
	addq	$1, %rax
	cmpb	$0, 0(%rbp,%rax)
	jne	.L2
	movslq	%ecx, %rdx
	movl	%ecx, %eax
	addq	%rbp, %rdx
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	subl	$1, %eax
	subq	$1, %rdx
	cmpl	$-1, %eax
	je	.L7
.L6:
	cmpb	$63, (%rdx)
	jne	.L3
	cmpl	%eax, %ecx
	je	.L16
	leal	1(%rax), %esi
	movslq	%esi, %rsi
	movzbl	(%rsp,%rsi), %esi
	cmpb	$80, %sil
	je	.L16
	cmpb	$68, %sil
	jne	.L3
.L16:
	subl	$1, %eax
	movb	$68, (%rdx)
	subq	$1, %rdx
	cmpl	$-1, %eax
	jne	.L6
.L7:
	movq	%rbp, %rdi
	call	puts@PLT
	movq	200008(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L18
	addq	$200016, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L18:
	.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:
```

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
.LC0:
	.string	"%200000s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	-196608(%rsp), %r11
	.cfi_def_cfa 11, 196624
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3408, %rsp
	.cfi_def_cfa_offset 200032
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 200008(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbp
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	xorl	%eax, %eax
	cmpb	$0, (%rsp)
	je	.L7
	.p2align 4,,10
	.p2align 3
.L2:
	movl	%eax, %ecx
	addq	$1, %rax
	cmpb	$0, 0(%rbp,%rax)
	jne	.L2
	movslq	%ecx, %rdx
	movl	%ecx, %eax
	addq	%rbp, %rdx
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	subl	$1, %eax
	subq	$1, %rdx
	cmpl	$-1, %eax
	je	.L7
.L6:
	cmpb	$63, (%rdx)
	jne	.L3
	cmpl	%eax, %ecx
	je	.L16
	leal	1(%rax), %esi
	movslq	%esi, %rsi
	movzbl	(%rsp,%rsi), %esi
	cmpb	$80, %sil
	je	.L16
	cmpb	$68, %sil
	jne	.L3
.L16:
	subl	$1, %eax
	movb	$68, (%rdx)
	subq	$1, %rdx
	cmpl	$-1, %eax
	jne	.L6
.L7:
	movq	%rbp, %rdi
	call	puts@PLT
	movq	200008(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L18
	addq	$200016, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L18:
	.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
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%200000s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	-196608(%rsp), %r11
	.cfi_def_cfa 11, 196624
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3408, %rsp
	.cfi_def_cfa_offset 200032
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 200008(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbp
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	xorl	%eax, %eax
	cmpb	$0, (%rsp)
	je	.L7
	.p2align 4,,10
	.p2align 3
.L2:
	movl	%eax, %ecx
	addq	$1, %rax
	cmpb	$0, 0(%rbp,%rax)
	jne	.L2
	movslq	%ecx, %rdx
	movl	%ecx, %eax
	addq	%rbp, %rdx
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	subl	$1, %eax
	subq	$1, %rdx
	cmpl	$-1, %eax
	je	.L7
.L6:
	cmpb	$63, (%rdx)
	jne	.L3
	cmpl	%eax, %ecx
	je	.L16
	leal	1(%rax), %esi
	movslq	%esi, %rsi
	movzbl	(%rsp,%rsi), %esi
	cmpb	$80, %sil
	je	.L16
	cmpb	$68, %sil
	jne	.L3
.L16:
	subl	$1, %eax
	movb	$68, (%rdx)
	subq	$1, %rdx
	cmpl	$-1, %eax
	jne	.L6
.L7:
	movq	%rbp, %rdi
	call	puts@PLT
	movq	200008(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L18
	addq	$200016, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L18:
	.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:
```
```c
#include <stdio.h>
int main(void){
    // Your code here!
    char str[200001];
    char *pstr = str;
    int len = 0;
    
    scanf("%200000s",str);
    
    while(*pstr){
        pstr++;
        len++;
    }
    
    for(int i = len-1; i >= 0; i--){
        if(str[i] == '?'){
            if(i == len -1){
                str[i] = 'D';
            }
            else if(str[i+1] == 'P'){
                str[i] = 'D';
            }
            else if(str[i+1] == 'D'){
                str[i] = 'D';
            }
        }
    }
    
    printf("%s\n",str);
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
int main(void){
    // Your code here!
    char str[200001];
    char *pstr = str;
    int len = 0;
    
    scanf("%200000s",str);
    
    while(*pstr){
        pstr++;
        len++;
    }
    
    for(int i = len-1; i >= 0; i--){
        if(str[i] == '?'){
            if(i == len -1){
                str[i] = 'D';
            }
            else if(str[i+1] == 'P'){
                str[i] = 'D';
            }
            else if(str[i+1] == 'D'){
                str[i] = 'D';
            }
        }
    }
    
    printf("%s\n",str);
}```

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:

PDPD???
 ?P?P
 DDPP???
 ??PP
 DDPO???
 ??OP
 DDPO?>?
 ??OO
 ?>?OPDD
 @?OP

PDPDDDD
 DPDP
 DDPPDDD
 DDPP
 DDPODDD
 ??OP
 DDPO?>D
 ??OO
 ?>?OPDD
 @?OP

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(void){
    // Your code here!
    char str[200001];
    char *pstr = str;
    int len = 0;
    
    scanf("%200000s",str);
    
    while(*pstr){
        pstr++;
        len++;
    }
    
    for(int i = len-1; i >= 0; i--){
        if(str[i] == '?'){
            if(i == len -1){
                str[i] = 'D';
            }
            else if(str[i+1] == 'P'){
                str[i] = 'D';
            }
            else if(str[i+1] == 'D'){
                str[i] = 'D';
            }
        }
    }
    
    printf("%s\n",str);
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%200000s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	-196608(%rsp), %r11
	.cfi_def_cfa 11, 196624
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3408, %rsp
	.cfi_def_cfa_offset 200032
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 200008(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbp
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	xorl	%eax, %eax
	cmpb	$0, (%rsp)
	je	.L7
	.p2align 4,,10
	.p2align 3
.L2:
	movl	%eax, %ecx
	addq	$1, %rax
	cmpb	$0, 0(%rbp,%rax)
	jne	.L2
	movslq	%ecx, %rdx
	movl	%ecx, %eax
	addq	%rbp, %rdx
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	subl	$1, %eax
	subq	$1, %rdx
	cmpl	$-1, %eax
	je	.L7
.L6:
	cmpb	$63, (%rdx)
	jne	.L3
	cmpl	%eax, %ecx
	je	.L16
	leal	1(%rax), %esi
	movslq	%esi, %rsi
	movzbl	(%rsp,%rsi), %esi
	cmpb	$80, %sil
	je	.L16
	cmpb	$68, %sil
	jne	.L3
.L16:
	subl	$1, %eax
	movb	$68, (%rdx)
	subq	$1, %rdx
	cmpl	$-1, %eax
	jne	.L6
.L7:
	movq	%rbp, %rdi
	call	puts@PLT
	movq	200008(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L18
	addq	$200016, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L18:
	.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:
```

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
.LC0:
	.string	"%200000s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	-196608(%rsp), %r11
	.cfi_def_cfa 11, 196624
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3408, %rsp
	.cfi_def_cfa_offset 200032
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 200008(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbp
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	xorl	%eax, %eax
	cmpb	$0, (%rsp)
	je	.L7
	.p2align 4,,10
	.p2align 3
.L2:
	movl	%eax, %ecx
	addq	$1, %rax
	cmpb	$0, 0(%rbp,%rax)
	jne	.L2
	movslq	%ecx, %rdx
	movl	%ecx, %eax
	addq	%rbp, %rdx
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	subl	$1, %eax
	subq	$1, %rdx
	cmpl	$-1, %eax
	je	.L7
.L6:
	cmpb	$63, (%rdx)
	jne	.L3
	cmpl	%eax, %ecx
	je	.L16
	leal	1(%rax), %esi
	movslq	%esi, %rsi
	movzbl	(%rsp,%rsi), %esi
	cmpb	$80, %sil
	je	.L16
	cmpb	$68, %sil
	jne	.L3
.L16:
	subl	$1, %eax
	movb	$68, (%rdx)
	subq	$1, %rdx
	cmpl	$-1, %eax
	jne	.L6
.L7:
	movq	%rbp, %rdi
	call	puts@PLT
	movq	200008(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L18
	addq	$200016, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L18:
	.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:
```