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

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

int main(void)
{
    int n;
    int m;
    int k;
    scanf("%d %d %d", &n, &m, &k);

    long long int *a;
    long long int *b;
    long long int temp;
    int i;
    a = (long long int *)malloc(sizeof(long long int) * n + 1);
    a[0] = 0;
    for (i = 1; i < n + 1; i++)
    {
        scanf("%lld", &temp);
        a[i] = a[i - 1] + temp;
    }
    b = (long long int *)malloc(sizeof(long long int) * m + 1);
    b[0] = 0;
    for (i = 1; i < m + 1; i++)
    {
        scanf("%lld", &temp);
        b[i] = b[i - 1] + temp;
    }

    int answer = 0;
    int j = m;
    for (i = 0; i < n + 1; i++)
    {
        if (a[i] > k)
        {
            break;
        }
        while (b[j] > k - a[i])
        {
            j -= 1;
        }
        answer = answer > (i + j) ? answer : (i + j);
    }

    printf("%d\n", answer);

    free(a);
    free(b);
    return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	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	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rcx
	leaq	8(%rsp), %rdx
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rax
	leaq	1(,%rax,8), %rdi
	movq	%rax, %rbx
	call	malloc@PLT
	movq	$0, (%rax)
	movq	%rax, %r12
	testl	%ebx, %ebx
	jle	.L2
	movl	$1, %ebx
	leaq	16(%rsp), %r15
	leaq	.LC1(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r15, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	16(%rsp), %rax
	addq	-8(%r12,%rbx,8), %rax
	movq	%rax, (%r12,%rbx,8)
	addq	$1, %rbx
	cmpl	%ebx, 4(%rsp)
	jge	.L3
.L2:
	movslq	8(%rsp), %rax
	leaq	1(,%rax,8), %rdi
	movq	%rax, %rbx
	call	malloc@PLT
	movq	$0, (%rax)
	movq	%rax, %rbp
	testl	%ebx, %ebx
	jle	.L4
	movl	$1, %r13d
	leaq	16(%rsp), %r15
	leaq	.LC1(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r15, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	16(%rsp), %rax
	movl	8(%rsp), %ebx
	addq	-8(%rbp,%r13,8), %rax
	movq	%rax, 0(%rbp,%r13,8)
	addq	$1, %r13
	cmpl	%r13d, %ebx
	jge	.L5
.L4:
	movl	4(%rsp), %r9d
	testl	%r9d, %r9d
	js	.L11
	movslq	12(%rsp), %rdi
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	.p2align 4,,10
	.p2align 3
.L9:
	movq	(%r12,%rcx,8), %rax
	movl	%ecx, %esi
	cmpq	%rdi, %rax
	jg	.L6
	movq	%rdi, %rdx
	subq	%rax, %rdx
	movslq	%ebx, %rax
	cmpq	0(%rbp,%rax,8), %rdx
	jge	.L7
	leal	-1(%rbx), %eax
	cltq
	.p2align 4,,10
	.p2align 3
.L8:
	movl	%eax, %ebx
	subq	$1, %rax
	cmpq	%rdx, 8(%rbp,%rax,8)
	jg	.L8
.L7:
	leal	(%rsi,%rbx), %eax
	cmpl	%eax, %r8d
	cmovl	%eax, %r8d
	addq	$1, %rcx
	cmpl	%ecx, %r9d
	jge	.L9
.L6:
	movl	%r8d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%r12, %rdi
	call	free@PLT
	movq	%rbp, %rdi
	call	free@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L18
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L11:
	.cfi_restore_state
	xorl	%r8d, %r8d
	jmp	.L6
.L18:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.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.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	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	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rcx
	leaq	8(%rsp), %rdx
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rax
	leaq	1(,%rax,8), %rdi
	movq	%rax, %rbx
	call	malloc@PLT
	movq	$0, (%rax)
	movq	%rax, %r12
	testl	%ebx, %ebx
	jle	.L2
	movl	$1, %ebx
	leaq	16(%rsp), %r15
	leaq	.LC1(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r15, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	16(%rsp), %rax
	addq	-8(%r12,%rbx,8), %rax
	movq	%rax, (%r12,%rbx,8)
	addq	$1, %rbx
	cmpl	%ebx, 4(%rsp)
	jge	.L3
.L2:
	movslq	8(%rsp), %rax
	leaq	1(,%rax,8), %rdi
	movq	%rax, %rbx
	call	malloc@PLT
	movq	$0, (%rax)
	movq	%rax, %rbp
	testl	%ebx, %ebx
	jle	.L4
	movl	$1, %r13d
	leaq	16(%rsp), %r15
	leaq	.LC1(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r15, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	16(%rsp), %rax
	movl	8(%rsp), %ebx
	addq	-8(%rbp,%r13,8), %rax
	movq	%rax, 0(%rbp,%r13,8)
	addq	$1, %r13
	cmpl	%r13d, %ebx
	jge	.L5
.L4:
	movl	4(%rsp), %r9d
	testl	%r9d, %r9d
	js	.L11
	movslq	12(%rsp), %rdi
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	.p2align 4,,10
	.p2align 3
.L9:
	movq	(%r12,%rcx,8), %rax
	movl	%ecx, %esi
	cmpq	%rdi, %rax
	jg	.L6
	movq	%rdi, %rdx
	subq	%rax, %rdx
	movslq	%ebx, %rax
	cmpq	0(%rbp,%rax,8), %rdx
	jge	.L7
	leal	-1(%rbx), %eax
	cltq
	.p2align 4,,10
	.p2align 3
.L8:
	movl	%eax, %ebx
	subq	$1, %rax
	cmpq	%rdx, 8(%rbp,%rax,8)
	jg	.L8
.L7:
	leal	(%rsi,%rbx), %eax
	cmpl	%eax, %r8d
	cmovl	%eax, %r8d
	addq	$1, %rcx
	cmpl	%ecx, %r9d
	jge	.L9
.L6:
	movl	%r8d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%r12, %rdi
	call	free@PLT
	movq	%rbp, %rdi
	call	free@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L18
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L11:
	.cfi_restore_state
	xorl	%r8d, %r8d
	jmp	.L6
.L18:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.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:
```
rule
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	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	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rcx
	leaq	8(%rsp), %rdx
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rax
	leaq	1(,%rax,8), %rdi
	movq	%rax, %rbx
	call	malloc@PLT
	movq	$0, (%rax)
	movq	%rax, %r12
	testl	%ebx, %ebx
	jle	.L2
	movl	$1, %ebx
	leaq	16(%rsp), %r15
	leaq	.LC1(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r15, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	16(%rsp), %rax
	addq	-8(%r12,%rbx,8), %rax
	movq	%rax, (%r12,%rbx,8)
	addq	$1, %rbx
	cmpl	%ebx, 4(%rsp)
	jge	.L3
.L2:
	movslq	8(%rsp), %rax
	leaq	1(,%rax,8), %rdi
	movq	%rax, %rbx
	call	malloc@PLT
	movq	$0, (%rax)
	movq	%rax, %rbp
	testl	%ebx, %ebx
	jle	.L4
	movl	$1, %r13d
	leaq	16(%rsp), %r15
	leaq	.LC1(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r15, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	16(%rsp), %rax
	movl	8(%rsp), %ebx
	addq	-8(%rbp,%r13,8), %rax
	movq	%rax, 0(%rbp,%r13,8)
	addq	$1, %r13
	cmpl	%r13d, %ebx
	jge	.L5
.L4:
	movl	4(%rsp), %r9d
	testl	%r9d, %r9d
	js	.L11
	movslq	12(%rsp), %rdi
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	.p2align 4,,10
	.p2align 3
.L9:
	movq	(%r12,%rcx,8), %rax
	movl	%ecx, %esi
	cmpq	%rdi, %rax
	jg	.L6
	movq	%rdi, %rdx
	subq	%rax, %rdx
	movslq	%ebx, %rax
	cmpq	0(%rbp,%rax,8), %rdx
	jge	.L7
	leal	-1(%rbx), %eax
	cltq
	.p2align 4,,10
	.p2align 3
.L8:
	movl	%eax, %ebx
	subq	$1, %rax
	cmpq	%rdx, 8(%rbp,%rax,8)
	jg	.L8
.L7:
	leal	(%rsi,%rbx), %eax
	cmpl	%eax, %r8d
	cmovl	%eax, %r8d
	addq	$1, %rcx
	cmpl	%ecx, %r9d
	jge	.L9
.L6:
	movl	%r8d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%r12, %rdi
	call	free@PLT
	movq	%rbp, %rdi
	call	free@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L18
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L11:
	.cfi_restore_state
	xorl	%r8d, %r8d
	jmp	.L6
.L18:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.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:
```
```c
#include <stdio.h>
#include <stdlib.h>

int main(void)
{
    int n;
    int m;
    int k;
    scanf("%d %d %d", &n, &m, &k);

    long long int *a;
    long long int *b;
    long long int temp;
    int i;
    a = (long long int *)malloc(sizeof(long long int) * n + 1);
    a[0] = 0;
    for (i = 1; i < n + 1; i++)
    {
        scanf("%lld", &temp);
        a[i] = a[i - 1] + temp;
    }
    b = (long long int *)malloc(sizeof(long long int) * m + 1);
    b[0] = 0;
    for (i = 1; i < m + 1; i++)
    {
        scanf("%lld", &temp);
        b[i] = b[i - 1] + temp;
    }

    int answer = 0;
    int j = m;
    for (i = 0; i < n + 1; i++)
    {
        if (a[i] > k)
        {
            break;
        }
        while (b[j] > k - a[i])
        {
            j -= 1;
        }
        answer = answer > (i + j) ? answer : (i + j);
    }

    printf("%d\n", answer);

    free(a);
    free(b);
    return 0;
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

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

int main(void)
{
    int n;
    int m;
    int k;
    scanf("%d %d %d", &n, &m, &k);

    long long int *a;
    long long int *b;
    long long int temp;
    int i;
    a = (long long int *)malloc(sizeof(long long int) * n + 1);
    a[0] = 0;
    for (i = 1; i < n + 1; i++)
    {
        scanf("%lld", &temp);
        a[i] = a[i - 1] + temp;
    }
    b = (long long int *)malloc(sizeof(long long int) * m + 1);
    b[0] = 0;
    for (i = 1; i < m + 1; i++)
    {
        scanf("%lld", &temp);
        b[i] = b[i - 1] + temp;
    }

    int answer = 0;
    int j = m;
    for (i = 0; i < n + 1; i++)
    {
        if (a[i] > k)
        {
            break;
        }
        while (b[j] > k - a[i])
        {
            j -= 1;
        }
        answer = answer > (i + j) ? answer : (i + j);
    }

    printf("%d\n", answer);

    free(a);
    free(b);
    return 0;
}```

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.
Optimized Assembly Code:

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 assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

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

int main(void)
{
    int n;
    int m;
    int k;
    scanf("%d %d %d", &n, &m, &k);

    long long int *a;
    long long int *b;
    long long int temp;
    int i;
    a = (long long int *)malloc(sizeof(long long int) * n + 1);
    a[0] = 0;
    for (i = 1; i < n + 1; i++)
    {
        scanf("%lld", &temp);
        a[i] = a[i - 1] + temp;
    }
    b = (long long int *)malloc(sizeof(long long int) * m + 1);
    b[0] = 0;
    for (i = 1; i < m + 1; i++)
    {
        scanf("%lld", &temp);
        b[i] = b[i - 1] + temp;
    }

    int answer = 0;
    int j = m;
    for (i = 0; i < n + 1; i++)
    {
        if (a[i] > k)
        {
            break;
        }
        while (b[j] > k - a[i])
        {
            j -= 1;
        }
        answer = answer > (i + j) ? answer : (i + j);
    }

    printf("%d\n", answer);

    free(a);
    free(b);
    return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	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	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rcx
	leaq	8(%rsp), %rdx
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rax
	leaq	1(,%rax,8), %rdi
	movq	%rax, %rbx
	call	malloc@PLT
	movq	$0, (%rax)
	movq	%rax, %r12
	testl	%ebx, %ebx
	jle	.L2
	movl	$1, %ebx
	leaq	16(%rsp), %r15
	leaq	.LC1(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r15, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	16(%rsp), %rax
	addq	-8(%r12,%rbx,8), %rax
	movq	%rax, (%r12,%rbx,8)
	addq	$1, %rbx
	cmpl	%ebx, 4(%rsp)
	jge	.L3
.L2:
	movslq	8(%rsp), %rax
	leaq	1(,%rax,8), %rdi
	movq	%rax, %rbx
	call	malloc@PLT
	movq	$0, (%rax)
	movq	%rax, %rbp
	testl	%ebx, %ebx
	jle	.L4
	movl	$1, %r13d
	leaq	16(%rsp), %r15
	leaq	.LC1(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r15, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	16(%rsp), %rax
	movl	8(%rsp), %ebx
	addq	-8(%rbp,%r13,8), %rax
	movq	%rax, 0(%rbp,%r13,8)
	addq	$1, %r13
	cmpl	%r13d, %ebx
	jge	.L5
.L4:
	movl	4(%rsp), %r9d
	testl	%r9d, %r9d
	js	.L11
	movslq	12(%rsp), %rdi
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	.p2align 4,,10
	.p2align 3
.L9:
	movq	(%r12,%rcx,8), %rax
	movl	%ecx, %esi
	cmpq	%rdi, %rax
	jg	.L6
	movq	%rdi, %rdx
	subq	%rax, %rdx
	movslq	%ebx, %rax
	cmpq	0(%rbp,%rax,8), %rdx
	jge	.L7
	leal	-1(%rbx), %eax
	cltq
	.p2align 4,,10
	.p2align 3
.L8:
	movl	%eax, %ebx
	subq	$1, %rax
	cmpq	%rdx, 8(%rbp,%rax,8)
	jg	.L8
.L7:
	leal	(%rsi,%rbx), %eax
	cmpl	%eax, %r8d
	cmovl	%eax, %r8d
	addq	$1, %rcx
	cmpl	%ecx, %r9d
	jge	.L9
.L6:
	movl	%r8d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%r12, %rdi
	call	free@PLT
	movq	%rbp, %rdi
	call	free@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L18
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L11:
	.cfi_restore_state
	xorl	%r8d, %r8d
	jmp	.L6
.L18:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.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.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	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	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rcx
	leaq	8(%rsp), %rdx
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rax
	leaq	1(,%rax,8), %rdi
	movq	%rax, %rbx
	call	malloc@PLT
	movq	$0, (%rax)
	movq	%rax, %r12
	testl	%ebx, %ebx
	jle	.L2
	movl	$1, %ebx
	leaq	16(%rsp), %r15
	leaq	.LC1(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r15, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	16(%rsp), %rax
	addq	-8(%r12,%rbx,8), %rax
	movq	%rax, (%r12,%rbx,8)
	addq	$1, %rbx
	cmpl	%ebx, 4(%rsp)
	jge	.L3
.L2:
	movslq	8(%rsp), %rax
	leaq	1(,%rax,8), %rdi
	movq	%rax, %rbx
	call	malloc@PLT
	movq	$0, (%rax)
	movq	%rax, %rbp
	testl	%ebx, %ebx
	jle	.L4
	movl	$1, %r13d
	leaq	16(%rsp), %r15
	leaq	.LC1(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r15, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	16(%rsp), %rax
	movl	8(%rsp), %ebx
	addq	-8(%rbp,%r13,8), %rax
	movq	%rax, 0(%rbp,%r13,8)
	addq	$1, %r13
	cmpl	%r13d, %ebx
	jge	.L5
.L4:
	movl	4(%rsp), %r9d
	testl	%r9d, %r9d
	js	.L11
	movslq	12(%rsp), %rdi
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	.p2align 4,,10
	.p2align 3
.L9:
	movq	(%r12,%rcx,8), %rax
	movl	%ecx, %esi
	cmpq	%rdi, %rax
	jg	.L6
	movq	%rdi, %rdx
	subq	%rax, %rdx
	movslq	%ebx, %rax
	cmpq	0(%rbp,%rax,8), %rdx
	jge	.L7
	leal	-1(%rbx), %eax
	cltq
	.p2align 4,,10
	.p2align 3
.L8:
	movl	%eax, %ebx
	subq	$1, %rax
	cmpq	%rdx, 8(%rbp,%rax,8)
	jg	.L8
.L7:
	leal	(%rsi,%rbx), %eax
	cmpl	%eax, %r8d
	cmovl	%eax, %r8d
	addq	$1, %rcx
	cmpl	%ecx, %r9d
	jge	.L9
.L6:
	movl	%r8d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%r12, %rdi
	call	free@PLT
	movq	%rbp, %rdi
	call	free@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L18
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L11:
	.cfi_restore_state
	xorl	%r8d, %r8d
	jmp	.L6
.L18:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.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:
```