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.14159265
#define EPS 0.000001
double A[2]={0,0};
int M,i,j,c,a,s;
int main()
{
	for(c=0;scanf("%d",&M),M;c++)
	{
		for(i=s=0;i<M-1;i++)
		{
			scanf("%d",&a);
			s+=a;
			A[c%2]+=sin(PI*((double)a/180))/2;
		}
		A[c%2]+=sin(PI*((360.0-s)/180))/2;
		if(A[0]>0&&A[1]>0)
		{
			if(A[0]==A[1])puts("0");
			else if(A[0]>A[1])puts("1");
			else puts("2");
			A[0]=A[1]=0;
		}
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	A
	.bss
	.align 16
	.type	A, @object
	.size	A, 16
A:
	.zero	16
	.globl	M
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	c
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	s
	.align 4
	.type	s, @object
	.size	s, 4
s:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d"
.LC6:
	.string	"0"
.LC7:
	.string	"1"
.LC8:
	.string	"2"
	.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
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 3, -24
	movl	$0, c(%rip)
	jmp	.L2
.L13:
	movl	$0, s(%rip)
	movl	s(%rip), %eax
	movl	%eax, i(%rip)
	jmp	.L3
.L4:
	leaq	a(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	s(%rip), %edx
	movl	a(%rip), %eax
	addl	%edx, %eax
	movl	%eax, s(%rip)
	movl	c(%rip), %eax
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	movl	%eax, %ebx
	movslq	%ebx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	A(%rip), %rax
	movsd	(%rdx,%rax), %xmm3
	movsd	%xmm3, -24(%rbp)
	movl	a(%rip), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movsd	.LC1(%rip), %xmm2
	movapd	%xmm0, %xmm1
	divsd	%xmm2, %xmm1
	movsd	.LC2(%rip), %xmm0
	mulsd	%xmm0, %xmm1
	movq	%xmm1, %rax
	movq	%rax, %xmm0
	call	sin@PLT
	movq	%xmm0, %rax
	movsd	.LC3(%rip), %xmm1
	movq	%rax, %xmm0
	divsd	%xmm1, %xmm0
	addsd	-24(%rbp), %xmm0
	movslq	%ebx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	A(%rip), %rax
	movsd	%xmm0, (%rdx,%rax)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L3:
	movl	M(%rip), %eax
	leal	-1(%rax), %edx
	movl	i(%rip), %eax
	cmpl	%eax, %edx
	jg	.L4
	movl	c(%rip), %eax
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	movl	%eax, %ebx
	movslq	%ebx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	A(%rip), %rax
	movsd	(%rdx,%rax), %xmm4
	movsd	%xmm4, -24(%rbp)
	movl	s(%rip), %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	movsd	.LC4(%rip), %xmm0
	subsd	%xmm1, %xmm0
	movsd	.LC1(%rip), %xmm2
	movapd	%xmm0, %xmm1
	divsd	%xmm2, %xmm1
	movsd	.LC2(%rip), %xmm0
	mulsd	%xmm0, %xmm1
	movq	%xmm1, %rax
	movq	%rax, %xmm0
	call	sin@PLT
	movq	%xmm0, %rax
	movsd	.LC3(%rip), %xmm1
	movq	%rax, %xmm0
	divsd	%xmm1, %xmm0
	addsd	-24(%rbp), %xmm0
	movslq	%ebx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	A(%rip), %rax
	movsd	%xmm0, (%rdx,%rax)
	movsd	A(%rip), %xmm0
	pxor	%xmm1, %xmm1
	comisd	%xmm1, %xmm0
	jbe	.L5
	movsd	8+A(%rip), %xmm0
	pxor	%xmm1, %xmm1
	comisd	%xmm1, %xmm0
	jbe	.L5
	movsd	A(%rip), %xmm0
	movsd	8+A(%rip), %xmm1
	ucomisd	%xmm1, %xmm0
	jp	.L8
	ucomisd	%xmm1, %xmm0
	jne	.L8
	leaq	.LC6(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L10
.L8:
	movsd	A(%rip), %xmm0
	movsd	8+A(%rip), %xmm1
	comisd	%xmm1, %xmm0
	jbe	.L19
	leaq	.LC7(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L10
.L19:
	leaq	.LC8(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L10:
	pxor	%xmm0, %xmm0
	movsd	%xmm0, 8+A(%rip)
	movsd	8+A(%rip), %xmm0
	movsd	%xmm0, A(%rip)
.L5:
	movl	c(%rip), %eax
	addl	$1, %eax
	movl	%eax, c(%rip)
.L2:
	leaq	M(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	M(%rip), %eax
	testl	%eax, %eax
	jne	.L13
	movl	$0, %eax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC1:
	.long	0
	.long	1080459264
	.align 8
.LC2:
	.long	1405670641
	.long	1074340347
	.align 8
.LC3:
	.long	0
	.long	1073741824
	.align 8
.LC4:
	.long	0
	.long	1081507840
	.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
.LC1:
	.string	"%d"
.LC7:
	.string	"0"
.LC8:
	.string	"1"
.LC9:
	.string	"2"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%r15d, %r15d
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	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
	leaq	A(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	.p2align 4,,10
	.p2align 3
.L2:
	leaq	M(%rip), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	movl	%r15d, c(%rip)
	call	__isoc99_scanf@PLT
	movl	M(%rip), %eax
	testl	%eax, %eax
	je	.L23
	movl	$0, s(%rip)
	movl	$0, i(%rip)
	cmpl	$1, %eax
	jle	.L3
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	a(%rip), %eax
	pxor	%xmm0, %xmm0
	movl	c(%rip), %r15d
	movl	s(%rip), %r14d
	cvtsi2sdl	%eax, %xmm0
	divsd	.LC2(%rip), %xmm0
	movl	%r15d, %edx
	mulsd	.LC3(%rip), %xmm0
	shrl	$31, %edx
	addl	%eax, %r14d
	leal	(%r15,%rdx), %ebx
	movl	%r14d, s(%rip)
	andl	$1, %ebx
	subl	%edx, %ebx
	call	sin@PLT
	movsd	.LC4(%rip), %xmm1
	movslq	%ebx, %rax
	movl	M(%rip), %ecx
	mulsd	%xmm0, %xmm1
	leal	-1(%rcx), %edx
	addsd	0(%rbp,%rax,8), %xmm1
	movsd	%xmm1, 0(%rbp,%rax,8)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
	cmpl	%edx, %eax
	jl	.L4
	pxor	%xmm2, %xmm2
	movsd	.LC5(%rip), %xmm0
	movsd	%xmm1, 8(%rsp)
	cvtsi2sdl	%r14d, %xmm2
	subsd	%xmm2, %xmm0
	divsd	.LC2(%rip), %xmm0
	mulsd	.LC3(%rip), %xmm0
	call	sin@PLT
	mulsd	.LC4(%rip), %xmm0
	movsd	8(%rsp), %xmm1
.L5:
	addsd	%xmm0, %xmm1
	movslq	%ebx, %rbx
	pxor	%xmm0, %xmm0
	movsd	%xmm1, 0(%rbp,%rbx,8)
	movsd	0(%rbp), %xmm1
	comisd	%xmm0, %xmm1
	jbe	.L6
	movsd	8+A(%rip), %xmm2
	comisd	%xmm0, %xmm2
	jbe	.L6
	ucomisd	%xmm2, %xmm1
	jp	.L9
	je	.L24
.L9:
	comisd	%xmm2, %xmm1
	jbe	.L20
	leaq	.LC8(%rip), %rdi
	call	puts@PLT
.L11:
	pxor	%xmm0, %xmm0
	movl	c(%rip), %r15d
	movaps	%xmm0, 0(%rbp)
.L6:
	addl	$1, %r15d
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L23:
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
	.p2align 4,,10
	.p2align 3
.L20:
	.cfi_restore_state
	leaq	.LC9(%rip), %rdi
	call	puts@PLT
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L24:
	leaq	.LC7(%rip), %rdi
	call	puts@PLT
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L3:
	movl	c(%rip), %r15d
	movl	%r15d, %eax
	shrl	$31, %eax
	leal	(%r15,%rax), %ebx
	andl	$1, %ebx
	subl	%eax, %ebx
	movslq	%ebx, %rax
	movsd	0(%rbp,%rax,8), %xmm1
	movq	.LC0(%rip), %rax
	movq	%rax, %xmm0
	jmp	.L5
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	s
	.bss
	.align 4
	.type	s, @object
	.size	s, 4
s:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	c
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	M
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	A
	.align 16
	.type	A, @object
	.size	A, 16
A:
	.zero	16
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC0:
	.long	-777640397
	.long	-1104226807
	.align 8
.LC2:
	.long	0
	.long	1080459264
	.align 8
.LC3:
	.long	1405670641
	.long	1074340347
	.align 8
.LC4:
	.long	0
	.long	1071644672
	.align 8
.LC5:
	.long	0
	.long	1081507840
	.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
.LC1:
	.string	"%d"
.LC7:
	.string	"0"
.LC8:
	.string	"1"
.LC9:
	.string	"2"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%r15d, %r15d
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	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
	leaq	A(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	.p2align 4,,10
	.p2align 3
.L2:
	leaq	M(%rip), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	movl	%r15d, c(%rip)
	call	__isoc99_scanf@PLT
	movl	M(%rip), %eax
	testl	%eax, %eax
	je	.L23
	movl	$0, s(%rip)
	movl	$0, i(%rip)
	cmpl	$1, %eax
	jle	.L3
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	a(%rip), %eax
	pxor	%xmm0, %xmm0
	movl	c(%rip), %r15d
	movl	s(%rip), %r14d
	cvtsi2sdl	%eax, %xmm0
	divsd	.LC2(%rip), %xmm0
	movl	%r15d, %edx
	mulsd	.LC3(%rip), %xmm0
	shrl	$31, %edx
	addl	%eax, %r14d
	leal	(%r15,%rdx), %ebx
	movl	%r14d, s(%rip)
	andl	$1, %ebx
	subl	%edx, %ebx
	call	sin@PLT
	movsd	.LC4(%rip), %xmm1
	movslq	%ebx, %rax
	movl	M(%rip), %ecx
	mulsd	%xmm0, %xmm1
	leal	-1(%rcx), %edx
	addsd	0(%rbp,%rax,8), %xmm1
	movsd	%xmm1, 0(%rbp,%rax,8)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
	cmpl	%edx, %eax
	jl	.L4
	pxor	%xmm2, %xmm2
	movsd	.LC5(%rip), %xmm0
	movsd	%xmm1, 8(%rsp)
	cvtsi2sdl	%r14d, %xmm2
	subsd	%xmm2, %xmm0
	divsd	.LC2(%rip), %xmm0
	mulsd	.LC3(%rip), %xmm0
	call	sin@PLT
	mulsd	.LC4(%rip), %xmm0
	movsd	8(%rsp), %xmm1
.L5:
	addsd	%xmm0, %xmm1
	movslq	%ebx, %rbx
	pxor	%xmm0, %xmm0
	movsd	%xmm1, 0(%rbp,%rbx,8)
	movsd	0(%rbp), %xmm1
	comisd	%xmm0, %xmm1
	jbe	.L6
	movsd	8+A(%rip), %xmm2
	comisd	%xmm0, %xmm2
	jbe	.L6
	ucomisd	%xmm2, %xmm1
	jp	.L9
	je	.L24
.L9:
	comisd	%xmm2, %xmm1
	jbe	.L20
	leaq	.LC8(%rip), %rdi
	call	puts@PLT
.L11:
	pxor	%xmm0, %xmm0
	movl	c(%rip), %r15d
	movaps	%xmm0, 0(%rbp)
.L6:
	addl	$1, %r15d
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L23:
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
	.p2align 4,,10
	.p2align 3
.L20:
	.cfi_restore_state
	leaq	.LC9(%rip), %rdi
	call	puts@PLT
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L24:
	leaq	.LC7(%rip), %rdi
	call	puts@PLT
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L3:
	movl	c(%rip), %r15d
	movl	%r15d, %eax
	shrl	$31, %eax
	leal	(%r15,%rax), %ebx
	andl	$1, %ebx
	subl	%eax, %ebx
	movslq	%ebx, %rax
	movsd	0(%rbp,%rax,8), %xmm1
	movq	.LC0(%rip), %rax
	movq	%rax, %xmm0
	jmp	.L5
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	s
	.bss
	.align 4
	.type	s, @object
	.size	s, 4
s:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	c
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	M
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	A
	.align 16
	.type	A, @object
	.size	A, 16
A:
	.zero	16
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC0:
	.long	-777640397
	.long	-1104226807
	.align 8
.LC2:
	.long	0
	.long	1080459264
	.align 8
.LC3:
	.long	1405670641
	.long	1074340347
	.align 8
.LC4:
	.long	0
	.long	1071644672
	.align 8
.LC5:
	.long	0
	.long	1081507840
	.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.14159265
#define EPS 0.000001
double A[2]={0,0};
int M,i,j,c,a,s;
int main()
{
	for(c=0;scanf("%d",&M),M;c++)
	{
		for(i=s=0;i<M-1;i++)
		{
			scanf("%d",&a);
			s+=a;
			A[c%2]+=sin(PI*((double)a/180))/2;
		}
		A[c%2]+=sin(PI*((360.0-s)/180))/2;
		if(A[0]>0&&A[1]>0)
		{
			if(A[0]==A[1])puts("0");
			else if(A[0]>A[1])puts("1");
			else puts("2");
			A[0]=A[1]=0;
		}
	}
	return 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
1
2
 2
2
1
 2
2
2
 1
2
1

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.14159265
#define EPS 0.000001
double A[2]={0,0};
int M,i,j,c,a,s;
int main()
{
	for(c=0;scanf("%d",&M),M;c++)
	{
		for(i=s=0;i<M-1;i++)
		{
			scanf("%d",&a);
			s+=a;
			A[c%2]+=sin(PI*((double)a/180))/2;
		}
		A[c%2]+=sin(PI*((360.0-s)/180))/2;
		if(A[0]>0&&A[1]>0)
		{
			if(A[0]==A[1])puts("0");
			else if(A[0]>A[1])puts("1");
			else puts("2");
			A[0]=A[1]=0;
		}
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	A
	.bss
	.align 16
	.type	A, @object
	.size	A, 16
A:
	.zero	16
	.globl	M
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	c
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	s
	.align 4
	.type	s, @object
	.size	s, 4
s:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d"
.LC6:
	.string	"0"
.LC7:
	.string	"1"
.LC8:
	.string	"2"
	.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
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 3, -24
	movl	$0, c(%rip)
	jmp	.L2
.L13:
	movl	$0, s(%rip)
	movl	s(%rip), %eax
	movl	%eax, i(%rip)
	jmp	.L3
.L4:
	leaq	a(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	s(%rip), %edx
	movl	a(%rip), %eax
	addl	%edx, %eax
	movl	%eax, s(%rip)
	movl	c(%rip), %eax
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	movl	%eax, %ebx
	movslq	%ebx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	A(%rip), %rax
	movsd	(%rdx,%rax), %xmm3
	movsd	%xmm3, -24(%rbp)
	movl	a(%rip), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movsd	.LC1(%rip), %xmm2
	movapd	%xmm0, %xmm1
	divsd	%xmm2, %xmm1
	movsd	.LC2(%rip), %xmm0
	mulsd	%xmm0, %xmm1
	movq	%xmm1, %rax
	movq	%rax, %xmm0
	call	sin@PLT
	movq	%xmm0, %rax
	movsd	.LC3(%rip), %xmm1
	movq	%rax, %xmm0
	divsd	%xmm1, %xmm0
	addsd	-24(%rbp), %xmm0
	movslq	%ebx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	A(%rip), %rax
	movsd	%xmm0, (%rdx,%rax)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L3:
	movl	M(%rip), %eax
	leal	-1(%rax), %edx
	movl	i(%rip), %eax
	cmpl	%eax, %edx
	jg	.L4
	movl	c(%rip), %eax
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	movl	%eax, %ebx
	movslq	%ebx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	A(%rip), %rax
	movsd	(%rdx,%rax), %xmm4
	movsd	%xmm4, -24(%rbp)
	movl	s(%rip), %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	movsd	.LC4(%rip), %xmm0
	subsd	%xmm1, %xmm0
	movsd	.LC1(%rip), %xmm2
	movapd	%xmm0, %xmm1
	divsd	%xmm2, %xmm1
	movsd	.LC2(%rip), %xmm0
	mulsd	%xmm0, %xmm1
	movq	%xmm1, %rax
	movq	%rax, %xmm0
	call	sin@PLT
	movq	%xmm0, %rax
	movsd	.LC3(%rip), %xmm1
	movq	%rax, %xmm0
	divsd	%xmm1, %xmm0
	addsd	-24(%rbp), %xmm0
	movslq	%ebx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	A(%rip), %rax
	movsd	%xmm0, (%rdx,%rax)
	movsd	A(%rip), %xmm0
	pxor	%xmm1, %xmm1
	comisd	%xmm1, %xmm0
	jbe	.L5
	movsd	8+A(%rip), %xmm0
	pxor	%xmm1, %xmm1
	comisd	%xmm1, %xmm0
	jbe	.L5
	movsd	A(%rip), %xmm0
	movsd	8+A(%rip), %xmm1
	ucomisd	%xmm1, %xmm0
	jp	.L8
	ucomisd	%xmm1, %xmm0
	jne	.L8
	leaq	.LC6(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L10
.L8:
	movsd	A(%rip), %xmm0
	movsd	8+A(%rip), %xmm1
	comisd	%xmm1, %xmm0
	jbe	.L19
	leaq	.LC7(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L10
.L19:
	leaq	.LC8(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L10:
	pxor	%xmm0, %xmm0
	movsd	%xmm0, 8+A(%rip)
	movsd	8+A(%rip), %xmm0
	movsd	%xmm0, A(%rip)
.L5:
	movl	c(%rip), %eax
	addl	$1, %eax
	movl	%eax, c(%rip)
.L2:
	leaq	M(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	M(%rip), %eax
	testl	%eax, %eax
	jne	.L13
	movl	$0, %eax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC1:
	.long	0
	.long	1080459264
	.align 8
.LC2:
	.long	1405670641
	.long	1074340347
	.align 8
.LC3:
	.long	0
	.long	1073741824
	.align 8
.LC4:
	.long	0
	.long	1081507840
	.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 16
	.type	A, @object
	.size	A, 16
A:
	.zero	16
	.globl	M
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	c
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	s
	.align 4
	.type	s, @object
	.size	s, 4
s:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d"
.LC6:
	.string	"0"
.LC7:
	.string	"1"
.LC8:
	.string	"2"
	.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
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 3, -24
	movl	$0, c(%rip)
	jmp	.L2
.L13:
	movl	$0, s(%rip)
	movl	s(%rip), %eax
	movl	%eax, i(%rip)
	jmp	.L3
.L4:
	leaq	a(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	s(%rip), %edx
	movl	a(%rip), %eax
	addl	%edx, %eax
	movl	%eax, s(%rip)
	movl	c(%rip), %eax
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	movl	%eax, %ebx
	movslq	%ebx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	A(%rip), %rax
	movsd	(%rdx,%rax), %xmm3
	movsd	%xmm3, -24(%rbp)
	movl	a(%rip), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movsd	.LC1(%rip), %xmm2
	movapd	%xmm0, %xmm1
	divsd	%xmm2, %xmm1
	movsd	.LC2(%rip), %xmm0
	mulsd	%xmm0, %xmm1
	movq	%xmm1, %rax
	movq	%rax, %xmm0
	call	sin@PLT
	movq	%xmm0, %rax
	movsd	.LC3(%rip), %xmm1
	movq	%rax, %xmm0
	divsd	%xmm1, %xmm0
	addsd	-24(%rbp), %xmm0
	movslq	%ebx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	A(%rip), %rax
	movsd	%xmm0, (%rdx,%rax)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L3:
	movl	M(%rip), %eax
	leal	-1(%rax), %edx
	movl	i(%rip), %eax
	cmpl	%eax, %edx
	jg	.L4
	movl	c(%rip), %eax
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	movl	%eax, %ebx
	movslq	%ebx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	A(%rip), %rax
	movsd	(%rdx,%rax), %xmm4
	movsd	%xmm4, -24(%rbp)
	movl	s(%rip), %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	movsd	.LC4(%rip), %xmm0
	subsd	%xmm1, %xmm0
	movsd	.LC1(%rip), %xmm2
	movapd	%xmm0, %xmm1
	divsd	%xmm2, %xmm1
	movsd	.LC2(%rip), %xmm0
	mulsd	%xmm0, %xmm1
	movq	%xmm1, %rax
	movq	%rax, %xmm0
	call	sin@PLT
	movq	%xmm0, %rax
	movsd	.LC3(%rip), %xmm1
	movq	%rax, %xmm0
	divsd	%xmm1, %xmm0
	addsd	-24(%rbp), %xmm0
	movslq	%ebx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	A(%rip), %rax
	movsd	%xmm0, (%rdx,%rax)
	movsd	A(%rip), %xmm0
	pxor	%xmm1, %xmm1
	comisd	%xmm1, %xmm0
	jbe	.L5
	movsd	8+A(%rip), %xmm0
	pxor	%xmm1, %xmm1
	comisd	%xmm1, %xmm0
	jbe	.L5
	movsd	A(%rip), %xmm0
	movsd	8+A(%rip), %xmm1
	ucomisd	%xmm1, %xmm0
	jp	.L8
	ucomisd	%xmm1, %xmm0
	jne	.L8
	leaq	.LC6(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L10
.L8:
	movsd	A(%rip), %xmm0
	movsd	8+A(%rip), %xmm1
	comisd	%xmm1, %xmm0
	jbe	.L19
	leaq	.LC7(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L10
.L19:
	leaq	.LC8(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L10:
	pxor	%xmm0, %xmm0
	movsd	%xmm0, 8+A(%rip)
	movsd	8+A(%rip), %xmm0
	movsd	%xmm0, A(%rip)
.L5:
	movl	c(%rip), %eax
	addl	$1, %eax
	movl	%eax, c(%rip)
.L2:
	leaq	M(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	M(%rip), %eax
	testl	%eax, %eax
	jne	.L13
	movl	$0, %eax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC1:
	.long	0
	.long	1080459264
	.align 8
.LC2:
	.long	1405670641
	.long	1074340347
	.align 8
.LC3:
	.long	0
	.long	1073741824
	.align 8
.LC4:
	.long	0
	.long	1081507840
	.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:
