Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
/*
Cache sum with binary tree
 */

#include <stdio.h>
#include <stdlib.h>

#define OUT_LINE_SIZE 11

int *a;
int N;

void add(int i, int x) {
    i += N - 1;
    a[i] += x;
    while (i) {
        i = i >> 1;
        a[i] = a[i*2] + a[i*2+1];
    }
}

int _getSum(int m, int n, int i, int l, int r) {
    if (n < l || r < m)
        return 0;
    if (m <= l && r <= n)
        return a[i];
    return _getSum(m, n, i*2, l, (l+r)>>1) +
           _getSum(m, n, i*2+1, ((l+r)>>1)+1, r);
}

void getSum(int s, int t) {
    printf("%d\n", _getSum(s-1, t-1, 1, 0, N-1));
}



int main() {
    int n, q, com, x, y, i;
    void (*f[2])(int, int);
    char *outbuf;

    f[0] = add;
    f[1] = getSum;

    scanf("%d %d", &n, &q);
    for (i = 1, N = 1<<1; n > N; ++i, N = 1<<i);

    a = (int*)calloc(N * 2, sizeof(int));

    outbuf = (char*)malloc(sizeof(char) * OUT_LINE_SIZE * q);
    setvbuf(stdout, outbuf, _IOFBF, OUT_LINE_SIZE * q);
    
    for (; q--;) {
        scanf("%d %d %d", &com, &x, &y);
        f[com](x, y);
    }

    free(a);

    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 8
	.type	a, @object
	.size	a, 8
a:
	.zero	8
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.text
	.globl	add
	.type	add, @function
add:
.LFB6:
	.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	N(%rip), %eax
	subl	$1, %eax
	addl	%eax, -4(%rbp)
	movq	a(%rip), %rdx
	movl	-4(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %ecx
	movq	a(%rip), %rdx
	movl	-4(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	-8(%rbp), %edx
	addl	%ecx, %edx
	movl	%edx, (%rax)
	jmp	.L2
.L3:
	sarl	-4(%rbp)
	movq	a(%rip), %rdx
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %ecx
	movq	a(%rip), %rdx
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	cltq
	addq	$1, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movq	a(%rip), %rsi
	movl	-4(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rsi, %rax
	addl	%ecx, %edx
	movl	%edx, (%rax)
.L2:
	cmpl	$0, -4(%rbp)
	jne	.L3
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	add, .-add
	.globl	_getSum
	.type	_getSum, @function
_getSum:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 3, -24
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movl	%ecx, -32(%rbp)
	movl	%r8d, -36(%rbp)
	movl	-24(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jl	.L5
	movl	-36(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jge	.L6
.L5:
	movl	$0, %eax
	jmp	.L7
.L6:
	movl	-20(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jg	.L8
	movl	-36(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jg	.L8
	movq	a(%rip), %rdx
	movl	-28(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	jmp	.L7
.L8:
	movl	-32(%rbp), %edx
	movl	-36(%rbp), %eax
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %ecx
	movl	-28(%rbp), %eax
	leal	(%rax,%rax), %edi
	movl	-32(%rbp), %edx
	movl	-24(%rbp), %esi
	movl	-20(%rbp), %eax
	movl	%ecx, %r8d
	movl	%edx, %ecx
	movl	%edi, %edx
	movl	%eax, %edi
	call	_getSum
	movl	%eax, %ebx
	movl	-32(%rbp), %edx
	movl	-36(%rbp), %eax
	addl	%edx, %eax
	sarl	%eax
	leal	1(%rax), %ecx
	movl	-28(%rbp), %eax
	addl	%eax, %eax
	leal	1(%rax), %edx
	movl	-36(%rbp), %edi
	movl	-24(%rbp), %esi
	movl	-20(%rbp), %eax
	movl	%edi, %r8d
	movl	%eax, %edi
	call	_getSum
	addl	%ebx, %eax
.L7:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	_getSum, .-_getSum
	.section	.rodata
.LC0:
	.string	"%d\n"
	.text
	.globl	getSum
	.type	getSum, @function
getSum:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	N(%rip), %eax
	leal	-1(%rax), %edx
	movl	-8(%rbp), %eax
	leal	-1(%rax), %esi
	movl	-4(%rbp), %eax
	subl	$1, %eax
	movl	%edx, %r8d
	movl	$0, %ecx
	movl	$1, %edx
	movl	%eax, %edi
	call	_getSum
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	getSum, .-getSum
	.section	.rodata
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d %d %d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	add(%rip), %rax
	movq	%rax, -32(%rbp)
	leaq	getSum(%rip), %rax
	movq	%rax, -24(%rbp)
	leaq	-60(%rbp), %rdx
	leaq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -44(%rbp)
	movl	$2, N(%rip)
	jmp	.L11
.L12:
	addl	$1, -44(%rbp)
	movl	-44(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	movl	%eax, N(%rip)
.L11:
	movl	-64(%rbp), %edx
	movl	N(%rip), %eax
	cmpl	%eax, %edx
	jg	.L12
	movl	N(%rip), %eax
	addl	%eax, %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, a(%rip)
	movl	-60(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -40(%rbp)
	movl	-60(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	addl	%edx, %eax
	movslq	%eax, %rdx
	movq	stdout(%rip), %rax
	movq	-40(%rbp), %rsi
	movq	%rdx, %rcx
	movl	$0, %edx
	movq	%rax, %rdi
	call	setvbuf@PLT
	jmp	.L13
.L14:
	leaq	-48(%rbp), %rcx
	leaq	-52(%rbp), %rdx
	leaq	-56(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-56(%rbp), %eax
	cltq
	movq	-32(%rbp,%rax,8), %rcx
	movl	-48(%rbp), %edx
	movl	-52(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	*%rcx
.L13:
	movl	-60(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -60(%rbp)
	testl	%eax, %eax
	jne	.L14
	movq	a(%rip), %rax
	movq	%rax, %rdi
	call	free@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.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	add
	.type	add, @function
add:
.LFB39:
	.cfi_startproc
	endbr64
	movl	N(%rip), %eax
	movl	%esi, %r8d
	movq	a(%rip), %rsi
	leal	-1(%rax,%rdi), %eax
	movslq	%eax, %rdx
	addl	%r8d, (%rsi,%rdx,4)
	testl	%eax, %eax
	je	.L1
	.p2align 4,,10
	.p2align 3
.L3:
	sarl	%eax
	leal	(%rax,%rax), %edx
	movslq	%eax, %rdi
	movslq	%edx, %rdx
	movl	(%rsi,%rdx,4), %ecx
	addl	4(%rsi,%rdx,4), %ecx
	movl	%ecx, (%rsi,%rdi,4)
	testl	%eax, %eax
	jne	.L3
.L1:
	ret
	.cfi_endproc
.LFE39:
	.size	add, .-add
	.p2align 4
	.globl	_getSum
	.type	_getSum, @function
_getSum:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$136, %rsp
	.cfi_def_cfa_offset 192
	movl	%r8d, 124(%rsp)
	cmpl	%esi, %ecx
	jg	.L55
	cmpl	%edi, %r8d
	jl	.L55
	cmpl	%r8d, %esi
	movl	%edx, %eax
	movq	a(%rip), %r10
	setge	81(%rsp)
	xorl	%r9d, %r9d
	movzbl	81(%rsp), %edx
	cmpl	%edi, %ecx
	jl	.L65
	testb	%dl, %dl
	jne	.L11
.L65:
	movl	%r9d, 48(%rsp)
	movq	%r10, %r9
.L110:
	movl	124(%rsp), %ebx
	addl	%eax, %eax
	movl	%eax, 52(%rsp)
	leal	(%rbx,%rcx), %edx
	sarl	%edx
	movl	%edx, 108(%rsp)
	cmpl	%ecx, %esi
	jl	.L14
	cmpl	%edi, %edx
	jl	.L14
	cmpl	%esi, %edx
	setle	82(%rsp)
	movzbl	82(%rsp), %eax
	cmpl	%ecx, %edi
	jg	.L66
	testb	%al, %al
	jne	.L57
.L66:
	movl	$0, 28(%rsp)
	movl	52(%rsp), %eax
.L111:
	movl	108(%rsp), %ebx
	addl	%eax, %eax
	movl	%eax, 56(%rsp)
	leal	(%rbx,%rcx), %edx
	sarl	%edx
	movl	%edx, 112(%rsp)
	cmpl	%edx, %edi
	jg	.L18
	cmpl	%ecx, %esi
	jl	.L18
	cmpl	%edx, %esi
	setge	83(%rsp)
	movzbl	83(%rsp), %eax
	cmpl	%ecx, %edi
	jg	.L67
	testb	%al, %al
	jne	.L58
.L67:
	movl	$0, 32(%rsp)
	movl	56(%rsp), %eax
	movq	%r9, %r10
.L112:
	movl	112(%rsp), %ebx
	addl	%eax, %eax
	movl	%eax, 60(%rsp)
	leal	(%rbx,%rcx), %edx
	sarl	%edx
	movl	%edx, 116(%rsp)
	cmpl	%edx, %edi
	jg	.L22
	cmpl	%ecx, %esi
	jl	.L22
	cmpl	%edx, %esi
	setge	84(%rsp)
	movzbl	84(%rsp), %eax
	cmpl	%ecx, %edi
	jg	.L68
	testb	%al, %al
	jne	.L59
.L68:
	movl	$0, 36(%rsp)
	movl	60(%rsp), %eax
	movq	%r10, %r11
.L113:
	movl	116(%rsp), %ebx
	addl	%eax, %eax
	movl	%eax, 64(%rsp)
	leal	(%rbx,%rcx), %edx
	sarl	%edx
	movl	%edx, 120(%rsp)
	cmpl	%edx, %edi
	jg	.L26
	cmpl	%ecx, %esi
	jl	.L26
	cmpl	%edx, %esi
	setge	85(%rsp)
	movzbl	85(%rsp), %eax
	cmpl	%ecx, %edi
	jg	.L69
	testb	%al, %al
	jne	.L60
.L69:
	movl	$0, 44(%rsp)
	movl	64(%rsp), %eax
	movq	%r11, %r15
.L114:
	movl	120(%rsp), %ebx
	addl	%eax, %eax
	movl	%eax, 72(%rsp)
	leal	(%rbx,%rcx), %edx
	sarl	%edx
	movl	%edx, 68(%rsp)
	cmpl	%edx, %edi
	jg	.L30
	cmpl	%ecx, %esi
	jl	.L30
	cmpl	%edx, %esi
	movl	$0, 40(%rsp)
	movl	72(%rsp), %r12d
	setge	86(%rsp)
	movzbl	86(%rsp), %eax
	cmpl	%ecx, %edi
	jg	.L70
	testb	%al, %al
	jne	.L31
.L70:
	movq	%r15, %r14
	movl	%esi, %ebx
	movl	%edi, %r15d
.L115:
	movl	68(%rsp), %eax
	leal	(%r12,%r12), %esi
	movl	%esi, 16(%rsp)
	addl	%ecx, %eax
	sarl	%eax
	movl	%eax, 24(%rsp)
	cmpl	%ecx, %ebx
	jl	.L34
	cmpl	%eax, %r15d
	jg	.L34
	cmpl	%eax, %ebx
	setge	87(%rsp)
	movzbl	87(%rsp), %eax
	cmpl	%ecx, %r15d
	jg	.L71
	testb	%al, %al
	jne	.L62
.L71:
	xorl	%r11d, %r11d
	movl	16(%rsp), %ebp
	movl	%r15d, %edi
	movq	%r14, %r10
	movl	%r11d, %r15d
.L116:
	movl	24(%rsp), %eax
	addl	%ecx, %eax
	sarl	%eax
	movl	%eax, %r11d
	leal	(%rbp,%rbp), %eax
	movl	%eax, 12(%rsp)
	cmpl	%ecx, %ebx
	jl	.L38
	cmpl	%r11d, %edi
	jg	.L38
	cmpl	%r11d, %ebx
	movl	12(%rsp), %r13d
	setge	23(%rsp)
	xorl	%ebp, %ebp
	movzbl	23(%rsp), %eax
	cmpl	%ecx, %edi
	jg	.L72
	testb	%al, %al
	jne	.L39
.L72:
	movl	%r15d, %r9d
	movl	%r11d, %r15d
.L117:
	leal	(%r15,%rcx), %r14d
	leal	(%r13,%r13), %eax
	movl	%eax, 76(%rsp)
	sarl	%r14d
	cmpl	%ecx, %ebx
	jl	.L42
	cmpl	%r14d, %edi
	jg	.L42
	cmpl	%r14d, %ebx
	movl	76(%rsp), %r12d
	setge	80(%rsp)
	xorl	%r13d, %r13d
	movzbl	80(%rsp), %eax
	cmpl	%ecx, %edi
	jg	.L73
	testb	%al, %al
	jne	.L43
.L73:
	movl	%ebp, %r11d
	movl	%ebx, %ebp
.L118:
	leal	(%r14,%rcx), %ebx
	addl	%r12d, %r12d
	movl	%ebp, %esi
	movq	%r10, 96(%rsp)
	sarl	%ebx
	movl	%r12d, %edx
	movl	%r11d, 104(%rsp)
	addl	$1, %r12d
	movl	%ebx, %r8d
	movl	%r9d, 92(%rsp)
	movl	%edi, 88(%rsp)
	call	_getSum
	leal	1(%rbx), %ecx
	movl	88(%rsp), %edi
	movl	92(%rsp), %r9d
	addl	%eax, %r13d
	cmpl	%ecx, %ebp
	movl	104(%rsp), %r11d
	movq	96(%rsp), %r10
	jl	.L147
	cmpl	%ecx, %edi
	jg	.L118
	cmpb	$0, 80(%rsp)
	je	.L118
	movl	%ebp, %ebx
	movl	%r11d, %ebp
.L43:
	movslq	%r12d, %r12
	addl	(%r10,%r12,4), %r13d
	addl	%r13d, %ebp
.L42:
	movl	76(%rsp), %r13d
	leal	1(%r14), %ecx
	addl	$1, %r13d
	cmpl	%ecx, %ebx
	jl	.L148
	cmpl	%ecx, %edi
	jg	.L117
	cmpb	$0, 23(%rsp)
	je	.L117
	movl	%r15d, %r11d
	movl	%r9d, %r15d
.L39:
	movslq	%r13d, %r13
	addl	(%r10,%r13,4), %ebp
	addl	%ebp, %r15d
.L38:
	movl	12(%rsp), %ebp
	leal	1(%r11), %ecx
	addl	$1, %ebp
	cmpl	%ecx, %ebx
	jl	.L149
.L48:
	cmpl	%ecx, %edi
	jg	.L116
	cmpb	$0, 87(%rsp)
	je	.L116
	movl	%r15d, %r11d
	movq	%r10, %r14
	movl	%edi, %r15d
.L35:
	movslq	%ebp, %rbp
	movl	(%r14,%rbp,4), %eax
	addl	%r11d, %eax
	addl	%eax, 40(%rsp)
.L34:
	movl	24(%rsp), %ecx
	movl	16(%rsp), %r12d
	addl	$1, %ecx
	addl	$1, %r12d
	cmpl	%ecx, %ebx
	jl	.L150
	cmpl	%ecx, %r15d
	jg	.L115
	cmpb	$0, 86(%rsp)
	je	.L115
	movl	%r15d, %edi
	movl	%ebx, %esi
	movq	%r14, %r15
.L31:
	movslq	%r12d, %r12
	movl	40(%rsp), %eax
	addl	(%r15,%r12,4), %eax
	addl	%eax, 44(%rsp)
.L30:
	movl	68(%rsp), %ecx
	movl	72(%rsp), %eax
	addl	$1, %ecx
	addl	$1, %eax
	cmpl	%ecx, %esi
	jl	.L151
	cmpl	%ecx, %edi
	jg	.L114
	cmpb	$0, 85(%rsp)
	je	.L114
	movq	%r15, %r11
.L27:
	cltq
	movl	44(%rsp), %edx
	addl	(%r11,%rax,4), %edx
	addl	%edx, 36(%rsp)
.L26:
	movl	120(%rsp), %ecx
	movl	64(%rsp), %eax
	addl	$1, %ecx
	addl	$1, %eax
	cmpl	%ecx, %esi
	jl	.L152
	cmpl	%ecx, %edi
	jg	.L113
	cmpb	$0, 84(%rsp)
	je	.L113
	movq	%r11, %r10
.L23:
	cltq
	movl	36(%rsp), %edx
	addl	(%r10,%rax,4), %edx
	addl	%edx, 32(%rsp)
.L22:
	movl	116(%rsp), %ecx
	movl	60(%rsp), %eax
	addl	$1, %ecx
	addl	$1, %eax
	cmpl	%ecx, %esi
	jl	.L153
	cmpl	%ecx, %edi
	jg	.L112
	cmpb	$0, 83(%rsp)
	je	.L112
	movq	%r10, %r9
.L19:
	cltq
	movl	32(%rsp), %edx
	addl	(%r9,%rax,4), %edx
	addl	%edx, 28(%rsp)
.L18:
	movl	112(%rsp), %ecx
	movl	56(%rsp), %eax
	addl	$1, %ecx
	addl	$1, %eax
	cmpl	%ecx, %esi
	jl	.L154
	cmpl	%ecx, %edi
	jg	.L111
	cmpb	$0, 82(%rsp)
	je	.L111
.L15:
	cltq
	movl	28(%rsp), %ebx
	addl	(%r9,%rax,4), %ebx
	addl	%ebx, 48(%rsp)
.L14:
	movl	108(%rsp), %ecx
	movl	52(%rsp), %eax
	addl	$1, %ecx
	addl	$1, %eax
	cmpl	%esi, %ecx
	jg	.L155
	cmpl	%edi, %ecx
	jl	.L110
	cmpb	$0, 81(%rsp)
	je	.L110
	movq	%r9, %r10
	movl	48(%rsp), %r9d
.L11:
	cltq
	addl	(%r10,%rax,4), %r9d
.L9:
	addq	$136, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movl	%r9d, %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
	.p2align 4,,10
	.p2align 3
.L148:
	.cfi_restore_state
	movl	%r15d, %r11d
	movl	%r9d, %r15d
	addl	%ebp, %r15d
	movl	12(%rsp), %ebp
	leal	1(%r11), %ecx
	addl	$1, %ebp
	cmpl	%ecx, %ebx
	jge	.L48
.L149:
	movl	%r15d, %r11d
	movq	%r10, %r14
	addl	%r11d, 40(%rsp)
	movl	%edi, %r15d
	jmp	.L34
.L150:
	movl	40(%rsp), %edx
	movl	%r15d, %edi
	addl	%edx, 44(%rsp)
	movq	%r14, %r15
	movl	%ebx, %esi
	jmp	.L30
.L62:
	movl	%esi, %ebp
	xorl	%r11d, %r11d
	jmp	.L35
	.p2align 4,,10
	.p2align 3
.L147:
	movl	%ebp, %ebx
	movl	%r11d, %ebp
	addl	%r13d, %ebp
	jmp	.L42
.L151:
	movl	44(%rsp), %ebx
	movq	%r15, %r11
	addl	%ebx, 36(%rsp)
	jmp	.L26
.L152:
	movl	36(%rsp), %edx
	movq	%r11, %r10
	addl	%edx, 32(%rsp)
	jmp	.L22
.L60:
	movl	$0, 44(%rsp)
	movl	64(%rsp), %eax
	jmp	.L27
.L59:
	movl	$0, 36(%rsp)
	movl	60(%rsp), %eax
	jmp	.L23
.L153:
	movl	32(%rsp), %ebx
	movq	%r10, %r9
	addl	%ebx, 28(%rsp)
	jmp	.L18
.L154:
	movl	28(%rsp), %edx
	addl	%edx, 48(%rsp)
	jmp	.L14
.L58:
	movl	$0, 32(%rsp)
	movl	56(%rsp), %eax
	jmp	.L19
.L155:
	movl	48(%rsp), %r9d
	jmp	.L9
.L57:
	movl	$0, 28(%rsp)
	movl	52(%rsp), %eax
	jmp	.L15
.L55:
	xorl	%r9d, %r9d
	jmp	.L9
	.cfi_endproc
.LFE40:
	.size	_getSum, .-_getSum
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
	.text
	.p2align 4
	.globl	getSum
	.type	getSum, @function
getSum:
.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
	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	$24, %rsp
	.cfi_def_cfa_offset 80
	movl	N(%rip), %eax
	cmpl	%edi, %eax
	jl	.L162
	leal	-1(%rsi), %r15d
	testl	%r15d, %r15d
	js	.L162
	cmpl	%esi, %eax
	leal	-1(%rdi), %r13d
	leal	-1(%rax), %r12d
	setle	15(%rsp)
	movzbl	15(%rsp), %eax
	testl	%r13d, %r13d
	jg	.L164
	testb	%al, %al
	jne	.L163
.L164:
	xorl	%r14d, %r14d
	movl	$1, %ebx
	xorl	%ecx, %ecx
.L169:
	leal	(%r12,%rcx), %ebp
	addl	%ebx, %ebx
	movl	%r15d, %esi
	movl	%r13d, %edi
	sarl	%ebp
	movl	%ebx, %edx
	addl	$1, %ebx
	movl	%ebp, %r8d
	call	_getSum
	leal	1(%rbp), %ecx
	addl	%eax, %r14d
	cmpl	%ecx, %r15d
	jl	.L157
	cmpl	%ecx, %r13d
	jg	.L169
	cmpb	$0, 15(%rsp)
	je	.L169
	movslq	%ebx, %rbx
	salq	$2, %rbx
.L158:
	movq	a(%rip), %rax
	addl	(%rax,%rbx), %r14d
.L157:
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movl	%r14d, %edx
	leaq	.LC0(%rip), %rsi
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	movl	$1, %edi
	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
	jmp	__printf_chk@PLT
	.p2align 4,,10
	.p2align 3
.L163:
	.cfi_restore_state
	movl	$4, %ebx
	xorl	%r14d, %r14d
	jmp	.L158
	.p2align 4,,10
	.p2align 3
.L162:
	xorl	%r14d, %r14d
	jmp	.L157
	.cfi_endproc
.LFE41:
	.size	getSum, .-getSum
	.section	.rodata.str1.1
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d %d %d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB42:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC1(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	add(%rip), %rbx
	movq	%rbx, %xmm0
	subq	$72, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	leaq	getSum(%rip), %rax
	leaq	16(%rsp), %rdx
	leaq	12(%rsp), %rsi
	movq	%rax, %xmm1
	xorl	%eax, %eax
	punpcklqdq	%xmm1, %xmm0
	movaps	%xmm0, 32(%rsp)
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	movl	$2, N(%rip)
	cmpl	$2, %eax
	jle	.L180
	movl	$1, %ecx
	movl	$1, %edx
	.p2align 4,,10
	.p2align 3
.L176:
	addl	$1, %ecx
	movl	%edx, %edi
	sall	%cl, %edi
	cmpl	%eax, %edi
	jl	.L176
	movl	%edi, N(%rip)
.L175:
	addl	%edi, %edi
	movl	$4, %esi
	movslq	%edi, %rdi
	call	calloc@PLT
	movq	%rax, a(%rip)
	movslq	16(%rsp), %rax
	leaq	(%rax,%rax,4), %rdx
	leaq	(%rax,%rdx,2), %r12
	movq	%r12, %rdi
	call	malloc@PLT
	movq	stdout(%rip), %rdi
	xorl	%edx, %edx
	movq	%r12, %rcx
	movq	%rax, %rsi
	call	setvbuf@PLT
	movl	16(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 16(%rsp)
	testl	%eax, %eax
	je	.L178
	leaq	28(%rsp), %r13
	leaq	24(%rsp), %r12
	leaq	20(%rsp), %rbp
	leaq	.LC2(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L177:
	movq	%r12, %rdx
	movq	%r13, %rcx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	20(%rsp), %rax
	movl	28(%rsp), %esi
	movl	24(%rsp), %edi
	call	*32(%rsp,%rax,8)
	movl	16(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 16(%rsp)
	testl	%eax, %eax
	jne	.L177
.L178:
	movq	a(%rip), %rdi
	call	free@PLT
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L186
	addq	$72, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L180:
	.cfi_restore_state
	movl	$2, %edi
	jmp	.L175
.L186:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE42:
	.size	main, .-main
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	a
	.align 8
	.type	a, @object
	.size	a, 8
a:
	.zero	8
	.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	add
	.type	add, @function
add:
.LFB39:
	.cfi_startproc
	endbr64
	movl	N(%rip), %eax
	movl	%esi, %r8d
	movq	a(%rip), %rsi
	leal	-1(%rax,%rdi), %eax
	movslq	%eax, %rdx
	addl	%r8d, (%rsi,%rdx,4)
	testl	%eax, %eax
	je	.L1
	.p2align 4,,10
	.p2align 3
.L3:
	sarl	%eax
	leal	(%rax,%rax), %edx
	movslq	%eax, %rdi
	movslq	%edx, %rdx
	movl	(%rsi,%rdx,4), %ecx
	addl	4(%rsi,%rdx,4), %ecx
	movl	%ecx, (%rsi,%rdi,4)
	testl	%eax, %eax
	jne	.L3
.L1:
	ret
	.cfi_endproc
.LFE39:
	.size	add, .-add
	.p2align 4
	.globl	_getSum
	.type	_getSum, @function
_getSum:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$136, %rsp
	.cfi_def_cfa_offset 192
	movl	%r8d, 124(%rsp)
	cmpl	%esi, %ecx
	jg	.L55
	cmpl	%edi, %r8d
	jl	.L55
	cmpl	%r8d, %esi
	movl	%edx, %eax
	movq	a(%rip), %r10
	setge	81(%rsp)
	xorl	%r9d, %r9d
	movzbl	81(%rsp), %edx
	cmpl	%edi, %ecx
	jl	.L65
	testb	%dl, %dl
	jne	.L11
.L65:
	movl	%r9d, 48(%rsp)
	movq	%r10, %r9
.L110:
	movl	124(%rsp), %ebx
	addl	%eax, %eax
	movl	%eax, 52(%rsp)
	leal	(%rbx,%rcx), %edx
	sarl	%edx
	movl	%edx, 108(%rsp)
	cmpl	%ecx, %esi
	jl	.L14
	cmpl	%edi, %edx
	jl	.L14
	cmpl	%esi, %edx
	setle	82(%rsp)
	movzbl	82(%rsp), %eax
	cmpl	%ecx, %edi
	jg	.L66
	testb	%al, %al
	jne	.L57
.L66:
	movl	$0, 28(%rsp)
	movl	52(%rsp), %eax
.L111:
	movl	108(%rsp), %ebx
	addl	%eax, %eax
	movl	%eax, 56(%rsp)
	leal	(%rbx,%rcx), %edx
	sarl	%edx
	movl	%edx, 112(%rsp)
	cmpl	%edx, %edi
	jg	.L18
	cmpl	%ecx, %esi
	jl	.L18
	cmpl	%edx, %esi
	setge	83(%rsp)
	movzbl	83(%rsp), %eax
	cmpl	%ecx, %edi
	jg	.L67
	testb	%al, %al
	jne	.L58
.L67:
	movl	$0, 32(%rsp)
	movl	56(%rsp), %eax
	movq	%r9, %r10
.L112:
	movl	112(%rsp), %ebx
	addl	%eax, %eax
	movl	%eax, 60(%rsp)
	leal	(%rbx,%rcx), %edx
	sarl	%edx
	movl	%edx, 116(%rsp)
	cmpl	%edx, %edi
	jg	.L22
	cmpl	%ecx, %esi
	jl	.L22
	cmpl	%edx, %esi
	setge	84(%rsp)
	movzbl	84(%rsp), %eax
	cmpl	%ecx, %edi
	jg	.L68
	testb	%al, %al
	jne	.L59
.L68:
	movl	$0, 36(%rsp)
	movl	60(%rsp), %eax
	movq	%r10, %r11
.L113:
	movl	116(%rsp), %ebx
	addl	%eax, %eax
	movl	%eax, 64(%rsp)
	leal	(%rbx,%rcx), %edx
	sarl	%edx
	movl	%edx, 120(%rsp)
	cmpl	%edx, %edi
	jg	.L26
	cmpl	%ecx, %esi
	jl	.L26
	cmpl	%edx, %esi
	setge	85(%rsp)
	movzbl	85(%rsp), %eax
	cmpl	%ecx, %edi
	jg	.L69
	testb	%al, %al
	jne	.L60
.L69:
	movl	$0, 44(%rsp)
	movl	64(%rsp), %eax
	movq	%r11, %r15
.L114:
	movl	120(%rsp), %ebx
	addl	%eax, %eax
	movl	%eax, 72(%rsp)
	leal	(%rbx,%rcx), %edx
	sarl	%edx
	movl	%edx, 68(%rsp)
	cmpl	%edx, %edi
	jg	.L30
	cmpl	%ecx, %esi
	jl	.L30
	cmpl	%edx, %esi
	movl	$0, 40(%rsp)
	movl	72(%rsp), %r12d
	setge	86(%rsp)
	movzbl	86(%rsp), %eax
	cmpl	%ecx, %edi
	jg	.L70
	testb	%al, %al
	jne	.L31
.L70:
	movq	%r15, %r14
	movl	%esi, %ebx
	movl	%edi, %r15d
.L115:
	movl	68(%rsp), %eax
	leal	(%r12,%r12), %esi
	movl	%esi, 16(%rsp)
	addl	%ecx, %eax
	sarl	%eax
	movl	%eax, 24(%rsp)
	cmpl	%ecx, %ebx
	jl	.L34
	cmpl	%eax, %r15d
	jg	.L34
	cmpl	%eax, %ebx
	setge	87(%rsp)
	movzbl	87(%rsp), %eax
	cmpl	%ecx, %r15d
	jg	.L71
	testb	%al, %al
	jne	.L62
.L71:
	xorl	%r11d, %r11d
	movl	16(%rsp), %ebp
	movl	%r15d, %edi
	movq	%r14, %r10
	movl	%r11d, %r15d
.L116:
	movl	24(%rsp), %eax
	addl	%ecx, %eax
	sarl	%eax
	movl	%eax, %r11d
	leal	(%rbp,%rbp), %eax
	movl	%eax, 12(%rsp)
	cmpl	%ecx, %ebx
	jl	.L38
	cmpl	%r11d, %edi
	jg	.L38
	cmpl	%r11d, %ebx
	movl	12(%rsp), %r13d
	setge	23(%rsp)
	xorl	%ebp, %ebp
	movzbl	23(%rsp), %eax
	cmpl	%ecx, %edi
	jg	.L72
	testb	%al, %al
	jne	.L39
.L72:
	movl	%r15d, %r9d
	movl	%r11d, %r15d
.L117:
	leal	(%r15,%rcx), %r14d
	leal	(%r13,%r13), %eax
	movl	%eax, 76(%rsp)
	sarl	%r14d
	cmpl	%ecx, %ebx
	jl	.L42
	cmpl	%r14d, %edi
	jg	.L42
	cmpl	%r14d, %ebx
	movl	76(%rsp), %r12d
	setge	80(%rsp)
	xorl	%r13d, %r13d
	movzbl	80(%rsp), %eax
	cmpl	%ecx, %edi
	jg	.L73
	testb	%al, %al
	jne	.L43
.L73:
	movl	%ebp, %r11d
	movl	%ebx, %ebp
.L118:
	leal	(%r14,%rcx), %ebx
	addl	%r12d, %r12d
	movl	%ebp, %esi
	movq	%r10, 96(%rsp)
	sarl	%ebx
	movl	%r12d, %edx
	movl	%r11d, 104(%rsp)
	addl	$1, %r12d
	movl	%ebx, %r8d
	movl	%r9d, 92(%rsp)
	movl	%edi, 88(%rsp)
	call	_getSum
	leal	1(%rbx), %ecx
	movl	88(%rsp), %edi
	movl	92(%rsp), %r9d
	addl	%eax, %r13d
	cmpl	%ecx, %ebp
	movl	104(%rsp), %r11d
	movq	96(%rsp), %r10
	jl	.L147
	cmpl	%ecx, %edi
	jg	.L118
	cmpb	$0, 80(%rsp)
	je	.L118
	movl	%ebp, %ebx
	movl	%r11d, %ebp
.L43:
	movslq	%r12d, %r12
	addl	(%r10,%r12,4), %r13d
	addl	%r13d, %ebp
.L42:
	movl	76(%rsp), %r13d
	leal	1(%r14), %ecx
	addl	$1, %r13d
	cmpl	%ecx, %ebx
	jl	.L148
	cmpl	%ecx, %edi
	jg	.L117
	cmpb	$0, 23(%rsp)
	je	.L117
	movl	%r15d, %r11d
	movl	%r9d, %r15d
.L39:
	movslq	%r13d, %r13
	addl	(%r10,%r13,4), %ebp
	addl	%ebp, %r15d
.L38:
	movl	12(%rsp), %ebp
	leal	1(%r11), %ecx
	addl	$1, %ebp
	cmpl	%ecx, %ebx
	jl	.L149
.L48:
	cmpl	%ecx, %edi
	jg	.L116
	cmpb	$0, 87(%rsp)
	je	.L116
	movl	%r15d, %r11d
	movq	%r10, %r14
	movl	%edi, %r15d
.L35:
	movslq	%ebp, %rbp
	movl	(%r14,%rbp,4), %eax
	addl	%r11d, %eax
	addl	%eax, 40(%rsp)
.L34:
	movl	24(%rsp), %ecx
	movl	16(%rsp), %r12d
	addl	$1, %ecx
	addl	$1, %r12d
	cmpl	%ecx, %ebx
	jl	.L150
	cmpl	%ecx, %r15d
	jg	.L115
	cmpb	$0, 86(%rsp)
	je	.L115
	movl	%r15d, %edi
	movl	%ebx, %esi
	movq	%r14, %r15
.L31:
	movslq	%r12d, %r12
	movl	40(%rsp), %eax
	addl	(%r15,%r12,4), %eax
	addl	%eax, 44(%rsp)
.L30:
	movl	68(%rsp), %ecx
	movl	72(%rsp), %eax
	addl	$1, %ecx
	addl	$1, %eax
	cmpl	%ecx, %esi
	jl	.L151
	cmpl	%ecx, %edi
	jg	.L114
	cmpb	$0, 85(%rsp)
	je	.L114
	movq	%r15, %r11
.L27:
	cltq
	movl	44(%rsp), %edx
	addl	(%r11,%rax,4), %edx
	addl	%edx, 36(%rsp)
.L26:
	movl	120(%rsp), %ecx
	movl	64(%rsp), %eax
	addl	$1, %ecx
	addl	$1, %eax
	cmpl	%ecx, %esi
	jl	.L152
	cmpl	%ecx, %edi
	jg	.L113
	cmpb	$0, 84(%rsp)
	je	.L113
	movq	%r11, %r10
.L23:
	cltq
	movl	36(%rsp), %edx
	addl	(%r10,%rax,4), %edx
	addl	%edx, 32(%rsp)
.L22:
	movl	116(%rsp), %ecx
	movl	60(%rsp), %eax
	addl	$1, %ecx
	addl	$1, %eax
	cmpl	%ecx, %esi
	jl	.L153
	cmpl	%ecx, %edi
	jg	.L112
	cmpb	$0, 83(%rsp)
	je	.L112
	movq	%r10, %r9
.L19:
	cltq
	movl	32(%rsp), %edx
	addl	(%r9,%rax,4), %edx
	addl	%edx, 28(%rsp)
.L18:
	movl	112(%rsp), %ecx
	movl	56(%rsp), %eax
	addl	$1, %ecx
	addl	$1, %eax
	cmpl	%ecx, %esi
	jl	.L154
	cmpl	%ecx, %edi
	jg	.L111
	cmpb	$0, 82(%rsp)
	je	.L111
.L15:
	cltq
	movl	28(%rsp), %ebx
	addl	(%r9,%rax,4), %ebx
	addl	%ebx, 48(%rsp)
.L14:
	movl	108(%rsp), %ecx
	movl	52(%rsp), %eax
	addl	$1, %ecx
	addl	$1, %eax
	cmpl	%esi, %ecx
	jg	.L155
	cmpl	%edi, %ecx
	jl	.L110
	cmpb	$0, 81(%rsp)
	je	.L110
	movq	%r9, %r10
	movl	48(%rsp), %r9d
.L11:
	cltq
	addl	(%r10,%rax,4), %r9d
.L9:
	addq	$136, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movl	%r9d, %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
	.p2align 4,,10
	.p2align 3
.L148:
	.cfi_restore_state
	movl	%r15d, %r11d
	movl	%r9d, %r15d
	addl	%ebp, %r15d
	movl	12(%rsp), %ebp
	leal	1(%r11), %ecx
	addl	$1, %ebp
	cmpl	%ecx, %ebx
	jge	.L48
.L149:
	movl	%r15d, %r11d
	movq	%r10, %r14
	addl	%r11d, 40(%rsp)
	movl	%edi, %r15d
	jmp	.L34
.L150:
	movl	40(%rsp), %edx
	movl	%r15d, %edi
	addl	%edx, 44(%rsp)
	movq	%r14, %r15
	movl	%ebx, %esi
	jmp	.L30
.L62:
	movl	%esi, %ebp
	xorl	%r11d, %r11d
	jmp	.L35
	.p2align 4,,10
	.p2align 3
.L147:
	movl	%ebp, %ebx
	movl	%r11d, %ebp
	addl	%r13d, %ebp
	jmp	.L42
.L151:
	movl	44(%rsp), %ebx
	movq	%r15, %r11
	addl	%ebx, 36(%rsp)
	jmp	.L26
.L152:
	movl	36(%rsp), %edx
	movq	%r11, %r10
	addl	%edx, 32(%rsp)
	jmp	.L22
.L60:
	movl	$0, 44(%rsp)
	movl	64(%rsp), %eax
	jmp	.L27
.L59:
	movl	$0, 36(%rsp)
	movl	60(%rsp), %eax
	jmp	.L23
.L153:
	movl	32(%rsp), %ebx
	movq	%r10, %r9
	addl	%ebx, 28(%rsp)
	jmp	.L18
.L154:
	movl	28(%rsp), %edx
	addl	%edx, 48(%rsp)
	jmp	.L14
.L58:
	movl	$0, 32(%rsp)
	movl	56(%rsp), %eax
	jmp	.L19
.L155:
	movl	48(%rsp), %r9d
	jmp	.L9
.L57:
	movl	$0, 28(%rsp)
	movl	52(%rsp), %eax
	jmp	.L15
.L55:
	xorl	%r9d, %r9d
	jmp	.L9
	.cfi_endproc
.LFE40:
	.size	_getSum, .-_getSum
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
	.text
	.p2align 4
	.globl	getSum
	.type	getSum, @function
getSum:
.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
	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	$24, %rsp
	.cfi_def_cfa_offset 80
	movl	N(%rip), %eax
	cmpl	%edi, %eax
	jl	.L162
	leal	-1(%rsi), %r15d
	testl	%r15d, %r15d
	js	.L162
	cmpl	%esi, %eax
	leal	-1(%rdi), %r13d
	leal	-1(%rax), %r12d
	setle	15(%rsp)
	movzbl	15(%rsp), %eax
	testl	%r13d, %r13d
	jg	.L164
	testb	%al, %al
	jne	.L163
.L164:
	xorl	%r14d, %r14d
	movl	$1, %ebx
	xorl	%ecx, %ecx
.L169:
	leal	(%r12,%rcx), %ebp
	addl	%ebx, %ebx
	movl	%r15d, %esi
	movl	%r13d, %edi
	sarl	%ebp
	movl	%ebx, %edx
	addl	$1, %ebx
	movl	%ebp, %r8d
	call	_getSum
	leal	1(%rbp), %ecx
	addl	%eax, %r14d
	cmpl	%ecx, %r15d
	jl	.L157
	cmpl	%ecx, %r13d
	jg	.L169
	cmpb	$0, 15(%rsp)
	je	.L169
	movslq	%ebx, %rbx
	salq	$2, %rbx
.L158:
	movq	a(%rip), %rax
	addl	(%rax,%rbx), %r14d
.L157:
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movl	%r14d, %edx
	leaq	.LC0(%rip), %rsi
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	movl	$1, %edi
	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
	jmp	__printf_chk@PLT
	.p2align 4,,10
	.p2align 3
.L163:
	.cfi_restore_state
	movl	$4, %ebx
	xorl	%r14d, %r14d
	jmp	.L158
	.p2align 4,,10
	.p2align 3
.L162:
	xorl	%r14d, %r14d
	jmp	.L157
	.cfi_endproc
.LFE41:
	.size	getSum, .-getSum
	.section	.rodata.str1.1
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d %d %d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB42:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC1(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	add(%rip), %rbx
	movq	%rbx, %xmm0
	subq	$72, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	leaq	getSum(%rip), %rax
	leaq	16(%rsp), %rdx
	leaq	12(%rsp), %rsi
	movq	%rax, %xmm1
	xorl	%eax, %eax
	punpcklqdq	%xmm1, %xmm0
	movaps	%xmm0, 32(%rsp)
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	movl	$2, N(%rip)
	cmpl	$2, %eax
	jle	.L180
	movl	$1, %ecx
	movl	$1, %edx
	.p2align 4,,10
	.p2align 3
.L176:
	addl	$1, %ecx
	movl	%edx, %edi
	sall	%cl, %edi
	cmpl	%eax, %edi
	jl	.L176
	movl	%edi, N(%rip)
.L175:
	addl	%edi, %edi
	movl	$4, %esi
	movslq	%edi, %rdi
	call	calloc@PLT
	movq	%rax, a(%rip)
	movslq	16(%rsp), %rax
	leaq	(%rax,%rax,4), %rdx
	leaq	(%rax,%rdx,2), %r12
	movq	%r12, %rdi
	call	malloc@PLT
	movq	stdout(%rip), %rdi
	xorl	%edx, %edx
	movq	%r12, %rcx
	movq	%rax, %rsi
	call	setvbuf@PLT
	movl	16(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 16(%rsp)
	testl	%eax, %eax
	je	.L178
	leaq	28(%rsp), %r13
	leaq	24(%rsp), %r12
	leaq	20(%rsp), %rbp
	leaq	.LC2(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L177:
	movq	%r12, %rdx
	movq	%r13, %rcx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	20(%rsp), %rax
	movl	28(%rsp), %esi
	movl	24(%rsp), %edi
	call	*32(%rsp,%rax,8)
	movl	16(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 16(%rsp)
	testl	%eax, %eax
	jne	.L177
.L178:
	movq	a(%rip), %rdi
	call	free@PLT
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L186
	addq	$72, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L180:
	.cfi_restore_state
	movl	$2, %edi
	jmp	.L175
.L186:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE42:
	.size	main, .-main
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	a
	.align 8
	.type	a, @object
	.size	a, 8
a:
	.zero	8
	.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:

/*
Cache sum with binary tree
 */

#include <stdio.h>
#include <stdlib.h>

#define OUT_LINE_SIZE 11

int *a;
int N;

void add(int i, int x) {
    i += N - 1;
    a[i] += x;
    while (i) {
        i = i >> 1;
        a[i] = a[i*2] + a[i*2+1];
    }
}

int _getSum(int m, int n, int i, int l, int r) {
    if (n < l || r < m)
        return 0;
    if (m <= l && r <= n)
        return a[i];
    return _getSum(m, n, i*2, l, (l+r)>>1) +
           _getSum(m, n, i*2+1, ((l+r)>>1)+1, r);
}

void getSum(int s, int t) {
    printf("%d\n", _getSum(s-1, t-1, 1, 0, N-1));
}



int main() {
    int n, q, com, x, y, i;
    void (*f[2])(int, int);
    char *outbuf;

    f[0] = add;
    f[1] = getSum;

    scanf("%d %d", &n, &q);
    for (i = 1, N = 1<<1; n > N; ++i, N = 1<<i);

    a = (int*)calloc(N * 2, sizeof(int));

    outbuf = (char*)malloc(sizeof(char) * OUT_LINE_SIZE * q);
    setvbuf(stdout, outbuf, _IOFBF, OUT_LINE_SIZE * q);
    
    for (; q--;) {
        scanf("%d %d %d", &com, &x, &y);
        f[com](x, y);
    }

    free(a);

    return 0;
}
4 5
0 1 1
0 2 2
0 3 3
1 1 2
1 2 2
 4 5
0 1 1
0 2 2
0 1 5
1 1 2
1 2 2
 4 5
0 1 0
0 2 2
0 1 5
1 1 2
1 2 2
 4 5
0 1 1
0 2 4
0 3 3
1 1 2
1 2 2
 4 5
0 1 1
0 4 4
0 3 3
1 1 2
1 2 2
 4 5
0 1 1
0 2 2
0 3 9
1 1 2
0 2 2
 4 5
0 1 0
0 2 2
0 1 5
1 1 0
1 2 3
 4 5
0 1 1
0 4 4
0 3 3
1 1 2
1 2 3
 4 5
0 1 0
0 2 2
0 3 9
1 1 2
0 2 2
 4 5
0 1 1
1 4 4
0 3 3
1 1 2
1 2 3

3
2
 8
2
 7
2
 5
4
 1
0
 3
 0
2
 1
3
 2
 0
1
3

Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
/*
Cache sum with binary tree
 */

#include <stdio.h>
#include <stdlib.h>

#define OUT_LINE_SIZE 11

int *a;
int N;

void add(int i, int x) {
    i += N - 1;
    a[i] += x;
    while (i) {
        i = i >> 1;
        a[i] = a[i*2] + a[i*2+1];
    }
}

int _getSum(int m, int n, int i, int l, int r) {
    if (n < l || r < m)
        return 0;
    if (m <= l && r <= n)
        return a[i];
    return _getSum(m, n, i*2, l, (l+r)>>1) +
           _getSum(m, n, i*2+1, ((l+r)>>1)+1, r);
}

void getSum(int s, int t) {
    printf("%d\n", _getSum(s-1, t-1, 1, 0, N-1));
}



int main() {
    int n, q, com, x, y, i;
    void (*f[2])(int, int);
    char *outbuf;

    f[0] = add;
    f[1] = getSum;

    scanf("%d %d", &n, &q);
    for (i = 1, N = 1<<1; n > N; ++i, N = 1<<i);

    a = (int*)calloc(N * 2, sizeof(int));

    outbuf = (char*)malloc(sizeof(char) * OUT_LINE_SIZE * q);
    setvbuf(stdout, outbuf, _IOFBF, OUT_LINE_SIZE * q);
    
    for (; q--;) {
        scanf("%d %d %d", &com, &x, &y);
        f[com](x, y);
    }

    free(a);

    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 8
	.type	a, @object
	.size	a, 8
a:
	.zero	8
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.text
	.globl	add
	.type	add, @function
add:
.LFB6:
	.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	N(%rip), %eax
	subl	$1, %eax
	addl	%eax, -4(%rbp)
	movq	a(%rip), %rdx
	movl	-4(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %ecx
	movq	a(%rip), %rdx
	movl	-4(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	-8(%rbp), %edx
	addl	%ecx, %edx
	movl	%edx, (%rax)
	jmp	.L2
.L3:
	sarl	-4(%rbp)
	movq	a(%rip), %rdx
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %ecx
	movq	a(%rip), %rdx
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	cltq
	addq	$1, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movq	a(%rip), %rsi
	movl	-4(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rsi, %rax
	addl	%ecx, %edx
	movl	%edx, (%rax)
.L2:
	cmpl	$0, -4(%rbp)
	jne	.L3
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	add, .-add
	.globl	_getSum
	.type	_getSum, @function
_getSum:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 3, -24
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movl	%ecx, -32(%rbp)
	movl	%r8d, -36(%rbp)
	movl	-24(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jl	.L5
	movl	-36(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jge	.L6
.L5:
	movl	$0, %eax
	jmp	.L7
.L6:
	movl	-20(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jg	.L8
	movl	-36(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jg	.L8
	movq	a(%rip), %rdx
	movl	-28(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	jmp	.L7
.L8:
	movl	-32(%rbp), %edx
	movl	-36(%rbp), %eax
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %ecx
	movl	-28(%rbp), %eax
	leal	(%rax,%rax), %edi
	movl	-32(%rbp), %edx
	movl	-24(%rbp), %esi
	movl	-20(%rbp), %eax
	movl	%ecx, %r8d
	movl	%edx, %ecx
	movl	%edi, %edx
	movl	%eax, %edi
	call	_getSum
	movl	%eax, %ebx
	movl	-32(%rbp), %edx
	movl	-36(%rbp), %eax
	addl	%edx, %eax
	sarl	%eax
	leal	1(%rax), %ecx
	movl	-28(%rbp), %eax
	addl	%eax, %eax
	leal	1(%rax), %edx
	movl	-36(%rbp), %edi
	movl	-24(%rbp), %esi
	movl	-20(%rbp), %eax
	movl	%edi, %r8d
	movl	%eax, %edi
	call	_getSum
	addl	%ebx, %eax
.L7:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	_getSum, .-_getSum
	.section	.rodata
.LC0:
	.string	"%d\n"
	.text
	.globl	getSum
	.type	getSum, @function
getSum:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	N(%rip), %eax
	leal	-1(%rax), %edx
	movl	-8(%rbp), %eax
	leal	-1(%rax), %esi
	movl	-4(%rbp), %eax
	subl	$1, %eax
	movl	%edx, %r8d
	movl	$0, %ecx
	movl	$1, %edx
	movl	%eax, %edi
	call	_getSum
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	getSum, .-getSum
	.section	.rodata
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d %d %d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	add(%rip), %rax
	movq	%rax, -32(%rbp)
	leaq	getSum(%rip), %rax
	movq	%rax, -24(%rbp)
	leaq	-60(%rbp), %rdx
	leaq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -44(%rbp)
	movl	$2, N(%rip)
	jmp	.L11
.L12:
	addl	$1, -44(%rbp)
	movl	-44(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	movl	%eax, N(%rip)
.L11:
	movl	-64(%rbp), %edx
	movl	N(%rip), %eax
	cmpl	%eax, %edx
	jg	.L12
	movl	N(%rip), %eax
	addl	%eax, %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, a(%rip)
	movl	-60(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -40(%rbp)
	movl	-60(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	addl	%edx, %eax
	movslq	%eax, %rdx
	movq	stdout(%rip), %rax
	movq	-40(%rbp), %rsi
	movq	%rdx, %rcx
	movl	$0, %edx
	movq	%rax, %rdi
	call	setvbuf@PLT
	jmp	.L13
.L14:
	leaq	-48(%rbp), %rcx
	leaq	-52(%rbp), %rdx
	leaq	-56(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-56(%rbp), %eax
	cltq
	movq	-32(%rbp,%rax,8), %rcx
	movl	-48(%rbp), %edx
	movl	-52(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	*%rcx
.L13:
	movl	-60(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -60(%rbp)
	testl	%eax, %eax
	jne	.L14
	movq	a(%rip), %rax
	movq	%rax, %rdi
	call	free@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.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	a
	.bss
	.align 8
	.type	a, @object
	.size	a, 8
a:
	.zero	8
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.text
	.globl	add
	.type	add, @function
add:
.LFB6:
	.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	N(%rip), %eax
	subl	$1, %eax
	addl	%eax, -4(%rbp)
	movq	a(%rip), %rdx
	movl	-4(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %ecx
	movq	a(%rip), %rdx
	movl	-4(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	-8(%rbp), %edx
	addl	%ecx, %edx
	movl	%edx, (%rax)
	jmp	.L2
.L3:
	sarl	-4(%rbp)
	movq	a(%rip), %rdx
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %ecx
	movq	a(%rip), %rdx
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	cltq
	addq	$1, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movq	a(%rip), %rsi
	movl	-4(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rsi, %rax
	addl	%ecx, %edx
	movl	%edx, (%rax)
.L2:
	cmpl	$0, -4(%rbp)
	jne	.L3
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	add, .-add
	.globl	_getSum
	.type	_getSum, @function
_getSum:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 3, -24
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movl	%ecx, -32(%rbp)
	movl	%r8d, -36(%rbp)
	movl	-24(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jl	.L5
	movl	-36(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jge	.L6
.L5:
	movl	$0, %eax
	jmp	.L7
.L6:
	movl	-20(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jg	.L8
	movl	-36(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jg	.L8
	movq	a(%rip), %rdx
	movl	-28(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	jmp	.L7
.L8:
	movl	-32(%rbp), %edx
	movl	-36(%rbp), %eax
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %ecx
	movl	-28(%rbp), %eax
	leal	(%rax,%rax), %edi
	movl	-32(%rbp), %edx
	movl	-24(%rbp), %esi
	movl	-20(%rbp), %eax
	movl	%ecx, %r8d
	movl	%edx, %ecx
	movl	%edi, %edx
	movl	%eax, %edi
	call	_getSum
	movl	%eax, %ebx
	movl	-32(%rbp), %edx
	movl	-36(%rbp), %eax
	addl	%edx, %eax
	sarl	%eax
	leal	1(%rax), %ecx
	movl	-28(%rbp), %eax
	addl	%eax, %eax
	leal	1(%rax), %edx
	movl	-36(%rbp), %edi
	movl	-24(%rbp), %esi
	movl	-20(%rbp), %eax
	movl	%edi, %r8d
	movl	%eax, %edi
	call	_getSum
	addl	%ebx, %eax
.L7:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	_getSum, .-_getSum
	.section	.rodata
.LC0:
	.string	"%d\n"
	.text
	.globl	getSum
	.type	getSum, @function
getSum:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	N(%rip), %eax
	leal	-1(%rax), %edx
	movl	-8(%rbp), %eax
	leal	-1(%rax), %esi
	movl	-4(%rbp), %eax
	subl	$1, %eax
	movl	%edx, %r8d
	movl	$0, %ecx
	movl	$1, %edx
	movl	%eax, %edi
	call	_getSum
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	getSum, .-getSum
	.section	.rodata
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d %d %d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	add(%rip), %rax
	movq	%rax, -32(%rbp)
	leaq	getSum(%rip), %rax
	movq	%rax, -24(%rbp)
	leaq	-60(%rbp), %rdx
	leaq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -44(%rbp)
	movl	$2, N(%rip)
	jmp	.L11
.L12:
	addl	$1, -44(%rbp)
	movl	-44(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	movl	%eax, N(%rip)
.L11:
	movl	-64(%rbp), %edx
	movl	N(%rip), %eax
	cmpl	%eax, %edx
	jg	.L12
	movl	N(%rip), %eax
	addl	%eax, %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, a(%rip)
	movl	-60(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -40(%rbp)
	movl	-60(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	addl	%edx, %eax
	movslq	%eax, %rdx
	movq	stdout(%rip), %rax
	movq	-40(%rbp), %rsi
	movq	%rdx, %rcx
	movl	$0, %edx
	movq	%rax, %rdi
	call	setvbuf@PLT
	jmp	.L13
.L14:
	leaq	-48(%rbp), %rcx
	leaq	-52(%rbp), %rdx
	leaq	-56(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-56(%rbp), %eax
	cltq
	movq	-32(%rbp,%rax,8), %rcx
	movl	-48(%rbp), %edx
	movl	-52(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	*%rcx
.L13:
	movl	-60(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -60(%rbp)
	testl	%eax, %eax
	jne	.L14
	movq	a(%rip), %rax
	movq	%rax, %rdi
	call	free@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.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:
