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

```c
#define Z(V) for(v=360,m=g();--m;V+=sin(x*z))v-=x=g();V+=sin(v*z)
a;g(){scanf("%d",&a);a?a:exit(0);}
main(m,v,x){
  for(;;){double s=0,t=0,z=.01745329,e=.000001;
    Z(s);Z(t);
    puts(s>t+e?"1":s+e<t?"2":"0");
  }
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	g
	.type	g, @function
g:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	a(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	a(%rip), %eax
	testl	%eax, %eax
	jne	.L2
	movl	$0, %edi
	call	exit@PLT
.L2:
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	g, .-g
	.section	.rodata
.LC4:
	.string	"1"
.LC5:
	.string	"2"
.LC6:
	.string	"0"
	.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	$48, %rsp
	movl	%edi, -36(%rbp)
	movl	%esi, -40(%rbp)
	movl	%edx, -44(%rbp)
.L14:
	pxor	%xmm0, %xmm0
	movsd	%xmm0, -32(%rbp)
	pxor	%xmm0, %xmm0
	movsd	%xmm0, -24(%rbp)
	movsd	.LC2(%rip), %xmm0
	movsd	%xmm0, -16(%rbp)
	movsd	.LC3(%rip), %xmm0
	movsd	%xmm0, -8(%rbp)
	movl	$360, -40(%rbp)
	movl	$0, %eax
	call	g
	movl	%eax, -36(%rbp)
	jmp	.L4
.L5:
	movl	$0, %eax
	call	g
	movl	%eax, -44(%rbp)
	movl	-44(%rbp), %eax
	subl	%eax, -40(%rbp)
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-44(%rbp), %xmm0
	mulsd	-16(%rbp), %xmm0
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	call	sin@PLT
	movsd	-32(%rbp), %xmm1
	addsd	%xmm1, %xmm0
	movsd	%xmm0, -32(%rbp)
.L4:
	subl	$1, -36(%rbp)
	cmpl	$0, -36(%rbp)
	jne	.L5
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-40(%rbp), %xmm0
	mulsd	-16(%rbp), %xmm0
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	call	sin@PLT
	movsd	-32(%rbp), %xmm1
	addsd	%xmm1, %xmm0
	movsd	%xmm0, -32(%rbp)
	movl	$360, -40(%rbp)
	movl	$0, %eax
	call	g
	movl	%eax, -36(%rbp)
	jmp	.L6
.L7:
	movl	$0, %eax
	call	g
	movl	%eax, -44(%rbp)
	movl	-44(%rbp), %eax
	subl	%eax, -40(%rbp)
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-44(%rbp), %xmm0
	mulsd	-16(%rbp), %xmm0
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	call	sin@PLT
	movsd	-24(%rbp), %xmm1
	addsd	%xmm1, %xmm0
	movsd	%xmm0, -24(%rbp)
.L6:
	subl	$1, -36(%rbp)
	cmpl	$0, -36(%rbp)
	jne	.L7
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-40(%rbp), %xmm0
	mulsd	-16(%rbp), %xmm0
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	call	sin@PLT
	movsd	-24(%rbp), %xmm1
	addsd	%xmm1, %xmm0
	movsd	%xmm0, -24(%rbp)
	movsd	-24(%rbp), %xmm0
	movapd	%xmm0, %xmm1
	addsd	-8(%rbp), %xmm1
	movsd	-32(%rbp), %xmm0
	comisd	%xmm1, %xmm0
	jbe	.L17
	leaq	.LC4(%rip), %rax
	jmp	.L10
.L17:
	movsd	-32(%rbp), %xmm0
	movapd	%xmm0, %xmm1
	addsd	-8(%rbp), %xmm1
	movsd	-24(%rbp), %xmm0
	comisd	%xmm1, %xmm0
	jbe	.L18
	leaq	.LC5(%rip), %rax
	jmp	.L10
.L18:
	leaq	.LC6(%rip), %rax
.L10:
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L14
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC2:
	.long	1996998989
	.long	1066524486
	.align 8
.LC3:
	.long	-1598689907
	.long	1051772663
	.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"
	.text
	.p2align 4
	.globl	g
	.type	g, @function
g:
.LFB0:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	leaq	a(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	a(%rip), %eax
	testl	%eax, %eax
	je	.L5
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	xorl	%edi, %edi
	call	exit@PLT
	.cfi_endproc
.LFE0:
	.size	g, .-g
	.section	.rodata.str1.1
.LC2:
	.string	"1"
.LC3:
	.string	"0"
.LC4:
	.string	"2"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB1:
	.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
	movl	$-1, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	a(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
.L13:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	a(%rip), %edx
	testl	%edx, %edx
	je	.L7
	xorl	%r14d, %r14d
	movl	%r13d, %r12d
	movq	%r14, (%rsp)
	testl	%r13d, %r13d
	je	.L9
.L8:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	a(%rip), %eax
	testl	%eax, %eax
	je	.L7
	xorl	%eax, %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	mulsd	.LC5(%rip), %xmm0
	call	sin@PLT
	addsd	(%rsp), %xmm0
	movsd	%xmm0, (%rsp)
	subl	$1, %r12d
	jne	.L8
.L9:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	scanf@PLT
	cmpl	$0, a(%rip)
	je	.L7
	movq	%r14, 8(%rsp)
.L10:
	subl	$1, %r15d
	je	.L19
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	scanf@PLT
	cmpl	$0, a(%rip)
	je	.L7
	xorl	%eax, %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	mulsd	.LC5(%rip), %xmm0
	call	sin@PLT
	addsd	8(%rsp), %xmm0
	movsd	%xmm0, 8(%rsp)
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L7:
	xorl	%edi, %edi
	call	exit@PLT
.L19:
	movsd	.LC6(%rip), %xmm2
	movsd	8(%rsp), %xmm1
	leaq	.LC2(%rip), %rdi
	movsd	(%rsp), %xmm0
	subsd	%xmm2, %xmm1
	subsd	%xmm2, %xmm0
	movsd	.LC7(%rip), %xmm2
	movapd	%xmm1, %xmm3
	addsd	%xmm2, %xmm3
	comisd	%xmm3, %xmm0
	ja	.L12
	addsd	%xmm2, %xmm0
	leaq	.LC4(%rip), %rdi
	leaq	.LC3(%rip), %rax
	comisd	%xmm0, %xmm1
	cmovbe	%rax, %rdi
.L12:
	call	puts@PLT
	jmp	.L13
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.globl	a
	.bss
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC5:
	.long	1996998989
	.long	1066524486
	.align 8
.LC6:
	.long	35866549
	.long	1051619485
	.align 8
.LC7:
	.long	-1598689907
	.long	1051772663
	.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"
	.text
	.p2align 4
	.globl	g
	.type	g, @function
g:
.LFB0:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	leaq	a(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	a(%rip), %eax
	testl	%eax, %eax
	je	.L5
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	xorl	%edi, %edi
	call	exit@PLT
	.cfi_endproc
.LFE0:
	.size	g, .-g
	.section	.rodata.str1.1
.LC2:
	.string	"1"
.LC3:
	.string	"0"
.LC4:
	.string	"2"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB1:
	.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
	movl	$-1, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	a(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
.L13:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	a(%rip), %edx
	testl	%edx, %edx
	je	.L7
	xorl	%r14d, %r14d
	movl	%r13d, %r12d
	movq	%r14, (%rsp)
	testl	%r13d, %r13d
	je	.L9
.L8:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	a(%rip), %eax
	testl	%eax, %eax
	je	.L7
	xorl	%eax, %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	mulsd	.LC5(%rip), %xmm0
	call	sin@PLT
	addsd	(%rsp), %xmm0
	movsd	%xmm0, (%rsp)
	subl	$1, %r12d
	jne	.L8
.L9:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	scanf@PLT
	cmpl	$0, a(%rip)
	je	.L7
	movq	%r14, 8(%rsp)
.L10:
	subl	$1, %r15d
	je	.L19
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	scanf@PLT
	cmpl	$0, a(%rip)
	je	.L7
	xorl	%eax, %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	mulsd	.LC5(%rip), %xmm0
	call	sin@PLT
	addsd	8(%rsp), %xmm0
	movsd	%xmm0, 8(%rsp)
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L7:
	xorl	%edi, %edi
	call	exit@PLT
.L19:
	movsd	.LC6(%rip), %xmm2
	movsd	8(%rsp), %xmm1
	leaq	.LC2(%rip), %rdi
	movsd	(%rsp), %xmm0
	subsd	%xmm2, %xmm1
	subsd	%xmm2, %xmm0
	movsd	.LC7(%rip), %xmm2
	movapd	%xmm1, %xmm3
	addsd	%xmm2, %xmm3
	comisd	%xmm3, %xmm0
	ja	.L12
	addsd	%xmm2, %xmm0
	leaq	.LC4(%rip), %rdi
	leaq	.LC3(%rip), %rax
	comisd	%xmm0, %xmm1
	cmovbe	%rax, %rdi
.L12:
	call	puts@PLT
	jmp	.L13
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.globl	a
	.bss
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC5:
	.long	1996998989
	.long	1066524486
	.align 8
.LC6:
	.long	35866549
	.long	1051619485
	.align 8
.LC7:
	.long	-1598689907
	.long	1051772663
	.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:

#define Z(V) for(v=360,m=g();--m;V+=sin(x*z))v-=x=g();V+=sin(v*z)
a;g(){scanf("%d",&a);a?a:exit(0);}
main(m,v,x){
  for(;;){double s=0,t=0,z=.01745329,e=.000001;
    Z(s);Z(t);
    puts(s>t+e?"1":s+e<t?"2":"0");
  }
}
4
30
125
75
4
30
125
75
5
30
125
75
65
4
30
125
75
4
30
125
75
6
30
50
50
29
75
0
 4
30
125
75
4
30
125
75
5
30
125
75
65
4
30
125
75
4
30
125
75
6
30
50
6
29
75
0
 4
30
84
75
4
30
125
75
5
30
125
75
65
4
30
125
75
4
30
125
75
6
52
50
50
25
75
0
 4
30
125
75
4
30
125
75
5
30
125
149
65
4
30
125
75
4
30
125
75
6
52
50
50
25
75
0
 4
30
125
75
4
21
125
75
5
30
125
75
65
4
30
125
75
4
30
125
75
6
30
50
6
29
75
0
 4
30
125
75
4
30
125
75
5
30
207
75
65
4
30
125
75
4
30
125
75
6
30
50
2
29
0
0
 4
30
125
75
4
30
125
30
5
30
125
75
65
4
30
125
75
4
30
211
75
6
30
50
50
29
35
0
 4
30
207
75
4
30
125
75
5
30
207
75
65
4
30
125
75
4
30
125
75
6
30
50
2
29
0
0
 4
30
84
75
4
30
125
75
5
30
7
14
65
4
30
125
75
4
30
125
75
6
52
50
50
7
75
0
 4
30
125
75
4
30
117
75
5
50
175
75
65
4
30
125
75
4
30
125
2
6
7
50
6
29
0
0

0
1
2
 0
1
1
 2
1
2
 0
2
2
 1
1
1
 0
2
 1
1
2
 2
2
 2
2
2
 1
2

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

```c
#define Z(V) for(v=360,m=g();--m;V+=sin(x*z))v-=x=g();V+=sin(v*z)
a;g(){scanf("%d",&a);a?a:exit(0);}
main(m,v,x){
  for(;;){double s=0,t=0,z=.01745329,e=.000001;
    Z(s);Z(t);
    puts(s>t+e?"1":s+e<t?"2":"0");
  }
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	g
	.type	g, @function
g:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	a(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	a(%rip), %eax
	testl	%eax, %eax
	jne	.L2
	movl	$0, %edi
	call	exit@PLT
.L2:
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	g, .-g
	.section	.rodata
.LC4:
	.string	"1"
.LC5:
	.string	"2"
.LC6:
	.string	"0"
	.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	$48, %rsp
	movl	%edi, -36(%rbp)
	movl	%esi, -40(%rbp)
	movl	%edx, -44(%rbp)
.L14:
	pxor	%xmm0, %xmm0
	movsd	%xmm0, -32(%rbp)
	pxor	%xmm0, %xmm0
	movsd	%xmm0, -24(%rbp)
	movsd	.LC2(%rip), %xmm0
	movsd	%xmm0, -16(%rbp)
	movsd	.LC3(%rip), %xmm0
	movsd	%xmm0, -8(%rbp)
	movl	$360, -40(%rbp)
	movl	$0, %eax
	call	g
	movl	%eax, -36(%rbp)
	jmp	.L4
.L5:
	movl	$0, %eax
	call	g
	movl	%eax, -44(%rbp)
	movl	-44(%rbp), %eax
	subl	%eax, -40(%rbp)
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-44(%rbp), %xmm0
	mulsd	-16(%rbp), %xmm0
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	call	sin@PLT
	movsd	-32(%rbp), %xmm1
	addsd	%xmm1, %xmm0
	movsd	%xmm0, -32(%rbp)
.L4:
	subl	$1, -36(%rbp)
	cmpl	$0, -36(%rbp)
	jne	.L5
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-40(%rbp), %xmm0
	mulsd	-16(%rbp), %xmm0
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	call	sin@PLT
	movsd	-32(%rbp), %xmm1
	addsd	%xmm1, %xmm0
	movsd	%xmm0, -32(%rbp)
	movl	$360, -40(%rbp)
	movl	$0, %eax
	call	g
	movl	%eax, -36(%rbp)
	jmp	.L6
.L7:
	movl	$0, %eax
	call	g
	movl	%eax, -44(%rbp)
	movl	-44(%rbp), %eax
	subl	%eax, -40(%rbp)
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-44(%rbp), %xmm0
	mulsd	-16(%rbp), %xmm0
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	call	sin@PLT
	movsd	-24(%rbp), %xmm1
	addsd	%xmm1, %xmm0
	movsd	%xmm0, -24(%rbp)
.L6:
	subl	$1, -36(%rbp)
	cmpl	$0, -36(%rbp)
	jne	.L7
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-40(%rbp), %xmm0
	mulsd	-16(%rbp), %xmm0
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	call	sin@PLT
	movsd	-24(%rbp), %xmm1
	addsd	%xmm1, %xmm0
	movsd	%xmm0, -24(%rbp)
	movsd	-24(%rbp), %xmm0
	movapd	%xmm0, %xmm1
	addsd	-8(%rbp), %xmm1
	movsd	-32(%rbp), %xmm0
	comisd	%xmm1, %xmm0
	jbe	.L17
	leaq	.LC4(%rip), %rax
	jmp	.L10
.L17:
	movsd	-32(%rbp), %xmm0
	movapd	%xmm0, %xmm1
	addsd	-8(%rbp), %xmm1
	movsd	-24(%rbp), %xmm0
	comisd	%xmm1, %xmm0
	jbe	.L18
	leaq	.LC5(%rip), %rax
	jmp	.L10
.L18:
	leaq	.LC6(%rip), %rax
.L10:
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L14
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC2:
	.long	1996998989
	.long	1066524486
	.align 8
.LC3:
	.long	-1598689907
	.long	1051772663
	.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	a
	.bss
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	g
	.type	g, @function
g:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	a(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	a(%rip), %eax
	testl	%eax, %eax
	jne	.L2
	movl	$0, %edi
	call	exit@PLT
.L2:
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	g, .-g
	.section	.rodata
.LC4:
	.string	"1"
.LC5:
	.string	"2"
.LC6:
	.string	"0"
	.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	$48, %rsp
	movl	%edi, -36(%rbp)
	movl	%esi, -40(%rbp)
	movl	%edx, -44(%rbp)
.L14:
	pxor	%xmm0, %xmm0
	movsd	%xmm0, -32(%rbp)
	pxor	%xmm0, %xmm0
	movsd	%xmm0, -24(%rbp)
	movsd	.LC2(%rip), %xmm0
	movsd	%xmm0, -16(%rbp)
	movsd	.LC3(%rip), %xmm0
	movsd	%xmm0, -8(%rbp)
	movl	$360, -40(%rbp)
	movl	$0, %eax
	call	g
	movl	%eax, -36(%rbp)
	jmp	.L4
.L5:
	movl	$0, %eax
	call	g
	movl	%eax, -44(%rbp)
	movl	-44(%rbp), %eax
	subl	%eax, -40(%rbp)
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-44(%rbp), %xmm0
	mulsd	-16(%rbp), %xmm0
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	call	sin@PLT
	movsd	-32(%rbp), %xmm1
	addsd	%xmm1, %xmm0
	movsd	%xmm0, -32(%rbp)
.L4:
	subl	$1, -36(%rbp)
	cmpl	$0, -36(%rbp)
	jne	.L5
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-40(%rbp), %xmm0
	mulsd	-16(%rbp), %xmm0
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	call	sin@PLT
	movsd	-32(%rbp), %xmm1
	addsd	%xmm1, %xmm0
	movsd	%xmm0, -32(%rbp)
	movl	$360, -40(%rbp)
	movl	$0, %eax
	call	g
	movl	%eax, -36(%rbp)
	jmp	.L6
.L7:
	movl	$0, %eax
	call	g
	movl	%eax, -44(%rbp)
	movl	-44(%rbp), %eax
	subl	%eax, -40(%rbp)
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-44(%rbp), %xmm0
	mulsd	-16(%rbp), %xmm0
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	call	sin@PLT
	movsd	-24(%rbp), %xmm1
	addsd	%xmm1, %xmm0
	movsd	%xmm0, -24(%rbp)
.L6:
	subl	$1, -36(%rbp)
	cmpl	$0, -36(%rbp)
	jne	.L7
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-40(%rbp), %xmm0
	mulsd	-16(%rbp), %xmm0
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	call	sin@PLT
	movsd	-24(%rbp), %xmm1
	addsd	%xmm1, %xmm0
	movsd	%xmm0, -24(%rbp)
	movsd	-24(%rbp), %xmm0
	movapd	%xmm0, %xmm1
	addsd	-8(%rbp), %xmm1
	movsd	-32(%rbp), %xmm0
	comisd	%xmm1, %xmm0
	jbe	.L17
	leaq	.LC4(%rip), %rax
	jmp	.L10
.L17:
	movsd	-32(%rbp), %xmm0
	movapd	%xmm0, %xmm1
	addsd	-8(%rbp), %xmm1
	movsd	-24(%rbp), %xmm0
	comisd	%xmm1, %xmm0
	jbe	.L18
	leaq	.LC5(%rip), %rax
	jmp	.L10
.L18:
	leaq	.LC6(%rip), %rax
.L10:
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L14
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC2:
	.long	1996998989
	.long	1066524486
	.align 8
.LC3:
	.long	-1598689907
	.long	1051772663
	.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:
