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>

#define LIMIT_YABASI 150
#define MAX_VILLAGER 100

typedef struct  {
    int weight;
    int time_s, time_e;
    int flag;
} Villager;

Villager vi_set[MAX_VILLAGER];


int compare(const void *a, const void *b) {
    return ((Villager*)a)->time_s - ((Villager*)b)->time_s;
}


int main(void) {
    int i, j, n, w, a, b, time, now_weight;
    int isBreak;

    while (EOF != scanf("%d", &n)) {
        if (n <= 0) {
            break;
        }

        isBreak = now_weight = time = 0;

        for (i = 0; i < n; i++) {
            scanf("%d %d %d", &w, &a, &b);

            vi_set[i].weight = w;
            vi_set[i].time_s = a;
            vi_set[i].time_e = b;
            vi_set[i].flag   = 0;
        }
        qsort(vi_set, n, sizeof(Villager), compare);

        for (i = 0; i < n; ++i) {
            time = vi_set[i].time_s;

            for (j = 0; j < i; ++j) {
                if (vi_set[j].flag == 1 && vi_set[j].time_e <= time) {
                    vi_set[j].flag = 0;
                    now_weight -= vi_set[j].weight;
                }
            }

            now_weight += vi_set[i].weight;
            vi_set[i].flag = 1;

            /* printf("weight is %d\n", now_weight); */
            if (LIMIT_YABASI < now_weight) {
                isBreak = 1;
                break;
            }
        }

        printf("%s\n", (isBreak == 1)?("NG"):("OK"));
    }

    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	vi_set
	.bss
	.align 32
	.type	vi_set, @object
	.size	vi_set, 1600
vi_set:
	.zero	1600
	.text
	.globl	compare
	.type	compare, @function
compare:
.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	4(%rax), %edx
	movq	-16(%rbp), %rax
	movl	4(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	compare, .-compare
	.section	.rodata
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"NG"
.LC2:
	.string	"OK"
.LC3:
	.string	"%d"
	.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
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L4
.L18:
	movl	-44(%rbp), %eax
	testl	%eax, %eax
	jle	.L21
	movl	$0, -12(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, -16(%rbp)
	movl	$0, -28(%rbp)
	jmp	.L7
.L8:
	leaq	-32(%rbp), %rcx
	leaq	-36(%rbp), %rdx
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-40(%rbp), %eax
	movl	-28(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	leaq	vi_set(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-36(%rbp), %eax
	movl	-28(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	leaq	4+vi_set(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-32(%rbp), %eax
	movl	-28(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	leaq	8+vi_set(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-28(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	12+vi_set(%rip), %rax
	movl	$0, (%rdx,%rax)
	addl	$1, -28(%rbp)
.L7:
	movl	-44(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L8
	movl	-44(%rbp), %eax
	cltq
	leaq	compare(%rip), %rdx
	movq	%rdx, %rcx
	movl	$16, %edx
	movq	%rax, %rsi
	leaq	vi_set(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -28(%rbp)
	jmp	.L9
.L15:
	movl	-28(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	4+vi_set(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -12(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L10
.L12:
	movl	-24(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	12+vi_set(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L11
	movl	-24(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	8+vi_set(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L11
	movl	-24(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	12+vi_set(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-24(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	vi_set(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	%eax, -20(%rbp)
.L11:
	addl	$1, -24(%rbp)
.L10:
	movl	-24(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L12
	movl	-28(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	vi_set(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, -20(%rbp)
	movl	-28(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	12+vi_set(%rip), %rax
	movl	$1, (%rdx,%rax)
	cmpl	$150, -20(%rbp)
	jle	.L13
	movl	$1, -16(%rbp)
	jmp	.L14
.L13:
	addl	$1, -28(%rbp)
.L9:
	movl	-44(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L15
.L14:
	cmpl	$1, -16(%rbp)
	jne	.L16
	leaq	.LC1(%rip), %rax
	jmp	.L17
.L16:
	leaq	.LC2(%rip), %rax
.L17:
	movq	%rax, %rdi
	call	puts@PLT
.L4:
	leaq	-44(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	jne	.L18
	jmp	.L6
.L21:
	nop
.L6:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	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	compare
	.type	compare, @function
compare:
.LFB39:
	.cfi_startproc
	endbr64
	movl	4(%rdi), %eax
	subl	4(%rsi), %eax
	ret
	.cfi_endproc
.LFE39:
	.size	compare, .-compare
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"OK"
.LC1:
	.string	"NG"
.LC2:
	.string	"%d %d %d"
.LC3:
	.string	"%d"
	.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
	leaq	.LC2(%rip), %r14
	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	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L4:
	movq	8(%rsp), %rsi
	xorl	%eax, %eax
	leaq	.LC3(%rip), %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L5
	movl	24(%rsp), %eax
	testl	%eax, %eax
	jle	.L5
	leaq	vi_set(%rip), %rbx
	xorl	%ebp, %ebp
	leaq	36(%rsp), %r15
	leaq	32(%rsp), %r13
	leaq	28(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r15, %rcx
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	addq	$16, %rbx
	call	__isoc99_scanf@PLT
	movl	36(%rsp), %eax
	movd	28(%rsp), %xmm0
	movl	$0, -4(%rbx)
	movd	32(%rsp), %xmm1
	movl	%eax, -8(%rbx)
	movl	24(%rsp), %eax
	punpckldq	%xmm1, %xmm0
	movq	%xmm0, -16(%rbx)
	cmpl	%ebp, %eax
	jg	.L6
	leaq	compare(%rip), %rcx
	movl	$16, %edx
	leaq	vi_set(%rip), %rdi
	movslq	%eax, %rsi
	call	qsort@PLT
	movl	24(%rsp), %r8d
	xorl	%edi, %edi
	xorl	%ecx, %ecx
	leaq	16+vi_set(%rip), %rdx
	testl	%r8d, %r8d
	jle	.L13
	.p2align 4,,10
	.p2align 3
.L9:
	addl	-16(%rdx), %ecx
	movl	$1, -4(%rdx)
	cmpl	$150, %ecx
	jg	.L16
	addl	$1, %edi
	cmpl	%r8d, %edi
	je	.L13
	movl	4(%rdx), %esi
	leaq	vi_set(%rip), %rax
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L10:
	addq	$16, %rax
	cmpq	%rdx, %rax
	je	.L22
.L11:
	cmpl	$1, 12(%rax)
	jne	.L10
	cmpl	%esi, 8(%rax)
	jg	.L10
	movl	$0, 12(%rax)
	subl	(%rax), %ecx
	addq	$16, %rax
	cmpq	%rdx, %rax
	jne	.L11
	.p2align 4,,10
	.p2align 3
.L22:
	addq	$16, %rdx
	jmp	.L9
.L13:
	leaq	.LC0(%rip), %rdi
.L8:
	call	puts@PLT
	jmp	.L4
.L16:
	leaq	.LC1(%rip), %rdi
	jmp	.L8
.L5:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L23
	addq	$56, %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
	.globl	vi_set
	.bss
	.align 32
	.type	vi_set, @object
	.size	vi_set, 1600
vi_set:
	.zero	1600
	.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
	.type	compare, @function
compare:
.LFB39:
	.cfi_startproc
	endbr64
	movl	4(%rdi), %eax
	subl	4(%rsi), %eax
	ret
	.cfi_endproc
.LFE39:
	.size	compare, .-compare
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"OK"
.LC1:
	.string	"NG"
.LC2:
	.string	"%d %d %d"
.LC3:
	.string	"%d"
	.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
	leaq	.LC2(%rip), %r14
	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	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L4:
	movq	8(%rsp), %rsi
	xorl	%eax, %eax
	leaq	.LC3(%rip), %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L5
	movl	24(%rsp), %eax
	testl	%eax, %eax
	jle	.L5
	leaq	vi_set(%rip), %rbx
	xorl	%ebp, %ebp
	leaq	36(%rsp), %r15
	leaq	32(%rsp), %r13
	leaq	28(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r15, %rcx
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	addq	$16, %rbx
	call	__isoc99_scanf@PLT
	movl	36(%rsp), %eax
	movd	28(%rsp), %xmm0
	movl	$0, -4(%rbx)
	movd	32(%rsp), %xmm1
	movl	%eax, -8(%rbx)
	movl	24(%rsp), %eax
	punpckldq	%xmm1, %xmm0
	movq	%xmm0, -16(%rbx)
	cmpl	%ebp, %eax
	jg	.L6
	leaq	compare(%rip), %rcx
	movl	$16, %edx
	leaq	vi_set(%rip), %rdi
	movslq	%eax, %rsi
	call	qsort@PLT
	movl	24(%rsp), %r8d
	xorl	%edi, %edi
	xorl	%ecx, %ecx
	leaq	16+vi_set(%rip), %rdx
	testl	%r8d, %r8d
	jle	.L13
	.p2align 4,,10
	.p2align 3
.L9:
	addl	-16(%rdx), %ecx
	movl	$1, -4(%rdx)
	cmpl	$150, %ecx
	jg	.L16
	addl	$1, %edi
	cmpl	%r8d, %edi
	je	.L13
	movl	4(%rdx), %esi
	leaq	vi_set(%rip), %rax
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L10:
	addq	$16, %rax
	cmpq	%rdx, %rax
	je	.L22
.L11:
	cmpl	$1, 12(%rax)
	jne	.L10
	cmpl	%esi, 8(%rax)
	jg	.L10
	movl	$0, 12(%rax)
	subl	(%rax), %ecx
	addq	$16, %rax
	cmpq	%rdx, %rax
	jne	.L11
	.p2align 4,,10
	.p2align 3
.L22:
	addq	$16, %rdx
	jmp	.L9
.L13:
	leaq	.LC0(%rip), %rdi
.L8:
	call	puts@PLT
	jmp	.L4
.L16:
	leaq	.LC1(%rip), %rdi
	jmp	.L8
.L5:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L23
	addq	$56, %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
	.globl	vi_set
	.bss
	.align 32
	.type	vi_set, @object
	.size	vi_set, 1600
vi_set:
	.zero	1600
	.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>

#define LIMIT_YABASI 150
#define MAX_VILLAGER 100

typedef struct  {
    int weight;
    int time_s, time_e;
    int flag;
} Villager;

Villager vi_set[MAX_VILLAGER];


int compare(const void *a, const void *b) {
    return ((Villager*)a)->time_s - ((Villager*)b)->time_s;
}


int main(void) {
    int i, j, n, w, a, b, time, now_weight;
    int isBreak;

    while (EOF != scanf("%d", &n)) {
        if (n <= 0) {
            break;
        }

        isBreak = now_weight = time = 0;

        for (i = 0; i < n; i++) {
            scanf("%d %d %d", &w, &a, &b);

            vi_set[i].weight = w;
            vi_set[i].time_s = a;
            vi_set[i].time_e = b;
            vi_set[i].flag   = 0;
        }
        qsort(vi_set, n, sizeof(Villager), compare);

        for (i = 0; i < n; ++i) {
            time = vi_set[i].time_s;

            for (j = 0; j < i; ++j) {
                if (vi_set[j].flag == 1 && vi_set[j].time_e <= time) {
                    vi_set[j].flag = 0;
                    now_weight -= vi_set[j].weight;
                }
            }

            now_weight += vi_set[i].weight;
            vi_set[i].flag = 1;

            /* printf("weight is %d\n", now_weight); */
            if (LIMIT_YABASI < now_weight) {
                isBreak = 1;
                break;
            }
        }

        printf("%s\n", (isBreak == 1)?("NG"):("OK"));
    }

    return 0;
}
3
80 0 30
50 5 25
90 27 50
3
80 0 30
70 5 25
71 30 84
0
 3
80 0 15
64 5 25
149 27 50
3
80 0 10
70 10 25
22 30 84
0
 3
80 0 30
50 5 25
90 27 50
3
80 0 30
70 5 25
71 23 50
0
 3
1 0 30
50 5 25
90 28 50
3
80 0 40
70 5 25
71 30 84
0
 3
80 0 15
64 3 49
149 27 50
0
80 1 10
70 10 25
22 30 84
0
 3
80 0 8
50 5 29
90 51 50
0
80 0 10
70 5 25
71 3 84
0
 3
80 0 30
50 5 25
90 27 50
3
80 0 10
70 5 25
71 30 84
0
 3
80 0 30
50 5 25
149 27 50
3
80 0 10
70 5 25
71 30 84
0
 3
80 0 30
50 5 25
149 27 50
3
80 0 10
70 5 25
22 30 84
0
 3
80 0 30
50 5 25
149 27 50
3
80 0 10
70 10 25
22 30 84
0

NG
OK
 OK
OK
 NG
NG
 OK
NG
 NG
 OK
 NG
OK
 NG
OK
 NG
OK
 NG
OK

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>

#define LIMIT_YABASI 150
#define MAX_VILLAGER 100

typedef struct  {
    int weight;
    int time_s, time_e;
    int flag;
} Villager;

Villager vi_set[MAX_VILLAGER];


int compare(const void *a, const void *b) {
    return ((Villager*)a)->time_s - ((Villager*)b)->time_s;
}


int main(void) {
    int i, j, n, w, a, b, time, now_weight;
    int isBreak;

    while (EOF != scanf("%d", &n)) {
        if (n <= 0) {
            break;
        }

        isBreak = now_weight = time = 0;

        for (i = 0; i < n; i++) {
            scanf("%d %d %d", &w, &a, &b);

            vi_set[i].weight = w;
            vi_set[i].time_s = a;
            vi_set[i].time_e = b;
            vi_set[i].flag   = 0;
        }
        qsort(vi_set, n, sizeof(Villager), compare);

        for (i = 0; i < n; ++i) {
            time = vi_set[i].time_s;

            for (j = 0; j < i; ++j) {
                if (vi_set[j].flag == 1 && vi_set[j].time_e <= time) {
                    vi_set[j].flag = 0;
                    now_weight -= vi_set[j].weight;
                }
            }

            now_weight += vi_set[i].weight;
            vi_set[i].flag = 1;

            /* printf("weight is %d\n", now_weight); */
            if (LIMIT_YABASI < now_weight) {
                isBreak = 1;
                break;
            }
        }

        printf("%s\n", (isBreak == 1)?("NG"):("OK"));
    }

    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	vi_set
	.bss
	.align 32
	.type	vi_set, @object
	.size	vi_set, 1600
vi_set:
	.zero	1600
	.text
	.globl	compare
	.type	compare, @function
compare:
.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	4(%rax), %edx
	movq	-16(%rbp), %rax
	movl	4(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	compare, .-compare
	.section	.rodata
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"NG"
.LC2:
	.string	"OK"
.LC3:
	.string	"%d"
	.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
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L4
.L18:
	movl	-44(%rbp), %eax
	testl	%eax, %eax
	jle	.L21
	movl	$0, -12(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, -16(%rbp)
	movl	$0, -28(%rbp)
	jmp	.L7
.L8:
	leaq	-32(%rbp), %rcx
	leaq	-36(%rbp), %rdx
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-40(%rbp), %eax
	movl	-28(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	leaq	vi_set(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-36(%rbp), %eax
	movl	-28(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	leaq	4+vi_set(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-32(%rbp), %eax
	movl	-28(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	leaq	8+vi_set(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-28(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	12+vi_set(%rip), %rax
	movl	$0, (%rdx,%rax)
	addl	$1, -28(%rbp)
.L7:
	movl	-44(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L8
	movl	-44(%rbp), %eax
	cltq
	leaq	compare(%rip), %rdx
	movq	%rdx, %rcx
	movl	$16, %edx
	movq	%rax, %rsi
	leaq	vi_set(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -28(%rbp)
	jmp	.L9
.L15:
	movl	-28(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	4+vi_set(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -12(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L10
.L12:
	movl	-24(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	12+vi_set(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L11
	movl	-24(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	8+vi_set(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L11
	movl	-24(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	12+vi_set(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-24(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	vi_set(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	%eax, -20(%rbp)
.L11:
	addl	$1, -24(%rbp)
.L10:
	movl	-24(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L12
	movl	-28(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	vi_set(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, -20(%rbp)
	movl	-28(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	12+vi_set(%rip), %rax
	movl	$1, (%rdx,%rax)
	cmpl	$150, -20(%rbp)
	jle	.L13
	movl	$1, -16(%rbp)
	jmp	.L14
.L13:
	addl	$1, -28(%rbp)
.L9:
	movl	-44(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L15
.L14:
	cmpl	$1, -16(%rbp)
	jne	.L16
	leaq	.LC1(%rip), %rax
	jmp	.L17
.L16:
	leaq	.LC2(%rip), %rax
.L17:
	movq	%rax, %rdi
	call	puts@PLT
.L4:
	leaq	-44(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	jne	.L18
	jmp	.L6
.L21:
	nop
.L6:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	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	vi_set
	.bss
	.align 32
	.type	vi_set, @object
	.size	vi_set, 1600
vi_set:
	.zero	1600
	.text
	.globl	compare
	.type	compare, @function
compare:
.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	4(%rax), %edx
	movq	-16(%rbp), %rax
	movl	4(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	compare, .-compare
	.section	.rodata
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"NG"
.LC2:
	.string	"OK"
.LC3:
	.string	"%d"
	.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
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L4
.L18:
	movl	-44(%rbp), %eax
	testl	%eax, %eax
	jle	.L21
	movl	$0, -12(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, -16(%rbp)
	movl	$0, -28(%rbp)
	jmp	.L7
.L8:
	leaq	-32(%rbp), %rcx
	leaq	-36(%rbp), %rdx
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-40(%rbp), %eax
	movl	-28(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	leaq	vi_set(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-36(%rbp), %eax
	movl	-28(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	leaq	4+vi_set(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-32(%rbp), %eax
	movl	-28(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	leaq	8+vi_set(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-28(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	12+vi_set(%rip), %rax
	movl	$0, (%rdx,%rax)
	addl	$1, -28(%rbp)
.L7:
	movl	-44(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L8
	movl	-44(%rbp), %eax
	cltq
	leaq	compare(%rip), %rdx
	movq	%rdx, %rcx
	movl	$16, %edx
	movq	%rax, %rsi
	leaq	vi_set(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -28(%rbp)
	jmp	.L9
.L15:
	movl	-28(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	4+vi_set(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -12(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L10
.L12:
	movl	-24(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	12+vi_set(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L11
	movl	-24(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	8+vi_set(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L11
	movl	-24(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	12+vi_set(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-24(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	vi_set(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	%eax, -20(%rbp)
.L11:
	addl	$1, -24(%rbp)
.L10:
	movl	-24(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L12
	movl	-28(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	vi_set(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, -20(%rbp)
	movl	-28(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	12+vi_set(%rip), %rax
	movl	$1, (%rdx,%rax)
	cmpl	$150, -20(%rbp)
	jle	.L13
	movl	$1, -16(%rbp)
	jmp	.L14
.L13:
	addl	$1, -28(%rbp)
.L9:
	movl	-44(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L15
.L14:
	cmpl	$1, -16(%rbp)
	jne	.L16
	leaq	.LC1(%rip), %rax
	jmp	.L17
.L16:
	leaq	.LC2(%rip), %rax
.L17:
	movq	%rax, %rdi
	call	puts@PLT
.L4:
	leaq	-44(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	jne	.L18
	jmp	.L6
.L21:
	nop
.L6:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	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:
