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>
#include<string.h>

typedef long long ll;

int max(int a, int b){
  if(a > b) return a;
  else return b;
}
int min(int a, int b){
  if(a < b) return a;
  else return b;
}

  ll n;

void func(ll cur, int use, ll *counter){

  if(cur > n) return;
  if(use == 0b111) ++(*counter);

  func(cur*10 + 3, use | 0b001, counter);
  func(cur*10 + 5, use | 0b010, counter);
  func(cur*10 + 7, use | 0b100, counter);

}

int main(){

  scanf("%d",&n);
  ll res = 0;
  func(0, 0, &res);
  printf("%d",res);
  return 0;

}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	max
	.type	max, @function
max:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L2
	movl	-4(%rbp), %eax
	jmp	.L3
.L2:
	movl	-8(%rbp), %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	max, .-max
	.globl	min
	.type	min, @function
min:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L5
	movl	-4(%rbp), %eax
	jmp	.L6
.L5:
	movl	-8(%rbp), %eax
.L6:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	min, .-min
	.globl	n
	.bss
	.align 8
	.type	n, @object
	.size	n, 8
n:
	.zero	8
	.text
	.globl	func
	.type	func, @function
func:
.LFB8:
	.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
	movq	%rdi, -8(%rbp)
	movl	%esi, -12(%rbp)
	movq	%rdx, -24(%rbp)
	movq	n(%rip), %rax
	cmpq	%rax, -8(%rbp)
	jg	.L11
	cmpl	$7, -12(%rbp)
	jne	.L10
	movq	-24(%rbp), %rax
	movq	(%rax), %rax
	leaq	1(%rax), %rdx
	movq	-24(%rbp), %rax
	movq	%rdx, (%rax)
.L10:
	movl	-12(%rbp), %eax
	orl	$1, %eax
	movl	%eax, %esi
	movq	-8(%rbp), %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	leaq	3(%rax), %rcx
	movq	-24(%rbp), %rax
	movq	%rax, %rdx
	movq	%rcx, %rdi
	call	func
	movl	-12(%rbp), %eax
	orl	$2, %eax
	movl	%eax, %esi
	movq	-8(%rbp), %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	leaq	5(%rax), %rcx
	movq	-24(%rbp), %rax
	movq	%rax, %rdx
	movq	%rcx, %rdi
	call	func
	movl	-12(%rbp), %eax
	orl	$4, %eax
	movl	%eax, %esi
	movq	-8(%rbp), %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	leaq	7(%rax), %rcx
	movq	-24(%rbp), %rax
	movq	%rax, %rdx
	movq	%rcx, %rdi
	call	func
	jmp	.L7
.L11:
	nop
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	func, .-func
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB9:
	.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
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -16(%rbp)
	leaq	-16(%rbp), %rax
	movq	%rax, %rdx
	movl	$0, %esi
	movl	$0, %edi
	call	func
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.p2align 4
	.globl	max
	.type	max, @function
max:
.LFB51:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovge	%edi, %eax
	ret
	.cfi_endproc
.LFE51:
	.size	max, .-max
	.p2align 4
	.globl	min
	.type	min, @function
min:
.LFB52:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovle	%edi, %eax
	ret
	.cfi_endproc
.LFE52:
	.size	min, .-min
	.p2align 4
	.globl	func
	.type	func, @function
func:
.LFB53:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movq	%rdx, %r15
	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
	movq	n(%rip), %rdx
	movl	%esi, 20(%rsp)
	cmpq	%rdx, %rdi
	jg	.L4
	movq	%rdi, %rcx
.L5:
	cmpl	$7, 20(%rsp)
	jne	.L6
	addq	$1, (%r15)
	movq	n(%rip), %rdx
.L6:
	movl	20(%rsp), %eax
	leaq	(%rcx,%rcx,4), %rcx
	orl	$1, %eax
	movl	%eax, 16(%rsp)
	leaq	(%rcx,%rcx), %rax
	leaq	3(%rax), %rcx
	movq	%rax, 24(%rsp)
	cmpq	%rdx, %rcx
	jg	.L7
.L41:
	cmpl	$7, 16(%rsp)
	jne	.L8
	addq	$1, (%r15)
	movq	n(%rip), %rdx
.L8:
	leaq	(%rcx,%rcx,4), %rcx
	movl	16(%rsp), %r14d
	leaq	(%rcx,%rcx), %rax
	leaq	3(%rax), %r13
	movq	%rax, 8(%rsp)
	orl	$1, %r14d
	cmpq	%rdx, %r13
	jg	.L9
.L26:
	cmpl	$7, %r14d
	jne	.L10
	addq	$1, (%r15)
	movq	n(%rip), %rdx
.L10:
	leaq	0(%r13,%r13,4), %r13
	movl	%r14d, %r12d
	leaq	(%r13,%r13), %rax
	orl	$1, %r12d
	leaq	3(%rax), %rbp
	movq	%rax, (%rsp)
	cmpq	%rdx, %rbp
	jg	.L11
.L21:
	cmpl	$7, %r12d
	jne	.L12
	addq	$1, (%r15)
	movq	n(%rip), %rdx
.L12:
	leaq	0(%rbp,%rbp,4), %rbp
	movl	%r12d, %r13d
	addq	%rbp, %rbp
	orl	$1, %r13d
	leaq	3(%rbp), %rbx
	cmpq	%rdx, %rbx
	jg	.L13
.L16:
	cmpl	$7, %r13d
	je	.L15
	leaq	(%rbx,%rbx,4), %rbx
	movl	%r13d, %esi
	movq	%r15, %rdx
	addq	%rbx, %rbx
	orl	$1, %esi
	leaq	3(%rbx), %rdi
	call	func
	movl	%r13d, %esi
	leaq	5(%rbx), %rdi
	movq	%r15, %rdx
	orl	$2, %esi
	addq	$7, %rbx
	orl	$4, %r13d
	call	func
	movq	n(%rip), %rdx
	cmpq	%rbx, %rdx
	jge	.L16
.L13:
	movl	%r12d, %r13d
	leaq	5(%rbp), %rbx
	orl	$2, %r13d
	cmpq	%rdx, %rbx
	jg	.L17
.L20:
	cmpl	$7, %r13d
	je	.L19
	leaq	(%rbx,%rbx,4), %rbx
	movl	%r13d, %esi
	movq	%r15, %rdx
	addq	%rbx, %rbx
	orl	$1, %esi
	leaq	3(%rbx), %rdi
	call	func
	movl	%r13d, %esi
	leaq	5(%rbx), %rdi
	movq	%r15, %rdx
	orl	$2, %esi
	addq	$7, %rbx
	orl	$4, %r13d
	call	func
	movq	n(%rip), %rdx
	cmpq	%rbx, %rdx
	jge	.L20
.L17:
	addq	$7, %rbp
	orl	$4, %r12d
	cmpq	%rdx, %rbp
	jle	.L21
.L11:
	movq	(%rsp), %rax
	movl	%r14d, %ebp
	orl	$2, %ebp
	leaq	5(%rax), %rbx
	cmpq	%rdx, %rbx
	jg	.L22
.L25:
	cmpl	$7, %ebp
	je	.L24
	leaq	(%rbx,%rbx,4), %rbx
	movl	%ebp, %esi
	movq	%r15, %rdx
	addq	%rbx, %rbx
	orl	$1, %esi
	leaq	3(%rbx), %rdi
	call	func
	movl	%ebp, %esi
	leaq	5(%rbx), %rdi
	movq	%r15, %rdx
	orl	$2, %esi
	addq	$7, %rbx
	orl	$4, %ebp
	call	func
	movq	n(%rip), %rdx
	cmpq	%rbx, %rdx
	jge	.L25
.L22:
	movq	(%rsp), %r13
	orl	$4, %r14d
	addq	$7, %r13
	cmpq	%rdx, %r13
	jle	.L26
.L9:
	movq	8(%rsp), %rax
	movl	16(%rsp), %r14d
	leaq	5(%rax), %r13
	orl	$2, %r14d
	cmpq	%rdx, %r13
	jg	.L27
.L40:
	cmpl	$7, %r14d
	jne	.L28
	addq	$1, (%r15)
	movq	n(%rip), %rdx
.L28:
	leaq	0(%r13,%r13,4), %r13
	movl	%r14d, %ebp
	leaq	(%r13,%r13), %rax
	orl	$1, %ebp
	leaq	3(%rax), %rbx
	movq	%rax, (%rsp)
	cmpq	%rdx, %rbx
	jg	.L29
.L32:
	cmpl	$7, %ebp
	je	.L31
	leaq	(%rbx,%rbx,4), %rbx
	movl	%ebp, %esi
	movq	%r15, %rdx
	addq	%rbx, %rbx
	orl	$1, %esi
	leaq	3(%rbx), %rdi
	call	func
	movl	%ebp, %esi
	leaq	5(%rbx), %rdi
	movq	%r15, %rdx
	orl	$2, %esi
	addq	$7, %rbx
	orl	$4, %ebp
	call	func
	movq	n(%rip), %rdx
	cmpq	%rbx, %rdx
	jge	.L32
.L29:
	movq	(%rsp), %rax
	movl	%r14d, %r12d
	orl	$2, %r12d
	leaq	5(%rax), %rbp
	cmpq	%rdx, %rbp
	jg	.L33
.L36:
	cmpl	$7, %r12d
	jne	.L34
	addq	$1, (%r15)
	movq	n(%rip), %rdx
.L34:
	leaq	0(%rbp,%rbp,4), %rbp
	movl	%r12d, %r13d
	addq	%rbp, %rbp
	orl	$1, %r13d
	leaq	3(%rbp), %rbx
	cmpq	%rdx, %rbx
	jg	.L38
.L35:
	cmpl	$7, %r13d
	je	.L39
	leaq	(%rbx,%rbx,4), %rbx
	movl	%r13d, %esi
	movq	%r15, %rdx
	addq	%rbx, %rbx
	orl	$1, %esi
	leaq	3(%rbx), %rdi
	call	func
	movl	%r13d, %esi
	leaq	5(%rbx), %rdi
	movq	%r15, %rdx
	orl	$2, %esi
	orl	$4, %r13d
	addq	$7, %rbx
	call	func
	cmpq	%rbx, n(%rip)
	jge	.L35
.L38:
	movl	%r12d, %esi
	leaq	5(%rbp), %rdi
	movq	%r15, %rdx
	addq	$7, %rbp
	orl	$2, %esi
	orl	$4, %r12d
	call	func
	movq	n(%rip), %rdx
	cmpq	%rbp, %rdx
	jge	.L36
.L33:
	movq	(%rsp), %r13
	orl	$4, %r14d
	addq	$7, %r13
	cmpq	%rdx, %r13
	jle	.L40
.L27:
	movq	8(%rsp), %rcx
	orl	$4, 16(%rsp)
	addq	$7, %rcx
	cmpq	%rdx, %rcx
	jle	.L41
.L7:
	movl	20(%rsp), %eax
	orl	$2, %eax
	movl	%eax, 16(%rsp)
	movq	24(%rsp), %rax
	leaq	5(%rax), %rcx
	cmpq	%rdx, %rcx
	jg	.L42
.L87:
	cmpl	$7, 16(%rsp)
	jne	.L43
	addq	$1, (%r15)
	movq	n(%rip), %rdx
.L43:
	leaq	(%rcx,%rcx,4), %rcx
	movl	16(%rsp), %r14d
	leaq	(%rcx,%rcx), %rax
	leaq	3(%rax), %r13
	movq	%rax, 8(%rsp)
	orl	$1, %r14d
	cmpq	%rdx, %r13
	jg	.L44
.L61:
	cmpl	$7, %r14d
	jne	.L45
	addq	$1, (%r15)
	movq	n(%rip), %rdx
.L45:
	leaq	0(%r13,%r13,4), %r13
	movl	%r14d, %r12d
	leaq	(%r13,%r13), %rax
	orl	$1, %r12d
	leaq	3(%rax), %rbp
	movq	%rax, (%rsp)
	cmpq	%rdx, %rbp
	jg	.L46
.L56:
	cmpl	$7, %r12d
	jne	.L47
	addq	$1, (%r15)
	movq	n(%rip), %rdx
.L47:
	leaq	0(%rbp,%rbp,4), %rbp
	movl	%r12d, %r13d
	addq	%rbp, %rbp
	orl	$1, %r13d
	leaq	3(%rbp), %rbx
	cmpq	%rdx, %rbx
	jg	.L48
.L51:
	cmpl	$7, %r13d
	je	.L50
	leaq	(%rbx,%rbx,4), %rbx
	movl	%r13d, %esi
	movq	%r15, %rdx
	addq	%rbx, %rbx
	orl	$1, %esi
	leaq	3(%rbx), %rdi
	call	func
	movl	%r13d, %esi
	leaq	5(%rbx), %rdi
	movq	%r15, %rdx
	orl	$2, %esi
	addq	$7, %rbx
	orl	$4, %r13d
	call	func
	movq	n(%rip), %rdx
	cmpq	%rbx, %rdx
	jge	.L51
.L48:
	movl	%r12d, %r13d
	leaq	5(%rbp), %rbx
	orl	$2, %r13d
	cmpq	%rdx, %rbx
	jg	.L52
.L55:
	cmpl	$7, %r13d
	je	.L54
	leaq	(%rbx,%rbx,4), %rbx
	movl	%r13d, %esi
	movq	%r15, %rdx
	addq	%rbx, %rbx
	orl	$1, %esi
	leaq	3(%rbx), %rdi
	call	func
	movl	%r13d, %esi
	leaq	5(%rbx), %rdi
	movq	%r15, %rdx
	orl	$2, %esi
	addq	$7, %rbx
	orl	$4, %r13d
	call	func
	movq	n(%rip), %rdx
	cmpq	%rbx, %rdx
	jge	.L55
.L52:
	addq	$7, %rbp
	orl	$4, %r12d
	cmpq	%rdx, %rbp
	jle	.L56
.L46:
	movq	(%rsp), %rax
	movl	%r14d, %ebp
	orl	$2, %ebp
	leaq	5(%rax), %rbx
	cmpq	%rdx, %rbx
	jg	.L57
.L60:
	cmpl	$7, %ebp
	je	.L59
	leaq	(%rbx,%rbx,4), %rbx
	movl	%ebp, %esi
	movq	%r15, %rdx
	addq	%rbx, %rbx
	orl	$1, %esi
	leaq	3(%rbx), %rdi
	call	func
	movl	%ebp, %esi
	leaq	5(%rbx), %rdi
	movq	%r15, %rdx
	orl	$2, %esi
	addq	$7, %rbx
	orl	$4, %ebp
	call	func
	movq	n(%rip), %rdx
	cmpq	%rbx, %rdx
	jge	.L60
.L57:
	movq	(%rsp), %r13
	orl	$4, %r14d
	addq	$7, %r13
	cmpq	%rdx, %r13
	jle	.L61
.L44:
	movq	8(%rsp), %rax
	movl	16(%rsp), %r14d
	leaq	5(%rax), %r13
	orl	$2, %r14d
	cmpq	%rdx, %r13
	jg	.L62
.L86:
	cmpl	$7, %r14d
	jne	.L63
	addq	$1, (%r15)
	movq	n(%rip), %rdx
.L63:
	leaq	0(%r13,%r13,4), %r13
	movl	%r14d, %r12d
	leaq	(%r13,%r13), %rax
	orl	$1, %r12d
	leaq	3(%rax), %rbp
	movq	%rax, (%rsp)
	cmpq	%rdx, %rbp
	jg	.L64
.L74:
	cmpl	$7, %r12d
	jne	.L65
	addq	$1, (%r15)
	movq	n(%rip), %rdx
.L65:
	leaq	0(%rbp,%rbp,4), %rbp
	movl	%r12d, %r13d
	addq	%rbp, %rbp
	orl	$1, %r13d
	leaq	3(%rbp), %rbx
	cmpq	%rdx, %rbx
	jg	.L66
.L69:
	cmpl	$7, %r13d
	je	.L68
	leaq	(%rbx,%rbx,4), %rbx
	movl	%r13d, %esi
	movq	%r15, %rdx
	addq	%rbx, %rbx
	orl	$1, %esi
	leaq	3(%rbx), %rdi
	call	func
	movl	%r13d, %esi
	leaq	5(%rbx), %rdi
	movq	%r15, %rdx
	orl	$2, %esi
	addq	$7, %rbx
	orl	$4, %r13d
	call	func
	movq	n(%rip), %rdx
	cmpq	%rbx, %rdx
	jge	.L69
.L66:
	movl	%r12d, %r13d
	leaq	5(%rbp), %rbx
	orl	$2, %r13d
	cmpq	%rdx, %rbx
	jg	.L70
.L73:
	cmpl	$7, %r13d
	je	.L72
	leaq	(%rbx,%rbx,4), %rbx
	movl	%r13d, %esi
	movq	%r15, %rdx
	addq	%rbx, %rbx
	orl	$1, %esi
	leaq	3(%rbx), %rdi
	call	func
	movl	%r13d, %esi
	leaq	5(%rbx), %rdi
	movq	%r15, %rdx
	orl	$2, %esi
	addq	$7, %rbx
	orl	$4, %r13d
	call	func
	movq	n(%rip), %rdx
	cmpq	%rbx, %rdx
	jge	.L73
.L70:
	addq	$7, %rbp
	orl	$4, %r12d
	cmpq	%rdx, %rbp
	jle	.L74
.L64:
	movq	(%rsp), %rax
	movl	%r14d, %r12d
	orl	$2, %r12d
	leaq	5(%rax), %rbp
	cmpq	%rdx, %rbp
	jg	.L75
.L85:
	cmpl	$7, %r12d
	jne	.L76
	addq	$1, (%r15)
	movq	n(%rip), %rdx
.L76:
	leaq	0(%rbp,%rbp,4), %rbp
	movl	%r12d, %r13d
	addq	%rbp, %rbp
	orl	$1, %r13d
	leaq	3(%rbp), %rbx
	cmpq	%rdx, %rbx
	jg	.L77
.L80:
	cmpl	$7, %r13d
	je	.L79
	leaq	(%rbx,%rbx,4), %rbx
	movl	%r13d, %esi
	movq	%r15, %rdx
	addq	%rbx, %rbx
	orl	$1, %esi
	leaq	3(%rbx), %rdi
	call	func
	movl	%r13d, %esi
	leaq	5(%rbx), %rdi
	movq	%r15, %rdx
	orl	$2, %esi
	addq	$7, %rbx
	orl	$4, %r13d
	call	func
	movq	n(%rip), %rdx
	cmpq	%rbx, %rdx
	jge	.L80
.L77:
	movl	%r12d, %r13d
	leaq	5(%rbp), %rbx
	orl	$2, %r13d
	cmpq	%rdx, %rbx
	jg	.L81
.L84:
	cmpl	$7, %r13d
	je	.L83
	leaq	(%rbx,%rbx,4), %rbx
	movl	%r13d, %esi
	movq	%r15, %rdx
	addq	%rbx, %rbx
	orl	$1, %esi
	leaq	3(%rbx), %rdi
	call	func
	movl	%r13d, %esi
	leaq	5(%rbx), %rdi
	movq	%r15, %rdx
	orl	$2, %esi
	addq	$7, %rbx
	orl	$4, %r13d
	call	func
	movq	n(%rip), %rdx
	cmpq	%rbx, %rdx
	jge	.L84
.L81:
	addq	$7, %rbp
	orl	$4, %r12d
	cmpq	%rdx, %rbp
	jle	.L85
.L75:
	movq	(%rsp), %r13
	orl	$4, %r14d
	addq	$7, %r13
	cmpq	%rdx, %r13
	jle	.L86
.L62:
	movq	8(%rsp), %rcx
	orl	$4, 16(%rsp)
	addq	$7, %rcx
	cmpq	%rdx, %rcx
	jle	.L87
.L42:
	movq	24(%rsp), %rcx
	orl	$4, 20(%rsp)
	addq	$7, %rcx
	cmpq	%rdx, %rcx
	jle	.L5
.L4:
	addq	$40, %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
.L15:
	.cfi_restore_state
	addq	$1, (%r15)
	leaq	(%rbx,%rbx,4), %rbx
	movq	%r15, %rdx
	movl	$7, %esi
	addq	%rbx, %rbx
	leaq	3(%rbx), %rdi
	call	func
	leaq	5(%rbx), %rdi
	movq	%r15, %rdx
	movl	$7, %esi
	call	func
	movq	n(%rip), %rdx
	addq	$7, %rbx
	cmpq	%rbx, %rdx
	jge	.L15
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L19:
	addq	$1, (%r15)
	leaq	(%rbx,%rbx,4), %rbx
	movq	%r15, %rdx
	movl	$7, %esi
	addq	%rbx, %rbx
	leaq	3(%rbx), %rdi
	call	func
	leaq	5(%rbx), %rdi
	movq	%r15, %rdx
	movl	$7, %esi
	call	func
	movq	n(%rip), %rdx
	addq	$7, %rbx
	cmpq	%rbx, %rdx
	jge	.L19
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L24:
	addq	$1, (%r15)
	leaq	(%rbx,%rbx,4), %rbx
	movq	%r15, %rdx
	movl	$7, %esi
	addq	%rbx, %rbx
	leaq	3(%rbx), %rdi
	call	func
	leaq	5(%rbx), %rdi
	movq	%r15, %rdx
	movl	$7, %esi
	call	func
	movq	n(%rip), %rdx
	addq	$7, %rbx
	cmpq	%rbx, %rdx
	jge	.L24
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L31:
	addq	$1, (%r15)
	leaq	(%rbx,%rbx,4), %rbx
	movq	%r15, %rdx
	movl	$7, %esi
	addq	%rbx, %rbx
	leaq	3(%rbx), %rdi
	call	func
	leaq	5(%rbx), %rdi
	movq	%r15, %rdx
	movl	$7, %esi
	call	func
	movq	n(%rip), %rdx
	addq	$7, %rbx
	cmpq	%rbx, %rdx
	jge	.L31
	jmp	.L29
	.p2align 4,,10
	.p2align 3
.L39:
	addq	$1, (%r15)
	leaq	(%rbx,%rbx,4), %rbx
	movq	%r15, %rdx
	movl	$7, %esi
	addq	%rbx, %rbx
	leaq	3(%rbx), %rdi
	call	func
	leaq	5(%rbx), %rdi
	movq	%r15, %rdx
	movl	$7, %esi
	call	func
	addq	$7, %rbx
	cmpq	%rbx, n(%rip)
	jge	.L39
	jmp	.L38
	.p2align 4,,10
	.p2align 3
.L50:
	addq	$1, (%r15)
	leaq	(%rbx,%rbx,4), %rbx
	movq	%r15, %rdx
	movl	$7, %esi
	addq	%rbx, %rbx
	leaq	3(%rbx), %rdi
	call	func
	leaq	5(%rbx), %rdi
	movq	%r15, %rdx
	movl	$7, %esi
	call	func
	movq	n(%rip), %rdx
	addq	$7, %rbx
	cmpq	%rbx, %rdx
	jge	.L50
	jmp	.L48
	.p2align 4,,10
	.p2align 3
.L54:
	addq	$1, (%r15)
	leaq	(%rbx,%rbx,4), %rbx
	movq	%r15, %rdx
	movl	$7, %esi
	addq	%rbx, %rbx
	leaq	3(%rbx), %rdi
	call	func
	leaq	5(%rbx), %rdi
	movq	%r15, %rdx
	movl	$7, %esi
	call	func
	movq	n(%rip), %rdx
	addq	$7, %rbx
	cmpq	%rbx, %rdx
	jge	.L54
	jmp	.L52
	.p2align 4,,10
	.p2align 3
.L59:
	addq	$1, (%r15)
	leaq	(%rbx,%rbx,4), %rbx
	movq	%r15, %rdx
	movl	$7, %esi
	addq	%rbx, %rbx
	leaq	3(%rbx), %rdi
	call	func
	leaq	5(%rbx), %rdi
	movq	%r15, %rdx
	movl	$7, %esi
	call	func
	movq	n(%rip), %rdx
	addq	$7, %rbx
	cmpq	%rbx, %rdx
	jge	.L59
	jmp	.L57
	.p2align 4,,10
	.p2align 3
.L68:
	addq	$1, (%r15)
	leaq	(%rbx,%rbx,4), %rbx
	movq	%r15, %rdx
	movl	$7, %esi
	addq	%rbx, %rbx
	leaq	3(%rbx), %rdi
	call	func
	leaq	5(%rbx), %rdi
	movq	%r15, %rdx
	movl	$7, %esi
	call	func
	movq	n(%rip), %rdx
	addq	$7, %rbx
	cmpq	%rbx, %rdx
	jge	.L68
	jmp	.L66
	.p2align 4,,10
	.p2align 3
.L72:
	addq	$1, (%r15)
	leaq	(%rbx,%rbx,4), %rbx
	movq	%r15, %rdx
	movl	$7, %esi
	addq	%rbx, %rbx
	leaq	3(%rbx), %rdi
	call	func
	leaq	5(%rbx), %rdi
	movq	%r15, %rdx
	movl	$7, %esi
	call	func
	movq	n(%rip), %rdx
	addq	$7, %rbx
	cmpq	%rbx, %rdx
	jge	.L72
	jmp	.L70
	.p2align 4,,10
	.p2align 3
.L79:
	addq	$1, (%r15)
	leaq	(%rbx,%rbx,4), %rbx
	movq	%r15, %rdx
	movl	$7, %esi
	addq	%rbx, %rbx
	leaq	3(%rbx), %rdi
	call	func
	leaq	5(%rbx), %rdi
	movq	%r15, %rdx
	movl	$7, %esi
	call	func
	movq	n(%rip), %rdx
	addq	$7, %rbx
	cmpq	%rbx, %rdx
	jge	.L79
	jmp	.L77
	.p2align 4,,10
	.p2align 3
.L83:
	addq	$1, (%r15)
	leaq	(%rbx,%rbx,4), %rbx
	movq	%r15, %rdx
	movl	$7, %esi
	addq	%rbx, %rbx
	leaq	3(%rbx), %rdi
	call	func
	leaq	5(%rbx), %rdi
	movq	%r15, %rdx
	movl	$7, %esi
	call	func
	movq	n(%rip), %rdx
	addq	$7, %rbx
	cmpq	%rdx, %rbx
	jle	.L83
	jmp	.L81
	.cfi_endproc
.LFE53:
	.size	func, .-func
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB54:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rbp
	leaq	n(%rip), %rsi
	movq	%rbp, %rdi
	subq	$16, %rsp
	.cfi_def_cfa_offset 32
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	xorl	%esi, %esi
	xorl	%edi, %edi
	movq	%rsp, %rdx
	movq	$0, (%rsp)
	call	func
	movq	(%rsp), %rdx
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L116
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L116:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE54:
	.size	main, .-main
	.globl	n
	.bss
	.align 8
	.type	n, @object
	.size	n, 8
n:
	.zero	8
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.p2align 4
	.globl	max
	.type	max, @function
max:
.LFB51:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovge	%edi, %eax
	ret
	.cfi_endproc
.LFE51:
	.size	max, .-max
	.p2align 4
	.globl	min
	.type	min, @function
min:
.LFB52:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovle	%edi, %eax
	ret
	.cfi_endproc
.LFE52:
	.size	min, .-min
	.p2align 4
	.globl	func
	.type	func, @function
func:
.LFB53:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movq	%rdx, %r15
	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
	movq	n(%rip), %rdx
	movl	%esi, 20(%rsp)
	cmpq	%rdx, %rdi
	jg	.L4
	movq	%rdi, %rcx
.L5:
	cmpl	$7, 20(%rsp)
	jne	.L6
	addq	$1, (%r15)
	movq	n(%rip), %rdx
.L6:
	movl	20(%rsp), %eax
	leaq	(%rcx,%rcx,4), %rcx
	orl	$1, %eax
	movl	%eax, 16(%rsp)
	leaq	(%rcx,%rcx), %rax
	leaq	3(%rax), %rcx
	movq	%rax, 24(%rsp)
	cmpq	%rdx, %rcx
	jg	.L7
.L41:
	cmpl	$7, 16(%rsp)
	jne	.L8
	addq	$1, (%r15)
	movq	n(%rip), %rdx
.L8:
	leaq	(%rcx,%rcx,4), %rcx
	movl	16(%rsp), %r14d
	leaq	(%rcx,%rcx), %rax
	leaq	3(%rax), %r13
	movq	%rax, 8(%rsp)
	orl	$1, %r14d
	cmpq	%rdx, %r13
	jg	.L9
.L26:
	cmpl	$7, %r14d
	jne	.L10
	addq	$1, (%r15)
	movq	n(%rip), %rdx
.L10:
	leaq	0(%r13,%r13,4), %r13
	movl	%r14d, %r12d
	leaq	(%r13,%r13), %rax
	orl	$1, %r12d
	leaq	3(%rax), %rbp
	movq	%rax, (%rsp)
	cmpq	%rdx, %rbp
	jg	.L11
.L21:
	cmpl	$7, %r12d
	jne	.L12
	addq	$1, (%r15)
	movq	n(%rip), %rdx
.L12:
	leaq	0(%rbp,%rbp,4), %rbp
	movl	%r12d, %r13d
	addq	%rbp, %rbp
	orl	$1, %r13d
	leaq	3(%rbp), %rbx
	cmpq	%rdx, %rbx
	jg	.L13
.L16:
	cmpl	$7, %r13d
	je	.L15
	leaq	(%rbx,%rbx,4), %rbx
	movl	%r13d, %esi
	movq	%r15, %rdx
	addq	%rbx, %rbx
	orl	$1, %esi
	leaq	3(%rbx), %rdi
	call	func
	movl	%r13d, %esi
	leaq	5(%rbx), %rdi
	movq	%r15, %rdx
	orl	$2, %esi
	addq	$7, %rbx
	orl	$4, %r13d
	call	func
	movq	n(%rip), %rdx
	cmpq	%rbx, %rdx
	jge	.L16
.L13:
	movl	%r12d, %r13d
	leaq	5(%rbp), %rbx
	orl	$2, %r13d
	cmpq	%rdx, %rbx
	jg	.L17
.L20:
	cmpl	$7, %r13d
	je	.L19
	leaq	(%rbx,%rbx,4), %rbx
	movl	%r13d, %esi
	movq	%r15, %rdx
	addq	%rbx, %rbx
	orl	$1, %esi
	leaq	3(%rbx), %rdi
	call	func
	movl	%r13d, %esi
	leaq	5(%rbx), %rdi
	movq	%r15, %rdx
	orl	$2, %esi
	addq	$7, %rbx
	orl	$4, %r13d
	call	func
	movq	n(%rip), %rdx
	cmpq	%rbx, %rdx
	jge	.L20
.L17:
	addq	$7, %rbp
	orl	$4, %r12d
	cmpq	%rdx, %rbp
	jle	.L21
.L11:
	movq	(%rsp), %rax
	movl	%r14d, %ebp
	orl	$2, %ebp
	leaq	5(%rax), %rbx
	cmpq	%rdx, %rbx
	jg	.L22
.L25:
	cmpl	$7, %ebp
	je	.L24
	leaq	(%rbx,%rbx,4), %rbx
	movl	%ebp, %esi
	movq	%r15, %rdx
	addq	%rbx, %rbx
	orl	$1, %esi
	leaq	3(%rbx), %rdi
	call	func
	movl	%ebp, %esi
	leaq	5(%rbx), %rdi
	movq	%r15, %rdx
	orl	$2, %esi
	addq	$7, %rbx
	orl	$4, %ebp
	call	func
	movq	n(%rip), %rdx
	cmpq	%rbx, %rdx
	jge	.L25
.L22:
	movq	(%rsp), %r13
	orl	$4, %r14d
	addq	$7, %r13
	cmpq	%rdx, %r13
	jle	.L26
.L9:
	movq	8(%rsp), %rax
	movl	16(%rsp), %r14d
	leaq	5(%rax), %r13
	orl	$2, %r14d
	cmpq	%rdx, %r13
	jg	.L27
.L40:
	cmpl	$7, %r14d
	jne	.L28
	addq	$1, (%r15)
	movq	n(%rip), %rdx
.L28:
	leaq	0(%r13,%r13,4), %r13
	movl	%r14d, %ebp
	leaq	(%r13,%r13), %rax
	orl	$1, %ebp
	leaq	3(%rax), %rbx
	movq	%rax, (%rsp)
	cmpq	%rdx, %rbx
	jg	.L29
.L32:
	cmpl	$7, %ebp
	je	.L31
	leaq	(%rbx,%rbx,4), %rbx
	movl	%ebp, %esi
	movq	%r15, %rdx
	addq	%rbx, %rbx
	orl	$1, %esi
	leaq	3(%rbx), %rdi
	call	func
	movl	%ebp, %esi
	leaq	5(%rbx), %rdi
	movq	%r15, %rdx
	orl	$2, %esi
	addq	$7, %rbx
	orl	$4, %ebp
	call	func
	movq	n(%rip), %rdx
	cmpq	%rbx, %rdx
	jge	.L32
.L29:
	movq	(%rsp), %rax
	movl	%r14d, %r12d
	orl	$2, %r12d
	leaq	5(%rax), %rbp
	cmpq	%rdx, %rbp
	jg	.L33
.L36:
	cmpl	$7, %r12d
	jne	.L34
	addq	$1, (%r15)
	movq	n(%rip), %rdx
.L34:
	leaq	0(%rbp,%rbp,4), %rbp
	movl	%r12d, %r13d
	addq	%rbp, %rbp
	orl	$1, %r13d
	leaq	3(%rbp), %rbx
	cmpq	%rdx, %rbx
	jg	.L38
.L35:
	cmpl	$7, %r13d
	je	.L39
	leaq	(%rbx,%rbx,4), %rbx
	movl	%r13d, %esi
	movq	%r15, %rdx
	addq	%rbx, %rbx
	orl	$1, %esi
	leaq	3(%rbx), %rdi
	call	func
	movl	%r13d, %esi
	leaq	5(%rbx), %rdi
	movq	%r15, %rdx
	orl	$2, %esi
	orl	$4, %r13d
	addq	$7, %rbx
	call	func
	cmpq	%rbx, n(%rip)
	jge	.L35
.L38:
	movl	%r12d, %esi
	leaq	5(%rbp), %rdi
	movq	%r15, %rdx
	addq	$7, %rbp
	orl	$2, %esi
	orl	$4, %r12d
	call	func
	movq	n(%rip), %rdx
	cmpq	%rbp, %rdx
	jge	.L36
.L33:
	movq	(%rsp), %r13
	orl	$4, %r14d
	addq	$7, %r13
	cmpq	%rdx, %r13
	jle	.L40
.L27:
	movq	8(%rsp), %rcx
	orl	$4, 16(%rsp)
	addq	$7, %rcx
	cmpq	%rdx, %rcx
	jle	.L41
.L7:
	movl	20(%rsp), %eax
	orl	$2, %eax
	movl	%eax, 16(%rsp)
	movq	24(%rsp), %rax
	leaq	5(%rax), %rcx
	cmpq	%rdx, %rcx
	jg	.L42
.L87:
	cmpl	$7, 16(%rsp)
	jne	.L43
	addq	$1, (%r15)
	movq	n(%rip), %rdx
.L43:
	leaq	(%rcx,%rcx,4), %rcx
	movl	16(%rsp), %r14d
	leaq	(%rcx,%rcx), %rax
	leaq	3(%rax), %r13
	movq	%rax, 8(%rsp)
	orl	$1, %r14d
	cmpq	%rdx, %r13
	jg	.L44
.L61:
	cmpl	$7, %r14d
	jne	.L45
	addq	$1, (%r15)
	movq	n(%rip), %rdx
.L45:
	leaq	0(%r13,%r13,4), %r13
	movl	%r14d, %r12d
	leaq	(%r13,%r13), %rax
	orl	$1, %r12d
	leaq	3(%rax), %rbp
	movq	%rax, (%rsp)
	cmpq	%rdx, %rbp
	jg	.L46
.L56:
	cmpl	$7, %r12d
	jne	.L47
	addq	$1, (%r15)
	movq	n(%rip), %rdx
.L47:
	leaq	0(%rbp,%rbp,4), %rbp
	movl	%r12d, %r13d
	addq	%rbp, %rbp
	orl	$1, %r13d
	leaq	3(%rbp), %rbx
	cmpq	%rdx, %rbx
	jg	.L48
.L51:
	cmpl	$7, %r13d
	je	.L50
	leaq	(%rbx,%rbx,4), %rbx
	movl	%r13d, %esi
	movq	%r15, %rdx
	addq	%rbx, %rbx
	orl	$1, %esi
	leaq	3(%rbx), %rdi
	call	func
	movl	%r13d, %esi
	leaq	5(%rbx), %rdi
	movq	%r15, %rdx
	orl	$2, %esi
	addq	$7, %rbx
	orl	$4, %r13d
	call	func
	movq	n(%rip), %rdx
	cmpq	%rbx, %rdx
	jge	.L51
.L48:
	movl	%r12d, %r13d
	leaq	5(%rbp), %rbx
	orl	$2, %r13d
	cmpq	%rdx, %rbx
	jg	.L52
.L55:
	cmpl	$7, %r13d
	je	.L54
	leaq	(%rbx,%rbx,4), %rbx
	movl	%r13d, %esi
	movq	%r15, %rdx
	addq	%rbx, %rbx
	orl	$1, %esi
	leaq	3(%rbx), %rdi
	call	func
	movl	%r13d, %esi
	leaq	5(%rbx), %rdi
	movq	%r15, %rdx
	orl	$2, %esi
	addq	$7, %rbx
	orl	$4, %r13d
	call	func
	movq	n(%rip), %rdx
	cmpq	%rbx, %rdx
	jge	.L55
.L52:
	addq	$7, %rbp
	orl	$4, %r12d
	cmpq	%rdx, %rbp
	jle	.L56
.L46:
	movq	(%rsp), %rax
	movl	%r14d, %ebp
	orl	$2, %ebp
	leaq	5(%rax), %rbx
	cmpq	%rdx, %rbx
	jg	.L57
.L60:
	cmpl	$7, %ebp
	je	.L59
	leaq	(%rbx,%rbx,4), %rbx
	movl	%ebp, %esi
	movq	%r15, %rdx
	addq	%rbx, %rbx
	orl	$1, %esi
	leaq	3(%rbx), %rdi
	call	func
	movl	%ebp, %esi
	leaq	5(%rbx), %rdi
	movq	%r15, %rdx
	orl	$2, %esi
	addq	$7, %rbx
	orl	$4, %ebp
	call	func
	movq	n(%rip), %rdx
	cmpq	%rbx, %rdx
	jge	.L60
.L57:
	movq	(%rsp), %r13
	orl	$4, %r14d
	addq	$7, %r13
	cmpq	%rdx, %r13
	jle	.L61
.L44:
	movq	8(%rsp), %rax
	movl	16(%rsp), %r14d
	leaq	5(%rax), %r13
	orl	$2, %r14d
	cmpq	%rdx, %r13
	jg	.L62
.L86:
	cmpl	$7, %r14d
	jne	.L63
	addq	$1, (%r15)
	movq	n(%rip), %rdx
.L63:
	leaq	0(%r13,%r13,4), %r13
	movl	%r14d, %r12d
	leaq	(%r13,%r13), %rax
	orl	$1, %r12d
	leaq	3(%rax), %rbp
	movq	%rax, (%rsp)
	cmpq	%rdx, %rbp
	jg	.L64
.L74:
	cmpl	$7, %r12d
	jne	.L65
	addq	$1, (%r15)
	movq	n(%rip), %rdx
.L65:
	leaq	0(%rbp,%rbp,4), %rbp
	movl	%r12d, %r13d
	addq	%rbp, %rbp
	orl	$1, %r13d
	leaq	3(%rbp), %rbx
	cmpq	%rdx, %rbx
	jg	.L66
.L69:
	cmpl	$7, %r13d
	je	.L68
	leaq	(%rbx,%rbx,4), %rbx
	movl	%r13d, %esi
	movq	%r15, %rdx
	addq	%rbx, %rbx
	orl	$1, %esi
	leaq	3(%rbx), %rdi
	call	func
	movl	%r13d, %esi
	leaq	5(%rbx), %rdi
	movq	%r15, %rdx
	orl	$2, %esi
	addq	$7, %rbx
	orl	$4, %r13d
	call	func
	movq	n(%rip), %rdx
	cmpq	%rbx, %rdx
	jge	.L69
.L66:
	movl	%r12d, %r13d
	leaq	5(%rbp), %rbx
	orl	$2, %r13d
	cmpq	%rdx, %rbx
	jg	.L70
.L73:
	cmpl	$7, %r13d
	je	.L72
	leaq	(%rbx,%rbx,4), %rbx
	movl	%r13d, %esi
	movq	%r15, %rdx
	addq	%rbx, %rbx
	orl	$1, %esi
	leaq	3(%rbx), %rdi
	call	func
	movl	%r13d, %esi
	leaq	5(%rbx), %rdi
	movq	%r15, %rdx
	orl	$2, %esi
	addq	$7, %rbx
	orl	$4, %r13d
	call	func
	movq	n(%rip), %rdx
	cmpq	%rbx, %rdx
	jge	.L73
.L70:
	addq	$7, %rbp
	orl	$4, %r12d
	cmpq	%rdx, %rbp
	jle	.L74
.L64:
	movq	(%rsp), %rax
	movl	%r14d, %r12d
	orl	$2, %r12d
	leaq	5(%rax), %rbp
	cmpq	%rdx, %rbp
	jg	.L75
.L85:
	cmpl	$7, %r12d
	jne	.L76
	addq	$1, (%r15)
	movq	n(%rip), %rdx
.L76:
	leaq	0(%rbp,%rbp,4), %rbp
	movl	%r12d, %r13d
	addq	%rbp, %rbp
	orl	$1, %r13d
	leaq	3(%rbp), %rbx
	cmpq	%rdx, %rbx
	jg	.L77
.L80:
	cmpl	$7, %r13d
	je	.L79
	leaq	(%rbx,%rbx,4), %rbx
	movl	%r13d, %esi
	movq	%r15, %rdx
	addq	%rbx, %rbx
	orl	$1, %esi
	leaq	3(%rbx), %rdi
	call	func
	movl	%r13d, %esi
	leaq	5(%rbx), %rdi
	movq	%r15, %rdx
	orl	$2, %esi
	addq	$7, %rbx
	orl	$4, %r13d
	call	func
	movq	n(%rip), %rdx
	cmpq	%rbx, %rdx
	jge	.L80
.L77:
	movl	%r12d, %r13d
	leaq	5(%rbp), %rbx
	orl	$2, %r13d
	cmpq	%rdx, %rbx
	jg	.L81
.L84:
	cmpl	$7, %r13d
	je	.L83
	leaq	(%rbx,%rbx,4), %rbx
	movl	%r13d, %esi
	movq	%r15, %rdx
	addq	%rbx, %rbx
	orl	$1, %esi
	leaq	3(%rbx), %rdi
	call	func
	movl	%r13d, %esi
	leaq	5(%rbx), %rdi
	movq	%r15, %rdx
	orl	$2, %esi
	addq	$7, %rbx
	orl	$4, %r13d
	call	func
	movq	n(%rip), %rdx
	cmpq	%rbx, %rdx
	jge	.L84
.L81:
	addq	$7, %rbp
	orl	$4, %r12d
	cmpq	%rdx, %rbp
	jle	.L85
.L75:
	movq	(%rsp), %r13
	orl	$4, %r14d
	addq	$7, %r13
	cmpq	%rdx, %r13
	jle	.L86
.L62:
	movq	8(%rsp), %rcx
	orl	$4, 16(%rsp)
	addq	$7, %rcx
	cmpq	%rdx, %rcx
	jle	.L87
.L42:
	movq	24(%rsp), %rcx
	orl	$4, 20(%rsp)
	addq	$7, %rcx
	cmpq	%rdx, %rcx
	jle	.L5
.L4:
	addq	$40, %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
.L15:
	.cfi_restore_state
	addq	$1, (%r15)
	leaq	(%rbx,%rbx,4), %rbx
	movq	%r15, %rdx
	movl	$7, %esi
	addq	%rbx, %rbx
	leaq	3(%rbx), %rdi
	call	func
	leaq	5(%rbx), %rdi
	movq	%r15, %rdx
	movl	$7, %esi
	call	func
	movq	n(%rip), %rdx
	addq	$7, %rbx
	cmpq	%rbx, %rdx
	jge	.L15
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L19:
	addq	$1, (%r15)
	leaq	(%rbx,%rbx,4), %rbx
	movq	%r15, %rdx
	movl	$7, %esi
	addq	%rbx, %rbx
	leaq	3(%rbx), %rdi
	call	func
	leaq	5(%rbx), %rdi
	movq	%r15, %rdx
	movl	$7, %esi
	call	func
	movq	n(%rip), %rdx
	addq	$7, %rbx
	cmpq	%rbx, %rdx
	jge	.L19
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L24:
	addq	$1, (%r15)
	leaq	(%rbx,%rbx,4), %rbx
	movq	%r15, %rdx
	movl	$7, %esi
	addq	%rbx, %rbx
	leaq	3(%rbx), %rdi
	call	func
	leaq	5(%rbx), %rdi
	movq	%r15, %rdx
	movl	$7, %esi
	call	func
	movq	n(%rip), %rdx
	addq	$7, %rbx
	cmpq	%rbx, %rdx
	jge	.L24
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L31:
	addq	$1, (%r15)
	leaq	(%rbx,%rbx,4), %rbx
	movq	%r15, %rdx
	movl	$7, %esi
	addq	%rbx, %rbx
	leaq	3(%rbx), %rdi
	call	func
	leaq	5(%rbx), %rdi
	movq	%r15, %rdx
	movl	$7, %esi
	call	func
	movq	n(%rip), %rdx
	addq	$7, %rbx
	cmpq	%rbx, %rdx
	jge	.L31
	jmp	.L29
	.p2align 4,,10
	.p2align 3
.L39:
	addq	$1, (%r15)
	leaq	(%rbx,%rbx,4), %rbx
	movq	%r15, %rdx
	movl	$7, %esi
	addq	%rbx, %rbx
	leaq	3(%rbx), %rdi
	call	func
	leaq	5(%rbx), %rdi
	movq	%r15, %rdx
	movl	$7, %esi
	call	func
	addq	$7, %rbx
	cmpq	%rbx, n(%rip)
	jge	.L39
	jmp	.L38
	.p2align 4,,10
	.p2align 3
.L50:
	addq	$1, (%r15)
	leaq	(%rbx,%rbx,4), %rbx
	movq	%r15, %rdx
	movl	$7, %esi
	addq	%rbx, %rbx
	leaq	3(%rbx), %rdi
	call	func
	leaq	5(%rbx), %rdi
	movq	%r15, %rdx
	movl	$7, %esi
	call	func
	movq	n(%rip), %rdx
	addq	$7, %rbx
	cmpq	%rbx, %rdx
	jge	.L50
	jmp	.L48
	.p2align 4,,10
	.p2align 3
.L54:
	addq	$1, (%r15)
	leaq	(%rbx,%rbx,4), %rbx
	movq	%r15, %rdx
	movl	$7, %esi
	addq	%rbx, %rbx
	leaq	3(%rbx), %rdi
	call	func
	leaq	5(%rbx), %rdi
	movq	%r15, %rdx
	movl	$7, %esi
	call	func
	movq	n(%rip), %rdx
	addq	$7, %rbx
	cmpq	%rbx, %rdx
	jge	.L54
	jmp	.L52
	.p2align 4,,10
	.p2align 3
.L59:
	addq	$1, (%r15)
	leaq	(%rbx,%rbx,4), %rbx
	movq	%r15, %rdx
	movl	$7, %esi
	addq	%rbx, %rbx
	leaq	3(%rbx), %rdi
	call	func
	leaq	5(%rbx), %rdi
	movq	%r15, %rdx
	movl	$7, %esi
	call	func
	movq	n(%rip), %rdx
	addq	$7, %rbx
	cmpq	%rbx, %rdx
	jge	.L59
	jmp	.L57
	.p2align 4,,10
	.p2align 3
.L68:
	addq	$1, (%r15)
	leaq	(%rbx,%rbx,4), %rbx
	movq	%r15, %rdx
	movl	$7, %esi
	addq	%rbx, %rbx
	leaq	3(%rbx), %rdi
	call	func
	leaq	5(%rbx), %rdi
	movq	%r15, %rdx
	movl	$7, %esi
	call	func
	movq	n(%rip), %rdx
	addq	$7, %rbx
	cmpq	%rbx, %rdx
	jge	.L68
	jmp	.L66
	.p2align 4,,10
	.p2align 3
.L72:
	addq	$1, (%r15)
	leaq	(%rbx,%rbx,4), %rbx
	movq	%r15, %rdx
	movl	$7, %esi
	addq	%rbx, %rbx
	leaq	3(%rbx), %rdi
	call	func
	leaq	5(%rbx), %rdi
	movq	%r15, %rdx
	movl	$7, %esi
	call	func
	movq	n(%rip), %rdx
	addq	$7, %rbx
	cmpq	%rbx, %rdx
	jge	.L72
	jmp	.L70
	.p2align 4,,10
	.p2align 3
.L79:
	addq	$1, (%r15)
	leaq	(%rbx,%rbx,4), %rbx
	movq	%r15, %rdx
	movl	$7, %esi
	addq	%rbx, %rbx
	leaq	3(%rbx), %rdi
	call	func
	leaq	5(%rbx), %rdi
	movq	%r15, %rdx
	movl	$7, %esi
	call	func
	movq	n(%rip), %rdx
	addq	$7, %rbx
	cmpq	%rbx, %rdx
	jge	.L79
	jmp	.L77
	.p2align 4,,10
	.p2align 3
.L83:
	addq	$1, (%r15)
	leaq	(%rbx,%rbx,4), %rbx
	movq	%r15, %rdx
	movl	$7, %esi
	addq	%rbx, %rbx
	leaq	3(%rbx), %rdi
	call	func
	leaq	5(%rbx), %rdi
	movq	%r15, %rdx
	movl	$7, %esi
	call	func
	movq	n(%rip), %rdx
	addq	$7, %rbx
	cmpq	%rdx, %rbx
	jle	.L83
	jmp	.L81
	.cfi_endproc
.LFE53:
	.size	func, .-func
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB54:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rbp
	leaq	n(%rip), %rsi
	movq	%rbp, %rdi
	subq	$16, %rsp
	.cfi_def_cfa_offset 32
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	xorl	%esi, %esi
	xorl	%edi, %edi
	movq	%rsp, %rdx
	movq	$0, (%rsp)
	call	func
	movq	(%rsp), %rdx
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L116
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L116:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE54:
	.size	main, .-main
	.globl	n
	.bss
	.align 8
	.type	n, @object
	.size	n, 8
n:
	.zero	8
	.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>
#include<string.h>

typedef long long ll;

int max(int a, int b){
  if(a > b) return a;
  else return b;
}
int min(int a, int b){
  if(a < b) return a;
  else return b;
}

  ll n;

void func(ll cur, int use, ll *counter){

  if(cur > n) return;
  if(use == 0b111) ++(*counter);

  func(cur*10 + 3, use | 0b001, counter);
  func(cur*10 + 5, use | 0b010, counter);
  func(cur*10 + 7, use | 0b100, counter);

}

int main(){

  scanf("%d",&n);
  ll res = 0;
  func(0, 0, &res);
  printf("%d",res);
  return 0;

}

60
 1134
 656396080
 1260308870
 251112438
 3669
 4753
 3412
 5825
 471776498

0 6 20434 26484 8334 13 18 8 30 14384
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>
#include<string.h>

typedef long long ll;

int max(int a, int b){
  if(a > b) return a;
  else return b;
}
int min(int a, int b){
  if(a < b) return a;
  else return b;
}

  ll n;

void func(ll cur, int use, ll *counter){

  if(cur > n) return;
  if(use == 0b111) ++(*counter);

  func(cur*10 + 3, use | 0b001, counter);
  func(cur*10 + 5, use | 0b010, counter);
  func(cur*10 + 7, use | 0b100, counter);

}

int main(){

  scanf("%d",&n);
  ll res = 0;
  func(0, 0, &res);
  printf("%d",res);
  return 0;

}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	max
	.type	max, @function
max:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L2
	movl	-4(%rbp), %eax
	jmp	.L3
.L2:
	movl	-8(%rbp), %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	max, .-max
	.globl	min
	.type	min, @function
min:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L5
	movl	-4(%rbp), %eax
	jmp	.L6
.L5:
	movl	-8(%rbp), %eax
.L6:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	min, .-min
	.globl	n
	.bss
	.align 8
	.type	n, @object
	.size	n, 8
n:
	.zero	8
	.text
	.globl	func
	.type	func, @function
func:
.LFB8:
	.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
	movq	%rdi, -8(%rbp)
	movl	%esi, -12(%rbp)
	movq	%rdx, -24(%rbp)
	movq	n(%rip), %rax
	cmpq	%rax, -8(%rbp)
	jg	.L11
	cmpl	$7, -12(%rbp)
	jne	.L10
	movq	-24(%rbp), %rax
	movq	(%rax), %rax
	leaq	1(%rax), %rdx
	movq	-24(%rbp), %rax
	movq	%rdx, (%rax)
.L10:
	movl	-12(%rbp), %eax
	orl	$1, %eax
	movl	%eax, %esi
	movq	-8(%rbp), %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	leaq	3(%rax), %rcx
	movq	-24(%rbp), %rax
	movq	%rax, %rdx
	movq	%rcx, %rdi
	call	func
	movl	-12(%rbp), %eax
	orl	$2, %eax
	movl	%eax, %esi
	movq	-8(%rbp), %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	leaq	5(%rax), %rcx
	movq	-24(%rbp), %rax
	movq	%rax, %rdx
	movq	%rcx, %rdi
	call	func
	movl	-12(%rbp), %eax
	orl	$4, %eax
	movl	%eax, %esi
	movq	-8(%rbp), %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	leaq	7(%rax), %rcx
	movq	-24(%rbp), %rax
	movq	%rax, %rdx
	movq	%rcx, %rdi
	call	func
	jmp	.L7
.L11:
	nop
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	func, .-func
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB9:
	.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
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -16(%rbp)
	leaq	-16(%rbp), %rax
	movq	%rax, %rdx
	movl	$0, %esi
	movl	$0, %edi
	call	func
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.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	max
	.type	max, @function
max:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L2
	movl	-4(%rbp), %eax
	jmp	.L3
.L2:
	movl	-8(%rbp), %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	max, .-max
	.globl	min
	.type	min, @function
min:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L5
	movl	-4(%rbp), %eax
	jmp	.L6
.L5:
	movl	-8(%rbp), %eax
.L6:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	min, .-min
	.globl	n
	.bss
	.align 8
	.type	n, @object
	.size	n, 8
n:
	.zero	8
	.text
	.globl	func
	.type	func, @function
func:
.LFB8:
	.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
	movq	%rdi, -8(%rbp)
	movl	%esi, -12(%rbp)
	movq	%rdx, -24(%rbp)
	movq	n(%rip), %rax
	cmpq	%rax, -8(%rbp)
	jg	.L11
	cmpl	$7, -12(%rbp)
	jne	.L10
	movq	-24(%rbp), %rax
	movq	(%rax), %rax
	leaq	1(%rax), %rdx
	movq	-24(%rbp), %rax
	movq	%rdx, (%rax)
.L10:
	movl	-12(%rbp), %eax
	orl	$1, %eax
	movl	%eax, %esi
	movq	-8(%rbp), %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	leaq	3(%rax), %rcx
	movq	-24(%rbp), %rax
	movq	%rax, %rdx
	movq	%rcx, %rdi
	call	func
	movl	-12(%rbp), %eax
	orl	$2, %eax
	movl	%eax, %esi
	movq	-8(%rbp), %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	leaq	5(%rax), %rcx
	movq	-24(%rbp), %rax
	movq	%rax, %rdx
	movq	%rcx, %rdi
	call	func
	movl	-12(%rbp), %eax
	orl	$4, %eax
	movl	%eax, %esi
	movq	-8(%rbp), %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	leaq	7(%rax), %rcx
	movq	-24(%rbp), %rax
	movq	%rax, %rdx
	movq	%rcx, %rdi
	call	func
	jmp	.L7
.L11:
	nop
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	func, .-func
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB9:
	.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
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -16(%rbp)
	leaq	-16(%rbp), %rax
	movq	%rax, %rdx
	movl	$0, %esi
	movl	$0, %edi
	call	func
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.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:
