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>
int main(){
    int n,d,c=0;
    double x,y;
    scanf("%i%i",&n,&d);
    for(int i=0;i<n;i++){
        scanf("%lf%lf",&x,&y);
        if(d>=sqrt(x*x + y*y))
            c++;
    }
    printf("%i\n",c);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%i%i"
.LC1:
	.string	"%lf%lf"
.LC2:
	.string	"%i\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	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -32(%rbp)
	leaq	-36(%rbp), %rdx
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -28(%rbp)
	jmp	.L2
.L5:
	leaq	-16(%rbp), %rdx
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-36(%rbp), %eax
	pxor	%xmm3, %xmm3
	cvtsi2sdl	%eax, %xmm3
	movsd	%xmm3, -56(%rbp)
	movsd	-24(%rbp), %xmm1
	movsd	-24(%rbp), %xmm0
	mulsd	%xmm0, %xmm1
	movsd	-16(%rbp), %xmm2
	movsd	-16(%rbp), %xmm0
	mulsd	%xmm2, %xmm0
	addsd	%xmm0, %xmm1
	movq	%xmm1, %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	movsd	-56(%rbp), %xmm3
	comisd	%xmm0, %xmm3
	jb	.L3
	addl	$1, -32(%rbp)
.L3:
	addl	$1, -28(%rbp)
.L2:
	movl	-40(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L5
	movl	-32(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L7
	call	__stack_chk_fail@PLT
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.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	"%i%i"
.LC1:
	.string	"%lf%lf"
.LC3:
	.string	"%i\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$48, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rdx
	leaq	16(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %eax
	testl	%eax, %eax
	jle	.L10
	xorl	%ebx, %ebx
	leaq	32(%rsp), %r14
	leaq	24(%rsp), %r13
	xorl	%r12d, %r12d
	leaq	.LC1(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L8:
	xorl	%eax, %eax
	movq	%r14, %rdx
	movq	%r13, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	movsd	24(%rsp), %xmm0
	movsd	32(%rsp), %xmm1
	pxor	%xmm3, %xmm3
	pxor	%xmm2, %xmm2
	mulsd	%xmm0, %xmm0
	cvtsi2sdl	20(%rsp), %xmm2
	mulsd	%xmm1, %xmm1
	addsd	%xmm1, %xmm0
	ucomisd	%xmm0, %xmm3
	ja	.L14
	sqrtsd	%xmm0, %xmm0
.L5:
	comisd	%xmm0, %xmm2
	sbbl	$-1, %r12d
	addl	$1, %ebx
	cmpl	%ebx, 16(%rsp)
	jg	.L8
.L2:
	xorl	%eax, %eax
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC3(%rip), %rsi
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$48, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L10:
	.cfi_restore_state
	xorl	%r12d, %r12d
	jmp	.L2
.L14:
	movsd	%xmm2, 8(%rsp)
	call	sqrt@PLT
	movsd	8(%rsp), %xmm2
	jmp	.L5
.L17:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.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	"%i%i"
.LC1:
	.string	"%lf%lf"
.LC3:
	.string	"%i\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$48, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rdx
	leaq	16(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %eax
	testl	%eax, %eax
	jle	.L10
	xorl	%ebx, %ebx
	leaq	32(%rsp), %r14
	leaq	24(%rsp), %r13
	xorl	%r12d, %r12d
	leaq	.LC1(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L8:
	xorl	%eax, %eax
	movq	%r14, %rdx
	movq	%r13, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	movsd	24(%rsp), %xmm0
	movsd	32(%rsp), %xmm1
	pxor	%xmm3, %xmm3
	pxor	%xmm2, %xmm2
	mulsd	%xmm0, %xmm0
	cvtsi2sdl	20(%rsp), %xmm2
	mulsd	%xmm1, %xmm1
	addsd	%xmm1, %xmm0
	ucomisd	%xmm0, %xmm3
	ja	.L14
	sqrtsd	%xmm0, %xmm0
.L5:
	comisd	%xmm0, %xmm2
	sbbl	$-1, %r12d
	addl	$1, %ebx
	cmpl	%ebx, 16(%rsp)
	jg	.L8
.L2:
	xorl	%eax, %eax
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC3(%rip), %rsi
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$48, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L10:
	.cfi_restore_state
	xorl	%r12d, %r12d
	jmp	.L2
.L14:
	movsd	%xmm2, 8(%rsp)
	call	sqrt@PLT
	movsd	8(%rsp), %xmm2
	jmp	.L5
.L17:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.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>
int main(){
    int n,d,c=0;
    double x,y;
    scanf("%i%i",&n,&d);
    for(int i=0;i<n;i++){
        scanf("%lf%lf",&x,&y);
        if(d>=sqrt(x*x + y*y))
            c++;
    }
    printf("%i\n",c);
}
12 3
1 1
1 1
1 1
1 1
0 2
1 3
2 1
2 2
2 3
3 1
3 2
3 3
 4 5
0 5
-2 4
3 4
4 -2
 20 100000
14309 -32939
-56855 100340
151364 25430
103789 -113141
147404 -136977
-37006 -30929
191679 -49557
13419 70401
-88280 165170
-196399 137941
-176527 -61904
46659 115261
-153551 114185
98784 -6820
94111 -86268
-30401 61477
-55056 7872
5901 -163796
138819 -185986
-69848 -96669
 4 5
1 5
-2 4
3 1
4 -1
 3 5
0 5
-2 4
5 1
4 -2
 12 2
0 1
2 2
1 1
1 2
0 2
0 4
2 1
2 0
2 0
3 1
3 2
1 3
 12 4
0 1
2 2
1 1
1 2
0 2
0 4
2 1
2 0
2 0
3 1
3 2
1 3
 12 0
0 2
2 2
1 1
1 2
0 2
0 4
2 1
2 0
2 1
3 2
3 2
1 3
 12 3
1 1
1 1
1 1
1 1
1 2
1 3
2 1
2 2
2 3
2 1
3 2
3 3
 1 5
0 5
-2 4
3 1
4 -2

7
 4
 6
 3
 2
 5
 12
 0
 8
 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>
int main(){
    int n,d,c=0;
    double x,y;
    scanf("%i%i",&n,&d);
    for(int i=0;i<n;i++){
        scanf("%lf%lf",&x,&y);
        if(d>=sqrt(x*x + y*y))
            c++;
    }
    printf("%i\n",c);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%i%i"
.LC1:
	.string	"%lf%lf"
.LC2:
	.string	"%i\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	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -32(%rbp)
	leaq	-36(%rbp), %rdx
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -28(%rbp)
	jmp	.L2
.L5:
	leaq	-16(%rbp), %rdx
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-36(%rbp), %eax
	pxor	%xmm3, %xmm3
	cvtsi2sdl	%eax, %xmm3
	movsd	%xmm3, -56(%rbp)
	movsd	-24(%rbp), %xmm1
	movsd	-24(%rbp), %xmm0
	mulsd	%xmm0, %xmm1
	movsd	-16(%rbp), %xmm2
	movsd	-16(%rbp), %xmm0
	mulsd	%xmm2, %xmm0
	addsd	%xmm0, %xmm1
	movq	%xmm1, %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	movsd	-56(%rbp), %xmm3
	comisd	%xmm0, %xmm3
	jb	.L3
	addl	$1, -32(%rbp)
.L3:
	addl	$1, -28(%rbp)
.L2:
	movl	-40(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L5
	movl	-32(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L7
	call	__stack_chk_fail@PLT
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.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	"%i%i"
.LC1:
	.string	"%lf%lf"
.LC2:
	.string	"%i\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	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -32(%rbp)
	leaq	-36(%rbp), %rdx
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -28(%rbp)
	jmp	.L2
.L5:
	leaq	-16(%rbp), %rdx
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-36(%rbp), %eax
	pxor	%xmm3, %xmm3
	cvtsi2sdl	%eax, %xmm3
	movsd	%xmm3, -56(%rbp)
	movsd	-24(%rbp), %xmm1
	movsd	-24(%rbp), %xmm0
	mulsd	%xmm0, %xmm1
	movsd	-16(%rbp), %xmm2
	movsd	-16(%rbp), %xmm0
	mulsd	%xmm2, %xmm0
	addsd	%xmm0, %xmm1
	movq	%xmm1, %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	movsd	-56(%rbp), %xmm3
	comisd	%xmm0, %xmm3
	jb	.L3
	addl	$1, -32(%rbp)
.L3:
	addl	$1, -28(%rbp)
.L2:
	movl	-40(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L5
	movl	-32(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L7
	call	__stack_chk_fail@PLT
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.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:
