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 M 10
#define N 100
void printB(int n)
{
    int temp;
    while(n)
    {
        temp = n&1;
        n >>= 1;
        printf("%d",temp);
    }
}
int main()
{
    int n;
    scanf("%d",&n);
    unsigned int F[N];
    int P[N][M+1];
    int temp;
    for(int i=0;i<n;i++)
    {
        F[i] = 0;
        for(int j=0;j<M;j++)
        {
            F[i] <<= 1;
            scanf("%d",&temp);
            F[i]+=temp;
        }
    }
    for(int i=0;i<n;i++)
        for(int j=0;j<M+1;j++)
            scanf("%d",&P[i][j]);
    unsigned int times,t;
    int max = 0;
    for(int j=0;j<n;j++)
            max += P[j][F[j]&1];
    for(unsigned int i=1;i<1024;i++)
    {
        temp = 0;
        for(int j=0;j<n;j++)
        {
            t = F[j]&i;
            times = 0;
            while(t)
            {
                times += t&1;
                t >>= 1;
            }
            temp += P[j][times];
        }
        max = (max>temp)?max:temp;
    }
    printf("%d\n",max);
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	printB
	.type	printB, @function
printB:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	jmp	.L2
.L3:
	movl	-20(%rbp), %eax
	andl	$1, %eax
	movl	%eax, -4(%rbp)
	sarl	-20(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	cmpl	$0, -20(%rbp)
	jne	.L3
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	printB, .-printB
	.section	.rodata
.LC1:
	.string	"%d\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
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$768, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-4864(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -4856(%rbp)
	jmp	.L5
.L8:
	movl	-4856(%rbp), %eax
	cltq
	movl	$0, -4816(%rbp,%rax,4)
	movl	$0, -4852(%rbp)
	jmp	.L6
.L7:
	movl	-4856(%rbp), %eax
	cltq
	movl	-4816(%rbp,%rax,4), %eax
	leal	(%rax,%rax), %edx
	movl	-4856(%rbp), %eax
	cltq
	movl	%edx, -4816(%rbp,%rax,4)
	leaq	-4860(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-4856(%rbp), %eax
	cltq
	movl	-4816(%rbp,%rax,4), %edx
	movl	-4860(%rbp), %eax
	addl	%eax, %edx
	movl	-4856(%rbp), %eax
	cltq
	movl	%edx, -4816(%rbp,%rax,4)
	addl	$1, -4852(%rbp)
.L6:
	cmpl	$9, -4852(%rbp)
	jle	.L7
	addl	$1, -4856(%rbp)
.L5:
	movl	-4864(%rbp), %eax
	cmpl	%eax, -4856(%rbp)
	jl	.L8
	movl	$0, -4848(%rbp)
	jmp	.L9
.L12:
	movl	$0, -4844(%rbp)
	jmp	.L10
.L11:
	leaq	-4416(%rbp), %rcx
	movl	-4844(%rbp), %eax
	movslq	%eax, %rsi
	movl	-4848(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -4844(%rbp)
.L10:
	cmpl	$10, -4844(%rbp)
	jle	.L11
	addl	$1, -4848(%rbp)
.L9:
	movl	-4864(%rbp), %eax
	cmpl	%eax, -4848(%rbp)
	jl	.L12
	movl	$0, -4832(%rbp)
	movl	$0, -4828(%rbp)
	jmp	.L13
.L14:
	movl	-4828(%rbp), %eax
	cltq
	movl	-4816(%rbp,%rax,4), %eax
	andl	$1, %eax
	movl	%eax, %ecx
	movl	-4828(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	movl	-4416(%rbp,%rax,4), %eax
	addl	%eax, -4832(%rbp)
	addl	$1, -4828(%rbp)
.L13:
	movl	-4864(%rbp), %eax
	cmpl	%eax, -4828(%rbp)
	jl	.L14
	movl	$1, -4824(%rbp)
	jmp	.L15
.L20:
	movl	$0, -4860(%rbp)
	movl	$0, -4820(%rbp)
	jmp	.L16
.L19:
	movl	-4820(%rbp), %eax
	cltq
	movl	-4816(%rbp,%rax,4), %eax
	andl	-4824(%rbp), %eax
	movl	%eax, -4836(%rbp)
	movl	$0, -4840(%rbp)
	jmp	.L17
.L18:
	movl	-4836(%rbp), %eax
	andl	$1, %eax
	addl	%eax, -4840(%rbp)
	shrl	-4836(%rbp)
.L17:
	cmpl	$0, -4836(%rbp)
	jne	.L18
	movl	-4840(%rbp), %ecx
	movl	-4820(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	movl	-4416(%rbp,%rax,4), %edx
	movl	-4860(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -4860(%rbp)
	addl	$1, -4820(%rbp)
.L16:
	movl	-4864(%rbp), %eax
	cmpl	%eax, -4820(%rbp)
	jl	.L19
	movl	-4860(%rbp), %eax
	movl	-4832(%rbp), %edx
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	movl	%eax, -4832(%rbp)
	addl	$1, -4824(%rbp)
.L15:
	cmpl	$1023, -4824(%rbp)
	jbe	.L20
	movl	-4832(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.text
	.p2align 4
	.globl	printB
	.type	printB, @function
printB:
.LFB23:
	.cfi_startproc
	endbr64
	testl	%edi, %edi
	je	.L9
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movl	%edi, %ebx
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	.p2align 4,,10
	.p2align 3
.L3:
	movl	%ebx, %edx
	xorl	%eax, %eax
	sarl	%ebx
	movq	%rbp, %rsi
	andl	$1, %edx
	movl	$1, %edi
	call	__printf_chk@PLT
	testl	%ebx, %ebx
	jne	.L3
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	.cfi_restore 3
	.cfi_restore 6
	ret
	.cfi_endproc
.LFE23:
	.size	printB, .-printB
	.section	.rodata.str1.1
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.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	$4096, %rsp
	.cfi_def_cfa_offset 4152
	orq	$0, (%rsp)
	subq	$760, %rsp
	.cfi_def_cfa_offset 4912
	leaq	.LC0(%rip), %r12
	movq	%r12, %rdi
	movq	%fs:40, %rax
	movq	%rax, 4840(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %ebx
	testl	%ebx, %ebx
	jle	.L27
	movl	$0, 12(%rsp)
	leaq	32(%rsp), %r13
	leaq	28(%rsp), %r14
	movq	%r13, %rbp
.L16:
	movl	$10, %ebx
	xorl	%r15d, %r15d
	.p2align 4,,10
	.p2align 3
.L15:
	movq	%r14, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	leal	(%rax,%r15,2), %r15d
	movl	%r15d, 0(%rbp)
	subl	$1, %ebx
	jne	.L15
	addl	$1, 12(%rsp)
	movl	24(%rsp), %ebx
	addq	$4, %rbp
	movl	12(%rsp), %eax
	cmpl	%eax, %ebx
	jg	.L16
	testl	%ebx, %ebx
	jle	.L27
	leaq	476(%rsp), %rbp
	xorl	%r14d, %r14d
.L18:
	leaq	-44(%rbp), %rbx
	.p2align 4,,10
	.p2align 3
.L17:
	movq	%rbx, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__isoc99_scanf@PLT
	cmpq	%rbx, %rbp
	jne	.L17
	movl	24(%rsp), %ebx
	addq	$1, %r14
	addq	$44, %rbp
	cmpl	%r14d, %ebx
	jg	.L18
	testl	%ebx, %ebx
	jle	.L27
	movslq	%ebx, %rsi
	xorl	%eax, %eax
	xorl	%r12d, %r12d
.L20:
	movslq	%eax, %rdx
	movl	0(%r13,%rax,4), %ecx
	addq	$1, %rax
	leaq	(%rdx,%rdx,4), %rdi
	andl	$1, %ecx
	leaq	(%rdx,%rdi,2), %rdx
	addq	%rcx, %rdx
	addl	432(%rsp,%rdx,4), %r12d
	cmpq	%rax, %rsi
	jne	.L20
.L19:
	movl	$1, %r9d
	movslq	%ebx, %r11
	leaq	32(%rsp), %r10
	.p2align 4,,10
	.p2align 3
.L25:
	testl	%ebx, %ebx
	jle	.L28
	xorl	%esi, %esi
	xorl	%r8d, %r8d
	.p2align 4,,10
	.p2align 3
.L24:
	movl	%esi, %edi
	movl	%r9d, %eax
	andl	(%r10,%rsi,4), %eax
	je	.L29
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L23:
	movl	%eax, %ecx
	andl	$1, %ecx
	addl	%ecx, %edx
	shrl	%eax
	jne	.L23
.L22:
	movslq	%edi, %rax
	addq	$1, %rsi
	leaq	(%rax,%rax,4), %rcx
	leaq	(%rax,%rcx,2), %rax
	addq	%rdx, %rax
	addl	432(%rsp,%rax,4), %r8d
	cmpq	%r11, %rsi
	jne	.L24
.L21:
	cmpl	%r8d, %r12d
	cmovl	%r8d, %r12d
	addl	$1, %r9d
	cmpl	$1024, %r9d
	jne	.L25
	xorl	%eax, %eax
	movl	%r12d, %edx
	movl	$1, %edi
	movl	%r8d, 28(%rsp)
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	4840(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L40
	addq	$4856, %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
	.p2align 4,,10
	.p2align 3
.L29:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L22
.L28:
	xorl	%r8d, %r8d
	jmp	.L21
.L27:
	xorl	%r12d, %r12d
	jmp	.L19
.L40:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.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
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.text
	.p2align 4
	.globl	printB
	.type	printB, @function
printB:
.LFB23:
	.cfi_startproc
	endbr64
	testl	%edi, %edi
	je	.L9
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movl	%edi, %ebx
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	.p2align 4,,10
	.p2align 3
.L3:
	movl	%ebx, %edx
	xorl	%eax, %eax
	sarl	%ebx
	movq	%rbp, %rsi
	andl	$1, %edx
	movl	$1, %edi
	call	__printf_chk@PLT
	testl	%ebx, %ebx
	jne	.L3
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	.cfi_restore 3
	.cfi_restore 6
	ret
	.cfi_endproc
.LFE23:
	.size	printB, .-printB
	.section	.rodata.str1.1
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.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	$4096, %rsp
	.cfi_def_cfa_offset 4152
	orq	$0, (%rsp)
	subq	$760, %rsp
	.cfi_def_cfa_offset 4912
	leaq	.LC0(%rip), %r12
	movq	%r12, %rdi
	movq	%fs:40, %rax
	movq	%rax, 4840(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %ebx
	testl	%ebx, %ebx
	jle	.L27
	movl	$0, 12(%rsp)
	leaq	32(%rsp), %r13
	leaq	28(%rsp), %r14
	movq	%r13, %rbp
.L16:
	movl	$10, %ebx
	xorl	%r15d, %r15d
	.p2align 4,,10
	.p2align 3
.L15:
	movq	%r14, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	leal	(%rax,%r15,2), %r15d
	movl	%r15d, 0(%rbp)
	subl	$1, %ebx
	jne	.L15
	addl	$1, 12(%rsp)
	movl	24(%rsp), %ebx
	addq	$4, %rbp
	movl	12(%rsp), %eax
	cmpl	%eax, %ebx
	jg	.L16
	testl	%ebx, %ebx
	jle	.L27
	leaq	476(%rsp), %rbp
	xorl	%r14d, %r14d
.L18:
	leaq	-44(%rbp), %rbx
	.p2align 4,,10
	.p2align 3
.L17:
	movq	%rbx, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__isoc99_scanf@PLT
	cmpq	%rbx, %rbp
	jne	.L17
	movl	24(%rsp), %ebx
	addq	$1, %r14
	addq	$44, %rbp
	cmpl	%r14d, %ebx
	jg	.L18
	testl	%ebx, %ebx
	jle	.L27
	movslq	%ebx, %rsi
	xorl	%eax, %eax
	xorl	%r12d, %r12d
.L20:
	movslq	%eax, %rdx
	movl	0(%r13,%rax,4), %ecx
	addq	$1, %rax
	leaq	(%rdx,%rdx,4), %rdi
	andl	$1, %ecx
	leaq	(%rdx,%rdi,2), %rdx
	addq	%rcx, %rdx
	addl	432(%rsp,%rdx,4), %r12d
	cmpq	%rax, %rsi
	jne	.L20
.L19:
	movl	$1, %r9d
	movslq	%ebx, %r11
	leaq	32(%rsp), %r10
	.p2align 4,,10
	.p2align 3
.L25:
	testl	%ebx, %ebx
	jle	.L28
	xorl	%esi, %esi
	xorl	%r8d, %r8d
	.p2align 4,,10
	.p2align 3
.L24:
	movl	%esi, %edi
	movl	%r9d, %eax
	andl	(%r10,%rsi,4), %eax
	je	.L29
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L23:
	movl	%eax, %ecx
	andl	$1, %ecx
	addl	%ecx, %edx
	shrl	%eax
	jne	.L23
.L22:
	movslq	%edi, %rax
	addq	$1, %rsi
	leaq	(%rax,%rax,4), %rcx
	leaq	(%rax,%rcx,2), %rax
	addq	%rdx, %rax
	addl	432(%rsp,%rax,4), %r8d
	cmpq	%r11, %rsi
	jne	.L24
.L21:
	cmpl	%r8d, %r12d
	cmovl	%r8d, %r12d
	addl	$1, %r9d
	cmpl	$1024, %r9d
	jne	.L25
	xorl	%eax, %eax
	movl	%r12d, %edx
	movl	$1, %edi
	movl	%r8d, 28(%rsp)
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	4840(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L40
	addq	$4856, %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
	.p2align 4,,10
	.p2align 3
.L29:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L22
.L28:
	xorl	%r8d, %r8d
	jmp	.L21
.L27:
	xorl	%r12d, %r12d
	jmp	.L19
.L40:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.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:

#include<stdio.h>
#define M 10
#define N 100
void printB(int n)
{
    int temp;
    while(n)
    {
        temp = n&1;
        n >>= 1;
        printf("%d",temp);
    }
}
int main()
{
    int n;
    scanf("%d",&n);
    unsigned int F[N];
    int P[N][M+1];
    int temp;
    for(int i=0;i<n;i++)
    {
        F[i] = 0;
        for(int j=0;j<M;j++)
        {
            F[i] <<= 1;
            scanf("%d",&temp);
            F[i]+=temp;
        }
    }
    for(int i=0;i<n;i++)
        for(int j=0;j<M+1;j++)
            scanf("%d",&P[i][j]);
    unsigned int times,t;
    int max = 0;
    for(int j=0;j<n;j++)
            max += P[j][F[j]&1];
    for(unsigned int i=1;i<1024;i++)
    {
        temp = 0;
        for(int j=0;j<n;j++)
        {
            t = F[j]&i;
            times = 0;
            while(t)
            {
                times += t&1;
                t >>= 1;
            }
            temp += P[j][times];
        }
        max = (max>temp)?max:temp;
    }
    printf("%d\n",max);
}

2
1 1 1 1 1 0 0 0 0 0
0 0 0 0 0 1 1 1 1 1
0 -2 -2 -2 -2 -2 -1 -1 -1 -1 -1
0 -2 -2 -2 -1 -2 -1 -1 -1 -1 -1
 1
1 1 0 1 0 0 0 1 0 1
3 4 5 6 7 8 9 -4 -3 4 -2
 2
1 1 1 1 1 0 0 0 0 0
0 0 0 0 0 1 1 1 1 1
0 -2 -2 -2 -4 -2 -1 -1 -1 -1 -1
0 -2 -2 -2 -2 -2 -1 -1 -1 -1 -1
 2
1 1 1 1 1 0 0 0 0 0
0 0 0 0 0 1 1 1 1 1
0 -2 -2 -2 -2 -2 -1 -1 -1 -1 -1
0 0 -2 -2 -1 -2 -1 -1 -1 -1 -1
 1
1 1 0 1 0 1 0 1 0 1
3 4 5 6 7 8 10 -4 -3 4 -2
 1
1 1 0 1 0 0 0 1 0 1
3 4 5 11 7 8 9 -2 -3 4 -2
 3
1 1 1 1 1 1 0 0 1 0
0 1 0 1 1 1 1 0 1 0
1 0 1 1 0 1 0 1 0 1
-8 6 -2 -8 -8 4 8 7 -6 2 2
-9 2 0 1 7 -5 0 -2 -6 5 5
6 -6 7 -9 6 -5 8 0 -9 -7 -7
 2
1 1 1 1 1 0 0 0 0 0
0 0 0 0 0 1 1 1 1 1
1 -2 -2 -2 -2 -2 -1 -1 -1 -1 -1
0 0 -2 -2 -1 -2 -1 -1 -1 -1 -1
 1
1 1 0 1 0 0 0 1 0 0
3 1 5 6 7 8 9 -7 -3 4 -2
 1
1 1 0 1 1 0 0 1 0 1
4 4 5 12 7 8 10 -4 -3 4 -2

-1
 8
 -2
 0
 10
 11
 23
 1
 7
 12

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 M 10
#define N 100
void printB(int n)
{
    int temp;
    while(n)
    {
        temp = n&1;
        n >>= 1;
        printf("%d",temp);
    }
}
int main()
{
    int n;
    scanf("%d",&n);
    unsigned int F[N];
    int P[N][M+1];
    int temp;
    for(int i=0;i<n;i++)
    {
        F[i] = 0;
        for(int j=0;j<M;j++)
        {
            F[i] <<= 1;
            scanf("%d",&temp);
            F[i]+=temp;
        }
    }
    for(int i=0;i<n;i++)
        for(int j=0;j<M+1;j++)
            scanf("%d",&P[i][j]);
    unsigned int times,t;
    int max = 0;
    for(int j=0;j<n;j++)
            max += P[j][F[j]&1];
    for(unsigned int i=1;i<1024;i++)
    {
        temp = 0;
        for(int j=0;j<n;j++)
        {
            t = F[j]&i;
            times = 0;
            while(t)
            {
                times += t&1;
                t >>= 1;
            }
            temp += P[j][times];
        }
        max = (max>temp)?max:temp;
    }
    printf("%d\n",max);
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	printB
	.type	printB, @function
printB:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	jmp	.L2
.L3:
	movl	-20(%rbp), %eax
	andl	$1, %eax
	movl	%eax, -4(%rbp)
	sarl	-20(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	cmpl	$0, -20(%rbp)
	jne	.L3
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	printB, .-printB
	.section	.rodata
.LC1:
	.string	"%d\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
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$768, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-4864(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -4856(%rbp)
	jmp	.L5
.L8:
	movl	-4856(%rbp), %eax
	cltq
	movl	$0, -4816(%rbp,%rax,4)
	movl	$0, -4852(%rbp)
	jmp	.L6
.L7:
	movl	-4856(%rbp), %eax
	cltq
	movl	-4816(%rbp,%rax,4), %eax
	leal	(%rax,%rax), %edx
	movl	-4856(%rbp), %eax
	cltq
	movl	%edx, -4816(%rbp,%rax,4)
	leaq	-4860(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-4856(%rbp), %eax
	cltq
	movl	-4816(%rbp,%rax,4), %edx
	movl	-4860(%rbp), %eax
	addl	%eax, %edx
	movl	-4856(%rbp), %eax
	cltq
	movl	%edx, -4816(%rbp,%rax,4)
	addl	$1, -4852(%rbp)
.L6:
	cmpl	$9, -4852(%rbp)
	jle	.L7
	addl	$1, -4856(%rbp)
.L5:
	movl	-4864(%rbp), %eax
	cmpl	%eax, -4856(%rbp)
	jl	.L8
	movl	$0, -4848(%rbp)
	jmp	.L9
.L12:
	movl	$0, -4844(%rbp)
	jmp	.L10
.L11:
	leaq	-4416(%rbp), %rcx
	movl	-4844(%rbp), %eax
	movslq	%eax, %rsi
	movl	-4848(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -4844(%rbp)
.L10:
	cmpl	$10, -4844(%rbp)
	jle	.L11
	addl	$1, -4848(%rbp)
.L9:
	movl	-4864(%rbp), %eax
	cmpl	%eax, -4848(%rbp)
	jl	.L12
	movl	$0, -4832(%rbp)
	movl	$0, -4828(%rbp)
	jmp	.L13
.L14:
	movl	-4828(%rbp), %eax
	cltq
	movl	-4816(%rbp,%rax,4), %eax
	andl	$1, %eax
	movl	%eax, %ecx
	movl	-4828(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	movl	-4416(%rbp,%rax,4), %eax
	addl	%eax, -4832(%rbp)
	addl	$1, -4828(%rbp)
.L13:
	movl	-4864(%rbp), %eax
	cmpl	%eax, -4828(%rbp)
	jl	.L14
	movl	$1, -4824(%rbp)
	jmp	.L15
.L20:
	movl	$0, -4860(%rbp)
	movl	$0, -4820(%rbp)
	jmp	.L16
.L19:
	movl	-4820(%rbp), %eax
	cltq
	movl	-4816(%rbp,%rax,4), %eax
	andl	-4824(%rbp), %eax
	movl	%eax, -4836(%rbp)
	movl	$0, -4840(%rbp)
	jmp	.L17
.L18:
	movl	-4836(%rbp), %eax
	andl	$1, %eax
	addl	%eax, -4840(%rbp)
	shrl	-4836(%rbp)
.L17:
	cmpl	$0, -4836(%rbp)
	jne	.L18
	movl	-4840(%rbp), %ecx
	movl	-4820(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	movl	-4416(%rbp,%rax,4), %edx
	movl	-4860(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -4860(%rbp)
	addl	$1, -4820(%rbp)
.L16:
	movl	-4864(%rbp), %eax
	cmpl	%eax, -4820(%rbp)
	jl	.L19
	movl	-4860(%rbp), %eax
	movl	-4832(%rbp), %edx
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	movl	%eax, -4832(%rbp)
	addl	$1, -4824(%rbp)
.L15:
	cmpl	$1023, -4824(%rbp)
	jbe	.L20
	movl	-4832(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	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
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	printB
	.type	printB, @function
printB:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	jmp	.L2
.L3:
	movl	-20(%rbp), %eax
	andl	$1, %eax
	movl	%eax, -4(%rbp)
	sarl	-20(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	cmpl	$0, -20(%rbp)
	jne	.L3
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	printB, .-printB
	.section	.rodata
.LC1:
	.string	"%d\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
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$768, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-4864(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -4856(%rbp)
	jmp	.L5
.L8:
	movl	-4856(%rbp), %eax
	cltq
	movl	$0, -4816(%rbp,%rax,4)
	movl	$0, -4852(%rbp)
	jmp	.L6
.L7:
	movl	-4856(%rbp), %eax
	cltq
	movl	-4816(%rbp,%rax,4), %eax
	leal	(%rax,%rax), %edx
	movl	-4856(%rbp), %eax
	cltq
	movl	%edx, -4816(%rbp,%rax,4)
	leaq	-4860(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-4856(%rbp), %eax
	cltq
	movl	-4816(%rbp,%rax,4), %edx
	movl	-4860(%rbp), %eax
	addl	%eax, %edx
	movl	-4856(%rbp), %eax
	cltq
	movl	%edx, -4816(%rbp,%rax,4)
	addl	$1, -4852(%rbp)
.L6:
	cmpl	$9, -4852(%rbp)
	jle	.L7
	addl	$1, -4856(%rbp)
.L5:
	movl	-4864(%rbp), %eax
	cmpl	%eax, -4856(%rbp)
	jl	.L8
	movl	$0, -4848(%rbp)
	jmp	.L9
.L12:
	movl	$0, -4844(%rbp)
	jmp	.L10
.L11:
	leaq	-4416(%rbp), %rcx
	movl	-4844(%rbp), %eax
	movslq	%eax, %rsi
	movl	-4848(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -4844(%rbp)
.L10:
	cmpl	$10, -4844(%rbp)
	jle	.L11
	addl	$1, -4848(%rbp)
.L9:
	movl	-4864(%rbp), %eax
	cmpl	%eax, -4848(%rbp)
	jl	.L12
	movl	$0, -4832(%rbp)
	movl	$0, -4828(%rbp)
	jmp	.L13
.L14:
	movl	-4828(%rbp), %eax
	cltq
	movl	-4816(%rbp,%rax,4), %eax
	andl	$1, %eax
	movl	%eax, %ecx
	movl	-4828(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	movl	-4416(%rbp,%rax,4), %eax
	addl	%eax, -4832(%rbp)
	addl	$1, -4828(%rbp)
.L13:
	movl	-4864(%rbp), %eax
	cmpl	%eax, -4828(%rbp)
	jl	.L14
	movl	$1, -4824(%rbp)
	jmp	.L15
.L20:
	movl	$0, -4860(%rbp)
	movl	$0, -4820(%rbp)
	jmp	.L16
.L19:
	movl	-4820(%rbp), %eax
	cltq
	movl	-4816(%rbp,%rax,4), %eax
	andl	-4824(%rbp), %eax
	movl	%eax, -4836(%rbp)
	movl	$0, -4840(%rbp)
	jmp	.L17
.L18:
	movl	-4836(%rbp), %eax
	andl	$1, %eax
	addl	%eax, -4840(%rbp)
	shrl	-4836(%rbp)
.L17:
	cmpl	$0, -4836(%rbp)
	jne	.L18
	movl	-4840(%rbp), %ecx
	movl	-4820(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	movl	-4416(%rbp,%rax,4), %edx
	movl	-4860(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -4860(%rbp)
	addl	$1, -4820(%rbp)
.L16:
	movl	-4864(%rbp), %eax
	cmpl	%eax, -4820(%rbp)
	jl	.L19
	movl	-4860(%rbp), %eax
	movl	-4832(%rbp), %edx
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	movl	%eax, -4832(%rbp)
	addl	$1, -4824(%rbp)
.L15:
	cmpl	$1023, -4824(%rbp)
	jbe	.L20
	movl	-4832(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	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:
