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

```c
// AOJ 1384 Rendezvous on a Tetrahedron
// 2018.4.6 bal4u

#include <stdio.h>
#include <math.h>

#define BASE     100
#define PI180    0.01745329251994329576923690768489    // PI/180
#define tan60	 (sqrt(3))				// tan 60 = sqrt(3)
#define sin60    (sqrt(3)/2)			// sin 60 = sqrt(3)/2

#define A 0
#define B 1
#define C 2
#define D 3
int ans[2][2][2] = { B,A,C,D,D,C,A,B };

int calc(char *edge, int d, int l)
{
	int ix, iy, one;
	double delta, x, y;

	if      (*edge == 'D') d += 60;
	else if (*edge == 'B') d += 120;
	delta = d * PI180;			// d/180*PI

	x = BASE + l * (cos(delta) - sin(delta)/tan60);
	y = l * sin(delta)/sin60;

	ix = (int)x, iy = (int)y;
	one = ((x-ix) + (y-iy)) >= 1;
	return ans[ix&1][iy&1][one];
}

int main()
{
	int d, l, fp, fq;
	char edge[5];

	scanf("%s%d%d", edge, &d, &l);
	fp = calc(edge, d, l);
	scanf("%s%d%d", edge, &d, &l);
	fq = calc(edge, d, l);
	puts(fp == fq? "YES": "NO");
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	ans
	.data
	.align 32
	.type	ans, @object
	.size	ans, 32
ans:
	.long	1
	.long	0
	.long	2
	.long	3
	.long	3
	.long	2
	.long	0
	.long	1
	.text
	.globl	calc
	.type	calc, @function
calc:
.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	$88, %rsp
	.cfi_offset 3, -24
	movq	%rdi, -72(%rbp)
	movl	%esi, -76(%rbp)
	movl	%edx, -80(%rbp)
	movq	-72(%rbp), %rax
	movzbl	(%rax), %eax
	cmpb	$68, %al
	jne	.L2
	addl	$60, -76(%rbp)
	jmp	.L3
.L2:
	movq	-72(%rbp), %rax
	movzbl	(%rax), %eax
	cmpb	$66, %al
	jne	.L3
	addl	$120, -76(%rbp)
.L3:
	pxor	%xmm1, %xmm1
	cvtsi2sdl	-76(%rbp), %xmm1
	movsd	.LC0(%rip), %xmm0
	mulsd	%xmm1, %xmm0
	movsd	%xmm0, -40(%rbp)
	pxor	%xmm3, %xmm3
	cvtsi2sdl	-80(%rbp), %xmm3
	movsd	%xmm3, -88(%rbp)
	movq	-40(%rbp), %rax
	movq	%rax, %xmm0
	call	cos@PLT
	movq	%xmm0, %rbx
	movq	-40(%rbp), %rax
	movq	%rax, %xmm0
	call	sin@PLT
	movq	%xmm0, %rax
	movsd	.LC1(%rip), %xmm0
	movq	%rax, %xmm4
	divsd	%xmm0, %xmm4
	movapd	%xmm4, %xmm1
	movq	%rbx, %xmm0
	subsd	%xmm1, %xmm0
	movsd	-88(%rbp), %xmm1
	mulsd	%xmm0, %xmm1
	movsd	.LC2(%rip), %xmm0
	addsd	%xmm1, %xmm0
	movsd	%xmm0, -32(%rbp)
	pxor	%xmm5, %xmm5
	cvtsi2sdl	-80(%rbp), %xmm5
	movsd	%xmm5, -88(%rbp)
	movq	-40(%rbp), %rax
	movq	%rax, %xmm0
	call	sin@PLT
	mulsd	-88(%rbp), %xmm0
	movsd	.LC3(%rip), %xmm1
	divsd	%xmm1, %xmm0
	movsd	%xmm0, -24(%rbp)
	movsd	-32(%rbp), %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -52(%rbp)
	movsd	-24(%rbp), %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -48(%rbp)
	pxor	%xmm2, %xmm2
	cvtsi2sdl	-52(%rbp), %xmm2
	movsd	-32(%rbp), %xmm0
	movapd	%xmm0, %xmm1
	subsd	%xmm2, %xmm1
	pxor	%xmm2, %xmm2
	cvtsi2sdl	-48(%rbp), %xmm2
	movsd	-24(%rbp), %xmm0
	subsd	%xmm2, %xmm0
	addsd	%xmm1, %xmm0
	movsd	.LC4(%rip), %xmm1
	comisd	%xmm1, %xmm0
	setnb	%al
	movzbl	%al, %eax
	movl	%eax, -44(%rbp)
	movl	-52(%rbp), %eax
	andl	$1, %eax
	movl	%eax, %ecx
	movl	-48(%rbp), %eax
	andl	$1, %eax
	movl	%eax, %edx
	movl	-44(%rbp), %eax
	movslq	%eax, %rsi
	movslq	%ecx, %rax
	movslq	%edx, %rdx
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	ans(%rip), %rax
	movl	(%rdx,%rax), %eax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	calc, .-calc
	.section	.rodata
.LC5:
	.string	"%s%d%d"
.LC6:
	.string	"YES"
.LC7:
	.string	"NO"
	.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	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-28(%rbp), %rcx
	leaq	-32(%rbp), %rdx
	leaq	-13(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %edx
	movl	-32(%rbp), %ecx
	leaq	-13(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	calc
	movl	%eax, -24(%rbp)
	leaq	-28(%rbp), %rcx
	leaq	-32(%rbp), %rdx
	leaq	-13(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %edx
	movl	-32(%rbp), %ecx
	leaq	-13(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	calc
	movl	%eax, -20(%rbp)
	movl	-24(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jne	.L6
	leaq	.LC6(%rip), %rax
	jmp	.L7
.L6:
	leaq	.LC7(%rip), %rax
.L7:
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC0:
	.long	-1571644103
	.long	1066524486
	.align 8
.LC1:
	.long	-396866390
	.long	1073460858
	.align 8
.LC2:
	.long	0
	.long	1079574528
	.align 8
.LC3:
	.long	-396866390
	.long	1072412282
	.align 8
.LC4:
	.long	0
	.long	1072693248
	.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
	.globl	calc
	.type	calc, @function
calc:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movl	%edx, %ebx
	subq	$16, %rsp
	.cfi_def_cfa_offset 32
	movzbl	(%rdi), %eax
	cmpb	$68, %al
	je	.L6
	leal	120(%rsi), %edx
	cmpb	$66, %al
	cmove	%edx, %esi
.L3:
	pxor	%xmm0, %xmm0
	leaq	8(%rsp), %rdi
	movq	%rsp, %r8
	cvtsi2sdl	%esi, %xmm0
	mulsd	.LC0(%rip), %xmm0
	movq	%r8, %rsi
	call	sincos@PLT
	movsd	(%rsp), %xmm0
	pxor	%xmm1, %xmm1
	xorl	%ecx, %ecx
	movsd	8(%rsp), %xmm2
	cvtsi2sdl	%ebx, %xmm1
	movapd	%xmm2, %xmm3
	divsd	.LC1(%rip), %xmm3
	subsd	%xmm3, %xmm0
	mulsd	%xmm1, %xmm0
	addsd	.LC2(%rip), %xmm0
	mulsd	%xmm2, %xmm1
	pxor	%xmm2, %xmm2
	divsd	.LC3(%rip), %xmm1
	cvttsd2sil	%xmm1, %eax
	cvttsd2sil	%xmm0, %edx
	cvtsi2sdl	%edx, %xmm2
	subsd	%xmm2, %xmm0
	pxor	%xmm2, %xmm2
	cvtsi2sdl	%eax, %xmm2
	subsd	%xmm2, %xmm1
	addsd	%xmm1, %xmm0
	comisd	.LC4(%rip), %xmm0
	setnb	%cl
	andl	$1, %edx
	andl	$1, %eax
	leaq	(%rax,%rdx,2), %rax
	leaq	(%rcx,%rax,2), %rdx
	leaq	ans(%rip), %rax
	movl	(%rax,%rdx,4), %eax
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	.cfi_restore_state
	addl	$60, %esi
	jmp	.L3
	.cfi_endproc
.LFE23:
	.size	calc, .-calc
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC5:
	.string	"YES"
.LC6:
	.string	"NO"
.LC7:
	.string	"%s%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	.LC7(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$32, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	19(%rsp), %rbp
	leaq	12(%rsp), %r14
	leaq	8(%rsp), %r13
	movq	%r14, %rcx
	movq	%rbp, %rsi
	movq	%r13, %rdx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edx
	movl	8(%rsp), %esi
	movq	%rbp, %rdi
	call	calc
	movq	%r14, %rcx
	movq	%r13, %rdx
	movq	%rbp, %rsi
	movl	%eax, %ebx
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edx
	movl	8(%rsp), %esi
	movq	%rbp, %rdi
	call	calc
	leaq	.LC5(%rip), %rdi
	cmpl	%eax, %ebx
	leaq	.LC6(%rip), %rax
	cmovne	%rax, %rdi
	call	puts@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L12
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L12:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	ans
	.data
	.align 32
	.type	ans, @object
	.size	ans, 32
ans:
	.long	1
	.long	0
	.long	2
	.long	3
	.long	3
	.long	2
	.long	0
	.long	1
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC0:
	.long	-1571644103
	.long	1066524486
	.align 8
.LC1:
	.long	-396866390
	.long	1073460858
	.align 8
.LC2:
	.long	0
	.long	1079574528
	.align 8
.LC3:
	.long	-396866390
	.long	1072412282
	.align 8
.LC4:
	.long	0
	.long	1072693248
	.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
	.globl	calc
	.type	calc, @function
calc:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movl	%edx, %ebx
	subq	$16, %rsp
	.cfi_def_cfa_offset 32
	movzbl	(%rdi), %eax
	cmpb	$68, %al
	je	.L6
	leal	120(%rsi), %edx
	cmpb	$66, %al
	cmove	%edx, %esi
.L3:
	pxor	%xmm0, %xmm0
	leaq	8(%rsp), %rdi
	movq	%rsp, %r8
	cvtsi2sdl	%esi, %xmm0
	mulsd	.LC0(%rip), %xmm0
	movq	%r8, %rsi
	call	sincos@PLT
	movsd	(%rsp), %xmm0
	pxor	%xmm1, %xmm1
	xorl	%ecx, %ecx
	movsd	8(%rsp), %xmm2
	cvtsi2sdl	%ebx, %xmm1
	movapd	%xmm2, %xmm3
	divsd	.LC1(%rip), %xmm3
	subsd	%xmm3, %xmm0
	mulsd	%xmm1, %xmm0
	addsd	.LC2(%rip), %xmm0
	mulsd	%xmm2, %xmm1
	pxor	%xmm2, %xmm2
	divsd	.LC3(%rip), %xmm1
	cvttsd2sil	%xmm1, %eax
	cvttsd2sil	%xmm0, %edx
	cvtsi2sdl	%edx, %xmm2
	subsd	%xmm2, %xmm0
	pxor	%xmm2, %xmm2
	cvtsi2sdl	%eax, %xmm2
	subsd	%xmm2, %xmm1
	addsd	%xmm1, %xmm0
	comisd	.LC4(%rip), %xmm0
	setnb	%cl
	andl	$1, %edx
	andl	$1, %eax
	leaq	(%rax,%rdx,2), %rax
	leaq	(%rcx,%rax,2), %rdx
	leaq	ans(%rip), %rax
	movl	(%rax,%rdx,4), %eax
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	.cfi_restore_state
	addl	$60, %esi
	jmp	.L3
	.cfi_endproc
.LFE23:
	.size	calc, .-calc
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC5:
	.string	"YES"
.LC6:
	.string	"NO"
.LC7:
	.string	"%s%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	.LC7(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$32, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	19(%rsp), %rbp
	leaq	12(%rsp), %r14
	leaq	8(%rsp), %r13
	movq	%r14, %rcx
	movq	%rbp, %rsi
	movq	%r13, %rdx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edx
	movl	8(%rsp), %esi
	movq	%rbp, %rdi
	call	calc
	movq	%r14, %rcx
	movq	%r13, %rdx
	movq	%rbp, %rsi
	movl	%eax, %ebx
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edx
	movl	8(%rsp), %esi
	movq	%rbp, %rdi
	call	calc
	leaq	.LC5(%rip), %rdi
	cmpl	%eax, %ebx
	leaq	.LC6(%rip), %rax
	cmovne	%rax, %rdi
	call	puts@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L12
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L12:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	ans
	.data
	.align 32
	.type	ans, @object
	.size	ans, 32
ans:
	.long	1
	.long	0
	.long	2
	.long	3
	.long	3
	.long	2
	.long	0
	.long	1
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC0:
	.long	-1571644103
	.long	1066524486
	.align 8
.LC1:
	.long	-396866390
	.long	1073460858
	.align 8
.LC2:
	.long	0
	.long	1079574528
	.align 8
.LC3:
	.long	-396866390
	.long	1072412282
	.align 8
.LC4:
	.long	0
	.long	1072693248
	.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 1384 Rendezvous on a Tetrahedron
// 2018.4.6 bal4u

#include <stdio.h>
#include <math.h>

#define BASE     100
#define PI180    0.01745329251994329576923690768489    // PI/180
#define tan60	 (sqrt(3))				// tan 60 = sqrt(3)
#define sin60    (sqrt(3)/2)			// sin 60 = sqrt(3)/2

#define A 0
#define B 1
#define C 2
#define D 3
int ans[2][2][2] = { B,A,C,D,D,C,A,B };

int calc(char *edge, int d, int l)
{
	int ix, iy, one;
	double delta, x, y;

	if      (*edge == 'D') d += 60;
	else if (*edge == 'B') d += 120;
	delta = d * PI180;			// d/180*PI

	x = BASE + l * (cos(delta) - sin(delta)/tan60);
	y = l * sin(delta)/sin60;

	ix = (int)x, iy = (int)y;
	one = ((x-ix) + (y-iy)) >= 1;
	return ans[ix&1][iy&1][one];
}

int main()
{
	int d, l, fp, fq;
	char edge[5];

	scanf("%s%d%d", edge, &d, &l);
	fp = calc(edge, d, l);
	scanf("%s%d%d", edge, &d, &l);
	fq = calc(edge, d, l);
	puts(fp == fq? "YES": "NO");
	return 0;
}

CD 51 1
DB 30 1
 CD 51 0
DB 55 1
 CD 51 1
DB 55 1
 CD 51 1
DB 19 1
 CD 51 1
DB 55 0
 CD 51 0
DB 56 1
 CD 14 1
DB 55 0
 CD 20 1
DB 55 0
 CD 30 1
DB 30 2
 CD 51 0
DB 54 1

YES
 NO
 YES
 YES
 NO
 NO
 NO
 NO
 YES
 NO

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

```c
// AOJ 1384 Rendezvous on a Tetrahedron
// 2018.4.6 bal4u

#include <stdio.h>
#include <math.h>

#define BASE     100
#define PI180    0.01745329251994329576923690768489    // PI/180
#define tan60	 (sqrt(3))				// tan 60 = sqrt(3)
#define sin60    (sqrt(3)/2)			// sin 60 = sqrt(3)/2

#define A 0
#define B 1
#define C 2
#define D 3
int ans[2][2][2] = { B,A,C,D,D,C,A,B };

int calc(char *edge, int d, int l)
{
	int ix, iy, one;
	double delta, x, y;

	if      (*edge == 'D') d += 60;
	else if (*edge == 'B') d += 120;
	delta = d * PI180;			// d/180*PI

	x = BASE + l * (cos(delta) - sin(delta)/tan60);
	y = l * sin(delta)/sin60;

	ix = (int)x, iy = (int)y;
	one = ((x-ix) + (y-iy)) >= 1;
	return ans[ix&1][iy&1][one];
}

int main()
{
	int d, l, fp, fq;
	char edge[5];

	scanf("%s%d%d", edge, &d, &l);
	fp = calc(edge, d, l);
	scanf("%s%d%d", edge, &d, &l);
	fq = calc(edge, d, l);
	puts(fp == fq? "YES": "NO");
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	ans
	.data
	.align 32
	.type	ans, @object
	.size	ans, 32
ans:
	.long	1
	.long	0
	.long	2
	.long	3
	.long	3
	.long	2
	.long	0
	.long	1
	.text
	.globl	calc
	.type	calc, @function
calc:
.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	$88, %rsp
	.cfi_offset 3, -24
	movq	%rdi, -72(%rbp)
	movl	%esi, -76(%rbp)
	movl	%edx, -80(%rbp)
	movq	-72(%rbp), %rax
	movzbl	(%rax), %eax
	cmpb	$68, %al
	jne	.L2
	addl	$60, -76(%rbp)
	jmp	.L3
.L2:
	movq	-72(%rbp), %rax
	movzbl	(%rax), %eax
	cmpb	$66, %al
	jne	.L3
	addl	$120, -76(%rbp)
.L3:
	pxor	%xmm1, %xmm1
	cvtsi2sdl	-76(%rbp), %xmm1
	movsd	.LC0(%rip), %xmm0
	mulsd	%xmm1, %xmm0
	movsd	%xmm0, -40(%rbp)
	pxor	%xmm3, %xmm3
	cvtsi2sdl	-80(%rbp), %xmm3
	movsd	%xmm3, -88(%rbp)
	movq	-40(%rbp), %rax
	movq	%rax, %xmm0
	call	cos@PLT
	movq	%xmm0, %rbx
	movq	-40(%rbp), %rax
	movq	%rax, %xmm0
	call	sin@PLT
	movq	%xmm0, %rax
	movsd	.LC1(%rip), %xmm0
	movq	%rax, %xmm4
	divsd	%xmm0, %xmm4
	movapd	%xmm4, %xmm1
	movq	%rbx, %xmm0
	subsd	%xmm1, %xmm0
	movsd	-88(%rbp), %xmm1
	mulsd	%xmm0, %xmm1
	movsd	.LC2(%rip), %xmm0
	addsd	%xmm1, %xmm0
	movsd	%xmm0, -32(%rbp)
	pxor	%xmm5, %xmm5
	cvtsi2sdl	-80(%rbp), %xmm5
	movsd	%xmm5, -88(%rbp)
	movq	-40(%rbp), %rax
	movq	%rax, %xmm0
	call	sin@PLT
	mulsd	-88(%rbp), %xmm0
	movsd	.LC3(%rip), %xmm1
	divsd	%xmm1, %xmm0
	movsd	%xmm0, -24(%rbp)
	movsd	-32(%rbp), %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -52(%rbp)
	movsd	-24(%rbp), %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -48(%rbp)
	pxor	%xmm2, %xmm2
	cvtsi2sdl	-52(%rbp), %xmm2
	movsd	-32(%rbp), %xmm0
	movapd	%xmm0, %xmm1
	subsd	%xmm2, %xmm1
	pxor	%xmm2, %xmm2
	cvtsi2sdl	-48(%rbp), %xmm2
	movsd	-24(%rbp), %xmm0
	subsd	%xmm2, %xmm0
	addsd	%xmm1, %xmm0
	movsd	.LC4(%rip), %xmm1
	comisd	%xmm1, %xmm0
	setnb	%al
	movzbl	%al, %eax
	movl	%eax, -44(%rbp)
	movl	-52(%rbp), %eax
	andl	$1, %eax
	movl	%eax, %ecx
	movl	-48(%rbp), %eax
	andl	$1, %eax
	movl	%eax, %edx
	movl	-44(%rbp), %eax
	movslq	%eax, %rsi
	movslq	%ecx, %rax
	movslq	%edx, %rdx
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	ans(%rip), %rax
	movl	(%rdx,%rax), %eax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	calc, .-calc
	.section	.rodata
.LC5:
	.string	"%s%d%d"
.LC6:
	.string	"YES"
.LC7:
	.string	"NO"
	.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	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-28(%rbp), %rcx
	leaq	-32(%rbp), %rdx
	leaq	-13(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %edx
	movl	-32(%rbp), %ecx
	leaq	-13(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	calc
	movl	%eax, -24(%rbp)
	leaq	-28(%rbp), %rcx
	leaq	-32(%rbp), %rdx
	leaq	-13(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %edx
	movl	-32(%rbp), %ecx
	leaq	-13(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	calc
	movl	%eax, -20(%rbp)
	movl	-24(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jne	.L6
	leaq	.LC6(%rip), %rax
	jmp	.L7
.L6:
	leaq	.LC7(%rip), %rax
.L7:
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC0:
	.long	-1571644103
	.long	1066524486
	.align 8
.LC1:
	.long	-396866390
	.long	1073460858
	.align 8
.LC2:
	.long	0
	.long	1079574528
	.align 8
.LC3:
	.long	-396866390
	.long	1072412282
	.align 8
.LC4:
	.long	0
	.long	1072693248
	.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	ans
	.data
	.align 32
	.type	ans, @object
	.size	ans, 32
ans:
	.long	1
	.long	0
	.long	2
	.long	3
	.long	3
	.long	2
	.long	0
	.long	1
	.text
	.globl	calc
	.type	calc, @function
calc:
.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	$88, %rsp
	.cfi_offset 3, -24
	movq	%rdi, -72(%rbp)
	movl	%esi, -76(%rbp)
	movl	%edx, -80(%rbp)
	movq	-72(%rbp), %rax
	movzbl	(%rax), %eax
	cmpb	$68, %al
	jne	.L2
	addl	$60, -76(%rbp)
	jmp	.L3
.L2:
	movq	-72(%rbp), %rax
	movzbl	(%rax), %eax
	cmpb	$66, %al
	jne	.L3
	addl	$120, -76(%rbp)
.L3:
	pxor	%xmm1, %xmm1
	cvtsi2sdl	-76(%rbp), %xmm1
	movsd	.LC0(%rip), %xmm0
	mulsd	%xmm1, %xmm0
	movsd	%xmm0, -40(%rbp)
	pxor	%xmm3, %xmm3
	cvtsi2sdl	-80(%rbp), %xmm3
	movsd	%xmm3, -88(%rbp)
	movq	-40(%rbp), %rax
	movq	%rax, %xmm0
	call	cos@PLT
	movq	%xmm0, %rbx
	movq	-40(%rbp), %rax
	movq	%rax, %xmm0
	call	sin@PLT
	movq	%xmm0, %rax
	movsd	.LC1(%rip), %xmm0
	movq	%rax, %xmm4
	divsd	%xmm0, %xmm4
	movapd	%xmm4, %xmm1
	movq	%rbx, %xmm0
	subsd	%xmm1, %xmm0
	movsd	-88(%rbp), %xmm1
	mulsd	%xmm0, %xmm1
	movsd	.LC2(%rip), %xmm0
	addsd	%xmm1, %xmm0
	movsd	%xmm0, -32(%rbp)
	pxor	%xmm5, %xmm5
	cvtsi2sdl	-80(%rbp), %xmm5
	movsd	%xmm5, -88(%rbp)
	movq	-40(%rbp), %rax
	movq	%rax, %xmm0
	call	sin@PLT
	mulsd	-88(%rbp), %xmm0
	movsd	.LC3(%rip), %xmm1
	divsd	%xmm1, %xmm0
	movsd	%xmm0, -24(%rbp)
	movsd	-32(%rbp), %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -52(%rbp)
	movsd	-24(%rbp), %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -48(%rbp)
	pxor	%xmm2, %xmm2
	cvtsi2sdl	-52(%rbp), %xmm2
	movsd	-32(%rbp), %xmm0
	movapd	%xmm0, %xmm1
	subsd	%xmm2, %xmm1
	pxor	%xmm2, %xmm2
	cvtsi2sdl	-48(%rbp), %xmm2
	movsd	-24(%rbp), %xmm0
	subsd	%xmm2, %xmm0
	addsd	%xmm1, %xmm0
	movsd	.LC4(%rip), %xmm1
	comisd	%xmm1, %xmm0
	setnb	%al
	movzbl	%al, %eax
	movl	%eax, -44(%rbp)
	movl	-52(%rbp), %eax
	andl	$1, %eax
	movl	%eax, %ecx
	movl	-48(%rbp), %eax
	andl	$1, %eax
	movl	%eax, %edx
	movl	-44(%rbp), %eax
	movslq	%eax, %rsi
	movslq	%ecx, %rax
	movslq	%edx, %rdx
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	ans(%rip), %rax
	movl	(%rdx,%rax), %eax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	calc, .-calc
	.section	.rodata
.LC5:
	.string	"%s%d%d"
.LC6:
	.string	"YES"
.LC7:
	.string	"NO"
	.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	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-28(%rbp), %rcx
	leaq	-32(%rbp), %rdx
	leaq	-13(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %edx
	movl	-32(%rbp), %ecx
	leaq	-13(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	calc
	movl	%eax, -24(%rbp)
	leaq	-28(%rbp), %rcx
	leaq	-32(%rbp), %rdx
	leaq	-13(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %edx
	movl	-32(%rbp), %ecx
	leaq	-13(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	calc
	movl	%eax, -20(%rbp)
	movl	-24(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jne	.L6
	leaq	.LC6(%rip), %rax
	jmp	.L7
.L6:
	leaq	.LC7(%rip), %rax
.L7:
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC0:
	.long	-1571644103
	.long	1066524486
	.align 8
.LC1:
	.long	-396866390
	.long	1073460858
	.align 8
.LC2:
	.long	0
	.long	1079574528
	.align 8
.LC3:
	.long	-396866390
	.long	1072412282
	.align 8
.LC4:
	.long	0
	.long	1072693248
	.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:
