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 <math.h>
#define PI 3.14159265358979323846264338327950L

int main(void){
    int A,B,H,M;
    double ans;
    
    scanf("%d%d%d%d",&A,&B,&H,&M);
    
    ans = cos(2*PI*(H/12.0 + (M/(60.0*12.0)) - M/60.0));
    printf("%.20lf\n",sqrt(A*A+B*B-2*A*B*ans));
    
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d%d%d"
.LC5:
	.string	"%.20lf\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-20(%rbp), %rsi
	leaq	-24(%rbp), %rcx
	leaq	-28(%rbp), %rdx
	leaq	-32(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24(%rbp), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movsd	.LC1(%rip), %xmm2
	movapd	%xmm0, %xmm1
	divsd	%xmm2, %xmm1
	movl	-20(%rbp), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movsd	.LC2(%rip), %xmm2
	divsd	%xmm2, %xmm0
	addsd	%xmm1, %xmm0
	movl	-20(%rbp), %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	movsd	.LC3(%rip), %xmm2
	divsd	%xmm2, %xmm1
	subsd	%xmm1, %xmm0
	movsd	%xmm0, -40(%rbp)
	fldl	-40(%rbp)
	fldt	.LC4(%rip)
	fmulp	%st, %st(1)
	fstpl	-40(%rbp)
	movsd	-40(%rbp), %xmm0
	call	cos@PLT
	movq	%xmm0, %rax
	movq	%rax, -16(%rbp)
	movl	-32(%rbp), %edx
	movl	-32(%rbp), %eax
	movl	%edx, %ecx
	imull	%eax, %ecx
	movl	-28(%rbp), %edx
	movl	-28(%rbp), %eax
	imull	%edx, %eax
	addl	%ecx, %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movl	-32(%rbp), %edx
	movl	-28(%rbp), %eax
	imull	%edx, %eax
	addl	%eax, %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	mulsd	-16(%rbp), %xmm1
	subsd	%xmm1, %xmm0
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$1, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L3
	call	__stack_chk_fail@PLT
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC1:
	.long	0
	.long	1076363264
	.align 8
.LC2:
	.long	0
	.long	1082556416
	.align 8
.LC3:
	.long	0
	.long	1078853632
	.align 16
.LC4:
	.long	560513589
	.long	-921707870
	.long	16385
	.long	0
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d%d%d"
.LC6:
	.string	"%.20lf\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	subq	$56, %rsp
	.cfi_def_cfa_offset 64
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %rcx
	leaq	28(%rsp), %rdx
	leaq	24(%rsp), %rsi
	leaq	36(%rsp), %r8
	call	__isoc99_scanf@PLT
	pxor	%xmm1, %xmm1
	pxor	%xmm0, %xmm0
	cvtsi2sdl	36(%rsp), %xmm1
	fldt	.LC4(%rip)
	cvtsi2sdl	32(%rsp), %xmm0
	divsd	.LC1(%rip), %xmm0
	movapd	%xmm1, %xmm2
	divsd	.LC2(%rip), %xmm2
	addsd	%xmm2, %xmm0
	divsd	.LC3(%rip), %xmm1
	subsd	%xmm1, %xmm0
	movsd	%xmm0, 8(%rsp)
	fmull	8(%rsp)
	fstpl	8(%rsp)
	movsd	8(%rsp), %xmm0
	call	cos@PLT
	movl	24(%rsp), %eax
	movl	28(%rsp), %edx
	pxor	%xmm1, %xmm1
	movapd	%xmm0, %xmm2
	pxor	%xmm0, %xmm0
	movl	%eax, %ecx
	movl	%edx, %esi
	imull	%eax, %ecx
	imull	%edx, %eax
	imull	%edx, %esi
	addl	%eax, %eax
	cvtsi2sdl	%eax, %xmm1
	addl	%esi, %ecx
	cvtsi2sdl	%ecx, %xmm0
	mulsd	%xmm2, %xmm1
	subsd	%xmm1, %xmm0
	pxor	%xmm1, %xmm1
	ucomisd	%xmm0, %xmm1
	ja	.L7
	sqrtsd	%xmm0, %xmm0
.L4:
	leaq	.LC6(%rip), %rsi
	movl	$1, %edi
	movl	$1, %eax
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L10
	xorl	%eax, %eax
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L7:
	.cfi_restore_state
	call	sqrt@PLT
	jmp	.L4
.L10:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.long	0
	.long	1076363264
	.align 8
.LC2:
	.long	0
	.long	1082556416
	.align 8
.LC3:
	.long	0
	.long	1078853632
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC4:
	.long	560513589
	.long	-921707870
	.long	16385
	.long	0
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d%d%d"
.LC6:
	.string	"%.20lf\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	subq	$56, %rsp
	.cfi_def_cfa_offset 64
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %rcx
	leaq	28(%rsp), %rdx
	leaq	24(%rsp), %rsi
	leaq	36(%rsp), %r8
	call	__isoc99_scanf@PLT
	pxor	%xmm1, %xmm1
	pxor	%xmm0, %xmm0
	cvtsi2sdl	36(%rsp), %xmm1
	fldt	.LC4(%rip)
	cvtsi2sdl	32(%rsp), %xmm0
	divsd	.LC1(%rip), %xmm0
	movapd	%xmm1, %xmm2
	divsd	.LC2(%rip), %xmm2
	addsd	%xmm2, %xmm0
	divsd	.LC3(%rip), %xmm1
	subsd	%xmm1, %xmm0
	movsd	%xmm0, 8(%rsp)
	fmull	8(%rsp)
	fstpl	8(%rsp)
	movsd	8(%rsp), %xmm0
	call	cos@PLT
	movl	24(%rsp), %eax
	movl	28(%rsp), %edx
	pxor	%xmm1, %xmm1
	movapd	%xmm0, %xmm2
	pxor	%xmm0, %xmm0
	movl	%eax, %ecx
	movl	%edx, %esi
	imull	%eax, %ecx
	imull	%edx, %eax
	imull	%edx, %esi
	addl	%eax, %eax
	cvtsi2sdl	%eax, %xmm1
	addl	%esi, %ecx
	cvtsi2sdl	%ecx, %xmm0
	mulsd	%xmm2, %xmm1
	subsd	%xmm1, %xmm0
	pxor	%xmm1, %xmm1
	ucomisd	%xmm0, %xmm1
	ja	.L7
	sqrtsd	%xmm0, %xmm0
.L4:
	leaq	.LC6(%rip), %rsi
	movl	$1, %edi
	movl	$1, %eax
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L10
	xorl	%eax, %eax
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L7:
	.cfi_restore_state
	call	sqrt@PLT
	jmp	.L4
.L10:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.long	0
	.long	1076363264
	.align 8
.LC2:
	.long	0
	.long	1082556416
	.align 8
.LC3:
	.long	0
	.long	1078853632
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC4:
	.long	560513589
	.long	-921707870
	.long	16385
	.long	0
	.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 <math.h>
#define PI 3.14159265358979323846264338327950L

int main(void){
    int A,B,H,M;
    double ans;
    
    scanf("%d%d%d%d",&A,&B,&H,&M);
    
    ans = cos(2*PI*(H/12.0 + (M/(60.0*12.0)) - M/60.0));
    printf("%.20lf\n",sqrt(A*A+B*B-2*A*B*ans));
    
}
3 4 13 0
 3 1 10 40
 3 4 17 0
 3 1 10 59
 6 4 17 0
 3 2 10 59
 9 4 17 0
 3 2 10 89
 9 4 21 0
 3 2 1 89

2.05314157066030533727
 2.99301034645696173442
 6.76643256752230737305
 2.13078210400330192442
 9.67311838972588233787
 1.44238162407924375152
 12.62354265143028619889
 4.98351554812933006389
 9.84885780179610570428
 3.87047429526771713526

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 <math.h>
#define PI 3.14159265358979323846264338327950L

int main(void){
    int A,B,H,M;
    double ans;
    
    scanf("%d%d%d%d",&A,&B,&H,&M);
    
    ans = cos(2*PI*(H/12.0 + (M/(60.0*12.0)) - M/60.0));
    printf("%.20lf\n",sqrt(A*A+B*B-2*A*B*ans));
    
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d%d%d"
.LC5:
	.string	"%.20lf\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-20(%rbp), %rsi
	leaq	-24(%rbp), %rcx
	leaq	-28(%rbp), %rdx
	leaq	-32(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24(%rbp), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movsd	.LC1(%rip), %xmm2
	movapd	%xmm0, %xmm1
	divsd	%xmm2, %xmm1
	movl	-20(%rbp), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movsd	.LC2(%rip), %xmm2
	divsd	%xmm2, %xmm0
	addsd	%xmm1, %xmm0
	movl	-20(%rbp), %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	movsd	.LC3(%rip), %xmm2
	divsd	%xmm2, %xmm1
	subsd	%xmm1, %xmm0
	movsd	%xmm0, -40(%rbp)
	fldl	-40(%rbp)
	fldt	.LC4(%rip)
	fmulp	%st, %st(1)
	fstpl	-40(%rbp)
	movsd	-40(%rbp), %xmm0
	call	cos@PLT
	movq	%xmm0, %rax
	movq	%rax, -16(%rbp)
	movl	-32(%rbp), %edx
	movl	-32(%rbp), %eax
	movl	%edx, %ecx
	imull	%eax, %ecx
	movl	-28(%rbp), %edx
	movl	-28(%rbp), %eax
	imull	%edx, %eax
	addl	%ecx, %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movl	-32(%rbp), %edx
	movl	-28(%rbp), %eax
	imull	%edx, %eax
	addl	%eax, %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	mulsd	-16(%rbp), %xmm1
	subsd	%xmm1, %xmm0
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$1, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L3
	call	__stack_chk_fail@PLT
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC1:
	.long	0
	.long	1076363264
	.align 8
.LC2:
	.long	0
	.long	1082556416
	.align 8
.LC3:
	.long	0
	.long	1078853632
	.align 16
.LC4:
	.long	560513589
	.long	-921707870
	.long	16385
	.long	0
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d%d%d"
.LC5:
	.string	"%.20lf\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-20(%rbp), %rsi
	leaq	-24(%rbp), %rcx
	leaq	-28(%rbp), %rdx
	leaq	-32(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24(%rbp), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movsd	.LC1(%rip), %xmm2
	movapd	%xmm0, %xmm1
	divsd	%xmm2, %xmm1
	movl	-20(%rbp), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movsd	.LC2(%rip), %xmm2
	divsd	%xmm2, %xmm0
	addsd	%xmm1, %xmm0
	movl	-20(%rbp), %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	movsd	.LC3(%rip), %xmm2
	divsd	%xmm2, %xmm1
	subsd	%xmm1, %xmm0
	movsd	%xmm0, -40(%rbp)
	fldl	-40(%rbp)
	fldt	.LC4(%rip)
	fmulp	%st, %st(1)
	fstpl	-40(%rbp)
	movsd	-40(%rbp), %xmm0
	call	cos@PLT
	movq	%xmm0, %rax
	movq	%rax, -16(%rbp)
	movl	-32(%rbp), %edx
	movl	-32(%rbp), %eax
	movl	%edx, %ecx
	imull	%eax, %ecx
	movl	-28(%rbp), %edx
	movl	-28(%rbp), %eax
	imull	%edx, %eax
	addl	%ecx, %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movl	-32(%rbp), %edx
	movl	-28(%rbp), %eax
	imull	%edx, %eax
	addl	%eax, %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	mulsd	-16(%rbp), %xmm1
	subsd	%xmm1, %xmm0
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$1, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L3
	call	__stack_chk_fail@PLT
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC1:
	.long	0
	.long	1076363264
	.align 8
.LC2:
	.long	0
	.long	1082556416
	.align 8
.LC3:
	.long	0
	.long	1078853632
	.align 16
.LC4:
	.long	560513589
	.long	-921707870
	.long	16385
	.long	0
	.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:
