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<stdlib.h>

int p,q,a,n;

int dfs(int b,int s,int c,int now)
{
	int i,r=0;
	if(b*p==q*s)
		return 1;
	if(c==n)
		return 0;
	if(b*p<q*s)
		return 0;
	for(i=now;i*b<=a;i++)
		r+=dfs(b*i,(s*i)+b,c+1,i);
	return r;
}

int main()
{
	for(;scanf("%d%d%d%d",&p,&q,&a,&n),q;)
		printf("%d\n",dfs(1,0,0,0));
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	p
	.bss
	.align 4
	.type	p, @object
	.size	p, 4
p:
	.zero	4
	.globl	q
	.align 4
	.type	q, @object
	.size	q, 4
q:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.text
	.globl	dfs
	.type	dfs, @function
dfs:
.LFB6:
	.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	%ecx, -32(%rbp)
	movl	$0, -4(%rbp)
	movl	p(%rip), %eax
	imull	-20(%rbp), %eax
	movl	%eax, %edx
	movl	q(%rip), %eax
	imull	-24(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L2
	movl	$1, %eax
	jmp	.L3
.L2:
	movl	n(%rip), %eax
	cmpl	%eax, -28(%rbp)
	jne	.L4
	movl	$0, %eax
	jmp	.L3
.L4:
	movl	p(%rip), %eax
	imull	-20(%rbp), %eax
	movl	%eax, %edx
	movl	q(%rip), %eax
	imull	-24(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L5
	movl	$0, %eax
	jmp	.L3
.L5:
	movl	-32(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L6
.L7:
	movl	-28(%rbp), %eax
	leal	1(%rax), %edi
	movl	-24(%rbp), %eax
	imull	-8(%rbp), %eax
	movl	%eax, %edx
	movl	-20(%rbp), %eax
	leal	(%rdx,%rax), %esi
	movl	-20(%rbp), %eax
	imull	-8(%rbp), %eax
	movl	-8(%rbp), %edx
	movl	%edx, %ecx
	movl	%edi, %edx
	movl	%eax, %edi
	call	dfs
	addl	%eax, -4(%rbp)
	addl	$1, -8(%rbp)
.L6:
	movl	-8(%rbp), %eax
	imull	-20(%rbp), %eax
	movl	%eax, %edx
	movl	a(%rip), %eax
	cmpl	%eax, %edx
	jle	.L7
	movl	-4(%rbp), %eax
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	dfs, .-dfs
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d%d%d%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	jmp	.L9
.L10:
	movl	$0, %ecx
	movl	$0, %edx
	movl	$0, %esi
	movl	$1, %edi
	call	dfs
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L9:
	leaq	n(%rip), %r8
	leaq	a(%rip), %rax
	movq	%rax, %rcx
	leaq	q(%rip), %rax
	movq	%rax, %rdx
	leaq	p(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	q(%rip), %eax
	testl	%eax, %eax
	jne	.L10
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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
	.type	dfs.part.0, @function
dfs.part.0:
.LFB41:
	.cfi_startproc
	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
	movl	%edi, %ebx
	subq	$168, %rsp
	.cfi_def_cfa_offset 224
	movl	a(%rip), %r10d
	movl	%edi, 112(%rsp)
	imull	%ecx, %edi
	movl	%esi, 116(%rsp)
	movl	%edx, 128(%rsp)
	movl	%edi, 44(%rsp)
	movl	$0, 124(%rsp)
	cmpl	%edi, %r10d
	jl	.L1
	movl	n(%rip), %r8d
	leal	1(%rdx), %eax
	movl	q(%rip), %r14d
	movl	p(%rip), %r11d
	cmpl	%r8d, %eax
	movl	%ebx, %eax
	movl	%r14d, 72(%rsp)
	sete	135(%rsp)
	addl	%edi, %eax
	addl	$5, %edx
	movl	%eax, 84(%rsp)
	movl	%esi, %eax
	imull	%ecx, %esi
	imull	%r14d, %eax
	movl	%r8d, (%rsp)
	movl	%eax, 120(%rsp)
	movl	%esi, %eax
	addl	%ebx, %eax
	movl	%ecx, %ebx
	imull	%eax, %r14d
	movl	%eax, 64(%rsp)
	movl	%r14d, 88(%rsp)
	movl	%r14d, 76(%rsp)
.L17:
	movl	44(%rsp), %ecx
	movl	%ecx, %eax
	imull	%r11d, %eax
	cmpl	88(%rsp), %eax
	je	.L3
	leal	1(%rbx), %esi
	movl	%esi, 96(%rsp)
	jl	.L4
	cmpb	$0, 135(%rsp)
	jne	.L4
	movl	%ecx, %edi
	movl	%ecx, %eax
	imull	%ebx, %edi
	movl	%edi, 16(%rsp)
	cmpl	%r10d, %edi
	jg	.L4
	movl	128(%rsp), %r14d
	movl	72(%rsp), %edi
	movl	$0, 108(%rsp)
	leal	2(%r14), %ecx
	movl	%ecx, 104(%rsp)
	movl	%esi, %ecx
	movl	%eax, %esi
	imull	%eax, %ecx
	movl	64(%rsp), %eax
	imull	%ebx, %eax
	movl	%ecx, 48(%rsp)
	addl	%esi, %eax
	imull	%eax, %edi
	movl	%eax, 28(%rsp)
	leal	3(%r14), %eax
	movl	%eax, 100(%rsp)
	movl	%edi, 52(%rsp)
	movl	%edi, 36(%rsp)
.L16:
	movl	16(%rsp), %ecx
	movl	52(%rsp), %esi
	movl	%ecx, %eax
	imull	%r11d, %eax
	cmpl	%esi, %eax
	je	.L5
	leal	1(%rbx), %edi
	movl	104(%rsp), %r8d
	movl	%edi, 68(%rsp)
	cmpl	%r8d, (%rsp)
	je	.L6
	cmpl	%esi, %eax
	jl	.L6
	movl	%ecx, %r8d
	imull	%ebx, %r8d
	cmpl	%r10d, %r8d
	jg	.L6
	movl	28(%rsp), %eax
	movl	72(%rsp), %r9d
	imull	%ecx, %edi
	movl	%r8d, %r15d
	movl	$0, 92(%rsp)
	imull	%ebx, %eax
	movl	%edi, 24(%rsp)
	addl	%ecx, %eax
	imull	%eax, %r9d
	movl	%eax, 8(%rsp)
	movl	128(%rsp), %eax
	addl	$4, %eax
	movl	%eax, 80(%rsp)
	movl	%r10d, %eax
	movl	%r9d, %r10d
	movl	%r9d, 20(%rsp)
	movl	%eax, %r9d
.L15:
	movl	%r11d, %eax
	imull	%r15d, %eax
	cmpl	%eax, 20(%rsp)
	je	.L7
	leal	1(%rbx), %eax
	movl	%eax, 32(%rsp)
	jg	.L8
	movl	100(%rsp), %ecx
	cmpl	%ecx, (%rsp)
	je	.L8
	movl	%ebx, %ebp
	imull	%r15d, %ebp
	cmpl	%ebp, %r9d
	jl	.L8
	movl	8(%rsp), %r12d
	imull	%r15d, %eax
	movl	%r15d, 40(%rsp)
	movl	$0, 60(%rsp)
	imull	%ebx, %r12d
	movl	%eax, 4(%rsp)
	movl	72(%rsp), %eax
	addl	%r15d, %r12d
	imull	%r12d, %eax
	movl	%eax, %r8d
	movl	%eax, %r15d
.L14:
	movl	%r11d, %eax
	imull	%ebp, %eax
	cmpl	%r8d, %eax
	je	.L9
	leal	1(%rbx), %eax
	movl	%eax, 12(%rsp)
	jl	.L10
	movl	80(%rsp), %ecx
	cmpl	%ecx, (%rsp)
	je	.L10
	movl	%ebx, %edi
	imull	%ebp, %edi
	cmpl	%edi, %r9d
	jl	.L10
	movl	%ebx, %esi
	movl	72(%rsp), %r13d
	imull	%ebp, %eax
	movl	$0, 56(%rsp)
	imull	%r12d, %esi
	movl	%eax, %r14d
	addl	%ebp, %esi
	imull	%esi, %r13d
.L13:
	movl	%r11d, %eax
	imull	%edi, %eax
	cmpl	%r13d, %eax
	je	.L38
	jl	.L12
	cmpl	%edx, (%rsp)
	je	.L12
	movl	%ebx, %ecx
	movl	%r8d, 156(%rsp)
	movl	%r9d, 152(%rsp)
	movl	%r10d, 148(%rsp)
	movl	%r11d, 144(%rsp)
	movl	%edx, 140(%rsp)
	movl	%esi, 136(%rsp)
	call	dfs.part.0
	addl	%eax, 56(%rsp)
	movl	156(%rsp), %r8d
	movl	152(%rsp), %r9d
	movl	148(%rsp), %r10d
	movl	144(%rsp), %r11d
	movl	140(%rsp), %edx
	movl	136(%rsp), %esi
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%r14d, %edi
	addl	$1, %ebx
	addl	%ebp, %r14d
	addl	%r15d, %r13d
	addl	%r12d, %esi
	cmpl	%r9d, %edi
	jle	.L13
	movl	56(%rsp), %ebx
	addl	%ebx, 60(%rsp)
.L10:
	movl	4(%rsp), %eax
	movl	40(%rsp), %ecx
	addl	%r10d, %r8d
	addl	%r10d, %r15d
	movl	12(%rsp), %ebx
	addl	8(%rsp), %r12d
	movl	%eax, %ebp
	addl	%ecx, %eax
	movl	%eax, 4(%rsp)
	cmpl	%r9d, %ebp
	jle	.L14
	movl	60(%rsp), %ebx
	addl	%ebx, 92(%rsp)
.L8:
	movl	24(%rsp), %eax
	movl	16(%rsp), %esi
	movl	28(%rsp), %ecx
	movl	32(%rsp), %ebx
	movl	%eax, %r15d
	addl	%esi, %eax
	movl	36(%rsp), %esi
	addl	%ecx, 8(%rsp)
	addl	%esi, 20(%rsp)
	movl	%eax, 24(%rsp)
	addl	%esi, %r10d
	cmpl	%r9d, %r15d
	jle	.L15
	movl	92(%rsp), %ebx
	addl	%ebx, 108(%rsp)
	movl	%r9d, %r10d
.L6:
	movl	48(%rsp), %ecx
	movl	44(%rsp), %edi
	movl	68(%rsp), %ebx
	movl	%ecx, 16(%rsp)
	movl	%ecx, %eax
	addl	%edi, %ecx
	movl	%ecx, 48(%rsp)
	movl	76(%rsp), %ecx
	addl	%ecx, 52(%rsp)
	addl	%ecx, 36(%rsp)
	movl	64(%rsp), %ecx
	addl	%ecx, 28(%rsp)
	cmpl	%r10d, %eax
	jle	.L16
	movl	108(%rsp), %ebx
	addl	%ebx, 124(%rsp)
.L4:
	movl	84(%rsp), %edi
	movl	112(%rsp), %ecx
	movl	120(%rsp), %esi
	movl	96(%rsp), %ebx
	movl	%edi, 44(%rsp)
	movl	%edi, %eax
	addl	%ecx, %edi
	addl	%esi, 88(%rsp)
	addl	%esi, 76(%rsp)
	movl	116(%rsp), %esi
	movl	%edi, 84(%rsp)
	addl	%esi, 64(%rsp)
	cmpl	%r10d, %eax
	jle	.L17
.L1:
	movl	124(%rsp), %eax
	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
	.p2align 4,,10
	.p2align 3
.L38:
	.cfi_restore_state
	addl	$1, 56(%rsp)
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L9:
	leal	1(%rbx), %eax
	addl	$1, 60(%rsp)
	movl	%eax, 12(%rsp)
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L7:
	leal	1(%rbx), %eax
	addl	$1, 92(%rsp)
	movl	%eax, 32(%rsp)
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L5:
	leal	1(%rbx), %eax
	addl	$1, 108(%rsp)
	movl	%eax, 68(%rsp)
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	leal	1(%rbx), %eax
	addl	$1, 124(%rsp)
	movl	%eax, 96(%rsp)
	jmp	.L4
	.cfi_endproc
.LFE41:
	.size	dfs.part.0, .-dfs.part.0
	.p2align 4
	.globl	dfs
	.type	dfs, @function
dfs:
.LFB39:
	.cfi_startproc
	endbr64
	movl	p(%rip), %r8d
	movl	q(%rip), %eax
	imull	%edi, %r8d
	imull	%esi, %eax
	cmpl	%eax, %r8d
	je	.L41
	cmpl	%edx, n(%rip)
	je	.L42
	cmpl	%eax, %r8d
	jl	.L42
	jmp	dfs.part.0
	.p2align 4,,10
	.p2align 3
.L42:
	xorl	%eax, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L41:
	movl	$1, %eax
	ret
	.cfi_endproc
.LFE39:
	.size	dfs, .-dfs
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d%d%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.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	$40, %rsp
	.cfi_def_cfa_offset 96
	.p2align 4,,10
	.p2align 3
.L44:
	leaq	n(%rip), %r8
	leaq	a(%rip), %rcx
	xorl	%eax, %eax
	leaq	q(%rip), %rdx
	leaq	p(%rip), %rsi
	leaq	.LC1(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	q(%rip), %eax
	movl	%eax, 16(%rsp)
	testl	%eax, %eax
	je	.L61
	movl	p(%rip), %eax
	movl	$1, %r15d
	movl	%eax, 20(%rsp)
	testl	%eax, %eax
	je	.L45
	movl	n(%rip), %edx
	movl	%edx, 24(%rsp)
	js	.L52
	testl	%edx, %edx
	je	.L52
	movl	a(%rip), %r12d
	xorl	%r15d, %r15d
	testl	%r12d, %r12d
	js	.L45
	movl	%r15d, 28(%rsp)
	xorl	%r14d, %r14d
	xorl	%ebx, %ebx
.L49:
	movl	16(%rsp), %eax
	cmpl	%r14d, %eax
	je	.L46
	leal	1(%rbx), %ecx
	cmpl	$1, 24(%rsp)
	movl	%ecx, 12(%rsp)
	je	.L47
	cmpl	%r14d, %eax
	jg	.L47
	movl	%ebx, %edi
	imull	%ebx, %edi
	cmpl	%edi, %r12d
	jl	.L47
	imull	%ebx, %ecx
	movl	%ebx, %r15d
	xorl	%r13d, %r13d
	movl	%ecx, %ebp
.L48:
	leal	(%r15,%rbx), %esi
	movl	%r15d, %ecx
	movl	$2, %edx
	addl	$1, %r15d
	call	dfs
	movl	%ebp, %edi
	addl	%ebx, %ebp
	addl	%eax, %r13d
	cmpl	%edi, %r12d
	jge	.L48
	addl	%r13d, 28(%rsp)
.L47:
	movl	12(%rsp), %ebx
	addl	20(%rsp), %r14d
	cmpl	%ebx, %r12d
	jge	.L49
	movl	28(%rsp), %r15d
.L45:
	movl	%r15d, %edx
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L44
	.p2align 4,,10
	.p2align 3
.L52:
	xorl	%r15d, %r15d
	jmp	.L45
	.p2align 4,,10
	.p2align 3
.L46:
	leal	1(%rbx), %eax
	addl	$1, 28(%rsp)
	movl	%eax, 12(%rsp)
	jmp	.L47
	.p2align 4,,10
	.p2align 3
.L61:
	addq	$40, %rsp
	.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
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	q
	.align 4
	.type	q, @object
	.size	q, 4
q:
	.zero	4
	.globl	p
	.align 4
	.type	p, @object
	.size	p, 4
p:
	.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
	.p2align 4
	.type	dfs.part.0, @function
dfs.part.0:
.LFB41:
	.cfi_startproc
	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
	movl	%edi, %ebx
	subq	$168, %rsp
	.cfi_def_cfa_offset 224
	movl	a(%rip), %r10d
	movl	%edi, 112(%rsp)
	imull	%ecx, %edi
	movl	%esi, 116(%rsp)
	movl	%edx, 128(%rsp)
	movl	%edi, 44(%rsp)
	movl	$0, 124(%rsp)
	cmpl	%edi, %r10d
	jl	.L1
	movl	n(%rip), %r8d
	leal	1(%rdx), %eax
	movl	q(%rip), %r14d
	movl	p(%rip), %r11d
	cmpl	%r8d, %eax
	movl	%ebx, %eax
	movl	%r14d, 72(%rsp)
	sete	135(%rsp)
	addl	%edi, %eax
	addl	$5, %edx
	movl	%eax, 84(%rsp)
	movl	%esi, %eax
	imull	%ecx, %esi
	imull	%r14d, %eax
	movl	%r8d, (%rsp)
	movl	%eax, 120(%rsp)
	movl	%esi, %eax
	addl	%ebx, %eax
	movl	%ecx, %ebx
	imull	%eax, %r14d
	movl	%eax, 64(%rsp)
	movl	%r14d, 88(%rsp)
	movl	%r14d, 76(%rsp)
.L17:
	movl	44(%rsp), %ecx
	movl	%ecx, %eax
	imull	%r11d, %eax
	cmpl	88(%rsp), %eax
	je	.L3
	leal	1(%rbx), %esi
	movl	%esi, 96(%rsp)
	jl	.L4
	cmpb	$0, 135(%rsp)
	jne	.L4
	movl	%ecx, %edi
	movl	%ecx, %eax
	imull	%ebx, %edi
	movl	%edi, 16(%rsp)
	cmpl	%r10d, %edi
	jg	.L4
	movl	128(%rsp), %r14d
	movl	72(%rsp), %edi
	movl	$0, 108(%rsp)
	leal	2(%r14), %ecx
	movl	%ecx, 104(%rsp)
	movl	%esi, %ecx
	movl	%eax, %esi
	imull	%eax, %ecx
	movl	64(%rsp), %eax
	imull	%ebx, %eax
	movl	%ecx, 48(%rsp)
	addl	%esi, %eax
	imull	%eax, %edi
	movl	%eax, 28(%rsp)
	leal	3(%r14), %eax
	movl	%eax, 100(%rsp)
	movl	%edi, 52(%rsp)
	movl	%edi, 36(%rsp)
.L16:
	movl	16(%rsp), %ecx
	movl	52(%rsp), %esi
	movl	%ecx, %eax
	imull	%r11d, %eax
	cmpl	%esi, %eax
	je	.L5
	leal	1(%rbx), %edi
	movl	104(%rsp), %r8d
	movl	%edi, 68(%rsp)
	cmpl	%r8d, (%rsp)
	je	.L6
	cmpl	%esi, %eax
	jl	.L6
	movl	%ecx, %r8d
	imull	%ebx, %r8d
	cmpl	%r10d, %r8d
	jg	.L6
	movl	28(%rsp), %eax
	movl	72(%rsp), %r9d
	imull	%ecx, %edi
	movl	%r8d, %r15d
	movl	$0, 92(%rsp)
	imull	%ebx, %eax
	movl	%edi, 24(%rsp)
	addl	%ecx, %eax
	imull	%eax, %r9d
	movl	%eax, 8(%rsp)
	movl	128(%rsp), %eax
	addl	$4, %eax
	movl	%eax, 80(%rsp)
	movl	%r10d, %eax
	movl	%r9d, %r10d
	movl	%r9d, 20(%rsp)
	movl	%eax, %r9d
.L15:
	movl	%r11d, %eax
	imull	%r15d, %eax
	cmpl	%eax, 20(%rsp)
	je	.L7
	leal	1(%rbx), %eax
	movl	%eax, 32(%rsp)
	jg	.L8
	movl	100(%rsp), %ecx
	cmpl	%ecx, (%rsp)
	je	.L8
	movl	%ebx, %ebp
	imull	%r15d, %ebp
	cmpl	%ebp, %r9d
	jl	.L8
	movl	8(%rsp), %r12d
	imull	%r15d, %eax
	movl	%r15d, 40(%rsp)
	movl	$0, 60(%rsp)
	imull	%ebx, %r12d
	movl	%eax, 4(%rsp)
	movl	72(%rsp), %eax
	addl	%r15d, %r12d
	imull	%r12d, %eax
	movl	%eax, %r8d
	movl	%eax, %r15d
.L14:
	movl	%r11d, %eax
	imull	%ebp, %eax
	cmpl	%r8d, %eax
	je	.L9
	leal	1(%rbx), %eax
	movl	%eax, 12(%rsp)
	jl	.L10
	movl	80(%rsp), %ecx
	cmpl	%ecx, (%rsp)
	je	.L10
	movl	%ebx, %edi
	imull	%ebp, %edi
	cmpl	%edi, %r9d
	jl	.L10
	movl	%ebx, %esi
	movl	72(%rsp), %r13d
	imull	%ebp, %eax
	movl	$0, 56(%rsp)
	imull	%r12d, %esi
	movl	%eax, %r14d
	addl	%ebp, %esi
	imull	%esi, %r13d
.L13:
	movl	%r11d, %eax
	imull	%edi, %eax
	cmpl	%r13d, %eax
	je	.L38
	jl	.L12
	cmpl	%edx, (%rsp)
	je	.L12
	movl	%ebx, %ecx
	movl	%r8d, 156(%rsp)
	movl	%r9d, 152(%rsp)
	movl	%r10d, 148(%rsp)
	movl	%r11d, 144(%rsp)
	movl	%edx, 140(%rsp)
	movl	%esi, 136(%rsp)
	call	dfs.part.0
	addl	%eax, 56(%rsp)
	movl	156(%rsp), %r8d
	movl	152(%rsp), %r9d
	movl	148(%rsp), %r10d
	movl	144(%rsp), %r11d
	movl	140(%rsp), %edx
	movl	136(%rsp), %esi
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%r14d, %edi
	addl	$1, %ebx
	addl	%ebp, %r14d
	addl	%r15d, %r13d
	addl	%r12d, %esi
	cmpl	%r9d, %edi
	jle	.L13
	movl	56(%rsp), %ebx
	addl	%ebx, 60(%rsp)
.L10:
	movl	4(%rsp), %eax
	movl	40(%rsp), %ecx
	addl	%r10d, %r8d
	addl	%r10d, %r15d
	movl	12(%rsp), %ebx
	addl	8(%rsp), %r12d
	movl	%eax, %ebp
	addl	%ecx, %eax
	movl	%eax, 4(%rsp)
	cmpl	%r9d, %ebp
	jle	.L14
	movl	60(%rsp), %ebx
	addl	%ebx, 92(%rsp)
.L8:
	movl	24(%rsp), %eax
	movl	16(%rsp), %esi
	movl	28(%rsp), %ecx
	movl	32(%rsp), %ebx
	movl	%eax, %r15d
	addl	%esi, %eax
	movl	36(%rsp), %esi
	addl	%ecx, 8(%rsp)
	addl	%esi, 20(%rsp)
	movl	%eax, 24(%rsp)
	addl	%esi, %r10d
	cmpl	%r9d, %r15d
	jle	.L15
	movl	92(%rsp), %ebx
	addl	%ebx, 108(%rsp)
	movl	%r9d, %r10d
.L6:
	movl	48(%rsp), %ecx
	movl	44(%rsp), %edi
	movl	68(%rsp), %ebx
	movl	%ecx, 16(%rsp)
	movl	%ecx, %eax
	addl	%edi, %ecx
	movl	%ecx, 48(%rsp)
	movl	76(%rsp), %ecx
	addl	%ecx, 52(%rsp)
	addl	%ecx, 36(%rsp)
	movl	64(%rsp), %ecx
	addl	%ecx, 28(%rsp)
	cmpl	%r10d, %eax
	jle	.L16
	movl	108(%rsp), %ebx
	addl	%ebx, 124(%rsp)
.L4:
	movl	84(%rsp), %edi
	movl	112(%rsp), %ecx
	movl	120(%rsp), %esi
	movl	96(%rsp), %ebx
	movl	%edi, 44(%rsp)
	movl	%edi, %eax
	addl	%ecx, %edi
	addl	%esi, 88(%rsp)
	addl	%esi, 76(%rsp)
	movl	116(%rsp), %esi
	movl	%edi, 84(%rsp)
	addl	%esi, 64(%rsp)
	cmpl	%r10d, %eax
	jle	.L17
.L1:
	movl	124(%rsp), %eax
	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
	.p2align 4,,10
	.p2align 3
.L38:
	.cfi_restore_state
	addl	$1, 56(%rsp)
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L9:
	leal	1(%rbx), %eax
	addl	$1, 60(%rsp)
	movl	%eax, 12(%rsp)
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L7:
	leal	1(%rbx), %eax
	addl	$1, 92(%rsp)
	movl	%eax, 32(%rsp)
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L5:
	leal	1(%rbx), %eax
	addl	$1, 108(%rsp)
	movl	%eax, 68(%rsp)
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	leal	1(%rbx), %eax
	addl	$1, 124(%rsp)
	movl	%eax, 96(%rsp)
	jmp	.L4
	.cfi_endproc
.LFE41:
	.size	dfs.part.0, .-dfs.part.0
	.p2align 4
	.globl	dfs
	.type	dfs, @function
dfs:
.LFB39:
	.cfi_startproc
	endbr64
	movl	p(%rip), %r8d
	movl	q(%rip), %eax
	imull	%edi, %r8d
	imull	%esi, %eax
	cmpl	%eax, %r8d
	je	.L41
	cmpl	%edx, n(%rip)
	je	.L42
	cmpl	%eax, %r8d
	jl	.L42
	jmp	dfs.part.0
	.p2align 4,,10
	.p2align 3
.L42:
	xorl	%eax, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L41:
	movl	$1, %eax
	ret
	.cfi_endproc
.LFE39:
	.size	dfs, .-dfs
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d%d%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.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	$40, %rsp
	.cfi_def_cfa_offset 96
	.p2align 4,,10
	.p2align 3
.L44:
	leaq	n(%rip), %r8
	leaq	a(%rip), %rcx
	xorl	%eax, %eax
	leaq	q(%rip), %rdx
	leaq	p(%rip), %rsi
	leaq	.LC1(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	q(%rip), %eax
	movl	%eax, 16(%rsp)
	testl	%eax, %eax
	je	.L61
	movl	p(%rip), %eax
	movl	$1, %r15d
	movl	%eax, 20(%rsp)
	testl	%eax, %eax
	je	.L45
	movl	n(%rip), %edx
	movl	%edx, 24(%rsp)
	js	.L52
	testl	%edx, %edx
	je	.L52
	movl	a(%rip), %r12d
	xorl	%r15d, %r15d
	testl	%r12d, %r12d
	js	.L45
	movl	%r15d, 28(%rsp)
	xorl	%r14d, %r14d
	xorl	%ebx, %ebx
.L49:
	movl	16(%rsp), %eax
	cmpl	%r14d, %eax
	je	.L46
	leal	1(%rbx), %ecx
	cmpl	$1, 24(%rsp)
	movl	%ecx, 12(%rsp)
	je	.L47
	cmpl	%r14d, %eax
	jg	.L47
	movl	%ebx, %edi
	imull	%ebx, %edi
	cmpl	%edi, %r12d
	jl	.L47
	imull	%ebx, %ecx
	movl	%ebx, %r15d
	xorl	%r13d, %r13d
	movl	%ecx, %ebp
.L48:
	leal	(%r15,%rbx), %esi
	movl	%r15d, %ecx
	movl	$2, %edx
	addl	$1, %r15d
	call	dfs
	movl	%ebp, %edi
	addl	%ebx, %ebp
	addl	%eax, %r13d
	cmpl	%edi, %r12d
	jge	.L48
	addl	%r13d, 28(%rsp)
.L47:
	movl	12(%rsp), %ebx
	addl	20(%rsp), %r14d
	cmpl	%ebx, %r12d
	jge	.L49
	movl	28(%rsp), %r15d
.L45:
	movl	%r15d, %edx
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L44
	.p2align 4,,10
	.p2align 3
.L52:
	xorl	%r15d, %r15d
	jmp	.L45
	.p2align 4,,10
	.p2align 3
.L46:
	leal	1(%rbx), %eax
	addl	$1, 28(%rsp)
	movl	%eax, 12(%rsp)
	jmp	.L47
	.p2align 4,,10
	.p2align 3
.L61:
	addq	$40, %rsp
	.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
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	q
	.align 4
	.type	q, @object
	.size	q, 4
q:
	.zero	4
	.globl	p
	.align 4
	.type	p, @object
	.size	p, 4
p:
	.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<stdlib.h>

int p,q,a,n;

int dfs(int b,int s,int c,int now)
{
	int i,r=0;
	if(b*p==q*s)
		return 1;
	if(c==n)
		return 0;
	if(b*p<q*s)
		return 0;
	for(i=now;i*b<=a;i++)
		r+=dfs(b*i,(s*i)+b,c+1,i);
	return r;
}

int main()
{
	for(;scanf("%d%d%d%d",&p,&q,&a,&n),q;)
		printf("%d\n",dfs(1,0,0,0));
}
2 3 120 3
2 3 300 3
2 3 299 3
2 3 12 3
2 3 12000 7
54 795 12000 7
2 4 300 1
2 1 200 5
2 4 54 2
0 0 0 0
 2 3 120 3
2 3 300 3
2 3 299 3
2 3 12 2
2 3 12000 7
54 795 12000 7
2 4 300 1
2 1 16 5
2 4 54 2
0 0 0 0
 2 3 120 3
2 3 300 3
2 3 299 3
2 3 12 2
2 3 12000 7
54 795 12000 7
2 4 300 1
2 1 8 5
2 4 54 2
0 0 0 0
 2 6 120 3
2 3 300 3
2 3 299 3
2 3 12 2
2 3 12000 7
54 795 12000 7
2 4 300 1
2 1 8 5
2 4 54 2
0 0 0 0
 2 6 120 5
2 3 300 3
2 3 299 3
2 3 12 2
2 0 12000 7
54 795 22620 7
2 4 300 1
2 1 8 5
2 4 54 2
0 0 0 0
 2 6 120 5
2 3 300 3
3 3 299 3
2 3 12 2
2 0 12000 7
54 795 22620 7
2 4 300 1
2 1 8 5
2 4 54 2
0 0 0 0
 2 6 120 5
2 3 300 3
3 3 299 3
2 3 7 2
2 0 12000 7
54 795 22620 7
2 4 300 1
2 1 8 5
2 4 54 2
0 0 0 0
 2 6 120 5
2 3 300 3
3 3 299 3
2 3 7 2
2 0 12000 7
54 781 35092 7
2 4 300 1
2 1 8 5
2 4 54 2
0 0 0 0
 2 3 120 3
2 3 300 3
2 3 299 3
2 3 12 3
2 3 12000 7
54 795 12000 7
2 3 300 1
2 1 200 5
2 6 54 2
0 0 0 0
 2 3 120 3
2 3 300 3
2 1 299 3
2 3 12 3
2 3 12000 7
54 795 12000 7
2 4 300 1
2 1 200 5
2 4 54 2
0 0 0 0

4
7
6
2
42
1
1
9
3
 4
7
6
2
42
1
1
3
3
 4
7
6
2
42
1
1
2
3
 3
7
6
2
42
1
1
2
3
 3
7
6
2
 3
7
5
2
 3
7
5
0
 3
7
5
0
 4
7
6
2
42
1
0
9
3
 4
7
2
2
42
1
1
9
3

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<stdlib.h>

int p,q,a,n;

int dfs(int b,int s,int c,int now)
{
	int i,r=0;
	if(b*p==q*s)
		return 1;
	if(c==n)
		return 0;
	if(b*p<q*s)
		return 0;
	for(i=now;i*b<=a;i++)
		r+=dfs(b*i,(s*i)+b,c+1,i);
	return r;
}

int main()
{
	for(;scanf("%d%d%d%d",&p,&q,&a,&n),q;)
		printf("%d\n",dfs(1,0,0,0));
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	p
	.bss
	.align 4
	.type	p, @object
	.size	p, 4
p:
	.zero	4
	.globl	q
	.align 4
	.type	q, @object
	.size	q, 4
q:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.text
	.globl	dfs
	.type	dfs, @function
dfs:
.LFB6:
	.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	%ecx, -32(%rbp)
	movl	$0, -4(%rbp)
	movl	p(%rip), %eax
	imull	-20(%rbp), %eax
	movl	%eax, %edx
	movl	q(%rip), %eax
	imull	-24(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L2
	movl	$1, %eax
	jmp	.L3
.L2:
	movl	n(%rip), %eax
	cmpl	%eax, -28(%rbp)
	jne	.L4
	movl	$0, %eax
	jmp	.L3
.L4:
	movl	p(%rip), %eax
	imull	-20(%rbp), %eax
	movl	%eax, %edx
	movl	q(%rip), %eax
	imull	-24(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L5
	movl	$0, %eax
	jmp	.L3
.L5:
	movl	-32(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L6
.L7:
	movl	-28(%rbp), %eax
	leal	1(%rax), %edi
	movl	-24(%rbp), %eax
	imull	-8(%rbp), %eax
	movl	%eax, %edx
	movl	-20(%rbp), %eax
	leal	(%rdx,%rax), %esi
	movl	-20(%rbp), %eax
	imull	-8(%rbp), %eax
	movl	-8(%rbp), %edx
	movl	%edx, %ecx
	movl	%edi, %edx
	movl	%eax, %edi
	call	dfs
	addl	%eax, -4(%rbp)
	addl	$1, -8(%rbp)
.L6:
	movl	-8(%rbp), %eax
	imull	-20(%rbp), %eax
	movl	%eax, %edx
	movl	a(%rip), %eax
	cmpl	%eax, %edx
	jle	.L7
	movl	-4(%rbp), %eax
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	dfs, .-dfs
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d%d%d%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	jmp	.L9
.L10:
	movl	$0, %ecx
	movl	$0, %edx
	movl	$0, %esi
	movl	$1, %edi
	call	dfs
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L9:
	leaq	n(%rip), %r8
	leaq	a(%rip), %rax
	movq	%rax, %rcx
	leaq	q(%rip), %rax
	movq	%rax, %rdx
	leaq	p(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	q(%rip), %eax
	testl	%eax, %eax
	jne	.L10
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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	p
	.bss
	.align 4
	.type	p, @object
	.size	p, 4
p:
	.zero	4
	.globl	q
	.align 4
	.type	q, @object
	.size	q, 4
q:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.text
	.globl	dfs
	.type	dfs, @function
dfs:
.LFB6:
	.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	%ecx, -32(%rbp)
	movl	$0, -4(%rbp)
	movl	p(%rip), %eax
	imull	-20(%rbp), %eax
	movl	%eax, %edx
	movl	q(%rip), %eax
	imull	-24(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L2
	movl	$1, %eax
	jmp	.L3
.L2:
	movl	n(%rip), %eax
	cmpl	%eax, -28(%rbp)
	jne	.L4
	movl	$0, %eax
	jmp	.L3
.L4:
	movl	p(%rip), %eax
	imull	-20(%rbp), %eax
	movl	%eax, %edx
	movl	q(%rip), %eax
	imull	-24(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L5
	movl	$0, %eax
	jmp	.L3
.L5:
	movl	-32(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L6
.L7:
	movl	-28(%rbp), %eax
	leal	1(%rax), %edi
	movl	-24(%rbp), %eax
	imull	-8(%rbp), %eax
	movl	%eax, %edx
	movl	-20(%rbp), %eax
	leal	(%rdx,%rax), %esi
	movl	-20(%rbp), %eax
	imull	-8(%rbp), %eax
	movl	-8(%rbp), %edx
	movl	%edx, %ecx
	movl	%edi, %edx
	movl	%eax, %edi
	call	dfs
	addl	%eax, -4(%rbp)
	addl	$1, -8(%rbp)
.L6:
	movl	-8(%rbp), %eax
	imull	-20(%rbp), %eax
	movl	%eax, %edx
	movl	a(%rip), %eax
	cmpl	%eax, %edx
	jle	.L7
	movl	-4(%rbp), %eax
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	dfs, .-dfs
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d%d%d%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	jmp	.L9
.L10:
	movl	$0, %ecx
	movl	$0, %edx
	movl	$0, %esi
	movl	$1, %edi
	call	dfs
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L9:
	leaq	n(%rip), %r8
	leaq	a(%rip), %rax
	movq	%rax, %rcx
	leaq	q(%rip), %rax
	movq	%rax, %rdx
	leaq	p(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	q(%rip), %eax
	testl	%eax, %eax
	jne	.L10
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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:
