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>
#include <string.h>
#include <math.h>
typedef long long ll;
#define rep(i,n) for(int i=0; i<(int)(n); i++)
int upcmpii(const void *a, const void *b){
    return (*(int*)a == *(int*)b ? 0 : (*(int*)a > *(int*)b ? 1 : -1));
}
void sort_ui(int *a, int n){ qsort(a, n, sizeof(int), upcmpii); }

int main(){
    int n; scanf("%d",&n);
    int a[101];
    rep(i,n) scanf("%d",a+i);
    sort_ui(a,n);
    int ans = 0, tmp = -1;
    rep(i,n) {
        ans += a[i];
        if(tmp == -1 && a[i]%10 != 0) tmp = a[i];
    }
    if(ans%10 == 0){
        if(tmp == -1) ans = 0;
        else ans -= tmp;
    }
    printf("%d",ans);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	upcmpii
	.type	upcmpii, @function
upcmpii:
.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	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	je	.L2
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jle	.L3
	movl	$1, %eax
	jmp	.L6
.L3:
	movl	$-1, %eax
	jmp	.L6
.L2:
	movl	$0, %eax
.L6:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	upcmpii, .-upcmpii
	.globl	sort_ui
	.type	sort_ui, @function
sort_ui:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
	movl	%esi, -12(%rbp)
	movl	-12(%rbp), %eax
	movslq	%eax, %rsi
	movq	-8(%rbp), %rax
	leaq	upcmpii(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	sort_ui, .-sort_ui
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$448, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-436(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -432(%rbp)
	jmp	.L9
.L10:
	movl	-432(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	-416(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -432(%rbp)
.L9:
	movl	-436(%rbp), %eax
	cmpl	%eax, -432(%rbp)
	jl	.L10
	movl	-436(%rbp), %edx
	leaq	-416(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	sort_ui
	movl	$0, -428(%rbp)
	movl	$-1, -424(%rbp)
	movl	$0, -420(%rbp)
	jmp	.L11
.L13:
	movl	-420(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	addl	%eax, -428(%rbp)
	cmpl	$-1, -424(%rbp)
	jne	.L12
	movl	-420(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %ecx
	movslq	%ecx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%ecx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	testl	%edx, %edx
	je	.L12
	movl	-420(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, -424(%rbp)
.L12:
	addl	$1, -420(%rbp)
.L11:
	movl	-436(%rbp), %eax
	cmpl	%eax, -420(%rbp)
	jl	.L13
	movl	-428(%rbp), %ecx
	movslq	%ecx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%ecx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	testl	%edx, %edx
	jne	.L14
	cmpl	$-1, -424(%rbp)
	jne	.L15
	movl	$0, -428(%rbp)
	jmp	.L14
.L15:
	movl	-424(%rbp), %eax
	subl	%eax, -428(%rbp)
.L14:
	movl	-428(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	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
.LFE8:
	.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	upcmpii
	.type	upcmpii, @function
upcmpii:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rsi), %edx
	xorl	%eax, %eax
	cmpl	%edx, (%rdi)
	je	.L1
	setg	%al
	movzbl	%al, %eax
	leal	-1(%rax,%rax), %eax
.L1:
	ret
	.cfi_endproc
.LFE51:
	.size	upcmpii, .-upcmpii
	.p2align 4
	.globl	sort_ui
	.type	sort_ui, @function
sort_ui:
.LFB52:
	.cfi_startproc
	endbr64
	movslq	%esi, %rsi
	leaq	upcmpii(%rip), %rcx
	movl	$4, %edx
	jmp	qsort@PLT
	.cfi_endproc
.LFE52:
	.size	sort_ui, .-sort_ui
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.section	.text.unlikely,"ax",@progbits
.LCOLDB1:
	.section	.text.startup,"ax",@progbits
.LHOTB1:
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB53:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	xorl	%ebx, %ebx
	subq	$440, %rsp
	.cfi_def_cfa_offset 480
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	16(%rsp), %r12
	movq	%r12, %rbp
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %rsi
	testl	%esi, %esi
	jle	.L8
	.p2align 4,,10
	.p2align 3
.L9:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %rsi
	addq	$4, %rbp
	cmpl	%ebx, %esi
	jg	.L9
.L8:
	leaq	upcmpii(%rip), %rcx
	movl	$4, %edx
	movq	%r12, %rdi
	call	qsort@PLT
	movl	12(%rsp), %esi
	testl	%esi, %esi
	jle	.L27
	movslq	%esi, %r9
	movl	$1, %eax
	movl	$-1, %edi
	xorl	%r8d, %r8d
.L17:
	movl	-4(%r12,%rax,4), %ecx
	addl	%ecx, %r8d
	cmpl	$-1, %edi
	je	.L19
	movl	%eax, %ecx
	cmpq	%r9, %rax
	je	.L16
	movl	%esi, %edx
	subl	%eax, %edx
	cmpl	%eax, %esi
	movl	$1, %eax
	cmovg	%edx, %eax
	subl	$1, %edx
	cmpl	$2, %edx
	jbe	.L21
	movslq	%ecx, %rdx
	movl	%eax, %r10d
	pxor	%xmm0, %xmm0
	leaq	(%r12,%rdx,4), %r9
	shrl	$2, %r10d
	xorl	%edx, %edx
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L39:
	cmpq	%rax, %r9
	je	.L28
	addq	$1, %rax
	movl	-4(%r12,%rax,4), %ecx
	addl	%ecx, %r8d
.L19:
	imull	$-858993459, %ecx, %edx
	addl	$429496728, %edx
	rorl	%edx
	cmpl	$429496728, %edx
	jbe	.L39
	cmpq	%rax, %r9
	je	.L18
	addq	$1, %rax
	movl	%ecx, %edi
	jmp	.L17
.L21:
	movslq	%ecx, %rax
	addl	16(%rsp,%rax,4), %r8d
	leal	1(%rcx), %eax
	cmpl	%esi, %eax
	jl	.L33
.L16:
	imull	$-858993459, %r8d, %eax
	addl	$429496728, %eax
	rorl	%eax
	cmpl	$429496728, %eax
	jbe	.L40
.L10:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L41
	addq	$440, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L28:
	.cfi_restore_state
	orl	$-1, %ecx
.L18:
	movl	%r8d, %eax
	movl	$10, %esi
	cltd
	idivl	%esi
	testl	%edx, %edx
	jne	.L10
	cmpl	$-1, %ecx
	jne	.L24
.L27:
	xorl	%r8d, %r8d
	jmp	.L10
.L40:
	movl	%edi, %ecx
.L24:
	subl	%ecx, %r8d
	jmp	.L10
.L41:
	call	__stack_chk_fail@PLT
	.cfi_endproc
	.section	.text.unlikely
	.cfi_startproc
	.type	main.cold, @function
main.cold:
.LFSB53:
.L14:
	.cfi_def_cfa_offset 480
	.cfi_offset 3, -40
	.cfi_offset 6, -32
	.cfi_offset 12, -24
	.cfi_offset 13, -16
	movq	%rdx, %r11
	addq	$1, %rdx
	salq	$4, %r11
	movdqu	(%r9,%r11), %xmm1
	paddd	%xmm1, %xmm0
	cmpl	%edx, %r10d
	ja	.L14
	movdqa	%xmm0, %xmm1
	psrldq	$8, %xmm1
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	addl	%edx, %r8d
	movl	%eax, %edx
	andl	$-4, %edx
	addl	%edx, %ecx
	cmpl	%edx, %eax
	je	.L16
	jmp	.L21
.L33:
	cltq
	addl	$2, %ecx
	addl	16(%rsp,%rax,4), %r8d
	cmpl	%ecx, %esi
	jle	.L16
	movslq	%ecx, %rcx
	addl	16(%rsp,%rcx,4), %r8d
	jmp	.L16
	.cfi_endproc
.LFE53:
	.section	.text.startup
	.size	main, .-main
	.section	.text.unlikely
	.size	main.cold, .-main.cold
.LCOLDE1:
	.section	.text.startup
.LHOTE1:
	.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	upcmpii
	.type	upcmpii, @function
upcmpii:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rsi), %edx
	xorl	%eax, %eax
	cmpl	%edx, (%rdi)
	je	.L1
	setg	%al
	movzbl	%al, %eax
	leal	-1(%rax,%rax), %eax
.L1:
	ret
	.cfi_endproc
.LFE51:
	.size	upcmpii, .-upcmpii
	.p2align 4
	.globl	sort_ui
	.type	sort_ui, @function
sort_ui:
.LFB52:
	.cfi_startproc
	endbr64
	movslq	%esi, %rsi
	leaq	upcmpii(%rip), %rcx
	movl	$4, %edx
	jmp	qsort@PLT
	.cfi_endproc
.LFE52:
	.size	sort_ui, .-sort_ui
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.section	.text.unlikely,"ax",@progbits
.LCOLDB1:
	.section	.text.startup,"ax",@progbits
.LHOTB1:
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB53:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	xorl	%ebx, %ebx
	subq	$440, %rsp
	.cfi_def_cfa_offset 480
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	16(%rsp), %r12
	movq	%r12, %rbp
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %rsi
	testl	%esi, %esi
	jle	.L8
	.p2align 4,,10
	.p2align 3
.L9:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %rsi
	addq	$4, %rbp
	cmpl	%ebx, %esi
	jg	.L9
.L8:
	leaq	upcmpii(%rip), %rcx
	movl	$4, %edx
	movq	%r12, %rdi
	call	qsort@PLT
	movl	12(%rsp), %esi
	testl	%esi, %esi
	jle	.L27
	movslq	%esi, %r9
	movl	$1, %eax
	movl	$-1, %edi
	xorl	%r8d, %r8d
.L17:
	movl	-4(%r12,%rax,4), %ecx
	addl	%ecx, %r8d
	cmpl	$-1, %edi
	je	.L19
	movl	%eax, %ecx
	cmpq	%r9, %rax
	je	.L16
	movl	%esi, %edx
	subl	%eax, %edx
	cmpl	%eax, %esi
	movl	$1, %eax
	cmovg	%edx, %eax
	subl	$1, %edx
	cmpl	$2, %edx
	jbe	.L21
	movslq	%ecx, %rdx
	movl	%eax, %r10d
	pxor	%xmm0, %xmm0
	leaq	(%r12,%rdx,4), %r9
	shrl	$2, %r10d
	xorl	%edx, %edx
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L39:
	cmpq	%rax, %r9
	je	.L28
	addq	$1, %rax
	movl	-4(%r12,%rax,4), %ecx
	addl	%ecx, %r8d
.L19:
	imull	$-858993459, %ecx, %edx
	addl	$429496728, %edx
	rorl	%edx
	cmpl	$429496728, %edx
	jbe	.L39
	cmpq	%rax, %r9
	je	.L18
	addq	$1, %rax
	movl	%ecx, %edi
	jmp	.L17
.L21:
	movslq	%ecx, %rax
	addl	16(%rsp,%rax,4), %r8d
	leal	1(%rcx), %eax
	cmpl	%esi, %eax
	jl	.L33
.L16:
	imull	$-858993459, %r8d, %eax
	addl	$429496728, %eax
	rorl	%eax
	cmpl	$429496728, %eax
	jbe	.L40
.L10:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L41
	addq	$440, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L28:
	.cfi_restore_state
	orl	$-1, %ecx
.L18:
	movl	%r8d, %eax
	movl	$10, %esi
	cltd
	idivl	%esi
	testl	%edx, %edx
	jne	.L10
	cmpl	$-1, %ecx
	jne	.L24
.L27:
	xorl	%r8d, %r8d
	jmp	.L10
.L40:
	movl	%edi, %ecx
.L24:
	subl	%ecx, %r8d
	jmp	.L10
.L41:
	call	__stack_chk_fail@PLT
	.cfi_endproc
	.section	.text.unlikely
	.cfi_startproc
	.type	main.cold, @function
main.cold:
.LFSB53:
.L14:
	.cfi_def_cfa_offset 480
	.cfi_offset 3, -40
	.cfi_offset 6, -32
	.cfi_offset 12, -24
	.cfi_offset 13, -16
	movq	%rdx, %r11
	addq	$1, %rdx
	salq	$4, %r11
	movdqu	(%r9,%r11), %xmm1
	paddd	%xmm1, %xmm0
	cmpl	%edx, %r10d
	ja	.L14
	movdqa	%xmm0, %xmm1
	psrldq	$8, %xmm1
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	addl	%edx, %r8d
	movl	%eax, %edx
	andl	$-4, %edx
	addl	%edx, %ecx
	cmpl	%edx, %eax
	je	.L16
	jmp	.L21
.L33:
	cltq
	addl	$2, %ecx
	addl	16(%rsp,%rax,4), %r8d
	cmpl	%ecx, %esi
	jle	.L16
	movslq	%ecx, %rcx
	addl	16(%rsp,%rcx,4), %r8d
	jmp	.L16
	.cfi_endproc
.LFE53:
	.section	.text.startup
	.size	main, .-main
	.section	.text.unlikely
	.size	main.cold, .-main.cold
.LCOLDE1:
	.section	.text.startup
.LHOTE1:
	.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>
#include <string.h>
#include <math.h>
typedef long long ll;
#define rep(i,n) for(int i=0; i<(int)(n); i++)
int upcmpii(const void *a, const void *b){
    return (*(int*)a == *(int*)b ? 0 : (*(int*)a > *(int*)b ? 1 : -1));
}
void sort_ui(int *a, int n){ qsort(a, n, sizeof(int), upcmpii); }

int main(){
    int n; scanf("%d",&n);
    int a[101];
    rep(i,n) scanf("%d",a+i);
    sort_ui(a,n);
    int ans = 0, tmp = -1;
    rep(i,n) {
        ans += a[i];
        if(tmp == -1 && a[i]%10 != 0) tmp = a[i];
    }
    if(ans%10 == 0){
        if(tmp == -1) ans = 0;
        else ans -= tmp;
    }
    printf("%d",ans);
}
3
4
10
15
 3
10
20
40
 3
5
10
12
 3
8
10
15
 3
7
20
40
 3
5
10
8
 3
1
10
15
 3
7
34
40
 3
5
10
10
 3
7
38
40

29 0 27 33 67 23 26 81 25 85
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>
#include <string.h>
#include <math.h>
typedef long long ll;
#define rep(i,n) for(int i=0; i<(int)(n); i++)
int upcmpii(const void *a, const void *b){
    return (*(int*)a == *(int*)b ? 0 : (*(int*)a > *(int*)b ? 1 : -1));
}
void sort_ui(int *a, int n){ qsort(a, n, sizeof(int), upcmpii); }

int main(){
    int n; scanf("%d",&n);
    int a[101];
    rep(i,n) scanf("%d",a+i);
    sort_ui(a,n);
    int ans = 0, tmp = -1;
    rep(i,n) {
        ans += a[i];
        if(tmp == -1 && a[i]%10 != 0) tmp = a[i];
    }
    if(ans%10 == 0){
        if(tmp == -1) ans = 0;
        else ans -= tmp;
    }
    printf("%d",ans);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	upcmpii
	.type	upcmpii, @function
upcmpii:
.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	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	je	.L2
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jle	.L3
	movl	$1, %eax
	jmp	.L6
.L3:
	movl	$-1, %eax
	jmp	.L6
.L2:
	movl	$0, %eax
.L6:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	upcmpii, .-upcmpii
	.globl	sort_ui
	.type	sort_ui, @function
sort_ui:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
	movl	%esi, -12(%rbp)
	movl	-12(%rbp), %eax
	movslq	%eax, %rsi
	movq	-8(%rbp), %rax
	leaq	upcmpii(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	sort_ui, .-sort_ui
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$448, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-436(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -432(%rbp)
	jmp	.L9
.L10:
	movl	-432(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	-416(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -432(%rbp)
.L9:
	movl	-436(%rbp), %eax
	cmpl	%eax, -432(%rbp)
	jl	.L10
	movl	-436(%rbp), %edx
	leaq	-416(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	sort_ui
	movl	$0, -428(%rbp)
	movl	$-1, -424(%rbp)
	movl	$0, -420(%rbp)
	jmp	.L11
.L13:
	movl	-420(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	addl	%eax, -428(%rbp)
	cmpl	$-1, -424(%rbp)
	jne	.L12
	movl	-420(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %ecx
	movslq	%ecx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%ecx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	testl	%edx, %edx
	je	.L12
	movl	-420(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, -424(%rbp)
.L12:
	addl	$1, -420(%rbp)
.L11:
	movl	-436(%rbp), %eax
	cmpl	%eax, -420(%rbp)
	jl	.L13
	movl	-428(%rbp), %ecx
	movslq	%ecx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%ecx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	testl	%edx, %edx
	jne	.L14
	cmpl	$-1, -424(%rbp)
	jne	.L15
	movl	$0, -428(%rbp)
	jmp	.L14
.L15:
	movl	-424(%rbp), %eax
	subl	%eax, -428(%rbp)
.L14:
	movl	-428(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	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
.LFE8:
	.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	upcmpii
	.type	upcmpii, @function
upcmpii:
.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	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	je	.L2
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jle	.L3
	movl	$1, %eax
	jmp	.L6
.L3:
	movl	$-1, %eax
	jmp	.L6
.L2:
	movl	$0, %eax
.L6:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	upcmpii, .-upcmpii
	.globl	sort_ui
	.type	sort_ui, @function
sort_ui:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
	movl	%esi, -12(%rbp)
	movl	-12(%rbp), %eax
	movslq	%eax, %rsi
	movq	-8(%rbp), %rax
	leaq	upcmpii(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	sort_ui, .-sort_ui
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$448, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-436(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -432(%rbp)
	jmp	.L9
.L10:
	movl	-432(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	-416(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -432(%rbp)
.L9:
	movl	-436(%rbp), %eax
	cmpl	%eax, -432(%rbp)
	jl	.L10
	movl	-436(%rbp), %edx
	leaq	-416(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	sort_ui
	movl	$0, -428(%rbp)
	movl	$-1, -424(%rbp)
	movl	$0, -420(%rbp)
	jmp	.L11
.L13:
	movl	-420(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	addl	%eax, -428(%rbp)
	cmpl	$-1, -424(%rbp)
	jne	.L12
	movl	-420(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %ecx
	movslq	%ecx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%ecx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	testl	%edx, %edx
	je	.L12
	movl	-420(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, -424(%rbp)
.L12:
	addl	$1, -420(%rbp)
.L11:
	movl	-436(%rbp), %eax
	cmpl	%eax, -420(%rbp)
	jl	.L13
	movl	-428(%rbp), %ecx
	movslq	%ecx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%ecx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	testl	%edx, %edx
	jne	.L14
	cmpl	$-1, -424(%rbp)
	jne	.L15
	movl	$0, -428(%rbp)
	jmp	.L14
.L15:
	movl	-424(%rbp), %eax
	subl	%eax, -428(%rbp)
.L14:
	movl	-428(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	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
.LFE8:
	.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:
