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 dfs(int p, int q, int a, int n, int pi, int prev){
  if(p == 0 && pi <= a){
    return 1;
  }else if(n == 0){
    return 0;
  }
  
  int sum = 0;
  int div = a / pi + 1;
  while(p * div >= q){
    if(n * q < p * div){
      div--;
      continue;
    }else if(div < prev){
      break;
    }
    
    sum += dfs(p * div - q, q * div, a, n - 1, pi * div, div);
    div--;
  }
  
  return sum;
}

int main(int argc,char* argv[]){
  for(;;){
    int p, q, a, n;
    scanf("%d %d %d %d", &p, &q, &a, &n);
    
    if(p == 0 && q == 0 && a == 0 && n == 0){
      break;
    }

    printf("%d\n", dfs(p, q, a, n, 1, 0));
  }

  return 0;  
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.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	$48, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movl	%ecx, -32(%rbp)
	movl	%r8d, -36(%rbp)
	movl	%r9d, -40(%rbp)
	cmpl	$0, -20(%rbp)
	jne	.L2
	movl	-36(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jg	.L2
	movl	$1, %eax
	jmp	.L3
.L2:
	cmpl	$0, -32(%rbp)
	jne	.L4
	movl	$0, %eax
	jmp	.L3
.L4:
	movl	$0, -8(%rbp)
	movl	-28(%rbp), %eax
	cltd
	idivl	-36(%rbp)
	addl	$1, %eax
	movl	%eax, -4(%rbp)
	jmp	.L5
.L9:
	movl	-32(%rbp), %eax
	imull	-24(%rbp), %eax
	movl	%eax, %edx
	movl	-20(%rbp), %eax
	imull	-4(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L6
	subl	$1, -4(%rbp)
	jmp	.L5
.L6:
	movl	-4(%rbp), %eax
	cmpl	-40(%rbp), %eax
	jl	.L10
	movl	-36(%rbp), %eax
	imull	-4(%rbp), %eax
	movl	%eax, %edi
	movl	-32(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-24(%rbp), %eax
	imull	-4(%rbp), %eax
	movl	%eax, %esi
	movl	-20(%rbp), %eax
	imull	-4(%rbp), %eax
	subl	-24(%rbp), %eax
	movl	-4(%rbp), %r8d
	movl	-28(%rbp), %edx
	movl	%r8d, %r9d
	movl	%edi, %r8d
	movl	%eax, %edi
	call	dfs
	addl	%eax, -8(%rbp)
	subl	$1, -4(%rbp)
.L5:
	movl	-20(%rbp), %eax
	imull	-4(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jle	.L9
	jmp	.L8
.L10:
	nop
.L8:
	movl	-8(%rbp), %eax
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	dfs, .-dfs
	.section	.rodata
.LC0:
	.string	"%d %d %d %d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movl	%edi, -36(%rbp)
	movq	%rsi, -48(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L14:
	leaq	-12(%rbp), %rsi
	leaq	-16(%rbp), %rcx
	leaq	-20(%rbp), %rdx
	leaq	-24(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24(%rbp), %eax
	testl	%eax, %eax
	jne	.L12
	movl	-20(%rbp), %eax
	testl	%eax, %eax
	jne	.L12
	movl	-16(%rbp), %eax
	testl	%eax, %eax
	jne	.L12
	movl	-12(%rbp), %eax
	testl	%eax, %eax
	jne	.L12
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L15
	jmp	.L16
.L12:
	movl	-12(%rbp), %ecx
	movl	-16(%rbp), %edx
	movl	-20(%rbp), %esi
	movl	-24(%rbp), %eax
	movl	$0, %r9d
	movl	$1, %r8d
	movl	%eax, %edi
	call	dfs
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L14
.L16:
	call	__stack_chk_fail@PLT
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.p2align 4
	.type	dfs.part.0, @function
dfs.part.0:
.LFB25:
	.cfi_startproc
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	%edx, %eax
	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	%esi, %ebx
	subq	$232, %rsp
	.cfi_def_cfa_offset 288
	movl	%edx, 4(%rsp)
	cltd
	idivl	%r8d
	movl	%esi, 128(%rsp)
	movl	%edi, 152(%rsp)
	movl	%r8d, 156(%rsp)
	movl	%r9d, 184(%rsp)
	leal	1(%rax), %esi
	imull	%esi, %edi
	cmpl	%edi, %ebx
	jg	.L43
	movl	%edi, %edx
	movl	%ebx, %edi
	movl	%eax, 80(%rsp)
	leal	-2(%rcx), %r14d
	imull	%ecx, %edi
	movl	%r14d, 180(%rsp)
	leal	-4(%rcx), %r10d
	movl	%r8d, %r9d
	leal	-3(%rcx), %r11d
	leal	-1(%rcx), %r8d
	movl	%r10d, 120(%rsp)
	subl	$5, %ecx
	movl	%r8d, 196(%rsp)
	imull	%ebx, %r8d
	movl	%edi, 148(%rsp)
	movl	%ebx, %edi
	imull	%esi, %r9d
	imull	%esi, %edi
	movl	%r11d, 140(%rsp)
	imull	%ebx, %r11d
	movl	%r8d, 164(%rsp)
	imull	%esi, %r8d
	movl	%r9d, 68(%rsp)
	negl	%r9d
	movl	%edi, %eax
	movl	%edi, 40(%rsp)
	negl	%eax
	imull	%r11d, %esi
	movl	%r9d, 92(%rsp)
	movl	%eax, 96(%rsp)
	movl	%r14d, %eax
	imull	%edi, %r14d
	imull	%ebx, %eax
	movl	%r8d, 88(%rsp)
	movl	%r11d, 160(%rsp)
	movl	%esi, 104(%rsp)
	movl	%eax, 168(%rsp)
	movl	%r14d, %eax
	movl	$0, 188(%rsp)
	negl	%eax
	movl	%eax, 100(%rsp)
	movl	%r10d, %eax
	imull	%edi, %r10d
	imull	%ebx, %eax
	movl	%eax, 172(%rsp)
	movl	%r10d, %eax
	negl	%eax
	movl	%eax, 108(%rsp)
	jmp	.L42
	.p2align 4,,10
	.p2align 3
.L95:
	movl	68(%rsp), %ebx
	cmpl	%ebx, 4(%rsp)
	jl	.L44
	addl	$1, 188(%rsp)
.L4:
	movl	80(%rsp), %eax
	movl	152(%rsp), %edx
	movl	156(%rsp), %esi
	movl	164(%rsp), %ebx
	imull	%eax, %edx
	subl	$1, %eax
	subl	%esi, 68(%rsp)
	movl	%eax, 80(%rsp)
	movl	128(%rsp), %eax
	subl	%ebx, 88(%rsp)
	movl	172(%rsp), %ebx
	addl	%esi, 92(%rsp)
	movl	168(%rsp), %esi
	subl	%eax, 40(%rsp)
	addl	%esi, 100(%rsp)
	movl	160(%rsp), %esi
	addl	%eax, 96(%rsp)
	subl	%esi, 104(%rsp)
	addl	%ebx, 108(%rsp)
	cmpl	%edx, %eax
	jg	.L1
.L42:
	cmpl	%edx, 148(%rsp)
	jl	.L4
	movl	80(%rsp), %eax
	addl	$1, %eax
	movl	%eax, 136(%rsp)
	cmpl	%eax, 184(%rsp)
	jg	.L1
	subl	128(%rsp), %edx
	movl	%edx, 112(%rsp)
	je	.L95
.L44:
	movl	196(%rsp), %edi
	testl	%edi, %edi
	je	.L4
	movl	4(%rsp), %eax
	movl	68(%rsp), %ebx
	movl	40(%rsp), %edi
	cltd
	idivl	%ebx
	movl	112(%rsp), %edx
	leal	1(%rax), %esi
	imull	%esi, %edx
	cmpl	%edx, %edi
	jg	.L4
	movl	%eax, 36(%rsp)
	movl	%edi, %r10d
	movl	180(%rsp), %eax
	imull	%esi, %ebx
	movl	$0, 176(%rsp)
	imull	%esi, %r10d
	imull	%edi, %eax
	movl	%ebx, 28(%rsp)
	negl	%ebx
	movl	%ebx, 52(%rsp)
	movl	%r10d, %r11d
	imull	%esi, %eax
	movl	%eax, 48(%rsp)
	movl	%r10d, %eax
	negl	%eax
	movl	%eax, 56(%rsp)
	movl	140(%rsp), %eax
	imull	%r10d, %eax
	negl	%eax
	movl	%eax, 60(%rsp)
	movl	120(%rsp), %eax
	imull	%edi, %eax
	imull	%esi, %eax
	movl	%eax, 64(%rsp)
	jmp	.L41
	.p2align 4,,10
	.p2align 3
.L11:
	addl	$1, 176(%rsp)
.L9:
	movl	36(%rsp), %eax
	movl	112(%rsp), %edx
	movl	100(%rsp), %edi
	addl	%edi, 48(%rsp)
	imull	%eax, %edx
	movl	40(%rsp), %edi
	subl	$1, %eax
	movl	92(%rsp), %esi
	movl	104(%rsp), %ebx
	addl	96(%rsp), %r11d
	movl	%eax, 36(%rsp)
	addl	%esi, 28(%rsp)
	movl	68(%rsp), %esi
	addl	%edi, 56(%rsp)
	addl	%esi, 52(%rsp)
	movl	108(%rsp), %esi
	addl	%ebx, 60(%rsp)
	addl	%esi, 64(%rsp)
	cmpl	%edx, %edi
	jg	.L92
.L41:
	cmpl	88(%rsp), %edx
	jg	.L9
	movl	36(%rsp), %eax
	addl	$1, %eax
	movl	%eax, 116(%rsp)
	cmpl	136(%rsp), %eax
	jl	.L92
	subl	40(%rsp), %edx
	movl	%edx, 76(%rsp)
	jne	.L45
	movl	28(%rsp), %edx
	cmpl	%edx, 4(%rsp)
	jge	.L11
.L45:
	movl	180(%rsp), %esi
	testl	%esi, %esi
	je	.L9
	movl	4(%rsp), %eax
	movl	28(%rsp), %edi
	cltd
	idivl	%edi
	movl	76(%rsp), %edx
	leal	1(%rax), %esi
	imull	%esi, %edx
	cmpl	%edx, %r11d
	jg	.L9
	movl	%eax, 8(%rsp)
	movl	%esi, %r15d
	movl	140(%rsp), %eax
	imull	%esi, %edi
	imull	%r11d, %r15d
	movl	%r11d, 44(%rsp)
	movl	$0, 144(%rsp)
	imull	%r11d, %eax
	movl	%edi, (%rsp)
	negl	%edi
	movl	%edi, 16(%rsp)
	imull	%esi, %eax
	movl	%eax, 12(%rsp)
	movl	%r15d, %eax
	negl	%eax
	movl	%eax, 20(%rsp)
	movl	120(%rsp), %eax
	imull	%r15d, %eax
	negl	%eax
	movl	%eax, 24(%rsp)
	jmp	.L40
	.p2align 4,,10
	.p2align 3
.L17:
	addl	$1, 144(%rsp)
.L15:
	movl	8(%rsp), %eax
	movl	76(%rsp), %edx
	movl	60(%rsp), %esi
	addl	%esi, 12(%rsp)
	imull	%eax, %edx
	movl	44(%rsp), %esi
	subl	$1, %eax
	movl	52(%rsp), %ebx
	movl	64(%rsp), %edi
	addl	56(%rsp), %r15d
	movl	%eax, 8(%rsp)
	addl	%ebx, (%rsp)
	movl	28(%rsp), %ebx
	addl	%esi, 20(%rsp)
	addl	%ebx, 16(%rsp)
	addl	%edi, 24(%rsp)
	cmpl	%edx, %esi
	jg	.L96
.L40:
	cmpl	48(%rsp), %edx
	jg	.L15
	movl	8(%rsp), %eax
	addl	$1, %eax
	movl	%eax, 84(%rsp)
	cmpl	116(%rsp), %eax
	jl	.L97
	subl	44(%rsp), %edx
	movl	%edx, 32(%rsp)
	jne	.L46
	movl	(%rsp), %ebx
	cmpl	%ebx, 4(%rsp)
	jge	.L17
.L46:
	movl	140(%rsp), %edx
	testl	%edx, %edx
	je	.L15
	movl	4(%rsp), %eax
	movl	(%rsp), %esi
	movl	32(%rsp), %ebp
	cltd
	idivl	%esi
	leal	1(%rax), %ebx
	imull	%ebx, %ebp
	cmpl	%ebp, %r15d
	jg	.L15
	movl	%ebx, %r13d
	movl	120(%rsp), %r14d
	imull	%ebx, %esi
	movl	$0, 124(%rsp)
	imull	%r15d, %r13d
	imull	%r15d, %r14d
	movl	%esi, %r10d
	movl	%esi, %r11d
	movl	%r13d, %eax
	negl	%r10d
	negl	%eax
	imull	%ebx, %r14d
	movl	%eax, 72(%rsp)
	jmp	.L39
	.p2align 4,,10
	.p2align 3
.L23:
	addl	$1, 124(%rsp)
.L25:
	movl	32(%rsp), %ebp
	subl	$1, %ebx
	addl	%r15d, 72(%rsp)
	addl	16(%rsp), %r11d
	addl	20(%rsp), %r13d
	imull	%ebx, %ebp
	addl	24(%rsp), %r14d
	addl	(%rsp), %r10d
	cmpl	%ebp, %r15d
	jg	.L91
.L39:
	cmpl	12(%rsp), %ebp
	jg	.L25
	cmpl	84(%rsp), %ebx
	jl	.L91
	subl	%r15d, %ebp
	jne	.L47
	cmpl	%r11d, 4(%rsp)
	jge	.L23
.L47:
	movl	120(%rsp), %eax
	testl	%eax, %eax
	je	.L25
	movl	4(%rsp), %eax
	cltd
	idivl	%r11d
	movl	%ebp, %edx
	leal	1(%rax), %r8d
	imull	%r8d, %edx
	cmpl	%edx, %r13d
	jg	.L25
	testl	%ecx, %ecx
	je	.L26
	movl	%r13d, %esi
	movl	%r11d, 192(%rsp)
	movl	%edx, %edi
	movl	%eax, %r12d
	imull	%r8d, %esi
	movl	4(%rsp), %edx
	movl	$0, 132(%rsp)
	imull	%r11d, %r8d
	movl	72(%rsp), %r11d
	jmp	.L32
	.p2align 4,,10
	.p2align 3
.L29:
	movl	%r10d, 220(%rsp)
	movl	%r11d, 216(%rsp)
	movl	%r8d, 212(%rsp)
	movl	%ecx, 208(%rsp)
	movl	%edx, 204(%rsp)
	movl	%esi, 200(%rsp)
	call	dfs.part.0
	addl	%eax, 132(%rsp)
	movl	220(%rsp), %r10d
	movl	216(%rsp), %r11d
	movl	212(%rsp), %r8d
	movl	208(%rsp), %ecx
	movl	204(%rsp), %edx
	movl	200(%rsp), %esi
	.p2align 4,,10
	.p2align 3
.L30:
	movl	%ebp, %edi
	addl	%r11d, %esi
	addl	%r10d, %r8d
	imull	%r12d, %edi
	subl	$1, %r12d
	cmpl	%edi, %r13d
	jg	.L89
.L32:
	leal	1(%r12), %r9d
	cmpl	%r14d, %edi
	jg	.L30
	cmpl	%ebx, %r9d
	jl	.L89
	subl	%r13d, %edi
	cmpl	%r8d, %edx
	jl	.L29
	testl	%edi, %edi
	jne	.L29
	addl	$1, 132(%rsp)
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L91:
	movl	124(%rsp), %ebx
	addl	%ebx, 144(%rsp)
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L89:
	movl	192(%rsp), %r11d
.L33:
	movl	132(%rsp), %edi
	addl	%edi, 124(%rsp)
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L92:
	movl	176(%rsp), %ebx
	addl	%ebx, 188(%rsp)
	jmp	.L4
.L43:
	movl	$0, 188(%rsp)
.L1:
	movl	188(%rsp), %eax
	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
.L26:
	.cfi_restore_state
	imull	%r11d, %r8d
	xorl	%edi, %edi
	.p2align 4,,10
	.p2align 3
.L38:
	cmpl	%r14d, %edx
	jg	.L35
	leal	1(%rax), %esi
	cmpl	%ebx, %esi
	jl	.L93
	cmpl	%edx, %r13d
	jne	.L35
	cmpl	%r8d, 4(%rsp)
	setge	%dl
	cmpb	$1, %dl
	sbbl	$-1, %edi
.L35:
	movl	%ebp, %edx
	addl	%r10d, %r8d
	imull	%eax, %edx
	subl	$1, %eax
	cmpl	%edx, %r13d
	jle	.L38
.L93:
	movl	%edi, 132(%rsp)
	jmp	.L33
	.p2align 4,,10
	.p2align 3
.L96:
	movl	144(%rsp), %ebx
	movl	%esi, %r11d
	addl	%ebx, 176(%rsp)
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L97:
	movl	144(%rsp), %ebx
	movl	44(%rsp), %r11d
	addl	%ebx, 176(%rsp)
	jmp	.L9
	.cfi_endproc
.LFE25:
	.size	dfs.part.0, .-dfs.part.0
	.p2align 4
	.globl	dfs
	.type	dfs, @function
dfs:
.LFB23:
	.cfi_startproc
	endbr64
	testl	%edi, %edi
	jne	.L103
	movl	$1, %eax
	cmpl	%edx, %r8d
	jg	.L103
	ret
	.p2align 4,,10
	.p2align 3
.L103:
	testl	%ecx, %ecx
	je	.L102
	jmp	dfs.part.0
	.p2align 4,,10
	.p2align 3
.L102:
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	dfs, .-dfs
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d %d %d"
.LC1:
	.string	"%d\n"
	.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
	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	$120, %rsp
	.cfi_def_cfa_offset 176
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	leaq	100(%rsp), %rax
	movq	%rax, 64(%rsp)
	leaq	96(%rsp), %rax
	movq	%rax, 56(%rsp)
	leaq	92(%rsp), %rax
	movq	%rax, 48(%rsp)
	leaq	88(%rsp), %rax
	movq	%rax, 40(%rsp)
	.p2align 4,,10
	.p2align 3
.L123:
	movq	64(%rsp), %r8
	movq	56(%rsp), %rcx
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rdi
	movq	48(%rsp), %rdx
	movq	40(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	88(%rsp), %eax
	movl	%eax, 12(%rsp)
	testl	%eax, %eax
	jne	.L108
	movl	92(%rsp), %r13d
	movl	96(%rsp), %edx
	movl	100(%rsp), %eax
	movl	%r13d, %r10d
	orl	%edx, %r10d
	jne	.L109
	testl	%eax, %eax
	je	.L110
	xorl	%r13d, %r13d
	xorl	%ebp, %ebp
	movl	$1, %ebx
.L111:
	movl	%eax, %ecx
	leal	-1(%rax), %esi
	movl	%ebx, %r14d
	subl	$2, %eax
	imull	%r13d, %ecx
	movl	%esi, 72(%rsp)
	movl	%r10d, %r11d
	imull	%r13d, %r14d
	movl	%eax, 36(%rsp)
	movl	$0, 16(%rsp)
	movl	%ecx, 28(%rsp)
	movl	%esi, %ecx
	imull	%ebx, %esi
	imull	%r13d, %ecx
	movl	%r14d, %r15d
	negl	%r15d
	movl	%esi, %edx
	movl	%r15d, %eax
	imull	%r13d, %edx
	movl	%ecx, 32(%rsp)
	movl	%eax, %r10d
	movl	%edx, %r15d
	jmp	.L122
	.p2align 4,,10
	.p2align 3
.L115:
	addl	$1, 16(%rsp)
.L117:
	movl	12(%rsp), %ebp
	subl	$1, %ebx
	subl	%r13d, %r14d
	subl	32(%rsp), %r15d
	addl	%r13d, %r10d
	imull	%ebx, %ebp
	cmpl	%r13d, %ebp
	jl	.L112
.L122:
	cmpl	%ebp, 28(%rsp)
	jl	.L117
	testl	%ebx, %ebx
	js	.L112
	subl	%r13d, %ebp
	jne	.L129
	cmpl	%ebx, %r11d
	jge	.L115
.L129:
	movl	72(%rsp), %eax
	testl	%eax, %eax
	je	.L117
	movl	%r11d, %eax
	cltd
	idivl	%ebx
	movl	%ebp, %edx
	leal	1(%rax), %r8d
	imull	%r8d, %edx
	cmpl	%edx, %r14d
	jg	.L117
	movl	%r8d, %esi
	imull	%ebx, %r8d
	movl	%ebp, 20(%rsp)
	movl	%eax, %r12d
	imull	%r14d, %esi
	movl	$0, 24(%rsp)
	movl	%edx, %edi
	movl	%r13d, 76(%rsp)
	movl	%r15d, 4(%rsp)
	movl	%r8d, %ebp
	movl	%r14d, %r15d
	movl	%r11d, %r14d
	movl	%esi, %r13d
	.p2align 4,,10
	.p2align 3
.L121:
	leal	1(%r12), %r9d
	cmpl	4(%rsp), %edi
	jg	.L119
	cmpl	%r9d, %ebx
	jg	.L141
	movl	36(%rsp), %ecx
	subl	%r15d, %edi
	movl	%ebp, %r8d
	movl	%r14d, %edx
	movl	%r13d, %esi
	movl	%r10d, 8(%rsp)
	call	dfs
	addl	%eax, 24(%rsp)
	movl	8(%rsp), %r10d
.L119:
	movl	20(%rsp), %edi
	addl	%r10d, %r13d
	subl	%ebx, %ebp
	imull	%r12d, %edi
	subl	$1, %r12d
	cmpl	%edi, %r15d
	jle	.L121
	movl	24(%rsp), %ecx
	movl	%r14d, %r11d
	addl	%ecx, 16(%rsp)
	movl	%r15d, %r14d
	movl	76(%rsp), %r13d
	movl	4(%rsp), %r15d
	jmp	.L117
	.p2align 4,,10
	.p2align 3
.L109:
	movl	$1, 16(%rsp)
	testl	%edx, %edx
	jle	.L142
.L112:
	movl	16(%rsp), %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L123
	.p2align 4,,10
	.p2align 3
.L108:
	movl	100(%rsp), %eax
	movl	96(%rsp), %r10d
	movl	92(%rsp), %r13d
.L124:
	movl	$0, 16(%rsp)
	testl	%eax, %eax
	je	.L112
	movl	12(%rsp), %ebp
	leal	1(%r10), %ebx
	imull	%ebx, %ebp
	cmpl	%r13d, %ebp
	jge	.L111
	jmp	.L112
	.p2align 4,,10
	.p2align 3
.L142:
	movl	%edx, %r10d
	jmp	.L124
	.p2align 4,,10
	.p2align 3
.L141:
	movl	24(%rsp), %esi
	movl	%r14d, %r11d
	addl	%esi, 16(%rsp)
	movl	%r15d, %r14d
	movl	76(%rsp), %r13d
	movl	4(%rsp), %r15d
	jmp	.L117
.L110:
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L143
	addq	$120, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L143:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.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:

rule
	.file	"temp.c"
	.text
	.p2align 4
	.type	dfs.part.0, @function
dfs.part.0:
.LFB25:
	.cfi_startproc
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	%edx, %eax
	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	%esi, %ebx
	subq	$232, %rsp
	.cfi_def_cfa_offset 288
	movl	%edx, 4(%rsp)
	cltd
	idivl	%r8d
	movl	%esi, 128(%rsp)
	movl	%edi, 152(%rsp)
	movl	%r8d, 156(%rsp)
	movl	%r9d, 184(%rsp)
	leal	1(%rax), %esi
	imull	%esi, %edi
	cmpl	%edi, %ebx
	jg	.L43
	movl	%edi, %edx
	movl	%ebx, %edi
	movl	%eax, 80(%rsp)
	leal	-2(%rcx), %r14d
	imull	%ecx, %edi
	movl	%r14d, 180(%rsp)
	leal	-4(%rcx), %r10d
	movl	%r8d, %r9d
	leal	-3(%rcx), %r11d
	leal	-1(%rcx), %r8d
	movl	%r10d, 120(%rsp)
	subl	$5, %ecx
	movl	%r8d, 196(%rsp)
	imull	%ebx, %r8d
	movl	%edi, 148(%rsp)
	movl	%ebx, %edi
	imull	%esi, %r9d
	imull	%esi, %edi
	movl	%r11d, 140(%rsp)
	imull	%ebx, %r11d
	movl	%r8d, 164(%rsp)
	imull	%esi, %r8d
	movl	%r9d, 68(%rsp)
	negl	%r9d
	movl	%edi, %eax
	movl	%edi, 40(%rsp)
	negl	%eax
	imull	%r11d, %esi
	movl	%r9d, 92(%rsp)
	movl	%eax, 96(%rsp)
	movl	%r14d, %eax
	imull	%edi, %r14d
	imull	%ebx, %eax
	movl	%r8d, 88(%rsp)
	movl	%r11d, 160(%rsp)
	movl	%esi, 104(%rsp)
	movl	%eax, 168(%rsp)
	movl	%r14d, %eax
	movl	$0, 188(%rsp)
	negl	%eax
	movl	%eax, 100(%rsp)
	movl	%r10d, %eax
	imull	%edi, %r10d
	imull	%ebx, %eax
	movl	%eax, 172(%rsp)
	movl	%r10d, %eax
	negl	%eax
	movl	%eax, 108(%rsp)
	jmp	.L42
	.p2align 4,,10
	.p2align 3
.L95:
	movl	68(%rsp), %ebx
	cmpl	%ebx, 4(%rsp)
	jl	.L44
	addl	$1, 188(%rsp)
.L4:
	movl	80(%rsp), %eax
	movl	152(%rsp), %edx
	movl	156(%rsp), %esi
	movl	164(%rsp), %ebx
	imull	%eax, %edx
	subl	$1, %eax
	subl	%esi, 68(%rsp)
	movl	%eax, 80(%rsp)
	movl	128(%rsp), %eax
	subl	%ebx, 88(%rsp)
	movl	172(%rsp), %ebx
	addl	%esi, 92(%rsp)
	movl	168(%rsp), %esi
	subl	%eax, 40(%rsp)
	addl	%esi, 100(%rsp)
	movl	160(%rsp), %esi
	addl	%eax, 96(%rsp)
	subl	%esi, 104(%rsp)
	addl	%ebx, 108(%rsp)
	cmpl	%edx, %eax
	jg	.L1
.L42:
	cmpl	%edx, 148(%rsp)
	jl	.L4
	movl	80(%rsp), %eax
	addl	$1, %eax
	movl	%eax, 136(%rsp)
	cmpl	%eax, 184(%rsp)
	jg	.L1
	subl	128(%rsp), %edx
	movl	%edx, 112(%rsp)
	je	.L95
.L44:
	movl	196(%rsp), %edi
	testl	%edi, %edi
	je	.L4
	movl	4(%rsp), %eax
	movl	68(%rsp), %ebx
	movl	40(%rsp), %edi
	cltd
	idivl	%ebx
	movl	112(%rsp), %edx
	leal	1(%rax), %esi
	imull	%esi, %edx
	cmpl	%edx, %edi
	jg	.L4
	movl	%eax, 36(%rsp)
	movl	%edi, %r10d
	movl	180(%rsp), %eax
	imull	%esi, %ebx
	movl	$0, 176(%rsp)
	imull	%esi, %r10d
	imull	%edi, %eax
	movl	%ebx, 28(%rsp)
	negl	%ebx
	movl	%ebx, 52(%rsp)
	movl	%r10d, %r11d
	imull	%esi, %eax
	movl	%eax, 48(%rsp)
	movl	%r10d, %eax
	negl	%eax
	movl	%eax, 56(%rsp)
	movl	140(%rsp), %eax
	imull	%r10d, %eax
	negl	%eax
	movl	%eax, 60(%rsp)
	movl	120(%rsp), %eax
	imull	%edi, %eax
	imull	%esi, %eax
	movl	%eax, 64(%rsp)
	jmp	.L41
	.p2align 4,,10
	.p2align 3
.L11:
	addl	$1, 176(%rsp)
.L9:
	movl	36(%rsp), %eax
	movl	112(%rsp), %edx
	movl	100(%rsp), %edi
	addl	%edi, 48(%rsp)
	imull	%eax, %edx
	movl	40(%rsp), %edi
	subl	$1, %eax
	movl	92(%rsp), %esi
	movl	104(%rsp), %ebx
	addl	96(%rsp), %r11d
	movl	%eax, 36(%rsp)
	addl	%esi, 28(%rsp)
	movl	68(%rsp), %esi
	addl	%edi, 56(%rsp)
	addl	%esi, 52(%rsp)
	movl	108(%rsp), %esi
	addl	%ebx, 60(%rsp)
	addl	%esi, 64(%rsp)
	cmpl	%edx, %edi
	jg	.L92
.L41:
	cmpl	88(%rsp), %edx
	jg	.L9
	movl	36(%rsp), %eax
	addl	$1, %eax
	movl	%eax, 116(%rsp)
	cmpl	136(%rsp), %eax
	jl	.L92
	subl	40(%rsp), %edx
	movl	%edx, 76(%rsp)
	jne	.L45
	movl	28(%rsp), %edx
	cmpl	%edx, 4(%rsp)
	jge	.L11
.L45:
	movl	180(%rsp), %esi
	testl	%esi, %esi
	je	.L9
	movl	4(%rsp), %eax
	movl	28(%rsp), %edi
	cltd
	idivl	%edi
	movl	76(%rsp), %edx
	leal	1(%rax), %esi
	imull	%esi, %edx
	cmpl	%edx, %r11d
	jg	.L9
	movl	%eax, 8(%rsp)
	movl	%esi, %r15d
	movl	140(%rsp), %eax
	imull	%esi, %edi
	imull	%r11d, %r15d
	movl	%r11d, 44(%rsp)
	movl	$0, 144(%rsp)
	imull	%r11d, %eax
	movl	%edi, (%rsp)
	negl	%edi
	movl	%edi, 16(%rsp)
	imull	%esi, %eax
	movl	%eax, 12(%rsp)
	movl	%r15d, %eax
	negl	%eax
	movl	%eax, 20(%rsp)
	movl	120(%rsp), %eax
	imull	%r15d, %eax
	negl	%eax
	movl	%eax, 24(%rsp)
	jmp	.L40
	.p2align 4,,10
	.p2align 3
.L17:
	addl	$1, 144(%rsp)
.L15:
	movl	8(%rsp), %eax
	movl	76(%rsp), %edx
	movl	60(%rsp), %esi
	addl	%esi, 12(%rsp)
	imull	%eax, %edx
	movl	44(%rsp), %esi
	subl	$1, %eax
	movl	52(%rsp), %ebx
	movl	64(%rsp), %edi
	addl	56(%rsp), %r15d
	movl	%eax, 8(%rsp)
	addl	%ebx, (%rsp)
	movl	28(%rsp), %ebx
	addl	%esi, 20(%rsp)
	addl	%ebx, 16(%rsp)
	addl	%edi, 24(%rsp)
	cmpl	%edx, %esi
	jg	.L96
.L40:
	cmpl	48(%rsp), %edx
	jg	.L15
	movl	8(%rsp), %eax
	addl	$1, %eax
	movl	%eax, 84(%rsp)
	cmpl	116(%rsp), %eax
	jl	.L97
	subl	44(%rsp), %edx
	movl	%edx, 32(%rsp)
	jne	.L46
	movl	(%rsp), %ebx
	cmpl	%ebx, 4(%rsp)
	jge	.L17
.L46:
	movl	140(%rsp), %edx
	testl	%edx, %edx
	je	.L15
	movl	4(%rsp), %eax
	movl	(%rsp), %esi
	movl	32(%rsp), %ebp
	cltd
	idivl	%esi
	leal	1(%rax), %ebx
	imull	%ebx, %ebp
	cmpl	%ebp, %r15d
	jg	.L15
	movl	%ebx, %r13d
	movl	120(%rsp), %r14d
	imull	%ebx, %esi
	movl	$0, 124(%rsp)
	imull	%r15d, %r13d
	imull	%r15d, %r14d
	movl	%esi, %r10d
	movl	%esi, %r11d
	movl	%r13d, %eax
	negl	%r10d
	negl	%eax
	imull	%ebx, %r14d
	movl	%eax, 72(%rsp)
	jmp	.L39
	.p2align 4,,10
	.p2align 3
.L23:
	addl	$1, 124(%rsp)
.L25:
	movl	32(%rsp), %ebp
	subl	$1, %ebx
	addl	%r15d, 72(%rsp)
	addl	16(%rsp), %r11d
	addl	20(%rsp), %r13d
	imull	%ebx, %ebp
	addl	24(%rsp), %r14d
	addl	(%rsp), %r10d
	cmpl	%ebp, %r15d
	jg	.L91
.L39:
	cmpl	12(%rsp), %ebp
	jg	.L25
	cmpl	84(%rsp), %ebx
	jl	.L91
	subl	%r15d, %ebp
	jne	.L47
	cmpl	%r11d, 4(%rsp)
	jge	.L23
.L47:
	movl	120(%rsp), %eax
	testl	%eax, %eax
	je	.L25
	movl	4(%rsp), %eax
	cltd
	idivl	%r11d
	movl	%ebp, %edx
	leal	1(%rax), %r8d
	imull	%r8d, %edx
	cmpl	%edx, %r13d
	jg	.L25
	testl	%ecx, %ecx
	je	.L26
	movl	%r13d, %esi
	movl	%r11d, 192(%rsp)
	movl	%edx, %edi
	movl	%eax, %r12d
	imull	%r8d, %esi
	movl	4(%rsp), %edx
	movl	$0, 132(%rsp)
	imull	%r11d, %r8d
	movl	72(%rsp), %r11d
	jmp	.L32
	.p2align 4,,10
	.p2align 3
.L29:
	movl	%r10d, 220(%rsp)
	movl	%r11d, 216(%rsp)
	movl	%r8d, 212(%rsp)
	movl	%ecx, 208(%rsp)
	movl	%edx, 204(%rsp)
	movl	%esi, 200(%rsp)
	call	dfs.part.0
	addl	%eax, 132(%rsp)
	movl	220(%rsp), %r10d
	movl	216(%rsp), %r11d
	movl	212(%rsp), %r8d
	movl	208(%rsp), %ecx
	movl	204(%rsp), %edx
	movl	200(%rsp), %esi
	.p2align 4,,10
	.p2align 3
.L30:
	movl	%ebp, %edi
	addl	%r11d, %esi
	addl	%r10d, %r8d
	imull	%r12d, %edi
	subl	$1, %r12d
	cmpl	%edi, %r13d
	jg	.L89
.L32:
	leal	1(%r12), %r9d
	cmpl	%r14d, %edi
	jg	.L30
	cmpl	%ebx, %r9d
	jl	.L89
	subl	%r13d, %edi
	cmpl	%r8d, %edx
	jl	.L29
	testl	%edi, %edi
	jne	.L29
	addl	$1, 132(%rsp)
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L91:
	movl	124(%rsp), %ebx
	addl	%ebx, 144(%rsp)
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L89:
	movl	192(%rsp), %r11d
.L33:
	movl	132(%rsp), %edi
	addl	%edi, 124(%rsp)
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L92:
	movl	176(%rsp), %ebx
	addl	%ebx, 188(%rsp)
	jmp	.L4
.L43:
	movl	$0, 188(%rsp)
.L1:
	movl	188(%rsp), %eax
	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
.L26:
	.cfi_restore_state
	imull	%r11d, %r8d
	xorl	%edi, %edi
	.p2align 4,,10
	.p2align 3
.L38:
	cmpl	%r14d, %edx
	jg	.L35
	leal	1(%rax), %esi
	cmpl	%ebx, %esi
	jl	.L93
	cmpl	%edx, %r13d
	jne	.L35
	cmpl	%r8d, 4(%rsp)
	setge	%dl
	cmpb	$1, %dl
	sbbl	$-1, %edi
.L35:
	movl	%ebp, %edx
	addl	%r10d, %r8d
	imull	%eax, %edx
	subl	$1, %eax
	cmpl	%edx, %r13d
	jle	.L38
.L93:
	movl	%edi, 132(%rsp)
	jmp	.L33
	.p2align 4,,10
	.p2align 3
.L96:
	movl	144(%rsp), %ebx
	movl	%esi, %r11d
	addl	%ebx, 176(%rsp)
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L97:
	movl	144(%rsp), %ebx
	movl	44(%rsp), %r11d
	addl	%ebx, 176(%rsp)
	jmp	.L9
	.cfi_endproc
.LFE25:
	.size	dfs.part.0, .-dfs.part.0
	.p2align 4
	.globl	dfs
	.type	dfs, @function
dfs:
.LFB23:
	.cfi_startproc
	endbr64
	testl	%edi, %edi
	jne	.L103
	movl	$1, %eax
	cmpl	%edx, %r8d
	jg	.L103
	ret
	.p2align 4,,10
	.p2align 3
.L103:
	testl	%ecx, %ecx
	je	.L102
	jmp	dfs.part.0
	.p2align 4,,10
	.p2align 3
.L102:
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	dfs, .-dfs
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d %d %d"
.LC1:
	.string	"%d\n"
	.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
	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	$120, %rsp
	.cfi_def_cfa_offset 176
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	leaq	100(%rsp), %rax
	movq	%rax, 64(%rsp)
	leaq	96(%rsp), %rax
	movq	%rax, 56(%rsp)
	leaq	92(%rsp), %rax
	movq	%rax, 48(%rsp)
	leaq	88(%rsp), %rax
	movq	%rax, 40(%rsp)
	.p2align 4,,10
	.p2align 3
.L123:
	movq	64(%rsp), %r8
	movq	56(%rsp), %rcx
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rdi
	movq	48(%rsp), %rdx
	movq	40(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	88(%rsp), %eax
	movl	%eax, 12(%rsp)
	testl	%eax, %eax
	jne	.L108
	movl	92(%rsp), %r13d
	movl	96(%rsp), %edx
	movl	100(%rsp), %eax
	movl	%r13d, %r10d
	orl	%edx, %r10d
	jne	.L109
	testl	%eax, %eax
	je	.L110
	xorl	%r13d, %r13d
	xorl	%ebp, %ebp
	movl	$1, %ebx
.L111:
	movl	%eax, %ecx
	leal	-1(%rax), %esi
	movl	%ebx, %r14d
	subl	$2, %eax
	imull	%r13d, %ecx
	movl	%esi, 72(%rsp)
	movl	%r10d, %r11d
	imull	%r13d, %r14d
	movl	%eax, 36(%rsp)
	movl	$0, 16(%rsp)
	movl	%ecx, 28(%rsp)
	movl	%esi, %ecx
	imull	%ebx, %esi
	imull	%r13d, %ecx
	movl	%r14d, %r15d
	negl	%r15d
	movl	%esi, %edx
	movl	%r15d, %eax
	imull	%r13d, %edx
	movl	%ecx, 32(%rsp)
	movl	%eax, %r10d
	movl	%edx, %r15d
	jmp	.L122
	.p2align 4,,10
	.p2align 3
.L115:
	addl	$1, 16(%rsp)
.L117:
	movl	12(%rsp), %ebp
	subl	$1, %ebx
	subl	%r13d, %r14d
	subl	32(%rsp), %r15d
	addl	%r13d, %r10d
	imull	%ebx, %ebp
	cmpl	%r13d, %ebp
	jl	.L112
.L122:
	cmpl	%ebp, 28(%rsp)
	jl	.L117
	testl	%ebx, %ebx
	js	.L112
	subl	%r13d, %ebp
	jne	.L129
	cmpl	%ebx, %r11d
	jge	.L115
.L129:
	movl	72(%rsp), %eax
	testl	%eax, %eax
	je	.L117
	movl	%r11d, %eax
	cltd
	idivl	%ebx
	movl	%ebp, %edx
	leal	1(%rax), %r8d
	imull	%r8d, %edx
	cmpl	%edx, %r14d
	jg	.L117
	movl	%r8d, %esi
	imull	%ebx, %r8d
	movl	%ebp, 20(%rsp)
	movl	%eax, %r12d
	imull	%r14d, %esi
	movl	$0, 24(%rsp)
	movl	%edx, %edi
	movl	%r13d, 76(%rsp)
	movl	%r15d, 4(%rsp)
	movl	%r8d, %ebp
	movl	%r14d, %r15d
	movl	%r11d, %r14d
	movl	%esi, %r13d
	.p2align 4,,10
	.p2align 3
.L121:
	leal	1(%r12), %r9d
	cmpl	4(%rsp), %edi
	jg	.L119
	cmpl	%r9d, %ebx
	jg	.L141
	movl	36(%rsp), %ecx
	subl	%r15d, %edi
	movl	%ebp, %r8d
	movl	%r14d, %edx
	movl	%r13d, %esi
	movl	%r10d, 8(%rsp)
	call	dfs
	addl	%eax, 24(%rsp)
	movl	8(%rsp), %r10d
.L119:
	movl	20(%rsp), %edi
	addl	%r10d, %r13d
	subl	%ebx, %ebp
	imull	%r12d, %edi
	subl	$1, %r12d
	cmpl	%edi, %r15d
	jle	.L121
	movl	24(%rsp), %ecx
	movl	%r14d, %r11d
	addl	%ecx, 16(%rsp)
	movl	%r15d, %r14d
	movl	76(%rsp), %r13d
	movl	4(%rsp), %r15d
	jmp	.L117
	.p2align 4,,10
	.p2align 3
.L109:
	movl	$1, 16(%rsp)
	testl	%edx, %edx
	jle	.L142
.L112:
	movl	16(%rsp), %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L123
	.p2align 4,,10
	.p2align 3
.L108:
	movl	100(%rsp), %eax
	movl	96(%rsp), %r10d
	movl	92(%rsp), %r13d
.L124:
	movl	$0, 16(%rsp)
	testl	%eax, %eax
	je	.L112
	movl	12(%rsp), %ebp
	leal	1(%r10), %ebx
	imull	%ebx, %ebp
	cmpl	%r13d, %ebp
	jge	.L111
	jmp	.L112
	.p2align 4,,10
	.p2align 3
.L142:
	movl	%edx, %r10d
	jmp	.L124
	.p2align 4,,10
	.p2align 3
.L141:
	movl	24(%rsp), %esi
	movl	%r14d, %r11d
	addl	%esi, 16(%rsp)
	movl	%r15d, %r14d
	movl	76(%rsp), %r13d
	movl	4(%rsp), %r15d
	jmp	.L117
.L110:
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L143
	addq	$120, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L143:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.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:

#include <stdio.h>

int dfs(int p, int q, int a, int n, int pi, int prev){
  if(p == 0 && pi <= a){
    return 1;
  }else if(n == 0){
    return 0;
  }
  
  int sum = 0;
  int div = a / pi + 1;
  while(p * div >= q){
    if(n * q < p * div){
      div--;
      continue;
    }else if(div < prev){
      break;
    }
    
    sum += dfs(p * div - q, q * div, a, n - 1, pi * div, div);
    div--;
  }
  
  return sum;
}

int main(int argc,char* argv[]){
  for(;;){
    int p, q, a, n;
    scanf("%d %d %d %d", &p, &q, &a, &n);
    
    if(p == 0 && q == 0 && a == 0 && n == 0){
      break;
    }

    printf("%d\n", dfs(p, q, a, n, 1, 0));
  }

  return 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
1
1
1
2
3
 3
7
5
2
1
1
1
2
3
 3
7
5
0
1
1
1
2
3
 3
7
5
0
1
0
1
2
3
 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>

int dfs(int p, int q, int a, int n, int pi, int prev){
  if(p == 0 && pi <= a){
    return 1;
  }else if(n == 0){
    return 0;
  }
  
  int sum = 0;
  int div = a / pi + 1;
  while(p * div >= q){
    if(n * q < p * div){
      div--;
      continue;
    }else if(div < prev){
      break;
    }
    
    sum += dfs(p * div - q, q * div, a, n - 1, pi * div, div);
    div--;
  }
  
  return sum;
}

int main(int argc,char* argv[]){
  for(;;){
    int p, q, a, n;
    scanf("%d %d %d %d", &p, &q, &a, &n);
    
    if(p == 0 && q == 0 && a == 0 && n == 0){
      break;
    }

    printf("%d\n", dfs(p, q, a, n, 1, 0));
  }

  return 0;  
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.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	$48, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movl	%ecx, -32(%rbp)
	movl	%r8d, -36(%rbp)
	movl	%r9d, -40(%rbp)
	cmpl	$0, -20(%rbp)
	jne	.L2
	movl	-36(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jg	.L2
	movl	$1, %eax
	jmp	.L3
.L2:
	cmpl	$0, -32(%rbp)
	jne	.L4
	movl	$0, %eax
	jmp	.L3
.L4:
	movl	$0, -8(%rbp)
	movl	-28(%rbp), %eax
	cltd
	idivl	-36(%rbp)
	addl	$1, %eax
	movl	%eax, -4(%rbp)
	jmp	.L5
.L9:
	movl	-32(%rbp), %eax
	imull	-24(%rbp), %eax
	movl	%eax, %edx
	movl	-20(%rbp), %eax
	imull	-4(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L6
	subl	$1, -4(%rbp)
	jmp	.L5
.L6:
	movl	-4(%rbp), %eax
	cmpl	-40(%rbp), %eax
	jl	.L10
	movl	-36(%rbp), %eax
	imull	-4(%rbp), %eax
	movl	%eax, %edi
	movl	-32(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-24(%rbp), %eax
	imull	-4(%rbp), %eax
	movl	%eax, %esi
	movl	-20(%rbp), %eax
	imull	-4(%rbp), %eax
	subl	-24(%rbp), %eax
	movl	-4(%rbp), %r8d
	movl	-28(%rbp), %edx
	movl	%r8d, %r9d
	movl	%edi, %r8d
	movl	%eax, %edi
	call	dfs
	addl	%eax, -8(%rbp)
	subl	$1, -4(%rbp)
.L5:
	movl	-20(%rbp), %eax
	imull	-4(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jle	.L9
	jmp	.L8
.L10:
	nop
.L8:
	movl	-8(%rbp), %eax
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	dfs, .-dfs
	.section	.rodata
.LC0:
	.string	"%d %d %d %d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movl	%edi, -36(%rbp)
	movq	%rsi, -48(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L14:
	leaq	-12(%rbp), %rsi
	leaq	-16(%rbp), %rcx
	leaq	-20(%rbp), %rdx
	leaq	-24(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24(%rbp), %eax
	testl	%eax, %eax
	jne	.L12
	movl	-20(%rbp), %eax
	testl	%eax, %eax
	jne	.L12
	movl	-16(%rbp), %eax
	testl	%eax, %eax
	jne	.L12
	movl	-12(%rbp), %eax
	testl	%eax, %eax
	jne	.L12
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L15
	jmp	.L16
.L12:
	movl	-12(%rbp), %ecx
	movl	-16(%rbp), %edx
	movl	-20(%rbp), %esi
	movl	-24(%rbp), %eax
	movl	$0, %r9d
	movl	$1, %r8d
	movl	%eax, %edi
	call	dfs
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L14
.L16:
	call	__stack_chk_fail@PLT
.L15:
	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	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	$48, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movl	%ecx, -32(%rbp)
	movl	%r8d, -36(%rbp)
	movl	%r9d, -40(%rbp)
	cmpl	$0, -20(%rbp)
	jne	.L2
	movl	-36(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jg	.L2
	movl	$1, %eax
	jmp	.L3
.L2:
	cmpl	$0, -32(%rbp)
	jne	.L4
	movl	$0, %eax
	jmp	.L3
.L4:
	movl	$0, -8(%rbp)
	movl	-28(%rbp), %eax
	cltd
	idivl	-36(%rbp)
	addl	$1, %eax
	movl	%eax, -4(%rbp)
	jmp	.L5
.L9:
	movl	-32(%rbp), %eax
	imull	-24(%rbp), %eax
	movl	%eax, %edx
	movl	-20(%rbp), %eax
	imull	-4(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L6
	subl	$1, -4(%rbp)
	jmp	.L5
.L6:
	movl	-4(%rbp), %eax
	cmpl	-40(%rbp), %eax
	jl	.L10
	movl	-36(%rbp), %eax
	imull	-4(%rbp), %eax
	movl	%eax, %edi
	movl	-32(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-24(%rbp), %eax
	imull	-4(%rbp), %eax
	movl	%eax, %esi
	movl	-20(%rbp), %eax
	imull	-4(%rbp), %eax
	subl	-24(%rbp), %eax
	movl	-4(%rbp), %r8d
	movl	-28(%rbp), %edx
	movl	%r8d, %r9d
	movl	%edi, %r8d
	movl	%eax, %edi
	call	dfs
	addl	%eax, -8(%rbp)
	subl	$1, -4(%rbp)
.L5:
	movl	-20(%rbp), %eax
	imull	-4(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jle	.L9
	jmp	.L8
.L10:
	nop
.L8:
	movl	-8(%rbp), %eax
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	dfs, .-dfs
	.section	.rodata
.LC0:
	.string	"%d %d %d %d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movl	%edi, -36(%rbp)
	movq	%rsi, -48(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L14:
	leaq	-12(%rbp), %rsi
	leaq	-16(%rbp), %rcx
	leaq	-20(%rbp), %rdx
	leaq	-24(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24(%rbp), %eax
	testl	%eax, %eax
	jne	.L12
	movl	-20(%rbp), %eax
	testl	%eax, %eax
	jne	.L12
	movl	-16(%rbp), %eax
	testl	%eax, %eax
	jne	.L12
	movl	-12(%rbp), %eax
	testl	%eax, %eax
	jne	.L12
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L15
	jmp	.L16
.L12:
	movl	-12(%rbp), %ecx
	movl	-16(%rbp), %edx
	movl	-20(%rbp), %esi
	movl	-24(%rbp), %eax
	movl	$0, %r9d
	movl	$1, %r8d
	movl	%eax, %edi
	call	dfs
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L14
.L16:
	call	__stack_chk_fail@PLT
.L15:
	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:
