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>
#include<string.h>
int N,i,S[31]={0};
void dfs(int d,int n,int s)
{
	int i;
	if(n==0)
		for(i=0;S[i];i++)
			printf("%d%s",S[i],S[i+1]==0?"\n":" ");
	for(i=(s>n?n:s);i>0;i--)
	{
		S[d]=i;
		dfs(d+1,n-i,i);
		S[d]=0;
	}
}


int main()
{
	for(;scanf("%d",&N),N;)
	{
		memset(S,0,124);
		dfs(0,N,N);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	S
	.align 32
	.type	S, @object
	.size	S, 124
S:
	.zero	124
	.section	.rodata
.LC0:
	.string	"\n"
.LC1:
	.string	" "
.LC2:
	.string	"%d%s"
	.text
	.globl	dfs
	.type	dfs, @function
dfs:
.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)
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	cmpl	$0, -24(%rbp)
	jne	.L2
	movl	$0, -4(%rbp)
	jmp	.L3
.L6:
	movl	-4(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	S(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L4
	leaq	.LC0(%rip), %rax
	jmp	.L5
.L4:
	leaq	.LC1(%rip), %rax
.L5:
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	S(%rip), %rdx
	movl	(%rcx,%rdx), %ecx
	movq	%rax, %rdx
	movl	%ecx, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -4(%rbp)
.L3:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	S(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L6
.L2:
	movl	-28(%rbp), %edx
	movl	-24(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	%eax, -4(%rbp)
	jmp	.L7
.L8:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	S(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-24(%rbp), %eax
	subl	-4(%rbp), %eax
	movl	-20(%rbp), %edx
	leal	1(%rdx), %ecx
	movl	-4(%rbp), %edx
	movl	%eax, %esi
	movl	%ecx, %edi
	call	dfs
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	S(%rip), %rax
	movl	$0, (%rdx,%rax)
	subl	$1, -4(%rbp)
.L7:
	cmpl	$0, -4(%rbp)
	jg	.L8
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	dfs, .-dfs
	.section	.rodata
.LC3:
	.string	"%d"
	.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
	jmp	.L10
.L11:
	movl	$124, %edx
	movl	$0, %esi
	leaq	S(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	N(%rip), %edx
	movl	N(%rip), %eax
	movl	%eax, %esi
	movl	$0, %edi
	call	dfs
.L10:
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	N(%rip), %eax
	testl	%eax, %eax
	jne	.L11
	movl	$0, %eax
	popq	%rbp
	.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	"\n"
.LC1:
	.string	"%d%s"
.LC2:
	.string	" "
	.text
	.p2align 4
	.globl	dfs
	.type	dfs, @function
dfs:
.LFB35:
	.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	$168, %rsp
	.cfi_def_cfa_offset 224
	movl	%edi, (%rsp)
	testl	%esi, %esi
	jne	.L2
	movl	S(%rip), %edx
	testl	%edx, %edx
	je	.L1
	leaq	4+S(%rip), %rbx
	leaq	.LC1(%rip), %rbp
	leaq	.LC2(%rip), %r13
	leaq	.LC0(%rip), %r12
.L6:
	movl	(%rbx), %eax
	movq	%r12, %rcx
	testl	%eax, %eax
	je	.L129
	movq	%r13, %rcx
.L129:
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__printf_chk@PLT
	movl	-4(%rbx), %edx
	testl	%edx, %edx
	jne	.L6
.L1:
	addq	$168, %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
.L2:
	.cfi_restore_state
	cmpl	%edx, %esi
	movl	%edx, %edi
	movl	%esi, %eax
	cmovle	%esi, %edi
	movl	%edi, 56(%rsp)
	testl	%edi, %edi
	jle	.L1
	movl	(%rsp), %ecx
	subl	%edi, %eax
	leaq	S(%rip), %r15
	movl	%eax, 92(%rsp)
	leal	1(%rcx), %esi
	movslq	%ecx, %rax
	movl	%esi, 136(%rsp)
	movq	%rax, 96(%rsp)
.L64:
	movq	96(%rsp), %rax
	movl	56(%rsp), %edi
	movl	%edi, (%r15,%rax,4)
	movl	92(%rsp), %eax
	testl	%eax, %eax
	jne	.L8
	movl	(%r15), %edx
	testl	%edx, %edx
	je	.L13
	leaq	4+S(%rip), %rbp
	leaq	.LC1(%rip), %r12
	leaq	.LC0(%rip), %rbx
.L12:
	movl	0(%rbp), %eax
	movq	%rbx, %rcx
	testl	%eax, %eax
	je	.L130
	leaq	.LC2(%rip), %rcx
.L130:
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %rbp
	call	__printf_chk@PLT
	movl	-4(%rbp), %edx
	testl	%edx, %edx
	jne	.L12
.L13:
	addl	$1, 92(%rsp)
	movq	96(%rsp), %rax
	subl	$1, 56(%rsp)
	movl	$0, (%r15,%rax,4)
	jne	.L64
	jmp	.L1
.L8:
	movl	92(%rsp), %esi
	movl	%edi, %eax
	cmpl	%edi, %esi
	cmovle	%esi, %eax
	movl	%eax, 60(%rsp)
	testl	%eax, %eax
	jle	.L13
	movl	(%rsp), %edi
	subl	%eax, %esi
	movslq	136(%rsp), %rax
	movl	%esi, 88(%rsp)
	addl	$2, %edi
	movq	%rax, 112(%rsp)
	movl	%edi, 140(%rsp)
.L63:
	movq	112(%rsp), %rax
	movl	60(%rsp), %edi
	movl	%edi, (%r15,%rax,4)
	movl	88(%rsp), %eax
	testl	%eax, %eax
	jne	.L14
	movl	(%r15), %edx
	testl	%edx, %edx
	je	.L19
	leaq	4+S(%rip), %rbp
	leaq	.LC1(%rip), %r12
	leaq	.LC0(%rip), %rbx
.L18:
	movl	0(%rbp), %eax
	movq	%rbx, %rcx
	testl	%eax, %eax
	je	.L131
	leaq	.LC2(%rip), %rcx
.L131:
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %rbp
	call	__printf_chk@PLT
	movl	-4(%rbp), %edx
	testl	%edx, %edx
	jne	.L18
.L19:
	addl	$1, 88(%rsp)
	movq	112(%rsp), %rax
	subl	$1, 60(%rsp)
	movl	$0, (%r15,%rax,4)
	jne	.L63
	jmp	.L13
.L14:
	movl	88(%rsp), %ecx
	movl	%edi, %eax
	cmpl	%edi, %ecx
	cmovle	%ecx, %eax
	movl	%eax, 64(%rsp)
	testl	%eax, %eax
	jle	.L19
	movl	(%rsp), %edi
	subl	%eax, %ecx
	movslq	140(%rsp), %rax
	movl	%ecx, 84(%rsp)
	leal	3(%rdi), %esi
	movq	%rax, 120(%rsp)
	movl	%esi, 132(%rsp)
.L62:
	movq	120(%rsp), %rax
	movl	64(%rsp), %ecx
	movl	84(%rsp), %r14d
	movl	%ecx, (%r15,%rax,4)
	testl	%r14d, %r14d
	jne	.L20
	movl	(%r15), %edx
	testl	%edx, %edx
	je	.L25
	leaq	4+S(%rip), %rbp
	leaq	.LC1(%rip), %r12
	leaq	.LC0(%rip), %rbx
.L24:
	movl	0(%rbp), %r13d
	movq	%rbx, %rcx
	testl	%r13d, %r13d
	je	.L132
	leaq	.LC2(%rip), %rcx
.L132:
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %rbp
	call	__printf_chk@PLT
	movl	-4(%rbp), %edx
	testl	%edx, %edx
	jne	.L24
.L25:
	addl	$1, 84(%rsp)
	movq	120(%rsp), %rax
	subl	$1, 64(%rsp)
	movl	$0, (%r15,%rax,4)
	jne	.L62
	jmp	.L19
.L20:
	movl	84(%rsp), %edi
	movl	%ecx, %eax
	cmpl	%ecx, %edi
	cmovle	%edi, %eax
	movl	%eax, 68(%rsp)
	testl	%eax, %eax
	jle	.L25
	movl	(%rsp), %esi
	subl	%eax, %edi
	movslq	132(%rsp), %rax
	movl	%edi, 80(%rsp)
	leal	4(%rsi), %ecx
	movq	%rax, 104(%rsp)
	movl	%ecx, 144(%rsp)
.L61:
	movq	104(%rsp), %rax
	movl	68(%rsp), %edi
	movl	80(%rsp), %ebx
	movl	%edi, (%r15,%rax,4)
	testl	%ebx, %ebx
	jne	.L26
	movl	(%r15), %edx
	testl	%edx, %edx
	je	.L31
	leaq	4+S(%rip), %r12
	leaq	.LC1(%rip), %rbx
	leaq	.LC0(%rip), %rbp
.L30:
	movl	(%r12), %r11d
	movq	%rbp, %rcx
	testl	%r11d, %r11d
	je	.L133
	leaq	.LC2(%rip), %rcx
.L133:
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %r12
	call	__printf_chk@PLT
	movl	-4(%r12), %edx
	testl	%edx, %edx
	jne	.L30
.L31:
	addl	$1, 80(%rsp)
	movq	104(%rsp), %rax
	subl	$1, 68(%rsp)
	movl	$0, (%r15,%rax,4)
	jne	.L61
	jmp	.L25
.L26:
	movl	80(%rsp), %esi
	movl	%edi, %eax
	cmpl	%edi, %esi
	cmovle	%esi, %eax
	movl	%eax, 4(%rsp)
	testl	%eax, %eax
	jle	.L31
	movl	(%rsp), %edi
	subl	%eax, %esi
	movslq	144(%rsp), %rax
	movl	%esi, 8(%rsp)
	leal	5(%rdi), %ecx
	movq	%rax, 16(%rsp)
	movl	%ecx, 76(%rsp)
.L60:
	movq	16(%rsp), %rax
	movl	4(%rsp), %esi
	movl	8(%rsp), %r10d
	movl	%esi, (%r15,%rax,4)
	testl	%r10d, %r10d
	jne	.L32
	movl	(%r15), %edx
	testl	%edx, %edx
	je	.L37
	leaq	4+S(%rip), %r12
	leaq	.LC1(%rip), %rbx
	leaq	.LC0(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L36:
	movl	(%r12), %r9d
	movq	%rbp, %rcx
	testl	%r9d, %r9d
	je	.L134
	leaq	.LC2(%rip), %rcx
.L134:
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %r12
	call	__printf_chk@PLT
	movl	-4(%r12), %edx
	testl	%edx, %edx
	jne	.L36
.L37:
	addl	$1, 8(%rsp)
	movq	16(%rsp), %rax
	subl	$1, 4(%rsp)
	movl	$0, (%r15,%rax,4)
	jne	.L60
	jmp	.L31
.L32:
	movl	8(%rsp), %eax
	movl	%esi, %r13d
	cmpl	%esi, %eax
	cmovle	%eax, %r13d
	testl	%r13d, %r13d
	jle	.L37
	subl	%r13d, %eax
	movl	(%rsp), %edi
	movl	%r13d, 24(%rsp)
	movl	%eax, 12(%rsp)
	movslq	76(%rsp), %rax
	leal	6(%rdi), %ecx
	movl	%ecx, 40(%rsp)
	movq	%rax, 32(%rsp)
.L59:
	movq	32(%rsp), %rax
	movl	24(%rsp), %ecx
	movl	12(%rsp), %r8d
	movl	%ecx, (%r15,%rax,4)
	testl	%r8d, %r8d
	jne	.L38
	movl	(%r15), %edx
	testl	%edx, %edx
	je	.L43
	leaq	4+S(%rip), %r12
	leaq	.LC1(%rip), %rbx
	leaq	.LC0(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L42:
	movl	(%r12), %edi
	movq	%rbp, %rcx
	testl	%edi, %edi
	je	.L135
	leaq	.LC2(%rip), %rcx
.L135:
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %r12
	call	__printf_chk@PLT
	movl	-4(%r12), %edx
	testl	%edx, %edx
	jne	.L42
.L43:
	addl	$1, 12(%rsp)
	movq	32(%rsp), %rax
	subl	$1, 24(%rsp)
	movl	$0, (%r15,%rax,4)
	jne	.L59
	jmp	.L37
.L38:
	movl	12(%rsp), %eax
	movl	%ecx, %r13d
	cmpl	%ecx, %eax
	cmovle	%eax, %r13d
	testl	%r13d, %r13d
	jle	.L43
	subl	%r13d, %eax
	movl	(%rsp), %ecx
	leaq	.LC1(%rip), %rbp
	movl	%eax, 28(%rsp)
	movslq	40(%rsp), %rax
	leal	7(%rcx), %esi
	movl	%esi, 44(%rsp)
	movq	%rax, 48(%rsp)
.L58:
	movq	48(%rsp), %rax
	movl	28(%rsp), %esi
	movl	%r13d, (%r15,%rax,4)
	testl	%esi, %esi
	jne	.L44
	movl	(%r15), %edx
	testl	%edx, %edx
	je	.L49
	leaq	4+S(%rip), %rbx
	leaq	.LC0(%rip), %r12
	jmp	.L48
	.p2align 4,,10
	.p2align 3
.L139:
	movq	%r12, %rcx
.L136:
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__printf_chk@PLT
	movl	-4(%rbx), %edx
	testl	%edx, %edx
	je	.L49
.L48:
	movl	(%rbx), %ecx
	testl	%ecx, %ecx
	je	.L139
	leaq	.LC2(%rip), %rcx
	jmp	.L136
	.p2align 4,,10
	.p2align 3
.L44:
	movl	28(%rsp), %eax
	cmpl	%r13d, %eax
	movl	%eax, %r14d
	cmovg	%r13d, %r14d
	testl	%r14d, %r14d
	jle	.L49
	movl	(%rsp), %ecx
	movl	%r13d, 128(%rsp)
	subl	%r14d, %eax
	movslq	44(%rsp), %r12
	movl	%eax, %ebx
	addl	$8, %ecx
	movl	%ecx, 72(%rsp)
.L57:
	movl	%r14d, (%r15,%r12,4)
	testl	%ebx, %ebx
	jne	.L50
	movl	(%r15), %edx
	testl	%edx, %edx
	je	.L55
	leaq	4+S(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L54:
	movl	0(%r13), %eax
	leaq	.LC0(%rip), %rcx
	testl	%eax, %eax
	je	.L137
	leaq	.LC2(%rip), %rcx
.L137:
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %r13
	call	__printf_chk@PLT
	movl	-4(%r13), %edx
	testl	%edx, %edx
	jne	.L54
.L55:
	movl	$0, (%r15,%r12,4)
	addl	$1, %ebx
	subl	$1, %r14d
	jne	.L57
	movl	128(%rsp), %r13d
.L49:
	movq	48(%rsp), %rax
	addl	$1, 28(%rsp)
	movl	$0, (%r15,%rax,4)
	subl	$1, %r13d
	jne	.L58
	jmp	.L43
	.p2align 4,,10
	.p2align 3
.L50:
	cmpl	%r14d, %ebx
	movl	%r14d, %eax
	cmovle	%ebx, %eax
	testl	%eax, %eax
	jle	.L55
	movl	(%rsp), %edi
	movslq	72(%rsp), %rcx
	movl	%eax, %r13d
	addl	$9, %edi
.L56:
	movl	%ebx, %esi
	movl	%r13d, %edx
	movl	%r13d, (%r15,%rcx,4)
	subl	%r13d, %esi
	movq	%rcx, 152(%rsp)
	movl	%edi, 148(%rsp)
	call	dfs
	subl	$1, %r13d
	movq	152(%rsp), %rcx
	movl	148(%rsp), %edi
	movl	$0, (%r15,%rcx,4)
	jne	.L56
	jmp	.L55
	.cfi_endproc
.LFE35:
	.size	dfs, .-dfs
	.section	.rodata.str1.1
.LC3:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB36:
	.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
	leaq	.LC2(%rip), %r14
	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
	.p2align 4,,10
	.p2align 3
.L141:
	leaq	N(%rip), %rsi
	leaq	.LC3(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	N(%rip), %ebp
	testl	%ebp, %ebp
	je	.L161
	movl	$15, %ecx
	movl	$0, %eax
	leaq	S(%rip), %rdi
	rep stosq
	movl	$0, (%rdi)
	jle	.L141
	leaq	S(%rip), %rax
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r12
	movl	%ebp, (%rax)
	leaq	.LC0(%rip), %r13
	testl	%ebx, %ebx
	jne	.L143
.L162:
	leaq	4(%rax), %r15
	movl	%ebp, %edx
	.p2align 4,,10
	.p2align 3
.L147:
	movl	(%r15), %eax
	movq	%r13, %rcx
	testl	%eax, %eax
	je	.L159
	movq	%r14, %rcx
.L159:
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %r15
	call	__printf_chk@PLT
	movl	-4(%r15), %edx
	testl	%edx, %edx
	jne	.L147
.L149:
	movl	$0, S(%rip)
	addl	$1, %ebx
	subl	$1, %ebp
	je	.L141
	leaq	S(%rip), %rax
	movl	%ebp, (%rax)
	testl	%ebx, %ebx
	je	.L162
.L143:
	cmpl	%ebx, %ebp
	movl	%ebx, %r15d
	cmovle	%ebp, %r15d
.L148:
	movl	%ebx, %esi
	movl	%r15d, %edx
	movl	$2, %edi
	movl	%r15d, 4+S(%rip)
	subl	%r15d, %esi
	call	dfs
	movl	$0, 4+S(%rip)
	subl	$1, %r15d
	jne	.L148
	jmp	.L149
.L161:
	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
.LFE36:
	.size	main, .-main
	.globl	S
	.bss
	.align 32
	.type	S, @object
	.size	S, 124
S:
	.zero	124
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.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	"\n"
.LC1:
	.string	"%d%s"
.LC2:
	.string	" "
	.text
	.p2align 4
	.globl	dfs
	.type	dfs, @function
dfs:
.LFB35:
	.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	$168, %rsp
	.cfi_def_cfa_offset 224
	movl	%edi, (%rsp)
	testl	%esi, %esi
	jne	.L2
	movl	S(%rip), %edx
	testl	%edx, %edx
	je	.L1
	leaq	4+S(%rip), %rbx
	leaq	.LC1(%rip), %rbp
	leaq	.LC2(%rip), %r13
	leaq	.LC0(%rip), %r12
.L6:
	movl	(%rbx), %eax
	movq	%r12, %rcx
	testl	%eax, %eax
	je	.L129
	movq	%r13, %rcx
.L129:
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__printf_chk@PLT
	movl	-4(%rbx), %edx
	testl	%edx, %edx
	jne	.L6
.L1:
	addq	$168, %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
.L2:
	.cfi_restore_state
	cmpl	%edx, %esi
	movl	%edx, %edi
	movl	%esi, %eax
	cmovle	%esi, %edi
	movl	%edi, 56(%rsp)
	testl	%edi, %edi
	jle	.L1
	movl	(%rsp), %ecx
	subl	%edi, %eax
	leaq	S(%rip), %r15
	movl	%eax, 92(%rsp)
	leal	1(%rcx), %esi
	movslq	%ecx, %rax
	movl	%esi, 136(%rsp)
	movq	%rax, 96(%rsp)
.L64:
	movq	96(%rsp), %rax
	movl	56(%rsp), %edi
	movl	%edi, (%r15,%rax,4)
	movl	92(%rsp), %eax
	testl	%eax, %eax
	jne	.L8
	movl	(%r15), %edx
	testl	%edx, %edx
	je	.L13
	leaq	4+S(%rip), %rbp
	leaq	.LC1(%rip), %r12
	leaq	.LC0(%rip), %rbx
.L12:
	movl	0(%rbp), %eax
	movq	%rbx, %rcx
	testl	%eax, %eax
	je	.L130
	leaq	.LC2(%rip), %rcx
.L130:
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %rbp
	call	__printf_chk@PLT
	movl	-4(%rbp), %edx
	testl	%edx, %edx
	jne	.L12
.L13:
	addl	$1, 92(%rsp)
	movq	96(%rsp), %rax
	subl	$1, 56(%rsp)
	movl	$0, (%r15,%rax,4)
	jne	.L64
	jmp	.L1
.L8:
	movl	92(%rsp), %esi
	movl	%edi, %eax
	cmpl	%edi, %esi
	cmovle	%esi, %eax
	movl	%eax, 60(%rsp)
	testl	%eax, %eax
	jle	.L13
	movl	(%rsp), %edi
	subl	%eax, %esi
	movslq	136(%rsp), %rax
	movl	%esi, 88(%rsp)
	addl	$2, %edi
	movq	%rax, 112(%rsp)
	movl	%edi, 140(%rsp)
.L63:
	movq	112(%rsp), %rax
	movl	60(%rsp), %edi
	movl	%edi, (%r15,%rax,4)
	movl	88(%rsp), %eax
	testl	%eax, %eax
	jne	.L14
	movl	(%r15), %edx
	testl	%edx, %edx
	je	.L19
	leaq	4+S(%rip), %rbp
	leaq	.LC1(%rip), %r12
	leaq	.LC0(%rip), %rbx
.L18:
	movl	0(%rbp), %eax
	movq	%rbx, %rcx
	testl	%eax, %eax
	je	.L131
	leaq	.LC2(%rip), %rcx
.L131:
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %rbp
	call	__printf_chk@PLT
	movl	-4(%rbp), %edx
	testl	%edx, %edx
	jne	.L18
.L19:
	addl	$1, 88(%rsp)
	movq	112(%rsp), %rax
	subl	$1, 60(%rsp)
	movl	$0, (%r15,%rax,4)
	jne	.L63
	jmp	.L13
.L14:
	movl	88(%rsp), %ecx
	movl	%edi, %eax
	cmpl	%edi, %ecx
	cmovle	%ecx, %eax
	movl	%eax, 64(%rsp)
	testl	%eax, %eax
	jle	.L19
	movl	(%rsp), %edi
	subl	%eax, %ecx
	movslq	140(%rsp), %rax
	movl	%ecx, 84(%rsp)
	leal	3(%rdi), %esi
	movq	%rax, 120(%rsp)
	movl	%esi, 132(%rsp)
.L62:
	movq	120(%rsp), %rax
	movl	64(%rsp), %ecx
	movl	84(%rsp), %r14d
	movl	%ecx, (%r15,%rax,4)
	testl	%r14d, %r14d
	jne	.L20
	movl	(%r15), %edx
	testl	%edx, %edx
	je	.L25
	leaq	4+S(%rip), %rbp
	leaq	.LC1(%rip), %r12
	leaq	.LC0(%rip), %rbx
.L24:
	movl	0(%rbp), %r13d
	movq	%rbx, %rcx
	testl	%r13d, %r13d
	je	.L132
	leaq	.LC2(%rip), %rcx
.L132:
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %rbp
	call	__printf_chk@PLT
	movl	-4(%rbp), %edx
	testl	%edx, %edx
	jne	.L24
.L25:
	addl	$1, 84(%rsp)
	movq	120(%rsp), %rax
	subl	$1, 64(%rsp)
	movl	$0, (%r15,%rax,4)
	jne	.L62
	jmp	.L19
.L20:
	movl	84(%rsp), %edi
	movl	%ecx, %eax
	cmpl	%ecx, %edi
	cmovle	%edi, %eax
	movl	%eax, 68(%rsp)
	testl	%eax, %eax
	jle	.L25
	movl	(%rsp), %esi
	subl	%eax, %edi
	movslq	132(%rsp), %rax
	movl	%edi, 80(%rsp)
	leal	4(%rsi), %ecx
	movq	%rax, 104(%rsp)
	movl	%ecx, 144(%rsp)
.L61:
	movq	104(%rsp), %rax
	movl	68(%rsp), %edi
	movl	80(%rsp), %ebx
	movl	%edi, (%r15,%rax,4)
	testl	%ebx, %ebx
	jne	.L26
	movl	(%r15), %edx
	testl	%edx, %edx
	je	.L31
	leaq	4+S(%rip), %r12
	leaq	.LC1(%rip), %rbx
	leaq	.LC0(%rip), %rbp
.L30:
	movl	(%r12), %r11d
	movq	%rbp, %rcx
	testl	%r11d, %r11d
	je	.L133
	leaq	.LC2(%rip), %rcx
.L133:
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %r12
	call	__printf_chk@PLT
	movl	-4(%r12), %edx
	testl	%edx, %edx
	jne	.L30
.L31:
	addl	$1, 80(%rsp)
	movq	104(%rsp), %rax
	subl	$1, 68(%rsp)
	movl	$0, (%r15,%rax,4)
	jne	.L61
	jmp	.L25
.L26:
	movl	80(%rsp), %esi
	movl	%edi, %eax
	cmpl	%edi, %esi
	cmovle	%esi, %eax
	movl	%eax, 4(%rsp)
	testl	%eax, %eax
	jle	.L31
	movl	(%rsp), %edi
	subl	%eax, %esi
	movslq	144(%rsp), %rax
	movl	%esi, 8(%rsp)
	leal	5(%rdi), %ecx
	movq	%rax, 16(%rsp)
	movl	%ecx, 76(%rsp)
.L60:
	movq	16(%rsp), %rax
	movl	4(%rsp), %esi
	movl	8(%rsp), %r10d
	movl	%esi, (%r15,%rax,4)
	testl	%r10d, %r10d
	jne	.L32
	movl	(%r15), %edx
	testl	%edx, %edx
	je	.L37
	leaq	4+S(%rip), %r12
	leaq	.LC1(%rip), %rbx
	leaq	.LC0(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L36:
	movl	(%r12), %r9d
	movq	%rbp, %rcx
	testl	%r9d, %r9d
	je	.L134
	leaq	.LC2(%rip), %rcx
.L134:
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %r12
	call	__printf_chk@PLT
	movl	-4(%r12), %edx
	testl	%edx, %edx
	jne	.L36
.L37:
	addl	$1, 8(%rsp)
	movq	16(%rsp), %rax
	subl	$1, 4(%rsp)
	movl	$0, (%r15,%rax,4)
	jne	.L60
	jmp	.L31
.L32:
	movl	8(%rsp), %eax
	movl	%esi, %r13d
	cmpl	%esi, %eax
	cmovle	%eax, %r13d
	testl	%r13d, %r13d
	jle	.L37
	subl	%r13d, %eax
	movl	(%rsp), %edi
	movl	%r13d, 24(%rsp)
	movl	%eax, 12(%rsp)
	movslq	76(%rsp), %rax
	leal	6(%rdi), %ecx
	movl	%ecx, 40(%rsp)
	movq	%rax, 32(%rsp)
.L59:
	movq	32(%rsp), %rax
	movl	24(%rsp), %ecx
	movl	12(%rsp), %r8d
	movl	%ecx, (%r15,%rax,4)
	testl	%r8d, %r8d
	jne	.L38
	movl	(%r15), %edx
	testl	%edx, %edx
	je	.L43
	leaq	4+S(%rip), %r12
	leaq	.LC1(%rip), %rbx
	leaq	.LC0(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L42:
	movl	(%r12), %edi
	movq	%rbp, %rcx
	testl	%edi, %edi
	je	.L135
	leaq	.LC2(%rip), %rcx
.L135:
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %r12
	call	__printf_chk@PLT
	movl	-4(%r12), %edx
	testl	%edx, %edx
	jne	.L42
.L43:
	addl	$1, 12(%rsp)
	movq	32(%rsp), %rax
	subl	$1, 24(%rsp)
	movl	$0, (%r15,%rax,4)
	jne	.L59
	jmp	.L37
.L38:
	movl	12(%rsp), %eax
	movl	%ecx, %r13d
	cmpl	%ecx, %eax
	cmovle	%eax, %r13d
	testl	%r13d, %r13d
	jle	.L43
	subl	%r13d, %eax
	movl	(%rsp), %ecx
	leaq	.LC1(%rip), %rbp
	movl	%eax, 28(%rsp)
	movslq	40(%rsp), %rax
	leal	7(%rcx), %esi
	movl	%esi, 44(%rsp)
	movq	%rax, 48(%rsp)
.L58:
	movq	48(%rsp), %rax
	movl	28(%rsp), %esi
	movl	%r13d, (%r15,%rax,4)
	testl	%esi, %esi
	jne	.L44
	movl	(%r15), %edx
	testl	%edx, %edx
	je	.L49
	leaq	4+S(%rip), %rbx
	leaq	.LC0(%rip), %r12
	jmp	.L48
	.p2align 4,,10
	.p2align 3
.L139:
	movq	%r12, %rcx
.L136:
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__printf_chk@PLT
	movl	-4(%rbx), %edx
	testl	%edx, %edx
	je	.L49
.L48:
	movl	(%rbx), %ecx
	testl	%ecx, %ecx
	je	.L139
	leaq	.LC2(%rip), %rcx
	jmp	.L136
	.p2align 4,,10
	.p2align 3
.L44:
	movl	28(%rsp), %eax
	cmpl	%r13d, %eax
	movl	%eax, %r14d
	cmovg	%r13d, %r14d
	testl	%r14d, %r14d
	jle	.L49
	movl	(%rsp), %ecx
	movl	%r13d, 128(%rsp)
	subl	%r14d, %eax
	movslq	44(%rsp), %r12
	movl	%eax, %ebx
	addl	$8, %ecx
	movl	%ecx, 72(%rsp)
.L57:
	movl	%r14d, (%r15,%r12,4)
	testl	%ebx, %ebx
	jne	.L50
	movl	(%r15), %edx
	testl	%edx, %edx
	je	.L55
	leaq	4+S(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L54:
	movl	0(%r13), %eax
	leaq	.LC0(%rip), %rcx
	testl	%eax, %eax
	je	.L137
	leaq	.LC2(%rip), %rcx
.L137:
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %r13
	call	__printf_chk@PLT
	movl	-4(%r13), %edx
	testl	%edx, %edx
	jne	.L54
.L55:
	movl	$0, (%r15,%r12,4)
	addl	$1, %ebx
	subl	$1, %r14d
	jne	.L57
	movl	128(%rsp), %r13d
.L49:
	movq	48(%rsp), %rax
	addl	$1, 28(%rsp)
	movl	$0, (%r15,%rax,4)
	subl	$1, %r13d
	jne	.L58
	jmp	.L43
	.p2align 4,,10
	.p2align 3
.L50:
	cmpl	%r14d, %ebx
	movl	%r14d, %eax
	cmovle	%ebx, %eax
	testl	%eax, %eax
	jle	.L55
	movl	(%rsp), %edi
	movslq	72(%rsp), %rcx
	movl	%eax, %r13d
	addl	$9, %edi
.L56:
	movl	%ebx, %esi
	movl	%r13d, %edx
	movl	%r13d, (%r15,%rcx,4)
	subl	%r13d, %esi
	movq	%rcx, 152(%rsp)
	movl	%edi, 148(%rsp)
	call	dfs
	subl	$1, %r13d
	movq	152(%rsp), %rcx
	movl	148(%rsp), %edi
	movl	$0, (%r15,%rcx,4)
	jne	.L56
	jmp	.L55
	.cfi_endproc
.LFE35:
	.size	dfs, .-dfs
	.section	.rodata.str1.1
.LC3:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB36:
	.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
	leaq	.LC2(%rip), %r14
	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
	.p2align 4,,10
	.p2align 3
.L141:
	leaq	N(%rip), %rsi
	leaq	.LC3(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	N(%rip), %ebp
	testl	%ebp, %ebp
	je	.L161
	movl	$15, %ecx
	movl	$0, %eax
	leaq	S(%rip), %rdi
	rep stosq
	movl	$0, (%rdi)
	jle	.L141
	leaq	S(%rip), %rax
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r12
	movl	%ebp, (%rax)
	leaq	.LC0(%rip), %r13
	testl	%ebx, %ebx
	jne	.L143
.L162:
	leaq	4(%rax), %r15
	movl	%ebp, %edx
	.p2align 4,,10
	.p2align 3
.L147:
	movl	(%r15), %eax
	movq	%r13, %rcx
	testl	%eax, %eax
	je	.L159
	movq	%r14, %rcx
.L159:
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %r15
	call	__printf_chk@PLT
	movl	-4(%r15), %edx
	testl	%edx, %edx
	jne	.L147
.L149:
	movl	$0, S(%rip)
	addl	$1, %ebx
	subl	$1, %ebp
	je	.L141
	leaq	S(%rip), %rax
	movl	%ebp, (%rax)
	testl	%ebx, %ebx
	je	.L162
.L143:
	cmpl	%ebx, %ebp
	movl	%ebx, %r15d
	cmovle	%ebp, %r15d
.L148:
	movl	%ebx, %esi
	movl	%r15d, %edx
	movl	$2, %edi
	movl	%r15d, 4+S(%rip)
	subl	%r15d, %esi
	call	dfs
	movl	$0, 4+S(%rip)
	subl	$1, %r15d
	jne	.L148
	jmp	.L149
.L161:
	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
.LFE36:
	.size	main, .-main
	.globl	S
	.bss
	.align 32
	.type	S, @object
	.size	S, 124
S:
	.zero	124
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.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>
#include<string.h>
int N,i,S[31]={0};
void dfs(int d,int n,int s)
{
	int i;
	if(n==0)
		for(i=0;S[i];i++)
			printf("%d%s",S[i],S[i+1]==0?"\n":" ");
	for(i=(s>n?n:s);i>0;i--)
	{
		S[d]=i;
		dfs(d+1,n-i,i);
		S[d]=0;
	}
}


int main()
{
	for(;scanf("%d",&N),N;)
	{
		memset(S,0,124);
		dfs(0,N,N);
	}
	return 0;
}
5
8
0
 5
6
0
 5
7
0
 5
4
0
 5
3
0
 5
0
0
 5
9
0
 5
14
0
 5
1
0
 5
2
0

5
4 1
3 2
3 1 1
2 2 1
2 1 1 1
1 1 1 1 1
8
7 1
6 2
6 1 1
5 3
5 2 1
5 1 1 1
4 4
4 3 1
4 2 2
4 2 1 1
4 1 1 1 1
3 3 2
3 3 1 1
3 2 2 1
3 2 1 1 1
3 1 1 1 1 1
2 2 2 2
2 2 2 1 1
2 2 1 1 1 1
2 1 1 1 1 1 1
1 1 1 1 1 1 1 1
 5
4 1
3 2
3 1 1
2 2 1
2 1 1 1
1 1 1 1 1
6
5 1
4 2
4 1 1
3 3
3 2 1
3 1 1 1
2 2 2
2 2 1 1
2 1 1 1 1
1 1 1 1 1 1
 5
4 1
3 2
3 1 1
2 2 1
2 1 1 1
1 1 1 1 1
7
6 1
5 2
5 1 1
4 3
4 2 1
4 1 1 1
3 3 1
3 2 2
3 2 1 1
3 1 1 1 1
2 2 2 1
2 2 1 1 1
2 1 1 1 1 1
1 1 1 1 1 1 1
 5
4 1
3 2
3 1 1
2 2 1
2 1 1 1
1 1 1 1 1
4
3 1
2 2
2 1 1
1 1 1 1
 5
4 1
3 2
3 1 1
2 2 1
2 1 1 1
1 1 1 1 1
3
2 1
1 1 1
 5
4 1
3 2
3 1 1
2 2 1
2 1 1 1
1 1 1 1 1
 5
4 1
3 2
3 1 1
2 2 1
2 1 1 1
1 1 1 1 1
9
8 1
7 2
7 1 1
6 3
6 2 1
6 1 1 1
5 4
5 3 1
5 2 2
5 2 1 1
5 1 1 1 1
4 4 1
4 3 2
4 3 1 1
4 2 2 1
4 2 1 1 1
4 1 1 1 1 1
3 3 3
3 3 2 1
3 3 1 1 1
3 2 2 2
3 2 2 1 1
3 2 1 1 1 1
3 1 1 1 1 1 1
2 2 2 2 1
2 2 2 1 1 1
2 2 1 1 1 1 1
2 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1
 5
4 1
3 2
3 1 1
2 2 1
2 1 1 1
1 1 1 1 1
14
13 1
12 2
12 1 1
11 3
11 2 1
11 1 1 1
10 4
10 3 1
10 2 2
10 2 1 1
10 1 1 1 1
9 5
9 4 1
9 3 2
9 3 1 1
9 2 2 1
9 2 1 1 1
9 1 1 1 1 1
8 6
8 5 1
8 4 2
8 4 1 1
8 3 3
8 3 2 1
8 3 1 1 1
8 2 2 2
8 2 2 1 1
8 2 1 1 1 1
8 1 1 1 1 1 1
7 7
7 6 1
7 5 2
7 5 1 1
7 4 3
7 4 2 1
7 4 1 1 1
7 3 3 1
7 3 2 2
7 3 2 1 1
7 3 1 1 1 1
7 2 2 2 1
7 2 2 1 1 1
7 2 1 1 1 1 1
7 1 1 1 1 1 1 1
6 6 2
6 6 1 1
6 5 3
6 5 2 1
6 5 1 1 1
6 4 4
6 4 3 1
6 4 2 2
6 4 2 1 1
6 4 1 1 1 1
6 3 3 2
6 3 3 1 1
6 3 2 2 1
6 3 2 1 1 1
6 3 1 1 1 1 1
6 2 2 2 2
6 2 2 2 1 1
6 2 2 1 1 1 1
6 2 1 1 1 1 1 1
6 1 1 1 1 1 1 1 1
5 5 4
5 5 3 1
5 5 2 2
5 5 2 1 1
5 5 1 1 1 1
5 4 4 1
5 4 3 2
5 4 3 1 1
5 4 2 2 1
5 4 2 1 1 1
5 4 1 1 1 1 1
5 3 3 3
5 3 3 2 1
5 3 3 1 1 1
5 3 2 2 2
5 3 2 2 1 1
5 3 2 1 1 1 1
5 3 1 1 1 1 1 1
5 2 2 2 2 1
5 2 2 2 1 1 1
5 2 2 1 1 1 1 1
5 2 1 1 1 1 1 1 1
5 1 1 1 1 1 1 1 1 1
4 4 4 2
4 4 4 1 1
4 4 3 3
4 4 3 2 1
4 4 3 1 1 1
4 4 2 2 2
4 4 2 2 1 1
4 4 2 1 1 1 1
4 4 1 1 1 1 1 1
4 3 3 3 1
4 3 3 2 2
4 3 3 2 1 1
4 3 3 1 1 1 1
4 3 2 2 2 1
4 3 2 2 1 1 1
4 3 2 1 1 1 1 1
4 3 1 1 1 1 1 1 1
4 2 2 2 2 2
4 2 2 2 2 1 1
4 2 2 2 1 1 1 1
4 2 2 1 1 1 1 1 1
4 2 1 1 1 1 1 1 1 1
4 1 1 1 1 1 1 1 1 1 1
3 3 3 3 2
3 3 3 3 1 1
3 3 3 2 2 1
3 3 3 2 1 1 1
3 3 3 1 1 1 1 1
3 3 2 2 2 2
3 3 2 2 2 1 1
3 3 2 2 1 1 1 1
3 3 2 1 1 1 1 1 1
3 3 1 1 1 1 1 1 1 1
3 2 2 2 2 2 1
3 2 2 2 2 1 1 1
3 2 2 2 1 1 1 1 1
3 2 2 1 1 1 1 1 1 1
3 2 1 1 1 1 1 1 1 1 1
3 1 1 1 1 1 1 1 1 1 1 1
2 2 2 2 2 2 2
2 2 2 2 2 2 1 1
2 2 2 2 2 1 1 1 1
2 2 2 2 1 1 1 1 1 1
2 2 2 1 1 1 1 1 1 1 1
2 2 1 1 1 1 1 1 1 1 1 1
2 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1
 5
4 1
3 2
3 1 1
2 2 1
2 1 1 1
1 1 1 1 1
1
 5
4 1
3 2
3 1 1
2 2 1
2 1 1 1
1 1 1 1 1
2
1 1

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>
#include<string.h>
int N,i,S[31]={0};
void dfs(int d,int n,int s)
{
	int i;
	if(n==0)
		for(i=0;S[i];i++)
			printf("%d%s",S[i],S[i+1]==0?"\n":" ");
	for(i=(s>n?n:s);i>0;i--)
	{
		S[d]=i;
		dfs(d+1,n-i,i);
		S[d]=0;
	}
}


int main()
{
	for(;scanf("%d",&N),N;)
	{
		memset(S,0,124);
		dfs(0,N,N);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	S
	.align 32
	.type	S, @object
	.size	S, 124
S:
	.zero	124
	.section	.rodata
.LC0:
	.string	"\n"
.LC1:
	.string	" "
.LC2:
	.string	"%d%s"
	.text
	.globl	dfs
	.type	dfs, @function
dfs:
.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)
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	cmpl	$0, -24(%rbp)
	jne	.L2
	movl	$0, -4(%rbp)
	jmp	.L3
.L6:
	movl	-4(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	S(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L4
	leaq	.LC0(%rip), %rax
	jmp	.L5
.L4:
	leaq	.LC1(%rip), %rax
.L5:
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	S(%rip), %rdx
	movl	(%rcx,%rdx), %ecx
	movq	%rax, %rdx
	movl	%ecx, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -4(%rbp)
.L3:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	S(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L6
.L2:
	movl	-28(%rbp), %edx
	movl	-24(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	%eax, -4(%rbp)
	jmp	.L7
.L8:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	S(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-24(%rbp), %eax
	subl	-4(%rbp), %eax
	movl	-20(%rbp), %edx
	leal	1(%rdx), %ecx
	movl	-4(%rbp), %edx
	movl	%eax, %esi
	movl	%ecx, %edi
	call	dfs
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	S(%rip), %rax
	movl	$0, (%rdx,%rax)
	subl	$1, -4(%rbp)
.L7:
	cmpl	$0, -4(%rbp)
	jg	.L8
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	dfs, .-dfs
	.section	.rodata
.LC3:
	.string	"%d"
	.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
	jmp	.L10
.L11:
	movl	$124, %edx
	movl	$0, %esi
	leaq	S(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	N(%rip), %edx
	movl	N(%rip), %eax
	movl	%eax, %esi
	movl	$0, %edi
	call	dfs
.L10:
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	N(%rip), %eax
	testl	%eax, %eax
	jne	.L11
	movl	$0, %eax
	popq	%rbp
	.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	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	S
	.align 32
	.type	S, @object
	.size	S, 124
S:
	.zero	124
	.section	.rodata
.LC0:
	.string	"\n"
.LC1:
	.string	" "
.LC2:
	.string	"%d%s"
	.text
	.globl	dfs
	.type	dfs, @function
dfs:
.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)
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	cmpl	$0, -24(%rbp)
	jne	.L2
	movl	$0, -4(%rbp)
	jmp	.L3
.L6:
	movl	-4(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	S(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L4
	leaq	.LC0(%rip), %rax
	jmp	.L5
.L4:
	leaq	.LC1(%rip), %rax
.L5:
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	S(%rip), %rdx
	movl	(%rcx,%rdx), %ecx
	movq	%rax, %rdx
	movl	%ecx, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -4(%rbp)
.L3:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	S(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L6
.L2:
	movl	-28(%rbp), %edx
	movl	-24(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	%eax, -4(%rbp)
	jmp	.L7
.L8:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	S(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-24(%rbp), %eax
	subl	-4(%rbp), %eax
	movl	-20(%rbp), %edx
	leal	1(%rdx), %ecx
	movl	-4(%rbp), %edx
	movl	%eax, %esi
	movl	%ecx, %edi
	call	dfs
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	S(%rip), %rax
	movl	$0, (%rdx,%rax)
	subl	$1, -4(%rbp)
.L7:
	cmpl	$0, -4(%rbp)
	jg	.L8
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	dfs, .-dfs
	.section	.rodata
.LC3:
	.string	"%d"
	.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
	jmp	.L10
.L11:
	movl	$124, %edx
	movl	$0, %esi
	leaq	S(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	N(%rip), %edx
	movl	N(%rip), %eax
	movl	%eax, %esi
	movl	$0, %edi
	call	dfs
.L10:
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	N(%rip), %eax
	testl	%eax, %eax
	jne	.L11
	movl	$0, %eax
	popq	%rbp
	.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:
