Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#define max(a,b)((a)>(b)?(a):(b))
long long BIT[100010], bit_size; // long long は 64bit 整数．
void bit_init(int n){
	memset(BIT,0,n*(sizeof(long long)));
	bit_size = n;
}
long long bit_max(int n){ // [1,n] の最大値
	long long ans = 0;
	while(n > 0){
		ans = max(ans, BIT[n]);
		n &= n-1;
	}
	return ans;
}
void bit_setmax(int n, long long v){ // # [1,n] の最大値を v に更新する
	while (n < bit_size){
		BIT[n] = max(BIT[n], v);
		n += n & (-n);
	}
}
int main(){
	long long N,x,i=0;
	scanf("%lld",&N);
	bit_init(N+1);
	for(; i<N; ++i){
		scanf("%lld",&x);
		long long cost = bit_max(x);
		bit_setmax(x,cost+x);
	}
	printf("%lld\n",(1+N)*N/2 - bit_max(N));
exit(0);}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	BIT
	.bss
	.align 32
	.type	BIT, @object
	.size	BIT, 800080
BIT:
	.zero	800080
	.globl	bit_size
	.align 8
	.type	bit_size, @object
	.size	bit_size, 8
bit_size:
	.zero	8
	.text
	.globl	bit_init
	.type	bit_init, @function
bit_init:
.LFB0:
	.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
	movl	%edi, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	salq	$3, %rax
	movq	%rax, %rdx
	movl	$0, %esi
	leaq	BIT(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	-4(%rbp), %eax
	cltq
	movq	%rax, bit_size(%rip)
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	bit_init, .-bit_init
	.globl	bit_max
	.type	bit_max, @function
bit_max:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movq	$0, -8(%rbp)
	jmp	.L3
.L4:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	BIT(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	-8(%rbp), %rdx
	cmpq	%rax, %rdx
	cmovge	%rdx, %rax
	movq	%rax, -8(%rbp)
	movl	-20(%rbp), %eax
	subl	$1, %eax
	andl	%eax, -20(%rbp)
.L3:
	cmpl	$0, -20(%rbp)
	jg	.L4
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	bit_max, .-bit_max
	.globl	bit_setmax
	.type	bit_setmax, @function
bit_setmax:
.LFB2:
	.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)
	movq	%rsi, -16(%rbp)
	jmp	.L7
.L8:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	BIT(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-16(%rbp), %rax
	cmpq	%rax, %rdx
	cmovge	%rdx, %rax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	BIT(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movl	-4(%rbp), %eax
	negl	%eax
	andl	-4(%rbp), %eax
	addl	%eax, -4(%rbp)
.L7:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	bit_size(%rip), %rax
	cmpq	%rax, %rdx
	jl	.L8
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	bit_setmax, .-bit_setmax
	.section	.rodata
.LC0:
	.string	"%lld"
.LC1:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movq	$0, -40(%rbp)
	leaq	-56(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movq	-56(%rbp), %rax
	addl	$1, %eax
	movl	%eax, %edi
	call	bit_init
	jmp	.L10
.L11:
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movq	-48(%rbp), %rax
	movl	%eax, %edi
	call	bit_max
	movq	%rax, -32(%rbp)
	movq	-48(%rbp), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	-48(%rbp), %rdx
	movq	%rax, %rsi
	movl	%edx, %edi
	call	bit_setmax
	addq	$1, -40(%rbp)
.L10:
	movq	-56(%rbp), %rax
	cmpq	%rax, -40(%rbp)
	jl	.L11
	movq	-56(%rbp), %rax
	leaq	1(%rax), %rdx
	movq	-56(%rbp), %rax
	imulq	%rdx, %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, %rbx
	movq	-56(%rbp), %rax
	movl	%eax, %edi
	call	bit_max
	movq	%rax, %rdx
	movq	%rbx, %rax
	subq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %edi
	call	exit@PLT
	.cfi_endproc
.LFE3:
	.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	bit_init
	.type	bit_init, @function
bit_init:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movslq	%edi, %rbx
	xorl	%esi, %esi
	leaq	BIT(%rip), %rdi
	leaq	0(,%rbx,8), %rdx
	call	memset@PLT
	movq	%rbx, bit_size(%rip)
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	bit_init, .-bit_init
	.p2align 4
	.globl	bit_max
	.type	bit_max, @function
bit_max:
.LFB1:
	.cfi_startproc
	endbr64
	xorl	%eax, %eax
	testl	%edi, %edi
	jle	.L7
	leaq	BIT(%rip), %rcx
	.p2align 4,,10
	.p2align 3
.L6:
	movslq	%edi, %rdx
	movq	(%rcx,%rdx,8), %rdx
	cmpq	%rdx, %rax
	cmovl	%rdx, %rax
	leal	-1(%rdi), %edx
	andl	%edx, %edi
	jne	.L6
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	ret
	.cfi_endproc
.LFE1:
	.size	bit_max, .-bit_max
	.p2align 4
	.globl	bit_setmax
	.type	bit_setmax, @function
bit_setmax:
.LFB2:
	.cfi_startproc
	endbr64
	movq	bit_size(%rip), %r8
	movslq	%edi, %rdx
	cmpq	%r8, %rdx
	jge	.L9
	leaq	BIT(%rip), %rcx
	.p2align 4,,10
	.p2align 3
.L11:
	movq	(%rcx,%rdx,8), %rax
	cmpq	%rsi, %rax
	cmovl	%rsi, %rax
	movq	%rax, (%rcx,%rdx,8)
	movl	%edi, %eax
	negl	%eax
	andl	%edi, %eax
	addl	%eax, %edi
	movslq	%edi, %rdx
	cmpq	%r8, %rdx
	jl	.L11
.L9:
	ret
	.cfi_endproc
.LFE2:
	.size	bit_setmax, .-bit_setmax
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld"
.LC1:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	BIT(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	.LC0(%rip), %rbx
	movq	%rbx, %rdi
	subq	$32, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	call	scanf@PLT
	movq	8(%rsp), %r14
	xorl	%esi, %esi
	movq	%r12, %rdi
	leal	1(%r14), %ebp
	movslq	%ebp, %rbp
	leaq	0(,%rbp,8), %rdx
	call	memset@PLT
	movq	%rbp, bit_size(%rip)
	testq	%r14, %r14
	jle	.L14
	xorl	%r13d, %r13d
	leaq	16(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L18:
	movq	%rbx, %rdi
	movq	%rbp, %rsi
	xorl	%eax, %eax
	call	scanf@PLT
	movq	16(%rsp), %rdi
	movl	%edi, %eax
	testl	%edi, %edi
	jle	.L15
	movl	%edi, %edx
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L16:
	movslq	%edx, %rsi
	movq	(%r12,%rsi,8), %rsi
	cmpq	%rsi, %rcx
	cmovl	%rsi, %rcx
	leal	-1(%rdx), %esi
	andl	%esi, %edx
	jne	.L16
	addq	%rcx, %rdi
.L15:
	movq	bit_size(%rip), %rsi
	movslq	%eax, %rcx
	cmpq	%rsi, %rcx
	jge	.L19
	.p2align 4,,10
	.p2align 3
.L17:
	movq	(%r12,%rcx,8), %rdx
	cmpq	%rdi, %rdx
	cmovl	%rdi, %rdx
	movq	%rdx, (%r12,%rcx,8)
	movl	%eax, %edx
	negl	%edx
	andl	%eax, %edx
	addl	%edx, %eax
	movslq	%eax, %rcx
	cmpq	%rsi, %rcx
	jl	.L17
.L19:
	movq	8(%rsp), %r14
	addq	$1, %r13
	cmpq	%r13, %r14
	jg	.L18
.L14:
	leaq	1(%r14), %rax
	xorl	%edx, %edx
	imulq	%r14, %rax
	movq	%rax, %rsi
	shrq	$63, %rsi
	addq	%rax, %rsi
	movl	%r14d, %eax
	sarq	%rsi
	testl	%r14d, %r14d
	jle	.L20
	.p2align 4,,10
	.p2align 3
.L21:
	movslq	%eax, %rcx
	movq	(%r12,%rcx,8), %rcx
	cmpq	%rcx, %rdx
	cmovl	%rcx, %rdx
	leal	-1(%rax), %ecx
	andl	%ecx, %eax
	jne	.L21
.L20:
	leaq	.LC1(%rip), %rdi
	subq	%rdx, %rsi
	xorl	%eax, %eax
	call	printf@PLT
	xorl	%edi, %edi
	call	exit@PLT
	.cfi_endproc
.LFE3:
	.size	main, .-main
	.globl	bit_size
	.bss
	.align 8
	.type	bit_size, @object
	.size	bit_size, 8
bit_size:
	.zero	8
	.globl	BIT
	.align 32
	.type	BIT, @object
	.size	BIT, 800080
BIT:
	.zero	800080
	.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	bit_init
	.type	bit_init, @function
bit_init:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movslq	%edi, %rbx
	xorl	%esi, %esi
	leaq	BIT(%rip), %rdi
	leaq	0(,%rbx,8), %rdx
	call	memset@PLT
	movq	%rbx, bit_size(%rip)
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	bit_init, .-bit_init
	.p2align 4
	.globl	bit_max
	.type	bit_max, @function
bit_max:
.LFB1:
	.cfi_startproc
	endbr64
	xorl	%eax, %eax
	testl	%edi, %edi
	jle	.L7
	leaq	BIT(%rip), %rcx
	.p2align 4,,10
	.p2align 3
.L6:
	movslq	%edi, %rdx
	movq	(%rcx,%rdx,8), %rdx
	cmpq	%rdx, %rax
	cmovl	%rdx, %rax
	leal	-1(%rdi), %edx
	andl	%edx, %edi
	jne	.L6
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	ret
	.cfi_endproc
.LFE1:
	.size	bit_max, .-bit_max
	.p2align 4
	.globl	bit_setmax
	.type	bit_setmax, @function
bit_setmax:
.LFB2:
	.cfi_startproc
	endbr64
	movq	bit_size(%rip), %r8
	movslq	%edi, %rdx
	cmpq	%r8, %rdx
	jge	.L9
	leaq	BIT(%rip), %rcx
	.p2align 4,,10
	.p2align 3
.L11:
	movq	(%rcx,%rdx,8), %rax
	cmpq	%rsi, %rax
	cmovl	%rsi, %rax
	movq	%rax, (%rcx,%rdx,8)
	movl	%edi, %eax
	negl	%eax
	andl	%edi, %eax
	addl	%eax, %edi
	movslq	%edi, %rdx
	cmpq	%r8, %rdx
	jl	.L11
.L9:
	ret
	.cfi_endproc
.LFE2:
	.size	bit_setmax, .-bit_setmax
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld"
.LC1:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	BIT(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	.LC0(%rip), %rbx
	movq	%rbx, %rdi
	subq	$32, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	call	scanf@PLT
	movq	8(%rsp), %r14
	xorl	%esi, %esi
	movq	%r12, %rdi
	leal	1(%r14), %ebp
	movslq	%ebp, %rbp
	leaq	0(,%rbp,8), %rdx
	call	memset@PLT
	movq	%rbp, bit_size(%rip)
	testq	%r14, %r14
	jle	.L14
	xorl	%r13d, %r13d
	leaq	16(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L18:
	movq	%rbx, %rdi
	movq	%rbp, %rsi
	xorl	%eax, %eax
	call	scanf@PLT
	movq	16(%rsp), %rdi
	movl	%edi, %eax
	testl	%edi, %edi
	jle	.L15
	movl	%edi, %edx
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L16:
	movslq	%edx, %rsi
	movq	(%r12,%rsi,8), %rsi
	cmpq	%rsi, %rcx
	cmovl	%rsi, %rcx
	leal	-1(%rdx), %esi
	andl	%esi, %edx
	jne	.L16
	addq	%rcx, %rdi
.L15:
	movq	bit_size(%rip), %rsi
	movslq	%eax, %rcx
	cmpq	%rsi, %rcx
	jge	.L19
	.p2align 4,,10
	.p2align 3
.L17:
	movq	(%r12,%rcx,8), %rdx
	cmpq	%rdi, %rdx
	cmovl	%rdi, %rdx
	movq	%rdx, (%r12,%rcx,8)
	movl	%eax, %edx
	negl	%edx
	andl	%eax, %edx
	addl	%edx, %eax
	movslq	%eax, %rcx
	cmpq	%rsi, %rcx
	jl	.L17
.L19:
	movq	8(%rsp), %r14
	addq	$1, %r13
	cmpq	%r13, %r14
	jg	.L18
.L14:
	leaq	1(%r14), %rax
	xorl	%edx, %edx
	imulq	%r14, %rax
	movq	%rax, %rsi
	shrq	$63, %rsi
	addq	%rax, %rsi
	movl	%r14d, %eax
	sarq	%rsi
	testl	%r14d, %r14d
	jle	.L20
	.p2align 4,,10
	.p2align 3
.L21:
	movslq	%eax, %rcx
	movq	(%r12,%rcx,8), %rcx
	cmpq	%rcx, %rdx
	cmovl	%rcx, %rdx
	leal	-1(%rax), %ecx
	andl	%ecx, %eax
	jne	.L21
.L20:
	leaq	.LC1(%rip), %rdi
	subq	%rdx, %rsi
	xorl	%eax, %eax
	call	printf@PLT
	xorl	%edi, %edi
	call	exit@PLT
	.cfi_endproc
.LFE3:
	.size	main, .-main
	.globl	bit_size
	.bss
	.align 8
	.type	bit_size, @object
	.size	bit_size, 8
bit_size:
	.zero	8
	.globl	BIT
	.align 32
	.type	BIT, @object
	.size	BIT, 800080
BIT:
	.zero	800080
	.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:

#define max(a,b)((a)>(b)?(a):(b))
long long BIT[100010], bit_size; // long long は 64bit 整数．
void bit_init(int n){
	memset(BIT,0,n*(sizeof(long long)));
	bit_size = n;
}
long long bit_max(int n){ // [1,n] の最大値
	long long ans = 0;
	while(n > 0){
		ans = max(ans, BIT[n]);
		n &= n-1;
	}
	return ans;
}
void bit_setmax(int n, long long v){ // # [1,n] の最大値を v に更新する
	while (n < bit_size){
		BIT[n] = max(BIT[n], v);
		n += n & (-n);
	}
}
int main(){
	long long N,x,i=0;
	scanf("%lld",&N);
	bit_init(N+1);
	for(; i<N; ++i){
		scanf("%lld",&x);
		long long cost = bit_max(x);
		bit_setmax(x,cost+x);
	}
	printf("%lld\n",(1+N)*N/2 - bit_max(N));
exit(0);}
7
1 2 5 4 3 6 7
 4
2 4 2 2
 4
1 4 3 2
 7
1 3 2 4 5 6 7
 4
3 4 1 2
 8
7 2 1 3 8 5 4 6
 7
1 2 8 1 3 6 7
 5
2 5 3 1 4
 8
5 2 1 3 8 6 4 7
 7
2 1 5 4 3 6 7

7
 4
 5
 2
 3
 20
 9
 6
 18
 8

Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#define max(a,b)((a)>(b)?(a):(b))
long long BIT[100010], bit_size; // long long は 64bit 整数．
void bit_init(int n){
	memset(BIT,0,n*(sizeof(long long)));
	bit_size = n;
}
long long bit_max(int n){ // [1,n] の最大値
	long long ans = 0;
	while(n > 0){
		ans = max(ans, BIT[n]);
		n &= n-1;
	}
	return ans;
}
void bit_setmax(int n, long long v){ // # [1,n] の最大値を v に更新する
	while (n < bit_size){
		BIT[n] = max(BIT[n], v);
		n += n & (-n);
	}
}
int main(){
	long long N,x,i=0;
	scanf("%lld",&N);
	bit_init(N+1);
	for(; i<N; ++i){
		scanf("%lld",&x);
		long long cost = bit_max(x);
		bit_setmax(x,cost+x);
	}
	printf("%lld\n",(1+N)*N/2 - bit_max(N));
exit(0);}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	BIT
	.bss
	.align 32
	.type	BIT, @object
	.size	BIT, 800080
BIT:
	.zero	800080
	.globl	bit_size
	.align 8
	.type	bit_size, @object
	.size	bit_size, 8
bit_size:
	.zero	8
	.text
	.globl	bit_init
	.type	bit_init, @function
bit_init:
.LFB0:
	.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
	movl	%edi, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	salq	$3, %rax
	movq	%rax, %rdx
	movl	$0, %esi
	leaq	BIT(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	-4(%rbp), %eax
	cltq
	movq	%rax, bit_size(%rip)
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	bit_init, .-bit_init
	.globl	bit_max
	.type	bit_max, @function
bit_max:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movq	$0, -8(%rbp)
	jmp	.L3
.L4:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	BIT(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	-8(%rbp), %rdx
	cmpq	%rax, %rdx
	cmovge	%rdx, %rax
	movq	%rax, -8(%rbp)
	movl	-20(%rbp), %eax
	subl	$1, %eax
	andl	%eax, -20(%rbp)
.L3:
	cmpl	$0, -20(%rbp)
	jg	.L4
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	bit_max, .-bit_max
	.globl	bit_setmax
	.type	bit_setmax, @function
bit_setmax:
.LFB2:
	.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)
	movq	%rsi, -16(%rbp)
	jmp	.L7
.L8:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	BIT(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-16(%rbp), %rax
	cmpq	%rax, %rdx
	cmovge	%rdx, %rax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	BIT(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movl	-4(%rbp), %eax
	negl	%eax
	andl	-4(%rbp), %eax
	addl	%eax, -4(%rbp)
.L7:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	bit_size(%rip), %rax
	cmpq	%rax, %rdx
	jl	.L8
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	bit_setmax, .-bit_setmax
	.section	.rodata
.LC0:
	.string	"%lld"
.LC1:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movq	$0, -40(%rbp)
	leaq	-56(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movq	-56(%rbp), %rax
	addl	$1, %eax
	movl	%eax, %edi
	call	bit_init
	jmp	.L10
.L11:
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movq	-48(%rbp), %rax
	movl	%eax, %edi
	call	bit_max
	movq	%rax, -32(%rbp)
	movq	-48(%rbp), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	-48(%rbp), %rdx
	movq	%rax, %rsi
	movl	%edx, %edi
	call	bit_setmax
	addq	$1, -40(%rbp)
.L10:
	movq	-56(%rbp), %rax
	cmpq	%rax, -40(%rbp)
	jl	.L11
	movq	-56(%rbp), %rax
	leaq	1(%rax), %rdx
	movq	-56(%rbp), %rax
	imulq	%rdx, %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, %rbx
	movq	-56(%rbp), %rax
	movl	%eax, %edi
	call	bit_max
	movq	%rax, %rdx
	movq	%rbx, %rax
	subq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %edi
	call	exit@PLT
	.cfi_endproc
.LFE3:
	.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	BIT
	.bss
	.align 32
	.type	BIT, @object
	.size	BIT, 800080
BIT:
	.zero	800080
	.globl	bit_size
	.align 8
	.type	bit_size, @object
	.size	bit_size, 8
bit_size:
	.zero	8
	.text
	.globl	bit_init
	.type	bit_init, @function
bit_init:
.LFB0:
	.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
	movl	%edi, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	salq	$3, %rax
	movq	%rax, %rdx
	movl	$0, %esi
	leaq	BIT(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	-4(%rbp), %eax
	cltq
	movq	%rax, bit_size(%rip)
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	bit_init, .-bit_init
	.globl	bit_max
	.type	bit_max, @function
bit_max:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movq	$0, -8(%rbp)
	jmp	.L3
.L4:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	BIT(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	-8(%rbp), %rdx
	cmpq	%rax, %rdx
	cmovge	%rdx, %rax
	movq	%rax, -8(%rbp)
	movl	-20(%rbp), %eax
	subl	$1, %eax
	andl	%eax, -20(%rbp)
.L3:
	cmpl	$0, -20(%rbp)
	jg	.L4
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	bit_max, .-bit_max
	.globl	bit_setmax
	.type	bit_setmax, @function
bit_setmax:
.LFB2:
	.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)
	movq	%rsi, -16(%rbp)
	jmp	.L7
.L8:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	BIT(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-16(%rbp), %rax
	cmpq	%rax, %rdx
	cmovge	%rdx, %rax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	BIT(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movl	-4(%rbp), %eax
	negl	%eax
	andl	-4(%rbp), %eax
	addl	%eax, -4(%rbp)
.L7:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	bit_size(%rip), %rax
	cmpq	%rax, %rdx
	jl	.L8
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	bit_setmax, .-bit_setmax
	.section	.rodata
.LC0:
	.string	"%lld"
.LC1:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movq	$0, -40(%rbp)
	leaq	-56(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movq	-56(%rbp), %rax
	addl	$1, %eax
	movl	%eax, %edi
	call	bit_init
	jmp	.L10
.L11:
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movq	-48(%rbp), %rax
	movl	%eax, %edi
	call	bit_max
	movq	%rax, -32(%rbp)
	movq	-48(%rbp), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	-48(%rbp), %rdx
	movq	%rax, %rsi
	movl	%edx, %edi
	call	bit_setmax
	addq	$1, -40(%rbp)
.L10:
	movq	-56(%rbp), %rax
	cmpq	%rax, -40(%rbp)
	jl	.L11
	movq	-56(%rbp), %rax
	leaq	1(%rax), %rdx
	movq	-56(%rbp), %rax
	imulq	%rdx, %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, %rbx
	movq	-56(%rbp), %rax
	movl	%eax, %edi
	call	bit_max
	movq	%rax, %rdx
	movq	%rbx, %rax
	subq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %edi
	call	exit@PLT
	.cfi_endproc
.LFE3:
	.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:
