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>

int compare_int(const void *a, const void *b){
    return *(int*)a - *(int*)b;
}
int minimum_vote(){
    int vote[10000];
    int index = 0;
    int sum = 0;
    char c = getchar();
    while(1){
        if(c == '['){
            vote[index++] = minimum_vote();
            c = getchar();
        }
        else if(c == ']'){
            qsort(vote, index, sizeof(int), compare_int);
            int i;
            for(i = 0; i < (index + 1) / 2; i++){
                sum += vote[i];
            }
            return sum;
        }
        else{
            int t = c - '0';
            c = getchar();
            while(c >= '0' && c <= '9'){
                t = t * 10 + (c - '0');
                c = getchar();
            }
            vote[index++] = (t + 1) / 2;
        }
    }
}
int main(void){
    int n, i;
    scanf("%d", &n);
    for(i = 0; i < n; i++){
        while(getchar() != '[');
        printf("%d\n", minimum_vote());
    }
    return 0;

}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	compare_int
	.type	compare_int, @function
compare_int:
.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), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	compare_int, .-compare_int
	.globl	minimum_vote
	.type	minimum_vote, @function
minimum_vote:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	leaq	-36864(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3192, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movl	$0, -40048(%rbp)
	movl	$0, -40044(%rbp)
	call	getchar@PLT
	movb	%al, -40049(%rbp)
.L13:
	cmpb	$91, -40049(%rbp)
	jne	.L4
	movl	-40048(%rbp), %ebx
	leal	1(%rbx), %eax
	movl	%eax, -40048(%rbp)
	movl	$0, %eax
	call	minimum_vote
	movslq	%ebx, %rdx
	movl	%eax, -40032(%rbp,%rdx,4)
	call	getchar@PLT
	movb	%al, -40049(%rbp)
	jmp	.L13
.L4:
	cmpb	$93, -40049(%rbp)
	jne	.L6
	movl	-40048(%rbp), %eax
	movslq	%eax, %rsi
	leaq	-40032(%rbp), %rax
	leaq	compare_int(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -40040(%rbp)
	jmp	.L7
.L8:
	movl	-40040(%rbp), %eax
	cltq
	movl	-40032(%rbp,%rax,4), %eax
	addl	%eax, -40044(%rbp)
	addl	$1, -40040(%rbp)
.L7:
	movl	-40048(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cmpl	%eax, -40040(%rbp)
	jl	.L8
	movl	-40044(%rbp), %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	jmp	.L15
.L6:
	movsbl	-40049(%rbp), %eax
	subl	$48, %eax
	movl	%eax, -40036(%rbp)
	call	getchar@PLT
	movb	%al, -40049(%rbp)
	jmp	.L10
.L12:
	movl	-40036(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movsbl	-40049(%rbp), %eax
	subl	$48, %eax
	addl	%edx, %eax
	movl	%eax, -40036(%rbp)
	call	getchar@PLT
	movb	%al, -40049(%rbp)
.L10:
	cmpb	$47, -40049(%rbp)
	jle	.L11
	cmpb	$57, -40049(%rbp)
	jle	.L12
.L11:
	movl	-40036(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-40048(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -40048(%rbp)
	movl	%ecx, %edx
	shrl	$31, %edx
	addl	%ecx, %edx
	sarl	%edx
	cltq
	movl	%edx, -40032(%rbp,%rax,4)
	jmp	.L13
.L15:
	call	__stack_chk_fail@PLT
.L14:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	minimum_vote, .-minimum_vote
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.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	$16, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12(%rbp)
	jmp	.L17
.L19:
	nop
.L18:
	call	getchar@PLT
	cmpl	$91, %eax
	jne	.L18
	movl	$0, %eax
	call	minimum_vote
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -12(%rbp)
.L17:
	movl	-16(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L19
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	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	compare_int
	.type	compare_int, @function
compare_int:
.LFB39:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE39:
	.size	compare_int, .-compare_int
	.p2align 4
	.globl	minimum_vote
	.type	minimum_vote, @function
minimum_vote:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	-36864(%rsp), %r11
	.cfi_def_cfa 11, 36912
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3152, %rsp
	.cfi_def_cfa_offset 40064
	movq	stdin(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 40008(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbx
	call	getc@PLT
	xorl	%esi, %esi
	movq	%rbx, %r13
	movq	%rbx, %r12
	movl	%eax, %edx
	leal	1(%rsi), %ebp
	cmpb	$91, %dl
	je	.L23
	.p2align 4,,10
	.p2align 3
.L5:
	cmpb	$93, %dl
	je	.L24
	movsbl	%dl, %r14d
	subl	$48, %r14d
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L25:
	subl	$48, %edx
	leal	(%r14,%r14,4), %eax
	movsbl	%dl, %edx
	leal	(%rdx,%rax,2), %r14d
.L22:
	movq	stdin(%rip), %rdi
	call	getc@PLT
	movl	%eax, %edx
	subl	$48, %eax
	cmpb	$9, %al
	jbe	.L25
	addl	$1, %r14d
	movl	%r14d, %eax
	shrl	$31, %eax
	addl	%r14d, %eax
	sarl	%eax
	movl	%eax, (%r12)
.L6:
	movslq	%ebp, %rsi
	addq	$4, %r12
	leal	1(%rsi), %ebp
	cmpb	$91, %dl
	jne	.L5
.L23:
	xorl	%eax, %eax
	call	minimum_vote
	movq	stdin(%rip), %rdi
	movl	%eax, (%r12)
	call	getc@PLT
	movl	%eax, %edx
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L24:
	leaq	compare_int(%rip), %rcx
	movl	$4, %edx
	movq	%rbx, %rdi
	call	qsort@PLT
	sarl	%ebp
	je	.L16
	leal	-1(%rbp), %eax
	cmpl	$2, %eax
	jbe	.L17
	movl	%ebp, %eax
	addq	$16, %rbx
	pxor	%xmm0, %xmm0
	shrl	$2, %eax
	subl	$1, %eax
	salq	$4, %rax
	addq	%rbx, %rax
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L26:
	addq	$16, %rbx
.L10:
	paddd	0(%r13), %xmm0
	movq	%rbx, %r13
	cmpq	%rax, %rbx
	jne	.L26
	movdqa	%xmm0, %xmm1
	movl	%ebp, %edx
	psrldq	$8, %xmm1
	andl	$-4, %edx
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	testb	$3, %bpl
	je	.L3
.L9:
	movslq	%edx, %rcx
	addl	(%rsp,%rcx,4), %eax
	leal	1(%rdx), %ecx
	cmpl	%ecx, %ebp
	jle	.L3
	movslq	%ecx, %rcx
	addl	$2, %edx
	addl	(%rsp,%rcx,4), %eax
	cmpl	%edx, %ebp
	jle	.L3
	movslq	%edx, %rdx
	addl	(%rsp,%rdx,4), %eax
.L3:
	movq	40008(%rsp), %rdx
	subq	%fs:40, %rdx
	jne	.L27
	addq	$40016, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L16:
	.cfi_restore_state
	xorl	%eax, %eax
	jmp	.L3
.L17:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L9
.L27:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.size	minimum_vote, .-minimum_vote
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB41:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	subq	$24, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L29
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L30:
	movq	stdin(%rip), %rdi
	call	getc@PLT
	cmpl	$91, %eax
	jne	.L30
	xorl	%eax, %eax
	addl	$1, %ebx
	call	minimum_vote
	movq	%rbp, %rsi
	movl	$1, %edi
	movl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	cmpl	%ebx, 4(%rsp)
	jg	.L30
.L29:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L36
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L36:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE41:
	.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	compare_int
	.type	compare_int, @function
compare_int:
.LFB39:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE39:
	.size	compare_int, .-compare_int
	.p2align 4
	.globl	minimum_vote
	.type	minimum_vote, @function
minimum_vote:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	-36864(%rsp), %r11
	.cfi_def_cfa 11, 36912
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3152, %rsp
	.cfi_def_cfa_offset 40064
	movq	stdin(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 40008(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbx
	call	getc@PLT
	xorl	%esi, %esi
	movq	%rbx, %r13
	movq	%rbx, %r12
	movl	%eax, %edx
	leal	1(%rsi), %ebp
	cmpb	$91, %dl
	je	.L23
	.p2align 4,,10
	.p2align 3
.L5:
	cmpb	$93, %dl
	je	.L24
	movsbl	%dl, %r14d
	subl	$48, %r14d
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L25:
	subl	$48, %edx
	leal	(%r14,%r14,4), %eax
	movsbl	%dl, %edx
	leal	(%rdx,%rax,2), %r14d
.L22:
	movq	stdin(%rip), %rdi
	call	getc@PLT
	movl	%eax, %edx
	subl	$48, %eax
	cmpb	$9, %al
	jbe	.L25
	addl	$1, %r14d
	movl	%r14d, %eax
	shrl	$31, %eax
	addl	%r14d, %eax
	sarl	%eax
	movl	%eax, (%r12)
.L6:
	movslq	%ebp, %rsi
	addq	$4, %r12
	leal	1(%rsi), %ebp
	cmpb	$91, %dl
	jne	.L5
.L23:
	xorl	%eax, %eax
	call	minimum_vote
	movq	stdin(%rip), %rdi
	movl	%eax, (%r12)
	call	getc@PLT
	movl	%eax, %edx
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L24:
	leaq	compare_int(%rip), %rcx
	movl	$4, %edx
	movq	%rbx, %rdi
	call	qsort@PLT
	sarl	%ebp
	je	.L16
	leal	-1(%rbp), %eax
	cmpl	$2, %eax
	jbe	.L17
	movl	%ebp, %eax
	addq	$16, %rbx
	pxor	%xmm0, %xmm0
	shrl	$2, %eax
	subl	$1, %eax
	salq	$4, %rax
	addq	%rbx, %rax
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L26:
	addq	$16, %rbx
.L10:
	paddd	0(%r13), %xmm0
	movq	%rbx, %r13
	cmpq	%rax, %rbx
	jne	.L26
	movdqa	%xmm0, %xmm1
	movl	%ebp, %edx
	psrldq	$8, %xmm1
	andl	$-4, %edx
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	testb	$3, %bpl
	je	.L3
.L9:
	movslq	%edx, %rcx
	addl	(%rsp,%rcx,4), %eax
	leal	1(%rdx), %ecx
	cmpl	%ecx, %ebp
	jle	.L3
	movslq	%ecx, %rcx
	addl	$2, %edx
	addl	(%rsp,%rcx,4), %eax
	cmpl	%edx, %ebp
	jle	.L3
	movslq	%edx, %rdx
	addl	(%rsp,%rdx,4), %eax
.L3:
	movq	40008(%rsp), %rdx
	subq	%fs:40, %rdx
	jne	.L27
	addq	$40016, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L16:
	.cfi_restore_state
	xorl	%eax, %eax
	jmp	.L3
.L17:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L9
.L27:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.size	minimum_vote, .-minimum_vote
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB41:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	subq	$24, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L29
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L30:
	movq	stdin(%rip), %rdi
	call	getc@PLT
	cmpl	$91, %eax
	jne	.L30
	xorl	%eax, %eax
	addl	$1, %ebx
	call	minimum_vote
	movq	%rbp, %rsi
	movl	$1, %edi
	movl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	cmpl	%ebx, 4(%rsp)
	jg	.L30
.L29:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L36
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L36:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE41:
	.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>

int compare_int(const void *a, const void *b){
    return *(int*)a - *(int*)b;
}
int minimum_vote(){
    int vote[10000];
    int index = 0;
    int sum = 0;
    char c = getchar();
    while(1){
        if(c == '['){
            vote[index++] = minimum_vote();
            c = getchar();
        }
        else if(c == ']'){
            qsort(vote, index, sizeof(int), compare_int);
            int i;
            for(i = 0; i < (index + 1) / 2; i++){
                sum += vote[i];
            }
            return sum;
        }
        else{
            int t = c - '0';
            c = getchar();
            while(c >= '0' && c <= '9'){
                t = t * 10 + (c - '0');
                c = getchar();
            }
            vote[index++] = (t + 1) / 2;
        }
    }
}
int main(void){
    int n, i;
    scanf("%d", &n);
    for(i = 0; i < n; i++){
        while(getchar() != '[');
        printf("%d\n", minimum_vote());
    }
    return 0;

}
6
[[133][4567][89]]
[[5][3][7][3][9]]
[[[99][59][63][85][51]][[1539][7995][467]][[51][57][79][99][3][91][59]]]
[[[37][95][31][77][15]][[43][5][5][5][85]][[71][3][51][89][29]][[57][95][5][69][31]][[99][59][65][73][31]]]
[[[[9][7][3]][[3][5][7]][[7][9][5]]][[[9][9][3]][[5][9][9]][[7][7][3]]][[[5][9][7]][[3][9][3]][[9][5][5]]]]
[[8231][3721][203][3271][8843]]
 6
[[133][4567][89]]
[[5][3][7][3][9]]
[[[95][59][63][85][51]][[1539][7995][467]][[51][97][79][99][3][91][59]]]
[[[37][95][31][77][15]][[43][5][5][5][85]][[71][3][51][89][29]][[57][95][5][69][31]][[99][59][65][73][31]]]
[[[[9][7][3]][[3][5][7]][[7][9][5]]][[[9][9][3]][[5][9][9]][[7][7][3]]][[[5][9][7]][[3][9][3]][[9][5][5]]]]
[[8231][3721][203][3271][8843]]
 6
[[133][4567][89]]
[[5][3][7][3][9]]
[[[99][59][73][85][51]][[1539][7995][467]][[51][57][79][99][3][91][59]]]
[[[37][95][31][77][15]][[43][5][5][5][85]][[71][3][51][89][29]][[57][95][5][69][31]][[99][59][65][73][31]]]
[[[[9][7][3]][[3][5][7]][[7][9][5]]][[[9][9][3]][[5][9][9]][[7][7][3]]][[[5][9][7]][[3][9][3]][[9][5][5]]]]
[[8231][3721][203][3271][8843]]
 6
[[123][4567][89]]
[[5][3][6][3][9]]
[[[99][59][63][85][51]][[1539][7995][467]][[51][57][79][99][3][91][59]]]
[[[37][95][31][77][15]][[43][5][5][5][85]][[71][3][51][89][29]][[57][94][5][69][31]][[99][59][65][73][31]]]
[[[[9][7][3]][[3][5][7]][[7][9][5]]][[[9][9][3]][[5][9][9]][[7][7][3]]][[[5][9][7]][[3][9][3]][[9][5][5]]]]
[[8231][3721][203][3271][8853]]
 6
[[123][4567][89]]
[[5][3][7][3][9]]
[[[99][59][73][85][51]][[1539][7995][467]][[51][57][79][99][3][91][59]]]
[[[37][95][31][77][15]][[43][5][5][5][85]][[71][3][51][89][29]][[57][95][5][69][31]][[99][59][65][73][31]]]
[[[[9][7][3]][[3][5][7]][[7][9][5]]][[[9][9][3]][[5][9][9]][[7][7][3]]][[[5][9][7]][[3][9][3]][[9][5][5]]]]
[[8231][3721][203][3271][8843]]
 6
[[133][4667][89]]
[[5][3][7][3][9]]
[[[99][59][63][85][51]][[1559][7995][467]][[51][57][79][99][3][91][39]]]
[[[37][95][31][77][15]][[43][5][5][5][85]][[71][3][51][89][29]][[57][95][5][69][31]][[99][59][65][73][31]]]
[[[[9][7][3]][[3][5][7]][[7][9][5]]][[[9][9][3]][[5][9][9]][[7][7][3]]][[[5][9][7]][[3][9][3]][[9][5][5]]]]
[[8231][3721][203][3271][8843]]
 6
[[133][4568][89]]
[[5][3][7][3][9]]
[[[99][59][63][85][51]][[1539][7995][467]][[51][57][79][99][3][91][59]]]
[[[37][95][31][77][15]][[43][5][5][5][85]][[71][3][51][89][29]][[57][95][5][69][31]][[99][59][65][73][31]]]
[[[[9][7][3]][[3][5][7]][[7][9][5]]][[[9][9][3]][[5][9][9]][[7][7][3]]][[[5][9][7]][[3][9][3]][[9][5][5]]]]
[[8231][3721][203][3371][8852]]
 6
[[133][4567][89]]
[[5][3][7][3][9]]
[[[95][59][63][85][51]][[1539][7995][467]][[51][97][79][99][3][91][59]]]
[[[37][95][31][77][15]][[43][5][5][5][85]][[71][3][51][89][29]][[57][95][5][69][31]][[99][59][65][73][31]]]
[[[[9][7][3]][[3][5][7]][[7][9][5]]][[[9][9][3]][[5][9][9]][[7][7][3]]][[[5][9][7]][[3][9][3]][[9][5][5]]]]
[[8241][3731][203][3271][8943]]
 6
[[133][4567][89]]
[[5][3][7][3][9]]
[[[99][59][63][85][51]][[1539][7995][467]][[51][57][79][99][3][91][59]]]
[[[37][95][31][77][15]][[43][5][5][5][85]][[71][3][51][79][29]][[47][95][5][69][31]][[99][59][65][73][31]]]
[[[[9][7][3]][[3][5][7]][[7][9][5]]][[[9][9][3]][[5][9][9]][[7][7][3]]][[[5][9][7]][[3][9][3]][[9][5][5]]]]
[[8231][3711][203][3271][8853]]
 6
[[133][4667][89]]
[[5][3][7][3][9]]
[[[99][59][63][85][51]][[1559][7995][467]][[51][57][79][99][3][91][39]]]
[[[37][95][31][77][15]][[43][5][5][5][85]][[71][3][51][89][29]][[57][95][5][69][31]][[99][59][65][73][31]]]
[[[[9][7][3]][[3][5][7]][[7][9][5]]][[[9][9][3]][[5][9][9]][[7][7][3]]][[[5][9][7]][[3][9][3]][[9][5][5]]]]
[[8221][3731][203][3271][8843]]

112
7
175
95
21
3599
 112
7
186
95
21
3599
 112
7
180
95
21
3599
 107
7
175
95
21
3599
 107
7
180
95
21
3599
 112
7
165
95
21
3599
 112
7
175
95
21
3649
 112
7
186
95
21
3604
 112
7
175
95
21
3594
 112
7
165
95
21
3604

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>

int compare_int(const void *a, const void *b){
    return *(int*)a - *(int*)b;
}
int minimum_vote(){
    int vote[10000];
    int index = 0;
    int sum = 0;
    char c = getchar();
    while(1){
        if(c == '['){
            vote[index++] = minimum_vote();
            c = getchar();
        }
        else if(c == ']'){
            qsort(vote, index, sizeof(int), compare_int);
            int i;
            for(i = 0; i < (index + 1) / 2; i++){
                sum += vote[i];
            }
            return sum;
        }
        else{
            int t = c - '0';
            c = getchar();
            while(c >= '0' && c <= '9'){
                t = t * 10 + (c - '0');
                c = getchar();
            }
            vote[index++] = (t + 1) / 2;
        }
    }
}
int main(void){
    int n, i;
    scanf("%d", &n);
    for(i = 0; i < n; i++){
        while(getchar() != '[');
        printf("%d\n", minimum_vote());
    }
    return 0;

}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	compare_int
	.type	compare_int, @function
compare_int:
.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), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	compare_int, .-compare_int
	.globl	minimum_vote
	.type	minimum_vote, @function
minimum_vote:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	leaq	-36864(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3192, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movl	$0, -40048(%rbp)
	movl	$0, -40044(%rbp)
	call	getchar@PLT
	movb	%al, -40049(%rbp)
.L13:
	cmpb	$91, -40049(%rbp)
	jne	.L4
	movl	-40048(%rbp), %ebx
	leal	1(%rbx), %eax
	movl	%eax, -40048(%rbp)
	movl	$0, %eax
	call	minimum_vote
	movslq	%ebx, %rdx
	movl	%eax, -40032(%rbp,%rdx,4)
	call	getchar@PLT
	movb	%al, -40049(%rbp)
	jmp	.L13
.L4:
	cmpb	$93, -40049(%rbp)
	jne	.L6
	movl	-40048(%rbp), %eax
	movslq	%eax, %rsi
	leaq	-40032(%rbp), %rax
	leaq	compare_int(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -40040(%rbp)
	jmp	.L7
.L8:
	movl	-40040(%rbp), %eax
	cltq
	movl	-40032(%rbp,%rax,4), %eax
	addl	%eax, -40044(%rbp)
	addl	$1, -40040(%rbp)
.L7:
	movl	-40048(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cmpl	%eax, -40040(%rbp)
	jl	.L8
	movl	-40044(%rbp), %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	jmp	.L15
.L6:
	movsbl	-40049(%rbp), %eax
	subl	$48, %eax
	movl	%eax, -40036(%rbp)
	call	getchar@PLT
	movb	%al, -40049(%rbp)
	jmp	.L10
.L12:
	movl	-40036(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movsbl	-40049(%rbp), %eax
	subl	$48, %eax
	addl	%edx, %eax
	movl	%eax, -40036(%rbp)
	call	getchar@PLT
	movb	%al, -40049(%rbp)
.L10:
	cmpb	$47, -40049(%rbp)
	jle	.L11
	cmpb	$57, -40049(%rbp)
	jle	.L12
.L11:
	movl	-40036(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-40048(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -40048(%rbp)
	movl	%ecx, %edx
	shrl	$31, %edx
	addl	%ecx, %edx
	sarl	%edx
	cltq
	movl	%edx, -40032(%rbp,%rax,4)
	jmp	.L13
.L15:
	call	__stack_chk_fail@PLT
.L14:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	minimum_vote, .-minimum_vote
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.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	$16, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12(%rbp)
	jmp	.L17
.L19:
	nop
.L18:
	call	getchar@PLT
	cmpl	$91, %eax
	jne	.L18
	movl	$0, %eax
	call	minimum_vote
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -12(%rbp)
.L17:
	movl	-16(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L19
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	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	compare_int
	.type	compare_int, @function
compare_int:
.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), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	compare_int, .-compare_int
	.globl	minimum_vote
	.type	minimum_vote, @function
minimum_vote:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	leaq	-36864(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3192, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movl	$0, -40048(%rbp)
	movl	$0, -40044(%rbp)
	call	getchar@PLT
	movb	%al, -40049(%rbp)
.L13:
	cmpb	$91, -40049(%rbp)
	jne	.L4
	movl	-40048(%rbp), %ebx
	leal	1(%rbx), %eax
	movl	%eax, -40048(%rbp)
	movl	$0, %eax
	call	minimum_vote
	movslq	%ebx, %rdx
	movl	%eax, -40032(%rbp,%rdx,4)
	call	getchar@PLT
	movb	%al, -40049(%rbp)
	jmp	.L13
.L4:
	cmpb	$93, -40049(%rbp)
	jne	.L6
	movl	-40048(%rbp), %eax
	movslq	%eax, %rsi
	leaq	-40032(%rbp), %rax
	leaq	compare_int(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -40040(%rbp)
	jmp	.L7
.L8:
	movl	-40040(%rbp), %eax
	cltq
	movl	-40032(%rbp,%rax,4), %eax
	addl	%eax, -40044(%rbp)
	addl	$1, -40040(%rbp)
.L7:
	movl	-40048(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cmpl	%eax, -40040(%rbp)
	jl	.L8
	movl	-40044(%rbp), %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	jmp	.L15
.L6:
	movsbl	-40049(%rbp), %eax
	subl	$48, %eax
	movl	%eax, -40036(%rbp)
	call	getchar@PLT
	movb	%al, -40049(%rbp)
	jmp	.L10
.L12:
	movl	-40036(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movsbl	-40049(%rbp), %eax
	subl	$48, %eax
	addl	%edx, %eax
	movl	%eax, -40036(%rbp)
	call	getchar@PLT
	movb	%al, -40049(%rbp)
.L10:
	cmpb	$47, -40049(%rbp)
	jle	.L11
	cmpb	$57, -40049(%rbp)
	jle	.L12
.L11:
	movl	-40036(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-40048(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -40048(%rbp)
	movl	%ecx, %edx
	shrl	$31, %edx
	addl	%ecx, %edx
	sarl	%edx
	cltq
	movl	%edx, -40032(%rbp,%rax,4)
	jmp	.L13
.L15:
	call	__stack_chk_fail@PLT
.L14:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	minimum_vote, .-minimum_vote
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.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	$16, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12(%rbp)
	jmp	.L17
.L19:
	nop
.L18:
	call	getchar@PLT
	cmpl	$91, %eax
	jne	.L18
	movl	$0, %eax
	call	minimum_vote
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -12(%rbp)
.L17:
	movl	-16(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L19
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	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:
