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>

struct yosinagasayuri {
	int A, B;
};

int mareitaso(const void* x, const void* y) {
	int a = ((const struct yosinagasayuri*)x)->A, b = ((const struct yosinagasayuri*)y)->A;
	return a < b ? -1 : a > b;
}

int N, M;
struct yosinagasayuri yakusimaruhiroko[114514];

int mimorinnSize = 0;
int mimorinn[114514];

void mimorinnAdjust(int pos) {
	for (;;) {
		int maxPos = pos;
		int i;
		for (i = 1; i <= 2; i++) {
			int candidatePos = pos * 2 + i;
			if (candidatePos < mimorinnSize && mimorinn[maxPos] < mimorinn[candidatePos]) {
				maxPos = candidatePos;
			}
		}
		if (maxPos == pos) {
			if (pos == 0) break;
			pos = (pos - 1) / 2;
		} else {
			int t = mimorinn[pos];
			mimorinn[pos] = mimorinn[maxPos];
			mimorinn[maxPos] = t;
			pos = maxPos;
		}
	}
}

void mimorinnPut(int value) {
	mimorinn[mimorinnSize++] = value;
	mimorinnAdjust(mimorinnSize - 1);
}

int mimorinnGet(void) {
	int ret;
	if (mimorinnSize <= 0) return 0;
	ret = mimorinn[0];
	mimorinn[0] = mimorinn[--mimorinnSize];
	if (mimorinnSize > 0) mimorinnAdjust(0);
	return ret;
}

int main(void) {
	int i;
	int haradahitomi = 0;
	int nannzyouyosino = 0;
	if (scanf("%d%d", &N, &M) != 2) return 1;
	for (i = 0; i < N; i++) {
		if (scanf("%d%d", &yakusimaruhiroko[i].A, &yakusimaruhiroko[i].B) != 2) return 1;
	}
	qsort(yakusimaruhiroko, N, sizeof(*yakusimaruhiroko), mareitaso);
	for (i = 0; i <= M; i++) {
		while (nannzyouyosino < N && yakusimaruhiroko[nannzyouyosino].A <= i) {
			mimorinnPut(yakusimaruhiroko[nannzyouyosino++].B);
		}
		haradahitomi += mimorinnGet();
	}
	printf("%d\n", haradahitomi);
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	mareitaso
	.type	mareitaso, @function
mareitaso:
.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, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jl	.L2
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	setg	%al
	movzbl	%al, %eax
	jmp	.L4
.L2:
	movl	$-1, %eax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	mareitaso, .-mareitaso
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	M
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	yakusimaruhiroko
	.align 32
	.type	yakusimaruhiroko, @object
	.size	yakusimaruhiroko, 916112
yakusimaruhiroko:
	.zero	916112
	.globl	mimorinnSize
	.align 4
	.type	mimorinnSize, @object
	.size	mimorinnSize, 4
mimorinnSize:
	.zero	4
	.globl	mimorinn
	.align 32
	.type	mimorinn, @object
	.size	mimorinn, 458056
mimorinn:
	.zero	458056
	.text
	.globl	mimorinnAdjust
	.type	mimorinnAdjust, @function
mimorinnAdjust:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
.L13:
	movl	-20(%rbp), %eax
	movl	%eax, -16(%rbp)
	movl	$1, -12(%rbp)
	jmp	.L6
.L8:
	movl	-20(%rbp), %eax
	leal	(%rax,%rax), %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	movl	mimorinnSize(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jge	.L7
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	mimorinn(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	mimorinn(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L7
	movl	-4(%rbp), %eax
	movl	%eax, -16(%rbp)
.L7:
	addl	$1, -12(%rbp)
.L6:
	cmpl	$2, -12(%rbp)
	jle	.L8
	movl	-16(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jne	.L9
	cmpl	$0, -20(%rbp)
	je	.L15
	movl	-20(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -20(%rbp)
	jmp	.L13
.L9:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	mimorinn(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -8(%rbp)
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	mimorinn(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	mimorinn(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	mimorinn(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-16(%rbp), %eax
	movl	%eax, -20(%rbp)
	jmp	.L13
.L15:
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	mimorinnAdjust, .-mimorinnAdjust
	.globl	mimorinnPut
	.type	mimorinnPut, @function
mimorinnPut:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$8, %rsp
	movl	%edi, -4(%rbp)
	movl	mimorinnSize(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, mimorinnSize(%rip)
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	mimorinn(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	mimorinnSize(%rip), %eax
	subl	$1, %eax
	movl	%eax, %edi
	call	mimorinnAdjust
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	mimorinnPut, .-mimorinnPut
	.globl	mimorinnGet
	.type	mimorinnGet, @function
mimorinnGet:
.LFB9:
	.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
	movl	mimorinnSize(%rip), %eax
	testl	%eax, %eax
	jg	.L18
	movl	$0, %eax
	jmp	.L19
.L18:
	movl	mimorinn(%rip), %eax
	movl	%eax, -4(%rbp)
	movl	mimorinnSize(%rip), %eax
	subl	$1, %eax
	movl	%eax, mimorinnSize(%rip)
	movl	mimorinnSize(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	mimorinn(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, mimorinn(%rip)
	movl	mimorinnSize(%rip), %eax
	testl	%eax, %eax
	jle	.L20
	movl	$0, %edi
	call	mimorinnAdjust
.L20:
	movl	-4(%rbp), %eax
.L19:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	mimorinnGet, .-mimorinnGet
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB10:
	.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
	movl	$0, -8(%rbp)
	movl	$0, -4(%rbp)
	leaq	M(%rip), %rax
	movq	%rax, %rdx
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$2, %eax
	je	.L22
	movl	$1, %eax
	jmp	.L23
.L22:
	movl	$0, -12(%rbp)
	jmp	.L24
.L26:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	yakusimaruhiroko(%rip), %rax
	addq	%rdx, %rax
	leaq	4(%rax), %rdx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	yakusimaruhiroko(%rip), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$2, %eax
	je	.L25
	movl	$1, %eax
	jmp	.L23
.L25:
	addl	$1, -12(%rbp)
.L24:
	movl	N(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L26
	movl	N(%rip), %eax
	cltq
	leaq	mareitaso(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rsi
	leaq	yakusimaruhiroko(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -12(%rbp)
	jmp	.L27
.L30:
	movl	-4(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -4(%rbp)
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+yakusimaruhiroko(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %edi
	call	mimorinnPut
.L28:
	movl	N(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jge	.L29
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	yakusimaruhiroko(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -12(%rbp)
	jge	.L30
.L29:
	call	mimorinnGet
	addl	%eax, -8(%rbp)
	addl	$1, -12(%rbp)
.L27:
	movl	M(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L28
	movl	-8(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L23:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.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	mareitaso
	.type	mareitaso, @function
mareitaso:
.LFB39:
	.cfi_startproc
	endbr64
	movl	(%rsi), %eax
	cmpl	%eax, (%rdi)
	movl	$-1, %edx
	setg	%al
	movzbl	%al, %eax
	cmovl	%edx, %eax
	ret
	.cfi_endproc
.LFE39:
	.size	mareitaso, .-mareitaso
	.p2align 4
	.globl	mimorinnAdjust
	.type	mimorinnAdjust, @function
mimorinnAdjust:
.LFB40:
	.cfi_startproc
	endbr64
	movl	mimorinnSize(%rip), %r9d
	leaq	mimorinn(%rip), %rdx
	.p2align 4,,10
	.p2align 3
.L6:
	leal	(%rdi,%rdi), %eax
	leal	1(%rax), %esi
	addl	$2, %eax
	cmpl	%r9d, %esi
	jge	.L7
.L16:
	movslq	%esi, %rcx
	movl	(%rdx,%rcx,4), %r8d
	movslq	%edi, %rcx
	cmpl	%r8d, (%rdx,%rcx,4)
	jge	.L7
	cmpl	%eax, %r9d
	jg	.L15
.L13:
	movl	%esi, %eax
.L8:
	cmpl	%eax, %edi
	je	.L12
	movl	(%rdx,%rcx,4), %esi
	movl	%eax, %edi
	movl	%r8d, (%rdx,%rcx,4)
	movslq	%eax, %rcx
	leal	(%rdi,%rdi), %eax
	movl	%esi, (%rdx,%rcx,4)
	leal	1(%rax), %esi
	addl	$2, %eax
	cmpl	%r9d, %esi
	jl	.L16
.L7:
	cmpl	%eax, %r9d
	jle	.L12
	movslq	%eax, %rcx
	movl	(%rdx,%rcx,4), %r8d
	movslq	%edi, %rcx
	cmpl	(%rdx,%rcx,4), %r8d
	jg	.L8
	.p2align 4,,10
	.p2align 3
.L12:
	testl	%edi, %edi
	je	.L5
	subl	$1, %edi
	movl	%edi, %eax
	shrl	$31, %eax
	addl	%eax, %edi
	sarl	%edi
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L15:
	movslq	%eax, %r10
	movl	(%rdx,%r10,4), %r10d
	cmpl	%r10d, %r8d
	jge	.L13
	movl	%r10d, %r8d
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L5:
	ret
	.cfi_endproc
.LFE40:
	.size	mimorinnAdjust, .-mimorinnAdjust
	.p2align 4
	.globl	mimorinnPut
	.type	mimorinnPut, @function
mimorinnPut:
.LFB41:
	.cfi_startproc
	endbr64
	movslq	mimorinnSize(%rip), %rax
	leaq	mimorinn(%rip), %rsi
	leal	1(%rax), %r10d
	movl	%edi, (%rsi,%rax,4)
	movq	%rax, %r9
	movl	%r10d, mimorinnSize(%rip)
	.p2align 4,,10
	.p2align 3
.L18:
	leal	(%rax,%rax), %edx
	leal	2(%rdx), %ecx
	cmpl	%edx, %r9d
	jle	.L19
.L28:
	addl	$1, %edx
	movslq	%edx, %rdi
	movl	(%rsi,%rdi,4), %r8d
	movslq	%eax, %rdi
	cmpl	%r8d, (%rsi,%rdi,4)
	jge	.L19
	cmpl	%ecx, %r10d
	jg	.L27
.L25:
	movl	%edx, %ecx
.L20:
	cmpl	%ecx, %eax
	je	.L24
	movl	(%rsi,%rdi,4), %edx
	movslq	%ecx, %rax
	movl	%r8d, (%rsi,%rdi,4)
	movl	%edx, (%rsi,%rax,4)
	movl	%ecx, %eax
	leal	(%rax,%rax), %edx
	leal	2(%rdx), %ecx
	cmpl	%edx, %r9d
	jg	.L28
.L19:
	cmpl	%ecx, %r10d
	jle	.L24
	movslq	%ecx, %rdx
	movslq	%eax, %rdi
	movl	(%rsi,%rdx,4), %r8d
	cmpl	%r8d, (%rsi,%rdi,4)
	jl	.L20
	.p2align 4,,10
	.p2align 3
.L24:
	testl	%eax, %eax
	je	.L17
	subl	$1, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L27:
	movslq	%ecx, %r11
	movl	(%rsi,%r11,4), %r11d
	cmpl	%r11d, %r8d
	jge	.L25
	movl	%r11d, %r8d
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L17:
	ret
	.cfi_endproc
.LFE41:
	.size	mimorinnPut, .-mimorinnPut
	.p2align 4
	.globl	mimorinnGet
	.type	mimorinnGet, @function
mimorinnGet:
.LFB42:
	.cfi_startproc
	endbr64
	movl	mimorinnSize(%rip), %edi
	xorl	%r10d, %r10d
	testl	%edi, %edi
	jle	.L29
	subl	$1, %edi
	leaq	mimorinn(%rip), %rcx
	movl	mimorinn(%rip), %r10d
	movslq	%edi, %rax
	movl	%edi, mimorinnSize(%rip)
	movl	(%rcx,%rax,4), %eax
	movl	%eax, mimorinn(%rip)
	jne	.L44
.L29:
	movl	%r10d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L44:
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L31:
	leal	(%rdx,%rdx), %eax
	leal	1(%rax), %r8d
	addl	$2, %eax
	cmpl	%r8d, %edi
	jle	.L32
.L46:
	movslq	%r8d, %rsi
	movl	(%rcx,%rsi,4), %r9d
	movslq	%edx, %rsi
	cmpl	%r9d, (%rcx,%rsi,4)
	jge	.L32
	cmpl	%eax, %edi
	jg	.L45
.L39:
	movl	%r8d, %eax
.L33:
	cmpl	%eax, %edx
	je	.L36
	movl	(%rcx,%rsi,4), %r8d
	movslq	%eax, %rdx
	movl	%r9d, (%rcx,%rsi,4)
	movl	%r8d, (%rcx,%rdx,4)
	movl	%eax, %edx
	leal	(%rdx,%rdx), %eax
	leal	1(%rax), %r8d
	addl	$2, %eax
	cmpl	%r8d, %edi
	jg	.L46
.L32:
	cmpl	%eax, %edi
	jle	.L36
	movslq	%eax, %rsi
	movl	(%rcx,%rsi,4), %r9d
	movslq	%edx, %rsi
	cmpl	%r9d, (%rcx,%rsi,4)
	jl	.L33
	.p2align 4,,10
	.p2align 3
.L36:
	testl	%edx, %edx
	je	.L29
	subl	$1, %edx
	movl	%edx, %eax
	shrl	$31, %eax
	addl	%eax, %edx
	sarl	%edx
	jmp	.L31
	.p2align 4,,10
	.p2align 3
.L45:
	movslq	%eax, %r11
	movl	(%rcx,%r11,4), %r11d
	cmpl	%r11d, %r9d
	jge	.L39
	movl	%r11d, %r9d
	jmp	.L33
	.cfi_endproc
.LFE42:
	.size	mimorinnGet, .-mimorinnGet
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB43:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%eax, %eax
	leaq	M(%rip), %rdx
	leaq	N(%rip), %rsi
	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
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	call	__isoc99_scanf@PLT
	cmpl	$2, %eax
	jne	.L51
	movl	N(%rip), %eax
	testl	%eax, %eax
	jle	.L106
	leaq	yakusimaruhiroko(%rip), %rax
	xorl	%ebp, %ebp
	movq	%rax, (%rsp)
	movq	%rax, %rbx
	jmp	.L52
.L107:
	movl	N(%rip), %eax
	addl	$1, %ebp
	addq	$8, %rbx
	cmpl	%ebp, %eax
	jle	.L50
.L52:
	xorl	%eax, %eax
	leaq	4(%rbx), %rdx
	movq	%rbx, %rsi
	movq	%r12, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$2, %eax
	je	.L107
.L51:
	movl	$1, %eax
.L47:
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L106:
	.cfi_restore_state
	leaq	yakusimaruhiroko(%rip), %rdi
	movq	%rdi, (%rsp)
.L50:
	movq	(%rsp), %rdi
	movslq	%eax, %rsi
	movl	$8, %edx
	xorl	%r14d, %r14d
	leaq	mareitaso(%rip), %rcx
	call	qsort@PLT
	movl	M(%rip), %eax
	movl	%eax, 12(%rsp)
	testl	%eax, %eax
	js	.L54
	movl	N(%rip), %r13d
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	xorl	%r14d, %r14d
	movl	mimorinnSize(%rip), %edx
	xorl	%r12d, %r12d
	leaq	mimorinn(%rip), %rcx
	cmpl	%r15d, %r13d
	jle	.L85
.L111:
	movq	(%rsp), %rdi
	movslq	%r15d, %rsi
	movslq	%edx, %r8
	movl	%r15d, %r11d
	leaq	(%rdi,%rsi,8), %r10
	.p2align 4,,10
	.p2align 3
.L62:
	cmpl	%r12d, (%r10)
	jg	.L61
	movl	4(%r10), %eax
	addl	$1, %r11d
	leal	1(%rdx), %r9d
	movl	%eax, (%rcx,%r8,4)
	.p2align 4,,10
	.p2align 3
.L55:
	leal	(%rdx,%rdx), %eax
	leal	2(%rax), %ebx
	cmpl	%r8d, %eax
	jge	.L56
.L109:
	addl	$1, %eax
	movslq	%eax, %rsi
	movl	(%rcx,%rsi,4), %edi
	movslq	%edx, %rsi
	cmpl	%edi, (%rcx,%rsi,4)
	jge	.L56
	cmpl	%ebx, %r9d
	jg	.L108
.L57:
	cmpl	%eax, %edx
	je	.L83
	movl	(%rcx,%rsi,4), %ebx
	movslq	%eax, %rdx
	movl	%edi, (%rcx,%rsi,4)
	movl	%ebx, (%rcx,%rdx,4)
	movl	%eax, %edx
	leal	(%rdx,%rdx), %eax
	leal	2(%rax), %ebx
	cmpl	%r8d, %eax
	jl	.L109
.L56:
	cmpl	%ebx, %r9d
	jle	.L83
	movslq	%ebx, %rax
	movslq	%edx, %rsi
	movl	(%rcx,%rax,4), %edi
	cmpl	(%rcx,%rsi,4), %edi
	jle	.L83
	movl	%ebx, %eax
	jmp	.L57
	.p2align 4,,10
	.p2align 3
.L83:
	testl	%edx, %edx
	je	.L59
	leal	-1(%rdx), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%eax, %edx
	sarl	%edx
	jmp	.L55
	.p2align 4,,10
	.p2align 3
.L108:
	movslq	%ebx, %rbp
	movl	(%rcx,%rbp,4), %ebp
	cmpl	%ebp, %edi
	jge	.L57
	movl	%ebp, %edi
	movl	%ebx, %eax
	jmp	.L57
	.p2align 4,,10
	.p2align 3
.L59:
	addq	$1, %r8
	addq	$8, %r10
	movl	$1, %eax
	movl	%r9d, %edx
	cmpl	%r13d, %r11d
	jne	.L62
.L61:
	xorl	%r10d, %r10d
	testl	%edx, %edx
	jle	.L64
	subl	$1, %edx
	movl	(%rcx), %r10d
	movslq	%edx, %rax
	movl	(%rcx,%rax,4), %eax
	movl	%eax, (%rcx)
	jne	.L88
.L89:
	movl	$1, %eax
.L64:
	addl	%r10d, %r14d
	addl	$1, %r12d
	cmpl	%r12d, 12(%rsp)
	jl	.L70
	cmpl	%r15d, %r13d
	jle	.L110
	movl	%r11d, %r15d
	cmpl	%r15d, %r13d
	jg	.L111
.L85:
	movl	%r15d, %r11d
	jmp	.L61
	.p2align 4,,10
	.p2align 3
.L110:
	leaq	mimorinn(%rip), %rdi
	jmp	.L79
.L72:
	addl	%r10d, %r14d
	addl	$1, %r12d
	cmpl	%r12d, 12(%rsp)
	jl	.L70
.L79:
	xorl	%r10d, %r10d
	testl	%edx, %edx
	jle	.L72
	subl	$1, %edx
	movl	(%rdi), %r10d
	movslq	%edx, %rax
	movl	(%rdi,%rax,4), %eax
	movl	%eax, (%rdi)
	movl	$1, %eax
	je	.L72
	xorl	%ecx, %ecx
.L75:
	leal	(%rcx,%rcx), %eax
	leal	1(%rax), %r9d
	addl	$2, %eax
	cmpl	%r9d, %edx
	jle	.L74
.L113:
	movslq	%r9d, %rsi
	movl	(%rdi,%rsi,4), %r8d
	movslq	%ecx, %rsi
	cmpl	%r8d, (%rdi,%rsi,4)
	jge	.L74
	cmpl	%eax, %edx
	jg	.L112
.L93:
	movl	%r9d, %eax
.L76:
	cmpl	%eax, %ecx
	je	.L77
	movl	(%rdi,%rsi,4), %r9d
	movslq	%eax, %rcx
	movl	%r8d, (%rdi,%rsi,4)
	movl	%r9d, (%rdi,%rcx,4)
	movl	%eax, %ecx
	leal	(%rcx,%rcx), %eax
	leal	1(%rax), %r9d
	addl	$2, %eax
	cmpl	%r9d, %edx
	jg	.L113
.L74:
	cmpl	%eax, %edx
	jle	.L77
	movslq	%eax, %rsi
	movl	(%rdi,%rsi,4), %r8d
	movslq	%ecx, %rsi
	cmpl	(%rdi,%rsi,4), %r8d
	jg	.L76
.L77:
	testl	%ecx, %ecx
	je	.L95
	subl	$1, %ecx
	movl	%ecx, %eax
	shrl	$31, %eax
	addl	%eax, %ecx
	sarl	%ecx
	jmp	.L75
.L112:
	movslq	%eax, %r11
	movl	(%rdi,%r11,4), %r11d
	cmpl	%r8d, %r11d
	jle	.L93
	movl	%r11d, %r8d
	jmp	.L76
.L95:
	movl	$1, %eax
	jmp	.L72
.L88:
	xorl	%edi, %edi
.L65:
	leal	(%rdi,%rdi), %eax
	leal	1(%rax), %r8d
	leal	2(%rax), %esi
	cmpl	%edx, %r8d
	jge	.L66
.L115:
	movslq	%r8d, %rax
	movl	(%rcx,%rax,4), %r9d
	movslq	%edi, %rax
	cmpl	%r9d, (%rcx,%rax,4)
	jge	.L66
	cmpl	%esi, %edx
	jg	.L114
.L67:
	cmpl	%r8d, %edi
	je	.L81
	movl	(%rcx,%rax,4), %esi
	movl	%r8d, %edi
	movl	%r9d, (%rcx,%rax,4)
	movslq	%r8d, %rax
	movl	%esi, (%rcx,%rax,4)
	leal	(%rdi,%rdi), %eax
	leal	1(%rax), %r8d
	leal	2(%rax), %esi
	cmpl	%edx, %r8d
	jl	.L115
.L66:
	cmpl	%esi, %edx
	jle	.L81
	movslq	%esi, %rax
	movl	(%rcx,%rax,4), %r9d
	movslq	%edi, %rax
	cmpl	%r9d, (%rcx,%rax,4)
	jge	.L81
.L82:
	movl	%esi, %r8d
	jmp	.L67
.L81:
	testl	%edi, %edi
	je	.L89
	leal	-1(%rdi), %eax
	movl	%eax, %edi
	shrl	$31, %edi
	addl	%eax, %edi
	sarl	%edi
	jmp	.L65
.L114:
	movslq	%esi, %rbx
	movl	(%rcx,%rbx,4), %ebx
	cmpl	%ebx, %r9d
	jge	.L67
	movl	%ebx, %r9d
	jmp	.L82
.L70:
	testb	%al, %al
	je	.L54
	movl	%edx, mimorinnSize(%rip)
.L54:
	movl	%r14d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%eax, %eax
	jmp	.L47
	.cfi_endproc
.LFE43:
	.size	main, .-main
	.globl	mimorinn
	.bss
	.align 32
	.type	mimorinn, @object
	.size	mimorinn, 458056
mimorinn:
	.zero	458056
	.globl	mimorinnSize
	.align 4
	.type	mimorinnSize, @object
	.size	mimorinnSize, 4
mimorinnSize:
	.zero	4
	.globl	yakusimaruhiroko
	.align 32
	.type	yakusimaruhiroko, @object
	.size	yakusimaruhiroko, 916112
yakusimaruhiroko:
	.zero	916112
	.globl	M
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.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	mareitaso
	.type	mareitaso, @function
mareitaso:
.LFB39:
	.cfi_startproc
	endbr64
	movl	(%rsi), %eax
	cmpl	%eax, (%rdi)
	movl	$-1, %edx
	setg	%al
	movzbl	%al, %eax
	cmovl	%edx, %eax
	ret
	.cfi_endproc
.LFE39:
	.size	mareitaso, .-mareitaso
	.p2align 4
	.globl	mimorinnAdjust
	.type	mimorinnAdjust, @function
mimorinnAdjust:
.LFB40:
	.cfi_startproc
	endbr64
	movl	mimorinnSize(%rip), %r9d
	leaq	mimorinn(%rip), %rdx
	.p2align 4,,10
	.p2align 3
.L6:
	leal	(%rdi,%rdi), %eax
	leal	1(%rax), %esi
	addl	$2, %eax
	cmpl	%r9d, %esi
	jge	.L7
.L16:
	movslq	%esi, %rcx
	movl	(%rdx,%rcx,4), %r8d
	movslq	%edi, %rcx
	cmpl	%r8d, (%rdx,%rcx,4)
	jge	.L7
	cmpl	%eax, %r9d
	jg	.L15
.L13:
	movl	%esi, %eax
.L8:
	cmpl	%eax, %edi
	je	.L12
	movl	(%rdx,%rcx,4), %esi
	movl	%eax, %edi
	movl	%r8d, (%rdx,%rcx,4)
	movslq	%eax, %rcx
	leal	(%rdi,%rdi), %eax
	movl	%esi, (%rdx,%rcx,4)
	leal	1(%rax), %esi
	addl	$2, %eax
	cmpl	%r9d, %esi
	jl	.L16
.L7:
	cmpl	%eax, %r9d
	jle	.L12
	movslq	%eax, %rcx
	movl	(%rdx,%rcx,4), %r8d
	movslq	%edi, %rcx
	cmpl	(%rdx,%rcx,4), %r8d
	jg	.L8
	.p2align 4,,10
	.p2align 3
.L12:
	testl	%edi, %edi
	je	.L5
	subl	$1, %edi
	movl	%edi, %eax
	shrl	$31, %eax
	addl	%eax, %edi
	sarl	%edi
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L15:
	movslq	%eax, %r10
	movl	(%rdx,%r10,4), %r10d
	cmpl	%r10d, %r8d
	jge	.L13
	movl	%r10d, %r8d
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L5:
	ret
	.cfi_endproc
.LFE40:
	.size	mimorinnAdjust, .-mimorinnAdjust
	.p2align 4
	.globl	mimorinnPut
	.type	mimorinnPut, @function
mimorinnPut:
.LFB41:
	.cfi_startproc
	endbr64
	movslq	mimorinnSize(%rip), %rax
	leaq	mimorinn(%rip), %rsi
	leal	1(%rax), %r10d
	movl	%edi, (%rsi,%rax,4)
	movq	%rax, %r9
	movl	%r10d, mimorinnSize(%rip)
	.p2align 4,,10
	.p2align 3
.L18:
	leal	(%rax,%rax), %edx
	leal	2(%rdx), %ecx
	cmpl	%edx, %r9d
	jle	.L19
.L28:
	addl	$1, %edx
	movslq	%edx, %rdi
	movl	(%rsi,%rdi,4), %r8d
	movslq	%eax, %rdi
	cmpl	%r8d, (%rsi,%rdi,4)
	jge	.L19
	cmpl	%ecx, %r10d
	jg	.L27
.L25:
	movl	%edx, %ecx
.L20:
	cmpl	%ecx, %eax
	je	.L24
	movl	(%rsi,%rdi,4), %edx
	movslq	%ecx, %rax
	movl	%r8d, (%rsi,%rdi,4)
	movl	%edx, (%rsi,%rax,4)
	movl	%ecx, %eax
	leal	(%rax,%rax), %edx
	leal	2(%rdx), %ecx
	cmpl	%edx, %r9d
	jg	.L28
.L19:
	cmpl	%ecx, %r10d
	jle	.L24
	movslq	%ecx, %rdx
	movslq	%eax, %rdi
	movl	(%rsi,%rdx,4), %r8d
	cmpl	%r8d, (%rsi,%rdi,4)
	jl	.L20
	.p2align 4,,10
	.p2align 3
.L24:
	testl	%eax, %eax
	je	.L17
	subl	$1, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L27:
	movslq	%ecx, %r11
	movl	(%rsi,%r11,4), %r11d
	cmpl	%r11d, %r8d
	jge	.L25
	movl	%r11d, %r8d
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L17:
	ret
	.cfi_endproc
.LFE41:
	.size	mimorinnPut, .-mimorinnPut
	.p2align 4
	.globl	mimorinnGet
	.type	mimorinnGet, @function
mimorinnGet:
.LFB42:
	.cfi_startproc
	endbr64
	movl	mimorinnSize(%rip), %edi
	xorl	%r10d, %r10d
	testl	%edi, %edi
	jle	.L29
	subl	$1, %edi
	leaq	mimorinn(%rip), %rcx
	movl	mimorinn(%rip), %r10d
	movslq	%edi, %rax
	movl	%edi, mimorinnSize(%rip)
	movl	(%rcx,%rax,4), %eax
	movl	%eax, mimorinn(%rip)
	jne	.L44
.L29:
	movl	%r10d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L44:
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L31:
	leal	(%rdx,%rdx), %eax
	leal	1(%rax), %r8d
	addl	$2, %eax
	cmpl	%r8d, %edi
	jle	.L32
.L46:
	movslq	%r8d, %rsi
	movl	(%rcx,%rsi,4), %r9d
	movslq	%edx, %rsi
	cmpl	%r9d, (%rcx,%rsi,4)
	jge	.L32
	cmpl	%eax, %edi
	jg	.L45
.L39:
	movl	%r8d, %eax
.L33:
	cmpl	%eax, %edx
	je	.L36
	movl	(%rcx,%rsi,4), %r8d
	movslq	%eax, %rdx
	movl	%r9d, (%rcx,%rsi,4)
	movl	%r8d, (%rcx,%rdx,4)
	movl	%eax, %edx
	leal	(%rdx,%rdx), %eax
	leal	1(%rax), %r8d
	addl	$2, %eax
	cmpl	%r8d, %edi
	jg	.L46
.L32:
	cmpl	%eax, %edi
	jle	.L36
	movslq	%eax, %rsi
	movl	(%rcx,%rsi,4), %r9d
	movslq	%edx, %rsi
	cmpl	%r9d, (%rcx,%rsi,4)
	jl	.L33
	.p2align 4,,10
	.p2align 3
.L36:
	testl	%edx, %edx
	je	.L29
	subl	$1, %edx
	movl	%edx, %eax
	shrl	$31, %eax
	addl	%eax, %edx
	sarl	%edx
	jmp	.L31
	.p2align 4,,10
	.p2align 3
.L45:
	movslq	%eax, %r11
	movl	(%rcx,%r11,4), %r11d
	cmpl	%r11d, %r9d
	jge	.L39
	movl	%r11d, %r9d
	jmp	.L33
	.cfi_endproc
.LFE42:
	.size	mimorinnGet, .-mimorinnGet
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB43:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%eax, %eax
	leaq	M(%rip), %rdx
	leaq	N(%rip), %rsi
	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
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	call	__isoc99_scanf@PLT
	cmpl	$2, %eax
	jne	.L51
	movl	N(%rip), %eax
	testl	%eax, %eax
	jle	.L106
	leaq	yakusimaruhiroko(%rip), %rax
	xorl	%ebp, %ebp
	movq	%rax, (%rsp)
	movq	%rax, %rbx
	jmp	.L52
.L107:
	movl	N(%rip), %eax
	addl	$1, %ebp
	addq	$8, %rbx
	cmpl	%ebp, %eax
	jle	.L50
.L52:
	xorl	%eax, %eax
	leaq	4(%rbx), %rdx
	movq	%rbx, %rsi
	movq	%r12, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$2, %eax
	je	.L107
.L51:
	movl	$1, %eax
.L47:
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L106:
	.cfi_restore_state
	leaq	yakusimaruhiroko(%rip), %rdi
	movq	%rdi, (%rsp)
.L50:
	movq	(%rsp), %rdi
	movslq	%eax, %rsi
	movl	$8, %edx
	xorl	%r14d, %r14d
	leaq	mareitaso(%rip), %rcx
	call	qsort@PLT
	movl	M(%rip), %eax
	movl	%eax, 12(%rsp)
	testl	%eax, %eax
	js	.L54
	movl	N(%rip), %r13d
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	xorl	%r14d, %r14d
	movl	mimorinnSize(%rip), %edx
	xorl	%r12d, %r12d
	leaq	mimorinn(%rip), %rcx
	cmpl	%r15d, %r13d
	jle	.L85
.L111:
	movq	(%rsp), %rdi
	movslq	%r15d, %rsi
	movslq	%edx, %r8
	movl	%r15d, %r11d
	leaq	(%rdi,%rsi,8), %r10
	.p2align 4,,10
	.p2align 3
.L62:
	cmpl	%r12d, (%r10)
	jg	.L61
	movl	4(%r10), %eax
	addl	$1, %r11d
	leal	1(%rdx), %r9d
	movl	%eax, (%rcx,%r8,4)
	.p2align 4,,10
	.p2align 3
.L55:
	leal	(%rdx,%rdx), %eax
	leal	2(%rax), %ebx
	cmpl	%r8d, %eax
	jge	.L56
.L109:
	addl	$1, %eax
	movslq	%eax, %rsi
	movl	(%rcx,%rsi,4), %edi
	movslq	%edx, %rsi
	cmpl	%edi, (%rcx,%rsi,4)
	jge	.L56
	cmpl	%ebx, %r9d
	jg	.L108
.L57:
	cmpl	%eax, %edx
	je	.L83
	movl	(%rcx,%rsi,4), %ebx
	movslq	%eax, %rdx
	movl	%edi, (%rcx,%rsi,4)
	movl	%ebx, (%rcx,%rdx,4)
	movl	%eax, %edx
	leal	(%rdx,%rdx), %eax
	leal	2(%rax), %ebx
	cmpl	%r8d, %eax
	jl	.L109
.L56:
	cmpl	%ebx, %r9d
	jle	.L83
	movslq	%ebx, %rax
	movslq	%edx, %rsi
	movl	(%rcx,%rax,4), %edi
	cmpl	(%rcx,%rsi,4), %edi
	jle	.L83
	movl	%ebx, %eax
	jmp	.L57
	.p2align 4,,10
	.p2align 3
.L83:
	testl	%edx, %edx
	je	.L59
	leal	-1(%rdx), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%eax, %edx
	sarl	%edx
	jmp	.L55
	.p2align 4,,10
	.p2align 3
.L108:
	movslq	%ebx, %rbp
	movl	(%rcx,%rbp,4), %ebp
	cmpl	%ebp, %edi
	jge	.L57
	movl	%ebp, %edi
	movl	%ebx, %eax
	jmp	.L57
	.p2align 4,,10
	.p2align 3
.L59:
	addq	$1, %r8
	addq	$8, %r10
	movl	$1, %eax
	movl	%r9d, %edx
	cmpl	%r13d, %r11d
	jne	.L62
.L61:
	xorl	%r10d, %r10d
	testl	%edx, %edx
	jle	.L64
	subl	$1, %edx
	movl	(%rcx), %r10d
	movslq	%edx, %rax
	movl	(%rcx,%rax,4), %eax
	movl	%eax, (%rcx)
	jne	.L88
.L89:
	movl	$1, %eax
.L64:
	addl	%r10d, %r14d
	addl	$1, %r12d
	cmpl	%r12d, 12(%rsp)
	jl	.L70
	cmpl	%r15d, %r13d
	jle	.L110
	movl	%r11d, %r15d
	cmpl	%r15d, %r13d
	jg	.L111
.L85:
	movl	%r15d, %r11d
	jmp	.L61
	.p2align 4,,10
	.p2align 3
.L110:
	leaq	mimorinn(%rip), %rdi
	jmp	.L79
.L72:
	addl	%r10d, %r14d
	addl	$1, %r12d
	cmpl	%r12d, 12(%rsp)
	jl	.L70
.L79:
	xorl	%r10d, %r10d
	testl	%edx, %edx
	jle	.L72
	subl	$1, %edx
	movl	(%rdi), %r10d
	movslq	%edx, %rax
	movl	(%rdi,%rax,4), %eax
	movl	%eax, (%rdi)
	movl	$1, %eax
	je	.L72
	xorl	%ecx, %ecx
.L75:
	leal	(%rcx,%rcx), %eax
	leal	1(%rax), %r9d
	addl	$2, %eax
	cmpl	%r9d, %edx
	jle	.L74
.L113:
	movslq	%r9d, %rsi
	movl	(%rdi,%rsi,4), %r8d
	movslq	%ecx, %rsi
	cmpl	%r8d, (%rdi,%rsi,4)
	jge	.L74
	cmpl	%eax, %edx
	jg	.L112
.L93:
	movl	%r9d, %eax
.L76:
	cmpl	%eax, %ecx
	je	.L77
	movl	(%rdi,%rsi,4), %r9d
	movslq	%eax, %rcx
	movl	%r8d, (%rdi,%rsi,4)
	movl	%r9d, (%rdi,%rcx,4)
	movl	%eax, %ecx
	leal	(%rcx,%rcx), %eax
	leal	1(%rax), %r9d
	addl	$2, %eax
	cmpl	%r9d, %edx
	jg	.L113
.L74:
	cmpl	%eax, %edx
	jle	.L77
	movslq	%eax, %rsi
	movl	(%rdi,%rsi,4), %r8d
	movslq	%ecx, %rsi
	cmpl	(%rdi,%rsi,4), %r8d
	jg	.L76
.L77:
	testl	%ecx, %ecx
	je	.L95
	subl	$1, %ecx
	movl	%ecx, %eax
	shrl	$31, %eax
	addl	%eax, %ecx
	sarl	%ecx
	jmp	.L75
.L112:
	movslq	%eax, %r11
	movl	(%rdi,%r11,4), %r11d
	cmpl	%r8d, %r11d
	jle	.L93
	movl	%r11d, %r8d
	jmp	.L76
.L95:
	movl	$1, %eax
	jmp	.L72
.L88:
	xorl	%edi, %edi
.L65:
	leal	(%rdi,%rdi), %eax
	leal	1(%rax), %r8d
	leal	2(%rax), %esi
	cmpl	%edx, %r8d
	jge	.L66
.L115:
	movslq	%r8d, %rax
	movl	(%rcx,%rax,4), %r9d
	movslq	%edi, %rax
	cmpl	%r9d, (%rcx,%rax,4)
	jge	.L66
	cmpl	%esi, %edx
	jg	.L114
.L67:
	cmpl	%r8d, %edi
	je	.L81
	movl	(%rcx,%rax,4), %esi
	movl	%r8d, %edi
	movl	%r9d, (%rcx,%rax,4)
	movslq	%r8d, %rax
	movl	%esi, (%rcx,%rax,4)
	leal	(%rdi,%rdi), %eax
	leal	1(%rax), %r8d
	leal	2(%rax), %esi
	cmpl	%edx, %r8d
	jl	.L115
.L66:
	cmpl	%esi, %edx
	jle	.L81
	movslq	%esi, %rax
	movl	(%rcx,%rax,4), %r9d
	movslq	%edi, %rax
	cmpl	%r9d, (%rcx,%rax,4)
	jge	.L81
.L82:
	movl	%esi, %r8d
	jmp	.L67
.L81:
	testl	%edi, %edi
	je	.L89
	leal	-1(%rdi), %eax
	movl	%eax, %edi
	shrl	$31, %edi
	addl	%eax, %edi
	sarl	%edi
	jmp	.L65
.L114:
	movslq	%esi, %rbx
	movl	(%rcx,%rbx,4), %ebx
	cmpl	%ebx, %r9d
	jge	.L67
	movl	%ebx, %r9d
	jmp	.L82
.L70:
	testb	%al, %al
	je	.L54
	movl	%edx, mimorinnSize(%rip)
.L54:
	movl	%r14d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%eax, %eax
	jmp	.L47
	.cfi_endproc
.LFE43:
	.size	main, .-main
	.globl	mimorinn
	.bss
	.align 32
	.type	mimorinn, @object
	.size	mimorinn, 458056
mimorinn:
	.zero	458056
	.globl	mimorinnSize
	.align 4
	.type	mimorinnSize, @object
	.size	mimorinnSize, 4
mimorinnSize:
	.zero	4
	.globl	yakusimaruhiroko
	.align 32
	.type	yakusimaruhiroko, @object
	.size	yakusimaruhiroko, 916112
yakusimaruhiroko:
	.zero	916112
	.globl	M
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.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>

struct yosinagasayuri {
	int A, B;
};

int mareitaso(const void* x, const void* y) {
	int a = ((const struct yosinagasayuri*)x)->A, b = ((const struct yosinagasayuri*)y)->A;
	return a < b ? -1 : a > b;
}

int N, M;
struct yosinagasayuri yakusimaruhiroko[114514];

int mimorinnSize = 0;
int mimorinn[114514];

void mimorinnAdjust(int pos) {
	for (;;) {
		int maxPos = pos;
		int i;
		for (i = 1; i <= 2; i++) {
			int candidatePos = pos * 2 + i;
			if (candidatePos < mimorinnSize && mimorinn[maxPos] < mimorinn[candidatePos]) {
				maxPos = candidatePos;
			}
		}
		if (maxPos == pos) {
			if (pos == 0) break;
			pos = (pos - 1) / 2;
		} else {
			int t = mimorinn[pos];
			mimorinn[pos] = mimorinn[maxPos];
			mimorinn[maxPos] = t;
			pos = maxPos;
		}
	}
}

void mimorinnPut(int value) {
	mimorinn[mimorinnSize++] = value;
	mimorinnAdjust(mimorinnSize - 1);
}

int mimorinnGet(void) {
	int ret;
	if (mimorinnSize <= 0) return 0;
	ret = mimorinn[0];
	mimorinn[0] = mimorinn[--mimorinnSize];
	if (mimorinnSize > 0) mimorinnAdjust(0);
	return ret;
}

int main(void) {
	int i;
	int haradahitomi = 0;
	int nannzyouyosino = 0;
	if (scanf("%d%d", &N, &M) != 2) return 1;
	for (i = 0; i < N; i++) {
		if (scanf("%d%d", &yakusimaruhiroko[i].A, &yakusimaruhiroko[i].B) != 2) return 1;
	}
	qsort(yakusimaruhiroko, N, sizeof(*yakusimaruhiroko), mareitaso);
	for (i = 0; i <= M; i++) {
		while (nannzyouyosino < N && yakusimaruhiroko[nannzyouyosino].A <= i) {
			mimorinnPut(yakusimaruhiroko[nannzyouyosino++].B);
		}
		haradahitomi += mimorinnGet();
	}
	printf("%d\n", haradahitomi);
	return 0;
}

5 3
1 2
1 3
1 4
1 1
2 3
 3 4
4 3
4 1
3 2
 5 3
1 2
1 0
1 4
1 1
2 3
 1 3
1 2
1 0
1 4
1 1
2 3
 3 4
4 3
3 0
3 4
 3 4
4 3
3 1
2 4
 3 0
4 3
3 1
2 4
 1 1
1 21
8 2
0 81
 3 5
4 3
4 1
2 2
 3 4
4 3
4 1
6 2

10
 5
 9
 2
 7
 8
 0
 21
 6
 3

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>

struct yosinagasayuri {
	int A, B;
};

int mareitaso(const void* x, const void* y) {
	int a = ((const struct yosinagasayuri*)x)->A, b = ((const struct yosinagasayuri*)y)->A;
	return a < b ? -1 : a > b;
}

int N, M;
struct yosinagasayuri yakusimaruhiroko[114514];

int mimorinnSize = 0;
int mimorinn[114514];

void mimorinnAdjust(int pos) {
	for (;;) {
		int maxPos = pos;
		int i;
		for (i = 1; i <= 2; i++) {
			int candidatePos = pos * 2 + i;
			if (candidatePos < mimorinnSize && mimorinn[maxPos] < mimorinn[candidatePos]) {
				maxPos = candidatePos;
			}
		}
		if (maxPos == pos) {
			if (pos == 0) break;
			pos = (pos - 1) / 2;
		} else {
			int t = mimorinn[pos];
			mimorinn[pos] = mimorinn[maxPos];
			mimorinn[maxPos] = t;
			pos = maxPos;
		}
	}
}

void mimorinnPut(int value) {
	mimorinn[mimorinnSize++] = value;
	mimorinnAdjust(mimorinnSize - 1);
}

int mimorinnGet(void) {
	int ret;
	if (mimorinnSize <= 0) return 0;
	ret = mimorinn[0];
	mimorinn[0] = mimorinn[--mimorinnSize];
	if (mimorinnSize > 0) mimorinnAdjust(0);
	return ret;
}

int main(void) {
	int i;
	int haradahitomi = 0;
	int nannzyouyosino = 0;
	if (scanf("%d%d", &N, &M) != 2) return 1;
	for (i = 0; i < N; i++) {
		if (scanf("%d%d", &yakusimaruhiroko[i].A, &yakusimaruhiroko[i].B) != 2) return 1;
	}
	qsort(yakusimaruhiroko, N, sizeof(*yakusimaruhiroko), mareitaso);
	for (i = 0; i <= M; i++) {
		while (nannzyouyosino < N && yakusimaruhiroko[nannzyouyosino].A <= i) {
			mimorinnPut(yakusimaruhiroko[nannzyouyosino++].B);
		}
		haradahitomi += mimorinnGet();
	}
	printf("%d\n", haradahitomi);
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	mareitaso
	.type	mareitaso, @function
mareitaso:
.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, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jl	.L2
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	setg	%al
	movzbl	%al, %eax
	jmp	.L4
.L2:
	movl	$-1, %eax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	mareitaso, .-mareitaso
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	M
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	yakusimaruhiroko
	.align 32
	.type	yakusimaruhiroko, @object
	.size	yakusimaruhiroko, 916112
yakusimaruhiroko:
	.zero	916112
	.globl	mimorinnSize
	.align 4
	.type	mimorinnSize, @object
	.size	mimorinnSize, 4
mimorinnSize:
	.zero	4
	.globl	mimorinn
	.align 32
	.type	mimorinn, @object
	.size	mimorinn, 458056
mimorinn:
	.zero	458056
	.text
	.globl	mimorinnAdjust
	.type	mimorinnAdjust, @function
mimorinnAdjust:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
.L13:
	movl	-20(%rbp), %eax
	movl	%eax, -16(%rbp)
	movl	$1, -12(%rbp)
	jmp	.L6
.L8:
	movl	-20(%rbp), %eax
	leal	(%rax,%rax), %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	movl	mimorinnSize(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jge	.L7
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	mimorinn(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	mimorinn(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L7
	movl	-4(%rbp), %eax
	movl	%eax, -16(%rbp)
.L7:
	addl	$1, -12(%rbp)
.L6:
	cmpl	$2, -12(%rbp)
	jle	.L8
	movl	-16(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jne	.L9
	cmpl	$0, -20(%rbp)
	je	.L15
	movl	-20(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -20(%rbp)
	jmp	.L13
.L9:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	mimorinn(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -8(%rbp)
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	mimorinn(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	mimorinn(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	mimorinn(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-16(%rbp), %eax
	movl	%eax, -20(%rbp)
	jmp	.L13
.L15:
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	mimorinnAdjust, .-mimorinnAdjust
	.globl	mimorinnPut
	.type	mimorinnPut, @function
mimorinnPut:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$8, %rsp
	movl	%edi, -4(%rbp)
	movl	mimorinnSize(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, mimorinnSize(%rip)
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	mimorinn(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	mimorinnSize(%rip), %eax
	subl	$1, %eax
	movl	%eax, %edi
	call	mimorinnAdjust
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	mimorinnPut, .-mimorinnPut
	.globl	mimorinnGet
	.type	mimorinnGet, @function
mimorinnGet:
.LFB9:
	.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
	movl	mimorinnSize(%rip), %eax
	testl	%eax, %eax
	jg	.L18
	movl	$0, %eax
	jmp	.L19
.L18:
	movl	mimorinn(%rip), %eax
	movl	%eax, -4(%rbp)
	movl	mimorinnSize(%rip), %eax
	subl	$1, %eax
	movl	%eax, mimorinnSize(%rip)
	movl	mimorinnSize(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	mimorinn(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, mimorinn(%rip)
	movl	mimorinnSize(%rip), %eax
	testl	%eax, %eax
	jle	.L20
	movl	$0, %edi
	call	mimorinnAdjust
.L20:
	movl	-4(%rbp), %eax
.L19:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	mimorinnGet, .-mimorinnGet
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB10:
	.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
	movl	$0, -8(%rbp)
	movl	$0, -4(%rbp)
	leaq	M(%rip), %rax
	movq	%rax, %rdx
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$2, %eax
	je	.L22
	movl	$1, %eax
	jmp	.L23
.L22:
	movl	$0, -12(%rbp)
	jmp	.L24
.L26:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	yakusimaruhiroko(%rip), %rax
	addq	%rdx, %rax
	leaq	4(%rax), %rdx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	yakusimaruhiroko(%rip), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$2, %eax
	je	.L25
	movl	$1, %eax
	jmp	.L23
.L25:
	addl	$1, -12(%rbp)
.L24:
	movl	N(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L26
	movl	N(%rip), %eax
	cltq
	leaq	mareitaso(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rsi
	leaq	yakusimaruhiroko(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -12(%rbp)
	jmp	.L27
.L30:
	movl	-4(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -4(%rbp)
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+yakusimaruhiroko(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %edi
	call	mimorinnPut
.L28:
	movl	N(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jge	.L29
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	yakusimaruhiroko(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -12(%rbp)
	jge	.L30
.L29:
	call	mimorinnGet
	addl	%eax, -8(%rbp)
	addl	$1, -12(%rbp)
.L27:
	movl	M(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L28
	movl	-8(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L23:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.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	mareitaso
	.type	mareitaso, @function
mareitaso:
.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, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jl	.L2
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	setg	%al
	movzbl	%al, %eax
	jmp	.L4
.L2:
	movl	$-1, %eax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	mareitaso, .-mareitaso
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	M
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	yakusimaruhiroko
	.align 32
	.type	yakusimaruhiroko, @object
	.size	yakusimaruhiroko, 916112
yakusimaruhiroko:
	.zero	916112
	.globl	mimorinnSize
	.align 4
	.type	mimorinnSize, @object
	.size	mimorinnSize, 4
mimorinnSize:
	.zero	4
	.globl	mimorinn
	.align 32
	.type	mimorinn, @object
	.size	mimorinn, 458056
mimorinn:
	.zero	458056
	.text
	.globl	mimorinnAdjust
	.type	mimorinnAdjust, @function
mimorinnAdjust:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
.L13:
	movl	-20(%rbp), %eax
	movl	%eax, -16(%rbp)
	movl	$1, -12(%rbp)
	jmp	.L6
.L8:
	movl	-20(%rbp), %eax
	leal	(%rax,%rax), %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	movl	mimorinnSize(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jge	.L7
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	mimorinn(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	mimorinn(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L7
	movl	-4(%rbp), %eax
	movl	%eax, -16(%rbp)
.L7:
	addl	$1, -12(%rbp)
.L6:
	cmpl	$2, -12(%rbp)
	jle	.L8
	movl	-16(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jne	.L9
	cmpl	$0, -20(%rbp)
	je	.L15
	movl	-20(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -20(%rbp)
	jmp	.L13
.L9:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	mimorinn(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -8(%rbp)
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	mimorinn(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	mimorinn(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	mimorinn(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-16(%rbp), %eax
	movl	%eax, -20(%rbp)
	jmp	.L13
.L15:
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	mimorinnAdjust, .-mimorinnAdjust
	.globl	mimorinnPut
	.type	mimorinnPut, @function
mimorinnPut:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$8, %rsp
	movl	%edi, -4(%rbp)
	movl	mimorinnSize(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, mimorinnSize(%rip)
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	mimorinn(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	mimorinnSize(%rip), %eax
	subl	$1, %eax
	movl	%eax, %edi
	call	mimorinnAdjust
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	mimorinnPut, .-mimorinnPut
	.globl	mimorinnGet
	.type	mimorinnGet, @function
mimorinnGet:
.LFB9:
	.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
	movl	mimorinnSize(%rip), %eax
	testl	%eax, %eax
	jg	.L18
	movl	$0, %eax
	jmp	.L19
.L18:
	movl	mimorinn(%rip), %eax
	movl	%eax, -4(%rbp)
	movl	mimorinnSize(%rip), %eax
	subl	$1, %eax
	movl	%eax, mimorinnSize(%rip)
	movl	mimorinnSize(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	mimorinn(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, mimorinn(%rip)
	movl	mimorinnSize(%rip), %eax
	testl	%eax, %eax
	jle	.L20
	movl	$0, %edi
	call	mimorinnAdjust
.L20:
	movl	-4(%rbp), %eax
.L19:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	mimorinnGet, .-mimorinnGet
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB10:
	.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
	movl	$0, -8(%rbp)
	movl	$0, -4(%rbp)
	leaq	M(%rip), %rax
	movq	%rax, %rdx
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$2, %eax
	je	.L22
	movl	$1, %eax
	jmp	.L23
.L22:
	movl	$0, -12(%rbp)
	jmp	.L24
.L26:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	yakusimaruhiroko(%rip), %rax
	addq	%rdx, %rax
	leaq	4(%rax), %rdx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	yakusimaruhiroko(%rip), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$2, %eax
	je	.L25
	movl	$1, %eax
	jmp	.L23
.L25:
	addl	$1, -12(%rbp)
.L24:
	movl	N(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L26
	movl	N(%rip), %eax
	cltq
	leaq	mareitaso(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rsi
	leaq	yakusimaruhiroko(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -12(%rbp)
	jmp	.L27
.L30:
	movl	-4(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -4(%rbp)
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+yakusimaruhiroko(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %edi
	call	mimorinnPut
.L28:
	movl	N(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jge	.L29
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	yakusimaruhiroko(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -12(%rbp)
	jge	.L30
.L29:
	call	mimorinnGet
	addl	%eax, -8(%rbp)
	addl	$1, -12(%rbp)
.L27:
	movl	M(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L28
	movl	-8(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L23:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.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:
