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 STANDARD 22;

struct BodyData
{
	int number;
	double bmi;
	double ideal_body;
};

int main(void) {
	int n,h,w,flag;
	int i,j;
	double a;
	struct BodyData data[1000],*p,temp;

	p = data;
	while (1) {
		scanf("%d",&n);
		if (n == 0)break;
		for (i = 0; i < n; i++) {
			scanf("%d %d %d",&data[i].number,&h,&w);
			data[i].bmi = w / pow((double)h / 100, 2);
			a = data[i].bmi - STANDARD;
			data[i].ideal_body = fabs(a);
		}
	
		for (i = 0; i < n; i++) {
			for (j = i+1; j < n; j++) {
				flag = 0;
				if ((p + i)->ideal_body == (p + j)->ideal_body) {
					if ((p + i)->number > (p + j)->number)flag = 1;
				}
				else if ((p + i)->ideal_body > (p + j)->ideal_body)
					flag = 1;
				if (flag) {
					temp = *(p + i);
					*(p + i) = *(p + j);
					*(p + j) = temp;
				}
			}
		}
		printf("%d\n",p->number);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d %d"
.LC6:
	.string	"%d\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
	leaq	-20480(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3632, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-24016(%rbp), %rax
	movq	%rax, -24064(%rbp)
.L15:
	leaq	-24088(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24088(%rbp), %eax
	testl	%eax, %eax
	je	.L21
	movl	$0, -24072(%rbp)
	jmp	.L4
.L5:
	leaq	-24016(%rbp), %rcx
	movl	-24072(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	leaq	(%rcx,%rax), %rsi
	leaq	-24080(%rbp), %rdx
	leaq	-24084(%rbp), %rax
	movq	%rdx, %rcx
	movq	%rax, %rdx
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24080(%rbp), %eax
	pxor	%xmm2, %xmm2
	cvtsi2sdl	%eax, %xmm2
	movsd	%xmm2, -24104(%rbp)
	movl	-24084(%rbp), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movsd	.LC2(%rip), %xmm1
	movapd	%xmm0, %xmm3
	divsd	%xmm1, %xmm3
	movq	%xmm3, %rax
	movsd	.LC3(%rip), %xmm0
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movapd	%xmm0, %xmm1
	movsd	-24104(%rbp), %xmm0
	divsd	%xmm1, %xmm0
	movl	-24072(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rbp, %rax
	subq	$24008, %rax
	movsd	%xmm0, (%rax)
	movl	-24072(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rbp, %rax
	subq	$24008, %rax
	movsd	(%rax), %xmm0
	movsd	.LC4(%rip), %xmm1
	subsd	%xmm1, %xmm0
	movsd	%xmm0, -24056(%rbp)
	movsd	-24056(%rbp), %xmm0
	movq	.LC5(%rip), %xmm1
	andpd	%xmm1, %xmm0
	movl	-24072(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rbp, %rax
	subq	$24000, %rax
	movsd	%xmm0, (%rax)
	addl	$1, -24072(%rbp)
.L4:
	movl	-24088(%rbp), %eax
	cmpl	%eax, -24072(%rbp)
	jl	.L5
	movl	$0, -24072(%rbp)
	jmp	.L6
.L14:
	movl	-24072(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -24068(%rbp)
	jmp	.L7
.L13:
	movl	$0, -24076(%rbp)
	movl	-24072(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movq	-24064(%rbp), %rax
	addq	%rdx, %rax
	movsd	16(%rax), %xmm0
	movl	-24068(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movq	-24064(%rbp), %rax
	addq	%rdx, %rax
	movsd	16(%rax), %xmm1
	ucomisd	%xmm1, %xmm0
	jp	.L8
	ucomisd	%xmm1, %xmm0
	jne	.L8
	movl	-24072(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movq	-24064(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %ecx
	movl	-24068(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movq	-24064(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	jle	.L10
	movl	$1, -24076(%rbp)
	jmp	.L10
.L8:
	movl	-24072(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movq	-24064(%rbp), %rax
	addq	%rdx, %rax
	movsd	16(%rax), %xmm0
	movl	-24068(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movq	-24064(%rbp), %rax
	addq	%rdx, %rax
	movsd	16(%rax), %xmm1
	comisd	%xmm1, %xmm0
	jbe	.L10
	movl	$1, -24076(%rbp)
.L10:
	cmpl	$0, -24076(%rbp)
	je	.L12
	movl	-24072(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movq	-24064(%rbp), %rax
	leaq	(%rdx,%rax), %rcx
	movq	(%rcx), %rax
	movq	8(%rcx), %rdx
	movq	%rax, -24048(%rbp)
	movq	%rdx, -24040(%rbp)
	movq	16(%rcx), %rax
	movq	%rax, -24032(%rbp)
	movl	-24068(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movq	-24064(%rbp), %rax
	leaq	(%rdx,%rax), %rsi
	movl	-24072(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movq	-24064(%rbp), %rax
	leaq	(%rdx,%rax), %rcx
	movq	(%rsi), %rax
	movq	8(%rsi), %rdx
	movq	%rax, (%rcx)
	movq	%rdx, 8(%rcx)
	movq	16(%rsi), %rax
	movq	%rax, 16(%rcx)
	movl	-24068(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movq	-24064(%rbp), %rax
	leaq	(%rdx,%rax), %rcx
	movq	-24048(%rbp), %rax
	movq	-24040(%rbp), %rdx
	movq	%rax, (%rcx)
	movq	%rdx, 8(%rcx)
	movq	-24032(%rbp), %rax
	movq	%rax, 16(%rcx)
.L12:
	addl	$1, -24068(%rbp)
.L7:
	movl	-24088(%rbp), %eax
	cmpl	%eax, -24068(%rbp)
	jl	.L13
	addl	$1, -24072(%rbp)
.L6:
	movl	-24088(%rbp), %eax
	cmpl	%eax, -24072(%rbp)
	jl	.L14
	movq	-24064(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, %esi
	leaq	.LC6(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L15
.L21:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC2:
	.long	0
	.long	1079574528
	.align 8
.LC3:
	.long	0
	.long	1073741824
	.align 8
.LC4:
	.long	0
	.long	1077280768
	.align 16
.LC5:
	.long	-1
	.long	2147483647
	.long	0
	.long	0
	.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"
.LC1:
	.string	"%d %d %d"
.LC5:
	.string	"%d\n"
	.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
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-20480(%rsp), %r11
	.cfi_def_cfa 11, 20536
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3560, %rsp
	.cfi_def_cfa_offset 24096
	leaq	.LC1(%rip), %rbx
	movq	%fs:40, %rax
	movq	%rax, 24024(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L15:
	movq	%r12, %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	je	.L2
	jle	.L3
	leaq	16(%rsp), %rbp
	xorl	%r15d, %r15d
	leaq	12(%rsp), %r14
	leaq	8(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	movq	%r14, %rcx
	movq	%r13, %rdx
	xorl	%eax, %eax
	addl	$1, %r15d
	addq	$24, %rbp
	call	__isoc99_scanf@PLT
	pxor	%xmm1, %xmm1
	pxor	%xmm0, %xmm0
	movl	4(%rsp), %edi
	cvtsi2sdl	8(%rsp), %xmm1
	divsd	.LC2(%rip), %xmm1
	mulsd	%xmm1, %xmm1
	cvtsi2sdl	12(%rsp), %xmm0
	divsd	%xmm1, %xmm0
	movapd	%xmm0, %xmm1
	subsd	.LC3(%rip), %xmm1
	andpd	.LC4(%rip), %xmm1
	unpcklpd	%xmm1, %xmm0
	movups	%xmm0, -16(%rbp)
	cmpl	%r15d, %edi
	jg	.L4
	testl	%edi, %edi
	jle	.L3
	leaq	40(%rsp), %rdx
	movl	$1, %r9d
	cmpl	$1, %edi
	je	.L3
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%rdx, %rax
	movl	%r9d, %ecx
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L27:
	movl	-24(%rdx), %esi
	cmpl	(%rax), %esi
	jle	.L11
.L10:
	movdqu	(%rax), %xmm2
	movsd	-16(%rdx), %xmm1
	movups	%xmm2, -24(%rdx)
	movq	16(%rax), %r8
	unpcklpd	%xmm0, %xmm1
	movq	%r8, -8(%rdx)
	movl	%esi, (%rax)
	movups	%xmm1, 8(%rax)
.L11:
	addl	$1, %ecx
	addq	$24, %rax
	cmpl	%ecx, %edi
	jle	.L26
.L13:
	movsd	-8(%rdx), %xmm0
	movsd	16(%rax), %xmm1
	ucomisd	%xmm1, %xmm0
	jp	.L8
	je	.L27
.L8:
	comisd	%xmm1, %xmm0
	jbe	.L11
	movl	-24(%rdx), %esi
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L26:
	addl	$1, %r9d
	addq	$24, %rdx
	cmpl	%r9d, %edi
	jne	.L7
.L3:
	movl	16(%rsp), %edx
	leaq	.LC5(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L15
.L2:
	movq	24024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L28
	addq	$24040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	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
.L28:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC2:
	.long	0
	.long	1079574528
	.align 8
.LC3:
	.long	0
	.long	1077280768
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC4:
	.long	-1
	.long	2147483647
	.long	0
	.long	0
	.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"
.LC1:
	.string	"%d %d %d"
.LC5:
	.string	"%d\n"
	.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
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-20480(%rsp), %r11
	.cfi_def_cfa 11, 20536
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3560, %rsp
	.cfi_def_cfa_offset 24096
	leaq	.LC1(%rip), %rbx
	movq	%fs:40, %rax
	movq	%rax, 24024(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L15:
	movq	%r12, %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	je	.L2
	jle	.L3
	leaq	16(%rsp), %rbp
	xorl	%r15d, %r15d
	leaq	12(%rsp), %r14
	leaq	8(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	movq	%r14, %rcx
	movq	%r13, %rdx
	xorl	%eax, %eax
	addl	$1, %r15d
	addq	$24, %rbp
	call	__isoc99_scanf@PLT
	pxor	%xmm1, %xmm1
	pxor	%xmm0, %xmm0
	movl	4(%rsp), %edi
	cvtsi2sdl	8(%rsp), %xmm1
	divsd	.LC2(%rip), %xmm1
	mulsd	%xmm1, %xmm1
	cvtsi2sdl	12(%rsp), %xmm0
	divsd	%xmm1, %xmm0
	movapd	%xmm0, %xmm1
	subsd	.LC3(%rip), %xmm1
	andpd	.LC4(%rip), %xmm1
	unpcklpd	%xmm1, %xmm0
	movups	%xmm0, -16(%rbp)
	cmpl	%r15d, %edi
	jg	.L4
	testl	%edi, %edi
	jle	.L3
	leaq	40(%rsp), %rdx
	movl	$1, %r9d
	cmpl	$1, %edi
	je	.L3
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%rdx, %rax
	movl	%r9d, %ecx
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L27:
	movl	-24(%rdx), %esi
	cmpl	(%rax), %esi
	jle	.L11
.L10:
	movdqu	(%rax), %xmm2
	movsd	-16(%rdx), %xmm1
	movups	%xmm2, -24(%rdx)
	movq	16(%rax), %r8
	unpcklpd	%xmm0, %xmm1
	movq	%r8, -8(%rdx)
	movl	%esi, (%rax)
	movups	%xmm1, 8(%rax)
.L11:
	addl	$1, %ecx
	addq	$24, %rax
	cmpl	%ecx, %edi
	jle	.L26
.L13:
	movsd	-8(%rdx), %xmm0
	movsd	16(%rax), %xmm1
	ucomisd	%xmm1, %xmm0
	jp	.L8
	je	.L27
.L8:
	comisd	%xmm1, %xmm0
	jbe	.L11
	movl	-24(%rdx), %esi
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L26:
	addl	$1, %r9d
	addq	$24, %rdx
	cmpl	%r9d, %edi
	jne	.L7
.L3:
	movl	16(%rsp), %edx
	leaq	.LC5(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L15
.L2:
	movq	24024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L28
	addq	$24040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	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
.L28:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC2:
	.long	0
	.long	1079574528
	.align 8
.LC3:
	.long	0
	.long	1077280768
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC4:
	.long	-1
	.long	2147483647
	.long	0
	.long	0
	.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 STANDARD 22;

struct BodyData
{
	int number;
	double bmi;
	double ideal_body;
};

int main(void) {
	int n,h,w,flag;
	int i,j;
	double a;
	struct BodyData data[1000],*p,temp;

	p = data;
	while (1) {
		scanf("%d",&n);
		if (n == 0)break;
		for (i = 0; i < n; i++) {
			scanf("%d %d %d",&data[i].number,&h,&w);
			data[i].bmi = w / pow((double)h / 100, 2);
			a = data[i].bmi - STANDARD;
			data[i].ideal_body = fabs(a);
		}
	
		for (i = 0; i < n; i++) {
			for (j = i+1; j < n; j++) {
				flag = 0;
				if ((p + i)->ideal_body == (p + j)->ideal_body) {
					if ((p + i)->number > (p + j)->number)flag = 1;
				}
				else if ((p + i)->ideal_body > (p + j)->ideal_body)
					flag = 1;
				if (flag) {
					temp = *(p + i);
					*(p + i) = *(p + j);
					*(p + j) = temp;
				}
			}
		}
		printf("%d\n",p->number);
	}
	return 0;
}
6
1 165 66
2 178 60
3 180 72
4 160 65
5 185 62
6 182 62
3
3 160 65
2 180 32
1 170 75
0
 6
1 165 66
2 178 60
3 180 72
4 160 65
5 185 62
6 182 62
3
3 160 65
2 180 70
1 170 103
0
 6
1 165 93
0 178 60
3 180 72
4 160 65
5 185 62
6 182 62
3
3 160 94
2 180 32
1 170 75
0
 6
1 165 93
0 178 60
3 115 72
4 160 65
5 185 62
6 182 62
3
3 160 94
2 180 32
1 170 75
0
 6
1 151 28
0 178 60
3 115 72
4 160 65
7 185 62
11 182 62
3
3 37 94
2 180 32
1 140 75
0
 6
2 95 40
-1 178 60
3 68 72
4 160 65
7 185 62
11 182 62
3
3 37 94
0 180 4
1 140 75
0
 6
2 95 40
-1 317 60
1 68 72
4 160 65
7 185 62
11 182 115
3
3 37 94
0 180 6
1 204 75
0
 6
2 95 40
-1 317 60
1 68 72
8 160 65
7 185 62
11 182 115
3
3 37 94
0 180 6
1 204 75
0
 6
2 95 40
-1 317 60
1 68 72
8 160 65
7 185 62
11 182 115
3
3 37 94
0 180 6
2 204 75
0
 6
2 32 66
1 178 118
3 180 72
4 116 65
5 101 62
6 47 50
3
0 147 129
1 3 14
0 80 24
0

3
3
 3
2
 3
1
 0
1
 0
2
 -1
1
 4
1
 8
1
 8
2
 3
0

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 STANDARD 22;

struct BodyData
{
	int number;
	double bmi;
	double ideal_body;
};

int main(void) {
	int n,h,w,flag;
	int i,j;
	double a;
	struct BodyData data[1000],*p,temp;

	p = data;
	while (1) {
		scanf("%d",&n);
		if (n == 0)break;
		for (i = 0; i < n; i++) {
			scanf("%d %d %d",&data[i].number,&h,&w);
			data[i].bmi = w / pow((double)h / 100, 2);
			a = data[i].bmi - STANDARD;
			data[i].ideal_body = fabs(a);
		}
	
		for (i = 0; i < n; i++) {
			for (j = i+1; j < n; j++) {
				flag = 0;
				if ((p + i)->ideal_body == (p + j)->ideal_body) {
					if ((p + i)->number > (p + j)->number)flag = 1;
				}
				else if ((p + i)->ideal_body > (p + j)->ideal_body)
					flag = 1;
				if (flag) {
					temp = *(p + i);
					*(p + i) = *(p + j);
					*(p + j) = temp;
				}
			}
		}
		printf("%d\n",p->number);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d %d"
.LC6:
	.string	"%d\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
	leaq	-20480(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3632, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-24016(%rbp), %rax
	movq	%rax, -24064(%rbp)
.L15:
	leaq	-24088(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24088(%rbp), %eax
	testl	%eax, %eax
	je	.L21
	movl	$0, -24072(%rbp)
	jmp	.L4
.L5:
	leaq	-24016(%rbp), %rcx
	movl	-24072(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	leaq	(%rcx,%rax), %rsi
	leaq	-24080(%rbp), %rdx
	leaq	-24084(%rbp), %rax
	movq	%rdx, %rcx
	movq	%rax, %rdx
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24080(%rbp), %eax
	pxor	%xmm2, %xmm2
	cvtsi2sdl	%eax, %xmm2
	movsd	%xmm2, -24104(%rbp)
	movl	-24084(%rbp), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movsd	.LC2(%rip), %xmm1
	movapd	%xmm0, %xmm3
	divsd	%xmm1, %xmm3
	movq	%xmm3, %rax
	movsd	.LC3(%rip), %xmm0
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movapd	%xmm0, %xmm1
	movsd	-24104(%rbp), %xmm0
	divsd	%xmm1, %xmm0
	movl	-24072(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rbp, %rax
	subq	$24008, %rax
	movsd	%xmm0, (%rax)
	movl	-24072(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rbp, %rax
	subq	$24008, %rax
	movsd	(%rax), %xmm0
	movsd	.LC4(%rip), %xmm1
	subsd	%xmm1, %xmm0
	movsd	%xmm0, -24056(%rbp)
	movsd	-24056(%rbp), %xmm0
	movq	.LC5(%rip), %xmm1
	andpd	%xmm1, %xmm0
	movl	-24072(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rbp, %rax
	subq	$24000, %rax
	movsd	%xmm0, (%rax)
	addl	$1, -24072(%rbp)
.L4:
	movl	-24088(%rbp), %eax
	cmpl	%eax, -24072(%rbp)
	jl	.L5
	movl	$0, -24072(%rbp)
	jmp	.L6
.L14:
	movl	-24072(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -24068(%rbp)
	jmp	.L7
.L13:
	movl	$0, -24076(%rbp)
	movl	-24072(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movq	-24064(%rbp), %rax
	addq	%rdx, %rax
	movsd	16(%rax), %xmm0
	movl	-24068(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movq	-24064(%rbp), %rax
	addq	%rdx, %rax
	movsd	16(%rax), %xmm1
	ucomisd	%xmm1, %xmm0
	jp	.L8
	ucomisd	%xmm1, %xmm0
	jne	.L8
	movl	-24072(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movq	-24064(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %ecx
	movl	-24068(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movq	-24064(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	jle	.L10
	movl	$1, -24076(%rbp)
	jmp	.L10
.L8:
	movl	-24072(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movq	-24064(%rbp), %rax
	addq	%rdx, %rax
	movsd	16(%rax), %xmm0
	movl	-24068(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movq	-24064(%rbp), %rax
	addq	%rdx, %rax
	movsd	16(%rax), %xmm1
	comisd	%xmm1, %xmm0
	jbe	.L10
	movl	$1, -24076(%rbp)
.L10:
	cmpl	$0, -24076(%rbp)
	je	.L12
	movl	-24072(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movq	-24064(%rbp), %rax
	leaq	(%rdx,%rax), %rcx
	movq	(%rcx), %rax
	movq	8(%rcx), %rdx
	movq	%rax, -24048(%rbp)
	movq	%rdx, -24040(%rbp)
	movq	16(%rcx), %rax
	movq	%rax, -24032(%rbp)
	movl	-24068(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movq	-24064(%rbp), %rax
	leaq	(%rdx,%rax), %rsi
	movl	-24072(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movq	-24064(%rbp), %rax
	leaq	(%rdx,%rax), %rcx
	movq	(%rsi), %rax
	movq	8(%rsi), %rdx
	movq	%rax, (%rcx)
	movq	%rdx, 8(%rcx)
	movq	16(%rsi), %rax
	movq	%rax, 16(%rcx)
	movl	-24068(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movq	-24064(%rbp), %rax
	leaq	(%rdx,%rax), %rcx
	movq	-24048(%rbp), %rax
	movq	-24040(%rbp), %rdx
	movq	%rax, (%rcx)
	movq	%rdx, 8(%rcx)
	movq	-24032(%rbp), %rax
	movq	%rax, 16(%rcx)
.L12:
	addl	$1, -24068(%rbp)
.L7:
	movl	-24088(%rbp), %eax
	cmpl	%eax, -24068(%rbp)
	jl	.L13
	addl	$1, -24072(%rbp)
.L6:
	movl	-24088(%rbp), %eax
	cmpl	%eax, -24072(%rbp)
	jl	.L14
	movq	-24064(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, %esi
	leaq	.LC6(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L15
.L21:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC2:
	.long	0
	.long	1079574528
	.align 8
.LC3:
	.long	0
	.long	1073741824
	.align 8
.LC4:
	.long	0
	.long	1077280768
	.align 16
.LC5:
	.long	-1
	.long	2147483647
	.long	0
	.long	0
	.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	"%d"
.LC1:
	.string	"%d %d %d"
.LC6:
	.string	"%d\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
	leaq	-20480(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3632, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-24016(%rbp), %rax
	movq	%rax, -24064(%rbp)
.L15:
	leaq	-24088(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24088(%rbp), %eax
	testl	%eax, %eax
	je	.L21
	movl	$0, -24072(%rbp)
	jmp	.L4
.L5:
	leaq	-24016(%rbp), %rcx
	movl	-24072(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	leaq	(%rcx,%rax), %rsi
	leaq	-24080(%rbp), %rdx
	leaq	-24084(%rbp), %rax
	movq	%rdx, %rcx
	movq	%rax, %rdx
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24080(%rbp), %eax
	pxor	%xmm2, %xmm2
	cvtsi2sdl	%eax, %xmm2
	movsd	%xmm2, -24104(%rbp)
	movl	-24084(%rbp), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movsd	.LC2(%rip), %xmm1
	movapd	%xmm0, %xmm3
	divsd	%xmm1, %xmm3
	movq	%xmm3, %rax
	movsd	.LC3(%rip), %xmm0
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movapd	%xmm0, %xmm1
	movsd	-24104(%rbp), %xmm0
	divsd	%xmm1, %xmm0
	movl	-24072(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rbp, %rax
	subq	$24008, %rax
	movsd	%xmm0, (%rax)
	movl	-24072(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rbp, %rax
	subq	$24008, %rax
	movsd	(%rax), %xmm0
	movsd	.LC4(%rip), %xmm1
	subsd	%xmm1, %xmm0
	movsd	%xmm0, -24056(%rbp)
	movsd	-24056(%rbp), %xmm0
	movq	.LC5(%rip), %xmm1
	andpd	%xmm1, %xmm0
	movl	-24072(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rbp, %rax
	subq	$24000, %rax
	movsd	%xmm0, (%rax)
	addl	$1, -24072(%rbp)
.L4:
	movl	-24088(%rbp), %eax
	cmpl	%eax, -24072(%rbp)
	jl	.L5
	movl	$0, -24072(%rbp)
	jmp	.L6
.L14:
	movl	-24072(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -24068(%rbp)
	jmp	.L7
.L13:
	movl	$0, -24076(%rbp)
	movl	-24072(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movq	-24064(%rbp), %rax
	addq	%rdx, %rax
	movsd	16(%rax), %xmm0
	movl	-24068(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movq	-24064(%rbp), %rax
	addq	%rdx, %rax
	movsd	16(%rax), %xmm1
	ucomisd	%xmm1, %xmm0
	jp	.L8
	ucomisd	%xmm1, %xmm0
	jne	.L8
	movl	-24072(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movq	-24064(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %ecx
	movl	-24068(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movq	-24064(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	jle	.L10
	movl	$1, -24076(%rbp)
	jmp	.L10
.L8:
	movl	-24072(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movq	-24064(%rbp), %rax
	addq	%rdx, %rax
	movsd	16(%rax), %xmm0
	movl	-24068(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movq	-24064(%rbp), %rax
	addq	%rdx, %rax
	movsd	16(%rax), %xmm1
	comisd	%xmm1, %xmm0
	jbe	.L10
	movl	$1, -24076(%rbp)
.L10:
	cmpl	$0, -24076(%rbp)
	je	.L12
	movl	-24072(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movq	-24064(%rbp), %rax
	leaq	(%rdx,%rax), %rcx
	movq	(%rcx), %rax
	movq	8(%rcx), %rdx
	movq	%rax, -24048(%rbp)
	movq	%rdx, -24040(%rbp)
	movq	16(%rcx), %rax
	movq	%rax, -24032(%rbp)
	movl	-24068(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movq	-24064(%rbp), %rax
	leaq	(%rdx,%rax), %rsi
	movl	-24072(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movq	-24064(%rbp), %rax
	leaq	(%rdx,%rax), %rcx
	movq	(%rsi), %rax
	movq	8(%rsi), %rdx
	movq	%rax, (%rcx)
	movq	%rdx, 8(%rcx)
	movq	16(%rsi), %rax
	movq	%rax, 16(%rcx)
	movl	-24068(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movq	-24064(%rbp), %rax
	leaq	(%rdx,%rax), %rcx
	movq	-24048(%rbp), %rax
	movq	-24040(%rbp), %rdx
	movq	%rax, (%rcx)
	movq	%rdx, 8(%rcx)
	movq	-24032(%rbp), %rax
	movq	%rax, 16(%rcx)
.L12:
	addl	$1, -24068(%rbp)
.L7:
	movl	-24088(%rbp), %eax
	cmpl	%eax, -24068(%rbp)
	jl	.L13
	addl	$1, -24072(%rbp)
.L6:
	movl	-24088(%rbp), %eax
	cmpl	%eax, -24072(%rbp)
	jl	.L14
	movq	-24064(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, %esi
	leaq	.LC6(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L15
.L21:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC2:
	.long	0
	.long	1079574528
	.align 8
.LC3:
	.long	0
	.long	1073741824
	.align 8
.LC4:
	.long	0
	.long	1077280768
	.align 16
.LC5:
	.long	-1
	.long	2147483647
	.long	0
	.long	0
	.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:
