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

```c
/*
AizuOnline A0177
Title distance betweeen cities
*/
#include <stdio.h>
#include <float.h>
#include <math.h>
#define PI (3.141592653589793)
//Global data section
double d2r=PI/180;
double a,b,c,d;
double r=6378.1;
double x1,y11,z1,x2,y2,z2;
void ki2xyz(double ido,double keido,double *x,double *y,double *z)
{
  
  *x = r*cos(d2r*keido)*cos(d2r*ido);
  *y = r*sin(d2r*keido)*cos(d2r*ido);
  *z = r*sin(d2r*ido);
}
// invert_cos (radian)

double calc_angle(double xa,double ya,double za,double xb,double yb,double zb)
{
  double c;

  c=(xa*xb+ya*yb+za*zb);
  c/=(r*r);
  return(acos(c));
}
//
main()
{
  double ang;

  while(EOF!=scanf("%lf %lf %lf %lf",&a,&b,&c,&d) && 
	((a != -1)||(b != -1)||(c != -1)||(d != -1)))
    {
      ki2xyz(a,b,&x1,&y11,&z1);
      ki2xyz(c,d,&x2,&y2,&z2);
      ang=calc_angle(x1,y11,z1,x2,y2,z2);
      printf("%.0lf\n",ang*r);
    }
return(0);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	d2r
	.data
	.align 8
	.type	d2r, @object
	.size	d2r, 8
d2r:
	.long	-1571644103
	.long	1066524486
	.globl	a
	.bss
	.align 8
	.type	a, @object
	.size	a, 8
a:
	.zero	8
	.globl	b
	.align 8
	.type	b, @object
	.size	b, 8
b:
	.zero	8
	.globl	c
	.align 8
	.type	c, @object
	.size	c, 8
c:
	.zero	8
	.globl	d
	.align 8
	.type	d, @object
	.size	d, 8
d:
	.zero	8
	.globl	r
	.data
	.align 8
	.type	r, @object
	.size	r, 8
r:
	.long	-1717986918
	.long	1085860377
	.globl	x1
	.bss
	.align 8
	.type	x1, @object
	.size	x1, 8
x1:
	.zero	8
	.globl	y11
	.align 8
	.type	y11, @object
	.size	y11, 8
y11:
	.zero	8
	.globl	z1
	.align 8
	.type	z1, @object
	.size	z1, 8
z1:
	.zero	8
	.globl	x2
	.align 8
	.type	x2, @object
	.size	x2, 8
x2:
	.zero	8
	.globl	y2
	.align 8
	.type	y2, @object
	.size	y2, 8
y2:
	.zero	8
	.globl	z2
	.align 8
	.type	z2, @object
	.size	z2, 8
z2:
	.zero	8
	.text
	.globl	ki2xyz
	.type	ki2xyz, @function
ki2xyz:
.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
	movsd	%xmm0, -8(%rbp)
	movsd	%xmm1, -16(%rbp)
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	%rdx, -40(%rbp)
	movsd	d2r(%rip), %xmm0
	mulsd	-16(%rbp), %xmm0
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	call	cos@PLT
	movsd	r(%rip), %xmm1
	mulsd	%xmm1, %xmm0
	movsd	%xmm0, -48(%rbp)
	movsd	d2r(%rip), %xmm0
	movapd	%xmm0, %xmm3
	mulsd	-8(%rbp), %xmm3
	movq	%xmm3, %rax
	movq	%rax, %xmm0
	call	cos@PLT
	mulsd	-48(%rbp), %xmm0
	movq	-24(%rbp), %rax
	movsd	%xmm0, (%rax)
	movsd	d2r(%rip), %xmm0
	mulsd	-16(%rbp), %xmm0
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	call	sin@PLT
	movsd	r(%rip), %xmm1
	mulsd	%xmm1, %xmm0
	movsd	%xmm0, -48(%rbp)
	movsd	d2r(%rip), %xmm0
	movapd	%xmm0, %xmm5
	mulsd	-8(%rbp), %xmm5
	movq	%xmm5, %rax
	movq	%rax, %xmm0
	call	cos@PLT
	mulsd	-48(%rbp), %xmm0
	movq	-32(%rbp), %rax
	movsd	%xmm0, (%rax)
	movsd	d2r(%rip), %xmm0
	mulsd	-8(%rbp), %xmm0
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	call	sin@PLT
	movsd	r(%rip), %xmm1
	mulsd	%xmm1, %xmm0
	movq	-40(%rbp), %rax
	movsd	%xmm0, (%rax)
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	ki2xyz, .-ki2xyz
	.globl	calc_angle
	.type	calc_angle, @function
calc_angle:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movsd	%xmm0, -24(%rbp)
	movsd	%xmm1, -32(%rbp)
	movsd	%xmm2, -40(%rbp)
	movsd	%xmm3, -48(%rbp)
	movsd	%xmm4, -56(%rbp)
	movsd	%xmm5, -64(%rbp)
	movsd	-24(%rbp), %xmm0
	movapd	%xmm0, %xmm1
	mulsd	-48(%rbp), %xmm1
	movsd	-32(%rbp), %xmm0
	mulsd	-56(%rbp), %xmm0
	addsd	%xmm0, %xmm1
	movsd	-40(%rbp), %xmm0
	mulsd	-64(%rbp), %xmm0
	addsd	%xmm1, %xmm0
	movsd	%xmm0, -8(%rbp)
	movsd	r(%rip), %xmm1
	movsd	r(%rip), %xmm0
	mulsd	%xmm0, %xmm1
	movsd	-8(%rbp), %xmm0
	divsd	%xmm1, %xmm0
	movsd	%xmm0, -8(%rbp)
	movq	-8(%rbp), %rax
	movq	%rax, %xmm0
	call	acos@PLT
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	calc_angle, .-calc_angle
	.section	.rodata
.LC0:
	.string	"%.0lf\n"
.LC1:
	.string	"%lf %lf %lf %lf"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	jmp	.L5
.L7:
	movsd	b(%rip), %xmm0
	movq	a(%rip), %rax
	leaq	z1(%rip), %rdx
	leaq	y11(%rip), %rcx
	movq	%rcx, %rsi
	leaq	x1(%rip), %rcx
	movq	%rcx, %rdi
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	ki2xyz
	movsd	d(%rip), %xmm0
	movq	c(%rip), %rax
	leaq	z2(%rip), %rdx
	leaq	y2(%rip), %rcx
	movq	%rcx, %rsi
	leaq	x2(%rip), %rcx
	movq	%rcx, %rdi
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	ki2xyz
	movsd	z2(%rip), %xmm4
	movsd	y2(%rip), %xmm3
	movsd	x2(%rip), %xmm2
	movsd	z1(%rip), %xmm1
	movsd	y11(%rip), %xmm0
	movq	x1(%rip), %rax
	movapd	%xmm4, %xmm5
	movapd	%xmm3, %xmm4
	movapd	%xmm2, %xmm3
	movapd	%xmm1, %xmm2
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	calc_angle
	movq	%xmm0, %rax
	movq	%rax, -8(%rbp)
	movsd	r(%rip), %xmm0
	mulsd	-8(%rbp), %xmm0
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$1, %eax
	call	printf@PLT
.L5:
	leaq	d(%rip), %r8
	leaq	c(%rip), %rax
	movq	%rax, %rcx
	leaq	b(%rip), %rax
	movq	%rax, %rdx
	leaq	a(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L6
	movsd	a(%rip), %xmm0
	movsd	.LC2(%rip), %xmm1
	ucomisd	%xmm1, %xmm0
	jp	.L7
	movsd	.LC2(%rip), %xmm1
	ucomisd	%xmm1, %xmm0
	jne	.L7
	movsd	b(%rip), %xmm0
	movsd	.LC2(%rip), %xmm1
	ucomisd	%xmm1, %xmm0
	jp	.L7
	movsd	.LC2(%rip), %xmm1
	ucomisd	%xmm1, %xmm0
	jne	.L7
	movsd	c(%rip), %xmm0
	movsd	.LC2(%rip), %xmm1
	ucomisd	%xmm1, %xmm0
	jp	.L7
	movsd	.LC2(%rip), %xmm1
	ucomisd	%xmm1, %xmm0
	jne	.L7
	movsd	d(%rip), %xmm0
	movsd	.LC2(%rip), %xmm1
	ucomisd	%xmm1, %xmm0
	jp	.L7
	movsd	.LC2(%rip), %xmm1
	ucomisd	%xmm1, %xmm0
	jne	.L7
.L6:
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC2:
	.long	0
	.long	-1074790400
	.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	ki2xyz
	.type	ki2xyz, @function
ki2xyz:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movq	%rdi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	%rsi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	%rdx, %rbx
	subq	$32, %rsp
	.cfi_def_cfa_offset 64
	movsd	d2r(%rip), %xmm3
	movsd	%xmm0, (%rsp)
	movapd	%xmm3, %xmm5
	movsd	%xmm1, 16(%rsp)
	mulsd	%xmm1, %xmm5
	movsd	%xmm3, 24(%rsp)
	movapd	%xmm5, %xmm0
	call	cos@PLT
	movsd	24(%rsp), %xmm3
	mulsd	(%rsp), %xmm3
	movsd	%xmm0, 8(%rsp)
	movapd	%xmm3, %xmm0
	call	cos@PLT
	movsd	8(%rsp), %xmm2
	mulsd	r(%rip), %xmm2
	movapd	%xmm0, %xmm3
	movsd	16(%rsp), %xmm1
	movapd	%xmm2, %xmm0
	mulsd	%xmm3, %xmm0
	movsd	%xmm0, (%r12)
	movsd	d2r(%rip), %xmm2
	mulsd	%xmm2, %xmm1
	movsd	%xmm2, 16(%rsp)
	movapd	%xmm1, %xmm0
	call	sin@PLT
	movsd	16(%rsp), %xmm2
	mulsd	(%rsp), %xmm2
	movsd	%xmm0, 8(%rsp)
	movapd	%xmm2, %xmm0
	call	cos@PLT
	movsd	8(%rsp), %xmm1
	mulsd	r(%rip), %xmm1
	movapd	%xmm0, %xmm2
	movapd	%xmm1, %xmm0
	mulsd	%xmm2, %xmm0
	movsd	%xmm0, 0(%rbp)
	movsd	(%rsp), %xmm0
	mulsd	d2r(%rip), %xmm0
	call	sin@PLT
	mulsd	r(%rip), %xmm0
	movsd	%xmm0, (%rbx)
	addq	$32, %rsp
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE23:
	.size	ki2xyz, .-ki2xyz
	.p2align 4
	.globl	calc_angle
	.type	calc_angle, @function
calc_angle:
.LFB24:
	.cfi_startproc
	endbr64
	mulsd	%xmm4, %xmm1
	mulsd	%xmm3, %xmm0
	mulsd	%xmm5, %xmm2
	addsd	%xmm1, %xmm0
	movsd	r(%rip), %xmm1
	mulsd	%xmm1, %xmm1
	addsd	%xmm2, %xmm0
	divsd	%xmm1, %xmm0
	jmp	acos@PLT
	.cfi_endproc
.LFE24:
	.size	calc_angle, .-calc_angle
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%.0lf\n"
.LC1:
	.string	"%lf %lf %lf %lf"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	c(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	b(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	a(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	.LC1(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$104, %rsp
	.cfi_def_cfa_offset 160
	leaq	88(%rsp), %rbp
	leaq	80(%rsp), %rbx
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L20:
	movsd	a(%rip), %xmm1
	ucomisd	.LC2(%rip), %xmm1
	movsd	b(%rip), %xmm0
	movsd	c(%rip), %xmm7
	movsd	d(%rip), %xmm3
	jp	.L8
	jne	.L8
	ucomisd	.LC2(%rip), %xmm0
	jp	.L8
	jne	.L8
	ucomisd	.LC2(%rip), %xmm7
	jp	.L8
	jne	.L8
	ucomisd	.LC2(%rip), %xmm3
	jp	.L8
	je	.L7
	.p2align 4,,10
	.p2align 3
.L8:
	movsd	d2r(%rip), %xmm5
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	movsd	%xmm7, 72(%rsp)
	movsd	%xmm3, 64(%rsp)
	mulsd	%xmm5, %xmm0
	movsd	%xmm5, 8(%rsp)
	movsd	%xmm1, 40(%rsp)
	call	sincos@PLT
	movsd	40(%rsp), %xmm1
	movq	%rbx, %rsi
	movsd	80(%rsp), %xmm6
	mulsd	8(%rsp), %xmm1
	movsd	88(%rsp), %xmm4
	movq	%rbp, %rdi
	movsd	r(%rip), %xmm2
	movsd	%xmm6, 32(%rsp)
	movsd	%xmm4, 24(%rsp)
	movsd	%xmm2, 16(%rsp)
	movapd	%xmm1, %xmm0
	call	sincos@PLT
	movsd	16(%rsp), %xmm2
	movq	%rbx, %rsi
	movsd	32(%rsp), %xmm6
	movsd	24(%rsp), %xmm4
	movsd	80(%rsp), %xmm0
	movq	%rbp, %rdi
	mulsd	%xmm2, %xmm6
	movsd	64(%rsp), %xmm3
	movapd	%xmm2, %xmm7
	movsd	%xmm2, 40(%rsp)
	mulsd	%xmm2, %xmm4
	mulsd	8(%rsp), %xmm3
	mulsd	88(%rsp), %xmm7
	mulsd	%xmm0, %xmm6
	mulsd	%xmm0, %xmm4
	movapd	%xmm3, %xmm0
	movsd	%xmm7, z1(%rip)
	movsd	%xmm7, 32(%rsp)
	movsd	%xmm6, x1(%rip)
	movsd	%xmm6, 56(%rsp)
	movsd	%xmm4, y11(%rip)
	movsd	%xmm4, 48(%rsp)
	call	sincos@PLT
	movsd	72(%rsp), %xmm7
	movq	%rbx, %rsi
	movsd	8(%rsp), %xmm0
	movsd	80(%rsp), %xmm1
	movsd	88(%rsp), %xmm3
	movq	%rbp, %rdi
	mulsd	%xmm7, %xmm0
	movsd	%xmm1, 24(%rsp)
	movsd	%xmm3, 16(%rsp)
	call	sincos@PLT
	movsd	40(%rsp), %xmm2
	movsd	16(%rsp), %xmm3
	movsd	24(%rsp), %xmm1
	movsd	80(%rsp), %xmm7
	mulsd	%xmm2, %xmm3
	movsd	56(%rsp), %xmm6
	movsd	48(%rsp), %xmm4
	movsd	%xmm2, 8(%rsp)
	mulsd	%xmm2, %xmm1
	movsd	32(%rsp), %xmm5
	movapd	%xmm3, %xmm0
	movsd	88(%rsp), %xmm3
	mulsd	%xmm7, %xmm1
	mulsd	%xmm7, %xmm0
	mulsd	%xmm2, %xmm3
	movsd	%xmm1, x2(%rip)
	mulsd	%xmm6, %xmm1
	movsd	%xmm0, y2(%rip)
	mulsd	%xmm4, %xmm0
	movsd	%xmm3, z2(%rip)
	mulsd	%xmm5, %xmm3
	addsd	%xmm0, %xmm1
	movapd	%xmm2, %xmm0
	mulsd	%xmm2, %xmm0
	addsd	%xmm3, %xmm1
	divsd	%xmm0, %xmm1
	movapd	%xmm1, %xmm0
	call	acos@PLT
	movsd	8(%rsp), %xmm2
	movl	$1, %edi
	leaq	.LC0(%rip), %rsi
	movl	$1, %eax
	mulsd	%xmm2, %xmm0
	call	__printf_chk@PLT
.L6:
	xorl	%eax, %eax
	leaq	d(%rip), %r8
	movq	%r15, %rcx
	movq	%r14, %rdx
	movq	%r13, %rsi
	movq	%r12, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	jne	.L20
.L7:
	addq	$104, %rsp
	.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
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.globl	z2
	.bss
	.align 8
	.type	z2, @object
	.size	z2, 8
z2:
	.zero	8
	.globl	y2
	.align 8
	.type	y2, @object
	.size	y2, 8
y2:
	.zero	8
	.globl	x2
	.align 8
	.type	x2, @object
	.size	x2, 8
x2:
	.zero	8
	.globl	z1
	.align 8
	.type	z1, @object
	.size	z1, 8
z1:
	.zero	8
	.globl	y11
	.align 8
	.type	y11, @object
	.size	y11, 8
y11:
	.zero	8
	.globl	x1
	.align 8
	.type	x1, @object
	.size	x1, 8
x1:
	.zero	8
	.globl	r
	.data
	.align 8
	.type	r, @object
	.size	r, 8
r:
	.long	-1717986918
	.long	1085860377
	.globl	d
	.bss
	.align 8
	.type	d, @object
	.size	d, 8
d:
	.zero	8
	.globl	c
	.align 8
	.type	c, @object
	.size	c, 8
c:
	.zero	8
	.globl	b
	.align 8
	.type	b, @object
	.size	b, 8
b:
	.zero	8
	.globl	a
	.align 8
	.type	a, @object
	.size	a, 8
a:
	.zero	8
	.globl	d2r
	.data
	.align 8
	.type	d2r, @object
	.size	d2r, 8
d2r:
	.long	-1571644103
	.long	1066524486
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC2:
	.long	0
	.long	-1074790400
	.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	ki2xyz
	.type	ki2xyz, @function
ki2xyz:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movq	%rdi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	%rsi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	%rdx, %rbx
	subq	$32, %rsp
	.cfi_def_cfa_offset 64
	movsd	d2r(%rip), %xmm3
	movsd	%xmm0, (%rsp)
	movapd	%xmm3, %xmm5
	movsd	%xmm1, 16(%rsp)
	mulsd	%xmm1, %xmm5
	movsd	%xmm3, 24(%rsp)
	movapd	%xmm5, %xmm0
	call	cos@PLT
	movsd	24(%rsp), %xmm3
	mulsd	(%rsp), %xmm3
	movsd	%xmm0, 8(%rsp)
	movapd	%xmm3, %xmm0
	call	cos@PLT
	movsd	8(%rsp), %xmm2
	mulsd	r(%rip), %xmm2
	movapd	%xmm0, %xmm3
	movsd	16(%rsp), %xmm1
	movapd	%xmm2, %xmm0
	mulsd	%xmm3, %xmm0
	movsd	%xmm0, (%r12)
	movsd	d2r(%rip), %xmm2
	mulsd	%xmm2, %xmm1
	movsd	%xmm2, 16(%rsp)
	movapd	%xmm1, %xmm0
	call	sin@PLT
	movsd	16(%rsp), %xmm2
	mulsd	(%rsp), %xmm2
	movsd	%xmm0, 8(%rsp)
	movapd	%xmm2, %xmm0
	call	cos@PLT
	movsd	8(%rsp), %xmm1
	mulsd	r(%rip), %xmm1
	movapd	%xmm0, %xmm2
	movapd	%xmm1, %xmm0
	mulsd	%xmm2, %xmm0
	movsd	%xmm0, 0(%rbp)
	movsd	(%rsp), %xmm0
	mulsd	d2r(%rip), %xmm0
	call	sin@PLT
	mulsd	r(%rip), %xmm0
	movsd	%xmm0, (%rbx)
	addq	$32, %rsp
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE23:
	.size	ki2xyz, .-ki2xyz
	.p2align 4
	.globl	calc_angle
	.type	calc_angle, @function
calc_angle:
.LFB24:
	.cfi_startproc
	endbr64
	mulsd	%xmm4, %xmm1
	mulsd	%xmm3, %xmm0
	mulsd	%xmm5, %xmm2
	addsd	%xmm1, %xmm0
	movsd	r(%rip), %xmm1
	mulsd	%xmm1, %xmm1
	addsd	%xmm2, %xmm0
	divsd	%xmm1, %xmm0
	jmp	acos@PLT
	.cfi_endproc
.LFE24:
	.size	calc_angle, .-calc_angle
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%.0lf\n"
.LC1:
	.string	"%lf %lf %lf %lf"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	c(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	b(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	a(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	.LC1(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$104, %rsp
	.cfi_def_cfa_offset 160
	leaq	88(%rsp), %rbp
	leaq	80(%rsp), %rbx
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L20:
	movsd	a(%rip), %xmm1
	ucomisd	.LC2(%rip), %xmm1
	movsd	b(%rip), %xmm0
	movsd	c(%rip), %xmm7
	movsd	d(%rip), %xmm3
	jp	.L8
	jne	.L8
	ucomisd	.LC2(%rip), %xmm0
	jp	.L8
	jne	.L8
	ucomisd	.LC2(%rip), %xmm7
	jp	.L8
	jne	.L8
	ucomisd	.LC2(%rip), %xmm3
	jp	.L8
	je	.L7
	.p2align 4,,10
	.p2align 3
.L8:
	movsd	d2r(%rip), %xmm5
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	movsd	%xmm7, 72(%rsp)
	movsd	%xmm3, 64(%rsp)
	mulsd	%xmm5, %xmm0
	movsd	%xmm5, 8(%rsp)
	movsd	%xmm1, 40(%rsp)
	call	sincos@PLT
	movsd	40(%rsp), %xmm1
	movq	%rbx, %rsi
	movsd	80(%rsp), %xmm6
	mulsd	8(%rsp), %xmm1
	movsd	88(%rsp), %xmm4
	movq	%rbp, %rdi
	movsd	r(%rip), %xmm2
	movsd	%xmm6, 32(%rsp)
	movsd	%xmm4, 24(%rsp)
	movsd	%xmm2, 16(%rsp)
	movapd	%xmm1, %xmm0
	call	sincos@PLT
	movsd	16(%rsp), %xmm2
	movq	%rbx, %rsi
	movsd	32(%rsp), %xmm6
	movsd	24(%rsp), %xmm4
	movsd	80(%rsp), %xmm0
	movq	%rbp, %rdi
	mulsd	%xmm2, %xmm6
	movsd	64(%rsp), %xmm3
	movapd	%xmm2, %xmm7
	movsd	%xmm2, 40(%rsp)
	mulsd	%xmm2, %xmm4
	mulsd	8(%rsp), %xmm3
	mulsd	88(%rsp), %xmm7
	mulsd	%xmm0, %xmm6
	mulsd	%xmm0, %xmm4
	movapd	%xmm3, %xmm0
	movsd	%xmm7, z1(%rip)
	movsd	%xmm7, 32(%rsp)
	movsd	%xmm6, x1(%rip)
	movsd	%xmm6, 56(%rsp)
	movsd	%xmm4, y11(%rip)
	movsd	%xmm4, 48(%rsp)
	call	sincos@PLT
	movsd	72(%rsp), %xmm7
	movq	%rbx, %rsi
	movsd	8(%rsp), %xmm0
	movsd	80(%rsp), %xmm1
	movsd	88(%rsp), %xmm3
	movq	%rbp, %rdi
	mulsd	%xmm7, %xmm0
	movsd	%xmm1, 24(%rsp)
	movsd	%xmm3, 16(%rsp)
	call	sincos@PLT
	movsd	40(%rsp), %xmm2
	movsd	16(%rsp), %xmm3
	movsd	24(%rsp), %xmm1
	movsd	80(%rsp), %xmm7
	mulsd	%xmm2, %xmm3
	movsd	56(%rsp), %xmm6
	movsd	48(%rsp), %xmm4
	movsd	%xmm2, 8(%rsp)
	mulsd	%xmm2, %xmm1
	movsd	32(%rsp), %xmm5
	movapd	%xmm3, %xmm0
	movsd	88(%rsp), %xmm3
	mulsd	%xmm7, %xmm1
	mulsd	%xmm7, %xmm0
	mulsd	%xmm2, %xmm3
	movsd	%xmm1, x2(%rip)
	mulsd	%xmm6, %xmm1
	movsd	%xmm0, y2(%rip)
	mulsd	%xmm4, %xmm0
	movsd	%xmm3, z2(%rip)
	mulsd	%xmm5, %xmm3
	addsd	%xmm0, %xmm1
	movapd	%xmm2, %xmm0
	mulsd	%xmm2, %xmm0
	addsd	%xmm3, %xmm1
	divsd	%xmm0, %xmm1
	movapd	%xmm1, %xmm0
	call	acos@PLT
	movsd	8(%rsp), %xmm2
	movl	$1, %edi
	leaq	.LC0(%rip), %rsi
	movl	$1, %eax
	mulsd	%xmm2, %xmm0
	call	__printf_chk@PLT
.L6:
	xorl	%eax, %eax
	leaq	d(%rip), %r8
	movq	%r15, %rcx
	movq	%r14, %rdx
	movq	%r13, %rsi
	movq	%r12, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	jne	.L20
.L7:
	addq	$104, %rsp
	.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
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.globl	z2
	.bss
	.align 8
	.type	z2, @object
	.size	z2, 8
z2:
	.zero	8
	.globl	y2
	.align 8
	.type	y2, @object
	.size	y2, 8
y2:
	.zero	8
	.globl	x2
	.align 8
	.type	x2, @object
	.size	x2, 8
x2:
	.zero	8
	.globl	z1
	.align 8
	.type	z1, @object
	.size	z1, 8
z1:
	.zero	8
	.globl	y11
	.align 8
	.type	y11, @object
	.size	y11, 8
y11:
	.zero	8
	.globl	x1
	.align 8
	.type	x1, @object
	.size	x1, 8
x1:
	.zero	8
	.globl	r
	.data
	.align 8
	.type	r, @object
	.size	r, 8
r:
	.long	-1717986918
	.long	1085860377
	.globl	d
	.bss
	.align 8
	.type	d, @object
	.size	d, 8
d:
	.zero	8
	.globl	c
	.align 8
	.type	c, @object
	.size	c, 8
c:
	.zero	8
	.globl	b
	.align 8
	.type	b, @object
	.size	b, 8
b:
	.zero	8
	.globl	a
	.align 8
	.type	a, @object
	.size	a, 8
a:
	.zero	8
	.globl	d2r
	.data
	.align 8
	.type	d2r, @object
	.size	d2r, 8
d2r:
	.long	-1571644103
	.long	1066524486
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC2:
	.long	0
	.long	-1074790400
	.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:

/*
AizuOnline A0177
Title distance betweeen cities
*/
#include <stdio.h>
#include <float.h>
#include <math.h>
#define PI (3.141592653589793)
//Global data section
double d2r=PI/180;
double a,b,c,d;
double r=6378.1;
double x1,y11,z1,x2,y2,z2;
void ki2xyz(double ido,double keido,double *x,double *y,double *z)
{
  
  *x = r*cos(d2r*keido)*cos(d2r*ido);
  *y = r*sin(d2r*keido)*cos(d2r*ido);
  *z = r*sin(d2r*ido);
}
// invert_cos (radian)

double calc_angle(double xa,double ya,double za,double xb,double yb,double zb)
{
  double c;

  c=(xa*xb+ya*yb+za*zb);
  c/=(r*r);
  return(acos(c));
}
//
main()
{
  double ang;

  while(EOF!=scanf("%lf %lf %lf %lf",&a,&b,&c,&d) && 
	((a != -1)||(b != -1)||(c != -1)||(d != -1)))
    {
      ki2xyz(a,b,&x1,&y11,&z1);
      ki2xyz(c,d,&x2,&y2,&z2);
      ang=calc_angle(x1,y11,z1,x2,y2,z2);
      printf("%.0lf\n",ang*r);
    }
return(0);
}
35.997652258458864 139.77 51.15 359.82
1.37 103.92 41.78 272.25
51.15 359.82 -34.58 301.52
-1 -1 -1 -1
 35.68 139.77 51.15 359.82
1.37 103.92 41.78 272.25
51.15 359.82 -34.03920544232073 301.52
-1 -1 -1 -1
 35.997652258458864 139.77 51.15 359.82
1.37 103.92 41.78 272.25
51.15 359.82 -34.58 302.04903635880555
-1 -1 -1 -1
 35.68 139.77 51.15 359.82
1.37 103.92 42.40751195136165 272.25
51.15 359.82 -34.03920544232073 301.52
-1 -1 -1 -1
 35.68 139.77 51.15 360.2993625222263
1.37 103.92 42.40751195136165 272.25
51.15 359.82 -34.03920544232073 301.52
-1 -1 -1 -1
 35.68 139.77 51.15 359.82
1.37 103.92 41.78 272.25
51.99657446150969 359.82 -34.58 301.52
-1 -1 -1 -1
 35.997652258458864 139.77 51.15 359.82
1.37 103.92 41.78 272.25
51.15 359.82 -34.03891385785915 301.52
-1 -1 -1 -1
 35.68 139.77 51.15 359.82
1.5789515272885046 103.92 41.78 272.25
51.15 359.82 -34.03920544232073 301.52
-1 -1 -1 -1
 35.997652258458864 140.28396755648947 51.15 359.82
1.37 103.92 41.78 272.25
51.15 359.82 -34.58 302.04903635880555
-1 -1 -1 -1
 35.68 139.77 51.15 359.82
1.37 103.92 42.40751195136165 272.25
51.15 359.82 -34.03920544232073 302.3019500184568
-1 -1 -1 -1

9577
15092
11112
 9609
15092
11062
 9577
15092
11086
 9609
15025
11062
 9591
15025
11062
 9609
15092
11178
 9577
15092
11062
 9609
15069
11062
 9595
15092
11086
 9609
15025
11023

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

```c
/*
AizuOnline A0177
Title distance betweeen cities
*/
#include <stdio.h>
#include <float.h>
#include <math.h>
#define PI (3.141592653589793)
//Global data section
double d2r=PI/180;
double a,b,c,d;
double r=6378.1;
double x1,y11,z1,x2,y2,z2;
void ki2xyz(double ido,double keido,double *x,double *y,double *z)
{
  
  *x = r*cos(d2r*keido)*cos(d2r*ido);
  *y = r*sin(d2r*keido)*cos(d2r*ido);
  *z = r*sin(d2r*ido);
}
// invert_cos (radian)

double calc_angle(double xa,double ya,double za,double xb,double yb,double zb)
{
  double c;

  c=(xa*xb+ya*yb+za*zb);
  c/=(r*r);
  return(acos(c));
}
//
main()
{
  double ang;

  while(EOF!=scanf("%lf %lf %lf %lf",&a,&b,&c,&d) && 
	((a != -1)||(b != -1)||(c != -1)||(d != -1)))
    {
      ki2xyz(a,b,&x1,&y11,&z1);
      ki2xyz(c,d,&x2,&y2,&z2);
      ang=calc_angle(x1,y11,z1,x2,y2,z2);
      printf("%.0lf\n",ang*r);
    }
return(0);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	d2r
	.data
	.align 8
	.type	d2r, @object
	.size	d2r, 8
d2r:
	.long	-1571644103
	.long	1066524486
	.globl	a
	.bss
	.align 8
	.type	a, @object
	.size	a, 8
a:
	.zero	8
	.globl	b
	.align 8
	.type	b, @object
	.size	b, 8
b:
	.zero	8
	.globl	c
	.align 8
	.type	c, @object
	.size	c, 8
c:
	.zero	8
	.globl	d
	.align 8
	.type	d, @object
	.size	d, 8
d:
	.zero	8
	.globl	r
	.data
	.align 8
	.type	r, @object
	.size	r, 8
r:
	.long	-1717986918
	.long	1085860377
	.globl	x1
	.bss
	.align 8
	.type	x1, @object
	.size	x1, 8
x1:
	.zero	8
	.globl	y11
	.align 8
	.type	y11, @object
	.size	y11, 8
y11:
	.zero	8
	.globl	z1
	.align 8
	.type	z1, @object
	.size	z1, 8
z1:
	.zero	8
	.globl	x2
	.align 8
	.type	x2, @object
	.size	x2, 8
x2:
	.zero	8
	.globl	y2
	.align 8
	.type	y2, @object
	.size	y2, 8
y2:
	.zero	8
	.globl	z2
	.align 8
	.type	z2, @object
	.size	z2, 8
z2:
	.zero	8
	.text
	.globl	ki2xyz
	.type	ki2xyz, @function
ki2xyz:
.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
	movsd	%xmm0, -8(%rbp)
	movsd	%xmm1, -16(%rbp)
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	%rdx, -40(%rbp)
	movsd	d2r(%rip), %xmm0
	mulsd	-16(%rbp), %xmm0
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	call	cos@PLT
	movsd	r(%rip), %xmm1
	mulsd	%xmm1, %xmm0
	movsd	%xmm0, -48(%rbp)
	movsd	d2r(%rip), %xmm0
	movapd	%xmm0, %xmm3
	mulsd	-8(%rbp), %xmm3
	movq	%xmm3, %rax
	movq	%rax, %xmm0
	call	cos@PLT
	mulsd	-48(%rbp), %xmm0
	movq	-24(%rbp), %rax
	movsd	%xmm0, (%rax)
	movsd	d2r(%rip), %xmm0
	mulsd	-16(%rbp), %xmm0
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	call	sin@PLT
	movsd	r(%rip), %xmm1
	mulsd	%xmm1, %xmm0
	movsd	%xmm0, -48(%rbp)
	movsd	d2r(%rip), %xmm0
	movapd	%xmm0, %xmm5
	mulsd	-8(%rbp), %xmm5
	movq	%xmm5, %rax
	movq	%rax, %xmm0
	call	cos@PLT
	mulsd	-48(%rbp), %xmm0
	movq	-32(%rbp), %rax
	movsd	%xmm0, (%rax)
	movsd	d2r(%rip), %xmm0
	mulsd	-8(%rbp), %xmm0
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	call	sin@PLT
	movsd	r(%rip), %xmm1
	mulsd	%xmm1, %xmm0
	movq	-40(%rbp), %rax
	movsd	%xmm0, (%rax)
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	ki2xyz, .-ki2xyz
	.globl	calc_angle
	.type	calc_angle, @function
calc_angle:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movsd	%xmm0, -24(%rbp)
	movsd	%xmm1, -32(%rbp)
	movsd	%xmm2, -40(%rbp)
	movsd	%xmm3, -48(%rbp)
	movsd	%xmm4, -56(%rbp)
	movsd	%xmm5, -64(%rbp)
	movsd	-24(%rbp), %xmm0
	movapd	%xmm0, %xmm1
	mulsd	-48(%rbp), %xmm1
	movsd	-32(%rbp), %xmm0
	mulsd	-56(%rbp), %xmm0
	addsd	%xmm0, %xmm1
	movsd	-40(%rbp), %xmm0
	mulsd	-64(%rbp), %xmm0
	addsd	%xmm1, %xmm0
	movsd	%xmm0, -8(%rbp)
	movsd	r(%rip), %xmm1
	movsd	r(%rip), %xmm0
	mulsd	%xmm0, %xmm1
	movsd	-8(%rbp), %xmm0
	divsd	%xmm1, %xmm0
	movsd	%xmm0, -8(%rbp)
	movq	-8(%rbp), %rax
	movq	%rax, %xmm0
	call	acos@PLT
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	calc_angle, .-calc_angle
	.section	.rodata
.LC0:
	.string	"%.0lf\n"
.LC1:
	.string	"%lf %lf %lf %lf"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	jmp	.L5
.L7:
	movsd	b(%rip), %xmm0
	movq	a(%rip), %rax
	leaq	z1(%rip), %rdx
	leaq	y11(%rip), %rcx
	movq	%rcx, %rsi
	leaq	x1(%rip), %rcx
	movq	%rcx, %rdi
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	ki2xyz
	movsd	d(%rip), %xmm0
	movq	c(%rip), %rax
	leaq	z2(%rip), %rdx
	leaq	y2(%rip), %rcx
	movq	%rcx, %rsi
	leaq	x2(%rip), %rcx
	movq	%rcx, %rdi
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	ki2xyz
	movsd	z2(%rip), %xmm4
	movsd	y2(%rip), %xmm3
	movsd	x2(%rip), %xmm2
	movsd	z1(%rip), %xmm1
	movsd	y11(%rip), %xmm0
	movq	x1(%rip), %rax
	movapd	%xmm4, %xmm5
	movapd	%xmm3, %xmm4
	movapd	%xmm2, %xmm3
	movapd	%xmm1, %xmm2
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	calc_angle
	movq	%xmm0, %rax
	movq	%rax, -8(%rbp)
	movsd	r(%rip), %xmm0
	mulsd	-8(%rbp), %xmm0
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$1, %eax
	call	printf@PLT
.L5:
	leaq	d(%rip), %r8
	leaq	c(%rip), %rax
	movq	%rax, %rcx
	leaq	b(%rip), %rax
	movq	%rax, %rdx
	leaq	a(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L6
	movsd	a(%rip), %xmm0
	movsd	.LC2(%rip), %xmm1
	ucomisd	%xmm1, %xmm0
	jp	.L7
	movsd	.LC2(%rip), %xmm1
	ucomisd	%xmm1, %xmm0
	jne	.L7
	movsd	b(%rip), %xmm0
	movsd	.LC2(%rip), %xmm1
	ucomisd	%xmm1, %xmm0
	jp	.L7
	movsd	.LC2(%rip), %xmm1
	ucomisd	%xmm1, %xmm0
	jne	.L7
	movsd	c(%rip), %xmm0
	movsd	.LC2(%rip), %xmm1
	ucomisd	%xmm1, %xmm0
	jp	.L7
	movsd	.LC2(%rip), %xmm1
	ucomisd	%xmm1, %xmm0
	jne	.L7
	movsd	d(%rip), %xmm0
	movsd	.LC2(%rip), %xmm1
	ucomisd	%xmm1, %xmm0
	jp	.L7
	movsd	.LC2(%rip), %xmm1
	ucomisd	%xmm1, %xmm0
	jne	.L7
.L6:
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC2:
	.long	0
	.long	-1074790400
	.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	d2r
	.data
	.align 8
	.type	d2r, @object
	.size	d2r, 8
d2r:
	.long	-1571644103
	.long	1066524486
	.globl	a
	.bss
	.align 8
	.type	a, @object
	.size	a, 8
a:
	.zero	8
	.globl	b
	.align 8
	.type	b, @object
	.size	b, 8
b:
	.zero	8
	.globl	c
	.align 8
	.type	c, @object
	.size	c, 8
c:
	.zero	8
	.globl	d
	.align 8
	.type	d, @object
	.size	d, 8
d:
	.zero	8
	.globl	r
	.data
	.align 8
	.type	r, @object
	.size	r, 8
r:
	.long	-1717986918
	.long	1085860377
	.globl	x1
	.bss
	.align 8
	.type	x1, @object
	.size	x1, 8
x1:
	.zero	8
	.globl	y11
	.align 8
	.type	y11, @object
	.size	y11, 8
y11:
	.zero	8
	.globl	z1
	.align 8
	.type	z1, @object
	.size	z1, 8
z1:
	.zero	8
	.globl	x2
	.align 8
	.type	x2, @object
	.size	x2, 8
x2:
	.zero	8
	.globl	y2
	.align 8
	.type	y2, @object
	.size	y2, 8
y2:
	.zero	8
	.globl	z2
	.align 8
	.type	z2, @object
	.size	z2, 8
z2:
	.zero	8
	.text
	.globl	ki2xyz
	.type	ki2xyz, @function
ki2xyz:
.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
	movsd	%xmm0, -8(%rbp)
	movsd	%xmm1, -16(%rbp)
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	%rdx, -40(%rbp)
	movsd	d2r(%rip), %xmm0
	mulsd	-16(%rbp), %xmm0
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	call	cos@PLT
	movsd	r(%rip), %xmm1
	mulsd	%xmm1, %xmm0
	movsd	%xmm0, -48(%rbp)
	movsd	d2r(%rip), %xmm0
	movapd	%xmm0, %xmm3
	mulsd	-8(%rbp), %xmm3
	movq	%xmm3, %rax
	movq	%rax, %xmm0
	call	cos@PLT
	mulsd	-48(%rbp), %xmm0
	movq	-24(%rbp), %rax
	movsd	%xmm0, (%rax)
	movsd	d2r(%rip), %xmm0
	mulsd	-16(%rbp), %xmm0
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	call	sin@PLT
	movsd	r(%rip), %xmm1
	mulsd	%xmm1, %xmm0
	movsd	%xmm0, -48(%rbp)
	movsd	d2r(%rip), %xmm0
	movapd	%xmm0, %xmm5
	mulsd	-8(%rbp), %xmm5
	movq	%xmm5, %rax
	movq	%rax, %xmm0
	call	cos@PLT
	mulsd	-48(%rbp), %xmm0
	movq	-32(%rbp), %rax
	movsd	%xmm0, (%rax)
	movsd	d2r(%rip), %xmm0
	mulsd	-8(%rbp), %xmm0
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	call	sin@PLT
	movsd	r(%rip), %xmm1
	mulsd	%xmm1, %xmm0
	movq	-40(%rbp), %rax
	movsd	%xmm0, (%rax)
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	ki2xyz, .-ki2xyz
	.globl	calc_angle
	.type	calc_angle, @function
calc_angle:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movsd	%xmm0, -24(%rbp)
	movsd	%xmm1, -32(%rbp)
	movsd	%xmm2, -40(%rbp)
	movsd	%xmm3, -48(%rbp)
	movsd	%xmm4, -56(%rbp)
	movsd	%xmm5, -64(%rbp)
	movsd	-24(%rbp), %xmm0
	movapd	%xmm0, %xmm1
	mulsd	-48(%rbp), %xmm1
	movsd	-32(%rbp), %xmm0
	mulsd	-56(%rbp), %xmm0
	addsd	%xmm0, %xmm1
	movsd	-40(%rbp), %xmm0
	mulsd	-64(%rbp), %xmm0
	addsd	%xmm1, %xmm0
	movsd	%xmm0, -8(%rbp)
	movsd	r(%rip), %xmm1
	movsd	r(%rip), %xmm0
	mulsd	%xmm0, %xmm1
	movsd	-8(%rbp), %xmm0
	divsd	%xmm1, %xmm0
	movsd	%xmm0, -8(%rbp)
	movq	-8(%rbp), %rax
	movq	%rax, %xmm0
	call	acos@PLT
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	calc_angle, .-calc_angle
	.section	.rodata
.LC0:
	.string	"%.0lf\n"
.LC1:
	.string	"%lf %lf %lf %lf"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	jmp	.L5
.L7:
	movsd	b(%rip), %xmm0
	movq	a(%rip), %rax
	leaq	z1(%rip), %rdx
	leaq	y11(%rip), %rcx
	movq	%rcx, %rsi
	leaq	x1(%rip), %rcx
	movq	%rcx, %rdi
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	ki2xyz
	movsd	d(%rip), %xmm0
	movq	c(%rip), %rax
	leaq	z2(%rip), %rdx
	leaq	y2(%rip), %rcx
	movq	%rcx, %rsi
	leaq	x2(%rip), %rcx
	movq	%rcx, %rdi
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	ki2xyz
	movsd	z2(%rip), %xmm4
	movsd	y2(%rip), %xmm3
	movsd	x2(%rip), %xmm2
	movsd	z1(%rip), %xmm1
	movsd	y11(%rip), %xmm0
	movq	x1(%rip), %rax
	movapd	%xmm4, %xmm5
	movapd	%xmm3, %xmm4
	movapd	%xmm2, %xmm3
	movapd	%xmm1, %xmm2
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	calc_angle
	movq	%xmm0, %rax
	movq	%rax, -8(%rbp)
	movsd	r(%rip), %xmm0
	mulsd	-8(%rbp), %xmm0
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$1, %eax
	call	printf@PLT
.L5:
	leaq	d(%rip), %r8
	leaq	c(%rip), %rax
	movq	%rax, %rcx
	leaq	b(%rip), %rax
	movq	%rax, %rdx
	leaq	a(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L6
	movsd	a(%rip), %xmm0
	movsd	.LC2(%rip), %xmm1
	ucomisd	%xmm1, %xmm0
	jp	.L7
	movsd	.LC2(%rip), %xmm1
	ucomisd	%xmm1, %xmm0
	jne	.L7
	movsd	b(%rip), %xmm0
	movsd	.LC2(%rip), %xmm1
	ucomisd	%xmm1, %xmm0
	jp	.L7
	movsd	.LC2(%rip), %xmm1
	ucomisd	%xmm1, %xmm0
	jne	.L7
	movsd	c(%rip), %xmm0
	movsd	.LC2(%rip), %xmm1
	ucomisd	%xmm1, %xmm0
	jp	.L7
	movsd	.LC2(%rip), %xmm1
	ucomisd	%xmm1, %xmm0
	jne	.L7
	movsd	d(%rip), %xmm0
	movsd	.LC2(%rip), %xmm1
	ucomisd	%xmm1, %xmm0
	jp	.L7
	movsd	.LC2(%rip), %xmm1
	ucomisd	%xmm1, %xmm0
	jne	.L7
.L6:
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC2:
	.long	0
	.long	-1074790400
	.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:
