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>
int N,M,X;
int C[20],A[20][20],D[20];
int min_S=-1;
void f(int p,int S){
  int c=1;
  for(int i=1;i<=M;i++){
    if(D[i]<X) c=0;
  }
  if(c==1){
    if(min_S<0 || S<min_S){
      min_S=S;
      return;
    }
  }
  for(int i=p+1;i<=N;i++){
    for(int j=1;j<=M;j++){
      D[j]+=A[i][j];
    }
    f(i,S+C[i]);
    for(int j=1;j<=N;j++){
      D[j]-=A[i][j];
    }
  }
  return;
}
int main(){
  scanf("%d %d %d",&N,&M,&X);
  for(int i=1;i<=N;i++){
    scanf("%d",C+i);
    D[i]=0;
    for(int j=1;j<=M;j++){
      scanf("%d",&A[i][j]);
    }
  }
  f(0,0);
  printf("%d\n",min_S);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	M
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	X
	.align 4
	.type	X, @object
	.size	X, 4
X:
	.zero	4
	.globl	C
	.align 32
	.type	C, @object
	.size	C, 80
C:
	.zero	80
	.globl	A
	.align 32
	.type	A, @object
	.size	A, 1600
A:
	.zero	1600
	.globl	D
	.align 32
	.type	D, @object
	.size	D, 80
D:
	.zero	80
	.globl	min_S
	.data
	.align 4
	.type	min_S, @object
	.size	min_S, 4
min_S:
	.long	-1
	.text
	.globl	f
	.type	f, @function
f:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movl	%edi, -36(%rbp)
	movl	%esi, -40(%rbp)
	movl	$1, -20(%rbp)
	movl	$1, -16(%rbp)
	jmp	.L2
.L4:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	D(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	X(%rip), %eax
	cmpl	%eax, %edx
	jge	.L3
	movl	$0, -20(%rbp)
.L3:
	addl	$1, -16(%rbp)
.L2:
	movl	M(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L4
	cmpl	$1, -20(%rbp)
	jne	.L5
	movl	min_S(%rip), %eax
	testl	%eax, %eax
	js	.L6
	movl	min_S(%rip), %eax
	cmpl	%eax, -40(%rbp)
	jge	.L5
.L6:
	movl	-40(%rbp), %eax
	movl	%eax, min_S(%rip)
	jmp	.L1
.L5:
	movl	-36(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -12(%rbp)
	jmp	.L8
.L13:
	movl	$1, -8(%rbp)
	jmp	.L9
.L10:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	D(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-8(%rbp), %eax
	movslq	%eax, %rsi
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	D(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -8(%rbp)
.L9:
	movl	M(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jle	.L10
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	C(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-40(%rbp), %eax
	addl	%eax, %edx
	movl	-12(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	f
	movl	$1, -4(%rbp)
	jmp	.L11
.L12:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	D(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-4(%rbp), %eax
	movslq	%eax, %rsi
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	%eax, %ecx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	D(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -4(%rbp)
.L11:
	movl	N(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L12
	addl	$1, -12(%rbp)
.L8:
	movl	N(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L13
	nop
.L1:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	f, .-f
	.section	.rodata
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"%d"
.LC2:
	.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	$16, %rsp
	leaq	X(%rip), %rax
	movq	%rax, %rcx
	leaq	M(%rip), %rax
	movq	%rax, %rdx
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -8(%rbp)
	jmp	.L15
.L18:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	C(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	D(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	$1, -4(%rbp)
	jmp	.L16
.L17:
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %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
	addl	$1, -4(%rbp)
.L16:
	movl	M(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L17
	addl	$1, -8(%rbp)
.L15:
	movl	N(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jle	.L18
	movl	$0, %esi
	movl	$0, %edi
	call	f
	movl	min_S(%rip), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.p2align 4
	.globl	f
	.type	f, @function
f:
.LFB23:
	.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
	movl	%edi, %r14d
	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	$24, %rsp
	.cfi_def_cfa_offset 80
	movl	M(%rip), %edi
	movl	%esi, 12(%rsp)
	testl	%edi, %edi
	jle	.L2
	leal	-1(%rdi), %eax
	movl	X(%rip), %ecx
	cmpl	$2, %eax
	jbe	.L28
	movd	%ecx, %xmm3
	movdqu	4+D(%rip), %xmm4
	movl	%edi, %eax
	pshufd	$0, %xmm3, %xmm1
	shrl	$2, %eax
	movdqa	%xmm1, %xmm0
	pcmpgtd	%xmm4, %xmm0
	pandn	.LC0(%rip), %xmm0
	cmpl	$1, %eax
	je	.L4
	movdqu	20+D(%rip), %xmm7
	movdqa	%xmm1, %xmm2
	pcmpgtd	%xmm7, %xmm2
	pandn	%xmm0, %xmm2
	movdqa	%xmm2, %xmm0
	cmpl	$2, %eax
	je	.L4
	movdqu	36+D(%rip), %xmm5
	movdqa	%xmm1, %xmm2
	pcmpgtd	%xmm5, %xmm2
	pandn	%xmm0, %xmm2
	movdqa	%xmm2, %xmm0
	cmpl	$3, %eax
	je	.L4
	movdqu	52+D(%rip), %xmm6
	pcmpgtd	%xmm6, %xmm1
	pandn	%xmm2, %xmm1
	movdqa	%xmm1, %xmm0
.L4:
	movdqa	%xmm0, %xmm2
	movl	%edi, %esi
	psrldq	$8, %xmm2
	andl	$-4, %esi
	movdqa	%xmm2, %xmm1
	leal	1(%rsi), %edx
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm1, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm0, %xmm1
	movd	%xmm1, %eax
	cmpl	%esi, %edi
	je	.L5
.L3:
	movslq	%edx, %r8
	leaq	D(%rip), %rsi
	addl	$1, %edx
	cmpl	(%rsi,%r8,4), %ecx
	jg	.L6
	cmpl	%edx, %edi
	jl	.L5
.L27:
	movslq	%edx, %r8
	cmpl	(%rsi,%r8,4), %ecx
	jg	.L7
	addl	$1, %edx
	cmpl	%edx, %edi
	jl	.L5
	movslq	%edx, %rdx
	cmpl	(%rsi,%rdx,4), %ecx
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L7:
	addl	$1, %r14d
	cmpl	N(%rip), %r14d
	jg	.L1
	movslq	%r14d, %r14
	leaq	A(%rip), %r13
	leaq	D(%rip), %r12
	leaq	(%r14,%r14,4), %rcx
	movl	%r14d, %ebx
	movq	%rcx, %rax
	leaq	0(,%rcx,4), %rbp
	salq	$4, %rax
	leaq	4(%r13,%rax), %r15
	testl	%edi, %edi
	jle	.L26
	leal	-1(%rdi), %eax
	cmpl	$2, %eax
	jbe	.L29
.L69:
	movdqu	(%r15), %xmm0
	movdqu	4+D(%rip), %xmm3
	movl	%edi, %eax
	shrl	$2, %eax
	paddd	%xmm3, %xmm0
	movups	%xmm0, 4+D(%rip)
	cmpl	$1, %eax
	je	.L13
	movdqu	20+D(%rip), %xmm0
	movdqu	16(%r15), %xmm5
	paddd	%xmm5, %xmm0
	movups	%xmm0, 20+D(%rip)
	cmpl	$2, %eax
	je	.L13
	movdqu	36+D(%rip), %xmm0
	movdqu	32(%r15), %xmm7
	paddd	%xmm7, %xmm0
	movups	%xmm0, 36+D(%rip)
	cmpl	$3, %eax
	je	.L13
	movdqu	52+D(%rip), %xmm0
	movdqu	48(%r15), %xmm5
	paddd	%xmm5, %xmm0
	movups	%xmm0, 52+D(%rip)
.L13:
	movl	%edi, %esi
	andl	$-4, %esi
	leal	1(%rsi), %eax
	cmpl	%esi, %edi
	je	.L26
.L12:
	subl	%esi, %edi
	cmpl	$1, %edi
	je	.L15
	leaq	4(%r12,%rsi,4), %r8
	leaq	1(%rsi,%rbp), %rsi
	movq	0(%r13,%rsi,4), %xmm0
	movq	(%r8), %xmm1
	movl	%edi, %esi
	andl	$-2, %esi
	paddd	%xmm1, %xmm0
	addl	%esi, %eax
	movq	%xmm0, (%r8)
	cmpl	%esi, %edi
	je	.L26
.L15:
	movslq	%ebx, %rsi
	cltq
	leaq	(%rsi,%rsi,4), %rsi
	leaq	(%rax,%rsi,4), %rsi
	movl	0(%r13,%rsi,4), %esi
	addl	%esi, (%r12,%rax,4)
.L26:
	leaq	C(%rip), %rax
	movl	12(%rsp), %esi
	movl	%ebx, %edi
	addl	(%rax,%r14,4), %esi
	call	f
	movl	N(%rip), %edi
	testl	%edi, %edi
	jle	.L21
	leal	-1(%rdi), %eax
	cmpl	$2, %eax
	jbe	.L30
	movdqu	4+D(%rip), %xmm0
	movdqu	(%r15), %xmm4
	movl	%edi, %eax
	shrl	$2, %eax
	psubd	%xmm4, %xmm0
	movups	%xmm0, 4+D(%rip)
	cmpl	$1, %eax
	je	.L20
	movdqu	20+D(%rip), %xmm0
	movdqu	16(%r15), %xmm6
	psubd	%xmm6, %xmm0
	movups	%xmm0, 20+D(%rip)
	cmpl	$2, %eax
	je	.L20
	movdqu	36+D(%rip), %xmm0
	movdqu	32(%r15), %xmm7
	psubd	%xmm7, %xmm0
	movups	%xmm0, 36+D(%rip)
	cmpl	$3, %eax
	je	.L20
	movdqu	52+D(%rip), %xmm0
	movdqu	48(%r15), %xmm6
	psubd	%xmm6, %xmm0
	movups	%xmm0, 52+D(%rip)
.L20:
	movl	%edi, %esi
	andl	$-4, %esi
	leal	1(%rsi), %eax
	cmpl	%esi, %edi
	je	.L21
.L19:
	movl	%edi, %r8d
	subl	%esi, %r8d
	cmpl	$1, %r8d
	je	.L23
	leaq	4(%r12,%rsi,4), %r9
	leaq	1(%rsi,%rbp), %rsi
	movq	0(%r13,%rsi,4), %xmm1
	movq	(%r9), %xmm0
	movl	%r8d, %esi
	andl	$-2, %esi
	psubd	%xmm1, %xmm0
	addl	%esi, %eax
	movq	%xmm0, (%r9)
	cmpl	%esi, %r8d
	je	.L21
.L23:
	movslq	%ebx, %rdx
	cltq
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%rax,%rdx,4), %rsi
	movl	(%r12,%rax,4), %edx
	subl	0(%r13,%rsi,4), %edx
	movl	%edx, (%r12,%rax,4)
.L21:
	addq	$1, %r14
	addq	$80, %r15
	addq	$20, %rbp
	cmpl	%r14d, %edi
	jl	.L1
	movl	M(%rip), %edi
	movl	%r14d, %ebx
	testl	%edi, %edi
	jle	.L26
	leal	-1(%rdi), %eax
	cmpl	$2, %eax
	ja	.L69
.L29:
	xorl	%esi, %esi
	movl	$1, %eax
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L5:
	cmpl	$1, %eax
	jne	.L7
.L2:
	movl	min_S(%rip), %eax
	cmpl	12(%rsp), %eax
	jg	.L32
	testl	%eax, %eax
	jns	.L7
.L32:
	movl	12(%rsp), %eax
	movl	%eax, min_S(%rip)
.L1:
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L6:
	.cfi_restore_state
	xorl	%eax, %eax
	cmpl	%edx, %edi
	jge	.L27
	jmp	.L7
.L30:
	xorl	%esi, %esi
	movl	$1, %eax
	jmp	.L19
.L28:
	movl	$1, %edx
	movl	$1, %eax
	jmp	.L3
	.cfi_endproc
.LFE23:
	.size	f, .-f
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d %d %d"
.LC2:
	.string	"%d\n"
.LC3:
	.string	"%d"
	.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
	leaq	M(%rip), %rdx
	xorl	%eax, %eax
	leaq	X(%rip), %rcx
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	N(%rip), %rsi
	leaq	.LC1(%rip), %rdi
	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	$8, %rsp
	.cfi_def_cfa_offset 64
	call	__isoc99_scanf@PLT
	movl	N(%rip), %edx
	testl	%edx, %edx
	jle	.L74
	leaq	84+A(%rip), %r13
	movl	$1, %r12d
	leaq	C(%rip), %r15
	leaq	.LC3(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L73:
	leaq	(%r15,%r12,4), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	movq	%r13, %r14
	call	__isoc99_scanf@PLT
	leaq	D(%rip), %rax
	movl	$1, %ebx
	movl	$0, (%rax,%r12,4)
	movl	M(%rip), %eax
	testl	%eax, %eax
	jle	.L75
	.p2align 4,,10
	.p2align 3
.L72:
	movq	%r14, %rsi
	xorl	%eax, %eax
	movq	%rbp, %rdi
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	addq	$4, %r14
	cmpl	%ebx, M(%rip)
	jge	.L72
.L75:
	addq	$1, %r12
	addq	$80, %r13
	cmpl	%r12d, N(%rip)
	jge	.L73
.L74:
	xorl	%esi, %esi
	xorl	%edi, %edi
	call	f
	movl	min_S(%rip), %edx
	leaq	.LC2(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	addq	$8, %rsp
	.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
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	min_S
	.data
	.align 4
	.type	min_S, @object
	.size	min_S, 4
min_S:
	.long	-1
	.globl	D
	.bss
	.align 32
	.type	D, @object
	.size	D, 80
D:
	.zero	80
	.globl	A
	.align 32
	.type	A, @object
	.size	A, 1600
A:
	.zero	1600
	.globl	C
	.align 32
	.type	C, @object
	.size	C, 80
C:
	.zero	80
	.globl	X
	.align 4
	.type	X, @object
	.size	X, 4
X:
	.zero	4
	.globl	M
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	1
	.long	1
	.long	1
	.long	1
	.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	f
	.type	f, @function
f:
.LFB23:
	.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
	movl	%edi, %r14d
	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	$24, %rsp
	.cfi_def_cfa_offset 80
	movl	M(%rip), %edi
	movl	%esi, 12(%rsp)
	testl	%edi, %edi
	jle	.L2
	leal	-1(%rdi), %eax
	movl	X(%rip), %ecx
	cmpl	$2, %eax
	jbe	.L28
	movd	%ecx, %xmm3
	movdqu	4+D(%rip), %xmm4
	movl	%edi, %eax
	pshufd	$0, %xmm3, %xmm1
	shrl	$2, %eax
	movdqa	%xmm1, %xmm0
	pcmpgtd	%xmm4, %xmm0
	pandn	.LC0(%rip), %xmm0
	cmpl	$1, %eax
	je	.L4
	movdqu	20+D(%rip), %xmm7
	movdqa	%xmm1, %xmm2
	pcmpgtd	%xmm7, %xmm2
	pandn	%xmm0, %xmm2
	movdqa	%xmm2, %xmm0
	cmpl	$2, %eax
	je	.L4
	movdqu	36+D(%rip), %xmm5
	movdqa	%xmm1, %xmm2
	pcmpgtd	%xmm5, %xmm2
	pandn	%xmm0, %xmm2
	movdqa	%xmm2, %xmm0
	cmpl	$3, %eax
	je	.L4
	movdqu	52+D(%rip), %xmm6
	pcmpgtd	%xmm6, %xmm1
	pandn	%xmm2, %xmm1
	movdqa	%xmm1, %xmm0
.L4:
	movdqa	%xmm0, %xmm2
	movl	%edi, %esi
	psrldq	$8, %xmm2
	andl	$-4, %esi
	movdqa	%xmm2, %xmm1
	leal	1(%rsi), %edx
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm1, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm0, %xmm1
	movd	%xmm1, %eax
	cmpl	%esi, %edi
	je	.L5
.L3:
	movslq	%edx, %r8
	leaq	D(%rip), %rsi
	addl	$1, %edx
	cmpl	(%rsi,%r8,4), %ecx
	jg	.L6
	cmpl	%edx, %edi
	jl	.L5
.L27:
	movslq	%edx, %r8
	cmpl	(%rsi,%r8,4), %ecx
	jg	.L7
	addl	$1, %edx
	cmpl	%edx, %edi
	jl	.L5
	movslq	%edx, %rdx
	cmpl	(%rsi,%rdx,4), %ecx
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L7:
	addl	$1, %r14d
	cmpl	N(%rip), %r14d
	jg	.L1
	movslq	%r14d, %r14
	leaq	A(%rip), %r13
	leaq	D(%rip), %r12
	leaq	(%r14,%r14,4), %rcx
	movl	%r14d, %ebx
	movq	%rcx, %rax
	leaq	0(,%rcx,4), %rbp
	salq	$4, %rax
	leaq	4(%r13,%rax), %r15
	testl	%edi, %edi
	jle	.L26
	leal	-1(%rdi), %eax
	cmpl	$2, %eax
	jbe	.L29
.L69:
	movdqu	(%r15), %xmm0
	movdqu	4+D(%rip), %xmm3
	movl	%edi, %eax
	shrl	$2, %eax
	paddd	%xmm3, %xmm0
	movups	%xmm0, 4+D(%rip)
	cmpl	$1, %eax
	je	.L13
	movdqu	20+D(%rip), %xmm0
	movdqu	16(%r15), %xmm5
	paddd	%xmm5, %xmm0
	movups	%xmm0, 20+D(%rip)
	cmpl	$2, %eax
	je	.L13
	movdqu	36+D(%rip), %xmm0
	movdqu	32(%r15), %xmm7
	paddd	%xmm7, %xmm0
	movups	%xmm0, 36+D(%rip)
	cmpl	$3, %eax
	je	.L13
	movdqu	52+D(%rip), %xmm0
	movdqu	48(%r15), %xmm5
	paddd	%xmm5, %xmm0
	movups	%xmm0, 52+D(%rip)
.L13:
	movl	%edi, %esi
	andl	$-4, %esi
	leal	1(%rsi), %eax
	cmpl	%esi, %edi
	je	.L26
.L12:
	subl	%esi, %edi
	cmpl	$1, %edi
	je	.L15
	leaq	4(%r12,%rsi,4), %r8
	leaq	1(%rsi,%rbp), %rsi
	movq	0(%r13,%rsi,4), %xmm0
	movq	(%r8), %xmm1
	movl	%edi, %esi
	andl	$-2, %esi
	paddd	%xmm1, %xmm0
	addl	%esi, %eax
	movq	%xmm0, (%r8)
	cmpl	%esi, %edi
	je	.L26
.L15:
	movslq	%ebx, %rsi
	cltq
	leaq	(%rsi,%rsi,4), %rsi
	leaq	(%rax,%rsi,4), %rsi
	movl	0(%r13,%rsi,4), %esi
	addl	%esi, (%r12,%rax,4)
.L26:
	leaq	C(%rip), %rax
	movl	12(%rsp), %esi
	movl	%ebx, %edi
	addl	(%rax,%r14,4), %esi
	call	f
	movl	N(%rip), %edi
	testl	%edi, %edi
	jle	.L21
	leal	-1(%rdi), %eax
	cmpl	$2, %eax
	jbe	.L30
	movdqu	4+D(%rip), %xmm0
	movdqu	(%r15), %xmm4
	movl	%edi, %eax
	shrl	$2, %eax
	psubd	%xmm4, %xmm0
	movups	%xmm0, 4+D(%rip)
	cmpl	$1, %eax
	je	.L20
	movdqu	20+D(%rip), %xmm0
	movdqu	16(%r15), %xmm6
	psubd	%xmm6, %xmm0
	movups	%xmm0, 20+D(%rip)
	cmpl	$2, %eax
	je	.L20
	movdqu	36+D(%rip), %xmm0
	movdqu	32(%r15), %xmm7
	psubd	%xmm7, %xmm0
	movups	%xmm0, 36+D(%rip)
	cmpl	$3, %eax
	je	.L20
	movdqu	52+D(%rip), %xmm0
	movdqu	48(%r15), %xmm6
	psubd	%xmm6, %xmm0
	movups	%xmm0, 52+D(%rip)
.L20:
	movl	%edi, %esi
	andl	$-4, %esi
	leal	1(%rsi), %eax
	cmpl	%esi, %edi
	je	.L21
.L19:
	movl	%edi, %r8d
	subl	%esi, %r8d
	cmpl	$1, %r8d
	je	.L23
	leaq	4(%r12,%rsi,4), %r9
	leaq	1(%rsi,%rbp), %rsi
	movq	0(%r13,%rsi,4), %xmm1
	movq	(%r9), %xmm0
	movl	%r8d, %esi
	andl	$-2, %esi
	psubd	%xmm1, %xmm0
	addl	%esi, %eax
	movq	%xmm0, (%r9)
	cmpl	%esi, %r8d
	je	.L21
.L23:
	movslq	%ebx, %rdx
	cltq
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%rax,%rdx,4), %rsi
	movl	(%r12,%rax,4), %edx
	subl	0(%r13,%rsi,4), %edx
	movl	%edx, (%r12,%rax,4)
.L21:
	addq	$1, %r14
	addq	$80, %r15
	addq	$20, %rbp
	cmpl	%r14d, %edi
	jl	.L1
	movl	M(%rip), %edi
	movl	%r14d, %ebx
	testl	%edi, %edi
	jle	.L26
	leal	-1(%rdi), %eax
	cmpl	$2, %eax
	ja	.L69
.L29:
	xorl	%esi, %esi
	movl	$1, %eax
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L5:
	cmpl	$1, %eax
	jne	.L7
.L2:
	movl	min_S(%rip), %eax
	cmpl	12(%rsp), %eax
	jg	.L32
	testl	%eax, %eax
	jns	.L7
.L32:
	movl	12(%rsp), %eax
	movl	%eax, min_S(%rip)
.L1:
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L6:
	.cfi_restore_state
	xorl	%eax, %eax
	cmpl	%edx, %edi
	jge	.L27
	jmp	.L7
.L30:
	xorl	%esi, %esi
	movl	$1, %eax
	jmp	.L19
.L28:
	movl	$1, %edx
	movl	$1, %eax
	jmp	.L3
	.cfi_endproc
.LFE23:
	.size	f, .-f
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d %d %d"
.LC2:
	.string	"%d\n"
.LC3:
	.string	"%d"
	.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
	leaq	M(%rip), %rdx
	xorl	%eax, %eax
	leaq	X(%rip), %rcx
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	N(%rip), %rsi
	leaq	.LC1(%rip), %rdi
	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	$8, %rsp
	.cfi_def_cfa_offset 64
	call	__isoc99_scanf@PLT
	movl	N(%rip), %edx
	testl	%edx, %edx
	jle	.L74
	leaq	84+A(%rip), %r13
	movl	$1, %r12d
	leaq	C(%rip), %r15
	leaq	.LC3(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L73:
	leaq	(%r15,%r12,4), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	movq	%r13, %r14
	call	__isoc99_scanf@PLT
	leaq	D(%rip), %rax
	movl	$1, %ebx
	movl	$0, (%rax,%r12,4)
	movl	M(%rip), %eax
	testl	%eax, %eax
	jle	.L75
	.p2align 4,,10
	.p2align 3
.L72:
	movq	%r14, %rsi
	xorl	%eax, %eax
	movq	%rbp, %rdi
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	addq	$4, %r14
	cmpl	%ebx, M(%rip)
	jge	.L72
.L75:
	addq	$1, %r12
	addq	$80, %r13
	cmpl	%r12d, N(%rip)
	jge	.L73
.L74:
	xorl	%esi, %esi
	xorl	%edi, %edi
	call	f
	movl	min_S(%rip), %edx
	leaq	.LC2(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	addq	$8, %rsp
	.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
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	min_S
	.data
	.align 4
	.type	min_S, @object
	.size	min_S, 4
min_S:
	.long	-1
	.globl	D
	.bss
	.align 32
	.type	D, @object
	.size	D, 80
D:
	.zero	80
	.globl	A
	.align 32
	.type	A, @object
	.size	A, 1600
A:
	.zero	1600
	.globl	C
	.align 32
	.type	C, @object
	.size	C, 80
C:
	.zero	80
	.globl	X
	.align 4
	.type	X, @object
	.size	X, 4
X:
	.zero	4
	.globl	M
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	1
	.long	1
	.long	1
	.long	1
	.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>
int N,M,X;
int C[20],A[20][20],D[20];
int min_S=-1;
void f(int p,int S){
  int c=1;
  for(int i=1;i<=M;i++){
    if(D[i]<X) c=0;
  }
  if(c==1){
    if(min_S<0 || S<min_S){
      min_S=S;
      return;
    }
  }
  for(int i=p+1;i<=N;i++){
    for(int j=1;j<=M;j++){
      D[j]+=A[i][j];
    }
    f(i,S+C[i]);
    for(int j=1;j<=N;j++){
      D[j]-=A[i][j];
    }
  }
  return;
}
int main(){
  scanf("%d %d %d",&N,&M,&X);
  for(int i=1;i<=N;i++){
    scanf("%d",C+i);
    D[i]=0;
    for(int j=1;j<=M;j++){
      scanf("%d",&A[i][j]);
    }
  }
  f(0,0);
  printf("%d\n",min_S);
}
2 3 10
100 3 1 4
100 1 5 9
100 2 6 5
 3 3 10
60 2 2 4
70 8 7 2
50 2 3 9
 8 5 22
100 3 7 5 3 1
164 4 5 2 7 8
334 7 2 7 2 9
234 4 7 2 8 2
541 5 4 3 3 6
235 4 6 6 9 7
394 3 6 1 6 2
872 8 4 3 7 2
 8 5 22
100 3 7 5 3 1
164 4 5 1 7 8
334 7 2 7 2 9
234 4 7 2 8 2
541 5 4 3 3 6
235 4 6 6 9 7
394 3 6 1 6 2
872 8 4 3 7 2
 8 5 22
100 3 7 5 3 1
32 4 5 1 7 8
334 7 2 7 2 1
234 4 7 2 8 2
541 5 4 3 3 6
235 4 6 6 9 7
394 3 6 0 6 2
872 8 4 3 7 2
 8 5 22
100 3 7 5 3 1
32 4 5 1 7 8
334 7 2 7 2 1
234 4 7 2 8 2
1039 5 4 3 3 6
235 4 6 6 9 7
394 3 6 0 6 2
872 8 4 3 7 2
 8 5 22
100 3 7 5 3 1
56 4 5 1 7 8
334 7 2 7 2 1
234 4 7 2 8 2
1039 5 4 3 3 6
235 4 6 6 9 7
394 3 6 0 6 2
872 8 4 3 7 2
 8 5 22
100 3 7 5 3 1
56 4 9 1 12 8
334 7 2 7 2 1
234 4 7 2 8 2
568 5 4 3 5 6
235 3 5 6 9 7
394 3 6 0 6 2
872 8 4 3 7 2
 8 5 22
100 3 7 5 3 1
56 4 9 1 12 8
334 7 2 7 2 1
234 4 7 2 8 2
568 5 4 3 5 6
239 3 5 6 9 9
394 3 6 0 6 2
872 8 4 3 7 2
 8 5 22
100 3 7 5 3 1
56 4 9 1 12 8
334 7 2 7 2 1
234 4 7 2 8 2
568 5 1 3 5 1
239 3 5 6 9 9
394 2 6 0 6 3
872 8 4 3 7 2

-1
 120
 1067
 1374
 1242
 1740
 1764
 1293
 1297
 1531

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>
int N,M,X;
int C[20],A[20][20],D[20];
int min_S=-1;
void f(int p,int S){
  int c=1;
  for(int i=1;i<=M;i++){
    if(D[i]<X) c=0;
  }
  if(c==1){
    if(min_S<0 || S<min_S){
      min_S=S;
      return;
    }
  }
  for(int i=p+1;i<=N;i++){
    for(int j=1;j<=M;j++){
      D[j]+=A[i][j];
    }
    f(i,S+C[i]);
    for(int j=1;j<=N;j++){
      D[j]-=A[i][j];
    }
  }
  return;
}
int main(){
  scanf("%d %d %d",&N,&M,&X);
  for(int i=1;i<=N;i++){
    scanf("%d",C+i);
    D[i]=0;
    for(int j=1;j<=M;j++){
      scanf("%d",&A[i][j]);
    }
  }
  f(0,0);
  printf("%d\n",min_S);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	M
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	X
	.align 4
	.type	X, @object
	.size	X, 4
X:
	.zero	4
	.globl	C
	.align 32
	.type	C, @object
	.size	C, 80
C:
	.zero	80
	.globl	A
	.align 32
	.type	A, @object
	.size	A, 1600
A:
	.zero	1600
	.globl	D
	.align 32
	.type	D, @object
	.size	D, 80
D:
	.zero	80
	.globl	min_S
	.data
	.align 4
	.type	min_S, @object
	.size	min_S, 4
min_S:
	.long	-1
	.text
	.globl	f
	.type	f, @function
f:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movl	%edi, -36(%rbp)
	movl	%esi, -40(%rbp)
	movl	$1, -20(%rbp)
	movl	$1, -16(%rbp)
	jmp	.L2
.L4:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	D(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	X(%rip), %eax
	cmpl	%eax, %edx
	jge	.L3
	movl	$0, -20(%rbp)
.L3:
	addl	$1, -16(%rbp)
.L2:
	movl	M(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L4
	cmpl	$1, -20(%rbp)
	jne	.L5
	movl	min_S(%rip), %eax
	testl	%eax, %eax
	js	.L6
	movl	min_S(%rip), %eax
	cmpl	%eax, -40(%rbp)
	jge	.L5
.L6:
	movl	-40(%rbp), %eax
	movl	%eax, min_S(%rip)
	jmp	.L1
.L5:
	movl	-36(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -12(%rbp)
	jmp	.L8
.L13:
	movl	$1, -8(%rbp)
	jmp	.L9
.L10:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	D(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-8(%rbp), %eax
	movslq	%eax, %rsi
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	D(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -8(%rbp)
.L9:
	movl	M(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jle	.L10
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	C(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-40(%rbp), %eax
	addl	%eax, %edx
	movl	-12(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	f
	movl	$1, -4(%rbp)
	jmp	.L11
.L12:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	D(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-4(%rbp), %eax
	movslq	%eax, %rsi
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	%eax, %ecx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	D(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -4(%rbp)
.L11:
	movl	N(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L12
	addl	$1, -12(%rbp)
.L8:
	movl	N(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L13
	nop
.L1:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	f, .-f
	.section	.rodata
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"%d"
.LC2:
	.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	$16, %rsp
	leaq	X(%rip), %rax
	movq	%rax, %rcx
	leaq	M(%rip), %rax
	movq	%rax, %rdx
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -8(%rbp)
	jmp	.L15
.L18:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	C(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	D(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	$1, -4(%rbp)
	jmp	.L16
.L17:
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %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
	addl	$1, -4(%rbp)
.L16:
	movl	M(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L17
	addl	$1, -8(%rbp)
.L15:
	movl	N(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jle	.L18
	movl	$0, %esi
	movl	$0, %edi
	call	f
	movl	min_S(%rip), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	M
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	X
	.align 4
	.type	X, @object
	.size	X, 4
X:
	.zero	4
	.globl	C
	.align 32
	.type	C, @object
	.size	C, 80
C:
	.zero	80
	.globl	A
	.align 32
	.type	A, @object
	.size	A, 1600
A:
	.zero	1600
	.globl	D
	.align 32
	.type	D, @object
	.size	D, 80
D:
	.zero	80
	.globl	min_S
	.data
	.align 4
	.type	min_S, @object
	.size	min_S, 4
min_S:
	.long	-1
	.text
	.globl	f
	.type	f, @function
f:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movl	%edi, -36(%rbp)
	movl	%esi, -40(%rbp)
	movl	$1, -20(%rbp)
	movl	$1, -16(%rbp)
	jmp	.L2
.L4:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	D(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	X(%rip), %eax
	cmpl	%eax, %edx
	jge	.L3
	movl	$0, -20(%rbp)
.L3:
	addl	$1, -16(%rbp)
.L2:
	movl	M(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L4
	cmpl	$1, -20(%rbp)
	jne	.L5
	movl	min_S(%rip), %eax
	testl	%eax, %eax
	js	.L6
	movl	min_S(%rip), %eax
	cmpl	%eax, -40(%rbp)
	jge	.L5
.L6:
	movl	-40(%rbp), %eax
	movl	%eax, min_S(%rip)
	jmp	.L1
.L5:
	movl	-36(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -12(%rbp)
	jmp	.L8
.L13:
	movl	$1, -8(%rbp)
	jmp	.L9
.L10:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	D(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-8(%rbp), %eax
	movslq	%eax, %rsi
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	D(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -8(%rbp)
.L9:
	movl	M(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jle	.L10
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	C(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-40(%rbp), %eax
	addl	%eax, %edx
	movl	-12(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	f
	movl	$1, -4(%rbp)
	jmp	.L11
.L12:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	D(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-4(%rbp), %eax
	movslq	%eax, %rsi
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	%eax, %ecx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	D(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -4(%rbp)
.L11:
	movl	N(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L12
	addl	$1, -12(%rbp)
.L8:
	movl	N(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L13
	nop
.L1:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	f, .-f
	.section	.rodata
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"%d"
.LC2:
	.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	$16, %rsp
	leaq	X(%rip), %rax
	movq	%rax, %rcx
	leaq	M(%rip), %rax
	movq	%rax, %rdx
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -8(%rbp)
	jmp	.L15
.L18:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	C(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	D(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	$1, -4(%rbp)
	jmp	.L16
.L17:
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %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
	addl	$1, -4(%rbp)
.L16:
	movl	M(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L17
	addl	$1, -8(%rbp)
.L15:
	movl	N(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jle	.L18
	movl	$0, %esi
	movl	$0, %edi
	call	f
	movl	min_S(%rip), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	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:
