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()
{
    double N, P;
    double i;
    fscanf(stdin, "%lf %lf", &N, &P);
    double h,j;
    double iptr;
    h = pow(P, 1/N);
    i = modf(h, &iptr);
    for(i = iptr+1; i >= 1; i -= 1){
        j = pow(i , N);
        if( fmod(P, j) == 0 ){
            break;
        }
    }

    fprintf(stdout, "%.0lf\n", i);

    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%lf %lf"
.LC3:
	.string	"%.0lf\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
	movq	stdin(%rip), %rax
	leaq	-48(%rbp), %rcx
	leaq	-56(%rbp), %rdx
	leaq	.LC0(%rip), %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_fscanf@PLT
	movsd	-56(%rbp), %xmm1
	movsd	.LC1(%rip), %xmm0
	divsd	%xmm1, %xmm0
	movq	-48(%rbp), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movq	%xmm0, %rax
	movq	%rax, -24(%rbp)
	leaq	-40(%rbp), %rdx
	movq	-24(%rbp), %rax
	movq	%rdx, %rdi
	movq	%rax, %xmm0
	call	modf@PLT
	movq	%xmm0, %rax
	movq	%rax, -32(%rbp)
	movsd	-40(%rbp), %xmm1
	movsd	.LC1(%rip), %xmm0
	addsd	%xmm1, %xmm0
	movsd	%xmm0, -32(%rbp)
	jmp	.L2
.L6:
	movsd	-56(%rbp), %xmm0
	movq	-32(%rbp), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movq	%xmm0, %rax
	movq	%rax, -16(%rbp)
	movq	-48(%rbp), %rax
	movsd	-16(%rbp), %xmm0
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	fmod@PLT
	movq	%xmm0, %rax
	pxor	%xmm0, %xmm0
	movq	%rax, %xmm2
	ucomisd	%xmm0, %xmm2
	jp	.L3
	pxor	%xmm0, %xmm0
	movq	%rax, %xmm3
	ucomisd	%xmm0, %xmm3
	je	.L9
.L3:
	movsd	-32(%rbp), %xmm0
	movsd	.LC1(%rip), %xmm1
	subsd	%xmm1, %xmm0
	movsd	%xmm0, -32(%rbp)
.L2:
	movsd	-32(%rbp), %xmm0
	movsd	.LC1(%rip), %xmm1
	comisd	%xmm1, %xmm0
	jnb	.L6
	jmp	.L5
.L9:
	nop
.L5:
	movq	stdout(%rip), %rax
	movq	-32(%rbp), %rdx
	movq	%rdx, %xmm0
	leaq	.LC3(%rip), %rdx
	movq	%rdx, %rsi
	movq	%rax, %rdi
	movl	$1, %eax
	call	fprintf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC1:
	.long	0
	.long	1072693248
	.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	"%lf %lf"
.LC3:
	.string	"%.0lf\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	.LC0(%rip), %rsi
	subq	$48, %rsp
	.cfi_def_cfa_offset 64
	movq	stdin(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rcx
	leaq	16(%rsp), %rdx
	call	__isoc99_fscanf@PLT
	movsd	16(%rsp), %xmm4
	movsd	.LC1(%rip), %xmm1
	movsd	24(%rsp), %xmm0
	divsd	%xmm4, %xmm1
	movsd	%xmm4, 8(%rsp)
	movq	%xmm0, %rbx
	call	pow@PLT
	leaq	32(%rsp), %rdi
	call	modf@PLT
	movsd	.LC1(%rip), %xmm2
	addsd	32(%rsp), %xmm2
	comisd	.LC1(%rip), %xmm2
	jnb	.L5
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L7:
	subsd	.LC1(%rip), %xmm2
	comisd	.LC1(%rip), %xmm2
	jb	.L2
.L5:
	movsd	8(%rsp), %xmm1
	movapd	%xmm2, %xmm0
	movsd	%xmm2, (%rsp)
	call	pow@PLT
	movapd	%xmm0, %xmm1
	movq	%rbx, %xmm0
	call	fmod@PLT
	pxor	%xmm3, %xmm3
	movsd	(%rsp), %xmm2
	ucomisd	%xmm3, %xmm0
	jp	.L7
	jne	.L7
.L2:
	movq	stdout(%rip), %rdi
	movapd	%xmm2, %xmm0
	movl	$1, %esi
	leaq	.LC3(%rip), %rdx
	movl	$1, %eax
	call	__fprintf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L12
	addq	$48, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
.L12:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.long	0
	.long	1072693248
	.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	"%lf %lf"
.LC3:
	.string	"%.0lf\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	.LC0(%rip), %rsi
	subq	$48, %rsp
	.cfi_def_cfa_offset 64
	movq	stdin(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rcx
	leaq	16(%rsp), %rdx
	call	__isoc99_fscanf@PLT
	movsd	16(%rsp), %xmm4
	movsd	.LC1(%rip), %xmm1
	movsd	24(%rsp), %xmm0
	divsd	%xmm4, %xmm1
	movsd	%xmm4, 8(%rsp)
	movq	%xmm0, %rbx
	call	pow@PLT
	leaq	32(%rsp), %rdi
	call	modf@PLT
	movsd	.LC1(%rip), %xmm2
	addsd	32(%rsp), %xmm2
	comisd	.LC1(%rip), %xmm2
	jnb	.L5
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L7:
	subsd	.LC1(%rip), %xmm2
	comisd	.LC1(%rip), %xmm2
	jb	.L2
.L5:
	movsd	8(%rsp), %xmm1
	movapd	%xmm2, %xmm0
	movsd	%xmm2, (%rsp)
	call	pow@PLT
	movapd	%xmm0, %xmm1
	movq	%rbx, %xmm0
	call	fmod@PLT
	pxor	%xmm3, %xmm3
	movsd	(%rsp), %xmm2
	ucomisd	%xmm3, %xmm0
	jp	.L7
	jne	.L7
.L2:
	movq	stdout(%rip), %rdi
	movapd	%xmm2, %xmm0
	movl	$1, %esi
	leaq	.LC3(%rip), %rdx
	movl	$1, %eax
	call	__fprintf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L12
	addq	$48, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
.L12:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.long	0
	.long	1072693248
	.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()
{
    double N, P;
    double i;
    fscanf(stdin, "%lf %lf", &N, &P);
    double h,j;
    double iptr;
    h = pow(P, 1/N);
    i = modf(h, &iptr);
    for(i = iptr+1; i >= 1; i -= 1){
        j = pow(i , N);
        if( fmod(P, j) == 0 ){
            break;
        }
    }

    fprintf(stdout, "%.0lf\n", i);

    return 0;
}
5 2
 1 972439611840
 1 110
 1 2
 1 534720932937
 1 18
 1 010
 1 3
 1 867963093279
 1 15

1
 972439611840
 110
 2
 534720932937
 18
 10
 3
 867963093279
 15

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()
{
    double N, P;
    double i;
    fscanf(stdin, "%lf %lf", &N, &P);
    double h,j;
    double iptr;
    h = pow(P, 1/N);
    i = modf(h, &iptr);
    for(i = iptr+1; i >= 1; i -= 1){
        j = pow(i , N);
        if( fmod(P, j) == 0 ){
            break;
        }
    }

    fprintf(stdout, "%.0lf\n", i);

    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%lf %lf"
.LC3:
	.string	"%.0lf\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
	movq	stdin(%rip), %rax
	leaq	-48(%rbp), %rcx
	leaq	-56(%rbp), %rdx
	leaq	.LC0(%rip), %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_fscanf@PLT
	movsd	-56(%rbp), %xmm1
	movsd	.LC1(%rip), %xmm0
	divsd	%xmm1, %xmm0
	movq	-48(%rbp), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movq	%xmm0, %rax
	movq	%rax, -24(%rbp)
	leaq	-40(%rbp), %rdx
	movq	-24(%rbp), %rax
	movq	%rdx, %rdi
	movq	%rax, %xmm0
	call	modf@PLT
	movq	%xmm0, %rax
	movq	%rax, -32(%rbp)
	movsd	-40(%rbp), %xmm1
	movsd	.LC1(%rip), %xmm0
	addsd	%xmm1, %xmm0
	movsd	%xmm0, -32(%rbp)
	jmp	.L2
.L6:
	movsd	-56(%rbp), %xmm0
	movq	-32(%rbp), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movq	%xmm0, %rax
	movq	%rax, -16(%rbp)
	movq	-48(%rbp), %rax
	movsd	-16(%rbp), %xmm0
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	fmod@PLT
	movq	%xmm0, %rax
	pxor	%xmm0, %xmm0
	movq	%rax, %xmm2
	ucomisd	%xmm0, %xmm2
	jp	.L3
	pxor	%xmm0, %xmm0
	movq	%rax, %xmm3
	ucomisd	%xmm0, %xmm3
	je	.L9
.L3:
	movsd	-32(%rbp), %xmm0
	movsd	.LC1(%rip), %xmm1
	subsd	%xmm1, %xmm0
	movsd	%xmm0, -32(%rbp)
.L2:
	movsd	-32(%rbp), %xmm0
	movsd	.LC1(%rip), %xmm1
	comisd	%xmm1, %xmm0
	jnb	.L6
	jmp	.L5
.L9:
	nop
.L5:
	movq	stdout(%rip), %rax
	movq	-32(%rbp), %rdx
	movq	%rdx, %xmm0
	leaq	.LC3(%rip), %rdx
	movq	%rdx, %rsi
	movq	%rax, %rdi
	movl	$1, %eax
	call	fprintf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC1:
	.long	0
	.long	1072693248
	.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	"%lf %lf"
.LC3:
	.string	"%.0lf\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
	movq	stdin(%rip), %rax
	leaq	-48(%rbp), %rcx
	leaq	-56(%rbp), %rdx
	leaq	.LC0(%rip), %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_fscanf@PLT
	movsd	-56(%rbp), %xmm1
	movsd	.LC1(%rip), %xmm0
	divsd	%xmm1, %xmm0
	movq	-48(%rbp), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movq	%xmm0, %rax
	movq	%rax, -24(%rbp)
	leaq	-40(%rbp), %rdx
	movq	-24(%rbp), %rax
	movq	%rdx, %rdi
	movq	%rax, %xmm0
	call	modf@PLT
	movq	%xmm0, %rax
	movq	%rax, -32(%rbp)
	movsd	-40(%rbp), %xmm1
	movsd	.LC1(%rip), %xmm0
	addsd	%xmm1, %xmm0
	movsd	%xmm0, -32(%rbp)
	jmp	.L2
.L6:
	movsd	-56(%rbp), %xmm0
	movq	-32(%rbp), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movq	%xmm0, %rax
	movq	%rax, -16(%rbp)
	movq	-48(%rbp), %rax
	movsd	-16(%rbp), %xmm0
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	fmod@PLT
	movq	%xmm0, %rax
	pxor	%xmm0, %xmm0
	movq	%rax, %xmm2
	ucomisd	%xmm0, %xmm2
	jp	.L3
	pxor	%xmm0, %xmm0
	movq	%rax, %xmm3
	ucomisd	%xmm0, %xmm3
	je	.L9
.L3:
	movsd	-32(%rbp), %xmm0
	movsd	.LC1(%rip), %xmm1
	subsd	%xmm1, %xmm0
	movsd	%xmm0, -32(%rbp)
.L2:
	movsd	-32(%rbp), %xmm0
	movsd	.LC1(%rip), %xmm1
	comisd	%xmm1, %xmm0
	jnb	.L6
	jmp	.L5
.L9:
	nop
.L5:
	movq	stdout(%rip), %rax
	movq	-32(%rbp), %rdx
	movq	%rdx, %xmm0
	leaq	.LC3(%rip), %rdx
	movq	%rdx, %rsi
	movq	%rax, %rdi
	movl	$1, %eax
	call	fprintf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC1:
	.long	0
	.long	1072693248
	.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:
