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

```c
#include <stdio.h>
#include <stdlib.h>
#include <float.h>
#include <math.h>

int main(void){

	double x, y;
	unsigned int X;
	unsigned int K = 0;

	x=1.;
	y=0.;

    scanf("%3d", &X);
	const double theta_x = X * (M_PI / 180.0);
  	double theta = 0;

	while(1){
            theta += theta_x;
		x += cos(theta);
		y += sin(theta);
		K++;
      if(fabs(x)-0. < 1e-7 && fabs(y)-0. < 1e-7){
        break;
    }
      }
  
	printf("%d\n", K+1);

	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC2:
	.string	"%3d"
.LC6:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC2(%rip), %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	xorl	%ebx, %ebx
	subq	$64, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	52(%rsp), %rsi
	leaq	40(%rsp), %r12
	leaq	32(%rsp), %rbp
	call	__isoc99_scanf@PLT
	movl	52(%rsp), %eax
	pxor	%xmm0, %xmm0
	movsd	.LC1(%rip), %xmm1
	cvtsi2sdq	%rax, %xmm0
	mulsd	.LC3(%rip), %xmm0
	movsd	%xmm0, 24(%rsp)
	pxor	%xmm0, %xmm0
	movapd	%xmm0, %xmm2
	.p2align 4,,10
	.p2align 3
.L10:
	addsd	24(%rsp), %xmm0
	movq	%rbp, %rsi
	movq	%r12, %rdi
	movsd	%xmm2, 16(%rsp)
	movsd	%xmm1, 8(%rsp)
	movsd	%xmm0, (%rsp)
	call	sincos@PLT
	movsd	8(%rsp), %xmm1
	movl	%ebx, %edx
	addsd	32(%rsp), %xmm1
	movsd	.LC5(%rip), %xmm5
	addl	$1, %ebx
	movsd	16(%rsp), %xmm2
	movsd	(%rsp), %xmm0
	addsd	40(%rsp), %xmm2
	movapd	%xmm1, %xmm3
	andpd	.LC4(%rip), %xmm3
	comisd	%xmm3, %xmm5
	jbe	.L10
	movapd	%xmm2, %xmm3
	andpd	.LC4(%rip), %xmm3
	comisd	%xmm3, %xmm5
	jbe	.L10
	addl	$2, %edx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC6(%rip), %rsi
	call	__printf_chk@PLT
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L13
	addq	$64, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L13:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.long	0
	.long	1072693248
	.align 8
.LC3:
	.long	-1571644103
	.long	1066524486
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC4:
	.long	-1
	.long	2147483647
	.long	0
	.long	0
	.section	.rodata.cst8
	.align 8
.LC5:
	.long	-1698910392
	.long	1048238066
	.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.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC2:
	.string	"%3d"
.LC6:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC2(%rip), %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	xorl	%ebx, %ebx
	subq	$64, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	52(%rsp), %rsi
	leaq	40(%rsp), %r12
	leaq	32(%rsp), %rbp
	call	__isoc99_scanf@PLT
	movl	52(%rsp), %eax
	pxor	%xmm0, %xmm0
	movsd	.LC1(%rip), %xmm1
	cvtsi2sdq	%rax, %xmm0
	mulsd	.LC3(%rip), %xmm0
	movsd	%xmm0, 24(%rsp)
	pxor	%xmm0, %xmm0
	movapd	%xmm0, %xmm2
	.p2align 4,,10
	.p2align 3
.L10:
	addsd	24(%rsp), %xmm0
	movq	%rbp, %rsi
	movq	%r12, %rdi
	movsd	%xmm2, 16(%rsp)
	movsd	%xmm1, 8(%rsp)
	movsd	%xmm0, (%rsp)
	call	sincos@PLT
	movsd	8(%rsp), %xmm1
	movl	%ebx, %edx
	addsd	32(%rsp), %xmm1
	movsd	.LC5(%rip), %xmm5
	addl	$1, %ebx
	movsd	16(%rsp), %xmm2
	movsd	(%rsp), %xmm0
	addsd	40(%rsp), %xmm2
	movapd	%xmm1, %xmm3
	andpd	.LC4(%rip), %xmm3
	comisd	%xmm3, %xmm5
	jbe	.L10
	movapd	%xmm2, %xmm3
	andpd	.LC4(%rip), %xmm3
	comisd	%xmm3, %xmm5
	jbe	.L10
	addl	$2, %edx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC6(%rip), %rsi
	call	__printf_chk@PLT
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L13
	addq	$64, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L13:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.long	0
	.long	1072693248
	.align 8
.LC3:
	.long	-1571644103
	.long	1066524486
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC4:
	.long	-1
	.long	2147483647
	.long	0
	.long	0
	.section	.rodata.cst8
	.align 8
.LC5:
	.long	-1698910392
	.long	1048238066
	.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
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC2:
	.string	"%3d"
.LC6:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC2(%rip), %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	xorl	%ebx, %ebx
	subq	$64, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	52(%rsp), %rsi
	leaq	40(%rsp), %r12
	leaq	32(%rsp), %rbp
	call	__isoc99_scanf@PLT
	movl	52(%rsp), %eax
	pxor	%xmm0, %xmm0
	movsd	.LC1(%rip), %xmm1
	cvtsi2sdq	%rax, %xmm0
	mulsd	.LC3(%rip), %xmm0
	movsd	%xmm0, 24(%rsp)
	pxor	%xmm0, %xmm0
	movapd	%xmm0, %xmm2
	.p2align 4,,10
	.p2align 3
.L10:
	addsd	24(%rsp), %xmm0
	movq	%rbp, %rsi
	movq	%r12, %rdi
	movsd	%xmm2, 16(%rsp)
	movsd	%xmm1, 8(%rsp)
	movsd	%xmm0, (%rsp)
	call	sincos@PLT
	movsd	8(%rsp), %xmm1
	movl	%ebx, %edx
	addsd	32(%rsp), %xmm1
	movsd	.LC5(%rip), %xmm5
	addl	$1, %ebx
	movsd	16(%rsp), %xmm2
	movsd	(%rsp), %xmm0
	addsd	40(%rsp), %xmm2
	movapd	%xmm1, %xmm3
	andpd	.LC4(%rip), %xmm3
	comisd	%xmm3, %xmm5
	jbe	.L10
	movapd	%xmm2, %xmm3
	andpd	.LC4(%rip), %xmm3
	comisd	%xmm3, %xmm5
	jbe	.L10
	addl	$2, %edx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC6(%rip), %rsi
	call	__printf_chk@PLT
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L13
	addq	$64, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L13:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.long	0
	.long	1072693248
	.align 8
.LC3:
	.long	-1571644103
	.long	1066524486
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC4:
	.long	-1
	.long	2147483647
	.long	0
	.long	0
	.section	.rodata.cst8
	.align 8
.LC5:
	.long	-1698910392
	.long	1048238066
	.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:
```
```c
#include <stdio.h>
#include <stdlib.h>
#include <float.h>
#include <math.h>

int main(void){

	double x, y;
	unsigned int X;
	unsigned int K = 0;

	x=1.;
	y=0.;

    scanf("%3d", &X);
	const double theta_x = X * (M_PI / 180.0);
  	double theta = 0;

	while(1){
            theta += theta_x;
		x += cos(theta);
		y += sin(theta);
		K++;
      if(fabs(x)-0. < 1e-7 && fabs(y)-0. < 1e-7){
        break;
    }
      }
  
	printf("%d\n", K+1);

	return 0;
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#include <stdlib.h>
#include <float.h>
#include <math.h>

int main(void){

	double x, y;
	unsigned int X;
	unsigned int K = 0;

	x=1.;
	y=0.;

    scanf("%3d", &X);
	const double theta_x = X * (M_PI / 180.0);
  	double theta = 0;

	while(1){
            theta += theta_x;
		x += cos(theta);
		y += sin(theta);
		K++;
      if(fabs(x)-0. < 1e-7 && fabs(y)-0. < 1e-7){
        break;
    }
      }
  
	printf("%d\n", K+1);

	return 0;
}```

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.
Optimized Assembly Code:

155
 2
 297
 408
 643
 810
 928
 1780
 33
 70

72
 180
 40
 15
 360
 4
 45
 180
 120
 36

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

```c
#include <stdio.h>
#include <stdlib.h>
#include <float.h>
#include <math.h>

int main(void){

	double x, y;
	unsigned int X;
	unsigned int K = 0;

	x=1.;
	y=0.;

    scanf("%3d", &X);
	const double theta_x = X * (M_PI / 180.0);
  	double theta = 0;

	while(1){
            theta += theta_x;
		x += cos(theta);
		y += sin(theta);
		K++;
      if(fabs(x)-0. < 1e-7 && fabs(y)-0. < 1e-7){
        break;
    }
      }
  
	printf("%d\n", K+1);

	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC2:
	.string	"%3d"
.LC6:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC2(%rip), %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	xorl	%ebx, %ebx
	subq	$64, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	52(%rsp), %rsi
	leaq	40(%rsp), %r12
	leaq	32(%rsp), %rbp
	call	__isoc99_scanf@PLT
	movl	52(%rsp), %eax
	pxor	%xmm0, %xmm0
	movsd	.LC1(%rip), %xmm1
	cvtsi2sdq	%rax, %xmm0
	mulsd	.LC3(%rip), %xmm0
	movsd	%xmm0, 24(%rsp)
	pxor	%xmm0, %xmm0
	movapd	%xmm0, %xmm2
	.p2align 4,,10
	.p2align 3
.L10:
	addsd	24(%rsp), %xmm0
	movq	%rbp, %rsi
	movq	%r12, %rdi
	movsd	%xmm2, 16(%rsp)
	movsd	%xmm1, 8(%rsp)
	movsd	%xmm0, (%rsp)
	call	sincos@PLT
	movsd	8(%rsp), %xmm1
	movl	%ebx, %edx
	addsd	32(%rsp), %xmm1
	movsd	.LC5(%rip), %xmm5
	addl	$1, %ebx
	movsd	16(%rsp), %xmm2
	movsd	(%rsp), %xmm0
	addsd	40(%rsp), %xmm2
	movapd	%xmm1, %xmm3
	andpd	.LC4(%rip), %xmm3
	comisd	%xmm3, %xmm5
	jbe	.L10
	movapd	%xmm2, %xmm3
	andpd	.LC4(%rip), %xmm3
	comisd	%xmm3, %xmm5
	jbe	.L10
	addl	$2, %edx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC6(%rip), %rsi
	call	__printf_chk@PLT
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L13
	addq	$64, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L13:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.long	0
	.long	1072693248
	.align 8
.LC3:
	.long	-1571644103
	.long	1066524486
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC4:
	.long	-1
	.long	2147483647
	.long	0
	.long	0
	.section	.rodata.cst8
	.align 8
.LC5:
	.long	-1698910392
	.long	1048238066
	.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.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC2:
	.string	"%3d"
.LC6:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC2(%rip), %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	xorl	%ebx, %ebx
	subq	$64, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	52(%rsp), %rsi
	leaq	40(%rsp), %r12
	leaq	32(%rsp), %rbp
	call	__isoc99_scanf@PLT
	movl	52(%rsp), %eax
	pxor	%xmm0, %xmm0
	movsd	.LC1(%rip), %xmm1
	cvtsi2sdq	%rax, %xmm0
	mulsd	.LC3(%rip), %xmm0
	movsd	%xmm0, 24(%rsp)
	pxor	%xmm0, %xmm0
	movapd	%xmm0, %xmm2
	.p2align 4,,10
	.p2align 3
.L10:
	addsd	24(%rsp), %xmm0
	movq	%rbp, %rsi
	movq	%r12, %rdi
	movsd	%xmm2, 16(%rsp)
	movsd	%xmm1, 8(%rsp)
	movsd	%xmm0, (%rsp)
	call	sincos@PLT
	movsd	8(%rsp), %xmm1
	movl	%ebx, %edx
	addsd	32(%rsp), %xmm1
	movsd	.LC5(%rip), %xmm5
	addl	$1, %ebx
	movsd	16(%rsp), %xmm2
	movsd	(%rsp), %xmm0
	addsd	40(%rsp), %xmm2
	movapd	%xmm1, %xmm3
	andpd	.LC4(%rip), %xmm3
	comisd	%xmm3, %xmm5
	jbe	.L10
	movapd	%xmm2, %xmm3
	andpd	.LC4(%rip), %xmm3
	comisd	%xmm3, %xmm5
	jbe	.L10
	addl	$2, %edx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC6(%rip), %rsi
	call	__printf_chk@PLT
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L13
	addq	$64, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L13:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.long	0
	.long	1072693248
	.align 8
.LC3:
	.long	-1571644103
	.long	1066524486
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC4:
	.long	-1
	.long	2147483647
	.long	0
	.long	0
	.section	.rodata.cst8
	.align 8
.LC5:
	.long	-1698910392
	.long	1048238066
	.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:
```