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>

#define MAX_N 100000
int tmpa[MAX_N],tmpb[MAX_N];

void func(int Len,long long *heada){
    int cent = Len/2;
    int tip  = Len%2;
    if(Len > 2){
        func(cent, heada);
        func(cent+tip, heada+cent);
    }
    int i,j,k;
    i = k = 0;
    j = cent;
    if(Len == 1){
        tmpa[k] = heada[0];
        k++;
    }else{
        while(i < cent && j < Len){
            if(heada[i] > heada[j]){
                tmpa[k] = heada[i];
                k++;
                i++;
            }else{
                tmpa[k] = heada[j];
                k++;
                j++;
            }
        }

        while(i < cent){
            tmpa[k] = heada[i];
            k++;
            i++;
        }

        while(j < Len){
            tmpa[k] = heada[j];
            k++;
            j++;
        }
    }
    int l;
    for(l = 0;l < k;l++){
        heada[l] = tmpa[l];
    }
    return;
}

int main(void){
    int N;
    int A[MAX_N],B[MAX_N];
    long long int AB[MAX_N];
    scanf(" %d",&N);
    int i;
    for(i = 0;i < N;i++){
        scanf(" %d %d",&A[i],&B[i]);
        AB[i] = A[i] + B[i];
    }
    func(N,AB);
    long long int bsum = 0;
    for(i = 0;i < N;i++){
        bsum += B[i];
    }
    long long int ans = 0;
    for(i = 0;i < N;i+=2){
            ans += AB[i];
    }
    ans = ans - bsum;
    printf("%lld\n",ans);
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	tmpa
	.bss
	.align 32
	.type	tmpa, @object
	.size	tmpa, 400000
tmpa:
	.zero	400000
	.globl	tmpb
	.align 32
	.type	tmpb, @object
	.size	tmpb, 400000
tmpb:
	.zero	400000
	.text
	.globl	func
	.type	func, @function
func:
.LFB0:
	.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
	movl	%edi, -36(%rbp)
	movq	%rsi, -48(%rbp)
	movl	-36(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -8(%rbp)
	movl	-36(%rbp), %eax
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	movl	%eax, -4(%rbp)
	cmpl	$2, -36(%rbp)
	jle	.L2
	movq	-48(%rbp), %rdx
	movl	-8(%rbp), %eax
	movq	%rdx, %rsi
	movl	%eax, %edi
	call	func
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	addq	%rax, %rdx
	movl	-8(%rbp), %ecx
	movl	-4(%rbp), %eax
	addl	%ecx, %eax
	movq	%rdx, %rsi
	movl	%eax, %edi
	call	func
.L2:
	movl	$0, -16(%rbp)
	movl	-16(%rbp), %eax
	movl	%eax, -24(%rbp)
	movl	-8(%rbp), %eax
	movl	%eax, -20(%rbp)
	cmpl	$1, -36(%rbp)
	jne	.L5
	movq	-48(%rbp), %rax
	movq	(%rax), %rax
	movl	%eax, %ecx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	tmpa(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -16(%rbp)
	jmp	.L4
.L8:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	movq	-48(%rbp), %rax
	addq	%rcx, %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jle	.L6
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movl	%eax, %ecx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	tmpa(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -16(%rbp)
	addl	$1, -24(%rbp)
	jmp	.L5
.L6:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movl	%eax, %ecx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	tmpa(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -16(%rbp)
	addl	$1, -20(%rbp)
.L5:
	movl	-24(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L9
	movl	-20(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jl	.L8
	jmp	.L9
.L10:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movl	%eax, %ecx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	tmpa(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -16(%rbp)
	addl	$1, -24(%rbp)
.L9:
	movl	-24(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jl	.L10
	jmp	.L11
.L12:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movl	%eax, %ecx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	tmpa(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -16(%rbp)
	addl	$1, -20(%rbp)
.L11:
	movl	-20(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jl	.L12
.L4:
	movl	$0, -12(%rbp)
	jmp	.L13
.L14:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	tmpa(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-48(%rbp), %rdx
	addq	%rcx, %rdx
	cltq
	movq	%rax, (%rdx)
	addl	$1, -12(%rbp)
.L13:
	movl	-12(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jl	.L14
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	func, .-func
	.section	.rodata
.LC0:
	.string	" %d"
.LC1:
	.string	" %d %d"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-1597440(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2608, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-1600040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -1600036(%rbp)
	jmp	.L17
.L18:
	leaq	-1200016(%rbp), %rdx
	movl	-1600036(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-1600016(%rbp), %rcx
	movl	-1600036(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-1600036(%rbp), %eax
	cltq
	movl	-1600016(%rbp,%rax,4), %edx
	movl	-1600036(%rbp), %eax
	cltq
	movl	-1200016(%rbp,%rax,4), %eax
	addl	%edx, %eax
	movslq	%eax, %rdx
	movl	-1600036(%rbp), %eax
	cltq
	movq	%rdx, -800016(%rbp,%rax,8)
	addl	$1, -1600036(%rbp)
.L17:
	movl	-1600040(%rbp), %eax
	cmpl	%eax, -1600036(%rbp)
	jl	.L18
	movl	-1600040(%rbp), %eax
	leaq	-800016(%rbp), %rdx
	movq	%rdx, %rsi
	movl	%eax, %edi
	call	func
	movq	$0, -1600032(%rbp)
	movl	$0, -1600036(%rbp)
	jmp	.L19
.L20:
	movl	-1600036(%rbp), %eax
	cltq
	movl	-1200016(%rbp,%rax,4), %eax
	cltq
	addq	%rax, -1600032(%rbp)
	addl	$1, -1600036(%rbp)
.L19:
	movl	-1600040(%rbp), %eax
	cmpl	%eax, -1600036(%rbp)
	jl	.L20
	movq	$0, -1600024(%rbp)
	movl	$0, -1600036(%rbp)
	jmp	.L21
.L22:
	movl	-1600036(%rbp), %eax
	cltq
	movq	-800016(%rbp,%rax,8), %rax
	addq	%rax, -1600024(%rbp)
	addl	$2, -1600036(%rbp)
.L21:
	movl	-1600040(%rbp), %eax
	cmpl	%eax, -1600036(%rbp)
	jl	.L22
	movq	-1600032(%rbp), %rax
	subq	%rax, -1600024(%rbp)
	movq	-1600024(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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	func
	.type	func, @function
func:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movl	%edi, %r12d
	shrl	$31, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movl	%edi, %ebp
	addl	%edi, %r12d
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	%rsi, %rbx
	sarl	%r12d
	cmpl	$2, %edi
	jg	.L50
	cmpl	$1, %edi
	jne	.L5
	movq	(%rsi), %rax
	movl	%eax, tmpa(%rip)
	cltq
	movq	%rax, (%rsi)
.L1:
	popq	%rbx
	.cfi_remember_state
	.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
.L50:
	.cfi_restore_state
	movl	%r12d, %edi
	call	func
	movl	%ebp, %edi
	movslq	%r12d, %rax
	andl	$1, %edi
	leaq	(%rbx,%rax,8), %rsi
	addl	%r12d, %edi
	call	func
.L5:
	testl	%r12d, %r12d
	movl	$1, %eax
	cmovg	%r12d, %eax
	cmpl	%eax, %ebp
	jle	.L51
	movl	%r12d, %ecx
	movl	$1, %eax
	xorl	%edx, %edx
	xorl	%r10d, %r10d
	movslq	%r12d, %r9
	leaq	-4+tmpa(%rip), %r11
	.p2align 4,,10
	.p2align 3
.L3:
	movq	(%rbx,%r10,8), %rdi
	movq	(%rbx,%r9,8), %rsi
	movl	%eax, %r8d
	cmpq	%rdi, %rsi
	jge	.L7
.L52:
	movl	%edi, (%r11,%rax,4)
	addl	$1, %edx
	addq	$1, %rax
	cmpl	%ecx, %ebp
	jle	.L10
	cmpl	%edx, %r12d
	jle	.L14
	movslq	%edx, %r10
	movq	(%rbx,%r9,8), %rsi
	movl	%eax, %r8d
	movq	(%rbx,%r10,8), %rdi
	cmpq	%rdi, %rsi
	jl	.L52
.L7:
	movl	%esi, (%r11,%rax,4)
	addl	$1, %ecx
	addq	$1, %rax
	cmpl	%edx, %r12d
	jle	.L14
	cmpl	%ecx, %ebp
	jle	.L10
	movslq	%ecx, %r9
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L10:
	cmpl	%edx, %r12d
	jle	.L14
.L11:
	movl	%r12d, %r11d
	subl	%edx, %r11d
	leal	-1(%r11), %eax
	cmpl	$2, %eax
	jbe	.L29
	movslq	%edx, %rax
	movl	%r11d, %r9d
	leaq	tmpa(%rip), %rsi
	leaq	(%rbx,%rax,8), %rdi
	shrl	$2, %r9d
	movslq	%r8d, %rax
	leaq	(%rsi,%rax,4), %r10
	salq	$4, %r9
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L16:
	movdqu	(%rdi,%rax,2), %xmm0
	movdqu	16(%rdi,%rax,2), %xmm4
	shufps	$136, %xmm4, %xmm0
	movups	%xmm0, (%r10,%rax)
	addq	$16, %rax
	cmpq	%r9, %rax
	jne	.L16
	movl	%r11d, %edi
	andl	$-4, %edi
	addl	%edi, %edx
	leal	(%r8,%rdi), %eax
	cmpl	%edi, %r11d
	je	.L17
.L15:
	movslq	%edx, %r10
	movslq	%eax, %rdi
	leaq	0(,%r10,8), %r9
	movq	(%rbx,%r10,8), %r10
	movl	%r10d, (%rsi,%rdi,4)
	leal	1(%rdx), %r10d
	leal	1(%rax), %edi
	cmpl	%r12d, %r10d
	jge	.L17
	movq	8(%rbx,%r9), %r10
	movslq	%edi, %rdi
	addl	$2, %edx
	addl	$2, %eax
	movl	%r10d, (%rsi,%rdi,4)
	cmpl	%edx, %r12d
	jle	.L17
	movq	16(%rbx,%r9), %rdx
	cltq
	movl	%edx, (%rsi,%rax,4)
.L17:
	addl	%r11d, %r8d
	cmpl	%ecx, %ebp
	jle	.L18
.L12:
	movl	%ebp, %r9d
	movl	$1, %r11d
	subl	%ecx, %r9d
	cmpl	%ecx, %ebp
	cmovg	%r9d, %r11d
	subl	$1, %r9d
	cmpl	%ecx, %ebp
	jle	.L30
	cmpl	$2, %r9d
	jbe	.L30
	movslq	%ecx, %rax
	movl	%r11d, %edi
	leaq	(%rbx,%rax,8), %rdx
	shrl	$2, %edi
	movslq	%r8d, %rax
	leaq	(%rsi,%rax,4), %r10
	salq	$4, %rdi
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L20:
	movdqu	(%rdx,%rax,2), %xmm0
	movdqu	16(%rdx,%rax,2), %xmm5
	shufps	$136, %xmm5, %xmm0
	movups	%xmm0, (%r10,%rax)
	addq	$16, %rax
	cmpq	%rax, %rdi
	jne	.L20
	movl	%r11d, %edi
	andl	$-4, %edi
	leal	(%rcx,%rdi), %edx
	leal	(%r8,%rdi), %eax
	cmpl	%edi, %r11d
	je	.L21
.L19:
	movslq	%edx, %r11
	movslq	%eax, %rdi
	leaq	0(,%r11,8), %r10
	movq	(%rbx,%r11,8), %r11
	movl	%r11d, (%rsi,%rdi,4)
	leal	1(%rdx), %r11d
	leal	1(%rax), %edi
	cmpl	%r11d, %ebp
	jle	.L21
	movq	8(%rbx,%r10), %r11
	movslq	%edi, %rdi
	addl	$2, %edx
	addl	$2, %eax
	movl	%r11d, (%rsi,%rdi,4)
	cmpl	%ebp, %edx
	jge	.L21
	movq	16(%rbx,%r10), %rdx
	cltq
	movl	%edx, (%rsi,%rax,4)
.L21:
	xorl	%eax, %eax
	cmpl	%ecx, %ebp
	cmovle	%eax, %r9d
	leal	1(%r8,%r9), %r8d
.L18:
	testl	%r8d, %r8d
	movl	$1, %ecx
	cmovg	%r8d, %ecx
	cmpl	$3, %r8d
	jle	.L31
	movl	%ecx, %edx
	pxor	%xmm3, %xmm3
	xorl	%eax, %eax
	shrl	$2, %edx
	salq	$4, %rdx
	.p2align 4,,10
	.p2align 3
.L23:
	movdqa	(%rsi,%rax), %xmm0
	movdqa	%xmm3, %xmm1
	pcmpgtd	%xmm0, %xmm1
	movdqa	%xmm0, %xmm2
	punpckldq	%xmm1, %xmm2
	punpckhdq	%xmm1, %xmm0
	movups	%xmm2, (%rbx,%rax,2)
	movups	%xmm0, 16(%rbx,%rax,2)
	addq	$16, %rax
	cmpq	%rax, %rdx
	jne	.L23
	movl	%ecx, %eax
	andl	$-4, %eax
	andl	$3, %ecx
	je	.L1
.L22:
	movslq	%eax, %rdx
	movslq	(%rsi,%rdx,4), %rdi
	leaq	0(,%rdx,8), %rcx
	movq	%rdi, (%rbx,%rdx,8)
	leal	1(%rax), %edx
	cmpl	%edx, %r8d
	jle	.L1
	movslq	%edx, %rdx
	addl	$2, %eax
	movslq	(%rsi,%rdx,4), %rdx
	movq	%rdx, 8(%rbx,%rcx)
	cmpl	%eax, %r8d
	jle	.L1
	cltq
	movslq	(%rsi,%rax,4), %rax
	movq	%rax, 16(%rbx,%rcx)
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L51:
	.cfi_restore_state
	movl	%r12d, %ecx
	xorl	%r8d, %r8d
	xorl	%edx, %edx
	cmpl	$1, %ebp
	jg	.L11
	cmpl	%r12d, %ebp
	jle	.L1
	leaq	tmpa(%rip), %rsi
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L14:
	leaq	tmpa(%rip), %rsi
	cmpl	%ecx, %ebp
	jle	.L18
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L29:
	movl	%r8d, %eax
	leaq	tmpa(%rip), %rsi
	jmp	.L15
.L30:
	movl	%r8d, %eax
	movl	%ecx, %edx
	jmp	.L19
.L31:
	xorl	%eax, %eax
	jmp	.L22
	.cfi_endproc
.LFE23:
	.size	func, .-func
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	" %d"
.LC1:
	.string	" %d %d"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	-1597440(%rsp), %r11
	.cfi_def_cfa 11, 1597488
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2592, %rsp
	.cfi_def_cfa_offset 1600080
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 1600024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	800016(%rsp), %rbp
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edi
	testl	%edi, %edi
	jle	.L54
	leaq	16(%rsp), %r13
	xorl	%ebx, %ebx
	leaq	400016(%rsp), %r14
	leaq	.LC1(%rip), %r12
	leaq	800016(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L55:
	leaq	(%r14,%rbx,4), %rdx
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	(%r14,%rbx,4), %eax
	addl	0(%r13), %eax
	addq	$4, %r13
	cltq
	movl	12(%rsp), %edi
	movq	%rax, 0(%rbp,%rbx,8)
	addq	$1, %rbx
	cmpl	%ebx, %edi
	jg	.L55
.L54:
	movq	%rbp, %rsi
	call	func
	movl	12(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L70
	leal	-1(%rcx), %edi
	cmpl	$2, %edi
	jbe	.L57
	movl	%ecx, %edx
	leaq	400016(%rsp), %rax
	pxor	%xmm1, %xmm1
	shrl	$2, %edx
	pxor	%xmm4, %xmm4
	subl	$1, %edx
	salq	$4, %rdx
	leaq	400032(%rsp,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L58:
	movdqa	(%rax), %xmm0
	movdqa	%xmm4, %xmm2
	addq	$16, %rax
	pcmpgtd	%xmm0, %xmm2
	movdqa	%xmm0, %xmm3
	punpckldq	%xmm2, %xmm3
	punpckhdq	%xmm2, %xmm0
	paddq	%xmm3, %xmm1
	paddq	%xmm0, %xmm1
	cmpq	%rdx, %rax
	jne	.L58
	movdqa	%xmm1, %xmm0
	movl	%ecx, %edx
	psrldq	$8, %xmm0
	andl	$-4, %edx
	paddq	%xmm0, %xmm1
	movq	%xmm1, %rax
	testb	$3, %cl
	je	.L82
	movslq	%edx, %rsi
	addl	$1, %edx
	movslq	400016(%rsp,%rsi,4), %rsi
	addq	%rsi, %rax
	cmpl	%edx, %ecx
	jle	.L82
.L67:
	movslq	%edx, %rsi
	addl	$1, %edx
	movslq	400016(%rsp,%rsi,4), %rsi
	addq	%rsi, %rax
	cmpl	%ecx, %edx
	jge	.L61
	movslq	%edx, %rdx
	movslq	400016(%rsp,%rdx,4), %rdx
	addq	%rdx, %rax
.L61:
	movl	%edi, %esi
	shrl	%esi
	addl	$1, %esi
	cmpl	$1, %edi
	jbe	.L71
.L66:
	movl	%esi, %edx
	pxor	%xmm0, %xmm0
	shrl	%edx
	subl	$1, %edx
	salq	$5, %rdx
	leaq	800048(%rsp,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L63:
	movdqa	0(%rbp), %xmm1
	punpcklqdq	16(%rbp), %xmm1
	addq	$32, %rbp
	paddq	%xmm1, %xmm0
	cmpq	%rbp, %rdx
	jne	.L63
	movdqa	%xmm0, %xmm1
	movl	%esi, %edi
	psrldq	$8, %xmm1
	andl	$-2, %edi
	paddq	%xmm1, %xmm0
	leal	(%rdi,%rdi), %ecx
	movq	%xmm0, %rdx
	cmpl	%esi, %edi
	je	.L56
.L62:
	movslq	%ecx, %rcx
	addq	800016(%rsp,%rcx,8), %rdx
.L56:
	subq	%rax, %rdx
	leaq	.LC2(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	1600024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L84
	addq	$1600032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L82:
	.cfi_restore_state
	movl	%edi, %esi
	shrl	%esi
	addl	$1, %esi
	jmp	.L66
.L70:
	xorl	%eax, %eax
	xorl	%edx, %edx
	jmp	.L56
.L71:
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	jmp	.L62
.L57:
	movslq	400016(%rsp), %rax
	cmpl	$1, %ecx
	je	.L61
	movl	$1, %edx
	jmp	.L67
.L84:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	tmpb
	.bss
	.align 32
	.type	tmpb, @object
	.size	tmpb, 400000
tmpb:
	.zero	400000
	.globl	tmpa
	.align 32
	.type	tmpa, @object
	.size	tmpa, 400000
tmpa:
	.zero	400000
	.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	func
	.type	func, @function
func:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movl	%edi, %r12d
	shrl	$31, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movl	%edi, %ebp
	addl	%edi, %r12d
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	%rsi, %rbx
	sarl	%r12d
	cmpl	$2, %edi
	jg	.L50
	cmpl	$1, %edi
	jne	.L5
	movq	(%rsi), %rax
	movl	%eax, tmpa(%rip)
	cltq
	movq	%rax, (%rsi)
.L1:
	popq	%rbx
	.cfi_remember_state
	.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
.L50:
	.cfi_restore_state
	movl	%r12d, %edi
	call	func
	movl	%ebp, %edi
	movslq	%r12d, %rax
	andl	$1, %edi
	leaq	(%rbx,%rax,8), %rsi
	addl	%r12d, %edi
	call	func
.L5:
	testl	%r12d, %r12d
	movl	$1, %eax
	cmovg	%r12d, %eax
	cmpl	%eax, %ebp
	jle	.L51
	movl	%r12d, %ecx
	movl	$1, %eax
	xorl	%edx, %edx
	xorl	%r10d, %r10d
	movslq	%r12d, %r9
	leaq	-4+tmpa(%rip), %r11
	.p2align 4,,10
	.p2align 3
.L3:
	movq	(%rbx,%r10,8), %rdi
	movq	(%rbx,%r9,8), %rsi
	movl	%eax, %r8d
	cmpq	%rdi, %rsi
	jge	.L7
.L52:
	movl	%edi, (%r11,%rax,4)
	addl	$1, %edx
	addq	$1, %rax
	cmpl	%ecx, %ebp
	jle	.L10
	cmpl	%edx, %r12d
	jle	.L14
	movslq	%edx, %r10
	movq	(%rbx,%r9,8), %rsi
	movl	%eax, %r8d
	movq	(%rbx,%r10,8), %rdi
	cmpq	%rdi, %rsi
	jl	.L52
.L7:
	movl	%esi, (%r11,%rax,4)
	addl	$1, %ecx
	addq	$1, %rax
	cmpl	%edx, %r12d
	jle	.L14
	cmpl	%ecx, %ebp
	jle	.L10
	movslq	%ecx, %r9
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L10:
	cmpl	%edx, %r12d
	jle	.L14
.L11:
	movl	%r12d, %r11d
	subl	%edx, %r11d
	leal	-1(%r11), %eax
	cmpl	$2, %eax
	jbe	.L29
	movslq	%edx, %rax
	movl	%r11d, %r9d
	leaq	tmpa(%rip), %rsi
	leaq	(%rbx,%rax,8), %rdi
	shrl	$2, %r9d
	movslq	%r8d, %rax
	leaq	(%rsi,%rax,4), %r10
	salq	$4, %r9
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L16:
	movdqu	(%rdi,%rax,2), %xmm0
	movdqu	16(%rdi,%rax,2), %xmm4
	shufps	$136, %xmm4, %xmm0
	movups	%xmm0, (%r10,%rax)
	addq	$16, %rax
	cmpq	%r9, %rax
	jne	.L16
	movl	%r11d, %edi
	andl	$-4, %edi
	addl	%edi, %edx
	leal	(%r8,%rdi), %eax
	cmpl	%edi, %r11d
	je	.L17
.L15:
	movslq	%edx, %r10
	movslq	%eax, %rdi
	leaq	0(,%r10,8), %r9
	movq	(%rbx,%r10,8), %r10
	movl	%r10d, (%rsi,%rdi,4)
	leal	1(%rdx), %r10d
	leal	1(%rax), %edi
	cmpl	%r12d, %r10d
	jge	.L17
	movq	8(%rbx,%r9), %r10
	movslq	%edi, %rdi
	addl	$2, %edx
	addl	$2, %eax
	movl	%r10d, (%rsi,%rdi,4)
	cmpl	%edx, %r12d
	jle	.L17
	movq	16(%rbx,%r9), %rdx
	cltq
	movl	%edx, (%rsi,%rax,4)
.L17:
	addl	%r11d, %r8d
	cmpl	%ecx, %ebp
	jle	.L18
.L12:
	movl	%ebp, %r9d
	movl	$1, %r11d
	subl	%ecx, %r9d
	cmpl	%ecx, %ebp
	cmovg	%r9d, %r11d
	subl	$1, %r9d
	cmpl	%ecx, %ebp
	jle	.L30
	cmpl	$2, %r9d
	jbe	.L30
	movslq	%ecx, %rax
	movl	%r11d, %edi
	leaq	(%rbx,%rax,8), %rdx
	shrl	$2, %edi
	movslq	%r8d, %rax
	leaq	(%rsi,%rax,4), %r10
	salq	$4, %rdi
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L20:
	movdqu	(%rdx,%rax,2), %xmm0
	movdqu	16(%rdx,%rax,2), %xmm5
	shufps	$136, %xmm5, %xmm0
	movups	%xmm0, (%r10,%rax)
	addq	$16, %rax
	cmpq	%rax, %rdi
	jne	.L20
	movl	%r11d, %edi
	andl	$-4, %edi
	leal	(%rcx,%rdi), %edx
	leal	(%r8,%rdi), %eax
	cmpl	%edi, %r11d
	je	.L21
.L19:
	movslq	%edx, %r11
	movslq	%eax, %rdi
	leaq	0(,%r11,8), %r10
	movq	(%rbx,%r11,8), %r11
	movl	%r11d, (%rsi,%rdi,4)
	leal	1(%rdx), %r11d
	leal	1(%rax), %edi
	cmpl	%r11d, %ebp
	jle	.L21
	movq	8(%rbx,%r10), %r11
	movslq	%edi, %rdi
	addl	$2, %edx
	addl	$2, %eax
	movl	%r11d, (%rsi,%rdi,4)
	cmpl	%ebp, %edx
	jge	.L21
	movq	16(%rbx,%r10), %rdx
	cltq
	movl	%edx, (%rsi,%rax,4)
.L21:
	xorl	%eax, %eax
	cmpl	%ecx, %ebp
	cmovle	%eax, %r9d
	leal	1(%r8,%r9), %r8d
.L18:
	testl	%r8d, %r8d
	movl	$1, %ecx
	cmovg	%r8d, %ecx
	cmpl	$3, %r8d
	jle	.L31
	movl	%ecx, %edx
	pxor	%xmm3, %xmm3
	xorl	%eax, %eax
	shrl	$2, %edx
	salq	$4, %rdx
	.p2align 4,,10
	.p2align 3
.L23:
	movdqa	(%rsi,%rax), %xmm0
	movdqa	%xmm3, %xmm1
	pcmpgtd	%xmm0, %xmm1
	movdqa	%xmm0, %xmm2
	punpckldq	%xmm1, %xmm2
	punpckhdq	%xmm1, %xmm0
	movups	%xmm2, (%rbx,%rax,2)
	movups	%xmm0, 16(%rbx,%rax,2)
	addq	$16, %rax
	cmpq	%rax, %rdx
	jne	.L23
	movl	%ecx, %eax
	andl	$-4, %eax
	andl	$3, %ecx
	je	.L1
.L22:
	movslq	%eax, %rdx
	movslq	(%rsi,%rdx,4), %rdi
	leaq	0(,%rdx,8), %rcx
	movq	%rdi, (%rbx,%rdx,8)
	leal	1(%rax), %edx
	cmpl	%edx, %r8d
	jle	.L1
	movslq	%edx, %rdx
	addl	$2, %eax
	movslq	(%rsi,%rdx,4), %rdx
	movq	%rdx, 8(%rbx,%rcx)
	cmpl	%eax, %r8d
	jle	.L1
	cltq
	movslq	(%rsi,%rax,4), %rax
	movq	%rax, 16(%rbx,%rcx)
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L51:
	.cfi_restore_state
	movl	%r12d, %ecx
	xorl	%r8d, %r8d
	xorl	%edx, %edx
	cmpl	$1, %ebp
	jg	.L11
	cmpl	%r12d, %ebp
	jle	.L1
	leaq	tmpa(%rip), %rsi
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L14:
	leaq	tmpa(%rip), %rsi
	cmpl	%ecx, %ebp
	jle	.L18
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L29:
	movl	%r8d, %eax
	leaq	tmpa(%rip), %rsi
	jmp	.L15
.L30:
	movl	%r8d, %eax
	movl	%ecx, %edx
	jmp	.L19
.L31:
	xorl	%eax, %eax
	jmp	.L22
	.cfi_endproc
.LFE23:
	.size	func, .-func
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	" %d"
.LC1:
	.string	" %d %d"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	-1597440(%rsp), %r11
	.cfi_def_cfa 11, 1597488
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2592, %rsp
	.cfi_def_cfa_offset 1600080
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 1600024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	800016(%rsp), %rbp
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edi
	testl	%edi, %edi
	jle	.L54
	leaq	16(%rsp), %r13
	xorl	%ebx, %ebx
	leaq	400016(%rsp), %r14
	leaq	.LC1(%rip), %r12
	leaq	800016(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L55:
	leaq	(%r14,%rbx,4), %rdx
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	(%r14,%rbx,4), %eax
	addl	0(%r13), %eax
	addq	$4, %r13
	cltq
	movl	12(%rsp), %edi
	movq	%rax, 0(%rbp,%rbx,8)
	addq	$1, %rbx
	cmpl	%ebx, %edi
	jg	.L55
.L54:
	movq	%rbp, %rsi
	call	func
	movl	12(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L70
	leal	-1(%rcx), %edi
	cmpl	$2, %edi
	jbe	.L57
	movl	%ecx, %edx
	leaq	400016(%rsp), %rax
	pxor	%xmm1, %xmm1
	shrl	$2, %edx
	pxor	%xmm4, %xmm4
	subl	$1, %edx
	salq	$4, %rdx
	leaq	400032(%rsp,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L58:
	movdqa	(%rax), %xmm0
	movdqa	%xmm4, %xmm2
	addq	$16, %rax
	pcmpgtd	%xmm0, %xmm2
	movdqa	%xmm0, %xmm3
	punpckldq	%xmm2, %xmm3
	punpckhdq	%xmm2, %xmm0
	paddq	%xmm3, %xmm1
	paddq	%xmm0, %xmm1
	cmpq	%rdx, %rax
	jne	.L58
	movdqa	%xmm1, %xmm0
	movl	%ecx, %edx
	psrldq	$8, %xmm0
	andl	$-4, %edx
	paddq	%xmm0, %xmm1
	movq	%xmm1, %rax
	testb	$3, %cl
	je	.L82
	movslq	%edx, %rsi
	addl	$1, %edx
	movslq	400016(%rsp,%rsi,4), %rsi
	addq	%rsi, %rax
	cmpl	%edx, %ecx
	jle	.L82
.L67:
	movslq	%edx, %rsi
	addl	$1, %edx
	movslq	400016(%rsp,%rsi,4), %rsi
	addq	%rsi, %rax
	cmpl	%ecx, %edx
	jge	.L61
	movslq	%edx, %rdx
	movslq	400016(%rsp,%rdx,4), %rdx
	addq	%rdx, %rax
.L61:
	movl	%edi, %esi
	shrl	%esi
	addl	$1, %esi
	cmpl	$1, %edi
	jbe	.L71
.L66:
	movl	%esi, %edx
	pxor	%xmm0, %xmm0
	shrl	%edx
	subl	$1, %edx
	salq	$5, %rdx
	leaq	800048(%rsp,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L63:
	movdqa	0(%rbp), %xmm1
	punpcklqdq	16(%rbp), %xmm1
	addq	$32, %rbp
	paddq	%xmm1, %xmm0
	cmpq	%rbp, %rdx
	jne	.L63
	movdqa	%xmm0, %xmm1
	movl	%esi, %edi
	psrldq	$8, %xmm1
	andl	$-2, %edi
	paddq	%xmm1, %xmm0
	leal	(%rdi,%rdi), %ecx
	movq	%xmm0, %rdx
	cmpl	%esi, %edi
	je	.L56
.L62:
	movslq	%ecx, %rcx
	addq	800016(%rsp,%rcx,8), %rdx
.L56:
	subq	%rax, %rdx
	leaq	.LC2(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	1600024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L84
	addq	$1600032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L82:
	.cfi_restore_state
	movl	%edi, %esi
	shrl	%esi
	addl	$1, %esi
	jmp	.L66
.L70:
	xorl	%eax, %eax
	xorl	%edx, %edx
	jmp	.L56
.L71:
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	jmp	.L62
.L57:
	movslq	400016(%rsp), %rax
	cmpl	$1, %ecx
	je	.L61
	movl	$1, %edx
	jmp	.L67
.L84:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	tmpb
	.bss
	.align 32
	.type	tmpb, @object
	.size	tmpb, 400000
tmpb:
	.zero	400000
	.globl	tmpa
	.align 32
	.type	tmpa, @object
	.size	tmpa, 400000
tmpa:
	.zero	400000
	.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>

#define MAX_N 100000
int tmpa[MAX_N],tmpb[MAX_N];

void func(int Len,long long *heada){
    int cent = Len/2;
    int tip  = Len%2;
    if(Len > 2){
        func(cent, heada);
        func(cent+tip, heada+cent);
    }
    int i,j,k;
    i = k = 0;
    j = cent;
    if(Len == 1){
        tmpa[k] = heada[0];
        k++;
    }else{
        while(i < cent && j < Len){
            if(heada[i] > heada[j]){
                tmpa[k] = heada[i];
                k++;
                i++;
            }else{
                tmpa[k] = heada[j];
                k++;
                j++;
            }
        }

        while(i < cent){
            tmpa[k] = heada[i];
            k++;
            i++;
        }

        while(j < Len){
            tmpa[k] = heada[j];
            k++;
            j++;
        }
    }
    int l;
    for(l = 0;l < k;l++){
        heada[l] = tmpa[l];
    }
    return;
}

int main(void){
    int N;
    int A[MAX_N],B[MAX_N];
    long long int AB[MAX_N];
    scanf(" %d",&N);
    int i;
    for(i = 0;i < N;i++){
        scanf(" %d %d",&A[i],&B[i]);
        AB[i] = A[i] + B[i];
    }
    func(N,AB);
    long long int bsum = 0;
    for(i = 0;i < N;i++){
        bsum += B[i];
    }
    long long int ans = 0;
    for(i = 0;i < N;i+=2){
            ans += AB[i];
    }
    ans = ans - bsum;
    printf("%lld\n",ans);
    return 0;
}
3
20 10
16 20
20 30
 3
10 10
20 34
30 30
 6
1 1000000000
1 1000000000
1 1000000000
1 1000000000
1 1000000000
1 1000000001
 3
20 10
16 20
20 7
 3
10 10
20 4
30 30
 6
1 1000000000
1 1000000000
1 1000000000
1 1000000000
1 1000000000
2 1000000001
 3
20 2
16 20
20 7
 3
15 10
20 4
30 30
 6
1 1000000000
1 1000000000
1 1000000000
1 1010000000
1 1000000000
2 1000000001
 3
20 2
1 20
20 7

20
 6
 -2999999997
 26
 36
 -2999999996
 29
 40
 -2999999998
 19

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>

#define MAX_N 100000
int tmpa[MAX_N],tmpb[MAX_N];

void func(int Len,long long *heada){
    int cent = Len/2;
    int tip  = Len%2;
    if(Len > 2){
        func(cent, heada);
        func(cent+tip, heada+cent);
    }
    int i,j,k;
    i = k = 0;
    j = cent;
    if(Len == 1){
        tmpa[k] = heada[0];
        k++;
    }else{
        while(i < cent && j < Len){
            if(heada[i] > heada[j]){
                tmpa[k] = heada[i];
                k++;
                i++;
            }else{
                tmpa[k] = heada[j];
                k++;
                j++;
            }
        }

        while(i < cent){
            tmpa[k] = heada[i];
            k++;
            i++;
        }

        while(j < Len){
            tmpa[k] = heada[j];
            k++;
            j++;
        }
    }
    int l;
    for(l = 0;l < k;l++){
        heada[l] = tmpa[l];
    }
    return;
}

int main(void){
    int N;
    int A[MAX_N],B[MAX_N];
    long long int AB[MAX_N];
    scanf(" %d",&N);
    int i;
    for(i = 0;i < N;i++){
        scanf(" %d %d",&A[i],&B[i]);
        AB[i] = A[i] + B[i];
    }
    func(N,AB);
    long long int bsum = 0;
    for(i = 0;i < N;i++){
        bsum += B[i];
    }
    long long int ans = 0;
    for(i = 0;i < N;i+=2){
            ans += AB[i];
    }
    ans = ans - bsum;
    printf("%lld\n",ans);
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	tmpa
	.bss
	.align 32
	.type	tmpa, @object
	.size	tmpa, 400000
tmpa:
	.zero	400000
	.globl	tmpb
	.align 32
	.type	tmpb, @object
	.size	tmpb, 400000
tmpb:
	.zero	400000
	.text
	.globl	func
	.type	func, @function
func:
.LFB0:
	.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
	movl	%edi, -36(%rbp)
	movq	%rsi, -48(%rbp)
	movl	-36(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -8(%rbp)
	movl	-36(%rbp), %eax
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	movl	%eax, -4(%rbp)
	cmpl	$2, -36(%rbp)
	jle	.L2
	movq	-48(%rbp), %rdx
	movl	-8(%rbp), %eax
	movq	%rdx, %rsi
	movl	%eax, %edi
	call	func
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	addq	%rax, %rdx
	movl	-8(%rbp), %ecx
	movl	-4(%rbp), %eax
	addl	%ecx, %eax
	movq	%rdx, %rsi
	movl	%eax, %edi
	call	func
.L2:
	movl	$0, -16(%rbp)
	movl	-16(%rbp), %eax
	movl	%eax, -24(%rbp)
	movl	-8(%rbp), %eax
	movl	%eax, -20(%rbp)
	cmpl	$1, -36(%rbp)
	jne	.L5
	movq	-48(%rbp), %rax
	movq	(%rax), %rax
	movl	%eax, %ecx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	tmpa(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -16(%rbp)
	jmp	.L4
.L8:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	movq	-48(%rbp), %rax
	addq	%rcx, %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jle	.L6
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movl	%eax, %ecx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	tmpa(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -16(%rbp)
	addl	$1, -24(%rbp)
	jmp	.L5
.L6:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movl	%eax, %ecx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	tmpa(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -16(%rbp)
	addl	$1, -20(%rbp)
.L5:
	movl	-24(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L9
	movl	-20(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jl	.L8
	jmp	.L9
.L10:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movl	%eax, %ecx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	tmpa(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -16(%rbp)
	addl	$1, -24(%rbp)
.L9:
	movl	-24(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jl	.L10
	jmp	.L11
.L12:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movl	%eax, %ecx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	tmpa(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -16(%rbp)
	addl	$1, -20(%rbp)
.L11:
	movl	-20(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jl	.L12
.L4:
	movl	$0, -12(%rbp)
	jmp	.L13
.L14:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	tmpa(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-48(%rbp), %rdx
	addq	%rcx, %rdx
	cltq
	movq	%rax, (%rdx)
	addl	$1, -12(%rbp)
.L13:
	movl	-12(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jl	.L14
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	func, .-func
	.section	.rodata
.LC0:
	.string	" %d"
.LC1:
	.string	" %d %d"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-1597440(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2608, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-1600040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -1600036(%rbp)
	jmp	.L17
.L18:
	leaq	-1200016(%rbp), %rdx
	movl	-1600036(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-1600016(%rbp), %rcx
	movl	-1600036(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-1600036(%rbp), %eax
	cltq
	movl	-1600016(%rbp,%rax,4), %edx
	movl	-1600036(%rbp), %eax
	cltq
	movl	-1200016(%rbp,%rax,4), %eax
	addl	%edx, %eax
	movslq	%eax, %rdx
	movl	-1600036(%rbp), %eax
	cltq
	movq	%rdx, -800016(%rbp,%rax,8)
	addl	$1, -1600036(%rbp)
.L17:
	movl	-1600040(%rbp), %eax
	cmpl	%eax, -1600036(%rbp)
	jl	.L18
	movl	-1600040(%rbp), %eax
	leaq	-800016(%rbp), %rdx
	movq	%rdx, %rsi
	movl	%eax, %edi
	call	func
	movq	$0, -1600032(%rbp)
	movl	$0, -1600036(%rbp)
	jmp	.L19
.L20:
	movl	-1600036(%rbp), %eax
	cltq
	movl	-1200016(%rbp,%rax,4), %eax
	cltq
	addq	%rax, -1600032(%rbp)
	addl	$1, -1600036(%rbp)
.L19:
	movl	-1600040(%rbp), %eax
	cmpl	%eax, -1600036(%rbp)
	jl	.L20
	movq	$0, -1600024(%rbp)
	movl	$0, -1600036(%rbp)
	jmp	.L21
.L22:
	movl	-1600036(%rbp), %eax
	cltq
	movq	-800016(%rbp,%rax,8), %rax
	addq	%rax, -1600024(%rbp)
	addl	$2, -1600036(%rbp)
.L21:
	movl	-1600040(%rbp), %eax
	cmpl	%eax, -1600036(%rbp)
	jl	.L22
	movq	-1600032(%rbp), %rax
	subq	%rax, -1600024(%rbp)
	movq	-1600024(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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	tmpa
	.bss
	.align 32
	.type	tmpa, @object
	.size	tmpa, 400000
tmpa:
	.zero	400000
	.globl	tmpb
	.align 32
	.type	tmpb, @object
	.size	tmpb, 400000
tmpb:
	.zero	400000
	.text
	.globl	func
	.type	func, @function
func:
.LFB0:
	.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
	movl	%edi, -36(%rbp)
	movq	%rsi, -48(%rbp)
	movl	-36(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -8(%rbp)
	movl	-36(%rbp), %eax
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	movl	%eax, -4(%rbp)
	cmpl	$2, -36(%rbp)
	jle	.L2
	movq	-48(%rbp), %rdx
	movl	-8(%rbp), %eax
	movq	%rdx, %rsi
	movl	%eax, %edi
	call	func
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	addq	%rax, %rdx
	movl	-8(%rbp), %ecx
	movl	-4(%rbp), %eax
	addl	%ecx, %eax
	movq	%rdx, %rsi
	movl	%eax, %edi
	call	func
.L2:
	movl	$0, -16(%rbp)
	movl	-16(%rbp), %eax
	movl	%eax, -24(%rbp)
	movl	-8(%rbp), %eax
	movl	%eax, -20(%rbp)
	cmpl	$1, -36(%rbp)
	jne	.L5
	movq	-48(%rbp), %rax
	movq	(%rax), %rax
	movl	%eax, %ecx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	tmpa(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -16(%rbp)
	jmp	.L4
.L8:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	movq	-48(%rbp), %rax
	addq	%rcx, %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jle	.L6
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movl	%eax, %ecx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	tmpa(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -16(%rbp)
	addl	$1, -24(%rbp)
	jmp	.L5
.L6:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movl	%eax, %ecx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	tmpa(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -16(%rbp)
	addl	$1, -20(%rbp)
.L5:
	movl	-24(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L9
	movl	-20(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jl	.L8
	jmp	.L9
.L10:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movl	%eax, %ecx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	tmpa(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -16(%rbp)
	addl	$1, -24(%rbp)
.L9:
	movl	-24(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jl	.L10
	jmp	.L11
.L12:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movl	%eax, %ecx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	tmpa(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -16(%rbp)
	addl	$1, -20(%rbp)
.L11:
	movl	-20(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jl	.L12
.L4:
	movl	$0, -12(%rbp)
	jmp	.L13
.L14:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	tmpa(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-48(%rbp), %rdx
	addq	%rcx, %rdx
	cltq
	movq	%rax, (%rdx)
	addl	$1, -12(%rbp)
.L13:
	movl	-12(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jl	.L14
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	func, .-func
	.section	.rodata
.LC0:
	.string	" %d"
.LC1:
	.string	" %d %d"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-1597440(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2608, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-1600040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -1600036(%rbp)
	jmp	.L17
.L18:
	leaq	-1200016(%rbp), %rdx
	movl	-1600036(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-1600016(%rbp), %rcx
	movl	-1600036(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-1600036(%rbp), %eax
	cltq
	movl	-1600016(%rbp,%rax,4), %edx
	movl	-1600036(%rbp), %eax
	cltq
	movl	-1200016(%rbp,%rax,4), %eax
	addl	%edx, %eax
	movslq	%eax, %rdx
	movl	-1600036(%rbp), %eax
	cltq
	movq	%rdx, -800016(%rbp,%rax,8)
	addl	$1, -1600036(%rbp)
.L17:
	movl	-1600040(%rbp), %eax
	cmpl	%eax, -1600036(%rbp)
	jl	.L18
	movl	-1600040(%rbp), %eax
	leaq	-800016(%rbp), %rdx
	movq	%rdx, %rsi
	movl	%eax, %edi
	call	func
	movq	$0, -1600032(%rbp)
	movl	$0, -1600036(%rbp)
	jmp	.L19
.L20:
	movl	-1600036(%rbp), %eax
	cltq
	movl	-1200016(%rbp,%rax,4), %eax
	cltq
	addq	%rax, -1600032(%rbp)
	addl	$1, -1600036(%rbp)
.L19:
	movl	-1600040(%rbp), %eax
	cmpl	%eax, -1600036(%rbp)
	jl	.L20
	movq	$0, -1600024(%rbp)
	movl	$0, -1600036(%rbp)
	jmp	.L21
.L22:
	movl	-1600036(%rbp), %eax
	cltq
	movq	-800016(%rbp,%rax,8), %rax
	addq	%rax, -1600024(%rbp)
	addl	$2, -1600036(%rbp)
.L21:
	movl	-1600040(%rbp), %eax
	cmpl	%eax, -1600036(%rbp)
	jl	.L22
	movq	-1600032(%rbp), %rax
	subq	%rax, -1600024(%rbp)
	movq	-1600024(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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:
