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

int main(void)
{
	long int i, j, k;
	long int h, w, a, b;
	long int count = 0;
	long int flg = 0;
	long int flgs = 0;
	long int flgfirst = 0;
	long int masu[1001][1001];
	
	scanf("%ld%ld%ld%ld", &h, &w, &a, &b);
	
	for(i = 1; i <= h; i++) {
		for(j = 1; j <= w; j++) {
			if (i <= h - b)
			{
				if (j <= w - a)
				{
					masu[i][j] = 1;
				}
				else
				{
					masu[i][j] = 0;
				}
			}
			else
			{
				if (j <= w - a)
				{
					masu[i][j] = 0;
				}
				else
				{
					masu[i][j] = 1;
				}
			}
		}
	}
	
	for (i = 1; i <= h; i++)
	{
		for (j = 1; j <= w; j++)
		{
			printf("%ld", masu[i][j]);
		}
		printf("\n");
	}
	
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%ld%ld%ld%ld"
.LC1:
	.string	"%ld"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-8015872(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$224, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -8016048(%rbp)
	movq	$0, -8016040(%rbp)
	movq	$0, -8016032(%rbp)
	movq	$0, -8016024(%rbp)
	leaq	-8016072(%rbp), %rsi
	leaq	-8016080(%rbp), %rcx
	leaq	-8016088(%rbp), %rdx
	leaq	-8016096(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$1, -8016064(%rbp)
	jmp	.L2
.L9:
	movq	$1, -8016056(%rbp)
	jmp	.L3
.L8:
	movq	-8016096(%rbp), %rax
	movq	-8016072(%rbp), %rdx
	subq	%rdx, %rax
	cmpq	%rax, -8016064(%rbp)
	jg	.L4
	movq	-8016088(%rbp), %rax
	movq	-8016080(%rbp), %rdx
	subq	%rdx, %rax
	cmpq	%rax, -8016056(%rbp)
	jg	.L5
	movq	-8016064(%rbp), %rax
	imulq	$1001, %rax, %rdx
	movq	-8016056(%rbp), %rax
	addq	%rdx, %rax
	movq	$1, -8016016(%rbp,%rax,8)
	jmp	.L6
.L5:
	movq	-8016064(%rbp), %rax
	imulq	$1001, %rax, %rdx
	movq	-8016056(%rbp), %rax
	addq	%rdx, %rax
	movq	$0, -8016016(%rbp,%rax,8)
	jmp	.L6
.L4:
	movq	-8016088(%rbp), %rax
	movq	-8016080(%rbp), %rdx
	subq	%rdx, %rax
	cmpq	%rax, -8016056(%rbp)
	jg	.L7
	movq	-8016064(%rbp), %rax
	imulq	$1001, %rax, %rdx
	movq	-8016056(%rbp), %rax
	addq	%rdx, %rax
	movq	$0, -8016016(%rbp,%rax,8)
	jmp	.L6
.L7:
	movq	-8016064(%rbp), %rax
	imulq	$1001, %rax, %rdx
	movq	-8016056(%rbp), %rax
	addq	%rdx, %rax
	movq	$1, -8016016(%rbp,%rax,8)
.L6:
	addq	$1, -8016056(%rbp)
.L3:
	movq	-8016088(%rbp), %rax
	cmpq	%rax, -8016056(%rbp)
	jle	.L8
	addq	$1, -8016064(%rbp)
.L2:
	movq	-8016096(%rbp), %rax
	cmpq	%rax, -8016064(%rbp)
	jle	.L9
	movq	$1, -8016064(%rbp)
	jmp	.L10
.L13:
	movq	$1, -8016056(%rbp)
	jmp	.L11
.L12:
	movq	-8016064(%rbp), %rax
	imulq	$1001, %rax, %rdx
	movq	-8016056(%rbp), %rax
	addq	%rdx, %rax
	movq	-8016016(%rbp,%rax,8), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addq	$1, -8016056(%rbp)
.L11:
	movq	-8016088(%rbp), %rax
	cmpq	%rax, -8016056(%rbp)
	jle	.L12
	movl	$10, %edi
	call	putchar@PLT
	addq	$1, -8016064(%rbp)
.L10:
	movq	-8016096(%rbp), %rax
	cmpq	%rax, -8016064(%rbp)
	jle	.L13
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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
.LC1:
	.string	"%ld%ld%ld%ld"
.LC4:
	.string	"%ld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-8015872(%rsp), %r11
	.cfi_def_cfa 11, 8015928
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$232, %rsp
	.cfi_def_cfa_offset 8016160
	leaq	.LC1(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 8016088(%rsp)
	xorl	%eax, %eax
	leaq	64(%rsp), %rcx
	leaq	56(%rsp), %rdx
	leaq	48(%rsp), %rsi
	leaq	72(%rsp), %r8
	call	__isoc99_scanf@PLT
	movq	48(%rsp), %rcx
	testq	%rcx, %rcx
	jle	.L3
	movq	56(%rsp), %rbp
	movq	%rcx, %rax
	addq	$1, %rcx
	subq	72(%rsp), %rax
	movl	$1, %r8d
	movq	%rax, 8(%rsp)
	movdqa	.LC2(%rip), %xmm3
	leaq	8096(%rsp), %r12
	movq	%rbp, %r10
	subq	64(%rsp), %r10
	movq	%rbp, %r9
	movdqa	.LC3(%rip), %xmm2
	cmpq	%rbp, %r10
	movl	$1001, %r13d
	movl	$1, %ebx
	movq	%r10, %r14
	cmovle	%r10, %r9
	testq	%r9, %r9
	movq	%r9, (%rsp)
	cmovg	%r9, %r8
	movq	%r8, %rax
	movq	%r8, %r11
	movq	%r8, 24(%rsp)
	andq	$-2, %rax
	shrq	%r11
	movq	%rax, 16(%rsp)
	movq	%r8, %rax
	salq	$4, %r11
	orq	$1, %rax
	movq	%r11, %r15
	movq	%rax, 40(%rsp)
	.p2align 4,,10
	.p2align 3
.L21:
	testq	%rbp, %rbp
	jle	.L18
	cmpq	%rbx, 8(%rsp)
	jge	.L4
	testq	%r14, %r14
	jle	.L27
	cmpq	$1, (%rsp)
	jle	.L28
	movdqa	.LC0(%rip), %xmm1
	leaq	(%r12,%r15), %rdx
	movq	%r12, %rax
	pxor	%xmm4, %xmm4
	movdqa	.LC3(%rip), %xmm5
	.p2align 4,,10
	.p2align 3
.L7:
	movdqa	%xmm1, %xmm0
	movups	%xmm4, (%rax)
	addq	$16, %rax
	paddq	%xmm3, %xmm1
	paddq	%xmm5, %xmm0
	cmpq	%rax, %rdx
	jne	.L7
	movhlps	%xmm0, %xmm6
	movq	16(%rsp), %rsi
	movq	%xmm6, %rax
	cmpq	%rsi, 24(%rsp)
	je	.L8
	movq	40(%rsp), %rax
.L6:
	imulq	$1001, %rbx, %rdx
	addq	%rax, %rdx
	addq	$1, %rax
	movq	$0, 80(%rsp,%rdx,8)
.L8:
	cmpq	%rax, %rbp
	jl	.L18
.L5:
	leaq	1(%rbp), %rdi
	movl	$1, %edx
	subq	%rax, %rdi
	cmpq	%rax, %rbp
	cmovl	%rdx, %rdi
	jle	.L9
	movq	%rdi, %rsi
	leaq	0(%r13,%rax), %rdx
	shrq	%rsi
	leaq	80(%rsp,%rdx,8), %rdx
	salq	$4, %rsi
	addq	%rdx, %rsi
	.p2align 4,,10
	.p2align 3
.L10:
	movups	%xmm2, (%rdx)
	addq	$16, %rdx
	cmpq	%rdx, %rsi
	jne	.L10
	movq	%rdi, %rdx
	andq	$-2, %rdx
	addq	%rdx, %rax
	cmpq	%rdx, %rdi
	je	.L18
.L9:
	imulq	$1001, %rbx, %rdx
	addq	%rdx, %rax
	movq	$1, 80(%rsp,%rax,8)
.L18:
	addq	$1, %rbx
	addq	$1001, %r13
	addq	$8008, %r12
	cmpq	%rcx, %rbx
	jne	.L21
	leaq	8088(%rsp), %r12
	movl	$1, %r14d
	leaq	.LC4(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L22:
	movl	$1, %ebx
	testq	%rbp, %rbp
	jle	.L25
	.p2align 4,,10
	.p2align 3
.L24:
	movq	(%r12,%rbx,8), %rdx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpq	%rbx, 56(%rsp)
	jge	.L24
.L25:
	movl	$10, %edi
	addq	$1, %r14
	addq	$8008, %r12
	call	putchar@PLT
	cmpq	%r14, 48(%rsp)
	jl	.L3
	movq	56(%rsp), %rbp
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L27:
	movl	$1, %eax
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	testq	%r14, %r14
	jle	.L29
	cmpq	$1, (%rsp)
	jle	.L30
	movdqa	.LC0(%rip), %xmm1
	leaq	(%r12,%r15), %rdx
	movq	%r12, %rax
	.p2align 4,,10
	.p2align 3
.L16:
	movdqa	%xmm1, %xmm0
	movups	%xmm2, (%rax)
	addq	$16, %rax
	paddq	%xmm3, %xmm1
	paddq	%xmm2, %xmm0
	cmpq	%rdx, %rax
	jne	.L16
	movhlps	%xmm0, %xmm7
	movq	16(%rsp), %rsi
	movq	%xmm7, %rax
	cmpq	%rsi, 24(%rsp)
	je	.L19
	movq	40(%rsp), %rax
.L15:
	imulq	$1001, %rbx, %rdx
	addq	%rax, %rdx
	addq	$1, %rax
	movq	$1, 80(%rsp,%rdx,8)
.L19:
	cmpq	%rax, %rbp
	jl	.L18
.L14:
	movq	%rbp, %rdx
	movl	$8, %esi
	movq	%rcx, 32(%rsp)
	subq	%rax, %rdx
	cmpq	%rax, %rbp
	leaq	8(,%rdx,8), %rdx
	cmovl	%rsi, %rdx
	addq	%r13, %rax
	xorl	%esi, %esi
	leaq	80(%rsp,%rax,8), %rdi
	call	memset@PLT
	movdqa	.LC2(%rip), %xmm3
	movq	32(%rsp), %rcx
	movdqa	.LC3(%rip), %xmm2
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L29:
	movl	$1, %eax
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L3:
	movq	8016088(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L41
	addq	$8016104, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L28:
	.cfi_restore_state
	movl	$1, %eax
	jmp	.L6
.L30:
	movl	$1, %eax
	jmp	.L15
.L41:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.quad	1
	.quad	2
	.align 16
.LC2:
	.quad	2
	.quad	2
	.align 16
.LC3:
	.quad	1
	.quad	1
	.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
.LC1:
	.string	"%ld%ld%ld%ld"
.LC4:
	.string	"%ld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-8015872(%rsp), %r11
	.cfi_def_cfa 11, 8015928
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$232, %rsp
	.cfi_def_cfa_offset 8016160
	leaq	.LC1(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 8016088(%rsp)
	xorl	%eax, %eax
	leaq	64(%rsp), %rcx
	leaq	56(%rsp), %rdx
	leaq	48(%rsp), %rsi
	leaq	72(%rsp), %r8
	call	__isoc99_scanf@PLT
	movq	48(%rsp), %rcx
	testq	%rcx, %rcx
	jle	.L3
	movq	56(%rsp), %rbp
	movq	%rcx, %rax
	addq	$1, %rcx
	subq	72(%rsp), %rax
	movl	$1, %r8d
	movq	%rax, 8(%rsp)
	movdqa	.LC2(%rip), %xmm3
	leaq	8096(%rsp), %r12
	movq	%rbp, %r10
	subq	64(%rsp), %r10
	movq	%rbp, %r9
	movdqa	.LC3(%rip), %xmm2
	cmpq	%rbp, %r10
	movl	$1001, %r13d
	movl	$1, %ebx
	movq	%r10, %r14
	cmovle	%r10, %r9
	testq	%r9, %r9
	movq	%r9, (%rsp)
	cmovg	%r9, %r8
	movq	%r8, %rax
	movq	%r8, %r11
	movq	%r8, 24(%rsp)
	andq	$-2, %rax
	shrq	%r11
	movq	%rax, 16(%rsp)
	movq	%r8, %rax
	salq	$4, %r11
	orq	$1, %rax
	movq	%r11, %r15
	movq	%rax, 40(%rsp)
	.p2align 4,,10
	.p2align 3
.L21:
	testq	%rbp, %rbp
	jle	.L18
	cmpq	%rbx, 8(%rsp)
	jge	.L4
	testq	%r14, %r14
	jle	.L27
	cmpq	$1, (%rsp)
	jle	.L28
	movdqa	.LC0(%rip), %xmm1
	leaq	(%r12,%r15), %rdx
	movq	%r12, %rax
	pxor	%xmm4, %xmm4
	movdqa	.LC3(%rip), %xmm5
	.p2align 4,,10
	.p2align 3
.L7:
	movdqa	%xmm1, %xmm0
	movups	%xmm4, (%rax)
	addq	$16, %rax
	paddq	%xmm3, %xmm1
	paddq	%xmm5, %xmm0
	cmpq	%rax, %rdx
	jne	.L7
	movhlps	%xmm0, %xmm6
	movq	16(%rsp), %rsi
	movq	%xmm6, %rax
	cmpq	%rsi, 24(%rsp)
	je	.L8
	movq	40(%rsp), %rax
.L6:
	imulq	$1001, %rbx, %rdx
	addq	%rax, %rdx
	addq	$1, %rax
	movq	$0, 80(%rsp,%rdx,8)
.L8:
	cmpq	%rax, %rbp
	jl	.L18
.L5:
	leaq	1(%rbp), %rdi
	movl	$1, %edx
	subq	%rax, %rdi
	cmpq	%rax, %rbp
	cmovl	%rdx, %rdi
	jle	.L9
	movq	%rdi, %rsi
	leaq	0(%r13,%rax), %rdx
	shrq	%rsi
	leaq	80(%rsp,%rdx,8), %rdx
	salq	$4, %rsi
	addq	%rdx, %rsi
	.p2align 4,,10
	.p2align 3
.L10:
	movups	%xmm2, (%rdx)
	addq	$16, %rdx
	cmpq	%rdx, %rsi
	jne	.L10
	movq	%rdi, %rdx
	andq	$-2, %rdx
	addq	%rdx, %rax
	cmpq	%rdx, %rdi
	je	.L18
.L9:
	imulq	$1001, %rbx, %rdx
	addq	%rdx, %rax
	movq	$1, 80(%rsp,%rax,8)
.L18:
	addq	$1, %rbx
	addq	$1001, %r13
	addq	$8008, %r12
	cmpq	%rcx, %rbx
	jne	.L21
	leaq	8088(%rsp), %r12
	movl	$1, %r14d
	leaq	.LC4(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L22:
	movl	$1, %ebx
	testq	%rbp, %rbp
	jle	.L25
	.p2align 4,,10
	.p2align 3
.L24:
	movq	(%r12,%rbx,8), %rdx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpq	%rbx, 56(%rsp)
	jge	.L24
.L25:
	movl	$10, %edi
	addq	$1, %r14
	addq	$8008, %r12
	call	putchar@PLT
	cmpq	%r14, 48(%rsp)
	jl	.L3
	movq	56(%rsp), %rbp
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L27:
	movl	$1, %eax
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	testq	%r14, %r14
	jle	.L29
	cmpq	$1, (%rsp)
	jle	.L30
	movdqa	.LC0(%rip), %xmm1
	leaq	(%r12,%r15), %rdx
	movq	%r12, %rax
	.p2align 4,,10
	.p2align 3
.L16:
	movdqa	%xmm1, %xmm0
	movups	%xmm2, (%rax)
	addq	$16, %rax
	paddq	%xmm3, %xmm1
	paddq	%xmm2, %xmm0
	cmpq	%rdx, %rax
	jne	.L16
	movhlps	%xmm0, %xmm7
	movq	16(%rsp), %rsi
	movq	%xmm7, %rax
	cmpq	%rsi, 24(%rsp)
	je	.L19
	movq	40(%rsp), %rax
.L15:
	imulq	$1001, %rbx, %rdx
	addq	%rax, %rdx
	addq	$1, %rax
	movq	$1, 80(%rsp,%rdx,8)
.L19:
	cmpq	%rax, %rbp
	jl	.L18
.L14:
	movq	%rbp, %rdx
	movl	$8, %esi
	movq	%rcx, 32(%rsp)
	subq	%rax, %rdx
	cmpq	%rax, %rbp
	leaq	8(,%rdx,8), %rdx
	cmovl	%rsi, %rdx
	addq	%r13, %rax
	xorl	%esi, %esi
	leaq	80(%rsp,%rax,8), %rdi
	call	memset@PLT
	movdqa	.LC2(%rip), %xmm3
	movq	32(%rsp), %rcx
	movdqa	.LC3(%rip), %xmm2
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L29:
	movl	$1, %eax
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L3:
	movq	8016088(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L41
	addq	$8016104, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L28:
	.cfi_restore_state
	movl	$1, %eax
	jmp	.L6
.L30:
	movl	$1, %eax
	jmp	.L15
.L41:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.quad	1
	.quad	2
	.align 16
.LC2:
	.quad	2
	.quad	2
	.align 16
.LC3:
	.quad	1
	.quad	1
	.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>
#include <limits.h>
#include <float.h>
#include <stdlib.h>
#include <math.h>

int main(void)
{
	long int i, j, k;
	long int h, w, a, b;
	long int count = 0;
	long int flg = 0;
	long int flgs = 0;
	long int flgfirst = 0;
	long int masu[1001][1001];
	
	scanf("%ld%ld%ld%ld", &h, &w, &a, &b);
	
	for(i = 1; i <= h; i++) {
		for(j = 1; j <= w; j++) {
			if (i <= h - b)
			{
				if (j <= w - a)
				{
					masu[i][j] = 1;
				}
				else
				{
					masu[i][j] = 0;
				}
			}
			else
			{
				if (j <= w - a)
				{
					masu[i][j] = 0;
				}
				else
				{
					masu[i][j] = 1;
				}
			}
		}
	}
	
	for (i = 1; i <= h; i++)
	{
		for (j = 1; j <= w; j++)
		{
			printf("%ld", masu[i][j]);
		}
		printf("\n");
	}
	
	return 0;
}
3 3 0 1
 1 5 2 -1
 3 6 0 1
 1 5 4 -1
 3 10 0 1
 2 5 4 -1
 2 6 4 -1
 1 5 0 0
 3 3 0 2
 1 5 2 1

111
111
000
 11100
 111111
111111
000000
 10000
 1111111111
1111111111
0000000000
 10000
10000
 110000
110000
 11111
 111
000
000
 00011

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

int main(void)
{
	long int i, j, k;
	long int h, w, a, b;
	long int count = 0;
	long int flg = 0;
	long int flgs = 0;
	long int flgfirst = 0;
	long int masu[1001][1001];
	
	scanf("%ld%ld%ld%ld", &h, &w, &a, &b);
	
	for(i = 1; i <= h; i++) {
		for(j = 1; j <= w; j++) {
			if (i <= h - b)
			{
				if (j <= w - a)
				{
					masu[i][j] = 1;
				}
				else
				{
					masu[i][j] = 0;
				}
			}
			else
			{
				if (j <= w - a)
				{
					masu[i][j] = 0;
				}
				else
				{
					masu[i][j] = 1;
				}
			}
		}
	}
	
	for (i = 1; i <= h; i++)
	{
		for (j = 1; j <= w; j++)
		{
			printf("%ld", masu[i][j]);
		}
		printf("\n");
	}
	
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%ld%ld%ld%ld"
.LC1:
	.string	"%ld"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-8015872(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$224, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -8016048(%rbp)
	movq	$0, -8016040(%rbp)
	movq	$0, -8016032(%rbp)
	movq	$0, -8016024(%rbp)
	leaq	-8016072(%rbp), %rsi
	leaq	-8016080(%rbp), %rcx
	leaq	-8016088(%rbp), %rdx
	leaq	-8016096(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$1, -8016064(%rbp)
	jmp	.L2
.L9:
	movq	$1, -8016056(%rbp)
	jmp	.L3
.L8:
	movq	-8016096(%rbp), %rax
	movq	-8016072(%rbp), %rdx
	subq	%rdx, %rax
	cmpq	%rax, -8016064(%rbp)
	jg	.L4
	movq	-8016088(%rbp), %rax
	movq	-8016080(%rbp), %rdx
	subq	%rdx, %rax
	cmpq	%rax, -8016056(%rbp)
	jg	.L5
	movq	-8016064(%rbp), %rax
	imulq	$1001, %rax, %rdx
	movq	-8016056(%rbp), %rax
	addq	%rdx, %rax
	movq	$1, -8016016(%rbp,%rax,8)
	jmp	.L6
.L5:
	movq	-8016064(%rbp), %rax
	imulq	$1001, %rax, %rdx
	movq	-8016056(%rbp), %rax
	addq	%rdx, %rax
	movq	$0, -8016016(%rbp,%rax,8)
	jmp	.L6
.L4:
	movq	-8016088(%rbp), %rax
	movq	-8016080(%rbp), %rdx
	subq	%rdx, %rax
	cmpq	%rax, -8016056(%rbp)
	jg	.L7
	movq	-8016064(%rbp), %rax
	imulq	$1001, %rax, %rdx
	movq	-8016056(%rbp), %rax
	addq	%rdx, %rax
	movq	$0, -8016016(%rbp,%rax,8)
	jmp	.L6
.L7:
	movq	-8016064(%rbp), %rax
	imulq	$1001, %rax, %rdx
	movq	-8016056(%rbp), %rax
	addq	%rdx, %rax
	movq	$1, -8016016(%rbp,%rax,8)
.L6:
	addq	$1, -8016056(%rbp)
.L3:
	movq	-8016088(%rbp), %rax
	cmpq	%rax, -8016056(%rbp)
	jle	.L8
	addq	$1, -8016064(%rbp)
.L2:
	movq	-8016096(%rbp), %rax
	cmpq	%rax, -8016064(%rbp)
	jle	.L9
	movq	$1, -8016064(%rbp)
	jmp	.L10
.L13:
	movq	$1, -8016056(%rbp)
	jmp	.L11
.L12:
	movq	-8016064(%rbp), %rax
	imulq	$1001, %rax, %rdx
	movq	-8016056(%rbp), %rax
	addq	%rdx, %rax
	movq	-8016016(%rbp,%rax,8), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addq	$1, -8016056(%rbp)
.L11:
	movq	-8016088(%rbp), %rax
	cmpq	%rax, -8016056(%rbp)
	jle	.L12
	movl	$10, %edi
	call	putchar@PLT
	addq	$1, -8016064(%rbp)
.L10:
	movq	-8016096(%rbp), %rax
	cmpq	%rax, -8016064(%rbp)
	jle	.L13
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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	"%ld%ld%ld%ld"
.LC1:
	.string	"%ld"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-8015872(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$224, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -8016048(%rbp)
	movq	$0, -8016040(%rbp)
	movq	$0, -8016032(%rbp)
	movq	$0, -8016024(%rbp)
	leaq	-8016072(%rbp), %rsi
	leaq	-8016080(%rbp), %rcx
	leaq	-8016088(%rbp), %rdx
	leaq	-8016096(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$1, -8016064(%rbp)
	jmp	.L2
.L9:
	movq	$1, -8016056(%rbp)
	jmp	.L3
.L8:
	movq	-8016096(%rbp), %rax
	movq	-8016072(%rbp), %rdx
	subq	%rdx, %rax
	cmpq	%rax, -8016064(%rbp)
	jg	.L4
	movq	-8016088(%rbp), %rax
	movq	-8016080(%rbp), %rdx
	subq	%rdx, %rax
	cmpq	%rax, -8016056(%rbp)
	jg	.L5
	movq	-8016064(%rbp), %rax
	imulq	$1001, %rax, %rdx
	movq	-8016056(%rbp), %rax
	addq	%rdx, %rax
	movq	$1, -8016016(%rbp,%rax,8)
	jmp	.L6
.L5:
	movq	-8016064(%rbp), %rax
	imulq	$1001, %rax, %rdx
	movq	-8016056(%rbp), %rax
	addq	%rdx, %rax
	movq	$0, -8016016(%rbp,%rax,8)
	jmp	.L6
.L4:
	movq	-8016088(%rbp), %rax
	movq	-8016080(%rbp), %rdx
	subq	%rdx, %rax
	cmpq	%rax, -8016056(%rbp)
	jg	.L7
	movq	-8016064(%rbp), %rax
	imulq	$1001, %rax, %rdx
	movq	-8016056(%rbp), %rax
	addq	%rdx, %rax
	movq	$0, -8016016(%rbp,%rax,8)
	jmp	.L6
.L7:
	movq	-8016064(%rbp), %rax
	imulq	$1001, %rax, %rdx
	movq	-8016056(%rbp), %rax
	addq	%rdx, %rax
	movq	$1, -8016016(%rbp,%rax,8)
.L6:
	addq	$1, -8016056(%rbp)
.L3:
	movq	-8016088(%rbp), %rax
	cmpq	%rax, -8016056(%rbp)
	jle	.L8
	addq	$1, -8016064(%rbp)
.L2:
	movq	-8016096(%rbp), %rax
	cmpq	%rax, -8016064(%rbp)
	jle	.L9
	movq	$1, -8016064(%rbp)
	jmp	.L10
.L13:
	movq	$1, -8016056(%rbp)
	jmp	.L11
.L12:
	movq	-8016064(%rbp), %rax
	imulq	$1001, %rax, %rdx
	movq	-8016056(%rbp), %rax
	addq	%rdx, %rax
	movq	-8016016(%rbp,%rax,8), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addq	$1, -8016056(%rbp)
.L11:
	movq	-8016088(%rbp), %rax
	cmpq	%rax, -8016056(%rbp)
	jle	.L12
	movl	$10, %edi
	call	putchar@PLT
	addq	$1, -8016064(%rbp)
.L10:
	movq	-8016096(%rbp), %rax
	cmpq	%rax, -8016064(%rbp)
	jle	.L13
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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:
