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;
int a[30];

void output(int num, int sum, int i)
{
	int j;
	
	if (sum == n){
		printf("%d", a[0]);
		for (j = 1; j < i; j++){
			printf(" %d", a[j]);
		}
		printf("\n");
	}
	else if (sum < n){
		for (j = num; j >= 1; j--){
			output(a[i] = j, sum + j, i + 1);
		}
	}
}

int main(void)
{
	int i;
	
	while (1){
		scanf("%d", &n);
		if (!n){
			break;
		}
		
		for (i = n; i >= 1; i--){
			output(a[0] = i, i, 1);
		}
	}
	
	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	a
	.align 32
	.type	a, @object
	.size	a, 120
a:
	.zero	120
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	" %d"
	.text
	.globl	output
	.type	output, @function
output:
.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)
	movl	n(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jne	.L2
	movl	a(%rip), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$1, -4(%rbp)
	jmp	.L3
.L4:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -4(%rbp)
.L3:
	movl	-4(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L4
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L8
.L2:
	movl	n(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jge	.L8
	movl	-20(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L6
.L7:
	movl	-28(%rbp), %eax
	leal	1(%rax), %edx
	movl	-24(%rbp), %ecx
	movl	-4(%rbp), %eax
	addl	%eax, %ecx
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdi
	leaq	a(%rip), %rsi
	movl	-4(%rbp), %eax
	movl	%eax, (%rdi,%rsi)
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rsi
	leaq	a(%rip), %rax
	movl	(%rsi,%rax), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	output
	subl	$1, -4(%rbp)
.L6:
	cmpl	$0, -4(%rbp)
	jg	.L7
.L8:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	output, .-output
	.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
.L14:
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	n(%rip), %eax
	testl	%eax, %eax
	je	.L17
	movl	n(%rip), %eax
	movl	%eax, -4(%rbp)
	jmp	.L12
.L13:
	movl	-4(%rbp), %eax
	movl	%eax, a(%rip)
	movl	a(%rip), %eax
	movl	-4(%rbp), %ecx
	movl	$1, %edx
	movl	%ecx, %esi
	movl	%eax, %edi
	call	output
	subl	$1, -4(%rbp)
.L12:
	cmpl	$0, -4(%rbp)
	jg	.L13
	jmp	.L14
.L17:
	nop
	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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	" %d"
	.text
	.p2align 4
	.globl	output
	.type	output, @function
output:
.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
	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	$232, %rsp
	.cfi_def_cfa_offset 288
	movl	n(%rip), %eax
	movl	%edi, 108(%rsp)
	movl	%esi, 132(%rsp)
	movl	%edx, 80(%rsp)
	cmpl	%esi, %eax
	je	.L118
	jle	.L1
	movl	108(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L1
	movl	%edx, %edi
	leal	1(%rdx), %esi
	leal	2(%rdx), %ebx
	leal	3(%rdx), %r8d
	leal	4(%rdx), %r9d
	movl	%esi, 188(%rsp)
	leal	5(%rdx), %r10d
	leal	6(%rdx), %ecx
	movl	%ebx, 184(%rsp)
	leal	7(%rdx), %edx
	movl	%ecx, 104(%rsp)
	leaq	a(%rip), %r13
	movl	%edx, 84(%rsp)
	leal	8(%rdi), %edx
	leaq	.LC1(%rip), %r14
	movl	%edx, 64(%rsp)
	leaq	8+a(%rip), %rdx
	leaq	(%rdx,%rcx,4), %rcx
	movl	%r8d, 156(%rsp)
	movq	%rcx, 120(%rsp)
	movl	%r10d, %ecx
	leaq	(%rdx,%rcx,4), %rcx
	movl	%r9d, 152(%rsp)
	movq	%rcx, 144(%rsp)
	movl	%r9d, %ecx
	leaq	(%rdx,%rcx,4), %rcx
	movl	%r10d, 128(%rsp)
	movq	%rcx, 160(%rsp)
	movl	%r8d, %ecx
	leaq	(%rdx,%rcx,4), %rcx
	movq	%rcx, 176(%rsp)
	movl	%ebx, %ecx
	leaq	(%rdx,%rcx,4), %rcx
	movq	%rcx, 192(%rsp)
	movl	%esi, %ecx
	leaq	(%rdx,%rcx,4), %rsi
	movl	%edi, %ecx
	movq	%rsi, 200(%rsp)
	leaq	(%rdx,%rcx,4), %rsi
	leal	-1(%rdi), %ecx
	movslq	%edi, %rdi
	leaq	(%rdx,%rcx,4), %rdx
	movq	%rsi, 208(%rsp)
	movq	%rdx, 216(%rsp)
	movq	%rdi, 168(%rsp)
.L64:
	movl	108(%rsp), %ecx
	movl	132(%rsp), %edx
	movq	168(%rsp), %rsi
	addl	%ecx, %edx
	movl	%ecx, 0(%r13,%rsi,4)
	cmpl	%edx, %eax
	je	.L119
	jle	.L9
	movl	%ecx, %edx
	movl	132(%rsp), %edi
	movl	%edx, 92(%rsp)
	movslq	188(%rsp), %rdx
	leal	(%rdi,%rcx,2), %ecx
	movl	%ecx, 60(%rsp)
	movq	%rdx, 136(%rsp)
.L63:
	movq	136(%rsp), %rdi
	movl	92(%rsp), %esi
	movl	%esi, 0(%r13,%rdi,4)
	cmpl	60(%rsp), %eax
	je	.L120
	jle	.L15
	movslq	184(%rsp), %rcx
	movl	%esi, 68(%rsp)
	movq	%rcx, 112(%rsp)
.L62:
	movl	68(%rsp), %ecx
	movl	60(%rsp), %edx
	movq	112(%rsp), %rsi
	addl	%ecx, %edx
	movl	%ecx, 0(%r13,%rsi,4)
	cmpl	%edx, %eax
	je	.L121
	jle	.L21
	movl	60(%rsp), %edx
	movl	%ecx, 44(%rsp)
	leal	(%rdx,%rcx,2), %edx
	movslq	156(%rsp), %rcx
	movl	%edx, 28(%rsp)
	movq	%rcx, 96(%rsp)
.L61:
	movq	96(%rsp), %rsi
	movl	44(%rsp), %ecx
	movl	%ecx, 0(%r13,%rsi,4)
	cmpl	28(%rsp), %eax
	je	.L122
	jle	.L27
	movslq	152(%rsp), %rdx
	movl	%ecx, 40(%rsp)
	movq	%rdx, 72(%rsp)
.L60:
	movl	40(%rsp), %ecx
	movl	28(%rsp), %edx
	movq	72(%rsp), %rdi
	addl	%ecx, %edx
	movl	%ecx, 0(%r13,%rdi,4)
	cmpl	%edx, %eax
	je	.L123
	jle	.L33
	movl	28(%rsp), %edx
	movl	%ecx, %esi
	movl	%esi, 24(%rsp)
	leal	(%rdx,%rcx,2), %ecx
	movslq	128(%rsp), %rdx
	movl	%ecx, 4(%rsp)
	movq	%rdx, 48(%rsp)
.L59:
	movq	48(%rsp), %rcx
	movl	24(%rsp), %edi
	movl	%edi, 0(%r13,%rcx,4)
	cmpl	4(%rsp), %eax
	je	.L124
	jle	.L39
	movslq	104(%rsp), %rcx
	movl	%edi, %r12d
	movq	%rcx, 32(%rsp)
	movslq	84(%rsp), %rcx
	movq	%rcx, 16(%rsp)
.L58:
	movl	4(%rsp), %ecx
	leal	(%r12,%rcx), %edx
	movq	32(%rsp), %rcx
	movl	%r12d, 0(%r13,%rcx,4)
	cmpl	%edx, %eax
	je	.L125
	jle	.L45
	movl	4(%rsp), %ecx
	movl	80(%rsp), %edi
	movl	%r12d, %ebp
	movl	%r12d, 56(%rsp)
	leal	(%rcx,%r12,2), %ebx
	movslq	64(%rsp), %rcx
	leal	9(%rdi), %r15d
	movq	%rcx, 8(%rsp)
	movq	16(%rsp), %rcx
	movl	%ebp, 0(%r13,%rcx,4)
	cmpl	%ebx, %eax
	je	.L126
.L49:
	jle	.L51
	movl	%r15d, %eax
	movl	%ebp, %r12d
	movl	%ebp, %r15d
	movl	%eax, %ebp
.L55:
	movq	8(%rsp), %rax
	leal	(%r12,%rbx), %esi
	movl	%r12d, %edi
	movl	%ebp, %edx
	movl	%r12d, 0(%r13,%rax,4)
	call	output
	subl	$1, %r12d
	jne	.L55
	movl	%ebp, %eax
	movl	%r15d, %ebp
	movl	%eax, %r15d
.L51:
	subl	$1, %ebx
	subl	$1, %ebp
	je	.L115
.L127:
	movq	16(%rsp), %rcx
	movl	n(%rip), %eax
	movl	%ebp, 0(%r13,%rcx,4)
	cmpl	%ebx, %eax
	jne	.L49
.L126:
	movl	0(%r13), %edx
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	leaq	4+a(%rip), %r12
	call	__printf_chk@PLT
	cmpl	$1, 64(%rsp)
	jle	.L53
	movl	%ebx, 88(%rsp)
	movq	%r12, %rbx
	movq	120(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L52:
	movl	(%rbx), %edx
	movq	%r14, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__printf_chk@PLT
	cmpq	%r12, %rbx
	jne	.L52
	movl	88(%rsp), %ebx
.L53:
	movl	$10, %edi
	subl	$1, %ebx
	call	putchar@PLT
	subl	$1, %ebp
	jne	.L127
.L115:
	movl	56(%rsp), %r12d
.L45:
	subl	$1, %r12d
	je	.L39
	movl	n(%rip), %eax
	jmp	.L58
	.p2align 4,,10
	.p2align 3
.L1:
	addq	$232, %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
.L124:
	.cfi_restore_state
	movl	0(%r13), %edx
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	leaq	4+a(%rip), %rbx
	call	__printf_chk@PLT
	cmpl	$1, 104(%rsp)
	movq	160(%rsp), %rbp
	jle	.L41
	.p2align 4,,10
	.p2align 3
.L40:
	movl	(%rbx), %edx
	movq	%r14, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__printf_chk@PLT
	cmpq	%rbp, %rbx
	jne	.L40
.L41:
	movl	$10, %edi
	call	putchar@PLT
.L39:
	subl	$1, 4(%rsp)
	subl	$1, 24(%rsp)
	je	.L33
	movl	n(%rip), %eax
	jmp	.L59
	.p2align 4,,10
	.p2align 3
.L123:
	movl	0(%r13), %edx
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	leaq	4+a(%rip), %rbx
	call	__printf_chk@PLT
	cmpl	$1, 128(%rsp)
	movq	176(%rsp), %rbp
	jle	.L35
	.p2align 4,,10
	.p2align 3
.L34:
	movl	(%rbx), %edx
	movq	%r14, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__printf_chk@PLT
	cmpq	%rbp, %rbx
	jne	.L34
.L35:
	movl	$10, %edi
	call	putchar@PLT
.L33:
	subl	$1, 40(%rsp)
	je	.L27
	movl	n(%rip), %eax
	jmp	.L60
	.p2align 4,,10
	.p2align 3
.L122:
	movl	0(%r13), %edx
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	leaq	4+a(%rip), %rbx
	call	__printf_chk@PLT
	cmpl	$1, 152(%rsp)
	movq	192(%rsp), %rbp
	jle	.L29
	.p2align 4,,10
	.p2align 3
.L28:
	movl	(%rbx), %edx
	movq	%r14, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__printf_chk@PLT
	cmpq	%rbp, %rbx
	jne	.L28
.L29:
	movl	$10, %edi
	call	putchar@PLT
.L27:
	subl	$1, 28(%rsp)
	subl	$1, 44(%rsp)
	je	.L21
	movl	n(%rip), %eax
	jmp	.L61
	.p2align 4,,10
	.p2align 3
.L121:
	movl	0(%r13), %edx
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	leaq	4+a(%rip), %rbx
	call	__printf_chk@PLT
	cmpl	$1, 156(%rsp)
	movq	200(%rsp), %rbp
	jle	.L23
	.p2align 4,,10
	.p2align 3
.L22:
	movl	(%rbx), %edx
	movq	%r14, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__printf_chk@PLT
	cmpq	%rbp, %rbx
	jne	.L22
.L23:
	movl	$10, %edi
	call	putchar@PLT
.L21:
	subl	$1, 68(%rsp)
	je	.L15
	movl	n(%rip), %eax
	jmp	.L62
	.p2align 4,,10
	.p2align 3
.L125:
	movl	0(%r13), %edx
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	leaq	4+a(%rip), %rbx
	call	__printf_chk@PLT
	cmpl	$1, 84(%rsp)
	movq	144(%rsp), %rbp
	jle	.L47
	.p2align 4,,10
	.p2align 3
.L46:
	movl	(%rbx), %edx
	movq	%r14, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__printf_chk@PLT
	cmpq	%rbp, %rbx
	jne	.L46
.L47:
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L45
	.p2align 4,,10
	.p2align 3
.L120:
	movl	0(%r13), %edx
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	leaq	4+a(%rip), %rbx
	call	__printf_chk@PLT
	cmpl	$1, 184(%rsp)
	movq	208(%rsp), %rbp
	jle	.L17
	.p2align 4,,10
	.p2align 3
.L16:
	movl	(%rbx), %edx
	movq	%r14, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__printf_chk@PLT
	cmpq	%rbp, %rbx
	jne	.L16
.L17:
	movl	$10, %edi
	call	putchar@PLT
.L15:
	subl	$1, 60(%rsp)
	subl	$1, 92(%rsp)
	je	.L9
	movl	n(%rip), %eax
	jmp	.L63
.L119:
	movl	0(%r13), %edx
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	leaq	4+a(%rip), %rbx
	call	__printf_chk@PLT
	cmpl	$1, 188(%rsp)
	movq	216(%rsp), %rbp
	jle	.L11
	.p2align 4,,10
	.p2align 3
.L10:
	movl	(%rbx), %edx
	movq	%r14, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__printf_chk@PLT
	cmpq	%rbx, %rbp
	jne	.L10
.L11:
	movl	$10, %edi
	call	putchar@PLT
.L9:
	subl	$1, 108(%rsp)
	je	.L1
	movl	n(%rip), %eax
	jmp	.L64
.L118:
	movl	a(%rip), %edx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC0(%rip), %rsi
	call	__printf_chk@PLT
	cmpl	$1, 80(%rsp)
	jle	.L5
	movl	80(%rsp), %eax
	leaq	4+a(%rip), %rbx
	leaq	.LC1(%rip), %rbp
	leal	-2(%rax), %edx
	leaq	4(%rbx), %rax
	leaq	(%rax,%rdx,4), %r12
	.p2align 4,,10
	.p2align 3
.L4:
	movl	(%rbx), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__printf_chk@PLT
	cmpq	%r12, %rbx
	jne	.L4
.L5:
	addq	$232, %rsp
	.cfi_def_cfa_offset 56
	movl	$10, %edi
	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
	jmp	putchar@PLT
	.cfi_endproc
.LFE23:
	.size	output, .-output
	.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
	leaq	.LC0(%rip), %r13
	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
.L140:
	leaq	n(%rip), %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	n(%rip), %eax
	testl	%eax, %eax
	je	.L129
	jle	.L140
	movl	%eax, %ebp
	leaq	a(%rip), %r12
	movl	%ebp, (%r12)
	cmpl	%ebp, %eax
	je	.L150
	.p2align 4,,10
	.p2align 3
.L131:
	jle	.L132
	movl	%ebp, %r15d
	leal	(%rbp,%rbp), %r14d
	movl	%r15d, 4+a(%rip)
	cmpl	%r14d, %eax
	je	.L151
.L134:
	jle	.L135
	movl	%r15d, %ebx
.L136:
	leal	(%rbx,%r14), %esi
	movl	%ebx, %edi
	movl	$3, %edx
	movl	%ebx, 8+a(%rip)
	call	output
	subl	$1, %ebx
	jne	.L136
.L135:
	subl	$1, %r14d
	subl	$1, %r15d
	je	.L132
.L152:
	movl	n(%rip), %eax
	movl	%r15d, 4+a(%rip)
	cmpl	%r14d, %eax
	jne	.L134
.L151:
	movl	(%r12), %edx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	subl	$1, %r14d
	call	__printf_chk@PLT
	movl	4+a(%rip), %edx
	leaq	.LC1(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	movl	$10, %edi
	call	putchar@PLT
	subl	$1, %r15d
	jne	.L152
	.p2align 4,,10
	.p2align 3
.L132:
	subl	$1, %ebp
	je	.L140
	movl	n(%rip), %eax
	movl	%ebp, (%r12)
	cmpl	%ebp, %eax
	jne	.L131
.L150:
	movl	%ebp, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L132
.L129:
	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	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 120
a:
	.zero	120
	.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	"%d"
.LC1:
	.string	" %d"
	.text
	.p2align 4
	.globl	output
	.type	output, @function
output:
.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
	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	$232, %rsp
	.cfi_def_cfa_offset 288
	movl	n(%rip), %eax
	movl	%edi, 108(%rsp)
	movl	%esi, 132(%rsp)
	movl	%edx, 80(%rsp)
	cmpl	%esi, %eax
	je	.L118
	jle	.L1
	movl	108(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L1
	movl	%edx, %edi
	leal	1(%rdx), %esi
	leal	2(%rdx), %ebx
	leal	3(%rdx), %r8d
	leal	4(%rdx), %r9d
	movl	%esi, 188(%rsp)
	leal	5(%rdx), %r10d
	leal	6(%rdx), %ecx
	movl	%ebx, 184(%rsp)
	leal	7(%rdx), %edx
	movl	%ecx, 104(%rsp)
	leaq	a(%rip), %r13
	movl	%edx, 84(%rsp)
	leal	8(%rdi), %edx
	leaq	.LC1(%rip), %r14
	movl	%edx, 64(%rsp)
	leaq	8+a(%rip), %rdx
	leaq	(%rdx,%rcx,4), %rcx
	movl	%r8d, 156(%rsp)
	movq	%rcx, 120(%rsp)
	movl	%r10d, %ecx
	leaq	(%rdx,%rcx,4), %rcx
	movl	%r9d, 152(%rsp)
	movq	%rcx, 144(%rsp)
	movl	%r9d, %ecx
	leaq	(%rdx,%rcx,4), %rcx
	movl	%r10d, 128(%rsp)
	movq	%rcx, 160(%rsp)
	movl	%r8d, %ecx
	leaq	(%rdx,%rcx,4), %rcx
	movq	%rcx, 176(%rsp)
	movl	%ebx, %ecx
	leaq	(%rdx,%rcx,4), %rcx
	movq	%rcx, 192(%rsp)
	movl	%esi, %ecx
	leaq	(%rdx,%rcx,4), %rsi
	movl	%edi, %ecx
	movq	%rsi, 200(%rsp)
	leaq	(%rdx,%rcx,4), %rsi
	leal	-1(%rdi), %ecx
	movslq	%edi, %rdi
	leaq	(%rdx,%rcx,4), %rdx
	movq	%rsi, 208(%rsp)
	movq	%rdx, 216(%rsp)
	movq	%rdi, 168(%rsp)
.L64:
	movl	108(%rsp), %ecx
	movl	132(%rsp), %edx
	movq	168(%rsp), %rsi
	addl	%ecx, %edx
	movl	%ecx, 0(%r13,%rsi,4)
	cmpl	%edx, %eax
	je	.L119
	jle	.L9
	movl	%ecx, %edx
	movl	132(%rsp), %edi
	movl	%edx, 92(%rsp)
	movslq	188(%rsp), %rdx
	leal	(%rdi,%rcx,2), %ecx
	movl	%ecx, 60(%rsp)
	movq	%rdx, 136(%rsp)
.L63:
	movq	136(%rsp), %rdi
	movl	92(%rsp), %esi
	movl	%esi, 0(%r13,%rdi,4)
	cmpl	60(%rsp), %eax
	je	.L120
	jle	.L15
	movslq	184(%rsp), %rcx
	movl	%esi, 68(%rsp)
	movq	%rcx, 112(%rsp)
.L62:
	movl	68(%rsp), %ecx
	movl	60(%rsp), %edx
	movq	112(%rsp), %rsi
	addl	%ecx, %edx
	movl	%ecx, 0(%r13,%rsi,4)
	cmpl	%edx, %eax
	je	.L121
	jle	.L21
	movl	60(%rsp), %edx
	movl	%ecx, 44(%rsp)
	leal	(%rdx,%rcx,2), %edx
	movslq	156(%rsp), %rcx
	movl	%edx, 28(%rsp)
	movq	%rcx, 96(%rsp)
.L61:
	movq	96(%rsp), %rsi
	movl	44(%rsp), %ecx
	movl	%ecx, 0(%r13,%rsi,4)
	cmpl	28(%rsp), %eax
	je	.L122
	jle	.L27
	movslq	152(%rsp), %rdx
	movl	%ecx, 40(%rsp)
	movq	%rdx, 72(%rsp)
.L60:
	movl	40(%rsp), %ecx
	movl	28(%rsp), %edx
	movq	72(%rsp), %rdi
	addl	%ecx, %edx
	movl	%ecx, 0(%r13,%rdi,4)
	cmpl	%edx, %eax
	je	.L123
	jle	.L33
	movl	28(%rsp), %edx
	movl	%ecx, %esi
	movl	%esi, 24(%rsp)
	leal	(%rdx,%rcx,2), %ecx
	movslq	128(%rsp), %rdx
	movl	%ecx, 4(%rsp)
	movq	%rdx, 48(%rsp)
.L59:
	movq	48(%rsp), %rcx
	movl	24(%rsp), %edi
	movl	%edi, 0(%r13,%rcx,4)
	cmpl	4(%rsp), %eax
	je	.L124
	jle	.L39
	movslq	104(%rsp), %rcx
	movl	%edi, %r12d
	movq	%rcx, 32(%rsp)
	movslq	84(%rsp), %rcx
	movq	%rcx, 16(%rsp)
.L58:
	movl	4(%rsp), %ecx
	leal	(%r12,%rcx), %edx
	movq	32(%rsp), %rcx
	movl	%r12d, 0(%r13,%rcx,4)
	cmpl	%edx, %eax
	je	.L125
	jle	.L45
	movl	4(%rsp), %ecx
	movl	80(%rsp), %edi
	movl	%r12d, %ebp
	movl	%r12d, 56(%rsp)
	leal	(%rcx,%r12,2), %ebx
	movslq	64(%rsp), %rcx
	leal	9(%rdi), %r15d
	movq	%rcx, 8(%rsp)
	movq	16(%rsp), %rcx
	movl	%ebp, 0(%r13,%rcx,4)
	cmpl	%ebx, %eax
	je	.L126
.L49:
	jle	.L51
	movl	%r15d, %eax
	movl	%ebp, %r12d
	movl	%ebp, %r15d
	movl	%eax, %ebp
.L55:
	movq	8(%rsp), %rax
	leal	(%r12,%rbx), %esi
	movl	%r12d, %edi
	movl	%ebp, %edx
	movl	%r12d, 0(%r13,%rax,4)
	call	output
	subl	$1, %r12d
	jne	.L55
	movl	%ebp, %eax
	movl	%r15d, %ebp
	movl	%eax, %r15d
.L51:
	subl	$1, %ebx
	subl	$1, %ebp
	je	.L115
.L127:
	movq	16(%rsp), %rcx
	movl	n(%rip), %eax
	movl	%ebp, 0(%r13,%rcx,4)
	cmpl	%ebx, %eax
	jne	.L49
.L126:
	movl	0(%r13), %edx
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	leaq	4+a(%rip), %r12
	call	__printf_chk@PLT
	cmpl	$1, 64(%rsp)
	jle	.L53
	movl	%ebx, 88(%rsp)
	movq	%r12, %rbx
	movq	120(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L52:
	movl	(%rbx), %edx
	movq	%r14, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__printf_chk@PLT
	cmpq	%r12, %rbx
	jne	.L52
	movl	88(%rsp), %ebx
.L53:
	movl	$10, %edi
	subl	$1, %ebx
	call	putchar@PLT
	subl	$1, %ebp
	jne	.L127
.L115:
	movl	56(%rsp), %r12d
.L45:
	subl	$1, %r12d
	je	.L39
	movl	n(%rip), %eax
	jmp	.L58
	.p2align 4,,10
	.p2align 3
.L1:
	addq	$232, %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
.L124:
	.cfi_restore_state
	movl	0(%r13), %edx
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	leaq	4+a(%rip), %rbx
	call	__printf_chk@PLT
	cmpl	$1, 104(%rsp)
	movq	160(%rsp), %rbp
	jle	.L41
	.p2align 4,,10
	.p2align 3
.L40:
	movl	(%rbx), %edx
	movq	%r14, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__printf_chk@PLT
	cmpq	%rbp, %rbx
	jne	.L40
.L41:
	movl	$10, %edi
	call	putchar@PLT
.L39:
	subl	$1, 4(%rsp)
	subl	$1, 24(%rsp)
	je	.L33
	movl	n(%rip), %eax
	jmp	.L59
	.p2align 4,,10
	.p2align 3
.L123:
	movl	0(%r13), %edx
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	leaq	4+a(%rip), %rbx
	call	__printf_chk@PLT
	cmpl	$1, 128(%rsp)
	movq	176(%rsp), %rbp
	jle	.L35
	.p2align 4,,10
	.p2align 3
.L34:
	movl	(%rbx), %edx
	movq	%r14, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__printf_chk@PLT
	cmpq	%rbp, %rbx
	jne	.L34
.L35:
	movl	$10, %edi
	call	putchar@PLT
.L33:
	subl	$1, 40(%rsp)
	je	.L27
	movl	n(%rip), %eax
	jmp	.L60
	.p2align 4,,10
	.p2align 3
.L122:
	movl	0(%r13), %edx
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	leaq	4+a(%rip), %rbx
	call	__printf_chk@PLT
	cmpl	$1, 152(%rsp)
	movq	192(%rsp), %rbp
	jle	.L29
	.p2align 4,,10
	.p2align 3
.L28:
	movl	(%rbx), %edx
	movq	%r14, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__printf_chk@PLT
	cmpq	%rbp, %rbx
	jne	.L28
.L29:
	movl	$10, %edi
	call	putchar@PLT
.L27:
	subl	$1, 28(%rsp)
	subl	$1, 44(%rsp)
	je	.L21
	movl	n(%rip), %eax
	jmp	.L61
	.p2align 4,,10
	.p2align 3
.L121:
	movl	0(%r13), %edx
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	leaq	4+a(%rip), %rbx
	call	__printf_chk@PLT
	cmpl	$1, 156(%rsp)
	movq	200(%rsp), %rbp
	jle	.L23
	.p2align 4,,10
	.p2align 3
.L22:
	movl	(%rbx), %edx
	movq	%r14, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__printf_chk@PLT
	cmpq	%rbp, %rbx
	jne	.L22
.L23:
	movl	$10, %edi
	call	putchar@PLT
.L21:
	subl	$1, 68(%rsp)
	je	.L15
	movl	n(%rip), %eax
	jmp	.L62
	.p2align 4,,10
	.p2align 3
.L125:
	movl	0(%r13), %edx
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	leaq	4+a(%rip), %rbx
	call	__printf_chk@PLT
	cmpl	$1, 84(%rsp)
	movq	144(%rsp), %rbp
	jle	.L47
	.p2align 4,,10
	.p2align 3
.L46:
	movl	(%rbx), %edx
	movq	%r14, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__printf_chk@PLT
	cmpq	%rbp, %rbx
	jne	.L46
.L47:
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L45
	.p2align 4,,10
	.p2align 3
.L120:
	movl	0(%r13), %edx
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	leaq	4+a(%rip), %rbx
	call	__printf_chk@PLT
	cmpl	$1, 184(%rsp)
	movq	208(%rsp), %rbp
	jle	.L17
	.p2align 4,,10
	.p2align 3
.L16:
	movl	(%rbx), %edx
	movq	%r14, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__printf_chk@PLT
	cmpq	%rbp, %rbx
	jne	.L16
.L17:
	movl	$10, %edi
	call	putchar@PLT
.L15:
	subl	$1, 60(%rsp)
	subl	$1, 92(%rsp)
	je	.L9
	movl	n(%rip), %eax
	jmp	.L63
.L119:
	movl	0(%r13), %edx
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	leaq	4+a(%rip), %rbx
	call	__printf_chk@PLT
	cmpl	$1, 188(%rsp)
	movq	216(%rsp), %rbp
	jle	.L11
	.p2align 4,,10
	.p2align 3
.L10:
	movl	(%rbx), %edx
	movq	%r14, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__printf_chk@PLT
	cmpq	%rbx, %rbp
	jne	.L10
.L11:
	movl	$10, %edi
	call	putchar@PLT
.L9:
	subl	$1, 108(%rsp)
	je	.L1
	movl	n(%rip), %eax
	jmp	.L64
.L118:
	movl	a(%rip), %edx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC0(%rip), %rsi
	call	__printf_chk@PLT
	cmpl	$1, 80(%rsp)
	jle	.L5
	movl	80(%rsp), %eax
	leaq	4+a(%rip), %rbx
	leaq	.LC1(%rip), %rbp
	leal	-2(%rax), %edx
	leaq	4(%rbx), %rax
	leaq	(%rax,%rdx,4), %r12
	.p2align 4,,10
	.p2align 3
.L4:
	movl	(%rbx), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__printf_chk@PLT
	cmpq	%r12, %rbx
	jne	.L4
.L5:
	addq	$232, %rsp
	.cfi_def_cfa_offset 56
	movl	$10, %edi
	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
	jmp	putchar@PLT
	.cfi_endproc
.LFE23:
	.size	output, .-output
	.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
	leaq	.LC0(%rip), %r13
	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
.L140:
	leaq	n(%rip), %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	n(%rip), %eax
	testl	%eax, %eax
	je	.L129
	jle	.L140
	movl	%eax, %ebp
	leaq	a(%rip), %r12
	movl	%ebp, (%r12)
	cmpl	%ebp, %eax
	je	.L150
	.p2align 4,,10
	.p2align 3
.L131:
	jle	.L132
	movl	%ebp, %r15d
	leal	(%rbp,%rbp), %r14d
	movl	%r15d, 4+a(%rip)
	cmpl	%r14d, %eax
	je	.L151
.L134:
	jle	.L135
	movl	%r15d, %ebx
.L136:
	leal	(%rbx,%r14), %esi
	movl	%ebx, %edi
	movl	$3, %edx
	movl	%ebx, 8+a(%rip)
	call	output
	subl	$1, %ebx
	jne	.L136
.L135:
	subl	$1, %r14d
	subl	$1, %r15d
	je	.L132
.L152:
	movl	n(%rip), %eax
	movl	%r15d, 4+a(%rip)
	cmpl	%r14d, %eax
	jne	.L134
.L151:
	movl	(%r12), %edx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	subl	$1, %r14d
	call	__printf_chk@PLT
	movl	4+a(%rip), %edx
	leaq	.LC1(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	movl	$10, %edi
	call	putchar@PLT
	subl	$1, %r15d
	jne	.L152
	.p2align 4,,10
	.p2align 3
.L132:
	subl	$1, %ebp
	je	.L140
	movl	n(%rip), %eax
	movl	%ebp, (%r12)
	cmpl	%ebp, %eax
	jne	.L131
.L150:
	movl	%ebp, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L132
.L129:
	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	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 120
a:
	.zero	120
	.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>

int n;
int a[30];

void output(int num, int sum, int i)
{
	int j;
	
	if (sum == n){
		printf("%d", a[0]);
		for (j = 1; j < i; j++){
			printf(" %d", a[j]);
		}
		printf("\n");
	}
	else if (sum < n){
		for (j = num; j >= 1; j--){
			output(a[i] = j, sum + j, i + 1);
		}
	}
}

int main(void)
{
	int i;
	
	while (1){
		scanf("%d", &n);
		if (!n){
			break;
		}
		
		for (i = n; i >= 1; i--){
			output(a[0] = i, i, 1);
		}
	}
	
	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>

int n;
int a[30];

void output(int num, int sum, int i)
{
	int j;
	
	if (sum == n){
		printf("%d", a[0]);
		for (j = 1; j < i; j++){
			printf(" %d", a[j]);
		}
		printf("\n");
	}
	else if (sum < n){
		for (j = num; j >= 1; j--){
			output(a[i] = j, sum + j, i + 1);
		}
	}
}

int main(void)
{
	int i;
	
	while (1){
		scanf("%d", &n);
		if (!n){
			break;
		}
		
		for (i = n; i >= 1; i--){
			output(a[0] = i, i, 1);
		}
	}
	
	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	a
	.align 32
	.type	a, @object
	.size	a, 120
a:
	.zero	120
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	" %d"
	.text
	.globl	output
	.type	output, @function
output:
.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)
	movl	n(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jne	.L2
	movl	a(%rip), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$1, -4(%rbp)
	jmp	.L3
.L4:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -4(%rbp)
.L3:
	movl	-4(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L4
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L8
.L2:
	movl	n(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jge	.L8
	movl	-20(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L6
.L7:
	movl	-28(%rbp), %eax
	leal	1(%rax), %edx
	movl	-24(%rbp), %ecx
	movl	-4(%rbp), %eax
	addl	%eax, %ecx
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdi
	leaq	a(%rip), %rsi
	movl	-4(%rbp), %eax
	movl	%eax, (%rdi,%rsi)
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rsi
	leaq	a(%rip), %rax
	movl	(%rsi,%rax), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	output
	subl	$1, -4(%rbp)
.L6:
	cmpl	$0, -4(%rbp)
	jg	.L7
.L8:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	output, .-output
	.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
.L14:
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	n(%rip), %eax
	testl	%eax, %eax
	je	.L17
	movl	n(%rip), %eax
	movl	%eax, -4(%rbp)
	jmp	.L12
.L13:
	movl	-4(%rbp), %eax
	movl	%eax, a(%rip)
	movl	a(%rip), %eax
	movl	-4(%rbp), %ecx
	movl	$1, %edx
	movl	%ecx, %esi
	movl	%eax, %edi
	call	output
	subl	$1, -4(%rbp)
.L12:
	cmpl	$0, -4(%rbp)
	jg	.L13
	jmp	.L14
.L17:
	nop
	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	a
	.align 32
	.type	a, @object
	.size	a, 120
a:
	.zero	120
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	" %d"
	.text
	.globl	output
	.type	output, @function
output:
.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)
	movl	n(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jne	.L2
	movl	a(%rip), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$1, -4(%rbp)
	jmp	.L3
.L4:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -4(%rbp)
.L3:
	movl	-4(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L4
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L8
.L2:
	movl	n(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jge	.L8
	movl	-20(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L6
.L7:
	movl	-28(%rbp), %eax
	leal	1(%rax), %edx
	movl	-24(%rbp), %ecx
	movl	-4(%rbp), %eax
	addl	%eax, %ecx
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdi
	leaq	a(%rip), %rsi
	movl	-4(%rbp), %eax
	movl	%eax, (%rdi,%rsi)
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rsi
	leaq	a(%rip), %rax
	movl	(%rsi,%rax), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	output
	subl	$1, -4(%rbp)
.L6:
	cmpl	$0, -4(%rbp)
	jg	.L7
.L8:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	output, .-output
	.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
.L14:
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	n(%rip), %eax
	testl	%eax, %eax
	je	.L17
	movl	n(%rip), %eax
	movl	%eax, -4(%rbp)
	jmp	.L12
.L13:
	movl	-4(%rbp), %eax
	movl	%eax, a(%rip)
	movl	a(%rip), %eax
	movl	-4(%rbp), %ecx
	movl	$1, %edx
	movl	%ecx, %esi
	movl	%eax, %edi
	call	output
	subl	$1, -4(%rbp)
.L12:
	cmpl	$0, -4(%rbp)
	jg	.L13
	jmp	.L14
.L17:
	nop
	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:
