Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
// AOJ 1501: Grid
// 2017.11.17 bal4u@uu

#include <stdio.h>

#define M 100000007
int tbl[1001][1001];

int combi(int n, int k)
{
	int ans;

	if (tbl[n][k]) return tbl[n][k];
	if ((k << 1) > n) k = n-k;
	if (k == 0) ans = 1;
	else if (k == 1) ans = n;
	else ans = combi(n-1, k) + combi(n-1, k-1);
	return tbl[n][k] = ans % M;
}

int main()
{
	int r, c, a1, b1, a2, b2, dr, dc, k, m;

	k = 0;
	scanf("%d%d%d%d%d%d", &r, &c, &a1, &a2, &b1, &b2);

	dr = a1-b1;
	if (dr < 0) dr = -dr;
	if (dr > r-dr) dr = r-dr;
	if ((dr << 1) == r) k++;

	dc = a2-b2;
	if (dc < 0) dc = -dc;
	if (dc > c-dc) dc = c-dc;
	if ((dc << 1) == c) k++;

	m = dc; if (dr < dc) m = dr;
	printf("%d\n", (combi(dr+dc, m) << k) % M);

	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	tbl
	.bss
	.align 32
	.type	tbl, @object
	.size	tbl, 4008004
tbl:
	.zero	4008004
	.text
	.globl	combi
	.type	combi, @function
combi:
.LFB0:
	.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	$40, %rsp
	.cfi_offset 3, -24
	movl	%edi, -36(%rbp)
	movl	%esi, -40(%rbp)
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$1001, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	tbl(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L2
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$1001, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	tbl(%rip), %rax
	movl	(%rdx,%rax), %eax
	jmp	.L3
.L2:
	movl	-40(%rbp), %eax
	addl	%eax, %eax
	cmpl	%eax, -36(%rbp)
	jge	.L4
	movl	-36(%rbp), %eax
	subl	-40(%rbp), %eax
	movl	%eax, -40(%rbp)
.L4:
	cmpl	$0, -40(%rbp)
	jne	.L5
	movl	$1, -20(%rbp)
	jmp	.L6
.L5:
	cmpl	$1, -40(%rbp)
	jne	.L7
	movl	-36(%rbp), %eax
	movl	%eax, -20(%rbp)
	jmp	.L6
.L7:
	movl	-36(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-40(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	combi
	movl	%eax, %ebx
	movl	-40(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-36(%rbp), %eax
	subl	$1, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	combi
	addl	%ebx, %eax
	movl	%eax, -20(%rbp)
.L6:
	movl	-20(%rbp), %edx
	movslq	%edx, %rax
	imulq	$360287945, %rax, %rax
	shrq	$32, %rax
	sarl	$23, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	imull	$100000007, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	-40(%rbp), %edx
	movslq	%edx, %rcx
	movl	-36(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$1001, %rdx, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	tbl(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$1001, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	tbl(%rip), %rax
	movl	(%rdx,%rax), %eax
.L3:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	combi, .-combi
	.section	.rodata
.LC0:
	.string	"%d%d%d%d%d%d"
.LC1:
	.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
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -16(%rbp)
	leaq	-36(%rbp), %r8
	leaq	-32(%rbp), %rdi
	leaq	-40(%rbp), %rcx
	leaq	-44(%rbp), %rdx
	leaq	-48(%rbp), %rax
	subq	$8, %rsp
	leaq	-28(%rbp), %rsi
	pushq	%rsi
	movq	%r8, %r9
	movq	%rdi, %r8
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$16, %rsp
	movl	-40(%rbp), %eax
	movl	-36(%rbp), %edx
	subl	%edx, %eax
	movl	%eax, -24(%rbp)
	cmpl	$0, -24(%rbp)
	jns	.L9
	negl	-24(%rbp)
.L9:
	movl	-48(%rbp), %eax
	subl	-24(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jle	.L10
	movl	-48(%rbp), %eax
	subl	-24(%rbp), %eax
	movl	%eax, -24(%rbp)
.L10:
	movl	-24(%rbp), %eax
	leal	(%rax,%rax), %edx
	movl	-48(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L11
	addl	$1, -16(%rbp)
.L11:
	movl	-32(%rbp), %eax
	movl	-28(%rbp), %edx
	subl	%edx, %eax
	movl	%eax, -20(%rbp)
	cmpl	$0, -20(%rbp)
	jns	.L12
	negl	-20(%rbp)
.L12:
	movl	-44(%rbp), %eax
	subl	-20(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jle	.L13
	movl	-44(%rbp), %eax
	subl	-20(%rbp), %eax
	movl	%eax, -20(%rbp)
.L13:
	movl	-20(%rbp), %eax
	leal	(%rax,%rax), %edx
	movl	-44(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L14
	addl	$1, -16(%rbp)
.L14:
	movl	-20(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	-24(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jge	.L15
	movl	-24(%rbp), %eax
	movl	%eax, -12(%rbp)
.L15:
	movl	-24(%rbp), %edx
	movl	-20(%rbp), %eax
	addl	%eax, %edx
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	combi
	movl	%eax, %edx
	movl	-16(%rbp), %eax
	movl	%eax, %ecx
	sall	%cl, %edx
	movslq	%edx, %rax
	imulq	$360287945, %rax, %rax
	shrq	$32, %rax
	sarl	$23, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	imull	$100000007, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	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
	.type	combi.part.0, @function
combi.part.0:
.LFB25:
	.cfi_startproc
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leal	(%rsi,%rsi), %edx
	movl	%edi, %eax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	subl	%esi, %eax
	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
	movl	%edi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	%esi, %ebx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	cmpl	%edi, %edx
	cmovg	%eax, %ebx
	testl	%ebx, %ebx
	je	.L16
	cmpl	$1, %ebx
	jne	.L4
	movslq	%edi, %rdx
	movl	%edi, %ecx
	leaq	tbl(%rip), %r12
	movl	$1, %r13d
	imulq	$360287945, %rdx, %rax
	sarl	$31, %ecx
	sarq	$55, %rax
	subl	%ecx, %eax
	imull	$100000007, %eax, %ecx
	movl	%edi, %eax
	subl	%ecx, %eax
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L16:
	movl	$1, %eax
	movslq	%edi, %rdx
	leaq	tbl(%rip), %r12
	xorl	%r13d, %r13d
.L3:
	imulq	$1001, %rdx, %rdx
	addq	%r13, %rdx
	movl	%eax, (%r12,%rdx,4)
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	leal	-1(%rdi), %edx
	movslq	%ebx, %r13
	leaq	tbl(%rip), %r12
	movslq	%edx, %r14
	imulq	$1001, %r14, %rax
	addq	%r13, %rax
	movl	(%r12,%rax,4), %r15d
	testl	%r15d, %r15d
	jne	.L5
	leal	(%rbx,%rbx), %eax
	cmpl	%eax, %edx
	jge	.L17
	movl	%edx, %r15d
	subl	%ebx, %r15d
	jne	.L24
	movl	$1, %r15d
	xorl	%ecx, %ecx
.L7:
	imulq	$1001, %r14, %rax
	addq	%rcx, %rax
	movl	%r15d, (%r12,%rax,4)
.L5:
	imulq	$1001, %r14, %rax
	leal	-1(%rbx), %esi
	movslq	%esi, %rcx
	addq	%rcx, %rax
	movl	(%r12,%rax,4), %eax
	testl	%eax, %eax
	jne	.L10
	leal	(%rsi,%rsi), %eax
	cmpl	%eax, %edx
	jge	.L11
	movl	%ebp, %esi
	subl	%ebx, %esi
	movslq	%esi, %rcx
.L11:
	movl	$1, %eax
	testl	%esi, %esi
	je	.L12
	cmpl	$1, %esi
	jne	.L13
	imulq	$360287945, %r14, %rax
.L22:
	movl	%edx, %esi
	sarq	$55, %rax
	sarl	$31, %esi
	subl	%esi, %eax
	imull	$100000007, %eax, %esi
	movl	%edx, %eax
	subl	%esi, %eax
.L12:
	imulq	$1001, %r14, %r14
	addq	%rcx, %r14
	movl	%eax, (%r12,%r14,4)
.L10:
	leal	(%rax,%r15), %edx
	movslq	%edx, %rax
	movl	%edx, %ecx
	imulq	$360287945, %rax, %rax
	sarl	$31, %ecx
	sarq	$55, %rax
	subl	%ecx, %eax
	imull	$100000007, %eax, %ecx
	movl	%edx, %eax
	movslq	%ebp, %rdx
	subl	%ecx, %eax
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L17:
	movl	%ebx, %r15d
.L6:
	leal	-2(%rbp), %edi
	movslq	%r15d, %rcx
	movslq	%edi, %r9
	imulq	$1001, %r9, %rax
	addq	%rcx, %rax
	movl	(%r12,%rax,4), %r8d
	testl	%r8d, %r8d
	jne	.L8
	movl	%r15d, %esi
	movq	%r9, 24(%rsp)
	movq	%rcx, 16(%rsp)
	movl	%edx, 12(%rsp)
	movl	%edi, (%rsp)
	call	combi.part.0
	movq	24(%rsp), %r9
	movq	16(%rsp), %rcx
	movl	12(%rsp), %edx
	movl	(%rsp), %edi
	movl	%eax, %r8d
.L8:
	imulq	$1001, %r9, %rax
	leal	-1(%r15), %esi
	movslq	%esi, %r10
	addq	%r10, %rax
	movl	(%r12,%rax,4), %eax
	testl	%eax, %eax
	jne	.L9
	movq	%rcx, 16(%rsp)
	movl	%r8d, 12(%rsp)
	movl	%edx, (%rsp)
	call	combi.part.0
	movq	16(%rsp), %rcx
	movl	12(%rsp), %r8d
	movl	(%rsp), %edx
.L9:
	addl	%r8d, %eax
	movslq	%eax, %r15
	movl	%eax, %esi
	imulq	$360287945, %r15, %r15
	sarl	$31, %esi
	sarq	$55, %r15
	subl	%esi, %r15d
	imull	$100000007, %r15d, %esi
	subl	%esi, %eax
	movl	%eax, %r15d
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L13:
	leal	-2(%rbp), %edi
	movslq	%edi, %rdx
	imulq	$1001, %rdx, %rax
	addq	%rcx, %rax
	movl	(%r12,%rax,4), %ebx
	testl	%ebx, %ebx
	jne	.L14
	movq	%rdx, 24(%rsp)
	movq	%rcx, 16(%rsp)
	movl	%esi, 12(%rsp)
	movl	%edi, (%rsp)
	call	combi.part.0
	movq	24(%rsp), %rdx
	movq	16(%rsp), %rcx
	movl	12(%rsp), %esi
	movl	(%rsp), %edi
	movl	%eax, %ebx
.L14:
	imulq	$1001, %rdx, %rax
	subl	$1, %esi
	movslq	%esi, %r8
	addq	%r8, %rax
	movl	(%r12,%rax,4), %eax
	testl	%eax, %eax
	jne	.L15
	movq	%rcx, (%rsp)
	call	combi.part.0
	movq	(%rsp), %rcx
.L15:
	leal	(%rax,%rbx), %edx
	movslq	%edx, %rax
	imulq	$360287945, %rax, %rax
	jmp	.L22
.L24:
	cmpl	$1, %r15d
	jne	.L6
	imulq	$360287945, %r14, %r15
	movl	%edx, %eax
	movl	$1, %ecx
	sarl	$31, %eax
	sarq	$55, %r15
	subl	%eax, %r15d
	imull	$100000007, %r15d, %eax
	movl	%edx, %r15d
	subl	%eax, %r15d
	jmp	.L7
	.cfi_endproc
.LFE25:
	.size	combi.part.0, .-combi.part.0
	.p2align 4
	.globl	combi
	.type	combi, @function
combi:
.LFB23:
	.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
	movslq	%edi, %r12
	imulq	$1001, %r12, %rax
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movslq	%esi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	tbl(%rip), %rbx
	addq	%rbp, %rax
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movl	(%rbx,%rax,4), %eax
	testl	%eax, %eax
	jne	.L25
	leal	(%rbp,%rbp), %eax
	movq	%r12, %r13
	movq	%rbp, %r11
	cmpl	%eax, %r12d
	jge	.L27
	movl	%r12d, %eax
	subl	%ebp, %eax
	movslq	%eax, %rbp
	movq	%rbp, %r11
.L27:
	movl	$1, %eax
	testl	%r11d, %r11d
	jne	.L49
.L28:
	imulq	$1001, %r12, %rdx
	addq	%rbp, %rdx
	movl	%eax, (%rbx,%rdx,4)
.L25:
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
	.p2align 4,,10
	.p2align 3
.L49:
	.cfi_restore_state
	cmpl	$1, %r11d
	jne	.L29
	imulq	$360287945, %r12, %rax
	movl	%r13d, %edx
	sarl	$31, %edx
	sarq	$55, %rax
	subl	%edx, %eax
	imull	$100000007, %eax, %edx
	movl	%r13d, %eax
	subl	%edx, %eax
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L29:
	leal	-1(%r13), %ecx
	movslq	%ecx, %r14
	imulq	$1001, %r14, %rax
	addq	%rbp, %rax
	movl	(%rbx,%rax,4), %r15d
	testl	%r15d, %r15d
	jne	.L30
	leal	(%r11,%r11), %eax
	cmpl	%eax, %ecx
	jge	.L42
	movl	%ecx, %esi
	subl	%r11d, %esi
	jne	.L50
	movl	$1, %r15d
	xorl	%edx, %edx
.L32:
	imulq	$1001, %r14, %rax
	addq	%rdx, %rax
	movl	%r15d, (%rbx,%rax,4)
.L30:
	imulq	$1001, %r14, %rax
	leal	-1(%r11), %esi
	movslq	%esi, %rdx
	addq	%rdx, %rax
	movl	(%rbx,%rax,4), %eax
	testl	%eax, %eax
	jne	.L35
	leal	(%rsi,%rsi), %eax
	cmpl	%eax, %ecx
	jge	.L36
	movl	%r13d, %esi
	subl	%r11d, %esi
	movslq	%esi, %rdx
.L36:
	movl	$1, %eax
	testl	%esi, %esi
	je	.L37
	cmpl	$1, %esi
	jne	.L38
	imulq	$360287945, %r14, %rax
.L48:
	movl	%ecx, %esi
	sarq	$55, %rax
	sarl	$31, %esi
	subl	%esi, %eax
	imull	$100000007, %eax, %esi
	movl	%ecx, %eax
	subl	%esi, %eax
.L37:
	imulq	$1001, %r14, %r14
	addq	%rdx, %r14
	movl	%eax, (%rbx,%r14,4)
.L35:
	leal	(%rax,%r15), %edx
	movslq	%edx, %rax
	movl	%edx, %ecx
	imulq	$360287945, %rax, %rax
	sarl	$31, %ecx
	sarq	$55, %rax
	subl	%ecx, %eax
	imull	$100000007, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L42:
	movl	%r11d, %esi
.L31:
	leal	-2(%r13), %edi
	movslq	%esi, %rdx
	movslq	%edi, %r8
	imulq	$1001, %r8, %rax
	addq	%rdx, %rax
	movl	(%rbx,%rax,4), %r15d
	testl	%r15d, %r15d
	jne	.L33
	movq	%r8, 40(%rsp)
	movq	%rdx, 32(%rsp)
	movl	%ecx, 24(%rsp)
	movl	%esi, 16(%rsp)
	movl	%edi, 8(%rsp)
	call	combi.part.0
	movq	40(%rsp), %r8
	movq	32(%rsp), %rdx
	movl	24(%rsp), %ecx
	movl	16(%rsp), %esi
	movl	%eax, %r15d
	movl	8(%rsp), %edi
.L33:
	imulq	$1001, %r8, %rax
	subl	$1, %esi
	movslq	%esi, %r9
	addq	%r9, %rax
	movl	(%rbx,%rax,4), %eax
	testl	%eax, %eax
	jne	.L34
	movq	%rdx, 16(%rsp)
	movl	%ecx, 8(%rsp)
	call	combi.part.0
	movq	16(%rsp), %rdx
	movl	8(%rsp), %ecx
.L34:
	addl	%r15d, %eax
	movslq	%eax, %r15
	movl	%eax, %esi
	imulq	$360287945, %r15, %r15
	sarl	$31, %esi
	sarq	$55, %r15
	subl	%esi, %r15d
	imull	$100000007, %r15d, %esi
	subl	%esi, %eax
	movl	%eax, %r15d
	jmp	.L32
	.p2align 4,,10
	.p2align 3
.L38:
	subl	$2, %r13d
	movslq	%r13d, %rcx
	imulq	$1001, %rcx, %rax
	addq	%rdx, %rax
	movl	(%rbx,%rax,4), %r11d
	testl	%r11d, %r11d
	jne	.L39
	movl	%r13d, %edi
	movq	%rcx, 24(%rsp)
	movq	%rdx, 16(%rsp)
	movl	%esi, 8(%rsp)
	call	combi.part.0
	movq	24(%rsp), %rcx
	movq	16(%rsp), %rdx
	movl	8(%rsp), %esi
	movl	%eax, %r11d
.L39:
	imulq	$1001, %rcx, %rax
	subl	$1, %esi
	movslq	%esi, %rdi
	addq	%rdi, %rax
	movl	(%rbx,%rax,4), %eax
	testl	%eax, %eax
	jne	.L40
	movl	%r13d, %edi
	movq	%rdx, 8(%rsp)
	call	combi.part.0
	movq	8(%rsp), %rdx
.L40:
	leal	(%rax,%r11), %ecx
	movslq	%ecx, %rax
	imulq	$360287945, %rax, %rax
	jmp	.L48
.L50:
	cmpl	$1, %esi
	jne	.L31
	imulq	$360287945, %r14, %r15
	movl	%ecx, %eax
	movl	$1, %edx
	sarl	$31, %eax
	sarq	$55, %r15
	subl	%eax, %r15d
	imull	$100000007, %r15d, %eax
	movl	%ecx, %r15d
	subl	%eax, %r15d
	jmp	.L32
	.cfi_endproc
.LFE23:
	.size	combi, .-combi
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d%d%d%d%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rcx
	leaq	4(%rsp), %rdx
	movq	%rsp, %rsi
	subq	$8, %rsp
	.cfi_def_cfa_offset 56
	leaq	28(%rsp), %rax
	pushq	%rax
	.cfi_def_cfa_offset 64
	xorl	%eax, %eax
	leaq	28(%rsp), %r9
	leaq	32(%rsp), %r8
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %edx
	movl	24(%rsp), %eax
	popq	%rcx
	.cfi_def_cfa_offset 56
	popq	%rsi
	.cfi_def_cfa_offset 48
	movl	%edx, %ecx
	subl	%eax, %ecx
	subl	%edx, %eax
	cmovs	%ecx, %eax
	movl	(%rsp), %ecx
	movl	%ecx, %edx
	subl	%eax, %edx
	cmpl	%eax, %edx
	cmovg	%eax, %edx
	xorl	%r11d, %r11d
	leal	(%rdx,%rdx), %eax
	cmpl	%ecx, %eax
	movl	20(%rsp), %ecx
	movl	16(%rsp), %eax
	sete	%r11b
	movl	%ecx, %esi
	subl	%eax, %esi
	subl	%ecx, %eax
	movl	4(%rsp), %ecx
	cmovs	%esi, %eax
	movl	%edx, %esi
	movl	%ecx, %edi
	subl	%eax, %edi
	cmpl	%eax, %edi
	cmovg	%eax, %edi
	leal	(%rdi,%rdi), %eax
	cmpl	%eax, %ecx
	sete	%al
	movzbl	%al, %eax
	addl	%eax, %r11d
	cmpl	%edx, %edi
	cmovle	%edi, %esi
	addl	%edx, %edi
	movslq	%edi, %rax
	imulq	$1001, %rax, %rax
	movslq	%esi, %rdx
	addq	%rdx, %rax
	leaq	tbl(%rip), %rdx
	movl	(%rdx,%rax,4), %edx
	testl	%edx, %edx
	jne	.L55
	call	combi.part.0
	movl	%eax, %edx
.L55:
	movl	%r11d, %ecx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	sall	%cl, %edx
	movslq	%edx, %rax
	movl	%edx, %ecx
	imulq	$360287945, %rax, %rax
	sarl	$31, %ecx
	sarq	$55, %rax
	subl	%ecx, %eax
	imull	$100000007, %eax, %eax
	subl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L58
	xorl	%eax, %eax
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L58:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	tbl
	.bss
	.align 32
	.type	tbl, @object
	.size	tbl, 4008004
tbl:
	.zero	4008004
	.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
	.type	combi.part.0, @function
combi.part.0:
.LFB25:
	.cfi_startproc
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leal	(%rsi,%rsi), %edx
	movl	%edi, %eax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	subl	%esi, %eax
	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
	movl	%edi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	%esi, %ebx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	cmpl	%edi, %edx
	cmovg	%eax, %ebx
	testl	%ebx, %ebx
	je	.L16
	cmpl	$1, %ebx
	jne	.L4
	movslq	%edi, %rdx
	movl	%edi, %ecx
	leaq	tbl(%rip), %r12
	movl	$1, %r13d
	imulq	$360287945, %rdx, %rax
	sarl	$31, %ecx
	sarq	$55, %rax
	subl	%ecx, %eax
	imull	$100000007, %eax, %ecx
	movl	%edi, %eax
	subl	%ecx, %eax
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L16:
	movl	$1, %eax
	movslq	%edi, %rdx
	leaq	tbl(%rip), %r12
	xorl	%r13d, %r13d
.L3:
	imulq	$1001, %rdx, %rdx
	addq	%r13, %rdx
	movl	%eax, (%r12,%rdx,4)
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	leal	-1(%rdi), %edx
	movslq	%ebx, %r13
	leaq	tbl(%rip), %r12
	movslq	%edx, %r14
	imulq	$1001, %r14, %rax
	addq	%r13, %rax
	movl	(%r12,%rax,4), %r15d
	testl	%r15d, %r15d
	jne	.L5
	leal	(%rbx,%rbx), %eax
	cmpl	%eax, %edx
	jge	.L17
	movl	%edx, %r15d
	subl	%ebx, %r15d
	jne	.L24
	movl	$1, %r15d
	xorl	%ecx, %ecx
.L7:
	imulq	$1001, %r14, %rax
	addq	%rcx, %rax
	movl	%r15d, (%r12,%rax,4)
.L5:
	imulq	$1001, %r14, %rax
	leal	-1(%rbx), %esi
	movslq	%esi, %rcx
	addq	%rcx, %rax
	movl	(%r12,%rax,4), %eax
	testl	%eax, %eax
	jne	.L10
	leal	(%rsi,%rsi), %eax
	cmpl	%eax, %edx
	jge	.L11
	movl	%ebp, %esi
	subl	%ebx, %esi
	movslq	%esi, %rcx
.L11:
	movl	$1, %eax
	testl	%esi, %esi
	je	.L12
	cmpl	$1, %esi
	jne	.L13
	imulq	$360287945, %r14, %rax
.L22:
	movl	%edx, %esi
	sarq	$55, %rax
	sarl	$31, %esi
	subl	%esi, %eax
	imull	$100000007, %eax, %esi
	movl	%edx, %eax
	subl	%esi, %eax
.L12:
	imulq	$1001, %r14, %r14
	addq	%rcx, %r14
	movl	%eax, (%r12,%r14,4)
.L10:
	leal	(%rax,%r15), %edx
	movslq	%edx, %rax
	movl	%edx, %ecx
	imulq	$360287945, %rax, %rax
	sarl	$31, %ecx
	sarq	$55, %rax
	subl	%ecx, %eax
	imull	$100000007, %eax, %ecx
	movl	%edx, %eax
	movslq	%ebp, %rdx
	subl	%ecx, %eax
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L17:
	movl	%ebx, %r15d
.L6:
	leal	-2(%rbp), %edi
	movslq	%r15d, %rcx
	movslq	%edi, %r9
	imulq	$1001, %r9, %rax
	addq	%rcx, %rax
	movl	(%r12,%rax,4), %r8d
	testl	%r8d, %r8d
	jne	.L8
	movl	%r15d, %esi
	movq	%r9, 24(%rsp)
	movq	%rcx, 16(%rsp)
	movl	%edx, 12(%rsp)
	movl	%edi, (%rsp)
	call	combi.part.0
	movq	24(%rsp), %r9
	movq	16(%rsp), %rcx
	movl	12(%rsp), %edx
	movl	(%rsp), %edi
	movl	%eax, %r8d
.L8:
	imulq	$1001, %r9, %rax
	leal	-1(%r15), %esi
	movslq	%esi, %r10
	addq	%r10, %rax
	movl	(%r12,%rax,4), %eax
	testl	%eax, %eax
	jne	.L9
	movq	%rcx, 16(%rsp)
	movl	%r8d, 12(%rsp)
	movl	%edx, (%rsp)
	call	combi.part.0
	movq	16(%rsp), %rcx
	movl	12(%rsp), %r8d
	movl	(%rsp), %edx
.L9:
	addl	%r8d, %eax
	movslq	%eax, %r15
	movl	%eax, %esi
	imulq	$360287945, %r15, %r15
	sarl	$31, %esi
	sarq	$55, %r15
	subl	%esi, %r15d
	imull	$100000007, %r15d, %esi
	subl	%esi, %eax
	movl	%eax, %r15d
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L13:
	leal	-2(%rbp), %edi
	movslq	%edi, %rdx
	imulq	$1001, %rdx, %rax
	addq	%rcx, %rax
	movl	(%r12,%rax,4), %ebx
	testl	%ebx, %ebx
	jne	.L14
	movq	%rdx, 24(%rsp)
	movq	%rcx, 16(%rsp)
	movl	%esi, 12(%rsp)
	movl	%edi, (%rsp)
	call	combi.part.0
	movq	24(%rsp), %rdx
	movq	16(%rsp), %rcx
	movl	12(%rsp), %esi
	movl	(%rsp), %edi
	movl	%eax, %ebx
.L14:
	imulq	$1001, %rdx, %rax
	subl	$1, %esi
	movslq	%esi, %r8
	addq	%r8, %rax
	movl	(%r12,%rax,4), %eax
	testl	%eax, %eax
	jne	.L15
	movq	%rcx, (%rsp)
	call	combi.part.0
	movq	(%rsp), %rcx
.L15:
	leal	(%rax,%rbx), %edx
	movslq	%edx, %rax
	imulq	$360287945, %rax, %rax
	jmp	.L22
.L24:
	cmpl	$1, %r15d
	jne	.L6
	imulq	$360287945, %r14, %r15
	movl	%edx, %eax
	movl	$1, %ecx
	sarl	$31, %eax
	sarq	$55, %r15
	subl	%eax, %r15d
	imull	$100000007, %r15d, %eax
	movl	%edx, %r15d
	subl	%eax, %r15d
	jmp	.L7
	.cfi_endproc
.LFE25:
	.size	combi.part.0, .-combi.part.0
	.p2align 4
	.globl	combi
	.type	combi, @function
combi:
.LFB23:
	.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
	movslq	%edi, %r12
	imulq	$1001, %r12, %rax
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movslq	%esi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	tbl(%rip), %rbx
	addq	%rbp, %rax
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movl	(%rbx,%rax,4), %eax
	testl	%eax, %eax
	jne	.L25
	leal	(%rbp,%rbp), %eax
	movq	%r12, %r13
	movq	%rbp, %r11
	cmpl	%eax, %r12d
	jge	.L27
	movl	%r12d, %eax
	subl	%ebp, %eax
	movslq	%eax, %rbp
	movq	%rbp, %r11
.L27:
	movl	$1, %eax
	testl	%r11d, %r11d
	jne	.L49
.L28:
	imulq	$1001, %r12, %rdx
	addq	%rbp, %rdx
	movl	%eax, (%rbx,%rdx,4)
.L25:
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
	.p2align 4,,10
	.p2align 3
.L49:
	.cfi_restore_state
	cmpl	$1, %r11d
	jne	.L29
	imulq	$360287945, %r12, %rax
	movl	%r13d, %edx
	sarl	$31, %edx
	sarq	$55, %rax
	subl	%edx, %eax
	imull	$100000007, %eax, %edx
	movl	%r13d, %eax
	subl	%edx, %eax
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L29:
	leal	-1(%r13), %ecx
	movslq	%ecx, %r14
	imulq	$1001, %r14, %rax
	addq	%rbp, %rax
	movl	(%rbx,%rax,4), %r15d
	testl	%r15d, %r15d
	jne	.L30
	leal	(%r11,%r11), %eax
	cmpl	%eax, %ecx
	jge	.L42
	movl	%ecx, %esi
	subl	%r11d, %esi
	jne	.L50
	movl	$1, %r15d
	xorl	%edx, %edx
.L32:
	imulq	$1001, %r14, %rax
	addq	%rdx, %rax
	movl	%r15d, (%rbx,%rax,4)
.L30:
	imulq	$1001, %r14, %rax
	leal	-1(%r11), %esi
	movslq	%esi, %rdx
	addq	%rdx, %rax
	movl	(%rbx,%rax,4), %eax
	testl	%eax, %eax
	jne	.L35
	leal	(%rsi,%rsi), %eax
	cmpl	%eax, %ecx
	jge	.L36
	movl	%r13d, %esi
	subl	%r11d, %esi
	movslq	%esi, %rdx
.L36:
	movl	$1, %eax
	testl	%esi, %esi
	je	.L37
	cmpl	$1, %esi
	jne	.L38
	imulq	$360287945, %r14, %rax
.L48:
	movl	%ecx, %esi
	sarq	$55, %rax
	sarl	$31, %esi
	subl	%esi, %eax
	imull	$100000007, %eax, %esi
	movl	%ecx, %eax
	subl	%esi, %eax
.L37:
	imulq	$1001, %r14, %r14
	addq	%rdx, %r14
	movl	%eax, (%rbx,%r14,4)
.L35:
	leal	(%rax,%r15), %edx
	movslq	%edx, %rax
	movl	%edx, %ecx
	imulq	$360287945, %rax, %rax
	sarl	$31, %ecx
	sarq	$55, %rax
	subl	%ecx, %eax
	imull	$100000007, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L42:
	movl	%r11d, %esi
.L31:
	leal	-2(%r13), %edi
	movslq	%esi, %rdx
	movslq	%edi, %r8
	imulq	$1001, %r8, %rax
	addq	%rdx, %rax
	movl	(%rbx,%rax,4), %r15d
	testl	%r15d, %r15d
	jne	.L33
	movq	%r8, 40(%rsp)
	movq	%rdx, 32(%rsp)
	movl	%ecx, 24(%rsp)
	movl	%esi, 16(%rsp)
	movl	%edi, 8(%rsp)
	call	combi.part.0
	movq	40(%rsp), %r8
	movq	32(%rsp), %rdx
	movl	24(%rsp), %ecx
	movl	16(%rsp), %esi
	movl	%eax, %r15d
	movl	8(%rsp), %edi
.L33:
	imulq	$1001, %r8, %rax
	subl	$1, %esi
	movslq	%esi, %r9
	addq	%r9, %rax
	movl	(%rbx,%rax,4), %eax
	testl	%eax, %eax
	jne	.L34
	movq	%rdx, 16(%rsp)
	movl	%ecx, 8(%rsp)
	call	combi.part.0
	movq	16(%rsp), %rdx
	movl	8(%rsp), %ecx
.L34:
	addl	%r15d, %eax
	movslq	%eax, %r15
	movl	%eax, %esi
	imulq	$360287945, %r15, %r15
	sarl	$31, %esi
	sarq	$55, %r15
	subl	%esi, %r15d
	imull	$100000007, %r15d, %esi
	subl	%esi, %eax
	movl	%eax, %r15d
	jmp	.L32
	.p2align 4,,10
	.p2align 3
.L38:
	subl	$2, %r13d
	movslq	%r13d, %rcx
	imulq	$1001, %rcx, %rax
	addq	%rdx, %rax
	movl	(%rbx,%rax,4), %r11d
	testl	%r11d, %r11d
	jne	.L39
	movl	%r13d, %edi
	movq	%rcx, 24(%rsp)
	movq	%rdx, 16(%rsp)
	movl	%esi, 8(%rsp)
	call	combi.part.0
	movq	24(%rsp), %rcx
	movq	16(%rsp), %rdx
	movl	8(%rsp), %esi
	movl	%eax, %r11d
.L39:
	imulq	$1001, %rcx, %rax
	subl	$1, %esi
	movslq	%esi, %rdi
	addq	%rdi, %rax
	movl	(%rbx,%rax,4), %eax
	testl	%eax, %eax
	jne	.L40
	movl	%r13d, %edi
	movq	%rdx, 8(%rsp)
	call	combi.part.0
	movq	8(%rsp), %rdx
.L40:
	leal	(%rax,%r11), %ecx
	movslq	%ecx, %rax
	imulq	$360287945, %rax, %rax
	jmp	.L48
.L50:
	cmpl	$1, %esi
	jne	.L31
	imulq	$360287945, %r14, %r15
	movl	%ecx, %eax
	movl	$1, %edx
	sarl	$31, %eax
	sarq	$55, %r15
	subl	%eax, %r15d
	imull	$100000007, %r15d, %eax
	movl	%ecx, %r15d
	subl	%eax, %r15d
	jmp	.L32
	.cfi_endproc
.LFE23:
	.size	combi, .-combi
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d%d%d%d%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rcx
	leaq	4(%rsp), %rdx
	movq	%rsp, %rsi
	subq	$8, %rsp
	.cfi_def_cfa_offset 56
	leaq	28(%rsp), %rax
	pushq	%rax
	.cfi_def_cfa_offset 64
	xorl	%eax, %eax
	leaq	28(%rsp), %r9
	leaq	32(%rsp), %r8
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %edx
	movl	24(%rsp), %eax
	popq	%rcx
	.cfi_def_cfa_offset 56
	popq	%rsi
	.cfi_def_cfa_offset 48
	movl	%edx, %ecx
	subl	%eax, %ecx
	subl	%edx, %eax
	cmovs	%ecx, %eax
	movl	(%rsp), %ecx
	movl	%ecx, %edx
	subl	%eax, %edx
	cmpl	%eax, %edx
	cmovg	%eax, %edx
	xorl	%r11d, %r11d
	leal	(%rdx,%rdx), %eax
	cmpl	%ecx, %eax
	movl	20(%rsp), %ecx
	movl	16(%rsp), %eax
	sete	%r11b
	movl	%ecx, %esi
	subl	%eax, %esi
	subl	%ecx, %eax
	movl	4(%rsp), %ecx
	cmovs	%esi, %eax
	movl	%edx, %esi
	movl	%ecx, %edi
	subl	%eax, %edi
	cmpl	%eax, %edi
	cmovg	%eax, %edi
	leal	(%rdi,%rdi), %eax
	cmpl	%eax, %ecx
	sete	%al
	movzbl	%al, %eax
	addl	%eax, %r11d
	cmpl	%edx, %edi
	cmovle	%edi, %esi
	addl	%edx, %edi
	movslq	%edi, %rax
	imulq	$1001, %rax, %rax
	movslq	%esi, %rdx
	addq	%rdx, %rax
	leaq	tbl(%rip), %rdx
	movl	(%rdx,%rax,4), %edx
	testl	%edx, %edx
	jne	.L55
	call	combi.part.0
	movl	%eax, %edx
.L55:
	movl	%r11d, %ecx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	sall	%cl, %edx
	movslq	%edx, %rax
	movl	%edx, %ecx
	imulq	$360287945, %rax, %rax
	sarl	$31, %ecx
	sarq	$55, %rax
	subl	%ecx, %eax
	imull	$100000007, %eax, %eax
	subl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L58
	xorl	%eax, %eax
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L58:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	tbl
	.bss
	.align 32
	.type	tbl, @object
	.size	tbl, 4008004
tbl:
	.zero	4008004
	.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:

// AOJ 1501: Grid
// 2017.11.17 bal4u@uu

#include <stdio.h>

#define M 100000007
int tbl[1001][1001];

int combi(int n, int k)
{
	int ans;

	if (tbl[n][k]) return tbl[n][k];
	if ((k << 1) > n) k = n-k;
	if (k == 0) ans = 1;
	else if (k == 1) ans = n;
	else ans = combi(n-1, k) + combi(n-1, k-1);
	return tbl[n][k] = ans % M;
}

int main()
{
	int r, c, a1, b1, a2, b2, dr, dc, k, m;

	k = 0;
	scanf("%d%d%d%d%d%d", &r, &c, &a1, &a2, &b1, &b2);

	dr = a1-b1;
	if (dr < 0) dr = -dr;
	if (dr > r-dr) dr = r-dr;
	if ((dr << 1) == r) k++;

	dc = a2-b2;
	if (dc < 0) dc = -dc;
	if (dc > c-dc) dc = c-dc;
	if ((dc << 1) == c) k++;

	m = dc; if (dr < dc) m = dr;
	printf("%d\n", (combi(dr+dc, m) << k) % M);

	return 0;
}
500 500 0 0 107 200
 4 1 0 0 1 1
 4 4 1 0 3 3
 2 3 0 0 1 1
 500 500 0 0 107 239
 2 1 0 0 1 1
 678 500 0 0 107 168
 500 500 0 0 200 277
 500 500 1 0 107 239
 678 353 0 0 107 239

68949311
 1
 6
 4
 29183355
 2
 46712821
 1876138
 8735893
 48683066

Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
// AOJ 1501: Grid
// 2017.11.17 bal4u@uu

#include <stdio.h>

#define M 100000007
int tbl[1001][1001];

int combi(int n, int k)
{
	int ans;

	if (tbl[n][k]) return tbl[n][k];
	if ((k << 1) > n) k = n-k;
	if (k == 0) ans = 1;
	else if (k == 1) ans = n;
	else ans = combi(n-1, k) + combi(n-1, k-1);
	return tbl[n][k] = ans % M;
}

int main()
{
	int r, c, a1, b1, a2, b2, dr, dc, k, m;

	k = 0;
	scanf("%d%d%d%d%d%d", &r, &c, &a1, &a2, &b1, &b2);

	dr = a1-b1;
	if (dr < 0) dr = -dr;
	if (dr > r-dr) dr = r-dr;
	if ((dr << 1) == r) k++;

	dc = a2-b2;
	if (dc < 0) dc = -dc;
	if (dc > c-dc) dc = c-dc;
	if ((dc << 1) == c) k++;

	m = dc; if (dr < dc) m = dr;
	printf("%d\n", (combi(dr+dc, m) << k) % M);

	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	tbl
	.bss
	.align 32
	.type	tbl, @object
	.size	tbl, 4008004
tbl:
	.zero	4008004
	.text
	.globl	combi
	.type	combi, @function
combi:
.LFB0:
	.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	$40, %rsp
	.cfi_offset 3, -24
	movl	%edi, -36(%rbp)
	movl	%esi, -40(%rbp)
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$1001, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	tbl(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L2
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$1001, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	tbl(%rip), %rax
	movl	(%rdx,%rax), %eax
	jmp	.L3
.L2:
	movl	-40(%rbp), %eax
	addl	%eax, %eax
	cmpl	%eax, -36(%rbp)
	jge	.L4
	movl	-36(%rbp), %eax
	subl	-40(%rbp), %eax
	movl	%eax, -40(%rbp)
.L4:
	cmpl	$0, -40(%rbp)
	jne	.L5
	movl	$1, -20(%rbp)
	jmp	.L6
.L5:
	cmpl	$1, -40(%rbp)
	jne	.L7
	movl	-36(%rbp), %eax
	movl	%eax, -20(%rbp)
	jmp	.L6
.L7:
	movl	-36(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-40(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	combi
	movl	%eax, %ebx
	movl	-40(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-36(%rbp), %eax
	subl	$1, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	combi
	addl	%ebx, %eax
	movl	%eax, -20(%rbp)
.L6:
	movl	-20(%rbp), %edx
	movslq	%edx, %rax
	imulq	$360287945, %rax, %rax
	shrq	$32, %rax
	sarl	$23, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	imull	$100000007, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	-40(%rbp), %edx
	movslq	%edx, %rcx
	movl	-36(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$1001, %rdx, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	tbl(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$1001, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	tbl(%rip), %rax
	movl	(%rdx,%rax), %eax
.L3:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	combi, .-combi
	.section	.rodata
.LC0:
	.string	"%d%d%d%d%d%d"
.LC1:
	.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
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -16(%rbp)
	leaq	-36(%rbp), %r8
	leaq	-32(%rbp), %rdi
	leaq	-40(%rbp), %rcx
	leaq	-44(%rbp), %rdx
	leaq	-48(%rbp), %rax
	subq	$8, %rsp
	leaq	-28(%rbp), %rsi
	pushq	%rsi
	movq	%r8, %r9
	movq	%rdi, %r8
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$16, %rsp
	movl	-40(%rbp), %eax
	movl	-36(%rbp), %edx
	subl	%edx, %eax
	movl	%eax, -24(%rbp)
	cmpl	$0, -24(%rbp)
	jns	.L9
	negl	-24(%rbp)
.L9:
	movl	-48(%rbp), %eax
	subl	-24(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jle	.L10
	movl	-48(%rbp), %eax
	subl	-24(%rbp), %eax
	movl	%eax, -24(%rbp)
.L10:
	movl	-24(%rbp), %eax
	leal	(%rax,%rax), %edx
	movl	-48(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L11
	addl	$1, -16(%rbp)
.L11:
	movl	-32(%rbp), %eax
	movl	-28(%rbp), %edx
	subl	%edx, %eax
	movl	%eax, -20(%rbp)
	cmpl	$0, -20(%rbp)
	jns	.L12
	negl	-20(%rbp)
.L12:
	movl	-44(%rbp), %eax
	subl	-20(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jle	.L13
	movl	-44(%rbp), %eax
	subl	-20(%rbp), %eax
	movl	%eax, -20(%rbp)
.L13:
	movl	-20(%rbp), %eax
	leal	(%rax,%rax), %edx
	movl	-44(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L14
	addl	$1, -16(%rbp)
.L14:
	movl	-20(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	-24(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jge	.L15
	movl	-24(%rbp), %eax
	movl	%eax, -12(%rbp)
.L15:
	movl	-24(%rbp), %edx
	movl	-20(%rbp), %eax
	addl	%eax, %edx
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	combi
	movl	%eax, %edx
	movl	-16(%rbp), %eax
	movl	%eax, %ecx
	sall	%cl, %edx
	movslq	%edx, %rax
	imulq	$360287945, %rax, %rax
	shrq	$32, %rax
	sarl	$23, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	imull	$100000007, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	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	tbl
	.bss
	.align 32
	.type	tbl, @object
	.size	tbl, 4008004
tbl:
	.zero	4008004
	.text
	.globl	combi
	.type	combi, @function
combi:
.LFB0:
	.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	$40, %rsp
	.cfi_offset 3, -24
	movl	%edi, -36(%rbp)
	movl	%esi, -40(%rbp)
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$1001, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	tbl(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L2
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$1001, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	tbl(%rip), %rax
	movl	(%rdx,%rax), %eax
	jmp	.L3
.L2:
	movl	-40(%rbp), %eax
	addl	%eax, %eax
	cmpl	%eax, -36(%rbp)
	jge	.L4
	movl	-36(%rbp), %eax
	subl	-40(%rbp), %eax
	movl	%eax, -40(%rbp)
.L4:
	cmpl	$0, -40(%rbp)
	jne	.L5
	movl	$1, -20(%rbp)
	jmp	.L6
.L5:
	cmpl	$1, -40(%rbp)
	jne	.L7
	movl	-36(%rbp), %eax
	movl	%eax, -20(%rbp)
	jmp	.L6
.L7:
	movl	-36(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-40(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	combi
	movl	%eax, %ebx
	movl	-40(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-36(%rbp), %eax
	subl	$1, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	combi
	addl	%ebx, %eax
	movl	%eax, -20(%rbp)
.L6:
	movl	-20(%rbp), %edx
	movslq	%edx, %rax
	imulq	$360287945, %rax, %rax
	shrq	$32, %rax
	sarl	$23, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	imull	$100000007, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	-40(%rbp), %edx
	movslq	%edx, %rcx
	movl	-36(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$1001, %rdx, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	tbl(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$1001, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	tbl(%rip), %rax
	movl	(%rdx,%rax), %eax
.L3:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	combi, .-combi
	.section	.rodata
.LC0:
	.string	"%d%d%d%d%d%d"
.LC1:
	.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
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -16(%rbp)
	leaq	-36(%rbp), %r8
	leaq	-32(%rbp), %rdi
	leaq	-40(%rbp), %rcx
	leaq	-44(%rbp), %rdx
	leaq	-48(%rbp), %rax
	subq	$8, %rsp
	leaq	-28(%rbp), %rsi
	pushq	%rsi
	movq	%r8, %r9
	movq	%rdi, %r8
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$16, %rsp
	movl	-40(%rbp), %eax
	movl	-36(%rbp), %edx
	subl	%edx, %eax
	movl	%eax, -24(%rbp)
	cmpl	$0, -24(%rbp)
	jns	.L9
	negl	-24(%rbp)
.L9:
	movl	-48(%rbp), %eax
	subl	-24(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jle	.L10
	movl	-48(%rbp), %eax
	subl	-24(%rbp), %eax
	movl	%eax, -24(%rbp)
.L10:
	movl	-24(%rbp), %eax
	leal	(%rax,%rax), %edx
	movl	-48(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L11
	addl	$1, -16(%rbp)
.L11:
	movl	-32(%rbp), %eax
	movl	-28(%rbp), %edx
	subl	%edx, %eax
	movl	%eax, -20(%rbp)
	cmpl	$0, -20(%rbp)
	jns	.L12
	negl	-20(%rbp)
.L12:
	movl	-44(%rbp), %eax
	subl	-20(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jle	.L13
	movl	-44(%rbp), %eax
	subl	-20(%rbp), %eax
	movl	%eax, -20(%rbp)
.L13:
	movl	-20(%rbp), %eax
	leal	(%rax,%rax), %edx
	movl	-44(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L14
	addl	$1, -16(%rbp)
.L14:
	movl	-20(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	-24(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jge	.L15
	movl	-24(%rbp), %eax
	movl	%eax, -12(%rbp)
.L15:
	movl	-24(%rbp), %edx
	movl	-20(%rbp), %eax
	addl	%eax, %edx
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	combi
	movl	%eax, %edx
	movl	-16(%rbp), %eax
	movl	%eax, %ecx
	sall	%cl, %edx
	movslq	%edx, %rax
	imulq	$360287945, %rax, %rax
	shrq	$32, %rax
	sarl	$23, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	imull	$100000007, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	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:
