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()
{
	int	N, M, C;
	int	A, *B;
	int	n, m, count, sum;

	m = 0;
	count = 0;
	scanf("%d %d %d\n", &N, &M, &C);
	B = (int *)malloc(sizeof(int) * (M + 1));
	while (m < M)
	{
		scanf("%d ", &B[m]);
		m++;
	}
	n = 0;
	while (n < N)
	{
		m = 0;
		sum = 0;
		while (m < M)
		{
			scanf("%d ", &A);
			sum += A * B[m];
			m++;
		}
		if ((sum + C) > 0)
			count++;
		n++;
	}
	printf("%d\n", count);
	return (0);
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d %d\n"
.LC1:
	.string	"%d "
.LC2:
	.string	"%d\n"
	.section	.text.unlikely,"ax",@progbits
.LCOLDB3:
	.section	.text.startup,"ax",@progbits
.LHOTB3:
	.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	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rcx
	leaq	32(%rsp), %rdx
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	32(%rsp), %r14d
	leal	1(%r14), %edi
	movslq	%edi, %rdi
	salq	$2, %rdi
	call	malloc@PLT
	movq	%rax, %r12
	testl	%r14d, %r14d
	jle	.L2
	movq	%rax, %rbp
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	32(%rsp), %r14d
	addq	$4, %rbp
	cmpl	%ebx, %r14d
	jg	.L3
.L2:
	movl	28(%rsp), %ecx
	movl	$0, 12(%rsp)
	leaq	.LC1(%rip), %r13
	movl	$0, 8(%rsp)
	testl	%ecx, %ecx
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	xorl	%r15d, %r15d
	xorl	%ebx, %ebx
	leaq	36(%rsp), %rbp
	movl	%r14d, %eax
	testl	%r14d, %r14d
	jle	.L19
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	(%r12,%r15,4), %eax
	imull	36(%rsp), %eax
	addq	$1, %r15
	addl	%eax, %ebx
	movl	32(%rsp), %eax
	cmpl	%r15d, %eax
	jg	.L6
	movl	28(%rsp), %ecx
.L19:
	movl	16(%rsp), %edx
	xorl	%esi, %esi
	addl	%edx, %ebx
	testl	%ebx, %ebx
	setg	%sil
	addl	$1, 8(%rsp)
	movl	8(%rsp), %edi
	addl	%esi, 12(%rsp)
	cmpl	%ecx, %edi
	jge	.L5
	testl	%r14d, %r14d
	jle	.L28
	movl	%eax, %r14d
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	movl	12(%rsp), %edx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L31
	addq	$56, %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
.L31:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
	.section	.text.unlikely
	.cfi_startproc
	.type	main.cold, @function
main.cold:
.LFSB39:
.L28:
	.cfi_def_cfa_offset 112
	.cfi_offset 3, -56
	.cfi_offset 6, -48
	.cfi_offset 12, -40
	.cfi_offset 13, -32
	.cfi_offset 14, -24
	.cfi_offset 15, -16
	movl	%ecx, %esi
	subl	8(%rsp), %esi
	leal	-1(%rsi), %eax
	cmpl	$2, %eax
	jbe	.L9
	movd	%edx, %xmm2
	pxor	%xmm0, %xmm0
	movl	%esi, %edi
	xorl	%eax, %eax
	pshufd	$0, %xmm2, %xmm1
	shrl	$2, %edi
	pcmpgtd	%xmm0, %xmm1
.L10:
	addl	$1, %eax
	psubd	%xmm1, %xmm0
	cmpl	%edi, %eax
	jne	.L10
	movdqa	%xmm0, %xmm1
	psrldq	$8, %xmm1
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	addl	%eax, 12(%rsp)
	movl	%esi, %eax
	andl	$-4, %eax
	addl	%eax, 8(%rsp)
	cmpl	%eax, %esi
	je	.L5
.L9:
	testl	%edx, %edx
	jle	.L5
	movl	8(%rsp), %edx
	movl	12(%rsp), %eax
	addl	$1, %edx
	addl	$1, %eax
	cmpl	%edx, %ecx
	jle	.L32
	movl	8(%rsp), %r15d
	movl	12(%rsp), %edx
	addl	$2, %r15d
	leal	2(%rdx), %eax
	addl	$3, %edx
	cmpl	%ecx, %r15d
	cmovl	%edx, %eax
	movl	%eax, 12(%rsp)
	jmp	.L5
.L32:
	movl	%eax, 12(%rsp)
	jmp	.L5
	.cfi_endproc
.LFE39:
	.section	.text.startup
	.size	main, .-main
	.section	.text.unlikely
	.size	main.cold, .-main.cold
.LCOLDE3:
	.section	.text.startup
.LHOTE3:
	.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\n"
.LC1:
	.string	"%d "
.LC2:
	.string	"%d\n"
	.section	.text.unlikely,"ax",@progbits
.LCOLDB3:
	.section	.text.startup,"ax",@progbits
.LHOTB3:
	.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	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rcx
	leaq	32(%rsp), %rdx
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	32(%rsp), %r14d
	leal	1(%r14), %edi
	movslq	%edi, %rdi
	salq	$2, %rdi
	call	malloc@PLT
	movq	%rax, %r12
	testl	%r14d, %r14d
	jle	.L2
	movq	%rax, %rbp
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	32(%rsp), %r14d
	addq	$4, %rbp
	cmpl	%ebx, %r14d
	jg	.L3
.L2:
	movl	28(%rsp), %ecx
	movl	$0, 12(%rsp)
	leaq	.LC1(%rip), %r13
	movl	$0, 8(%rsp)
	testl	%ecx, %ecx
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	xorl	%r15d, %r15d
	xorl	%ebx, %ebx
	leaq	36(%rsp), %rbp
	movl	%r14d, %eax
	testl	%r14d, %r14d
	jle	.L19
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	(%r12,%r15,4), %eax
	imull	36(%rsp), %eax
	addq	$1, %r15
	addl	%eax, %ebx
	movl	32(%rsp), %eax
	cmpl	%r15d, %eax
	jg	.L6
	movl	28(%rsp), %ecx
.L19:
	movl	16(%rsp), %edx
	xorl	%esi, %esi
	addl	%edx, %ebx
	testl	%ebx, %ebx
	setg	%sil
	addl	$1, 8(%rsp)
	movl	8(%rsp), %edi
	addl	%esi, 12(%rsp)
	cmpl	%ecx, %edi
	jge	.L5
	testl	%r14d, %r14d
	jle	.L28
	movl	%eax, %r14d
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	movl	12(%rsp), %edx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L31
	addq	$56, %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
.L31:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
	.section	.text.unlikely
	.cfi_startproc
	.type	main.cold, @function
main.cold:
.LFSB39:
.L28:
	.cfi_def_cfa_offset 112
	.cfi_offset 3, -56
	.cfi_offset 6, -48
	.cfi_offset 12, -40
	.cfi_offset 13, -32
	.cfi_offset 14, -24
	.cfi_offset 15, -16
	movl	%ecx, %esi
	subl	8(%rsp), %esi
	leal	-1(%rsi), %eax
	cmpl	$2, %eax
	jbe	.L9
	movd	%edx, %xmm2
	pxor	%xmm0, %xmm0
	movl	%esi, %edi
	xorl	%eax, %eax
	pshufd	$0, %xmm2, %xmm1
	shrl	$2, %edi
	pcmpgtd	%xmm0, %xmm1
.L10:
	addl	$1, %eax
	psubd	%xmm1, %xmm0
	cmpl	%edi, %eax
	jne	.L10
	movdqa	%xmm0, %xmm1
	psrldq	$8, %xmm1
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	addl	%eax, 12(%rsp)
	movl	%esi, %eax
	andl	$-4, %eax
	addl	%eax, 8(%rsp)
	cmpl	%eax, %esi
	je	.L5
.L9:
	testl	%edx, %edx
	jle	.L5
	movl	8(%rsp), %edx
	movl	12(%rsp), %eax
	addl	$1, %edx
	addl	$1, %eax
	cmpl	%edx, %ecx
	jle	.L32
	movl	8(%rsp), %r15d
	movl	12(%rsp), %edx
	addl	$2, %r15d
	leal	2(%rdx), %eax
	addl	$3, %edx
	cmpl	%ecx, %r15d
	cmovl	%edx, %eax
	movl	%eax, 12(%rsp)
	jmp	.L5
.L32:
	movl	%eax, 12(%rsp)
	jmp	.L5
	.cfi_endproc
.LFE39:
	.section	.text.startup
	.size	main, .-main
	.section	.text.unlikely
	.size	main.cold, .-main.cold
.LCOLDE3:
	.section	.text.startup
.LHOTE3:
	.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\n"
.LC1:
	.string	"%d "
.LC2:
	.string	"%d\n"
	.section	.text.unlikely,"ax",@progbits
.LCOLDB3:
	.section	.text.startup,"ax",@progbits
.LHOTB3:
	.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	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rcx
	leaq	32(%rsp), %rdx
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	32(%rsp), %r14d
	leal	1(%r14), %edi
	movslq	%edi, %rdi
	salq	$2, %rdi
	call	malloc@PLT
	movq	%rax, %r12
	testl	%r14d, %r14d
	jle	.L2
	movq	%rax, %rbp
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	32(%rsp), %r14d
	addq	$4, %rbp
	cmpl	%ebx, %r14d
	jg	.L3
.L2:
	movl	28(%rsp), %ecx
	movl	$0, 12(%rsp)
	leaq	.LC1(%rip), %r13
	movl	$0, 8(%rsp)
	testl	%ecx, %ecx
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	xorl	%r15d, %r15d
	xorl	%ebx, %ebx
	leaq	36(%rsp), %rbp
	movl	%r14d, %eax
	testl	%r14d, %r14d
	jle	.L19
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	(%r12,%r15,4), %eax
	imull	36(%rsp), %eax
	addq	$1, %r15
	addl	%eax, %ebx
	movl	32(%rsp), %eax
	cmpl	%r15d, %eax
	jg	.L6
	movl	28(%rsp), %ecx
.L19:
	movl	16(%rsp), %edx
	xorl	%esi, %esi
	addl	%edx, %ebx
	testl	%ebx, %ebx
	setg	%sil
	addl	$1, 8(%rsp)
	movl	8(%rsp), %edi
	addl	%esi, 12(%rsp)
	cmpl	%ecx, %edi
	jge	.L5
	testl	%r14d, %r14d
	jle	.L28
	movl	%eax, %r14d
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	movl	12(%rsp), %edx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L31
	addq	$56, %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
.L31:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
	.section	.text.unlikely
	.cfi_startproc
	.type	main.cold, @function
main.cold:
.LFSB39:
.L28:
	.cfi_def_cfa_offset 112
	.cfi_offset 3, -56
	.cfi_offset 6, -48
	.cfi_offset 12, -40
	.cfi_offset 13, -32
	.cfi_offset 14, -24
	.cfi_offset 15, -16
	movl	%ecx, %esi
	subl	8(%rsp), %esi
	leal	-1(%rsi), %eax
	cmpl	$2, %eax
	jbe	.L9
	movd	%edx, %xmm2
	pxor	%xmm0, %xmm0
	movl	%esi, %edi
	xorl	%eax, %eax
	pshufd	$0, %xmm2, %xmm1
	shrl	$2, %edi
	pcmpgtd	%xmm0, %xmm1
.L10:
	addl	$1, %eax
	psubd	%xmm1, %xmm0
	cmpl	%edi, %eax
	jne	.L10
	movdqa	%xmm0, %xmm1
	psrldq	$8, %xmm1
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	addl	%eax, 12(%rsp)
	movl	%esi, %eax
	andl	$-4, %eax
	addl	%eax, 8(%rsp)
	cmpl	%eax, %esi
	je	.L5
.L9:
	testl	%edx, %edx
	jle	.L5
	movl	8(%rsp), %edx
	movl	12(%rsp), %eax
	addl	$1, %edx
	addl	$1, %eax
	cmpl	%edx, %ecx
	jle	.L32
	movl	8(%rsp), %r15d
	movl	12(%rsp), %edx
	addl	$2, %r15d
	leal	2(%rdx), %eax
	addl	$3, %edx
	cmpl	%ecx, %r15d
	cmovl	%edx, %eax
	movl	%eax, 12(%rsp)
	jmp	.L5
.L32:
	movl	%eax, 12(%rsp)
	jmp	.L5
	.cfi_endproc
.LFE39:
	.section	.text.startup
	.size	main, .-main
	.section	.text.unlikely
	.size	main.cold, .-main.cold
.LCOLDE3:
	.section	.text.startup
.LHOTE3:
	.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()
{
	int	N, M, C;
	int	A, *B;
	int	n, m, count, sum;

	m = 0;
	count = 0;
	scanf("%d %d %d\n", &N, &M, &C);
	B = (int *)malloc(sizeof(int) * (M + 1));
	while (m < M)
	{
		scanf("%d ", &B[m]);
		m++;
	}
	n = 0;
	while (n < N)
	{
		m = 0;
		sum = 0;
		while (m < M)
		{
			scanf("%d ", &A);
			sum += A * B[m];
			m++;
		}
		if ((sum + C) > 0)
			count++;
		n++;
	}
	printf("%d\n", count);
	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()
{
	int	N, M, C;
	int	A, *B;
	int	n, m, count, sum;

	m = 0;
	count = 0;
	scanf("%d %d %d\n", &N, &M, &C);
	B = (int *)malloc(sizeof(int) * (M + 1));
	while (m < M)
	{
		scanf("%d ", &B[m]);
		m++;
	}
	n = 0;
	while (n < N)
	{
		m = 0;
		sum = 0;
		while (m < M)
		{
			scanf("%d ", &A);
			sum += A * B[m];
			m++;
		}
		if ((sum + C) > 0)
			count++;
		n++;
	}
	printf("%d\n", count);
	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:

3 3 0
100 -100 0
0 100 101
100 100 100
-100 100 100
 5 2 -4
-2 5
100 41
100 40
-4 0
-6 -2
18 -13
 3 3 0
101 -100 0
0 100 101
100 100 100
-100 100 100
 5 2 -4
-2 5
100 41
001 40
-3 1
-6 -2
18 -13
 2 3 -10
1 2 3
3 2 1
1 1 2
 5 2 -4
-2 5
100 41
100 40
-4 -1
-6 -2
18 -13
 2 3 -10
1 2 3
3 2 1
1 1 1
 3 3 0
101 -100 0
-1 100 101
100 100 100
-100 100 100
 2 2 -4
-2 5
100 41
100 40
-4 -1
-6 -2
18 -13
 2 3 -11
1 2 3
3 2 1
1 1 1

0
 2
 1
 3
 0
 1
 0
 1
 1
 0

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()
{
	int	N, M, C;
	int	A, *B;
	int	n, m, count, sum;

	m = 0;
	count = 0;
	scanf("%d %d %d\n", &N, &M, &C);
	B = (int *)malloc(sizeof(int) * (M + 1));
	while (m < M)
	{
		scanf("%d ", &B[m]);
		m++;
	}
	n = 0;
	while (n < N)
	{
		m = 0;
		sum = 0;
		while (m < M)
		{
			scanf("%d ", &A);
			sum += A * B[m];
			m++;
		}
		if ((sum + C) > 0)
			count++;
		n++;
	}
	printf("%d\n", count);
	return (0);
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d %d\n"
.LC1:
	.string	"%d "
.LC2:
	.string	"%d\n"
	.section	.text.unlikely,"ax",@progbits
.LCOLDB3:
	.section	.text.startup,"ax",@progbits
.LHOTB3:
	.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	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rcx
	leaq	32(%rsp), %rdx
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	32(%rsp), %r14d
	leal	1(%r14), %edi
	movslq	%edi, %rdi
	salq	$2, %rdi
	call	malloc@PLT
	movq	%rax, %r12
	testl	%r14d, %r14d
	jle	.L2
	movq	%rax, %rbp
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	32(%rsp), %r14d
	addq	$4, %rbp
	cmpl	%ebx, %r14d
	jg	.L3
.L2:
	movl	28(%rsp), %ecx
	movl	$0, 12(%rsp)
	leaq	.LC1(%rip), %r13
	movl	$0, 8(%rsp)
	testl	%ecx, %ecx
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	xorl	%r15d, %r15d
	xorl	%ebx, %ebx
	leaq	36(%rsp), %rbp
	movl	%r14d, %eax
	testl	%r14d, %r14d
	jle	.L19
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	(%r12,%r15,4), %eax
	imull	36(%rsp), %eax
	addq	$1, %r15
	addl	%eax, %ebx
	movl	32(%rsp), %eax
	cmpl	%r15d, %eax
	jg	.L6
	movl	28(%rsp), %ecx
.L19:
	movl	16(%rsp), %edx
	xorl	%esi, %esi
	addl	%edx, %ebx
	testl	%ebx, %ebx
	setg	%sil
	addl	$1, 8(%rsp)
	movl	8(%rsp), %edi
	addl	%esi, 12(%rsp)
	cmpl	%ecx, %edi
	jge	.L5
	testl	%r14d, %r14d
	jle	.L28
	movl	%eax, %r14d
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	movl	12(%rsp), %edx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L31
	addq	$56, %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
.L31:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
	.section	.text.unlikely
	.cfi_startproc
	.type	main.cold, @function
main.cold:
.LFSB39:
.L28:
	.cfi_def_cfa_offset 112
	.cfi_offset 3, -56
	.cfi_offset 6, -48
	.cfi_offset 12, -40
	.cfi_offset 13, -32
	.cfi_offset 14, -24
	.cfi_offset 15, -16
	movl	%ecx, %esi
	subl	8(%rsp), %esi
	leal	-1(%rsi), %eax
	cmpl	$2, %eax
	jbe	.L9
	movd	%edx, %xmm2
	pxor	%xmm0, %xmm0
	movl	%esi, %edi
	xorl	%eax, %eax
	pshufd	$0, %xmm2, %xmm1
	shrl	$2, %edi
	pcmpgtd	%xmm0, %xmm1
.L10:
	addl	$1, %eax
	psubd	%xmm1, %xmm0
	cmpl	%edi, %eax
	jne	.L10
	movdqa	%xmm0, %xmm1
	psrldq	$8, %xmm1
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	addl	%eax, 12(%rsp)
	movl	%esi, %eax
	andl	$-4, %eax
	addl	%eax, 8(%rsp)
	cmpl	%eax, %esi
	je	.L5
.L9:
	testl	%edx, %edx
	jle	.L5
	movl	8(%rsp), %edx
	movl	12(%rsp), %eax
	addl	$1, %edx
	addl	$1, %eax
	cmpl	%edx, %ecx
	jle	.L32
	movl	8(%rsp), %r15d
	movl	12(%rsp), %edx
	addl	$2, %r15d
	leal	2(%rdx), %eax
	addl	$3, %edx
	cmpl	%ecx, %r15d
	cmovl	%edx, %eax
	movl	%eax, 12(%rsp)
	jmp	.L5
.L32:
	movl	%eax, 12(%rsp)
	jmp	.L5
	.cfi_endproc
.LFE39:
	.section	.text.startup
	.size	main, .-main
	.section	.text.unlikely
	.size	main.cold, .-main.cold
.LCOLDE3:
	.section	.text.startup
.LHOTE3:
	.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\n"
.LC1:
	.string	"%d "
.LC2:
	.string	"%d\n"
	.section	.text.unlikely,"ax",@progbits
.LCOLDB3:
	.section	.text.startup,"ax",@progbits
.LHOTB3:
	.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	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rcx
	leaq	32(%rsp), %rdx
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	32(%rsp), %r14d
	leal	1(%r14), %edi
	movslq	%edi, %rdi
	salq	$2, %rdi
	call	malloc@PLT
	movq	%rax, %r12
	testl	%r14d, %r14d
	jle	.L2
	movq	%rax, %rbp
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	32(%rsp), %r14d
	addq	$4, %rbp
	cmpl	%ebx, %r14d
	jg	.L3
.L2:
	movl	28(%rsp), %ecx
	movl	$0, 12(%rsp)
	leaq	.LC1(%rip), %r13
	movl	$0, 8(%rsp)
	testl	%ecx, %ecx
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	xorl	%r15d, %r15d
	xorl	%ebx, %ebx
	leaq	36(%rsp), %rbp
	movl	%r14d, %eax
	testl	%r14d, %r14d
	jle	.L19
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	(%r12,%r15,4), %eax
	imull	36(%rsp), %eax
	addq	$1, %r15
	addl	%eax, %ebx
	movl	32(%rsp), %eax
	cmpl	%r15d, %eax
	jg	.L6
	movl	28(%rsp), %ecx
.L19:
	movl	16(%rsp), %edx
	xorl	%esi, %esi
	addl	%edx, %ebx
	testl	%ebx, %ebx
	setg	%sil
	addl	$1, 8(%rsp)
	movl	8(%rsp), %edi
	addl	%esi, 12(%rsp)
	cmpl	%ecx, %edi
	jge	.L5
	testl	%r14d, %r14d
	jle	.L28
	movl	%eax, %r14d
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	movl	12(%rsp), %edx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L31
	addq	$56, %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
.L31:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
	.section	.text.unlikely
	.cfi_startproc
	.type	main.cold, @function
main.cold:
.LFSB39:
.L28:
	.cfi_def_cfa_offset 112
	.cfi_offset 3, -56
	.cfi_offset 6, -48
	.cfi_offset 12, -40
	.cfi_offset 13, -32
	.cfi_offset 14, -24
	.cfi_offset 15, -16
	movl	%ecx, %esi
	subl	8(%rsp), %esi
	leal	-1(%rsi), %eax
	cmpl	$2, %eax
	jbe	.L9
	movd	%edx, %xmm2
	pxor	%xmm0, %xmm0
	movl	%esi, %edi
	xorl	%eax, %eax
	pshufd	$0, %xmm2, %xmm1
	shrl	$2, %edi
	pcmpgtd	%xmm0, %xmm1
.L10:
	addl	$1, %eax
	psubd	%xmm1, %xmm0
	cmpl	%edi, %eax
	jne	.L10
	movdqa	%xmm0, %xmm1
	psrldq	$8, %xmm1
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	addl	%eax, 12(%rsp)
	movl	%esi, %eax
	andl	$-4, %eax
	addl	%eax, 8(%rsp)
	cmpl	%eax, %esi
	je	.L5
.L9:
	testl	%edx, %edx
	jle	.L5
	movl	8(%rsp), %edx
	movl	12(%rsp), %eax
	addl	$1, %edx
	addl	$1, %eax
	cmpl	%edx, %ecx
	jle	.L32
	movl	8(%rsp), %r15d
	movl	12(%rsp), %edx
	addl	$2, %r15d
	leal	2(%rdx), %eax
	addl	$3, %edx
	cmpl	%ecx, %r15d
	cmovl	%edx, %eax
	movl	%eax, 12(%rsp)
	jmp	.L5
.L32:
	movl	%eax, 12(%rsp)
	jmp	.L5
	.cfi_endproc
.LFE39:
	.section	.text.startup
	.size	main, .-main
	.section	.text.unlikely
	.size	main.cold, .-main.cold
.LCOLDE3:
	.section	.text.startup
.LHOTE3:
	.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:
```