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>
 
int main(){
  int h, w;  scanf("%d %d", &h, &w);
  char field[103][103];
  for(int i=0; i<h; i++)
    scanf("%s", field[i]);
  for(int i=0; i<w+2; i++)  printf("#");  puts("");
  for(int i=0; i<h; i++)
    printf("#%s#\n", field[i]);
  for(int i=0; i<w+2; i++)  printf("#");  puts("");
 
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%s"
.LC2:
	.string	""
.LC3:
	.string	"#%s#\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$2464, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-10644(%rbp), %rdx
	leaq	-10648(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -10640(%rbp)
	jmp	.L2
.L3:
	leaq	-10624(%rbp), %rdx
	movl	-10640(%rbp), %eax
	cltq
	imulq	$103, %rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -10640(%rbp)
.L2:
	movl	-10648(%rbp), %eax
	cmpl	%eax, -10640(%rbp)
	jl	.L3
	movl	$0, -10636(%rbp)
	jmp	.L4
.L5:
	movl	$35, %edi
	call	putchar@PLT
	addl	$1, -10636(%rbp)
.L4:
	movl	-10644(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -10636(%rbp)
	jle	.L5
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, -10632(%rbp)
	jmp	.L6
.L7:
	leaq	-10624(%rbp), %rdx
	movl	-10632(%rbp), %eax
	cltq
	imulq	$103, %rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -10632(%rbp)
.L6:
	movl	-10648(%rbp), %eax
	cmpl	%eax, -10632(%rbp)
	jl	.L7
	movl	$0, -10628(%rbp)
	jmp	.L8
.L9:
	movl	$35, %edi
	call	putchar@PLT
	addl	$1, -10628(%rbp)
.L8:
	movl	-10644(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -10628(%rbp)
	jle	.L9
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%s"
.LC2:
	.string	""
.LC3:
	.string	"#%s#\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
	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	$4096, %rsp
	.cfi_def_cfa_offset 4136
	orq	$0, (%rsp)
	subq	$4096, %rsp
	.cfi_def_cfa_offset 8232
	orq	$0, (%rsp)
	subq	$2456, %rsp
	.cfi_def_cfa_offset 10688
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 10632(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rdx
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %edx
	testl	%edx, %edx
	jle	.L2
	leaq	16(%rsp), %rbp
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	addq	$103, %rbp
	cmpl	%ebx, 8(%rsp)
	jg	.L3
.L2:
	cmpl	$-1, 12(%rsp)
	jl	.L4
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L5:
	movl	$35, %edi
	call	putchar@PLT
	movl	%ebx, %eax
	addl	$1, %ebx
	cmpl	%eax, 12(%rsp)
	jge	.L5
.L4:
	leaq	.LC2(%rip), %r13
	movq	%r13, %rdi
	call	puts@PLT
	movl	8(%rsp), %eax
	testl	%eax, %eax
	jle	.L6
	leaq	16(%rsp), %rbp
	xorl	%ebx, %ebx
	leaq	.LC3(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%rbp, %rdx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addl	$1, %ebx
	addq	$103, %rbp
	cmpl	%ebx, 8(%rsp)
	jg	.L7
.L6:
	cmpl	$-1, 12(%rsp)
	jl	.L8
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L9:
	movl	$35, %edi
	call	putchar@PLT
	movl	%ebx, %eax
	addl	$1, %ebx
	cmpl	%eax, 12(%rsp)
	jge	.L9
.L8:
	movq	%r13, %rdi
	call	puts@PLT
	movq	10632(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$10648, %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
.L17:
	.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
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%s"
.LC2:
	.string	""
.LC3:
	.string	"#%s#\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
	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	$4096, %rsp
	.cfi_def_cfa_offset 4136
	orq	$0, (%rsp)
	subq	$4096, %rsp
	.cfi_def_cfa_offset 8232
	orq	$0, (%rsp)
	subq	$2456, %rsp
	.cfi_def_cfa_offset 10688
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 10632(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rdx
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %edx
	testl	%edx, %edx
	jle	.L2
	leaq	16(%rsp), %rbp
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	addq	$103, %rbp
	cmpl	%ebx, 8(%rsp)
	jg	.L3
.L2:
	cmpl	$-1, 12(%rsp)
	jl	.L4
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L5:
	movl	$35, %edi
	call	putchar@PLT
	movl	%ebx, %eax
	addl	$1, %ebx
	cmpl	%eax, 12(%rsp)
	jge	.L5
.L4:
	leaq	.LC2(%rip), %r13
	movq	%r13, %rdi
	call	puts@PLT
	movl	8(%rsp), %eax
	testl	%eax, %eax
	jle	.L6
	leaq	16(%rsp), %rbp
	xorl	%ebx, %ebx
	leaq	.LC3(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%rbp, %rdx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addl	$1, %ebx
	addq	$103, %rbp
	cmpl	%ebx, 8(%rsp)
	jg	.L7
.L6:
	cmpl	$-1, 12(%rsp)
	jl	.L8
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L9:
	movl	$35, %edi
	call	putchar@PLT
	movl	%ebx, %eax
	addl	$1, %ebx
	cmpl	%eax, 12(%rsp)
	jge	.L9
.L8:
	movq	%r13, %rdi
	call	puts@PLT
	movq	10632(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$10648, %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
.L17:
	.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:

#include <stdio.h>
 
int main(){
  int h, w;  scanf("%d %d", &h, &w);
  char field[103][103];
  for(int i=0; i<h; i++)
    scanf("%s", field[i]);
  for(int i=0; i<w+2; i++)  printf("#");  puts("");
  for(int i=0; i<h; i++)
    printf("#%s#\n", field[i]);
  for(int i=0; i<w+2; i++)  printf("#");  puts("");
 
  return 0;
}
2 3
abc
brc
 1 1
y
 2 3
abc
bqc
 0 1
y
 2 1
abc
brc
 1 1
x
 1 2
z
 0 2
z
 -2 0
z
 -2 -1
z

#####
#abc#
#brc#
#####
 ###
#y#
###
 #####
#abc#
#bqc#
#####
 ###
###
 ###
#abc#
#brc#
###
 ###
#x#
###
 ####
#z#
####
 ####
####
 ##
##
 #
#

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>
 
int main(){
  int h, w;  scanf("%d %d", &h, &w);
  char field[103][103];
  for(int i=0; i<h; i++)
    scanf("%s", field[i]);
  for(int i=0; i<w+2; i++)  printf("#");  puts("");
  for(int i=0; i<h; i++)
    printf("#%s#\n", field[i]);
  for(int i=0; i<w+2; i++)  printf("#");  puts("");
 
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%s"
.LC2:
	.string	""
.LC3:
	.string	"#%s#\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$2464, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-10644(%rbp), %rdx
	leaq	-10648(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -10640(%rbp)
	jmp	.L2
.L3:
	leaq	-10624(%rbp), %rdx
	movl	-10640(%rbp), %eax
	cltq
	imulq	$103, %rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -10640(%rbp)
.L2:
	movl	-10648(%rbp), %eax
	cmpl	%eax, -10640(%rbp)
	jl	.L3
	movl	$0, -10636(%rbp)
	jmp	.L4
.L5:
	movl	$35, %edi
	call	putchar@PLT
	addl	$1, -10636(%rbp)
.L4:
	movl	-10644(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -10636(%rbp)
	jle	.L5
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, -10632(%rbp)
	jmp	.L6
.L7:
	leaq	-10624(%rbp), %rdx
	movl	-10632(%rbp), %eax
	cltq
	imulq	$103, %rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -10632(%rbp)
.L6:
	movl	-10648(%rbp), %eax
	cmpl	%eax, -10632(%rbp)
	jl	.L7
	movl	$0, -10628(%rbp)
	jmp	.L8
.L9:
	movl	$35, %edi
	call	putchar@PLT
	addl	$1, -10628(%rbp)
.L8:
	movl	-10644(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -10628(%rbp)
	jle	.L9
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%s"
.LC2:
	.string	""
.LC3:
	.string	"#%s#\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$2464, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-10644(%rbp), %rdx
	leaq	-10648(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -10640(%rbp)
	jmp	.L2
.L3:
	leaq	-10624(%rbp), %rdx
	movl	-10640(%rbp), %eax
	cltq
	imulq	$103, %rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -10640(%rbp)
.L2:
	movl	-10648(%rbp), %eax
	cmpl	%eax, -10640(%rbp)
	jl	.L3
	movl	$0, -10636(%rbp)
	jmp	.L4
.L5:
	movl	$35, %edi
	call	putchar@PLT
	addl	$1, -10636(%rbp)
.L4:
	movl	-10644(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -10636(%rbp)
	jle	.L5
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, -10632(%rbp)
	jmp	.L6
.L7:
	leaq	-10624(%rbp), %rdx
	movl	-10632(%rbp), %eax
	cltq
	imulq	$103, %rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -10632(%rbp)
.L6:
	movl	-10648(%rbp), %eax
	cmpl	%eax, -10632(%rbp)
	jl	.L7
	movl	$0, -10628(%rbp)
	jmp	.L8
.L9:
	movl	$35, %edi
	call	putchar@PLT
	addl	$1, -10628(%rbp)
.L8:
	movl	-10644(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -10628(%rbp)
	jle	.L9
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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:
