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 i, q, a, b, c, d;
	char S[100001], T[100001];
	scanf("%s", S);
	scanf("%s", T);
	scanf("%d", &q);
	
	int count[2][100001] = {};
	for (i = 0; S[i] != 0; i++) count[0][i+1] = count[0][i] + ((S[i] == 'A')? 1: 0);
	for (i = 0; T[i] != 0; i++) count[1][i+1] = count[1][i] + ((T[i] == 'A')? 1: 0);
	
	for (i = 1; i <= q; i++) {
		scanf("%d %d %d %d", &a, &b, &c, &d);
		if (((b - a + 1) - (count[0][b] - count[0][a-1]) * 2 + (count[1][d] - count[1][c-1]) * 2 - (d - c + 1)) % 3 == 0) printf("YES\n");
		else printf("NO\n");
	}
	fflush(stdout);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d %d %d %d"
.LC3:
	.string	"YES"
.LC4:
	.string	"NO"
	.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
	leaq	-999424(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$656, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-200032(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-100016(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-1000072(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-1000048(%rbp), %rax
	movl	$800008, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -1000052(%rbp)
	jmp	.L2
.L3:
	movl	-1000052(%rbp), %eax
	cltq
	movl	-1000048(%rbp,%rax,4), %ecx
	movl	-1000052(%rbp), %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	cmpb	$65, %al
	sete	%al
	movzbl	%al, %edx
	movl	-1000052(%rbp), %eax
	addl	$1, %eax
	addl	%ecx, %edx
	cltq
	movl	%edx, -1000048(%rbp,%rax,4)
	addl	$1, -1000052(%rbp)
.L2:
	movl	-1000052(%rbp), %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	testb	%al, %al
	jne	.L3
	movl	$0, -1000052(%rbp)
	jmp	.L4
.L5:
	movl	-1000052(%rbp), %eax
	cltq
	addq	$100001, %rax
	movl	-1000048(%rbp,%rax,4), %ecx
	movl	-1000052(%rbp), %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$65, %al
	sete	%al
	movzbl	%al, %edx
	movl	-1000052(%rbp), %eax
	addl	$1, %eax
	addl	%ecx, %edx
	cltq
	addq	$100001, %rax
	movl	%edx, -1000048(%rbp,%rax,4)
	addl	$1, -1000052(%rbp)
.L4:
	movl	-1000052(%rbp), %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	testb	%al, %al
	jne	.L5
	movl	$1, -1000052(%rbp)
	jmp	.L6
.L9:
	leaq	-1000056(%rbp), %rsi
	leaq	-1000060(%rbp), %rcx
	leaq	-1000064(%rbp), %rdx
	leaq	-1000068(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-1000064(%rbp), %eax
	movl	-1000068(%rbp), %edx
	subl	%edx, %eax
	leal	1(%rax), %ecx
	movl	-1000064(%rbp), %eax
	cltq
	movl	-1000048(%rbp,%rax,4), %edx
	movl	-1000068(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-1000048(%rbp,%rax,4), %esi
	movl	%edx, %eax
	subl	%esi, %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	-1000056(%rbp), %eax
	cltq
	addq	$100001, %rax
	movl	-1000048(%rbp,%rax,4), %eax
	movl	-1000060(%rbp), %edx
	subl	$1, %edx
	movslq	%edx, %rdx
	addq	$100001, %rdx
	movl	-1000048(%rbp,%rdx,4), %edx
	subl	%edx, %eax
	addl	%eax, %eax
	leal	(%rcx,%rax), %edx
	movl	-1000056(%rbp), %eax
	movl	-1000060(%rbp), %ecx
	subl	%ecx, %eax
	addl	$1, %eax
	subl	%eax, %edx
	movslq	%edx, %rax
	imulq	$1431655766, %rax, %rax
	shrq	$32, %rax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	movl	%eax, %ecx
	addl	%ecx, %ecx
	addl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	testl	%eax, %eax
	jne	.L7
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L8
.L7:
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L8:
	addl	$1, -1000052(%rbp)
.L6:
	movl	-1000072(%rbp), %eax
	cmpl	%eax, -1000052(%rbp)
	jle	.L9
	movq	stdout(%rip), %rax
	movq	%rax, %rdi
	call	fflush@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	"%s"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d %d %d %d"
.LC3:
	.string	"YES"
.LC4:
	.string	"NO"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.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
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-999424(%rsp), %r11
	.cfi_def_cfa 11, 999480
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$664, %rsp
	.cfi_def_cfa_offset 1000144
	leaq	.LC0(%rip), %rbp
	movq	%rbp, %rdi
	movq	%fs:40, %rax
	movq	%rax, 1000072(%rsp)
	xorl	%eax, %eax
	leaq	800048(%rsp), %rsi
	call	__isoc99_scanf@PLT
	leaq	900064(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	leaq	12(%rsp), %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	leaq	32(%rsp), %rdi
	movl	$800008, %edx
	xorl	%esi, %esi
	call	memset@PLT
	movzbl	800048(%rsp), %edx
	movq	%rax, %rdi
	testb	%dl, %dl
	je	.L2
	movl	$1, %eax
	xorl	%ecx, %ecx
	leaq	800047(%rsp), %rsi
	.p2align 4,,10
	.p2align 3
.L3:
	cmpb	$65, %dl
	sete	%dl
	movzbl	%dl, %edx
	addl	%edx, %ecx
	movl	%ecx, (%rdi,%rax,4)
	addq	$1, %rax
	movzbl	(%rsi,%rax), %edx
	testb	%dl, %dl
	jne	.L3
.L2:
	movzbl	900064(%rsp), %edx
	testb	%dl, %dl
	je	.L4
	movl	400036(%rsp), %ecx
	movl	$1, %eax
	leaq	900063(%rsp), %rsi
	.p2align 4,,10
	.p2align 3
.L5:
	cmpb	$65, %dl
	sete	%dl
	movzbl	%dl, %edx
	addl	%edx, %ecx
	movl	%ecx, 400004(%rdi,%rax,4)
	addq	$1, %rax
	movzbl	(%rsi,%rax), %edx
	testb	%dl, %dl
	jne	.L5
.L4:
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L6
	movl	$1, %ebx
	leaq	28(%rsp), %r15
	leaq	24(%rsp), %r14
	leaq	20(%rsp), %r13
	leaq	16(%rsp), %r12
	leaq	.LC2(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L9:
	movq	%r14, %rcx
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	movq	%r15, %r8
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	20(%rsp), %rdi
	movl	16(%rsp), %eax
	movl	24(%rsp), %esi
	movl	28(%rsp), %edx
	movl	%edi, %ecx
	movl	32(%rsp,%rdi,4), %edi
	subl	%eax, %ecx
	subl	$1, %eax
	cltq
	addl	$1, %ecx
	subl	32(%rsp,%rax,4), %edi
	movl	%edi, %eax
	leal	-1(%rsi), %edi
	addl	%eax, %eax
	movslq	%edi, %rdi
	subl	%eax, %ecx
	movslq	%edx, %rax
	subl	%esi, %edx
	movl	400036(%rsp,%rax,4), %eax
	subl	400036(%rsp,%rdi,4), %eax
	addl	$1, %edx
	leal	(%rcx,%rax,2), %eax
	subl	%edx, %eax
	imull	$-1431655765, %eax, %eax
	addl	$715827882, %eax
	cmpl	$1431655764, %eax
	ja	.L7
	leaq	.LC3(%rip), %rdi
	addl	$1, %ebx
	call	puts@PLT
	cmpl	%ebx, 12(%rsp)
	jge	.L9
.L6:
	movq	stdout(%rip), %rdi
	call	fflush@PLT
	movq	1000072(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L21
	addq	$1000088, %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
	.p2align 4,,10
	.p2align 3
.L7:
	.cfi_restore_state
	leaq	.LC4(%rip), %rdi
	addl	$1, %ebx
	call	puts@PLT
	cmpl	%ebx, 12(%rsp)
	jge	.L9
	jmp	.L6
.L21:
	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	"%s"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d %d %d %d"
.LC3:
	.string	"YES"
.LC4:
	.string	"NO"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.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
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-999424(%rsp), %r11
	.cfi_def_cfa 11, 999480
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$664, %rsp
	.cfi_def_cfa_offset 1000144
	leaq	.LC0(%rip), %rbp
	movq	%rbp, %rdi
	movq	%fs:40, %rax
	movq	%rax, 1000072(%rsp)
	xorl	%eax, %eax
	leaq	800048(%rsp), %rsi
	call	__isoc99_scanf@PLT
	leaq	900064(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	leaq	12(%rsp), %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	leaq	32(%rsp), %rdi
	movl	$800008, %edx
	xorl	%esi, %esi
	call	memset@PLT
	movzbl	800048(%rsp), %edx
	movq	%rax, %rdi
	testb	%dl, %dl
	je	.L2
	movl	$1, %eax
	xorl	%ecx, %ecx
	leaq	800047(%rsp), %rsi
	.p2align 4,,10
	.p2align 3
.L3:
	cmpb	$65, %dl
	sete	%dl
	movzbl	%dl, %edx
	addl	%edx, %ecx
	movl	%ecx, (%rdi,%rax,4)
	addq	$1, %rax
	movzbl	(%rsi,%rax), %edx
	testb	%dl, %dl
	jne	.L3
.L2:
	movzbl	900064(%rsp), %edx
	testb	%dl, %dl
	je	.L4
	movl	400036(%rsp), %ecx
	movl	$1, %eax
	leaq	900063(%rsp), %rsi
	.p2align 4,,10
	.p2align 3
.L5:
	cmpb	$65, %dl
	sete	%dl
	movzbl	%dl, %edx
	addl	%edx, %ecx
	movl	%ecx, 400004(%rdi,%rax,4)
	addq	$1, %rax
	movzbl	(%rsi,%rax), %edx
	testb	%dl, %dl
	jne	.L5
.L4:
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L6
	movl	$1, %ebx
	leaq	28(%rsp), %r15
	leaq	24(%rsp), %r14
	leaq	20(%rsp), %r13
	leaq	16(%rsp), %r12
	leaq	.LC2(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L9:
	movq	%r14, %rcx
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	movq	%r15, %r8
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	20(%rsp), %rdi
	movl	16(%rsp), %eax
	movl	24(%rsp), %esi
	movl	28(%rsp), %edx
	movl	%edi, %ecx
	movl	32(%rsp,%rdi,4), %edi
	subl	%eax, %ecx
	subl	$1, %eax
	cltq
	addl	$1, %ecx
	subl	32(%rsp,%rax,4), %edi
	movl	%edi, %eax
	leal	-1(%rsi), %edi
	addl	%eax, %eax
	movslq	%edi, %rdi
	subl	%eax, %ecx
	movslq	%edx, %rax
	subl	%esi, %edx
	movl	400036(%rsp,%rax,4), %eax
	subl	400036(%rsp,%rdi,4), %eax
	addl	$1, %edx
	leal	(%rcx,%rax,2), %eax
	subl	%edx, %eax
	imull	$-1431655765, %eax, %eax
	addl	$715827882, %eax
	cmpl	$1431655764, %eax
	ja	.L7
	leaq	.LC3(%rip), %rdi
	addl	$1, %ebx
	call	puts@PLT
	cmpl	%ebx, 12(%rsp)
	jge	.L9
.L6:
	movq	stdout(%rip), %rdi
	call	fflush@PLT
	movq	1000072(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L21
	addq	$1000088, %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
	.p2align 4,,10
	.p2align 3
.L7:
	.cfi_restore_state
	leaq	.LC4(%rip), %rdi
	addl	$1, %ebx
	call	puts@PLT
	cmpl	%ebx, 12(%rsp)
	jge	.L9
	jmp	.L6
.L21:
	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 i, q, a, b, c, d;
	char S[100001], T[100001];
	scanf("%s", S);
	scanf("%s", T);
	scanf("%d", &q);
	
	int count[2][100001] = {};
	for (i = 0; S[i] != 0; i++) count[0][i+1] = count[0][i] + ((S[i] == 'A')? 1: 0);
	for (i = 0; T[i] != 0; i++) count[1][i+1] = count[1][i] + ((T[i] == 'A')? 1: 0);
	
	for (i = 1; i <= q; i++) {
		scanf("%d %d %d %d", &a, &b, &c, &d);
		if (((b - a + 1) - (count[0][b] - count[0][a-1]) * 2 + (count[1][d] - count[1][c-1]) * 2 - (d - c + 1)) % 3 == 0) printf("YES\n");
		else printf("NO\n");
	}
	fflush(stdout);
	return 0;
}
AAAAABBBBAAABBBBAAAA
BBBBAAABBBBBBAAAAABB
10
2 15 2 13
2 13 6 16
1 13 2 20
4 20 6 20
1 18 9 19
2 14 1 11
3 20 3 15
6 16 1 17
4 18 8 20
7 20 3 14
 BBBAAAABA
BBBBA
4
7 9 2 5
7 9 1 4
1 7 2 5
1 6 2 4
 AAAAABBBBAAABBBBAAAA
BBBBAAABBBBBBAAAAABB
10
2 15 2 13
2 13 6 16
1 13 2 20
4 20 6 20
1 18 13 19
2 14 1 11
3 20 3 15
6 16 1 17
4 18 8 20
7 20 3 14
 AAAAABBBBAAABBBBAAAA
BBBBAAABBBBABAAAAABB
10
2 15 2 13
2 13 6 16
1 13 2 20
4 20 6 20
1 18 13 19
2 14 1 11
3 20 3 15
6 16 1 17
4 18 8 20
7 20 3 14
 AAAAABBBBAAABBBBAAAA
BBBBAAABBBBABAAAAABB
10
2 15 2 13
2 13 6 16
1 13 2 20
4 20 6 20
1 18 13 19
4 14 1 11
3 20 3 15
6 16 1 17
4 18 8 20
7 20 3 14
 AAAAABBBBAAABBBBAAAA
BBBBAAABBBBABAAAAABB
4
2 15 2 13
2 13 6 16
1 13 2 20
4 20 6 20
1 18 13 19
4 14 1 11
3 20 3 15
6 16 1 17
4 18 8 20
7 20 3 14
 AAAAABBBBAAABBBBAAAA
BBAAAAABABBBBAAABBBB
4
2 15 2 13
2 13 6 16
1 13 2 20
4 20 6 20
1 18 13 24
4 14 1 11
3 20 3 15
6 16 1 17
4 18 8 20
7 20 3 14
 AAAAABBBBAAABBBBAAAA
BBAAAAABABBBBAAABBBB
4
2 15 2 13
2 13 6 16
1 13 2 20
4 20 8 20
1 18 13 24
4 14 1 11
3 20 3 15
6 16 1 17
4 18 8 14
7 20 3 14
 AAAAABBBBAAABBBBAAAA
BBBBAAABBBBABAAAAABB
4
2 15 2 13
2 13 6 16
1 13 2 20
4 20 8 20
1 18 13 24
4 14 1 11
3 20 3 15
6 16 1 17
4 18 8 14
7 20 3 14
 AAAAABBBBAAABBBBAAAA
BBBBAAABBBBBBAAAAABB
10
2 15 2 13
2 13 6 16
1 13 2 20
4 20 3 20
1 18 9 19
2 14 1 11
3 20 3 15
6 16 1 19
4 18 8 20
7 20 3 14

YES
YES
YES
NO
YES
YES
NO
NO
NO
NO
 YES
NO
YES
YES
 YES
YES
YES
NO
NO
YES
NO
NO
NO
NO
 NO
NO
NO
YES
NO
YES
YES
NO
YES
NO
 NO
NO
NO
YES
NO
NO
YES
NO
YES
NO
 NO
NO
NO
YES
 YES
NO
NO
NO
 YES
NO
NO
YES
 NO
NO
NO
NO
 YES
YES
YES
YES
YES
YES
NO
NO
NO
NO

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 i, q, a, b, c, d;
	char S[100001], T[100001];
	scanf("%s", S);
	scanf("%s", T);
	scanf("%d", &q);
	
	int count[2][100001] = {};
	for (i = 0; S[i] != 0; i++) count[0][i+1] = count[0][i] + ((S[i] == 'A')? 1: 0);
	for (i = 0; T[i] != 0; i++) count[1][i+1] = count[1][i] + ((T[i] == 'A')? 1: 0);
	
	for (i = 1; i <= q; i++) {
		scanf("%d %d %d %d", &a, &b, &c, &d);
		if (((b - a + 1) - (count[0][b] - count[0][a-1]) * 2 + (count[1][d] - count[1][c-1]) * 2 - (d - c + 1)) % 3 == 0) printf("YES\n");
		else printf("NO\n");
	}
	fflush(stdout);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d %d %d %d"
.LC3:
	.string	"YES"
.LC4:
	.string	"NO"
	.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
	leaq	-999424(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$656, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-200032(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-100016(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-1000072(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-1000048(%rbp), %rax
	movl	$800008, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -1000052(%rbp)
	jmp	.L2
.L3:
	movl	-1000052(%rbp), %eax
	cltq
	movl	-1000048(%rbp,%rax,4), %ecx
	movl	-1000052(%rbp), %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	cmpb	$65, %al
	sete	%al
	movzbl	%al, %edx
	movl	-1000052(%rbp), %eax
	addl	$1, %eax
	addl	%ecx, %edx
	cltq
	movl	%edx, -1000048(%rbp,%rax,4)
	addl	$1, -1000052(%rbp)
.L2:
	movl	-1000052(%rbp), %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	testb	%al, %al
	jne	.L3
	movl	$0, -1000052(%rbp)
	jmp	.L4
.L5:
	movl	-1000052(%rbp), %eax
	cltq
	addq	$100001, %rax
	movl	-1000048(%rbp,%rax,4), %ecx
	movl	-1000052(%rbp), %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$65, %al
	sete	%al
	movzbl	%al, %edx
	movl	-1000052(%rbp), %eax
	addl	$1, %eax
	addl	%ecx, %edx
	cltq
	addq	$100001, %rax
	movl	%edx, -1000048(%rbp,%rax,4)
	addl	$1, -1000052(%rbp)
.L4:
	movl	-1000052(%rbp), %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	testb	%al, %al
	jne	.L5
	movl	$1, -1000052(%rbp)
	jmp	.L6
.L9:
	leaq	-1000056(%rbp), %rsi
	leaq	-1000060(%rbp), %rcx
	leaq	-1000064(%rbp), %rdx
	leaq	-1000068(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-1000064(%rbp), %eax
	movl	-1000068(%rbp), %edx
	subl	%edx, %eax
	leal	1(%rax), %ecx
	movl	-1000064(%rbp), %eax
	cltq
	movl	-1000048(%rbp,%rax,4), %edx
	movl	-1000068(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-1000048(%rbp,%rax,4), %esi
	movl	%edx, %eax
	subl	%esi, %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	-1000056(%rbp), %eax
	cltq
	addq	$100001, %rax
	movl	-1000048(%rbp,%rax,4), %eax
	movl	-1000060(%rbp), %edx
	subl	$1, %edx
	movslq	%edx, %rdx
	addq	$100001, %rdx
	movl	-1000048(%rbp,%rdx,4), %edx
	subl	%edx, %eax
	addl	%eax, %eax
	leal	(%rcx,%rax), %edx
	movl	-1000056(%rbp), %eax
	movl	-1000060(%rbp), %ecx
	subl	%ecx, %eax
	addl	$1, %eax
	subl	%eax, %edx
	movslq	%edx, %rax
	imulq	$1431655766, %rax, %rax
	shrq	$32, %rax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	movl	%eax, %ecx
	addl	%ecx, %ecx
	addl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	testl	%eax, %eax
	jne	.L7
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L8
.L7:
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L8:
	addl	$1, -1000052(%rbp)
.L6:
	movl	-1000072(%rbp), %eax
	cmpl	%eax, -1000052(%rbp)
	jle	.L9
	movq	stdout(%rip), %rax
	movq	%rax, %rdi
	call	fflush@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	"%s"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d %d %d %d"
.LC3:
	.string	"YES"
.LC4:
	.string	"NO"
	.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
	leaq	-999424(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$656, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-200032(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-100016(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-1000072(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-1000048(%rbp), %rax
	movl	$800008, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -1000052(%rbp)
	jmp	.L2
.L3:
	movl	-1000052(%rbp), %eax
	cltq
	movl	-1000048(%rbp,%rax,4), %ecx
	movl	-1000052(%rbp), %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	cmpb	$65, %al
	sete	%al
	movzbl	%al, %edx
	movl	-1000052(%rbp), %eax
	addl	$1, %eax
	addl	%ecx, %edx
	cltq
	movl	%edx, -1000048(%rbp,%rax,4)
	addl	$1, -1000052(%rbp)
.L2:
	movl	-1000052(%rbp), %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	testb	%al, %al
	jne	.L3
	movl	$0, -1000052(%rbp)
	jmp	.L4
.L5:
	movl	-1000052(%rbp), %eax
	cltq
	addq	$100001, %rax
	movl	-1000048(%rbp,%rax,4), %ecx
	movl	-1000052(%rbp), %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$65, %al
	sete	%al
	movzbl	%al, %edx
	movl	-1000052(%rbp), %eax
	addl	$1, %eax
	addl	%ecx, %edx
	cltq
	addq	$100001, %rax
	movl	%edx, -1000048(%rbp,%rax,4)
	addl	$1, -1000052(%rbp)
.L4:
	movl	-1000052(%rbp), %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	testb	%al, %al
	jne	.L5
	movl	$1, -1000052(%rbp)
	jmp	.L6
.L9:
	leaq	-1000056(%rbp), %rsi
	leaq	-1000060(%rbp), %rcx
	leaq	-1000064(%rbp), %rdx
	leaq	-1000068(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-1000064(%rbp), %eax
	movl	-1000068(%rbp), %edx
	subl	%edx, %eax
	leal	1(%rax), %ecx
	movl	-1000064(%rbp), %eax
	cltq
	movl	-1000048(%rbp,%rax,4), %edx
	movl	-1000068(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-1000048(%rbp,%rax,4), %esi
	movl	%edx, %eax
	subl	%esi, %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	-1000056(%rbp), %eax
	cltq
	addq	$100001, %rax
	movl	-1000048(%rbp,%rax,4), %eax
	movl	-1000060(%rbp), %edx
	subl	$1, %edx
	movslq	%edx, %rdx
	addq	$100001, %rdx
	movl	-1000048(%rbp,%rdx,4), %edx
	subl	%edx, %eax
	addl	%eax, %eax
	leal	(%rcx,%rax), %edx
	movl	-1000056(%rbp), %eax
	movl	-1000060(%rbp), %ecx
	subl	%ecx, %eax
	addl	$1, %eax
	subl	%eax, %edx
	movslq	%edx, %rax
	imulq	$1431655766, %rax, %rax
	shrq	$32, %rax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	movl	%eax, %ecx
	addl	%ecx, %ecx
	addl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	testl	%eax, %eax
	jne	.L7
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L8
.L7:
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L8:
	addl	$1, -1000052(%rbp)
.L6:
	movl	-1000072(%rbp), %eax
	cmpl	%eax, -1000052(%rbp)
	jle	.L9
	movq	stdout(%rip), %rax
	movq	%rax, %rdi
	call	fflush@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:
