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 <string.h>

typedef struct {
    int sx, sy;
    int ex, ey;
} RECT;

int min(int a, int b)
{
    return (b > a ? a : b);
}

int max(int a, int b)
{
    return (a > b ? a : b);
}

int comp(const void *a, const void *b)
{
    RECT x, y;
    x = *(RECT *)a;
    y = *(RECT *)b;
    
    return (x.sx - y.sx);
}

int comp_int(const void *a, const void *b)
{
    int x, y;
    x = *(int *)a;
    y = *(int *)b;
    
    return (x - y);
}

int area;
int length;

RECT calc[10000];
RECT before[10000];
int bsize;

void mergeArea(RECT *grid, int n, int *sq)
{
    int i, j;
    int num;
    int start, end;
    
    if (n == 0){
        return;
    }
    num = 0;
    start = grid[0].sx;
    end = grid[0].ex;
    for (i = 1; i < n; i++){
        if (grid[i].sx <= end){
            end = max(end, grid[i].ex);
        }
        else {
            calc[num].sx = start;
            calc[num++].ex = end;
            start = grid[i].sx;
            end = grid[i].ex;
        }
    }
    calc[num].sx = start;
    calc[num++].ex = end;
    for (i = 0; i < num; i++){
        area += calc[i].ex - calc[i].sx;
    }
    
    *sq = num;
}

void mergeLength(RECT *grid, int n)
{
    int total[40000];
    int i;
    int res, num;
    
    num = 0;
    for (i = 0; i < n; i++){
        total[num++] = grid[i].sx;
        total[num++] = grid[i].ex;
    }
    for (i = 0; i < bsize; i++){
        total[num++] = before[i].sx;
        total[num++] = before[i].ex;
    }
    
    qsort(total, num, sizeof(int), comp_int);
    res = 0;
    for (i = 0; i < num; i += 2){
        res += total[i + 1] - total[i];
    }
    length += res + 2 * n;
}

int main(void)
{
    int n, query;
    static RECT p[10000];
    static RECT grid[10000];
    int num;
    int i, j;
    int sq;
    int miny, maxy;
    
    while (1){
        scanf("%d%d", &n, &query);
        
        if (n + query == 0){
            break;
        }
        area = length = 0;
        miny = 1000000;
        maxy = -100000;
        for (i = 0; i < n; i++){
            scanf("%d%d%d%d", &p[i].sx, &p[i].sy, &p[i].ex, &p[i].ey);
            miny = min(miny, p[i].sy);
            maxy = max(maxy, p[i].ey);
        }
        bsize = 0;
        memset(before, 0, sizeof(before));
        qsort(p, n, sizeof(RECT), comp);
        area = length = 0;
        for (i = miny; i <= maxy; i++){
            memset(grid, 0, sizeof(grid));
            num = sq = 0;
            for (j = 0; j < n; j++){
                if (p[j].sy <= i && i < p[j].ey){
                    grid[num++] = p[j];
                }
            }
            mergeArea(grid, num, &sq);
            if (query == 2 && (bsize != 0 || num != 0)){
                mergeLength(calc, sq);
            }
            memcpy(before, calc, sizeof(calc));
            bsize = sq;
        }
        printf("%d\n", area);
        if (query == 2){
            printf("%d\n", length);
        }
    }
    
    return (0);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	min
	.type	min, @function
min:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	min, .-min
	.globl	max
	.type	max, @function
max:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	max, .-max
	.globl	comp
	.type	comp, @function
comp:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -40(%rbp)
	movq	%rsi, -48(%rbp)
	movq	-40(%rbp), %rax
	movq	8(%rax), %rdx
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	%rdx, -24(%rbp)
	movq	-48(%rbp), %rax
	movq	8(%rax), %rdx
	movq	(%rax), %rax
	movq	%rax, -16(%rbp)
	movq	%rdx, -8(%rbp)
	movl	-32(%rbp), %eax
	movl	-16(%rbp), %edx
	subl	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	comp, .-comp
	.globl	comp_int
	.type	comp_int, @function
comp_int:
.LFB3:
	.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
	subl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	comp_int, .-comp_int
	.globl	area
	.bss
	.align 4
	.type	area, @object
	.size	area, 4
area:
	.zero	4
	.globl	length
	.align 4
	.type	length, @object
	.size	length, 4
length:
	.zero	4
	.globl	calc
	.align 32
	.type	calc, @object
	.size	calc, 160000
calc:
	.zero	160000
	.globl	before
	.align 32
	.type	before, @object
	.size	before, 160000
before:
	.zero	160000
	.globl	bsize
	.align 4
	.type	bsize, @object
	.size	bsize, 4
bsize:
	.zero	4
	.text
	.globl	mergeArea
	.type	mergeArea, @function
mergeArea:
.LFB4:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$40, %rsp
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movq	%rdx, -40(%rbp)
	cmpl	$0, -28(%rbp)
	je	.L18
	movl	$0, -12(%rbp)
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
	movq	-24(%rbp), %rax
	movl	8(%rax), %eax
	movl	%eax, -4(%rbp)
	movl	$1, -16(%rbp)
	jmp	.L12
.L15:
	movl	-16(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L13
	movl	-16(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	8(%rax), %edx
	movl	-4(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	max
	movl	%eax, -4(%rbp)
	jmp	.L14
.L13:
	movl	-12(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	calc(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-12(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -12(%rbp)
	cltq
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	8+calc(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-16(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
	movl	-16(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	8(%rax), %eax
	movl	%eax, -4(%rbp)
.L14:
	addl	$1, -16(%rbp)
.L12:
	movl	-16(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L15
	movl	-12(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	calc(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-12(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -12(%rbp)
	cltq
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	8+calc(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	$0, -16(%rbp)
	jmp	.L16
.L17:
	movl	-16(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	8+calc(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-16(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	leaq	calc(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	movl	%eax, %ecx
	movl	area(%rip), %eax
	addl	%ecx, %eax
	movl	%eax, area(%rip)
	addl	$1, -16(%rbp)
.L16:
	movl	-16(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jl	.L17
	movq	-40(%rbp), %rax
	movl	-12(%rbp), %edx
	movl	%edx, (%rax)
	jmp	.L9
.L18:
	nop
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	mergeArea, .-mergeArea
	.globl	mergeLength
	.type	mergeLength, @function
mergeLength:
.LFB5:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-159744(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$304, %rsp
	movq	%rdi, -160040(%rbp)
	movl	%esi, -160044(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -160020(%rbp)
	movl	$0, -160028(%rbp)
	jmp	.L20
.L21:
	movl	-160028(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-160040(%rbp), %rax
	leaq	(%rdx,%rax), %rcx
	movl	-160020(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -160020(%rbp)
	movl	(%rcx), %edx
	cltq
	movl	%edx, -160016(%rbp,%rax,4)
	movl	-160028(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-160040(%rbp), %rax
	leaq	(%rdx,%rax), %rcx
	movl	-160020(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -160020(%rbp)
	movl	8(%rcx), %edx
	cltq
	movl	%edx, -160016(%rbp,%rax,4)
	addl	$1, -160028(%rbp)
.L20:
	movl	-160028(%rbp), %eax
	cmpl	-160044(%rbp), %eax
	jl	.L21
	movl	$0, -160028(%rbp)
	jmp	.L22
.L23:
	movl	-160020(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -160020(%rbp)
	movl	-160028(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	leaq	before(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	cltq
	movl	%edx, -160016(%rbp,%rax,4)
	movl	-160020(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -160020(%rbp)
	movl	-160028(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	leaq	8+before(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	cltq
	movl	%edx, -160016(%rbp,%rax,4)
	addl	$1, -160028(%rbp)
.L22:
	movl	bsize(%rip), %eax
	cmpl	%eax, -160028(%rbp)
	jl	.L23
	movl	-160020(%rbp), %esi
	leaq	-160016(%rbp), %rax
	leaq	comp_int(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rdi
	movl	$0, %eax
	call	qsort@PLT
	movl	$0, -160024(%rbp)
	movl	$0, -160028(%rbp)
	jmp	.L24
.L25:
	movl	-160028(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-160016(%rbp,%rax,4), %edx
	movl	-160028(%rbp), %eax
	cltq
	movl	-160016(%rbp,%rax,4), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	addl	%eax, -160024(%rbp)
	addl	$2, -160028(%rbp)
.L24:
	movl	-160028(%rbp), %eax
	cmpl	-160020(%rbp), %eax
	jl	.L25
	movl	-160044(%rbp), %eax
	leal	(%rax,%rax), %edx
	movl	-160024(%rbp), %eax
	addl	%eax, %edx
	movl	length(%rip), %eax
	addl	%edx, %eax
	movl	%eax, length(%rip)
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L26
	call	__stack_chk_fail@PLT
.L26:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE5:
	.size	mergeLength, .-mergeLength
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d%d%d%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.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
.L40:
	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), %edx
	movl	-36(%rbp), %eax
	addl	%edx, %eax
	testl	%eax, %eax
	je	.L44
	movl	$0, length(%rip)
	movl	length(%rip), %eax
	movl	%eax, area(%rip)
	movl	$1000000, -16(%rbp)
	movl	$-100000, -12(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L30
.L31:
	movl	-24(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	p.1(%rip), %rax
	addq	%rdx, %rax
	leaq	12(%rax), %rsi
	movl	-24(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	p.1(%rip), %rax
	addq	%rdx, %rax
	leaq	8(%rax), %rcx
	movl	-24(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	p.1(%rip), %rax
	addq	%rdx, %rax
	leaq	4(%rax), %rdx
	movl	-24(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdi
	leaq	p.1(%rip), %rax
	addq	%rdi, %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	4+p.1(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-16(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	min
	movl	%eax, -16(%rbp)
	movl	-24(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	12+p.1(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-12(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	max
	movl	%eax, -12(%rbp)
	addl	$1, -24(%rbp)
.L30:
	movl	-40(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L31
	movl	$0, bsize(%rip)
	movl	$160000, %edx
	movl	$0, %esi
	leaq	before(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	-40(%rbp), %eax
	leaq	comp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$16, %edx
	movl	%eax, %esi
	leaq	p.1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	qsort@PLT
	movl	$0, length(%rip)
	movl	length(%rip), %eax
	movl	%eax, area(%rip)
	movl	-16(%rbp), %eax
	movl	%eax, -24(%rbp)
	jmp	.L32
.L38:
	movl	$160000, %edx
	movl	$0, %esi
	leaq	grid.0(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -32(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -28(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L33
.L35:
	movl	-20(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	4+p.1(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L34
	movl	-20(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	12+p.1(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -24(%rbp)
	jge	.L34
	movl	-28(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -28(%rbp)
	cltq
	salq	$4, %rax
	movq	%rax, %rsi
	leaq	grid.0(%rip), %rcx
	movl	-20(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	p.1(%rip), %rax
	leaq	(%rdx,%rax), %rdx
	movq	(%rdx), %rax
	movq	8(%rdx), %rdx
	movq	%rax, (%rsi,%rcx)
	movq	%rdx, 8(%rsi,%rcx)
.L34:
	addl	$1, -20(%rbp)
.L33:
	movl	-40(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L35
	leaq	-32(%rbp), %rdx
	movl	-28(%rbp), %eax
	movl	%eax, %esi
	leaq	grid.0(%rip), %rax
	movq	%rax, %rdi
	call	mergeArea
	movl	-36(%rbp), %eax
	cmpl	$2, %eax
	jne	.L36
	movl	bsize(%rip), %eax
	testl	%eax, %eax
	jne	.L37
	cmpl	$0, -28(%rbp)
	je	.L36
.L37:
	movl	-32(%rbp), %eax
	movl	%eax, %esi
	leaq	calc(%rip), %rax
	movq	%rax, %rdi
	call	mergeLength
.L36:
	leaq	before(%rip), %rax
	leaq	calc(%rip), %rcx
	movl	$160000, %edx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	memcpy@PLT
	movl	-32(%rbp), %eax
	movl	%eax, bsize(%rip)
	addl	$1, -24(%rbp)
.L32:
	movl	-24(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jle	.L38
	movl	area(%rip), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	-36(%rbp), %eax
	cmpl	$2, %eax
	jne	.L40
	movl	length(%rip), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L40
.L44:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L42
	call	__stack_chk_fail@PLT
.L42:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.local	p.1
	.comm	p.1,160000,32
	.local	grid.0
	.comm	grid.0,160000,32
	.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	comp
	.type	comp, @function
comp:
.LFB37:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE37:
	.size	comp, .-comp
	.p2align 4
	.globl	comp_int
	.type	comp_int, @function
comp_int:
.LFB38:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE38:
	.size	comp_int, .-comp_int
	.p2align 4
	.globl	min
	.type	min, @function
min:
.LFB35:
	.cfi_startproc
	endbr64
	cmpl	%edi, %esi
	movl	%edi, %eax
	cmovle	%esi, %eax
	ret
	.cfi_endproc
.LFE35:
	.size	min, .-min
	.p2align 4
	.globl	max
	.type	max, @function
max:
.LFB36:
	.cfi_startproc
	endbr64
	cmpl	%edi, %esi
	movl	%edi, %eax
	cmovge	%esi, %eax
	ret
	.cfi_endproc
.LFE36:
	.size	max, .-max
	.p2align 4
	.globl	mergeArea
	.type	mergeArea, @function
mergeArea:
.LFB39:
	.cfi_startproc
	endbr64
	movq	%rdx, %r9
	testl	%esi, %esi
	je	.L6
	movl	(%rdi), %r8d
	movl	8(%rdi), %edx
	cmpl	$1, %esi
	jle	.L8
	leal	-2(%rsi), %ecx
	leaq	16(%rdi), %rax
	xorl	%esi, %esi
	salq	$4, %rcx
	leaq	32(%rdi,%rcx), %r10
	leaq	calc(%rip), %rdi
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L22:
	movl	8(%rax), %ecx
	cmpl	%ecx, %edx
	cmovl	%ecx, %edx
	addq	$16, %rax
	cmpq	%r10, %rax
	je	.L21
.L11:
	cmpl	%edx, (%rax)
	jle	.L22
	movslq	%esi, %rcx
	addq	$16, %rax
	addl	$1, %esi
	salq	$4, %rcx
	addq	%rdi, %rcx
	movl	%r8d, (%rcx)
	movl	%edx, 8(%rcx)
	movl	-16(%rax), %r8d
	movl	-8(%rax), %edx
	cmpq	%r10, %rax
	jne	.L11
.L21:
	movslq	%esi, %rax
	leal	1(%rsi), %r10d
	salq	$4, %rax
	addq	%rdi, %rax
	movl	%edx, 8(%rax)
	movl	area(%rip), %edx
	movl	%r8d, (%rax)
	cmpl	$2, %esi
	jle	.L15
	movl	%r10d, %ecx
	leaq	calc(%rip), %rax
	pxor	%xmm3, %xmm3
	shrl	$2, %ecx
	leaq	64(%rax), %r8
	subl	$1, %ecx
	salq	$6, %rcx
	addq	%r8, %rcx
	.p2align 4,,10
	.p2align 3
.L13:
	movdqa	(%rax), %xmm0
	shufps	$136, 16(%rax), %xmm0
	movdqa	%xmm0, %xmm2
	addq	$64, %rax
	movdqa	-32(%rax), %xmm1
	shufps	$136, -16(%rax), %xmm1
	shufps	$221, %xmm1, %xmm2
	shufps	$136, %xmm1, %xmm0
	psubd	%xmm0, %xmm2
	paddd	%xmm2, %xmm3
	cmpq	%rcx, %rax
	jne	.L13
	movdqa	%xmm3, %xmm0
	psrldq	$8, %xmm0
	paddd	%xmm0, %xmm3
	movdqa	%xmm3, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm3
	movd	%xmm3, %eax
	addl	%eax, %edx
	movl	%r10d, %eax
	andl	$-4, %eax
	testb	$3, %r10b
	je	.L14
.L12:
	movslq	%eax, %rcx
	leal	1(%rax), %r8d
	salq	$4, %rcx
	addq	%rdi, %rcx
	addl	8(%rcx), %edx
	subl	(%rcx), %edx
	cmpl	%eax, %esi
	jle	.L14
	movslq	%r8d, %rcx
	addl	$2, %eax
	salq	$4, %rcx
	addq	%rdi, %rcx
	addl	8(%rcx), %edx
	subl	(%rcx), %edx
	cmpl	%esi, %r8d
	jge	.L14
	cltq
	salq	$4, %rax
	addq	%rax, %rdi
	addl	8(%rdi), %edx
	subl	(%rdi), %edx
.L14:
	movl	%edx, area(%rip)
	movl	%r10d, (%r9)
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	ret
	.p2align 4,,10
	.p2align 3
.L8:
	movl	%edx, 8+calc(%rip)
	movl	$1, %r10d
	subl	%r8d, %edx
	addl	area(%rip), %edx
	movl	%r8d, calc(%rip)
	jmp	.L14
.L15:
	xorl	%eax, %eax
	jmp	.L12
	.cfi_endproc
.LFE39:
	.size	mergeArea, .-mergeArea
	.p2align 4
	.globl	mergeLength
	.type	mergeLength, @function
mergeLength:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	-159744(%rsp), %r11
	.cfi_def_cfa 11, 159776
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$272, %rsp
	.cfi_def_cfa_offset 160048
	movq	%fs:40, %rdx
	movq	%rdx, 160008(%rsp)
	xorl	%edx, %edx
	movl	%esi, %ebx
	movl	bsize(%rip), %esi
	testl	%ebx, %ebx
	jle	.L24
	movq	%rdi, %rax
	leal	-1(%rbx), %edi
	cmpl	$1, %edi
	jbe	.L40
	movl	%edi, %ecx
	movq	%rsp, %rbp
	shrl	%ecx
	salq	$4, %rcx
	.p2align 4,,10
	.p2align 3
.L26:
	movdqu	(%rax,%rdx,2), %xmm0
	movdqu	16(%rax,%rdx,2), %xmm4
	shufps	$136, %xmm4, %xmm0
	movaps	%xmm0, 0(%rbp,%rdx)
	addq	$16, %rdx
	cmpq	%rdx, %rcx
	jne	.L26
	andl	$-2, %edi
	movl	%edi, %edx
	leal	(%rdi,%rdi), %ecx
.L25:
	movl	%ebx, %r8d
	subl	%edi, %r8d
	cmpl	$1, %r8d
	je	.L27
	movq	%rdi, %r9
	salq	$4, %r9
	addq	%rax, %r9
	movq	(%r9), %xmm0
	movq	8(%r9), %xmm1
	punpckldq	%xmm1, %xmm0
	movq	%xmm0, (%rsp,%rdi,8)
	leal	-1(%r8), %edi
	addl	%edi, %edx
	leal	(%rcx,%rdi,2), %ecx
.L27:
	movslq	%edx, %rdx
	leal	(%rbx,%rbx), %r12d
	salq	$4, %rdx
	addq	%rdx, %rax
	movd	(%rax), %xmm0
	movd	8(%rax), %xmm3
	movslq	%ecx, %rax
	punpckldq	%xmm3, %xmm0
	movq	%xmm0, (%rsp,%rax,4)
	testl	%esi, %esi
	jle	.L28
.L37:
	testl	%esi, %esi
	movl	$1, %edi
	cmovg	%esi, %edi
	cmpl	$1, %esi
	je	.L41
	movl	%edi, %ecx
	leaq	before(%rip), %r8
	movslq	%r12d, %r9
	shrl	%ecx
	leaq	32(%r8), %r10
	leaq	0(%rbp,%r9,4), %rdx
	movq	%r8, %rax
	subl	$1, %ecx
	salq	$5, %rcx
	addq	%r10, %rcx
	.p2align 4,,10
	.p2align 3
.L30:
	movdqa	(%rax), %xmm0
	addq	$32, %rax
	shufps	$136, -16(%rax), %xmm0
	addq	$16, %rdx
	movups	%xmm0, -16(%rdx)
	cmpq	%rcx, %rax
	jne	.L30
	movl	%edi, %eax
	andl	$-2, %eax
	andl	$1, %edi
	je	.L31
.L29:
	movq	%rax, %rdx
	leaq	(%r9,%rax,2), %rax
	salq	$4, %rdx
	addq	%rdx, %r8
	movq	(%r8), %xmm0
	movq	8(%r8), %xmm1
	punpckldq	%xmm1, %xmm0
	movq	%xmm0, (%rsp,%rax,4)
.L31:
	xorl	%edx, %edx
	leal	-2(%rsi,%rsi), %eax
	testl	%esi, %esi
	cmovle	%edx, %eax
	leal	2(%r12,%rax), %r12d
.L28:
	movl	$4, %edx
	xorl	%eax, %eax
	movl	%r12d, %esi
	movq	%rbp, %rdi
	leaq	comp_int(%rip), %rcx
	call	qsort@PLT
	leal	-1(%r12), %edx
	movl	$1, %eax
	shrl	%edx
	addl	$1, %edx
	testl	%r12d, %r12d
	cmovle	%eax, %edx
	cmpl	$6, %r12d
	jle	.L42
	movl	%edx, %ecx
	pxor	%xmm2, %xmm2
	movq	%rbp, %rax
	shrl	$2, %ecx
	subl	$1, %ecx
	salq	$5, %rcx
	leaq	32(%rsp,%rcx), %rcx
	.p2align 4,,10
	.p2align 3
.L33:
	movdqa	(%rax), %xmm0
	addq	$32, %rax
	movdqa	%xmm0, %xmm1
	shufps	$136, -16(%rax), %xmm0
	shufps	$221, -16(%rax), %xmm1
	psubd	%xmm0, %xmm1
	paddd	%xmm1, %xmm2
	cmpq	%rax, %rcx
	jne	.L33
	movdqa	%xmm2, %xmm0
	movl	%edx, %esi
	psrldq	$8, %xmm0
	andl	$-4, %esi
	paddd	%xmm0, %xmm2
	leal	(%rsi,%rsi), %ecx
	movdqa	%xmm2, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm2
	movd	%xmm2, %eax
	cmpl	%edx, %esi
	je	.L36
.L32:
	leal	1(%rcx), %esi
	movslq	%ecx, %rdx
	movslq	%esi, %rsi
	addl	(%rsp,%rsi,4), %eax
	subl	(%rsp,%rdx,4), %eax
	leal	2(%rcx), %edx
	cmpl	%r12d, %edx
	jge	.L36
	leal	3(%rcx), %esi
	movslq	%edx, %rdx
	movslq	%esi, %rsi
	addl	(%rsp,%rsi,4), %eax
	subl	(%rsp,%rdx,4), %eax
	leal	4(%rcx), %edx
	cmpl	%r12d, %edx
	jge	.L36
	addl	$5, %ecx
	movslq	%edx, %rdx
	movslq	%ecx, %rcx
	addl	(%rsp,%rcx,4), %eax
	subl	(%rsp,%rdx,4), %eax
.L36:
	leal	(%rax,%rbx,2), %eax
	addl	%eax, length(%rip)
	movq	160008(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L53
	addq	$160016, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L24:
	.cfi_restore_state
	testl	%esi, %esi
	jg	.L54
	movq	%rsp, %rdi
	leaq	comp_int(%rip), %rcx
	xorl	%esi, %esi
	xorl	%eax, %eax
	movl	$4, %edx
	call	qsort@PLT
	xorl	%eax, %eax
	jmp	.L36
.L40:
	xorl	%edi, %edi
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	movq	%rsp, %rbp
	jmp	.L25
.L41:
	xorl	%eax, %eax
	leaq	before(%rip), %r8
	movslq	%r12d, %r9
	jmp	.L29
.L42:
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	jmp	.L32
.L54:
	xorl	%r12d, %r12d
	movq	%rsp, %rbp
	jmp	.L37
.L53:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.size	mergeLength, .-mergeLength
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d%d%d%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB41:
	.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
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	before(%rip), %r13
	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	36(%rsp), %rax
	movq	%rax, 24(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 16(%rsp)
	.p2align 4,,10
	.p2align 3
.L72:
	movq	24(%rsp), %rdx
	movq	16(%rsp), %rsi
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	32(%rsp), %ebp
	movl	%ebp, %eax
	addl	36(%rsp), %eax
	je	.L56
	movl	$0, length(%rip)
	movl	$0, area(%rip)
	testl	%ebp, %ebp
	jle	.L57
	leaq	4+p.1(%rip), %r12
	movl	$-100000, %ebx
	movl	$1000000, %r14d
	xorl	%r15d, %r15d
	leaq	.LC1(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L58:
	leaq	8(%r12), %r8
	leaq	4(%r12), %rcx
	movq	%r12, %rdx
	xorl	%eax, %eax
	leaq	-4(%r12), %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	movl	(%r12), %eax
	movl	32(%rsp), %r8d
	cmpl	%eax, %r14d
	cmovg	%eax, %r14d
	movl	8(%r12), %eax
	cmpl	%eax, %ebx
	cmovl	%eax, %ebx
	addl	$1, %r15d
	addq	$16, %r12
	cmpl	%r15d, %r8d
	jg	.L58
	movl	$160000, %edx
	xorl	%esi, %esi
	movq	%r13, %rdi
	movl	%r8d, 12(%rsp)
	movl	$0, bsize(%rip)
	call	memset@PLT
	movl	12(%rsp), %esi
	movl	$16, %edx
	xorl	%eax, %eax
	leaq	comp(%rip), %rcx
	leaq	p.1(%rip), %rdi
	call	qsort@PLT
	movl	$0, length(%rip)
	movl	$0, area(%rip)
	cmpl	%r14d, %ebx
	jl	.L76
	leaq	grid.0(%rip), %r12
	leaq	calc(%rip), %r15
	.p2align 4,,10
	.p2align 3
.L71:
	movl	$160000, %edx
	xorl	%esi, %esi
	movq	%r12, %rdi
	call	memset@PLT
	movl	32(%rsp), %edx
	testl	%edx, %edx
	jle	.L60
	leaq	p.1(%rip), %rax
	subl	$1, %edx
	xorl	%ebp, %ebp
	salq	$4, %rdx
	leaq	16(%rax), %rdi
	addq	%rdi, %rdx
	.p2align 4,,10
	.p2align 3
.L62:
	cmpl	%r14d, 4(%rax)
	jg	.L61
	cmpl	%r14d, 12(%rax)
	jle	.L61
	movslq	%ebp, %rcx
	movdqa	(%rax), %xmm4
	addl	$1, %ebp
	salq	$4, %rcx
	movaps	%xmm4, (%r12,%rcx)
.L61:
	addq	$16, %rax
	cmpq	%rdx, %rax
	jne	.L62
	testl	%ebp, %ebp
	je	.L60
	movl	(%r12), %r8d
	movl	8+grid.0(%rip), %eax
	cmpl	$1, %ebp
	je	.L63
	leaq	16+grid.0(%rip), %rdx
	leal	-2(%rbp), %r10d
	leaq	16(%rdx), %rdi
	salq	$4, %r10
	addq	%rdi, %r10
	xorl	%edi, %edi
	jmp	.L66
	.p2align 4,,10
	.p2align 3
.L94:
	cmpl	%r9d, %eax
	cmovl	%r9d, %eax
	addq	$16, %rdx
	cmpq	%r10, %rdx
	je	.L93
.L66:
	movl	(%rdx), %esi
	movl	8(%rdx), %r9d
	cmpl	%eax, %esi
	jle	.L94
	movslq	%edi, %rcx
	addq	$16, %rdx
	addl	$1, %edi
	salq	$4, %rcx
	addq	%r15, %rcx
	movl	%r8d, (%rcx)
	movl	%esi, %r8d
	movl	%eax, 8(%rcx)
	movl	%r9d, %eax
	cmpq	%r10, %rdx
	jne	.L66
.L93:
	movslq	%edi, %rdx
	leal	1(%rdi), %ebp
	salq	$4, %rdx
	addq	%r15, %rdx
	movl	%eax, 8(%rdx)
	movl	area(%rip), %eax
	movl	%r8d, (%rdx)
	cmpl	$2, %edi
	jle	.L77
	movl	%ebp, %ecx
	leaq	calc(%rip), %rdx
	pxor	%xmm3, %xmm3
	shrl	$2, %ecx
	leaq	64(%rdx), %rsi
	subl	$1, %ecx
	salq	$6, %rcx
	addq	%rsi, %rcx
	.p2align 4,,10
	.p2align 3
.L68:
	movdqa	(%rdx), %xmm0
	shufps	$136, 16(%rdx), %xmm0
	movdqa	%xmm0, %xmm2
	addq	$64, %rdx
	movdqa	-32(%rdx), %xmm1
	shufps	$136, -16(%rdx), %xmm1
	shufps	$221, %xmm1, %xmm2
	shufps	$136, %xmm1, %xmm0
	psubd	%xmm0, %xmm2
	paddd	%xmm2, %xmm3
	cmpq	%rcx, %rdx
	jne	.L68
	movdqa	%xmm3, %xmm0
	psrldq	$8, %xmm0
	paddd	%xmm0, %xmm3
	movdqa	%xmm3, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm3
	movd	%xmm3, %edx
	addl	%edx, %eax
	movl	%ebp, %edx
	andl	$-4, %edx
	testb	$3, %bpl
	je	.L69
.L67:
	movslq	%edx, %rcx
	leal	1(%rdx), %esi
	salq	$4, %rcx
	addq	%r15, %rcx
	addl	8(%rcx), %eax
	subl	(%rcx), %eax
	cmpl	%edi, %edx
	jge	.L69
	movslq	%esi, %rcx
	addl	$2, %edx
	salq	$4, %rcx
	addq	%r15, %rcx
	addl	8(%rcx), %eax
	subl	(%rcx), %eax
	cmpl	%edi, %esi
	jge	.L69
	movslq	%edx, %rdx
	salq	$4, %rdx
	addq	%r15, %rdx
	addl	8(%rdx), %eax
	subl	(%rdx), %eax
.L69:
	cmpl	$2, 36(%rsp)
	movl	%eax, area(%rip)
	je	.L74
.L70:
	movl	$160000, %edx
	movq	%r15, %rsi
	movq	%r13, %rdi
	addl	$1, %r14d
	call	memcpy@PLT
	movl	%ebp, bsize(%rip)
	cmpl	%ebx, %r14d
	jle	.L71
	movl	area(%rip), %edx
.L59:
	leaq	.LC2(%rip), %rbp
	xorl	%eax, %eax
	movl	$1, %edi
	movq	%rbp, %rsi
	call	__printf_chk@PLT
	cmpl	$2, 36(%rsp)
	jne	.L72
	movl	length(%rip), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L72
	.p2align 4,,10
	.p2align 3
.L60:
	xorl	%ebp, %ebp
	cmpl	$2, 36(%rsp)
	jne	.L70
	movl	bsize(%rip), %ebp
	testl	%ebp, %ebp
	je	.L70
	xorl	%ebp, %ebp
	.p2align 4,,10
	.p2align 3
.L74:
	movl	%ebp, %esi
	movq	%r15, %rdi
	call	mergeLength
	jmp	.L70
.L63:
	movl	%eax, 8+calc(%rip)
	subl	%r8d, %eax
	addl	area(%rip), %eax
	movl	%r8d, (%r15)
	jmp	.L69
.L57:
	movl	$160000, %edx
	xorl	%esi, %esi
	movq	%r13, %rdi
	movl	$0, bsize(%rip)
	call	memset@PLT
	movl	$16, %edx
	movl	%ebp, %esi
	xorl	%eax, %eax
	leaq	comp(%rip), %rcx
	leaq	p.1(%rip), %rdi
	call	qsort@PLT
	xorl	%edx, %edx
	movl	$0, length(%rip)
	movl	$0, area(%rip)
	jmp	.L59
.L56:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L95
	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
.L76:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L59
.L95:
	call	__stack_chk_fail@PLT
.L77:
	xorl	%edx, %edx
	jmp	.L67
	.cfi_endproc
.LFE41:
	.size	main, .-main
	.local	grid.0
	.comm	grid.0,160000,32
	.local	p.1
	.comm	p.1,160000,32
	.globl	bsize
	.bss
	.align 4
	.type	bsize, @object
	.size	bsize, 4
bsize:
	.zero	4
	.globl	before
	.align 32
	.type	before, @object
	.size	before, 160000
before:
	.zero	160000
	.globl	calc
	.align 32
	.type	calc, @object
	.size	calc, 160000
calc:
	.zero	160000
	.globl	length
	.align 4
	.type	length, @object
	.size	length, 4
length:
	.zero	4
	.globl	area
	.align 4
	.type	area, @object
	.size	area, 4
area:
	.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	comp
	.type	comp, @function
comp:
.LFB37:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE37:
	.size	comp, .-comp
	.p2align 4
	.globl	comp_int
	.type	comp_int, @function
comp_int:
.LFB38:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE38:
	.size	comp_int, .-comp_int
	.p2align 4
	.globl	min
	.type	min, @function
min:
.LFB35:
	.cfi_startproc
	endbr64
	cmpl	%edi, %esi
	movl	%edi, %eax
	cmovle	%esi, %eax
	ret
	.cfi_endproc
.LFE35:
	.size	min, .-min
	.p2align 4
	.globl	max
	.type	max, @function
max:
.LFB36:
	.cfi_startproc
	endbr64
	cmpl	%edi, %esi
	movl	%edi, %eax
	cmovge	%esi, %eax
	ret
	.cfi_endproc
.LFE36:
	.size	max, .-max
	.p2align 4
	.globl	mergeArea
	.type	mergeArea, @function
mergeArea:
.LFB39:
	.cfi_startproc
	endbr64
	movq	%rdx, %r9
	testl	%esi, %esi
	je	.L6
	movl	(%rdi), %r8d
	movl	8(%rdi), %edx
	cmpl	$1, %esi
	jle	.L8
	leal	-2(%rsi), %ecx
	leaq	16(%rdi), %rax
	xorl	%esi, %esi
	salq	$4, %rcx
	leaq	32(%rdi,%rcx), %r10
	leaq	calc(%rip), %rdi
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L22:
	movl	8(%rax), %ecx
	cmpl	%ecx, %edx
	cmovl	%ecx, %edx
	addq	$16, %rax
	cmpq	%r10, %rax
	je	.L21
.L11:
	cmpl	%edx, (%rax)
	jle	.L22
	movslq	%esi, %rcx
	addq	$16, %rax
	addl	$1, %esi
	salq	$4, %rcx
	addq	%rdi, %rcx
	movl	%r8d, (%rcx)
	movl	%edx, 8(%rcx)
	movl	-16(%rax), %r8d
	movl	-8(%rax), %edx
	cmpq	%r10, %rax
	jne	.L11
.L21:
	movslq	%esi, %rax
	leal	1(%rsi), %r10d
	salq	$4, %rax
	addq	%rdi, %rax
	movl	%edx, 8(%rax)
	movl	area(%rip), %edx
	movl	%r8d, (%rax)
	cmpl	$2, %esi
	jle	.L15
	movl	%r10d, %ecx
	leaq	calc(%rip), %rax
	pxor	%xmm3, %xmm3
	shrl	$2, %ecx
	leaq	64(%rax), %r8
	subl	$1, %ecx
	salq	$6, %rcx
	addq	%r8, %rcx
	.p2align 4,,10
	.p2align 3
.L13:
	movdqa	(%rax), %xmm0
	shufps	$136, 16(%rax), %xmm0
	movdqa	%xmm0, %xmm2
	addq	$64, %rax
	movdqa	-32(%rax), %xmm1
	shufps	$136, -16(%rax), %xmm1
	shufps	$221, %xmm1, %xmm2
	shufps	$136, %xmm1, %xmm0
	psubd	%xmm0, %xmm2
	paddd	%xmm2, %xmm3
	cmpq	%rcx, %rax
	jne	.L13
	movdqa	%xmm3, %xmm0
	psrldq	$8, %xmm0
	paddd	%xmm0, %xmm3
	movdqa	%xmm3, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm3
	movd	%xmm3, %eax
	addl	%eax, %edx
	movl	%r10d, %eax
	andl	$-4, %eax
	testb	$3, %r10b
	je	.L14
.L12:
	movslq	%eax, %rcx
	leal	1(%rax), %r8d
	salq	$4, %rcx
	addq	%rdi, %rcx
	addl	8(%rcx), %edx
	subl	(%rcx), %edx
	cmpl	%eax, %esi
	jle	.L14
	movslq	%r8d, %rcx
	addl	$2, %eax
	salq	$4, %rcx
	addq	%rdi, %rcx
	addl	8(%rcx), %edx
	subl	(%rcx), %edx
	cmpl	%esi, %r8d
	jge	.L14
	cltq
	salq	$4, %rax
	addq	%rax, %rdi
	addl	8(%rdi), %edx
	subl	(%rdi), %edx
.L14:
	movl	%edx, area(%rip)
	movl	%r10d, (%r9)
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	ret
	.p2align 4,,10
	.p2align 3
.L8:
	movl	%edx, 8+calc(%rip)
	movl	$1, %r10d
	subl	%r8d, %edx
	addl	area(%rip), %edx
	movl	%r8d, calc(%rip)
	jmp	.L14
.L15:
	xorl	%eax, %eax
	jmp	.L12
	.cfi_endproc
.LFE39:
	.size	mergeArea, .-mergeArea
	.p2align 4
	.globl	mergeLength
	.type	mergeLength, @function
mergeLength:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	-159744(%rsp), %r11
	.cfi_def_cfa 11, 159776
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$272, %rsp
	.cfi_def_cfa_offset 160048
	movq	%fs:40, %rdx
	movq	%rdx, 160008(%rsp)
	xorl	%edx, %edx
	movl	%esi, %ebx
	movl	bsize(%rip), %esi
	testl	%ebx, %ebx
	jle	.L24
	movq	%rdi, %rax
	leal	-1(%rbx), %edi
	cmpl	$1, %edi
	jbe	.L40
	movl	%edi, %ecx
	movq	%rsp, %rbp
	shrl	%ecx
	salq	$4, %rcx
	.p2align 4,,10
	.p2align 3
.L26:
	movdqu	(%rax,%rdx,2), %xmm0
	movdqu	16(%rax,%rdx,2), %xmm4
	shufps	$136, %xmm4, %xmm0
	movaps	%xmm0, 0(%rbp,%rdx)
	addq	$16, %rdx
	cmpq	%rdx, %rcx
	jne	.L26
	andl	$-2, %edi
	movl	%edi, %edx
	leal	(%rdi,%rdi), %ecx
.L25:
	movl	%ebx, %r8d
	subl	%edi, %r8d
	cmpl	$1, %r8d
	je	.L27
	movq	%rdi, %r9
	salq	$4, %r9
	addq	%rax, %r9
	movq	(%r9), %xmm0
	movq	8(%r9), %xmm1
	punpckldq	%xmm1, %xmm0
	movq	%xmm0, (%rsp,%rdi,8)
	leal	-1(%r8), %edi
	addl	%edi, %edx
	leal	(%rcx,%rdi,2), %ecx
.L27:
	movslq	%edx, %rdx
	leal	(%rbx,%rbx), %r12d
	salq	$4, %rdx
	addq	%rdx, %rax
	movd	(%rax), %xmm0
	movd	8(%rax), %xmm3
	movslq	%ecx, %rax
	punpckldq	%xmm3, %xmm0
	movq	%xmm0, (%rsp,%rax,4)
	testl	%esi, %esi
	jle	.L28
.L37:
	testl	%esi, %esi
	movl	$1, %edi
	cmovg	%esi, %edi
	cmpl	$1, %esi
	je	.L41
	movl	%edi, %ecx
	leaq	before(%rip), %r8
	movslq	%r12d, %r9
	shrl	%ecx
	leaq	32(%r8), %r10
	leaq	0(%rbp,%r9,4), %rdx
	movq	%r8, %rax
	subl	$1, %ecx
	salq	$5, %rcx
	addq	%r10, %rcx
	.p2align 4,,10
	.p2align 3
.L30:
	movdqa	(%rax), %xmm0
	addq	$32, %rax
	shufps	$136, -16(%rax), %xmm0
	addq	$16, %rdx
	movups	%xmm0, -16(%rdx)
	cmpq	%rcx, %rax
	jne	.L30
	movl	%edi, %eax
	andl	$-2, %eax
	andl	$1, %edi
	je	.L31
.L29:
	movq	%rax, %rdx
	leaq	(%r9,%rax,2), %rax
	salq	$4, %rdx
	addq	%rdx, %r8
	movq	(%r8), %xmm0
	movq	8(%r8), %xmm1
	punpckldq	%xmm1, %xmm0
	movq	%xmm0, (%rsp,%rax,4)
.L31:
	xorl	%edx, %edx
	leal	-2(%rsi,%rsi), %eax
	testl	%esi, %esi
	cmovle	%edx, %eax
	leal	2(%r12,%rax), %r12d
.L28:
	movl	$4, %edx
	xorl	%eax, %eax
	movl	%r12d, %esi
	movq	%rbp, %rdi
	leaq	comp_int(%rip), %rcx
	call	qsort@PLT
	leal	-1(%r12), %edx
	movl	$1, %eax
	shrl	%edx
	addl	$1, %edx
	testl	%r12d, %r12d
	cmovle	%eax, %edx
	cmpl	$6, %r12d
	jle	.L42
	movl	%edx, %ecx
	pxor	%xmm2, %xmm2
	movq	%rbp, %rax
	shrl	$2, %ecx
	subl	$1, %ecx
	salq	$5, %rcx
	leaq	32(%rsp,%rcx), %rcx
	.p2align 4,,10
	.p2align 3
.L33:
	movdqa	(%rax), %xmm0
	addq	$32, %rax
	movdqa	%xmm0, %xmm1
	shufps	$136, -16(%rax), %xmm0
	shufps	$221, -16(%rax), %xmm1
	psubd	%xmm0, %xmm1
	paddd	%xmm1, %xmm2
	cmpq	%rax, %rcx
	jne	.L33
	movdqa	%xmm2, %xmm0
	movl	%edx, %esi
	psrldq	$8, %xmm0
	andl	$-4, %esi
	paddd	%xmm0, %xmm2
	leal	(%rsi,%rsi), %ecx
	movdqa	%xmm2, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm2
	movd	%xmm2, %eax
	cmpl	%edx, %esi
	je	.L36
.L32:
	leal	1(%rcx), %esi
	movslq	%ecx, %rdx
	movslq	%esi, %rsi
	addl	(%rsp,%rsi,4), %eax
	subl	(%rsp,%rdx,4), %eax
	leal	2(%rcx), %edx
	cmpl	%r12d, %edx
	jge	.L36
	leal	3(%rcx), %esi
	movslq	%edx, %rdx
	movslq	%esi, %rsi
	addl	(%rsp,%rsi,4), %eax
	subl	(%rsp,%rdx,4), %eax
	leal	4(%rcx), %edx
	cmpl	%r12d, %edx
	jge	.L36
	addl	$5, %ecx
	movslq	%edx, %rdx
	movslq	%ecx, %rcx
	addl	(%rsp,%rcx,4), %eax
	subl	(%rsp,%rdx,4), %eax
.L36:
	leal	(%rax,%rbx,2), %eax
	addl	%eax, length(%rip)
	movq	160008(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L53
	addq	$160016, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L24:
	.cfi_restore_state
	testl	%esi, %esi
	jg	.L54
	movq	%rsp, %rdi
	leaq	comp_int(%rip), %rcx
	xorl	%esi, %esi
	xorl	%eax, %eax
	movl	$4, %edx
	call	qsort@PLT
	xorl	%eax, %eax
	jmp	.L36
.L40:
	xorl	%edi, %edi
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	movq	%rsp, %rbp
	jmp	.L25
.L41:
	xorl	%eax, %eax
	leaq	before(%rip), %r8
	movslq	%r12d, %r9
	jmp	.L29
.L42:
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	jmp	.L32
.L54:
	xorl	%r12d, %r12d
	movq	%rsp, %rbp
	jmp	.L37
.L53:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.size	mergeLength, .-mergeLength
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d%d%d%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB41:
	.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
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	before(%rip), %r13
	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	36(%rsp), %rax
	movq	%rax, 24(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 16(%rsp)
	.p2align 4,,10
	.p2align 3
.L72:
	movq	24(%rsp), %rdx
	movq	16(%rsp), %rsi
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	32(%rsp), %ebp
	movl	%ebp, %eax
	addl	36(%rsp), %eax
	je	.L56
	movl	$0, length(%rip)
	movl	$0, area(%rip)
	testl	%ebp, %ebp
	jle	.L57
	leaq	4+p.1(%rip), %r12
	movl	$-100000, %ebx
	movl	$1000000, %r14d
	xorl	%r15d, %r15d
	leaq	.LC1(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L58:
	leaq	8(%r12), %r8
	leaq	4(%r12), %rcx
	movq	%r12, %rdx
	xorl	%eax, %eax
	leaq	-4(%r12), %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	movl	(%r12), %eax
	movl	32(%rsp), %r8d
	cmpl	%eax, %r14d
	cmovg	%eax, %r14d
	movl	8(%r12), %eax
	cmpl	%eax, %ebx
	cmovl	%eax, %ebx
	addl	$1, %r15d
	addq	$16, %r12
	cmpl	%r15d, %r8d
	jg	.L58
	movl	$160000, %edx
	xorl	%esi, %esi
	movq	%r13, %rdi
	movl	%r8d, 12(%rsp)
	movl	$0, bsize(%rip)
	call	memset@PLT
	movl	12(%rsp), %esi
	movl	$16, %edx
	xorl	%eax, %eax
	leaq	comp(%rip), %rcx
	leaq	p.1(%rip), %rdi
	call	qsort@PLT
	movl	$0, length(%rip)
	movl	$0, area(%rip)
	cmpl	%r14d, %ebx
	jl	.L76
	leaq	grid.0(%rip), %r12
	leaq	calc(%rip), %r15
	.p2align 4,,10
	.p2align 3
.L71:
	movl	$160000, %edx
	xorl	%esi, %esi
	movq	%r12, %rdi
	call	memset@PLT
	movl	32(%rsp), %edx
	testl	%edx, %edx
	jle	.L60
	leaq	p.1(%rip), %rax
	subl	$1, %edx
	xorl	%ebp, %ebp
	salq	$4, %rdx
	leaq	16(%rax), %rdi
	addq	%rdi, %rdx
	.p2align 4,,10
	.p2align 3
.L62:
	cmpl	%r14d, 4(%rax)
	jg	.L61
	cmpl	%r14d, 12(%rax)
	jle	.L61
	movslq	%ebp, %rcx
	movdqa	(%rax), %xmm4
	addl	$1, %ebp
	salq	$4, %rcx
	movaps	%xmm4, (%r12,%rcx)
.L61:
	addq	$16, %rax
	cmpq	%rdx, %rax
	jne	.L62
	testl	%ebp, %ebp
	je	.L60
	movl	(%r12), %r8d
	movl	8+grid.0(%rip), %eax
	cmpl	$1, %ebp
	je	.L63
	leaq	16+grid.0(%rip), %rdx
	leal	-2(%rbp), %r10d
	leaq	16(%rdx), %rdi
	salq	$4, %r10
	addq	%rdi, %r10
	xorl	%edi, %edi
	jmp	.L66
	.p2align 4,,10
	.p2align 3
.L94:
	cmpl	%r9d, %eax
	cmovl	%r9d, %eax
	addq	$16, %rdx
	cmpq	%r10, %rdx
	je	.L93
.L66:
	movl	(%rdx), %esi
	movl	8(%rdx), %r9d
	cmpl	%eax, %esi
	jle	.L94
	movslq	%edi, %rcx
	addq	$16, %rdx
	addl	$1, %edi
	salq	$4, %rcx
	addq	%r15, %rcx
	movl	%r8d, (%rcx)
	movl	%esi, %r8d
	movl	%eax, 8(%rcx)
	movl	%r9d, %eax
	cmpq	%r10, %rdx
	jne	.L66
.L93:
	movslq	%edi, %rdx
	leal	1(%rdi), %ebp
	salq	$4, %rdx
	addq	%r15, %rdx
	movl	%eax, 8(%rdx)
	movl	area(%rip), %eax
	movl	%r8d, (%rdx)
	cmpl	$2, %edi
	jle	.L77
	movl	%ebp, %ecx
	leaq	calc(%rip), %rdx
	pxor	%xmm3, %xmm3
	shrl	$2, %ecx
	leaq	64(%rdx), %rsi
	subl	$1, %ecx
	salq	$6, %rcx
	addq	%rsi, %rcx
	.p2align 4,,10
	.p2align 3
.L68:
	movdqa	(%rdx), %xmm0
	shufps	$136, 16(%rdx), %xmm0
	movdqa	%xmm0, %xmm2
	addq	$64, %rdx
	movdqa	-32(%rdx), %xmm1
	shufps	$136, -16(%rdx), %xmm1
	shufps	$221, %xmm1, %xmm2
	shufps	$136, %xmm1, %xmm0
	psubd	%xmm0, %xmm2
	paddd	%xmm2, %xmm3
	cmpq	%rcx, %rdx
	jne	.L68
	movdqa	%xmm3, %xmm0
	psrldq	$8, %xmm0
	paddd	%xmm0, %xmm3
	movdqa	%xmm3, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm3
	movd	%xmm3, %edx
	addl	%edx, %eax
	movl	%ebp, %edx
	andl	$-4, %edx
	testb	$3, %bpl
	je	.L69
.L67:
	movslq	%edx, %rcx
	leal	1(%rdx), %esi
	salq	$4, %rcx
	addq	%r15, %rcx
	addl	8(%rcx), %eax
	subl	(%rcx), %eax
	cmpl	%edi, %edx
	jge	.L69
	movslq	%esi, %rcx
	addl	$2, %edx
	salq	$4, %rcx
	addq	%r15, %rcx
	addl	8(%rcx), %eax
	subl	(%rcx), %eax
	cmpl	%edi, %esi
	jge	.L69
	movslq	%edx, %rdx
	salq	$4, %rdx
	addq	%r15, %rdx
	addl	8(%rdx), %eax
	subl	(%rdx), %eax
.L69:
	cmpl	$2, 36(%rsp)
	movl	%eax, area(%rip)
	je	.L74
.L70:
	movl	$160000, %edx
	movq	%r15, %rsi
	movq	%r13, %rdi
	addl	$1, %r14d
	call	memcpy@PLT
	movl	%ebp, bsize(%rip)
	cmpl	%ebx, %r14d
	jle	.L71
	movl	area(%rip), %edx
.L59:
	leaq	.LC2(%rip), %rbp
	xorl	%eax, %eax
	movl	$1, %edi
	movq	%rbp, %rsi
	call	__printf_chk@PLT
	cmpl	$2, 36(%rsp)
	jne	.L72
	movl	length(%rip), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L72
	.p2align 4,,10
	.p2align 3
.L60:
	xorl	%ebp, %ebp
	cmpl	$2, 36(%rsp)
	jne	.L70
	movl	bsize(%rip), %ebp
	testl	%ebp, %ebp
	je	.L70
	xorl	%ebp, %ebp
	.p2align 4,,10
	.p2align 3
.L74:
	movl	%ebp, %esi
	movq	%r15, %rdi
	call	mergeLength
	jmp	.L70
.L63:
	movl	%eax, 8+calc(%rip)
	subl	%r8d, %eax
	addl	area(%rip), %eax
	movl	%r8d, (%r15)
	jmp	.L69
.L57:
	movl	$160000, %edx
	xorl	%esi, %esi
	movq	%r13, %rdi
	movl	$0, bsize(%rip)
	call	memset@PLT
	movl	$16, %edx
	movl	%ebp, %esi
	xorl	%eax, %eax
	leaq	comp(%rip), %rcx
	leaq	p.1(%rip), %rdi
	call	qsort@PLT
	xorl	%edx, %edx
	movl	$0, length(%rip)
	movl	$0, area(%rip)
	jmp	.L59
.L56:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L95
	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
.L76:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L59
.L95:
	call	__stack_chk_fail@PLT
.L77:
	xorl	%edx, %edx
	jmp	.L67
	.cfi_endproc
.LFE41:
	.size	main, .-main
	.local	grid.0
	.comm	grid.0,160000,32
	.local	p.1
	.comm	p.1,160000,32
	.globl	bsize
	.bss
	.align 4
	.type	bsize, @object
	.size	bsize, 4
bsize:
	.zero	4
	.globl	before
	.align 32
	.type	before, @object
	.size	before, 160000
before:
	.zero	160000
	.globl	calc
	.align 32
	.type	calc, @object
	.size	calc, 160000
calc:
	.zero	160000
	.globl	length
	.align 4
	.type	length, @object
	.size	length, 4
length:
	.zero	4
	.globl	area
	.align 4
	.type	area, @object
	.size	area, 4
area:
	.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 <string.h>

typedef struct {
    int sx, sy;
    int ex, ey;
} RECT;

int min(int a, int b)
{
    return (b > a ? a : b);
}

int max(int a, int b)
{
    return (a > b ? a : b);
}

int comp(const void *a, const void *b)
{
    RECT x, y;
    x = *(RECT *)a;
    y = *(RECT *)b;
    
    return (x.sx - y.sx);
}

int comp_int(const void *a, const void *b)
{
    int x, y;
    x = *(int *)a;
    y = *(int *)b;
    
    return (x - y);
}

int area;
int length;

RECT calc[10000];
RECT before[10000];
int bsize;

void mergeArea(RECT *grid, int n, int *sq)
{
    int i, j;
    int num;
    int start, end;
    
    if (n == 0){
        return;
    }
    num = 0;
    start = grid[0].sx;
    end = grid[0].ex;
    for (i = 1; i < n; i++){
        if (grid[i].sx <= end){
            end = max(end, grid[i].ex);
        }
        else {
            calc[num].sx = start;
            calc[num++].ex = end;
            start = grid[i].sx;
            end = grid[i].ex;
        }
    }
    calc[num].sx = start;
    calc[num++].ex = end;
    for (i = 0; i < num; i++){
        area += calc[i].ex - calc[i].sx;
    }
    
    *sq = num;
}

void mergeLength(RECT *grid, int n)
{
    int total[40000];
    int i;
    int res, num;
    
    num = 0;
    for (i = 0; i < n; i++){
        total[num++] = grid[i].sx;
        total[num++] = grid[i].ex;
    }
    for (i = 0; i < bsize; i++){
        total[num++] = before[i].sx;
        total[num++] = before[i].ex;
    }
    
    qsort(total, num, sizeof(int), comp_int);
    res = 0;
    for (i = 0; i < num; i += 2){
        res += total[i + 1] - total[i];
    }
    length += res + 2 * n;
}

int main(void)
{
    int n, query;
    static RECT p[10000];
    static RECT grid[10000];
    int num;
    int i, j;
    int sq;
    int miny, maxy;
    
    while (1){
        scanf("%d%d", &n, &query);
        
        if (n + query == 0){
            break;
        }
        area = length = 0;
        miny = 1000000;
        maxy = -100000;
        for (i = 0; i < n; i++){
            scanf("%d%d%d%d", &p[i].sx, &p[i].sy, &p[i].ex, &p[i].ey);
            miny = min(miny, p[i].sy);
            maxy = max(maxy, p[i].ey);
        }
        bsize = 0;
        memset(before, 0, sizeof(before));
        qsort(p, n, sizeof(RECT), comp);
        area = length = 0;
        for (i = miny; i <= maxy; i++){
            memset(grid, 0, sizeof(grid));
            num = sq = 0;
            for (j = 0; j < n; j++){
                if (p[j].sy <= i && i < p[j].ey){
                    grid[num++] = p[j];
                }
            }
            mergeArea(grid, num, &sq);
            if (query == 2 && (bsize != 0 || num != 0)){
                mergeLength(calc, sq);
            }
            memcpy(before, calc, sizeof(calc));
            bsize = sq;
        }
        printf("%d\n", area);
        if (query == 2){
            printf("%d\n", length);
        }
    }
    
    return (0);
}
5 1
0 0 3 2
1 1 2 5
0 4 6 5
3 3 5 6
5 0 7 6
5 2
0 0 3 2
1 1 2 5
0 4 6 5
3 3 5 6
5 0 7 6
2 2
0 0 8 9
0 1 9 8
3 2
2 2 8 8
3 0 4 9
5 0 7 9
0 0
 5 1
0 0 3 2
1 1 2 5
0 4 6 5
3 3 5 6
5 0 7 6
5 2
0 0 3 2
1 1 2 5
0 4 6 5
3 3 5 6
5 0 7 6
2 2
0 0 8 3
0 1 9 8
3 2
2 2 8 8
3 0 4 9
5 0 7 9
0 0
 5 1
0 0 3 2
1 1 2 5
0 4 6 5
3 3 5 6
5 0 7 6
5 2
0 0 3 2
1 1 2 5
0 4 6 5
3 3 5 6
5 0 7 6
2 2
0 0 8 3
0 2 9 8
3 2
2 2 8 8
3 0 4 9
5 0 7 9
0 0
 5 1
0 0 4 2
1 1 2 5
0 4 6 5
3 3 5 6
5 0 7 6
5 2
0 0 3 2
1 1 2 5
0 4 6 5
3 3 5 6
5 0 7 6
2 2
0 0 8 3
0 2 9 8
3 2
2 2 8 8
3 0 4 9
5 0 7 9
0 0
 5 1
0 0 4 2
1 1 2 5
0 4 6 5
3 3 5 6
5 0 7 6
5 2
0 0 3 2
1 1 2 1
0 4 6 5
3 3 5 6
5 0 7 6
2 2
0 0 8 3
0 2 9 8
3 2
2 2 8 8
3 0 4 9
5 0 7 9
0 0
 5 1
0 0 4 2
1 1 2 5
0 4 6 5
3 3 5 6
5 1 7 6
5 2
0 0 3 2
1 1 2 1
0 4 6 5
3 3 5 6
5 0 7 6
2 2
0 0 8 3
0 2 9 8
3 2
2 2 8 8
3 0 4 9
5 0 7 9
0 0
 5 1
0 0 3 2
2 1 2 5
0 4 6 5
3 3 5 6
5 0 7 6
5 2
0 0 3 2
1 1 2 5
0 4 6 5
3 3 5 6
5 0 7 6
2 2
0 0 8 9
0 0 9 8
3 2
2 2 8 8
3 0 4 9
5 0 7 9
0 0
 5 1
0 0 3 2
1 1 2 5
0 4 6 5
3 3 5 6
5 0 7 6
5 2
0 0 3 2
1 1 2 5
0 4 6 5
3 3 5 6
5 0 7 6
2 2
0 0 8 3
0 1 9 8
3 2
2 2 8 10
3 0 4 9
5 0 7 9
0 0
 5 1
0 0 3 2
2 1 2 5
0 4 6 5
3 3 5 6
5 0 7 6
5 2
0 0 3 2
1 1 2 5
0 4 6 5
3 3 5 6
5 0 7 6
2 2
0 0 8 9
0 0 9 8
3 2
2 2 13 8
3 0 4 9
5 0 7 9
0 0
 5 1
0 0 3 2
2 1 2 5
0 4 6 5
3 3 5 6
5 0 7 5
5 2
0 0 3 2
1 1 2 5
0 4 6 5
3 3 5 6
5 0 7 6
2 2
0 0 8 9
0 0 9 8
3 2
2 2 13 8
3 0 4 9
5 0 7 9
0 0

29
29
38
79
36
45
36
 29
29
38
71
34
45
36
 29
29
38
70
34
45
36
 31
29
38
70
34
45
36
 31
27
36
70
34
45
36
 29
27
36
70
34
45
36
 27
29
38
80
36
45
36
 29
29
38
71
34
54
36
 27
29
38
80
36
75
46
 25
29
38
80
36
75
46

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 <string.h>

typedef struct {
    int sx, sy;
    int ex, ey;
} RECT;

int min(int a, int b)
{
    return (b > a ? a : b);
}

int max(int a, int b)
{
    return (a > b ? a : b);
}

int comp(const void *a, const void *b)
{
    RECT x, y;
    x = *(RECT *)a;
    y = *(RECT *)b;
    
    return (x.sx - y.sx);
}

int comp_int(const void *a, const void *b)
{
    int x, y;
    x = *(int *)a;
    y = *(int *)b;
    
    return (x - y);
}

int area;
int length;

RECT calc[10000];
RECT before[10000];
int bsize;

void mergeArea(RECT *grid, int n, int *sq)
{
    int i, j;
    int num;
    int start, end;
    
    if (n == 0){
        return;
    }
    num = 0;
    start = grid[0].sx;
    end = grid[0].ex;
    for (i = 1; i < n; i++){
        if (grid[i].sx <= end){
            end = max(end, grid[i].ex);
        }
        else {
            calc[num].sx = start;
            calc[num++].ex = end;
            start = grid[i].sx;
            end = grid[i].ex;
        }
    }
    calc[num].sx = start;
    calc[num++].ex = end;
    for (i = 0; i < num; i++){
        area += calc[i].ex - calc[i].sx;
    }
    
    *sq = num;
}

void mergeLength(RECT *grid, int n)
{
    int total[40000];
    int i;
    int res, num;
    
    num = 0;
    for (i = 0; i < n; i++){
        total[num++] = grid[i].sx;
        total[num++] = grid[i].ex;
    }
    for (i = 0; i < bsize; i++){
        total[num++] = before[i].sx;
        total[num++] = before[i].ex;
    }
    
    qsort(total, num, sizeof(int), comp_int);
    res = 0;
    for (i = 0; i < num; i += 2){
        res += total[i + 1] - total[i];
    }
    length += res + 2 * n;
}

int main(void)
{
    int n, query;
    static RECT p[10000];
    static RECT grid[10000];
    int num;
    int i, j;
    int sq;
    int miny, maxy;
    
    while (1){
        scanf("%d%d", &n, &query);
        
        if (n + query == 0){
            break;
        }
        area = length = 0;
        miny = 1000000;
        maxy = -100000;
        for (i = 0; i < n; i++){
            scanf("%d%d%d%d", &p[i].sx, &p[i].sy, &p[i].ex, &p[i].ey);
            miny = min(miny, p[i].sy);
            maxy = max(maxy, p[i].ey);
        }
        bsize = 0;
        memset(before, 0, sizeof(before));
        qsort(p, n, sizeof(RECT), comp);
        area = length = 0;
        for (i = miny; i <= maxy; i++){
            memset(grid, 0, sizeof(grid));
            num = sq = 0;
            for (j = 0; j < n; j++){
                if (p[j].sy <= i && i < p[j].ey){
                    grid[num++] = p[j];
                }
            }
            mergeArea(grid, num, &sq);
            if (query == 2 && (bsize != 0 || num != 0)){
                mergeLength(calc, sq);
            }
            memcpy(before, calc, sizeof(calc));
            bsize = sq;
        }
        printf("%d\n", area);
        if (query == 2){
            printf("%d\n", length);
        }
    }
    
    return (0);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	min
	.type	min, @function
min:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	min, .-min
	.globl	max
	.type	max, @function
max:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	max, .-max
	.globl	comp
	.type	comp, @function
comp:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -40(%rbp)
	movq	%rsi, -48(%rbp)
	movq	-40(%rbp), %rax
	movq	8(%rax), %rdx
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	%rdx, -24(%rbp)
	movq	-48(%rbp), %rax
	movq	8(%rax), %rdx
	movq	(%rax), %rax
	movq	%rax, -16(%rbp)
	movq	%rdx, -8(%rbp)
	movl	-32(%rbp), %eax
	movl	-16(%rbp), %edx
	subl	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	comp, .-comp
	.globl	comp_int
	.type	comp_int, @function
comp_int:
.LFB3:
	.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
	subl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	comp_int, .-comp_int
	.globl	area
	.bss
	.align 4
	.type	area, @object
	.size	area, 4
area:
	.zero	4
	.globl	length
	.align 4
	.type	length, @object
	.size	length, 4
length:
	.zero	4
	.globl	calc
	.align 32
	.type	calc, @object
	.size	calc, 160000
calc:
	.zero	160000
	.globl	before
	.align 32
	.type	before, @object
	.size	before, 160000
before:
	.zero	160000
	.globl	bsize
	.align 4
	.type	bsize, @object
	.size	bsize, 4
bsize:
	.zero	4
	.text
	.globl	mergeArea
	.type	mergeArea, @function
mergeArea:
.LFB4:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$40, %rsp
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movq	%rdx, -40(%rbp)
	cmpl	$0, -28(%rbp)
	je	.L18
	movl	$0, -12(%rbp)
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
	movq	-24(%rbp), %rax
	movl	8(%rax), %eax
	movl	%eax, -4(%rbp)
	movl	$1, -16(%rbp)
	jmp	.L12
.L15:
	movl	-16(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L13
	movl	-16(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	8(%rax), %edx
	movl	-4(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	max
	movl	%eax, -4(%rbp)
	jmp	.L14
.L13:
	movl	-12(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	calc(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-12(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -12(%rbp)
	cltq
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	8+calc(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-16(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
	movl	-16(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	8(%rax), %eax
	movl	%eax, -4(%rbp)
.L14:
	addl	$1, -16(%rbp)
.L12:
	movl	-16(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L15
	movl	-12(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	calc(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-12(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -12(%rbp)
	cltq
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	8+calc(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	$0, -16(%rbp)
	jmp	.L16
.L17:
	movl	-16(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	8+calc(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-16(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	leaq	calc(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	movl	%eax, %ecx
	movl	area(%rip), %eax
	addl	%ecx, %eax
	movl	%eax, area(%rip)
	addl	$1, -16(%rbp)
.L16:
	movl	-16(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jl	.L17
	movq	-40(%rbp), %rax
	movl	-12(%rbp), %edx
	movl	%edx, (%rax)
	jmp	.L9
.L18:
	nop
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	mergeArea, .-mergeArea
	.globl	mergeLength
	.type	mergeLength, @function
mergeLength:
.LFB5:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-159744(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$304, %rsp
	movq	%rdi, -160040(%rbp)
	movl	%esi, -160044(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -160020(%rbp)
	movl	$0, -160028(%rbp)
	jmp	.L20
.L21:
	movl	-160028(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-160040(%rbp), %rax
	leaq	(%rdx,%rax), %rcx
	movl	-160020(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -160020(%rbp)
	movl	(%rcx), %edx
	cltq
	movl	%edx, -160016(%rbp,%rax,4)
	movl	-160028(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-160040(%rbp), %rax
	leaq	(%rdx,%rax), %rcx
	movl	-160020(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -160020(%rbp)
	movl	8(%rcx), %edx
	cltq
	movl	%edx, -160016(%rbp,%rax,4)
	addl	$1, -160028(%rbp)
.L20:
	movl	-160028(%rbp), %eax
	cmpl	-160044(%rbp), %eax
	jl	.L21
	movl	$0, -160028(%rbp)
	jmp	.L22
.L23:
	movl	-160020(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -160020(%rbp)
	movl	-160028(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	leaq	before(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	cltq
	movl	%edx, -160016(%rbp,%rax,4)
	movl	-160020(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -160020(%rbp)
	movl	-160028(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	leaq	8+before(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	cltq
	movl	%edx, -160016(%rbp,%rax,4)
	addl	$1, -160028(%rbp)
.L22:
	movl	bsize(%rip), %eax
	cmpl	%eax, -160028(%rbp)
	jl	.L23
	movl	-160020(%rbp), %esi
	leaq	-160016(%rbp), %rax
	leaq	comp_int(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rdi
	movl	$0, %eax
	call	qsort@PLT
	movl	$0, -160024(%rbp)
	movl	$0, -160028(%rbp)
	jmp	.L24
.L25:
	movl	-160028(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-160016(%rbp,%rax,4), %edx
	movl	-160028(%rbp), %eax
	cltq
	movl	-160016(%rbp,%rax,4), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	addl	%eax, -160024(%rbp)
	addl	$2, -160028(%rbp)
.L24:
	movl	-160028(%rbp), %eax
	cmpl	-160020(%rbp), %eax
	jl	.L25
	movl	-160044(%rbp), %eax
	leal	(%rax,%rax), %edx
	movl	-160024(%rbp), %eax
	addl	%eax, %edx
	movl	length(%rip), %eax
	addl	%edx, %eax
	movl	%eax, length(%rip)
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L26
	call	__stack_chk_fail@PLT
.L26:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE5:
	.size	mergeLength, .-mergeLength
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d%d%d%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.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
.L40:
	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), %edx
	movl	-36(%rbp), %eax
	addl	%edx, %eax
	testl	%eax, %eax
	je	.L44
	movl	$0, length(%rip)
	movl	length(%rip), %eax
	movl	%eax, area(%rip)
	movl	$1000000, -16(%rbp)
	movl	$-100000, -12(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L30
.L31:
	movl	-24(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	p.1(%rip), %rax
	addq	%rdx, %rax
	leaq	12(%rax), %rsi
	movl	-24(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	p.1(%rip), %rax
	addq	%rdx, %rax
	leaq	8(%rax), %rcx
	movl	-24(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	p.1(%rip), %rax
	addq	%rdx, %rax
	leaq	4(%rax), %rdx
	movl	-24(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdi
	leaq	p.1(%rip), %rax
	addq	%rdi, %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	4+p.1(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-16(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	min
	movl	%eax, -16(%rbp)
	movl	-24(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	12+p.1(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-12(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	max
	movl	%eax, -12(%rbp)
	addl	$1, -24(%rbp)
.L30:
	movl	-40(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L31
	movl	$0, bsize(%rip)
	movl	$160000, %edx
	movl	$0, %esi
	leaq	before(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	-40(%rbp), %eax
	leaq	comp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$16, %edx
	movl	%eax, %esi
	leaq	p.1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	qsort@PLT
	movl	$0, length(%rip)
	movl	length(%rip), %eax
	movl	%eax, area(%rip)
	movl	-16(%rbp), %eax
	movl	%eax, -24(%rbp)
	jmp	.L32
.L38:
	movl	$160000, %edx
	movl	$0, %esi
	leaq	grid.0(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -32(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -28(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L33
.L35:
	movl	-20(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	4+p.1(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L34
	movl	-20(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	12+p.1(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -24(%rbp)
	jge	.L34
	movl	-28(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -28(%rbp)
	cltq
	salq	$4, %rax
	movq	%rax, %rsi
	leaq	grid.0(%rip), %rcx
	movl	-20(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	p.1(%rip), %rax
	leaq	(%rdx,%rax), %rdx
	movq	(%rdx), %rax
	movq	8(%rdx), %rdx
	movq	%rax, (%rsi,%rcx)
	movq	%rdx, 8(%rsi,%rcx)
.L34:
	addl	$1, -20(%rbp)
.L33:
	movl	-40(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L35
	leaq	-32(%rbp), %rdx
	movl	-28(%rbp), %eax
	movl	%eax, %esi
	leaq	grid.0(%rip), %rax
	movq	%rax, %rdi
	call	mergeArea
	movl	-36(%rbp), %eax
	cmpl	$2, %eax
	jne	.L36
	movl	bsize(%rip), %eax
	testl	%eax, %eax
	jne	.L37
	cmpl	$0, -28(%rbp)
	je	.L36
.L37:
	movl	-32(%rbp), %eax
	movl	%eax, %esi
	leaq	calc(%rip), %rax
	movq	%rax, %rdi
	call	mergeLength
.L36:
	leaq	before(%rip), %rax
	leaq	calc(%rip), %rcx
	movl	$160000, %edx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	memcpy@PLT
	movl	-32(%rbp), %eax
	movl	%eax, bsize(%rip)
	addl	$1, -24(%rbp)
.L32:
	movl	-24(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jle	.L38
	movl	area(%rip), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	-36(%rbp), %eax
	cmpl	$2, %eax
	jne	.L40
	movl	length(%rip), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L40
.L44:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L42
	call	__stack_chk_fail@PLT
.L42:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.local	p.1
	.comm	p.1,160000,32
	.local	grid.0
	.comm	grid.0,160000,32
	.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	min
	.type	min, @function
min:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	min, .-min
	.globl	max
	.type	max, @function
max:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	max, .-max
	.globl	comp
	.type	comp, @function
comp:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -40(%rbp)
	movq	%rsi, -48(%rbp)
	movq	-40(%rbp), %rax
	movq	8(%rax), %rdx
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	%rdx, -24(%rbp)
	movq	-48(%rbp), %rax
	movq	8(%rax), %rdx
	movq	(%rax), %rax
	movq	%rax, -16(%rbp)
	movq	%rdx, -8(%rbp)
	movl	-32(%rbp), %eax
	movl	-16(%rbp), %edx
	subl	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	comp, .-comp
	.globl	comp_int
	.type	comp_int, @function
comp_int:
.LFB3:
	.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
	subl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	comp_int, .-comp_int
	.globl	area
	.bss
	.align 4
	.type	area, @object
	.size	area, 4
area:
	.zero	4
	.globl	length
	.align 4
	.type	length, @object
	.size	length, 4
length:
	.zero	4
	.globl	calc
	.align 32
	.type	calc, @object
	.size	calc, 160000
calc:
	.zero	160000
	.globl	before
	.align 32
	.type	before, @object
	.size	before, 160000
before:
	.zero	160000
	.globl	bsize
	.align 4
	.type	bsize, @object
	.size	bsize, 4
bsize:
	.zero	4
	.text
	.globl	mergeArea
	.type	mergeArea, @function
mergeArea:
.LFB4:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$40, %rsp
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movq	%rdx, -40(%rbp)
	cmpl	$0, -28(%rbp)
	je	.L18
	movl	$0, -12(%rbp)
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
	movq	-24(%rbp), %rax
	movl	8(%rax), %eax
	movl	%eax, -4(%rbp)
	movl	$1, -16(%rbp)
	jmp	.L12
.L15:
	movl	-16(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L13
	movl	-16(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	8(%rax), %edx
	movl	-4(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	max
	movl	%eax, -4(%rbp)
	jmp	.L14
.L13:
	movl	-12(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	calc(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-12(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -12(%rbp)
	cltq
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	8+calc(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-16(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
	movl	-16(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	8(%rax), %eax
	movl	%eax, -4(%rbp)
.L14:
	addl	$1, -16(%rbp)
.L12:
	movl	-16(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L15
	movl	-12(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	calc(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-12(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -12(%rbp)
	cltq
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	8+calc(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	$0, -16(%rbp)
	jmp	.L16
.L17:
	movl	-16(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	8+calc(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-16(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	leaq	calc(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	movl	%eax, %ecx
	movl	area(%rip), %eax
	addl	%ecx, %eax
	movl	%eax, area(%rip)
	addl	$1, -16(%rbp)
.L16:
	movl	-16(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jl	.L17
	movq	-40(%rbp), %rax
	movl	-12(%rbp), %edx
	movl	%edx, (%rax)
	jmp	.L9
.L18:
	nop
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	mergeArea, .-mergeArea
	.globl	mergeLength
	.type	mergeLength, @function
mergeLength:
.LFB5:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-159744(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$304, %rsp
	movq	%rdi, -160040(%rbp)
	movl	%esi, -160044(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -160020(%rbp)
	movl	$0, -160028(%rbp)
	jmp	.L20
.L21:
	movl	-160028(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-160040(%rbp), %rax
	leaq	(%rdx,%rax), %rcx
	movl	-160020(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -160020(%rbp)
	movl	(%rcx), %edx
	cltq
	movl	%edx, -160016(%rbp,%rax,4)
	movl	-160028(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-160040(%rbp), %rax
	leaq	(%rdx,%rax), %rcx
	movl	-160020(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -160020(%rbp)
	movl	8(%rcx), %edx
	cltq
	movl	%edx, -160016(%rbp,%rax,4)
	addl	$1, -160028(%rbp)
.L20:
	movl	-160028(%rbp), %eax
	cmpl	-160044(%rbp), %eax
	jl	.L21
	movl	$0, -160028(%rbp)
	jmp	.L22
.L23:
	movl	-160020(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -160020(%rbp)
	movl	-160028(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	leaq	before(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	cltq
	movl	%edx, -160016(%rbp,%rax,4)
	movl	-160020(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -160020(%rbp)
	movl	-160028(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	leaq	8+before(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	cltq
	movl	%edx, -160016(%rbp,%rax,4)
	addl	$1, -160028(%rbp)
.L22:
	movl	bsize(%rip), %eax
	cmpl	%eax, -160028(%rbp)
	jl	.L23
	movl	-160020(%rbp), %esi
	leaq	-160016(%rbp), %rax
	leaq	comp_int(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rdi
	movl	$0, %eax
	call	qsort@PLT
	movl	$0, -160024(%rbp)
	movl	$0, -160028(%rbp)
	jmp	.L24
.L25:
	movl	-160028(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-160016(%rbp,%rax,4), %edx
	movl	-160028(%rbp), %eax
	cltq
	movl	-160016(%rbp,%rax,4), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	addl	%eax, -160024(%rbp)
	addl	$2, -160028(%rbp)
.L24:
	movl	-160028(%rbp), %eax
	cmpl	-160020(%rbp), %eax
	jl	.L25
	movl	-160044(%rbp), %eax
	leal	(%rax,%rax), %edx
	movl	-160024(%rbp), %eax
	addl	%eax, %edx
	movl	length(%rip), %eax
	addl	%edx, %eax
	movl	%eax, length(%rip)
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L26
	call	__stack_chk_fail@PLT
.L26:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE5:
	.size	mergeLength, .-mergeLength
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d%d%d%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.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
.L40:
	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), %edx
	movl	-36(%rbp), %eax
	addl	%edx, %eax
	testl	%eax, %eax
	je	.L44
	movl	$0, length(%rip)
	movl	length(%rip), %eax
	movl	%eax, area(%rip)
	movl	$1000000, -16(%rbp)
	movl	$-100000, -12(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L30
.L31:
	movl	-24(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	p.1(%rip), %rax
	addq	%rdx, %rax
	leaq	12(%rax), %rsi
	movl	-24(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	p.1(%rip), %rax
	addq	%rdx, %rax
	leaq	8(%rax), %rcx
	movl	-24(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	p.1(%rip), %rax
	addq	%rdx, %rax
	leaq	4(%rax), %rdx
	movl	-24(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdi
	leaq	p.1(%rip), %rax
	addq	%rdi, %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	4+p.1(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-16(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	min
	movl	%eax, -16(%rbp)
	movl	-24(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	12+p.1(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-12(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	max
	movl	%eax, -12(%rbp)
	addl	$1, -24(%rbp)
.L30:
	movl	-40(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L31
	movl	$0, bsize(%rip)
	movl	$160000, %edx
	movl	$0, %esi
	leaq	before(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	-40(%rbp), %eax
	leaq	comp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$16, %edx
	movl	%eax, %esi
	leaq	p.1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	qsort@PLT
	movl	$0, length(%rip)
	movl	length(%rip), %eax
	movl	%eax, area(%rip)
	movl	-16(%rbp), %eax
	movl	%eax, -24(%rbp)
	jmp	.L32
.L38:
	movl	$160000, %edx
	movl	$0, %esi
	leaq	grid.0(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -32(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -28(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L33
.L35:
	movl	-20(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	4+p.1(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L34
	movl	-20(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	12+p.1(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -24(%rbp)
	jge	.L34
	movl	-28(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -28(%rbp)
	cltq
	salq	$4, %rax
	movq	%rax, %rsi
	leaq	grid.0(%rip), %rcx
	movl	-20(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	p.1(%rip), %rax
	leaq	(%rdx,%rax), %rdx
	movq	(%rdx), %rax
	movq	8(%rdx), %rdx
	movq	%rax, (%rsi,%rcx)
	movq	%rdx, 8(%rsi,%rcx)
.L34:
	addl	$1, -20(%rbp)
.L33:
	movl	-40(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L35
	leaq	-32(%rbp), %rdx
	movl	-28(%rbp), %eax
	movl	%eax, %esi
	leaq	grid.0(%rip), %rax
	movq	%rax, %rdi
	call	mergeArea
	movl	-36(%rbp), %eax
	cmpl	$2, %eax
	jne	.L36
	movl	bsize(%rip), %eax
	testl	%eax, %eax
	jne	.L37
	cmpl	$0, -28(%rbp)
	je	.L36
.L37:
	movl	-32(%rbp), %eax
	movl	%eax, %esi
	leaq	calc(%rip), %rax
	movq	%rax, %rdi
	call	mergeLength
.L36:
	leaq	before(%rip), %rax
	leaq	calc(%rip), %rcx
	movl	$160000, %edx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	memcpy@PLT
	movl	-32(%rbp), %eax
	movl	%eax, bsize(%rip)
	addl	$1, -24(%rbp)
.L32:
	movl	-24(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jle	.L38
	movl	area(%rip), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	-36(%rbp), %eax
	cmpl	$2, %eax
	jne	.L40
	movl	length(%rip), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L40
.L44:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L42
	call	__stack_chk_fail@PLT
.L42:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.local	p.1
	.comm	p.1,160000,32
	.local	grid.0
	.comm	grid.0,160000,32
	.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:
