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 <stdlib.h>

typedef struct{
    int d;
    int p;
}SYUKUBA;


int struct_sort( const void *a, const void *b ){
    return ((SYUKUBA*)b)->p - ((SYUKUBA*)a)->p;
}



int main(){
    int N,sum;
    long int M,count;
    int i;
    SYUKUBA n[10003];

    while(1){
        scanf("%d %ld",&N, &M);
        if(N == 0 && M == 0){
            break;
        }

        for(i = 0; i < N ; i++){
            scanf("%d %d",&n[i].d,&n[i].p);
            //printf("d = %d p = %d\n",n[i].d,n[i].p);
        }
        qsort(n,N,sizeof(SYUKUBA),struct_sort);
        /*
        for(i = 0; i < N ; i++){
            printf("s.d = %d s.p = %d\n",n[i].d,n[i].p);
        }
        */
       count = M;
       sum = 0;
       for(i = 0; i < N ; i++){
           if(n[i].d <= count){
               count -= n[i].d;
           }else if(n[i].d > count && count != 0){
               sum += (n[i].d - count) * n[i].p;
               count = 0;
           }else if(count == 0){
               sum += n[i].p * n[i].d;
           }

       }
       printf("%d\n",sum);

    }


    return 0;

}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	struct_sort
	.type	struct_sort, @function
struct_sort:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rax
	movl	4(%rax), %edx
	movq	-8(%rbp), %rax
	movl	4(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	struct_sort, .-struct_sort
	.section	.rodata
.LC0:
	.string	"%d %ld"
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-77824(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2240, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L13:
	leaq	-80048(%rbp), %rdx
	leaq	-80060(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-80060(%rbp), %eax
	testl	%eax, %eax
	jne	.L4
	movq	-80048(%rbp), %rax
	testq	%rax, %rax
	je	.L17
.L4:
	movl	$0, -80052(%rbp)
	jmp	.L6
.L7:
	leaq	-80032(%rbp), %rdx
	movl	-80052(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	leaq	4(%rax), %rdx
	leaq	-80032(%rbp), %rcx
	movl	-80052(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -80052(%rbp)
.L6:
	movl	-80060(%rbp), %eax
	cmpl	%eax, -80052(%rbp)
	jl	.L7
	movl	-80060(%rbp), %eax
	movslq	%eax, %rsi
	leaq	-80032(%rbp), %rax
	leaq	struct_sort(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movq	-80048(%rbp), %rax
	movq	%rax, -80040(%rbp)
	movl	$0, -80056(%rbp)
	movl	$0, -80052(%rbp)
	jmp	.L8
.L12:
	movl	-80052(%rbp), %eax
	cltq
	movl	-80032(%rbp,%rax,8), %eax
	cltq
	cmpq	%rax, -80040(%rbp)
	jl	.L9
	movl	-80052(%rbp), %eax
	cltq
	movl	-80032(%rbp,%rax,8), %eax
	cltq
	subq	%rax, -80040(%rbp)
	jmp	.L10
.L9:
	movl	-80052(%rbp), %eax
	cltq
	movl	-80032(%rbp,%rax,8), %eax
	cltq
	cmpq	%rax, -80040(%rbp)
	jge	.L11
	cmpq	$0, -80040(%rbp)
	je	.L11
	movl	-80052(%rbp), %eax
	cltq
	movl	-80032(%rbp,%rax,8), %eax
	cltq
	subq	-80040(%rbp), %rax
	movl	%eax, %edx
	movl	-80052(%rbp), %eax
	cltq
	movl	-80028(%rbp,%rax,8), %eax
	imull	%eax, %edx
	movl	-80056(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -80056(%rbp)
	movq	$0, -80040(%rbp)
	jmp	.L10
.L11:
	cmpq	$0, -80040(%rbp)
	jne	.L10
	movl	-80052(%rbp), %eax
	cltq
	movl	-80028(%rbp,%rax,8), %edx
	movl	-80052(%rbp), %eax
	cltq
	movl	-80032(%rbp,%rax,8), %eax
	imull	%edx, %eax
	addl	%eax, -80056(%rbp)
.L10:
	addl	$1, -80052(%rbp)
.L8:
	movl	-80060(%rbp), %eax
	cmpl	%eax, -80052(%rbp)
	jl	.L12
	movl	-80056(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L13
.L17:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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
	.p2align 4
	.globl	struct_sort
	.type	struct_sort, @function
struct_sort:
.LFB39:
	.cfi_startproc
	endbr64
	movl	4(%rsi), %eax
	subl	4(%rdi), %eax
	ret
	.cfi_endproc
.LFE39:
	.size	struct_sort, .-struct_sort
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %ld"
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.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	-77824(%rsp), %r11
	.cfi_def_cfa 11, 77880
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2232, %rsp
	.cfi_def_cfa_offset 80112
	leaq	.LC1(%rip), %rbx
	movq	%fs:40, %rax
	movq	%rax, 80040(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %r14
	leaq	4(%rsp), %r13
	leaq	16(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L14:
	movq	%r13, %rsi
	movq	%r14, %rdx
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rsi
	testl	%esi, %esi
	jne	.L20
	cmpq	$0, 8(%rsp)
	je	.L21
.L6:
	leaq	struct_sort(%rip), %rcx
	movl	$8, %edx
	movq	%rbp, %rdi
	call	qsort@PLT
	movl	4(%rsp), %edx
	movq	8(%rsp), %rcx
	testl	%edx, %edx
	jle	.L16
	subl	$1, %edx
	movq	%rbp, %rax
	xorl	%r8d, %r8d
	leaq	24(%rsp,%rdx,8), %r9
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L22:
	subq	%rdx, %rcx
.L11:
	addq	$8, %rax
	cmpq	%rax, %r9
	je	.L9
.L13:
	movslq	(%rax), %rdx
	cmpq	%rcx, %rdx
	jle	.L22
	movl	4(%rax), %edi
	testq	%rcx, %rcx
	je	.L12
	subq	%rcx, %rdx
	addq	$8, %rax
	xorl	%ecx, %ecx
	imull	%edx, %edi
	addl	%edi, %r8d
	cmpq	%rax, %r9
	jne	.L13
.L9:
	movl	%r8d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L12:
	imull	%edx, %edi
	addl	%edi, %r8d
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L20:
	jle	.L6
	movq	%rbp, %r12
	xorl	%r15d, %r15d
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r12, %rsi
	leaq	4(%r12), %rdx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rsi
	addl	$1, %r15d
	addq	$8, %r12
	cmpl	%r15d, %esi
	jg	.L8
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L16:
	xorl	%r8d, %r8d
	jmp	.L9
.L21:
	movq	80040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L23
	addq	$80056, %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
.L23:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.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
	.p2align 4
	.globl	struct_sort
	.type	struct_sort, @function
struct_sort:
.LFB39:
	.cfi_startproc
	endbr64
	movl	4(%rsi), %eax
	subl	4(%rdi), %eax
	ret
	.cfi_endproc
.LFE39:
	.size	struct_sort, .-struct_sort
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %ld"
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.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	-77824(%rsp), %r11
	.cfi_def_cfa 11, 77880
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2232, %rsp
	.cfi_def_cfa_offset 80112
	leaq	.LC1(%rip), %rbx
	movq	%fs:40, %rax
	movq	%rax, 80040(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %r14
	leaq	4(%rsp), %r13
	leaq	16(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L14:
	movq	%r13, %rsi
	movq	%r14, %rdx
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rsi
	testl	%esi, %esi
	jne	.L20
	cmpq	$0, 8(%rsp)
	je	.L21
.L6:
	leaq	struct_sort(%rip), %rcx
	movl	$8, %edx
	movq	%rbp, %rdi
	call	qsort@PLT
	movl	4(%rsp), %edx
	movq	8(%rsp), %rcx
	testl	%edx, %edx
	jle	.L16
	subl	$1, %edx
	movq	%rbp, %rax
	xorl	%r8d, %r8d
	leaq	24(%rsp,%rdx,8), %r9
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L22:
	subq	%rdx, %rcx
.L11:
	addq	$8, %rax
	cmpq	%rax, %r9
	je	.L9
.L13:
	movslq	(%rax), %rdx
	cmpq	%rcx, %rdx
	jle	.L22
	movl	4(%rax), %edi
	testq	%rcx, %rcx
	je	.L12
	subq	%rcx, %rdx
	addq	$8, %rax
	xorl	%ecx, %ecx
	imull	%edx, %edi
	addl	%edi, %r8d
	cmpq	%rax, %r9
	jne	.L13
.L9:
	movl	%r8d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L12:
	imull	%edx, %edi
	addl	%edi, %r8d
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L20:
	jle	.L6
	movq	%rbp, %r12
	xorl	%r15d, %r15d
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r12, %rsi
	leaq	4(%r12), %rdx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rsi
	addl	$1, %r15d
	addq	$8, %r12
	cmpl	%r15d, %esi
	jg	.L8
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L16:
	xorl	%r8d, %r8d
	jmp	.L9
.L21:
	movq	80040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L23
	addq	$80056, %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
.L23:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.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 <stdlib.h>

typedef struct{
    int d;
    int p;
}SYUKUBA;


int struct_sort( const void *a, const void *b ){
    return ((SYUKUBA*)b)->p - ((SYUKUBA*)a)->p;
}



int main(){
    int N,sum;
    long int M,count;
    int i;
    SYUKUBA n[10003];

    while(1){
        scanf("%d %ld",&N, &M);
        if(N == 0 && M == 0){
            break;
        }

        for(i = 0; i < N ; i++){
            scanf("%d %d",&n[i].d,&n[i].p);
            //printf("d = %d p = %d\n",n[i].d,n[i].p);
        }
        qsort(n,N,sizeof(SYUKUBA),struct_sort);
        /*
        for(i = 0; i < N ; i++){
            printf("s.d = %d s.p = %d\n",n[i].d,n[i].p);
        }
        */
       count = M;
       sum = 0;
       for(i = 0; i < N ; i++){
           if(n[i].d <= count){
               count -= n[i].d;
           }else if(n[i].d > count && count != 0){
               sum += (n[i].d - count) * n[i].p;
               count = 0;
           }else if(count == 0){
               sum += n[i].p * n[i].d;
           }

       }
       printf("%d\n",sum);

    }


    return 0;

}


2 8
5 6
4 5
3 2
5 10
5 10
5 10
0 0
 2 8
5 6
4 5
3 2
5 10
3 10
5 10
0 0
 2 8
5 6
4 5
3 2
1 10
5 10
5 10
0 0
 2 8
5 6
4 5
3 1
3 10
5 10
5 10
0 0
 2 8
5 6
4 5
3 2
5 10
7 10
5 10
0 0
 2 8
5 6
4 5
3 2
0 10
5 10
5 10
0 0
 2 8
5 6
4 5
3 2
0 10
7 10
5 10
0 0
 2 8
5 6
4 5
3 4
0 5
5 10
5 10
0 0
 2 8
5 6
4 5
3 2
0 6
7 10
4 7
0 0
 2 8
7 6
4 5
3 2
5 10
3 10
5 10
0 0

5
130
 5
110
 5
90
 5
120
 5
150
 5
80
 5
100
 5
60
 5
78
 15
110

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 <stdlib.h>

typedef struct{
    int d;
    int p;
}SYUKUBA;


int struct_sort( const void *a, const void *b ){
    return ((SYUKUBA*)b)->p - ((SYUKUBA*)a)->p;
}



int main(){
    int N,sum;
    long int M,count;
    int i;
    SYUKUBA n[10003];

    while(1){
        scanf("%d %ld",&N, &M);
        if(N == 0 && M == 0){
            break;
        }

        for(i = 0; i < N ; i++){
            scanf("%d %d",&n[i].d,&n[i].p);
            //printf("d = %d p = %d\n",n[i].d,n[i].p);
        }
        qsort(n,N,sizeof(SYUKUBA),struct_sort);
        /*
        for(i = 0; i < N ; i++){
            printf("s.d = %d s.p = %d\n",n[i].d,n[i].p);
        }
        */
       count = M;
       sum = 0;
       for(i = 0; i < N ; i++){
           if(n[i].d <= count){
               count -= n[i].d;
           }else if(n[i].d > count && count != 0){
               sum += (n[i].d - count) * n[i].p;
               count = 0;
           }else if(count == 0){
               sum += n[i].p * n[i].d;
           }

       }
       printf("%d\n",sum);

    }


    return 0;

}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	struct_sort
	.type	struct_sort, @function
struct_sort:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rax
	movl	4(%rax), %edx
	movq	-8(%rbp), %rax
	movl	4(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	struct_sort, .-struct_sort
	.section	.rodata
.LC0:
	.string	"%d %ld"
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-77824(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2240, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L13:
	leaq	-80048(%rbp), %rdx
	leaq	-80060(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-80060(%rbp), %eax
	testl	%eax, %eax
	jne	.L4
	movq	-80048(%rbp), %rax
	testq	%rax, %rax
	je	.L17
.L4:
	movl	$0, -80052(%rbp)
	jmp	.L6
.L7:
	leaq	-80032(%rbp), %rdx
	movl	-80052(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	leaq	4(%rax), %rdx
	leaq	-80032(%rbp), %rcx
	movl	-80052(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -80052(%rbp)
.L6:
	movl	-80060(%rbp), %eax
	cmpl	%eax, -80052(%rbp)
	jl	.L7
	movl	-80060(%rbp), %eax
	movslq	%eax, %rsi
	leaq	-80032(%rbp), %rax
	leaq	struct_sort(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movq	-80048(%rbp), %rax
	movq	%rax, -80040(%rbp)
	movl	$0, -80056(%rbp)
	movl	$0, -80052(%rbp)
	jmp	.L8
.L12:
	movl	-80052(%rbp), %eax
	cltq
	movl	-80032(%rbp,%rax,8), %eax
	cltq
	cmpq	%rax, -80040(%rbp)
	jl	.L9
	movl	-80052(%rbp), %eax
	cltq
	movl	-80032(%rbp,%rax,8), %eax
	cltq
	subq	%rax, -80040(%rbp)
	jmp	.L10
.L9:
	movl	-80052(%rbp), %eax
	cltq
	movl	-80032(%rbp,%rax,8), %eax
	cltq
	cmpq	%rax, -80040(%rbp)
	jge	.L11
	cmpq	$0, -80040(%rbp)
	je	.L11
	movl	-80052(%rbp), %eax
	cltq
	movl	-80032(%rbp,%rax,8), %eax
	cltq
	subq	-80040(%rbp), %rax
	movl	%eax, %edx
	movl	-80052(%rbp), %eax
	cltq
	movl	-80028(%rbp,%rax,8), %eax
	imull	%eax, %edx
	movl	-80056(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -80056(%rbp)
	movq	$0, -80040(%rbp)
	jmp	.L10
.L11:
	cmpq	$0, -80040(%rbp)
	jne	.L10
	movl	-80052(%rbp), %eax
	cltq
	movl	-80028(%rbp,%rax,8), %edx
	movl	-80052(%rbp), %eax
	cltq
	movl	-80032(%rbp,%rax,8), %eax
	imull	%edx, %eax
	addl	%eax, -80056(%rbp)
.L10:
	addl	$1, -80052(%rbp)
.L8:
	movl	-80060(%rbp), %eax
	cmpl	%eax, -80052(%rbp)
	jl	.L12
	movl	-80056(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L13
.L17:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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
	.globl	struct_sort
	.type	struct_sort, @function
struct_sort:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rax
	movl	4(%rax), %edx
	movq	-8(%rbp), %rax
	movl	4(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	struct_sort, .-struct_sort
	.section	.rodata
.LC0:
	.string	"%d %ld"
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-77824(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2240, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L13:
	leaq	-80048(%rbp), %rdx
	leaq	-80060(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-80060(%rbp), %eax
	testl	%eax, %eax
	jne	.L4
	movq	-80048(%rbp), %rax
	testq	%rax, %rax
	je	.L17
.L4:
	movl	$0, -80052(%rbp)
	jmp	.L6
.L7:
	leaq	-80032(%rbp), %rdx
	movl	-80052(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	leaq	4(%rax), %rdx
	leaq	-80032(%rbp), %rcx
	movl	-80052(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -80052(%rbp)
.L6:
	movl	-80060(%rbp), %eax
	cmpl	%eax, -80052(%rbp)
	jl	.L7
	movl	-80060(%rbp), %eax
	movslq	%eax, %rsi
	leaq	-80032(%rbp), %rax
	leaq	struct_sort(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movq	-80048(%rbp), %rax
	movq	%rax, -80040(%rbp)
	movl	$0, -80056(%rbp)
	movl	$0, -80052(%rbp)
	jmp	.L8
.L12:
	movl	-80052(%rbp), %eax
	cltq
	movl	-80032(%rbp,%rax,8), %eax
	cltq
	cmpq	%rax, -80040(%rbp)
	jl	.L9
	movl	-80052(%rbp), %eax
	cltq
	movl	-80032(%rbp,%rax,8), %eax
	cltq
	subq	%rax, -80040(%rbp)
	jmp	.L10
.L9:
	movl	-80052(%rbp), %eax
	cltq
	movl	-80032(%rbp,%rax,8), %eax
	cltq
	cmpq	%rax, -80040(%rbp)
	jge	.L11
	cmpq	$0, -80040(%rbp)
	je	.L11
	movl	-80052(%rbp), %eax
	cltq
	movl	-80032(%rbp,%rax,8), %eax
	cltq
	subq	-80040(%rbp), %rax
	movl	%eax, %edx
	movl	-80052(%rbp), %eax
	cltq
	movl	-80028(%rbp,%rax,8), %eax
	imull	%eax, %edx
	movl	-80056(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -80056(%rbp)
	movq	$0, -80040(%rbp)
	jmp	.L10
.L11:
	cmpq	$0, -80040(%rbp)
	jne	.L10
	movl	-80052(%rbp), %eax
	cltq
	movl	-80028(%rbp,%rax,8), %edx
	movl	-80052(%rbp), %eax
	cltq
	movl	-80032(%rbp,%rax,8), %eax
	imull	%edx, %eax
	addl	%eax, -80056(%rbp)
.L10:
	addl	$1, -80052(%rbp)
.L8:
	movl	-80060(%rbp), %eax
	cmpl	%eax, -80052(%rbp)
	jl	.L12
	movl	-80056(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L13
.L17:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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:
