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>
long long int a[200000], b[200000];
long long int sum_a[200001], sum_b[200001];
int max(int a, int b){return a > b ? a : b;}
int min(int a, int b){return a < b ? a : b;}

int main(void){
    sum_a[0] = 0;
    sum_b[0] = 0;
    int n, m;
    long long int k;
    scanf("%d%d%lld", &n, &m, &k);
    
    

    int i, j;
    for(i = 0; i < n; i++){
        scanf("%lld", &a[i]);
        sum_a[i+1] = sum_a[i] + a[i];
    }
    for(i = 0; i < m; i++){
        scanf("%lld", &b[i]);
        sum_b[i+1] = sum_b[i] + b[i];
    }
    int ans = 0;
    for(i = 0; i < n + 1; i++){
        long long int L = k - sum_a[i];//Aのテーブルからi冊読む
        if(L < 0){
            continue;
        }else if(L == 0){
            ans = max(ans, i);
        }else if(sum_b[m] <= L){
            ans = max(ans, i + m);
        }
        int r = m;
        int l = 0;
        while(r - l != 1){
            int mid = (r + l)/2;
            if(sum_b[mid] <= L){
                l = mid;
            }else{
                r = mid;
            }
        }
        ans = max(ans, l + i);
    }
    printf("%d\n", ans);
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 1600000
a:
	.zero	1600000
	.globl	b
	.align 32
	.type	b, @object
	.size	b, 1600000
b:
	.zero	1600000
	.globl	sum_a
	.align 32
	.type	sum_a, @object
	.size	sum_a, 1600008
sum_a:
	.zero	1600008
	.globl	sum_b
	.align 32
	.type	sum_b, @object
	.size	sum_b, 1600008
sum_b:
	.zero	1600008
	.text
	.globl	max
	.type	max, @function
max:
.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
	cmovge	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	max, .-max
	.globl	min
	.type	min, @function
min:
.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
	cmovle	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	min, .-min
	.section	.rodata
.LC0:
	.string	"%d%d%lld"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.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
	movq	$0, sum_a(%rip)
	movq	$0, sum_b(%rip)
	leaq	-24(%rbp), %rcx
	leaq	-48(%rbp), %rdx
	leaq	-52(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -44(%rbp)
	jmp	.L6
.L7:
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	sum_a(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-44(%rbp), %eax
	addl	$1, %eax
	addq	%rdx, %rcx
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	sum_a(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	addl	$1, -44(%rbp)
.L6:
	movl	-52(%rbp), %eax
	cmpl	%eax, -44(%rbp)
	jl	.L7
	movl	$0, -44(%rbp)
	jmp	.L8
.L9:
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	b(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	sum_b(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	b(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-44(%rbp), %eax
	addl	$1, %eax
	addq	%rdx, %rcx
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	sum_b(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	addl	$1, -44(%rbp)
.L8:
	movl	-48(%rbp), %eax
	cmpl	%eax, -44(%rbp)
	jl	.L9
	movl	$0, -40(%rbp)
	movl	$0, -44(%rbp)
	jmp	.L10
.L18:
	movq	-24(%rbp), %rax
	movl	-44(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	sum_a(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	subq	%rdx, %rax
	movq	%rax, -16(%rbp)
	cmpq	$0, -16(%rbp)
	js	.L21
	cmpq	$0, -16(%rbp)
	jne	.L13
	movl	-44(%rbp), %edx
	movl	-40(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	max
	movl	%eax, -40(%rbp)
	jmp	.L14
.L13:
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	sum_b(%rip), %rax
	movq	(%rdx,%rax), %rax
	cmpq	%rax, -16(%rbp)
	jl	.L14
	movl	-48(%rbp), %edx
	movl	-44(%rbp), %eax
	addl	%eax, %edx
	movl	-40(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	max
	movl	%eax, -40(%rbp)
.L14:
	movl	-48(%rbp), %eax
	movl	%eax, -36(%rbp)
	movl	$0, -32(%rbp)
	jmp	.L15
.L17:
	movl	-36(%rbp), %edx
	movl	-32(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -28(%rbp)
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	sum_b(%rip), %rax
	movq	(%rdx,%rax), %rax
	cmpq	%rax, -16(%rbp)
	jl	.L16
	movl	-28(%rbp), %eax
	movl	%eax, -32(%rbp)
	jmp	.L15
.L16:
	movl	-28(%rbp), %eax
	movl	%eax, -36(%rbp)
.L15:
	movl	-36(%rbp), %eax
	subl	-32(%rbp), %eax
	cmpl	$1, %eax
	jne	.L17
	movl	-32(%rbp), %edx
	movl	-44(%rbp), %eax
	addl	%eax, %edx
	movl	-40(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	max
	movl	%eax, -40(%rbp)
	jmp	.L12
.L21:
	nop
.L12:
	addl	$1, -44(%rbp)
.L10:
	movl	-52(%rbp), %eax
	cmpl	%eax, -44(%rbp)
	jle	.L18
	movl	-40(%rbp), %eax
	movl	%eax, %esi
	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	.L20
	call	__stack_chk_fail@PLT
.L20:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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	max
	.type	max, @function
max:
.LFB23:
	.cfi_startproc
	endbr64
	cmpl	%edi, %esi
	movl	%edi, %eax
	cmovge	%esi, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	max, .-max
	.p2align 4
	.globl	min
	.type	min, @function
min:
.LFB24:
	.cfi_startproc
	endbr64
	cmpl	%edi, %esi
	movl	%edi, %eax
	cmovle	%esi, %eax
	ret
	.cfi_endproc
.LFE24:
	.size	min, .-min
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d%lld"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %rdi
	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
	subq	$32, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rcx
	leaq	12(%rsp), %rdx
	movq	$0, sum_a(%rip)
	movq	$0, sum_b(%rip)
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %eax
	testl	%eax, %eax
	jle	.L5
	leaq	8+sum_a(%rip), %r14
	leaq	a(%rip), %r13
	xorl	%ebp, %ebp
	leaq	.LC1(%rip), %r12
	leaq	-8(%r14), %rbx
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$8, %r13
	call	__isoc99_scanf@PLT
	movq	-8(%r13), %rax
	addq	(%rbx,%rbp,8), %rax
	movq	%rax, (%r14,%rbp,8)
	addq	$1, %rbp
	cmpl	%ebp, 8(%rsp)
	jg	.L6
.L5:
	movl	12(%rsp), %r9d
	testl	%r9d, %r9d
	jle	.L7
	leaq	8+sum_b(%rip), %r14
	leaq	b(%rip), %rbp
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r12
	leaq	-8(%r14), %r13
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$8, %rbp
	call	__isoc99_scanf@PLT
	movq	-8(%rbp), %rax
	movl	12(%rsp), %r9d
	addq	0(%r13,%rbx,8), %rax
	movq	%rax, (%r14,%rbx,8)
	addq	$1, %rbx
	cmpl	%ebx, %r9d
	jg	.L8
.L7:
	movslq	8(%rsp), %rbp
	testl	%ebp, %ebp
	js	.L18
	movq	16(%rsp), %r11
	xorl	%r8d, %r8d
	xorl	%r10d, %r10d
	movslq	%r9d, %r12
	leaq	sum_a(%rip), %rbx
	leaq	sum_b(%rip), %rdi
	.p2align 4,,10
	.p2align 3
.L16:
	movl	%r8d, %r13d
	movq	%r11, %rsi
	subq	(%rbx,%r8,8), %rsi
	js	.L10
	jne	.L11
	cmpl	%r8d, %r10d
	cmovl	%r8d, %r10d
.L12:
	movl	%r9d, %ecx
	xorl	%edx, %edx
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L15:
	leal	(%rcx,%rdx), %r14d
	movl	%r14d, %eax
	shrl	$31, %eax
	addl	%r14d, %eax
	sarl	%eax
	movslq	%eax, %r14
	cmpq	%rsi, (%rdi,%r14,8)
	cmovg	%eax, %ecx
	cmovle	%eax, %edx
.L14:
	movl	%ecx, %eax
	subl	%edx, %eax
	cmpl	$1, %eax
	jne	.L15
	addl	%r13d, %edx
	cmpl	%edx, %r10d
	cmovl	%edx, %r10d
.L10:
	leaq	1(%r8), %rax
	cmpq	%r8, %rbp
	je	.L9
	movq	%rax, %r8
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L11:
	cmpq	%rsi, (%rdi,%r12,8)
	jg	.L12
	leal	(%r9,%r8), %eax
	cmpl	%eax, %r10d
	cmovl	%eax, %r10d
	jmp	.L12
.L18:
	xorl	%r10d, %r10d
	.p2align 4,,10
	.p2align 3
.L9:
	xorl	%eax, %eax
	movl	%r10d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L24
	addq	$32, %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
.L24:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.globl	sum_b
	.bss
	.align 32
	.type	sum_b, @object
	.size	sum_b, 1600008
sum_b:
	.zero	1600008
	.globl	sum_a
	.align 32
	.type	sum_a, @object
	.size	sum_a, 1600008
sum_a:
	.zero	1600008
	.globl	b
	.align 32
	.type	b, @object
	.size	b, 1600000
b:
	.zero	1600000
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 1600000
a:
	.zero	1600000
	.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	max
	.type	max, @function
max:
.LFB23:
	.cfi_startproc
	endbr64
	cmpl	%edi, %esi
	movl	%edi, %eax
	cmovge	%esi, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	max, .-max
	.p2align 4
	.globl	min
	.type	min, @function
min:
.LFB24:
	.cfi_startproc
	endbr64
	cmpl	%edi, %esi
	movl	%edi, %eax
	cmovle	%esi, %eax
	ret
	.cfi_endproc
.LFE24:
	.size	min, .-min
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d%lld"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %rdi
	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
	subq	$32, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rcx
	leaq	12(%rsp), %rdx
	movq	$0, sum_a(%rip)
	movq	$0, sum_b(%rip)
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %eax
	testl	%eax, %eax
	jle	.L5
	leaq	8+sum_a(%rip), %r14
	leaq	a(%rip), %r13
	xorl	%ebp, %ebp
	leaq	.LC1(%rip), %r12
	leaq	-8(%r14), %rbx
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$8, %r13
	call	__isoc99_scanf@PLT
	movq	-8(%r13), %rax
	addq	(%rbx,%rbp,8), %rax
	movq	%rax, (%r14,%rbp,8)
	addq	$1, %rbp
	cmpl	%ebp, 8(%rsp)
	jg	.L6
.L5:
	movl	12(%rsp), %r9d
	testl	%r9d, %r9d
	jle	.L7
	leaq	8+sum_b(%rip), %r14
	leaq	b(%rip), %rbp
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r12
	leaq	-8(%r14), %r13
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$8, %rbp
	call	__isoc99_scanf@PLT
	movq	-8(%rbp), %rax
	movl	12(%rsp), %r9d
	addq	0(%r13,%rbx,8), %rax
	movq	%rax, (%r14,%rbx,8)
	addq	$1, %rbx
	cmpl	%ebx, %r9d
	jg	.L8
.L7:
	movslq	8(%rsp), %rbp
	testl	%ebp, %ebp
	js	.L18
	movq	16(%rsp), %r11
	xorl	%r8d, %r8d
	xorl	%r10d, %r10d
	movslq	%r9d, %r12
	leaq	sum_a(%rip), %rbx
	leaq	sum_b(%rip), %rdi
	.p2align 4,,10
	.p2align 3
.L16:
	movl	%r8d, %r13d
	movq	%r11, %rsi
	subq	(%rbx,%r8,8), %rsi
	js	.L10
	jne	.L11
	cmpl	%r8d, %r10d
	cmovl	%r8d, %r10d
.L12:
	movl	%r9d, %ecx
	xorl	%edx, %edx
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L15:
	leal	(%rcx,%rdx), %r14d
	movl	%r14d, %eax
	shrl	$31, %eax
	addl	%r14d, %eax
	sarl	%eax
	movslq	%eax, %r14
	cmpq	%rsi, (%rdi,%r14,8)
	cmovg	%eax, %ecx
	cmovle	%eax, %edx
.L14:
	movl	%ecx, %eax
	subl	%edx, %eax
	cmpl	$1, %eax
	jne	.L15
	addl	%r13d, %edx
	cmpl	%edx, %r10d
	cmovl	%edx, %r10d
.L10:
	leaq	1(%r8), %rax
	cmpq	%r8, %rbp
	je	.L9
	movq	%rax, %r8
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L11:
	cmpq	%rsi, (%rdi,%r12,8)
	jg	.L12
	leal	(%r9,%r8), %eax
	cmpl	%eax, %r10d
	cmovl	%eax, %r10d
	jmp	.L12
.L18:
	xorl	%r10d, %r10d
	.p2align 4,,10
	.p2align 3
.L9:
	xorl	%eax, %eax
	movl	%r10d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L24
	addq	$32, %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
.L24:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.globl	sum_b
	.bss
	.align 32
	.type	sum_b, @object
	.size	sum_b, 1600008
sum_b:
	.zero	1600008
	.globl	sum_a
	.align 32
	.type	sum_a, @object
	.size	sum_a, 1600008
sum_a:
	.zero	1600008
	.globl	b
	.align 32
	.type	b, @object
	.size	b, 1600000
b:
	.zero	1600000
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 1600000
a:
	.zero	1600000
	.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>
long long int a[200000], b[200000];
long long int sum_a[200001], sum_b[200001];
int max(int a, int b){return a > b ? a : b;}
int min(int a, int b){return a < b ? a : b;}

int main(void){
    sum_a[0] = 0;
    sum_b[0] = 0;
    int n, m;
    long long int k;
    scanf("%d%d%lld", &n, &m, &k);
    
    

    int i, j;
    for(i = 0; i < n; i++){
        scanf("%lld", &a[i]);
        sum_a[i+1] = sum_a[i] + a[i];
    }
    for(i = 0; i < m; i++){
        scanf("%lld", &b[i]);
        sum_b[i+1] = sum_b[i] + b[i];
    }
    int ans = 0;
    for(i = 0; i < n + 1; i++){
        long long int L = k - sum_a[i];//Aのテーブルからi冊読む
        if(L < 0){
            continue;
        }else if(L == 0){
            ans = max(ans, i);
        }else if(sum_b[m] <= L){
            ans = max(ans, i + m);
        }
        int r = m;
        int l = 0;
        while(r - l != 1){
            int mid = (r + l)/2;
            if(sum_b[mid] <= L){
                l = mid;
            }else{
                r = mid;
            }
        }
        ans = max(ans, l + i);
    }
    printf("%d\n", ans);
    return 0;
}
5 4 1
1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000010 1000000000
 3 4 194
60 90 120
80 150 80 150
 3 4 730
60 9 120
80 150 80 150
 3 4 194
60 90 120
80 34 80 150
 3 4 376
60 9 120
80 150 80 150
 3 4 449
60 9 120
80 150 80 150
 3 3 100
96 16 120
30 94 80 150
 3 4 730
60 90 120
85 150 80 150
 3 4 194
60 90 120
80 35 80 150
 3 4 100
60 9 120
80 150 80 150

0
 2
 7
 3
 4
 5
 1
 6
 3
 2

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>
long long int a[200000], b[200000];
long long int sum_a[200001], sum_b[200001];
int max(int a, int b){return a > b ? a : b;}
int min(int a, int b){return a < b ? a : b;}

int main(void){
    sum_a[0] = 0;
    sum_b[0] = 0;
    int n, m;
    long long int k;
    scanf("%d%d%lld", &n, &m, &k);
    
    

    int i, j;
    for(i = 0; i < n; i++){
        scanf("%lld", &a[i]);
        sum_a[i+1] = sum_a[i] + a[i];
    }
    for(i = 0; i < m; i++){
        scanf("%lld", &b[i]);
        sum_b[i+1] = sum_b[i] + b[i];
    }
    int ans = 0;
    for(i = 0; i < n + 1; i++){
        long long int L = k - sum_a[i];//Aのテーブルからi冊読む
        if(L < 0){
            continue;
        }else if(L == 0){
            ans = max(ans, i);
        }else if(sum_b[m] <= L){
            ans = max(ans, i + m);
        }
        int r = m;
        int l = 0;
        while(r - l != 1){
            int mid = (r + l)/2;
            if(sum_b[mid] <= L){
                l = mid;
            }else{
                r = mid;
            }
        }
        ans = max(ans, l + i);
    }
    printf("%d\n", ans);
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 1600000
a:
	.zero	1600000
	.globl	b
	.align 32
	.type	b, @object
	.size	b, 1600000
b:
	.zero	1600000
	.globl	sum_a
	.align 32
	.type	sum_a, @object
	.size	sum_a, 1600008
sum_a:
	.zero	1600008
	.globl	sum_b
	.align 32
	.type	sum_b, @object
	.size	sum_b, 1600008
sum_b:
	.zero	1600008
	.text
	.globl	max
	.type	max, @function
max:
.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
	cmovge	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	max, .-max
	.globl	min
	.type	min, @function
min:
.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
	cmovle	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	min, .-min
	.section	.rodata
.LC0:
	.string	"%d%d%lld"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.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
	movq	$0, sum_a(%rip)
	movq	$0, sum_b(%rip)
	leaq	-24(%rbp), %rcx
	leaq	-48(%rbp), %rdx
	leaq	-52(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -44(%rbp)
	jmp	.L6
.L7:
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	sum_a(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-44(%rbp), %eax
	addl	$1, %eax
	addq	%rdx, %rcx
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	sum_a(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	addl	$1, -44(%rbp)
.L6:
	movl	-52(%rbp), %eax
	cmpl	%eax, -44(%rbp)
	jl	.L7
	movl	$0, -44(%rbp)
	jmp	.L8
.L9:
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	b(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	sum_b(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	b(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-44(%rbp), %eax
	addl	$1, %eax
	addq	%rdx, %rcx
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	sum_b(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	addl	$1, -44(%rbp)
.L8:
	movl	-48(%rbp), %eax
	cmpl	%eax, -44(%rbp)
	jl	.L9
	movl	$0, -40(%rbp)
	movl	$0, -44(%rbp)
	jmp	.L10
.L18:
	movq	-24(%rbp), %rax
	movl	-44(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	sum_a(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	subq	%rdx, %rax
	movq	%rax, -16(%rbp)
	cmpq	$0, -16(%rbp)
	js	.L21
	cmpq	$0, -16(%rbp)
	jne	.L13
	movl	-44(%rbp), %edx
	movl	-40(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	max
	movl	%eax, -40(%rbp)
	jmp	.L14
.L13:
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	sum_b(%rip), %rax
	movq	(%rdx,%rax), %rax
	cmpq	%rax, -16(%rbp)
	jl	.L14
	movl	-48(%rbp), %edx
	movl	-44(%rbp), %eax
	addl	%eax, %edx
	movl	-40(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	max
	movl	%eax, -40(%rbp)
.L14:
	movl	-48(%rbp), %eax
	movl	%eax, -36(%rbp)
	movl	$0, -32(%rbp)
	jmp	.L15
.L17:
	movl	-36(%rbp), %edx
	movl	-32(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -28(%rbp)
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	sum_b(%rip), %rax
	movq	(%rdx,%rax), %rax
	cmpq	%rax, -16(%rbp)
	jl	.L16
	movl	-28(%rbp), %eax
	movl	%eax, -32(%rbp)
	jmp	.L15
.L16:
	movl	-28(%rbp), %eax
	movl	%eax, -36(%rbp)
.L15:
	movl	-36(%rbp), %eax
	subl	-32(%rbp), %eax
	cmpl	$1, %eax
	jne	.L17
	movl	-32(%rbp), %edx
	movl	-44(%rbp), %eax
	addl	%eax, %edx
	movl	-40(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	max
	movl	%eax, -40(%rbp)
	jmp	.L12
.L21:
	nop
.L12:
	addl	$1, -44(%rbp)
.L10:
	movl	-52(%rbp), %eax
	cmpl	%eax, -44(%rbp)
	jle	.L18
	movl	-40(%rbp), %eax
	movl	%eax, %esi
	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	.L20
	call	__stack_chk_fail@PLT
.L20:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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 32
	.type	a, @object
	.size	a, 1600000
a:
	.zero	1600000
	.globl	b
	.align 32
	.type	b, @object
	.size	b, 1600000
b:
	.zero	1600000
	.globl	sum_a
	.align 32
	.type	sum_a, @object
	.size	sum_a, 1600008
sum_a:
	.zero	1600008
	.globl	sum_b
	.align 32
	.type	sum_b, @object
	.size	sum_b, 1600008
sum_b:
	.zero	1600008
	.text
	.globl	max
	.type	max, @function
max:
.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
	cmovge	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	max, .-max
	.globl	min
	.type	min, @function
min:
.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
	cmovle	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	min, .-min
	.section	.rodata
.LC0:
	.string	"%d%d%lld"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.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
	movq	$0, sum_a(%rip)
	movq	$0, sum_b(%rip)
	leaq	-24(%rbp), %rcx
	leaq	-48(%rbp), %rdx
	leaq	-52(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -44(%rbp)
	jmp	.L6
.L7:
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	sum_a(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-44(%rbp), %eax
	addl	$1, %eax
	addq	%rdx, %rcx
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	sum_a(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	addl	$1, -44(%rbp)
.L6:
	movl	-52(%rbp), %eax
	cmpl	%eax, -44(%rbp)
	jl	.L7
	movl	$0, -44(%rbp)
	jmp	.L8
.L9:
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	b(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	sum_b(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	b(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-44(%rbp), %eax
	addl	$1, %eax
	addq	%rdx, %rcx
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	sum_b(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	addl	$1, -44(%rbp)
.L8:
	movl	-48(%rbp), %eax
	cmpl	%eax, -44(%rbp)
	jl	.L9
	movl	$0, -40(%rbp)
	movl	$0, -44(%rbp)
	jmp	.L10
.L18:
	movq	-24(%rbp), %rax
	movl	-44(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	sum_a(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	subq	%rdx, %rax
	movq	%rax, -16(%rbp)
	cmpq	$0, -16(%rbp)
	js	.L21
	cmpq	$0, -16(%rbp)
	jne	.L13
	movl	-44(%rbp), %edx
	movl	-40(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	max
	movl	%eax, -40(%rbp)
	jmp	.L14
.L13:
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	sum_b(%rip), %rax
	movq	(%rdx,%rax), %rax
	cmpq	%rax, -16(%rbp)
	jl	.L14
	movl	-48(%rbp), %edx
	movl	-44(%rbp), %eax
	addl	%eax, %edx
	movl	-40(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	max
	movl	%eax, -40(%rbp)
.L14:
	movl	-48(%rbp), %eax
	movl	%eax, -36(%rbp)
	movl	$0, -32(%rbp)
	jmp	.L15
.L17:
	movl	-36(%rbp), %edx
	movl	-32(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -28(%rbp)
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	sum_b(%rip), %rax
	movq	(%rdx,%rax), %rax
	cmpq	%rax, -16(%rbp)
	jl	.L16
	movl	-28(%rbp), %eax
	movl	%eax, -32(%rbp)
	jmp	.L15
.L16:
	movl	-28(%rbp), %eax
	movl	%eax, -36(%rbp)
.L15:
	movl	-36(%rbp), %eax
	subl	-32(%rbp), %eax
	cmpl	$1, %eax
	jne	.L17
	movl	-32(%rbp), %edx
	movl	-44(%rbp), %eax
	addl	%eax, %edx
	movl	-40(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	max
	movl	%eax, -40(%rbp)
	jmp	.L12
.L21:
	nop
.L12:
	addl	$1, -44(%rbp)
.L10:
	movl	-52(%rbp), %eax
	cmpl	%eax, -44(%rbp)
	jle	.L18
	movl	-40(%rbp), %eax
	movl	%eax, %esi
	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	.L20
	call	__stack_chk_fail@PLT
.L20:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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:
