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) {
	int W, H;
	char c[4];
	int i, j;
	if (scanf("%d%d%1s", &W, &H, c) != 3) return 1;
	for (i = 0; i < H; i++) {
		for (j = 0; j < W; j++) {
			int pc = ' ';
			if ((i == 0 || i == H - 1) && (j == 0 || j == W - 1)) pc = '+';
			else if (i == 0 || i == H - 1) pc = '-';
			else if (j == 0 || j == W - 1) pc = '|';
			else if (i == H / 2 && j == W / 2) pc = c[0];
			else pc = '.';
			putchar(pc);
		}
		putchar('\n');
	}
	return 0;
}

```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d%1s"
	.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	.LC0(%rip), %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	subq	$40, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rcx
	leaq	16(%rsp), %rdx
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	%eax, %r8d
	movl	$1, %eax
	cmpl	$3, %r8d
	jne	.L1
	xorl	%ebp, %ebp
	cmpl	$0, 16(%rsp)
	jle	.L11
	.p2align 4,,10
	.p2align 3
.L3:
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L13
	xorl	%ebx, %ebx
	testl	%ebp, %ebp
	jne	.L7
	movl	$43, %edi
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L10:
	subl	$1, %eax
	xorl	%edi, %edi
	cmpl	%ebx, %eax
	setne	%dil
	leal	43(%rdi,%rdi), %edi
.L4:
	movq	stdout(%rip), %rsi
	addl	$1, %ebx
	call	putc@PLT
	movl	12(%rsp), %eax
	cmpl	%ebx, %eax
	jg	.L10
.L13:
	movq	stdout(%rip), %rsi
	movl	$10, %edi
	addl	$1, %ebp
	call	putc@PLT
	cmpl	%ebp, 16(%rsp)
	jg	.L3
.L11:
	xorl	%eax, %eax
.L1:
	movq	24(%rsp), %rdx
	subq	%fs:40, %rdx
	jne	.L32
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	movl	$124, %edi
	testl	%ebx, %ebx
	je	.L6
	leal	-1(%rax), %ecx
	cmpl	%ebx, %ecx
	je	.L6
	movl	%edx, %ecx
	movl	$46, %edi
	shrl	$31, %ecx
	addl	%ecx, %edx
	sarl	%edx
	cmpl	%ebp, %edx
	je	.L33
	.p2align 4,,10
	.p2align 3
.L6:
	movq	stdout(%rip), %rsi
	addl	$1, %ebx
	call	putc@PLT
	movl	12(%rsp), %eax
	cmpl	%eax, %ebx
	jge	.L13
.L7:
	movl	16(%rsp), %edx
	leal	-1(%rdx), %ecx
	cmpl	%ecx, %ebp
	jne	.L5
	movl	$43, %edi
	testl	%ebx, %ebx
	je	.L6
	subl	$1, %eax
	xorl	%edi, %edi
	cmpl	%ebx, %eax
	setne	%dil
	leal	43(%rdi,%rdi), %edi
	jmp	.L6
.L33:
	sarl	%eax
	cmpl	%ebx, %eax
	jne	.L6
	movsbl	20(%rsp), %edi
	jmp	.L6
.L32:
	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	"%d%d%1s"
	.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	.LC0(%rip), %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	subq	$40, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rcx
	leaq	16(%rsp), %rdx
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	%eax, %r8d
	movl	$1, %eax
	cmpl	$3, %r8d
	jne	.L1
	xorl	%ebp, %ebp
	cmpl	$0, 16(%rsp)
	jle	.L11
	.p2align 4,,10
	.p2align 3
.L3:
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L13
	xorl	%ebx, %ebx
	testl	%ebp, %ebp
	jne	.L7
	movl	$43, %edi
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L10:
	subl	$1, %eax
	xorl	%edi, %edi
	cmpl	%ebx, %eax
	setne	%dil
	leal	43(%rdi,%rdi), %edi
.L4:
	movq	stdout(%rip), %rsi
	addl	$1, %ebx
	call	putc@PLT
	movl	12(%rsp), %eax
	cmpl	%ebx, %eax
	jg	.L10
.L13:
	movq	stdout(%rip), %rsi
	movl	$10, %edi
	addl	$1, %ebp
	call	putc@PLT
	cmpl	%ebp, 16(%rsp)
	jg	.L3
.L11:
	xorl	%eax, %eax
.L1:
	movq	24(%rsp), %rdx
	subq	%fs:40, %rdx
	jne	.L32
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	movl	$124, %edi
	testl	%ebx, %ebx
	je	.L6
	leal	-1(%rax), %ecx
	cmpl	%ebx, %ecx
	je	.L6
	movl	%edx, %ecx
	movl	$46, %edi
	shrl	$31, %ecx
	addl	%ecx, %edx
	sarl	%edx
	cmpl	%ebp, %edx
	je	.L33
	.p2align 4,,10
	.p2align 3
.L6:
	movq	stdout(%rip), %rsi
	addl	$1, %ebx
	call	putc@PLT
	movl	12(%rsp), %eax
	cmpl	%eax, %ebx
	jge	.L13
.L7:
	movl	16(%rsp), %edx
	leal	-1(%rdx), %ecx
	cmpl	%ecx, %ebp
	jne	.L5
	movl	$43, %edi
	testl	%ebx, %ebx
	je	.L6
	subl	$1, %eax
	xorl	%edi, %edi
	cmpl	%ebx, %eax
	setne	%dil
	leal	43(%rdi,%rdi), %edi
	jmp	.L6
.L33:
	sarl	%eax
	cmpl	%ebx, %eax
	jne	.L6
	movsbl	20(%rsp), %edi
	jmp	.L6
.L32:
	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	"%d%d%1s"
	.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	.LC0(%rip), %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	subq	$40, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rcx
	leaq	16(%rsp), %rdx
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	%eax, %r8d
	movl	$1, %eax
	cmpl	$3, %r8d
	jne	.L1
	xorl	%ebp, %ebp
	cmpl	$0, 16(%rsp)
	jle	.L11
	.p2align 4,,10
	.p2align 3
.L3:
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L13
	xorl	%ebx, %ebx
	testl	%ebp, %ebp
	jne	.L7
	movl	$43, %edi
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L10:
	subl	$1, %eax
	xorl	%edi, %edi
	cmpl	%ebx, %eax
	setne	%dil
	leal	43(%rdi,%rdi), %edi
.L4:
	movq	stdout(%rip), %rsi
	addl	$1, %ebx
	call	putc@PLT
	movl	12(%rsp), %eax
	cmpl	%ebx, %eax
	jg	.L10
.L13:
	movq	stdout(%rip), %rsi
	movl	$10, %edi
	addl	$1, %ebp
	call	putc@PLT
	cmpl	%ebp, 16(%rsp)
	jg	.L3
.L11:
	xorl	%eax, %eax
.L1:
	movq	24(%rsp), %rdx
	subq	%fs:40, %rdx
	jne	.L32
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	movl	$124, %edi
	testl	%ebx, %ebx
	je	.L6
	leal	-1(%rax), %ecx
	cmpl	%ebx, %ecx
	je	.L6
	movl	%edx, %ecx
	movl	$46, %edi
	shrl	$31, %ecx
	addl	%ecx, %edx
	sarl	%edx
	cmpl	%ebp, %edx
	je	.L33
	.p2align 4,,10
	.p2align 3
.L6:
	movq	stdout(%rip), %rsi
	addl	$1, %ebx
	call	putc@PLT
	movl	12(%rsp), %eax
	cmpl	%eax, %ebx
	jge	.L13
.L7:
	movl	16(%rsp), %edx
	leal	-1(%rdx), %ecx
	cmpl	%ecx, %ebp
	jne	.L5
	movl	$43, %edi
	testl	%ebx, %ebx
	je	.L6
	subl	$1, %eax
	xorl	%edi, %edi
	cmpl	%ebx, %eax
	setne	%dil
	leal	43(%rdi,%rdi), %edi
	jmp	.L6
.L33:
	sarl	%eax
	cmpl	%ebx, %eax
	jne	.L6
	movsbl	20(%rsp), %edi
	jmp	.L6
.L32:
	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) {
	int W, H;
	char c[4];
	int i, j;
	if (scanf("%d%d%1s", &W, &H, c) != 3) return 1;
	for (i = 0; i < H; i++) {
		for (j = 0; j < W; j++) {
			int pc = ' ';
			if ((i == 0 || i == H - 1) && (j == 0 || j == W - 1)) pc = '+';
			else if (i == 0 || i == H - 1) pc = '-';
			else if (j == 0 || j == W - 1) pc = '|';
			else if (i == H / 2 && j == W / 2) pc = c[0];
			else pc = '.';
			putchar(pc);
		}
		putchar('\n');
	}
	return 0;
}

```
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) {
	int W, H;
	char c[4];
	int i, j;
	if (scanf("%d%d%1s", &W, &H, c) != 3) return 1;
	for (i = 0; i < H; i++) {
		for (j = 0; j < W; j++) {
			int pc = ' ';
			if ((i == 0 || i == H - 1) && (j == 0 || j == W - 1)) pc = '+';
			else if (i == 0 || i == H - 1) pc = '-';
			else if (j == 0 || j == W - 1) pc = '|';
			else if (i == H / 2 && j == W / 2) pc = c[0];
			else pc = '.';
			putchar(pc);
		}
		putchar('\n');
	}
	return 0;
}

```

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:

3 3 B

+-+
|B|
+-+

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) {
	int W, H;
	char c[4];
	int i, j;
	if (scanf("%d%d%1s", &W, &H, c) != 3) return 1;
	for (i = 0; i < H; i++) {
		for (j = 0; j < W; j++) {
			int pc = ' ';
			if ((i == 0 || i == H - 1) && (j == 0 || j == W - 1)) pc = '+';
			else if (i == 0 || i == H - 1) pc = '-';
			else if (j == 0 || j == W - 1) pc = '|';
			else if (i == H / 2 && j == W / 2) pc = c[0];
			else pc = '.';
			putchar(pc);
		}
		putchar('\n');
	}
	return 0;
}

```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d%1s"
	.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	.LC0(%rip), %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	subq	$40, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rcx
	leaq	16(%rsp), %rdx
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	%eax, %r8d
	movl	$1, %eax
	cmpl	$3, %r8d
	jne	.L1
	xorl	%ebp, %ebp
	cmpl	$0, 16(%rsp)
	jle	.L11
	.p2align 4,,10
	.p2align 3
.L3:
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L13
	xorl	%ebx, %ebx
	testl	%ebp, %ebp
	jne	.L7
	movl	$43, %edi
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L10:
	subl	$1, %eax
	xorl	%edi, %edi
	cmpl	%ebx, %eax
	setne	%dil
	leal	43(%rdi,%rdi), %edi
.L4:
	movq	stdout(%rip), %rsi
	addl	$1, %ebx
	call	putc@PLT
	movl	12(%rsp), %eax
	cmpl	%ebx, %eax
	jg	.L10
.L13:
	movq	stdout(%rip), %rsi
	movl	$10, %edi
	addl	$1, %ebp
	call	putc@PLT
	cmpl	%ebp, 16(%rsp)
	jg	.L3
.L11:
	xorl	%eax, %eax
.L1:
	movq	24(%rsp), %rdx
	subq	%fs:40, %rdx
	jne	.L32
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	movl	$124, %edi
	testl	%ebx, %ebx
	je	.L6
	leal	-1(%rax), %ecx
	cmpl	%ebx, %ecx
	je	.L6
	movl	%edx, %ecx
	movl	$46, %edi
	shrl	$31, %ecx
	addl	%ecx, %edx
	sarl	%edx
	cmpl	%ebp, %edx
	je	.L33
	.p2align 4,,10
	.p2align 3
.L6:
	movq	stdout(%rip), %rsi
	addl	$1, %ebx
	call	putc@PLT
	movl	12(%rsp), %eax
	cmpl	%eax, %ebx
	jge	.L13
.L7:
	movl	16(%rsp), %edx
	leal	-1(%rdx), %ecx
	cmpl	%ecx, %ebp
	jne	.L5
	movl	$43, %edi
	testl	%ebx, %ebx
	je	.L6
	subl	$1, %eax
	xorl	%edi, %edi
	cmpl	%ebx, %eax
	setne	%dil
	leal	43(%rdi,%rdi), %edi
	jmp	.L6
.L33:
	sarl	%eax
	cmpl	%ebx, %eax
	jne	.L6
	movsbl	20(%rsp), %edi
	jmp	.L6
.L32:
	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	"%d%d%1s"
	.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	.LC0(%rip), %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	subq	$40, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rcx
	leaq	16(%rsp), %rdx
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	%eax, %r8d
	movl	$1, %eax
	cmpl	$3, %r8d
	jne	.L1
	xorl	%ebp, %ebp
	cmpl	$0, 16(%rsp)
	jle	.L11
	.p2align 4,,10
	.p2align 3
.L3:
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L13
	xorl	%ebx, %ebx
	testl	%ebp, %ebp
	jne	.L7
	movl	$43, %edi
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L10:
	subl	$1, %eax
	xorl	%edi, %edi
	cmpl	%ebx, %eax
	setne	%dil
	leal	43(%rdi,%rdi), %edi
.L4:
	movq	stdout(%rip), %rsi
	addl	$1, %ebx
	call	putc@PLT
	movl	12(%rsp), %eax
	cmpl	%ebx, %eax
	jg	.L10
.L13:
	movq	stdout(%rip), %rsi
	movl	$10, %edi
	addl	$1, %ebp
	call	putc@PLT
	cmpl	%ebp, 16(%rsp)
	jg	.L3
.L11:
	xorl	%eax, %eax
.L1:
	movq	24(%rsp), %rdx
	subq	%fs:40, %rdx
	jne	.L32
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	movl	$124, %edi
	testl	%ebx, %ebx
	je	.L6
	leal	-1(%rax), %ecx
	cmpl	%ebx, %ecx
	je	.L6
	movl	%edx, %ecx
	movl	$46, %edi
	shrl	$31, %ecx
	addl	%ecx, %edx
	sarl	%edx
	cmpl	%ebp, %edx
	je	.L33
	.p2align 4,,10
	.p2align 3
.L6:
	movq	stdout(%rip), %rsi
	addl	$1, %ebx
	call	putc@PLT
	movl	12(%rsp), %eax
	cmpl	%eax, %ebx
	jge	.L13
.L7:
	movl	16(%rsp), %edx
	leal	-1(%rdx), %ecx
	cmpl	%ecx, %ebp
	jne	.L5
	movl	$43, %edi
	testl	%ebx, %ebx
	je	.L6
	subl	$1, %eax
	xorl	%edi, %edi
	cmpl	%ebx, %eax
	setne	%dil
	leal	43(%rdi,%rdi), %edi
	jmp	.L6
.L33:
	sarl	%eax
	cmpl	%ebx, %eax
	jne	.L6
	movsbl	20(%rsp), %edi
	jmp	.L6
.L32:
	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:
```