Given the following C code and assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
#include<stdlib.h>

#define NEW(p,n){p=malloc((n)*sizeof(p[0]));if(p==NULL){printf("not enough memory\n");exit(1);};}
//pの型の変数n個の要素分のメモリを確保し、そのアドレスをpに代入するマクロ

#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))

typedef struct{
    long price;
    int num;
}shop;

//昇順
int asc(const void* a, const void* b){
    shop p = *(shop*)a;
    shop q = *(shop*)b;

    if(p.price<q.price) return -1;
    else if(p.price>q.price) return 1;
    return 0;
}

int main(void){
    int N,M;
    scanf("%d%d",&N,&M);

    //S[0]~S[N-1]に格納する
    shop* S;
    NEW(S,N);
    for(int i=0;i<N;i++){
        scanf("%ld%d",&S[i].price, &S[i].num);
    }
    qsort(S,N,sizeof(shop),asc);

    long ans=0;
    int i=0;
    while(M>0){
        if(M>=S[i].num){
            ans+=S[i].price*S[i].num;
            M-=S[i].num;
        }
        else{
            ans+=S[i].price*M;
            M=0;
        }
        i++;
    }
    printf("%ld\n",ans);

    return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	asc
	.type	asc, @function
asc:
.LFB39:
	.cfi_startproc
	endbr64
	movq	(%rsi), %rax
	cmpq	%rax, (%rdi)
	movl	$-1, %edx
	setg	%al
	movzbl	%al, %eax
	cmovl	%edx, %eax
	ret
	.cfi_endproc
.LFE39:
	.size	asc, .-asc
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"not enough memory"
.LC2:
	.string	"%ld%d"
.LC3:
	.string	"%ld\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
	leaq	.LC0(%rip), %rdi
	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
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movslq	(%rsp), %r15
	movq	%r15, %rdi
	salq	$4, %rdi
	call	malloc@PLT
	testq	%rax, %rax
	je	.L6
	movq	%rax, %rbp
	movq	%rax, %rbx
	leaq	.LC2(%rip), %r14
	xorl	%r12d, %r12d
	testl	%r15d, %r15d
	jle	.L8
	.p2align 4,,10
	.p2align 3
.L9:
	leaq	8(%rbx), %rdx
	movq	%rbx, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	(%rsp), %r13d
	addl	$1, %r12d
	addq	$16, %rbx
	cmpl	%r12d, %r13d
	jg	.L9
	movslq	%r13d, %r15
.L8:
	leaq	asc(%rip), %rcx
	movl	$16, %edx
	movq	%r15, %rsi
	movq	%rbp, %rdi
	call	qsort@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L15
	movq	%rbp, %rdx
	xorl	%r8d, %r8d
	.p2align 4,,10
	.p2align 3
.L12:
	movl	8(%rdx), %ecx
	movq	(%rdx), %rsi
	cmpl	%eax, %ecx
	jg	.L11
	movslq	%ecx, %rdi
	addq	$16, %rdx
	imulq	%rdi, %rsi
	addq	%rsi, %r8
	subl	%ecx, %eax
	jne	.L12
	.p2align 4,,10
	.p2align 3
.L13:
	movl	$0, 4(%rsp)
.L10:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movl	$1, %edi
	leaq	.LC3(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	addq	$24, %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
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	cltq
	imulq	%rsi, %rax
	addq	%rax, %r8
	jmp	.L13
.L15:
	xorl	%r8d, %r8d
	jmp	.L10
.L20:
	call	__stack_chk_fail@PLT
.L6:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	movl	$1, %edi
	call	exit@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:
```

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.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	asc
	.type	asc, @function
asc:
.LFB39:
	.cfi_startproc
	endbr64
	movq	(%rsi), %rax
	cmpq	%rax, (%rdi)
	movl	$-1, %edx
	setg	%al
	movzbl	%al, %eax
	cmovl	%edx, %eax
	ret
	.cfi_endproc
.LFE39:
	.size	asc, .-asc
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"not enough memory"
.LC2:
	.string	"%ld%d"
.LC3:
	.string	"%ld\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
	leaq	.LC0(%rip), %rdi
	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
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movslq	(%rsp), %r15
	movq	%r15, %rdi
	salq	$4, %rdi
	call	malloc@PLT
	testq	%rax, %rax
	je	.L6
	movq	%rax, %rbp
	movq	%rax, %rbx
	leaq	.LC2(%rip), %r14
	xorl	%r12d, %r12d
	testl	%r15d, %r15d
	jle	.L8
	.p2align 4,,10
	.p2align 3
.L9:
	leaq	8(%rbx), %rdx
	movq	%rbx, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	(%rsp), %r13d
	addl	$1, %r12d
	addq	$16, %rbx
	cmpl	%r12d, %r13d
	jg	.L9
	movslq	%r13d, %r15
.L8:
	leaq	asc(%rip), %rcx
	movl	$16, %edx
	movq	%r15, %rsi
	movq	%rbp, %rdi
	call	qsort@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L15
	movq	%rbp, %rdx
	xorl	%r8d, %r8d
	.p2align 4,,10
	.p2align 3
.L12:
	movl	8(%rdx), %ecx
	movq	(%rdx), %rsi
	cmpl	%eax, %ecx
	jg	.L11
	movslq	%ecx, %rdi
	addq	$16, %rdx
	imulq	%rdi, %rsi
	addq	%rsi, %r8
	subl	%ecx, %eax
	jne	.L12
	.p2align 4,,10
	.p2align 3
.L13:
	movl	$0, 4(%rsp)
.L10:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movl	$1, %edi
	leaq	.LC3(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	addq	$24, %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
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	cltq
	imulq	%rsi, %rax
	addq	%rax, %r8
	jmp	.L13
.L15:
	xorl	%r8d, %r8d
	jmp	.L10
.L20:
	call	__stack_chk_fail@PLT
.L6:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	movl	$1, %edi
	call	exit@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
```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	asc
	.type	asc, @function
asc:
.LFB39:
	.cfi_startproc
	endbr64
	movq	(%rsi), %rax
	cmpq	%rax, (%rdi)
	movl	$-1, %edx
	setg	%al
	movzbl	%al, %eax
	cmovl	%edx, %eax
	ret
	.cfi_endproc
.LFE39:
	.size	asc, .-asc
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"not enough memory"
.LC2:
	.string	"%ld%d"
.LC3:
	.string	"%ld\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
	leaq	.LC0(%rip), %rdi
	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
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movslq	(%rsp), %r15
	movq	%r15, %rdi
	salq	$4, %rdi
	call	malloc@PLT
	testq	%rax, %rax
	je	.L6
	movq	%rax, %rbp
	movq	%rax, %rbx
	leaq	.LC2(%rip), %r14
	xorl	%r12d, %r12d
	testl	%r15d, %r15d
	jle	.L8
	.p2align 4,,10
	.p2align 3
.L9:
	leaq	8(%rbx), %rdx
	movq	%rbx, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	(%rsp), %r13d
	addl	$1, %r12d
	addq	$16, %rbx
	cmpl	%r12d, %r13d
	jg	.L9
	movslq	%r13d, %r15
.L8:
	leaq	asc(%rip), %rcx
	movl	$16, %edx
	movq	%r15, %rsi
	movq	%rbp, %rdi
	call	qsort@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L15
	movq	%rbp, %rdx
	xorl	%r8d, %r8d
	.p2align 4,,10
	.p2align 3
.L12:
	movl	8(%rdx), %ecx
	movq	(%rdx), %rsi
	cmpl	%eax, %ecx
	jg	.L11
	movslq	%ecx, %rdi
	addq	$16, %rdx
	imulq	%rdi, %rsi
	addq	%rsi, %r8
	subl	%ecx, %eax
	jne	.L12
	.p2align 4,,10
	.p2align 3
.L13:
	movl	$0, 4(%rsp)
.L10:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movl	$1, %edi
	leaq	.LC3(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	addq	$24, %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
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	cltq
	imulq	%rsi, %rax
	addq	%rax, %r8
	jmp	.L13
.L15:
	xorl	%r8d, %r8d
	jmp	.L10
.L20:
	call	__stack_chk_fail@PLT
.L6:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	movl	$1, %edi
	call	exit@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:
```
```c
#include<stdio.h>
#include<stdlib.h>

#define NEW(p,n){p=malloc((n)*sizeof(p[0]));if(p==NULL){printf("not enough memory\n");exit(1);};}
//pの型の変数n個の要素分のメモリを確保し、そのアドレスをpに代入するマクロ

#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))

typedef struct{
    long price;
    int num;
}shop;

//昇順
int asc(const void* a, const void* b){
    shop p = *(shop*)a;
    shop q = *(shop*)b;

    if(p.price<q.price) return -1;
    else if(p.price>q.price) return 1;
    return 0;
}

int main(void){
    int N,M;
    scanf("%d%d",&N,&M);

    //S[0]~S[N-1]に格納する
    shop* S;
    NEW(S,N);
    for(int i=0;i<N;i++){
        scanf("%ld%d",&S[i].price, &S[i].num);
    }
    qsort(S,N,sizeof(shop),asc);

    long ans=0;
    int i=0;
    while(M>0){
        if(M>=S[i].num){
            ans+=S[i].price*S[i].num;
            M-=S[i].num;
        }
        else{
            ans+=S[i].price*M;
            M=0;
        }
        i++;
    }
    printf("%ld\n",ans);

    return 0;
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
#include<stdlib.h>

#define NEW(p,n){p=malloc((n)*sizeof(p[0]));if(p==NULL){printf("not enough memory\n");exit(1);};}
//pの型の変数n個の要素分のメモリを確保し、そのアドレスをpに代入するマクロ

#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))

typedef struct{
    long price;
    int num;
}shop;

//昇順
int asc(const void* a, const void* b){
    shop p = *(shop*)a;
    shop q = *(shop*)b;

    if(p.price<q.price) return -1;
    else if(p.price>q.price) return 1;
    return 0;
}

int main(void){
    int N,M;
    scanf("%d%d",&N,&M);

    //S[0]~S[N-1]に格納する
    shop* S;
    NEW(S,N);
    for(int i=0;i<N;i++){
        scanf("%ld%d",&S[i].price, &S[i].num);
    }
    qsort(S,N,sizeof(shop),asc);

    long ans=0;
    int i=0;
    while(M>0){
        if(M>=S[i].num){
            ans+=S[i].price*S[i].num;
            M-=S[i].num;
        }
        else{
            ans+=S[i].price*M;
            M=0;
        }
        i++;
    }
    printf("%ld\n",ans);

    return 0;
}```

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.
Optimized Assembly Code:

4 30
6 18
2 6
3 10
7 9
 2 3
4 9
2 4
 4 30
6 18
2 1
3 10
7 9
 2 3
4 9
4 4
 2 6
4 9
4 4
 2 6
3 9
4 4
 2 6
3 9
2 4
 2 6
3 9
1 4
 2 3
3 4
1 6
 2 5
3 4
1 6

126
 6
 147
 12
 24
 18
 14
 10
 3
 5

Given the following C code and assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
#include<stdlib.h>

#define NEW(p,n){p=malloc((n)*sizeof(p[0]));if(p==NULL){printf("not enough memory\n");exit(1);};}
//pの型の変数n個の要素分のメモリを確保し、そのアドレスをpに代入するマクロ

#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))

typedef struct{
    long price;
    int num;
}shop;

//昇順
int asc(const void* a, const void* b){
    shop p = *(shop*)a;
    shop q = *(shop*)b;

    if(p.price<q.price) return -1;
    else if(p.price>q.price) return 1;
    return 0;
}

int main(void){
    int N,M;
    scanf("%d%d",&N,&M);

    //S[0]~S[N-1]に格納する
    shop* S;
    NEW(S,N);
    for(int i=0;i<N;i++){
        scanf("%ld%d",&S[i].price, &S[i].num);
    }
    qsort(S,N,sizeof(shop),asc);

    long ans=0;
    int i=0;
    while(M>0){
        if(M>=S[i].num){
            ans+=S[i].price*S[i].num;
            M-=S[i].num;
        }
        else{
            ans+=S[i].price*M;
            M=0;
        }
        i++;
    }
    printf("%ld\n",ans);

    return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	asc
	.type	asc, @function
asc:
.LFB39:
	.cfi_startproc
	endbr64
	movq	(%rsi), %rax
	cmpq	%rax, (%rdi)
	movl	$-1, %edx
	setg	%al
	movzbl	%al, %eax
	cmovl	%edx, %eax
	ret
	.cfi_endproc
.LFE39:
	.size	asc, .-asc
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"not enough memory"
.LC2:
	.string	"%ld%d"
.LC3:
	.string	"%ld\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
	leaq	.LC0(%rip), %rdi
	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
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movslq	(%rsp), %r15
	movq	%r15, %rdi
	salq	$4, %rdi
	call	malloc@PLT
	testq	%rax, %rax
	je	.L6
	movq	%rax, %rbp
	movq	%rax, %rbx
	leaq	.LC2(%rip), %r14
	xorl	%r12d, %r12d
	testl	%r15d, %r15d
	jle	.L8
	.p2align 4,,10
	.p2align 3
.L9:
	leaq	8(%rbx), %rdx
	movq	%rbx, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	(%rsp), %r13d
	addl	$1, %r12d
	addq	$16, %rbx
	cmpl	%r12d, %r13d
	jg	.L9
	movslq	%r13d, %r15
.L8:
	leaq	asc(%rip), %rcx
	movl	$16, %edx
	movq	%r15, %rsi
	movq	%rbp, %rdi
	call	qsort@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L15
	movq	%rbp, %rdx
	xorl	%r8d, %r8d
	.p2align 4,,10
	.p2align 3
.L12:
	movl	8(%rdx), %ecx
	movq	(%rdx), %rsi
	cmpl	%eax, %ecx
	jg	.L11
	movslq	%ecx, %rdi
	addq	$16, %rdx
	imulq	%rdi, %rsi
	addq	%rsi, %r8
	subl	%ecx, %eax
	jne	.L12
	.p2align 4,,10
	.p2align 3
.L13:
	movl	$0, 4(%rsp)
.L10:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movl	$1, %edi
	leaq	.LC3(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	addq	$24, %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
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	cltq
	imulq	%rsi, %rax
	addq	%rax, %r8
	jmp	.L13
.L15:
	xorl	%r8d, %r8d
	jmp	.L10
.L20:
	call	__stack_chk_fail@PLT
.L6:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	movl	$1, %edi
	call	exit@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:
```

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.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	asc
	.type	asc, @function
asc:
.LFB39:
	.cfi_startproc
	endbr64
	movq	(%rsi), %rax
	cmpq	%rax, (%rdi)
	movl	$-1, %edx
	setg	%al
	movzbl	%al, %eax
	cmovl	%edx, %eax
	ret
	.cfi_endproc
.LFE39:
	.size	asc, .-asc
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"not enough memory"
.LC2:
	.string	"%ld%d"
.LC3:
	.string	"%ld\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
	leaq	.LC0(%rip), %rdi
	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
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movslq	(%rsp), %r15
	movq	%r15, %rdi
	salq	$4, %rdi
	call	malloc@PLT
	testq	%rax, %rax
	je	.L6
	movq	%rax, %rbp
	movq	%rax, %rbx
	leaq	.LC2(%rip), %r14
	xorl	%r12d, %r12d
	testl	%r15d, %r15d
	jle	.L8
	.p2align 4,,10
	.p2align 3
.L9:
	leaq	8(%rbx), %rdx
	movq	%rbx, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	(%rsp), %r13d
	addl	$1, %r12d
	addq	$16, %rbx
	cmpl	%r12d, %r13d
	jg	.L9
	movslq	%r13d, %r15
.L8:
	leaq	asc(%rip), %rcx
	movl	$16, %edx
	movq	%r15, %rsi
	movq	%rbp, %rdi
	call	qsort@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L15
	movq	%rbp, %rdx
	xorl	%r8d, %r8d
	.p2align 4,,10
	.p2align 3
.L12:
	movl	8(%rdx), %ecx
	movq	(%rdx), %rsi
	cmpl	%eax, %ecx
	jg	.L11
	movslq	%ecx, %rdi
	addq	$16, %rdx
	imulq	%rdi, %rsi
	addq	%rsi, %r8
	subl	%ecx, %eax
	jne	.L12
	.p2align 4,,10
	.p2align 3
.L13:
	movl	$0, 4(%rsp)
.L10:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movl	$1, %edi
	leaq	.LC3(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	addq	$24, %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
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	cltq
	imulq	%rsi, %rax
	addq	%rax, %r8
	jmp	.L13
.L15:
	xorl	%r8d, %r8d
	jmp	.L10
.L20:
	call	__stack_chk_fail@PLT
.L6:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	movl	$1, %edi
	call	exit@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:
```