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>

#define MAX_COST (1<<21)

int **mat;
int *d;
int n;

void SSSP();
int Search(int*,int*);
int Test_Set(int*);

int main(void){
	int i,j;
	int in_u,in_k,in_v,in_wei;

	scanf("%d",&n);

	d=(int*)malloc(sizeof(int)*n);

	mat=(int**)malloc(sizeof(int*)*n);
	for(i=0;i<n;i++) mat[i]=malloc(sizeof(int)*n);

	for(i=0;i<n;i++){
		for(j=0;j<n;j++) mat[i][j]=MAX_COST+1;
	}

	for(i=0;i<n;i++){
		scanf("%d",&in_u);
		scanf("%d",&in_k);
		for(j=0;j<in_k;j++){
			scanf("%d",&in_v);
			scanf("%d",&in_wei);
			mat[in_u][in_v]=in_wei;
		}
	}

	SSSP();

	for(i=0;i<n;i++) printf("%d %d\n",i,d[i]);

	free(d);
	for(i=0;i<n;i++) free(mat[i]);
	free(mat);

	return 0;
}

void SSSP(){
	int s,u;
	int i;
	int S[n];

	for(i=0;i<n;i++){
		S[i]=0;
		d[i]=MAX_COST+1;
	}
	s=0;
	d[s]=0;

	while(Test_Set(S)==0){
		u=Search(d,S);
		S[u]=1;

		for(i=0;i<n;i++){
			if(S[i]==1) continue;
			if(d[u]+mat[u][i] < d[i]) d[i]=d[u]+mat[u][i];
		}
	}

}

int Search(int *d,int *S){
	int i;
	int min=MAX_COST+1;
	int u;

	for(i=0;i<n;i++){
		if(S[i]==1) continue;
		
		if(d[i]<min){
			min=d[i];
			u=i;
		}
	}

	return u;
}

int Test_Set(int *S){
	int i;

	for(i=0;i<n;i++){
		if(S[i]==0) return 0;
	}	
	return 1;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	mat
	.bss
	.align 8
	.type	mat, @object
	.size	mat, 8
mat:
	.zero	8
	.globl	d
	.align 8
	.type	d, @object
	.size	d, 8
d:
	.zero	8
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.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	$40, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%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
	movl	n(%rip), %eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, d(%rip)
	movl	n(%rip), %eax
	cltq
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, mat(%rip)
	movl	$0, -32(%rbp)
	jmp	.L2
.L3:
	movl	n(%rip), %eax
	cltq
	salq	$2, %rax
	movq	mat(%rip), %rcx
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	salq	$3, %rdx
	leaq	(%rcx,%rdx), %rbx
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, (%rbx)
	addl	$1, -32(%rbp)
.L2:
	movl	n(%rip), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L3
	movl	$0, -32(%rbp)
	jmp	.L4
.L7:
	movl	$0, -28(%rbp)
	jmp	.L5
.L6:
	movq	mat(%rip), %rdx
	movl	-32(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-28(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	$2097153, (%rax)
	addl	$1, -28(%rbp)
.L5:
	movl	n(%rip), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L6
	addl	$1, -32(%rbp)
.L4:
	movl	n(%rip), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L7
	movl	$0, -32(%rbp)
	jmp	.L8
.L11:
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-44(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -28(%rbp)
	jmp	.L9
.L10:
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	mat(%rip), %rdx
	movl	-48(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-40(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	movl	-36(%rbp), %eax
	movl	%eax, (%rdx)
	addl	$1, -28(%rbp)
.L9:
	movl	-44(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L10
	addl	$1, -32(%rbp)
.L8:
	movl	n(%rip), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L11
	movl	$0, %eax
	call	SSSP
	movl	$0, -32(%rbp)
	jmp	.L12
.L13:
	movq	d(%rip), %rdx
	movl	-32(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-32(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -32(%rbp)
.L12:
	movl	n(%rip), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L13
	movq	d(%rip), %rax
	movq	%rax, %rdi
	call	free@PLT
	movl	$0, -32(%rbp)
	jmp	.L14
.L15:
	movq	mat(%rip), %rdx
	movl	-32(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, %rdi
	call	free@PLT
	addl	$1, -32(%rbp)
.L14:
	movl	n(%rip), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L15
	movq	mat(%rip), %rax
	movq	%rax, %rdi
	call	free@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.globl	SSSP
	.type	SSSP, @function
SSSP:
.LFB7:
	.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	%rsp, %rax
	movq	%rax, %rbx
	movl	n(%rip), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -40(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r8
	movl	$0, %r9d
	movslq	%eax, %rdx
	movq	%rdx, %rsi
	movl	$0, %edi
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L19:
	cmpq	%rdx, %rsp
	je	.L20
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L19
.L20:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L21
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L21:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -32(%rbp)
	movl	$0, -52(%rbp)
	jmp	.L22
.L23:
	movq	-32(%rbp), %rax
	movl	-52(%rbp), %edx
	movslq	%edx, %rdx
	movl	$0, (%rax,%rdx,4)
	movq	d(%rip), %rdx
	movl	-52(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	$2097153, (%rax)
	addl	$1, -52(%rbp)
.L22:
	movl	n(%rip), %eax
	cmpl	%eax, -52(%rbp)
	jl	.L23
	movl	$0, -48(%rbp)
	movq	d(%rip), %rdx
	movl	-48(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	$0, (%rax)
	jmp	.L24
.L29:
	movq	d(%rip), %rax
	movq	-32(%rbp), %rdx
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	Search
	movl	%eax, -44(%rbp)
	movq	-32(%rbp), %rax
	movl	-44(%rbp), %edx
	movslq	%edx, %rdx
	movl	$1, (%rax,%rdx,4)
	movl	$0, -52(%rbp)
	jmp	.L25
.L28:
	movq	-32(%rbp), %rax
	movl	-52(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	$1, %eax
	je	.L31
	movq	d(%rip), %rdx
	movl	-44(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movq	mat(%rip), %rcx
	movl	-44(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rcx, %rax
	movq	(%rax), %rcx
	movl	-52(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	addl	%eax, %edx
	movq	d(%rip), %rcx
	movl	-52(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jge	.L27
	movq	d(%rip), %rdx
	movl	-44(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %ecx
	movq	mat(%rip), %rdx
	movl	-44(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-52(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movq	d(%rip), %rsi
	movl	-52(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rsi, %rax
	addl	%ecx, %edx
	movl	%edx, (%rax)
	jmp	.L27
.L31:
	nop
.L27:
	addl	$1, -52(%rbp)
.L25:
	movl	n(%rip), %eax
	cmpl	%eax, -52(%rbp)
	jl	.L28
.L24:
	movq	-32(%rbp), %rax
	movq	%rax, %rdi
	call	Test_Set
	testl	%eax, %eax
	je	.L29
	movq	%rbx, %rsp
	nop
	movq	-24(%rbp), %rax
	subq	%fs:40, %rax
	je	.L30
	call	__stack_chk_fail@PLT
.L30:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	SSSP, .-SSSP
	.globl	Search
	.type	Search, @function
Search:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movl	$2097153, -8(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L33
.L36:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	$1, %eax
	je	.L38
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -8(%rbp)
	jle	.L35
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L35
.L38:
	nop
.L35:
	addl	$1, -12(%rbp)
.L33:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L36
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	Search, .-Search
	.globl	Test_Set
	.type	Test_Set, @function
Test_Set:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L40
.L43:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jne	.L41
	movl	$0, %eax
	jmp	.L42
.L41:
	addl	$1, -4(%rbp)
.L40:
	movl	n(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L43
	movl	$1, %eax
.L42:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	Test_Set, .-Test_Set
	.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	SSSP
	.type	SSSP, @function
SSSP:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset 12, -24
	.cfi_offset 3, -32
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movslq	n(%rip), %rax
	movq	%rsp, %rsi
	movq	%rax, %rdx
	leaq	15(,%rax,4), %rax
	movq	%rax, %rcx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rcx
	cmpq	%rsi, %rsp
	je	.L3
.L28:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L28
.L3:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L29
.L4:
	movq	d(%rip), %rsi
	movq	%rsp, %rcx
	xorl	%eax, %eax
	testl	%edx, %edx
	jle	.L7
	.p2align 4,,10
	.p2align 3
.L5:
	movl	$2097153, (%rsi,%rax,4)
	movl	$0, (%rcx,%rax,4)
	addq	$1, %rax
	cmpl	%eax, n(%rip)
	jg	.L5
.L7:
	movl	$0, (%rsi)
	movl	n(%rip), %edi
	leaq	4(%rcx), %r10
	movq	mat(%rip), %r11
	testl	%edi, %edi
	jle	.L1
	.p2align 4,,10
	.p2align 3
.L31:
	leal	-1(%rdi), %edx
	movq	%rcx, %rax
	leaq	(%r10,%rdx,4), %rdx
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L30:
	addq	$4, %rax
	cmpq	%rax, %rdx
	je	.L1
.L14:
	movl	(%rax), %r8d
	testl	%r8d, %r8d
	jne	.L30
	movl	%edi, %ebx
	xorl	%eax, %eax
	movl	$2097153, %r8d
	.p2align 4,,10
	.p2align 3
.L9:
	cmpl	$1, (%rcx,%rax,4)
	je	.L8
	movl	(%rsi,%rax,4), %edx
	cmpl	%r8d, %edx
	jge	.L8
	movl	%eax, %r9d
	movl	%edx, %r8d
.L8:
	addq	$1, %rax
	cmpq	%rbx, %rax
	jne	.L9
	movslq	%r9d, %rax
	movl	$1, (%rcx,%rax,4)
	leaq	(%rsi,%rax,4), %r12
	leaq	(%r11,%rax,8), %rbx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L11:
	cmpl	$1, (%rcx,%rax,4)
	je	.L10
	movq	(%rbx), %r8
	movl	(%r12), %edx
	addl	(%r8,%rax,4), %edx
	cmpl	(%rsi,%rax,4), %edx
	jge	.L10
	movl	%edx, (%rsi,%rax,4)
	movl	n(%rip), %edi
.L10:
	addq	$1, %rax
	cmpl	%eax, %edi
	jg	.L11
	testl	%edi, %edi
	jg	.L31
	.p2align 4,,10
	.p2align 3
.L1:
	movq	-24(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L32
	leaq	-16(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L29:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rcx)
	jmp	.L4
.L32:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.size	SSSP, .-SSSP
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	n(%rip), %rsi
	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
	leaq	.LC0(%rip), %rbx
	movq	%rbx, %rdi
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	n(%rip), %rbp
	leaq	0(,%rbp,4), %r13
	movq	%r13, %rdi
	call	malloc@PLT
	leaq	0(,%rbp,8), %rdi
	movq	%rax, d(%rip)
	call	malloc@PLT
	movq	%rax, mat(%rip)
	testl	%ebp, %ebp
	jle	.L41
	movq	%rbp, %r14
	movq	%rax, %r12
	movq	%rax, %rbp
	movl	%r14d, %r14d
	leaq	(%rax,%r14,8), %r14
	.p2align 4,,10
	.p2align 3
.L37:
	movq	%r13, %rdi
	addq	$8, %rbp
	call	malloc@PLT
	movq	%rax, -8(%rbp)
	cmpq	%r14, %rbp
	jne	.L37
	movl	$1, %esi
	.p2align 4,,10
	.p2align 3
.L38:
	movq	-8(%r12,%rsi,8), %rcx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L39:
	movl	$2097153, (%rcx,%rax,4)
	movl	n(%rip), %edx
	addq	$1, %rax
	cmpl	%eax, %edx
	jg	.L39
	cmpl	%esi, %edx
	jle	.L66
	addq	$1, %rsi
	jmp	.L38
	.p2align 4,,10
	.p2align 3
.L66:
	testl	%edx, %edx
	jle	.L41
	leaq	28(%rsp), %rax
	xorl	%r13d, %r13d
	leaq	24(%rsp), %r15
	movq	%rax, 8(%rsp)
	leaq	32(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L43:
	movq	%r15, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	xorl	%r14d, %r14d
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	leaq	36(%rsp), %rbp
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %edx
	testl	%edx, %edx
	jle	.L44
	.p2align 4,,10
	.p2align 3
.L42:
	movq	%r12, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	24(%rsp), %rsi
	movslq	32(%rsp), %rcx
	movq	mat(%rip), %rax
	movq	(%rax,%rsi,8), %rax
	movl	36(%rsp), %esi
	movl	%esi, (%rax,%rcx,4)
	cmpl	%r14d, 28(%rsp)
	jg	.L42
.L44:
	addl	$1, %r13d
	cmpl	%r13d, n(%rip)
	jg	.L43
.L41:
	xorl	%eax, %eax
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %rbp
	call	SSSP
	movl	n(%rip), %ecx
	testl	%ecx, %ecx
	jle	.L36
	.p2align 4,,10
	.p2align 3
.L35:
	movq	d(%rip), %rax
	movl	%ebx, %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	movl	(%rax,%rbx,4), %ecx
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, n(%rip)
	jg	.L35
.L36:
	movq	d(%rip), %rdi
	xorl	%ebx, %ebx
	call	free@PLT
	movl	n(%rip), %eax
	testl	%eax, %eax
	jle	.L46
	.p2align 4,,10
	.p2align 3
.L45:
	movq	mat(%rip), %rax
	movq	(%rax,%rbx,8), %rdi
	addq	$1, %rbx
	call	free@PLT
	cmpl	%ebx, n(%rip)
	jg	.L45
.L46:
	movq	mat(%rip), %rdi
	call	free@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L67
	addq	$56, %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
.L67:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.text
	.p2align 4
	.globl	Search
	.type	Search, @function
Search:
.LFB41:
	.cfi_startproc
	endbr64
	movslq	n(%rip), %rcx
	xorl	%r9d, %r9d
	testl	%ecx, %ecx
	jle	.L68
	xorl	%eax, %eax
	movl	$2097153, %r8d
	.p2align 4,,10
	.p2align 3
.L71:
	cmpl	$1, (%rsi,%rax,4)
	je	.L70
	movl	(%rdi,%rax,4), %edx
	cmpl	%r8d, %edx
	jge	.L70
	movl	%eax, %r9d
	movl	%edx, %r8d
.L70:
	addq	$1, %rax
	cmpq	%rax, %rcx
	jne	.L71
.L68:
	movl	%r9d, %eax
	ret
	.cfi_endproc
.LFE41:
	.size	Search, .-Search
	.p2align 4
	.globl	Test_Set
	.type	Test_Set, @function
Test_Set:
.LFB42:
	.cfi_startproc
	endbr64
	movl	n(%rip), %eax
	testl	%eax, %eax
	jle	.L77
	subl	$1, %eax
	leaq	4(%rdi,%rax,4), %rdx
	jmp	.L76
	.p2align 4,,10
	.p2align 3
.L82:
	addq	$4, %rdi
	cmpq	%rdx, %rdi
	je	.L77
.L76:
	movl	(%rdi), %eax
	testl	%eax, %eax
	jne	.L82
	ret
	.p2align 4,,10
	.p2align 3
.L77:
	movl	$1, %eax
	ret
	.cfi_endproc
.LFE42:
	.size	Test_Set, .-Test_Set
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	d
	.align 8
	.type	d, @object
	.size	d, 8
d:
	.zero	8
	.globl	mat
	.align 8
	.type	mat, @object
	.size	mat, 8
mat:
	.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	SSSP
	.type	SSSP, @function
SSSP:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset 12, -24
	.cfi_offset 3, -32
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movslq	n(%rip), %rax
	movq	%rsp, %rsi
	movq	%rax, %rdx
	leaq	15(,%rax,4), %rax
	movq	%rax, %rcx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rcx
	cmpq	%rsi, %rsp
	je	.L3
.L28:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L28
.L3:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L29
.L4:
	movq	d(%rip), %rsi
	movq	%rsp, %rcx
	xorl	%eax, %eax
	testl	%edx, %edx
	jle	.L7
	.p2align 4,,10
	.p2align 3
.L5:
	movl	$2097153, (%rsi,%rax,4)
	movl	$0, (%rcx,%rax,4)
	addq	$1, %rax
	cmpl	%eax, n(%rip)
	jg	.L5
.L7:
	movl	$0, (%rsi)
	movl	n(%rip), %edi
	leaq	4(%rcx), %r10
	movq	mat(%rip), %r11
	testl	%edi, %edi
	jle	.L1
	.p2align 4,,10
	.p2align 3
.L31:
	leal	-1(%rdi), %edx
	movq	%rcx, %rax
	leaq	(%r10,%rdx,4), %rdx
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L30:
	addq	$4, %rax
	cmpq	%rax, %rdx
	je	.L1
.L14:
	movl	(%rax), %r8d
	testl	%r8d, %r8d
	jne	.L30
	movl	%edi, %ebx
	xorl	%eax, %eax
	movl	$2097153, %r8d
	.p2align 4,,10
	.p2align 3
.L9:
	cmpl	$1, (%rcx,%rax,4)
	je	.L8
	movl	(%rsi,%rax,4), %edx
	cmpl	%r8d, %edx
	jge	.L8
	movl	%eax, %r9d
	movl	%edx, %r8d
.L8:
	addq	$1, %rax
	cmpq	%rbx, %rax
	jne	.L9
	movslq	%r9d, %rax
	movl	$1, (%rcx,%rax,4)
	leaq	(%rsi,%rax,4), %r12
	leaq	(%r11,%rax,8), %rbx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L11:
	cmpl	$1, (%rcx,%rax,4)
	je	.L10
	movq	(%rbx), %r8
	movl	(%r12), %edx
	addl	(%r8,%rax,4), %edx
	cmpl	(%rsi,%rax,4), %edx
	jge	.L10
	movl	%edx, (%rsi,%rax,4)
	movl	n(%rip), %edi
.L10:
	addq	$1, %rax
	cmpl	%eax, %edi
	jg	.L11
	testl	%edi, %edi
	jg	.L31
	.p2align 4,,10
	.p2align 3
.L1:
	movq	-24(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L32
	leaq	-16(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L29:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rcx)
	jmp	.L4
.L32:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.size	SSSP, .-SSSP
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	n(%rip), %rsi
	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
	leaq	.LC0(%rip), %rbx
	movq	%rbx, %rdi
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	n(%rip), %rbp
	leaq	0(,%rbp,4), %r13
	movq	%r13, %rdi
	call	malloc@PLT
	leaq	0(,%rbp,8), %rdi
	movq	%rax, d(%rip)
	call	malloc@PLT
	movq	%rax, mat(%rip)
	testl	%ebp, %ebp
	jle	.L41
	movq	%rbp, %r14
	movq	%rax, %r12
	movq	%rax, %rbp
	movl	%r14d, %r14d
	leaq	(%rax,%r14,8), %r14
	.p2align 4,,10
	.p2align 3
.L37:
	movq	%r13, %rdi
	addq	$8, %rbp
	call	malloc@PLT
	movq	%rax, -8(%rbp)
	cmpq	%r14, %rbp
	jne	.L37
	movl	$1, %esi
	.p2align 4,,10
	.p2align 3
.L38:
	movq	-8(%r12,%rsi,8), %rcx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L39:
	movl	$2097153, (%rcx,%rax,4)
	movl	n(%rip), %edx
	addq	$1, %rax
	cmpl	%eax, %edx
	jg	.L39
	cmpl	%esi, %edx
	jle	.L66
	addq	$1, %rsi
	jmp	.L38
	.p2align 4,,10
	.p2align 3
.L66:
	testl	%edx, %edx
	jle	.L41
	leaq	28(%rsp), %rax
	xorl	%r13d, %r13d
	leaq	24(%rsp), %r15
	movq	%rax, 8(%rsp)
	leaq	32(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L43:
	movq	%r15, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	xorl	%r14d, %r14d
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	leaq	36(%rsp), %rbp
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %edx
	testl	%edx, %edx
	jle	.L44
	.p2align 4,,10
	.p2align 3
.L42:
	movq	%r12, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	24(%rsp), %rsi
	movslq	32(%rsp), %rcx
	movq	mat(%rip), %rax
	movq	(%rax,%rsi,8), %rax
	movl	36(%rsp), %esi
	movl	%esi, (%rax,%rcx,4)
	cmpl	%r14d, 28(%rsp)
	jg	.L42
.L44:
	addl	$1, %r13d
	cmpl	%r13d, n(%rip)
	jg	.L43
.L41:
	xorl	%eax, %eax
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %rbp
	call	SSSP
	movl	n(%rip), %ecx
	testl	%ecx, %ecx
	jle	.L36
	.p2align 4,,10
	.p2align 3
.L35:
	movq	d(%rip), %rax
	movl	%ebx, %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	movl	(%rax,%rbx,4), %ecx
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, n(%rip)
	jg	.L35
.L36:
	movq	d(%rip), %rdi
	xorl	%ebx, %ebx
	call	free@PLT
	movl	n(%rip), %eax
	testl	%eax, %eax
	jle	.L46
	.p2align 4,,10
	.p2align 3
.L45:
	movq	mat(%rip), %rax
	movq	(%rax,%rbx,8), %rdi
	addq	$1, %rbx
	call	free@PLT
	cmpl	%ebx, n(%rip)
	jg	.L45
.L46:
	movq	mat(%rip), %rdi
	call	free@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L67
	addq	$56, %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
.L67:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.text
	.p2align 4
	.globl	Search
	.type	Search, @function
Search:
.LFB41:
	.cfi_startproc
	endbr64
	movslq	n(%rip), %rcx
	xorl	%r9d, %r9d
	testl	%ecx, %ecx
	jle	.L68
	xorl	%eax, %eax
	movl	$2097153, %r8d
	.p2align 4,,10
	.p2align 3
.L71:
	cmpl	$1, (%rsi,%rax,4)
	je	.L70
	movl	(%rdi,%rax,4), %edx
	cmpl	%r8d, %edx
	jge	.L70
	movl	%eax, %r9d
	movl	%edx, %r8d
.L70:
	addq	$1, %rax
	cmpq	%rax, %rcx
	jne	.L71
.L68:
	movl	%r9d, %eax
	ret
	.cfi_endproc
.LFE41:
	.size	Search, .-Search
	.p2align 4
	.globl	Test_Set
	.type	Test_Set, @function
Test_Set:
.LFB42:
	.cfi_startproc
	endbr64
	movl	n(%rip), %eax
	testl	%eax, %eax
	jle	.L77
	subl	$1, %eax
	leaq	4(%rdi,%rax,4), %rdx
	jmp	.L76
	.p2align 4,,10
	.p2align 3
.L82:
	addq	$4, %rdi
	cmpq	%rdx, %rdi
	je	.L77
.L76:
	movl	(%rdi), %eax
	testl	%eax, %eax
	jne	.L82
	ret
	.p2align 4,,10
	.p2align 3
.L77:
	movl	$1, %eax
	ret
	.cfi_endproc
.LFE42:
	.size	Test_Set, .-Test_Set
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	d
	.align 8
	.type	d, @object
	.size	d, 8
d:
	.zero	8
	.globl	mat
	.align 8
	.type	mat, @object
	.size	mat, 8
mat:
	.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>

#define MAX_COST (1<<21)

int **mat;
int *d;
int n;

void SSSP();
int Search(int*,int*);
int Test_Set(int*);

int main(void){
	int i,j;
	int in_u,in_k,in_v,in_wei;

	scanf("%d",&n);

	d=(int*)malloc(sizeof(int)*n);

	mat=(int**)malloc(sizeof(int*)*n);
	for(i=0;i<n;i++) mat[i]=malloc(sizeof(int)*n);

	for(i=0;i<n;i++){
		for(j=0;j<n;j++) mat[i][j]=MAX_COST+1;
	}

	for(i=0;i<n;i++){
		scanf("%d",&in_u);
		scanf("%d",&in_k);
		for(j=0;j<in_k;j++){
			scanf("%d",&in_v);
			scanf("%d",&in_wei);
			mat[in_u][in_v]=in_wei;
		}
	}

	SSSP();

	for(i=0;i<n;i++) printf("%d %d\n",i,d[i]);

	free(d);
	for(i=0;i<n;i++) free(mat[i]);
	free(mat);

	return 0;
}

void SSSP(){
	int s,u;
	int i;
	int S[n];

	for(i=0;i<n;i++){
		S[i]=0;
		d[i]=MAX_COST+1;
	}
	s=0;
	d[s]=0;

	while(Test_Set(S)==0){
		u=Search(d,S);
		S[u]=1;

		for(i=0;i<n;i++){
			if(S[i]==1) continue;
			if(d[u]+mat[u][i] < d[i]) d[i]=d[u]+mat[u][i];
		}
	}

}

int Search(int *d,int *S){
	int i;
	int min=MAX_COST+1;
	int u;

	for(i=0;i<n;i++){
		if(S[i]==1) continue;
		
		if(d[i]<min){
			min=d[i];
			u=i;
		}
	}

	return u;
}

int Test_Set(int *S){
	int i;

	for(i=0;i<n;i++){
		if(S[i]==0) return 0;
	}	
	return 1;
}
5
0 3 2 3 3 1 1 2
1 2 0 2 3 4
2 3 0 3 3 1 4 1
3 4 2 1 0 1 1 4 4 3
4 2 2 1 3 3

0 0
1 2
2 2
3 1
4 3

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

```c
#include<stdio.h>
#include<stdlib.h>

#define MAX_COST (1<<21)

int **mat;
int *d;
int n;

void SSSP();
int Search(int*,int*);
int Test_Set(int*);

int main(void){
	int i,j;
	int in_u,in_k,in_v,in_wei;

	scanf("%d",&n);

	d=(int*)malloc(sizeof(int)*n);

	mat=(int**)malloc(sizeof(int*)*n);
	for(i=0;i<n;i++) mat[i]=malloc(sizeof(int)*n);

	for(i=0;i<n;i++){
		for(j=0;j<n;j++) mat[i][j]=MAX_COST+1;
	}

	for(i=0;i<n;i++){
		scanf("%d",&in_u);
		scanf("%d",&in_k);
		for(j=0;j<in_k;j++){
			scanf("%d",&in_v);
			scanf("%d",&in_wei);
			mat[in_u][in_v]=in_wei;
		}
	}

	SSSP();

	for(i=0;i<n;i++) printf("%d %d\n",i,d[i]);

	free(d);
	for(i=0;i<n;i++) free(mat[i]);
	free(mat);

	return 0;
}

void SSSP(){
	int s,u;
	int i;
	int S[n];

	for(i=0;i<n;i++){
		S[i]=0;
		d[i]=MAX_COST+1;
	}
	s=0;
	d[s]=0;

	while(Test_Set(S)==0){
		u=Search(d,S);
		S[u]=1;

		for(i=0;i<n;i++){
			if(S[i]==1) continue;
			if(d[u]+mat[u][i] < d[i]) d[i]=d[u]+mat[u][i];
		}
	}

}

int Search(int *d,int *S){
	int i;
	int min=MAX_COST+1;
	int u;

	for(i=0;i<n;i++){
		if(S[i]==1) continue;
		
		if(d[i]<min){
			min=d[i];
			u=i;
		}
	}

	return u;
}

int Test_Set(int *S){
	int i;

	for(i=0;i<n;i++){
		if(S[i]==0) return 0;
	}	
	return 1;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	mat
	.bss
	.align 8
	.type	mat, @object
	.size	mat, 8
mat:
	.zero	8
	.globl	d
	.align 8
	.type	d, @object
	.size	d, 8
d:
	.zero	8
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.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	$40, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%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
	movl	n(%rip), %eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, d(%rip)
	movl	n(%rip), %eax
	cltq
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, mat(%rip)
	movl	$0, -32(%rbp)
	jmp	.L2
.L3:
	movl	n(%rip), %eax
	cltq
	salq	$2, %rax
	movq	mat(%rip), %rcx
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	salq	$3, %rdx
	leaq	(%rcx,%rdx), %rbx
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, (%rbx)
	addl	$1, -32(%rbp)
.L2:
	movl	n(%rip), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L3
	movl	$0, -32(%rbp)
	jmp	.L4
.L7:
	movl	$0, -28(%rbp)
	jmp	.L5
.L6:
	movq	mat(%rip), %rdx
	movl	-32(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-28(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	$2097153, (%rax)
	addl	$1, -28(%rbp)
.L5:
	movl	n(%rip), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L6
	addl	$1, -32(%rbp)
.L4:
	movl	n(%rip), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L7
	movl	$0, -32(%rbp)
	jmp	.L8
.L11:
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-44(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -28(%rbp)
	jmp	.L9
.L10:
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	mat(%rip), %rdx
	movl	-48(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-40(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	movl	-36(%rbp), %eax
	movl	%eax, (%rdx)
	addl	$1, -28(%rbp)
.L9:
	movl	-44(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L10
	addl	$1, -32(%rbp)
.L8:
	movl	n(%rip), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L11
	movl	$0, %eax
	call	SSSP
	movl	$0, -32(%rbp)
	jmp	.L12
.L13:
	movq	d(%rip), %rdx
	movl	-32(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-32(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -32(%rbp)
.L12:
	movl	n(%rip), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L13
	movq	d(%rip), %rax
	movq	%rax, %rdi
	call	free@PLT
	movl	$0, -32(%rbp)
	jmp	.L14
.L15:
	movq	mat(%rip), %rdx
	movl	-32(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, %rdi
	call	free@PLT
	addl	$1, -32(%rbp)
.L14:
	movl	n(%rip), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L15
	movq	mat(%rip), %rax
	movq	%rax, %rdi
	call	free@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.globl	SSSP
	.type	SSSP, @function
SSSP:
.LFB7:
	.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	%rsp, %rax
	movq	%rax, %rbx
	movl	n(%rip), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -40(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r8
	movl	$0, %r9d
	movslq	%eax, %rdx
	movq	%rdx, %rsi
	movl	$0, %edi
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L19:
	cmpq	%rdx, %rsp
	je	.L20
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L19
.L20:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L21
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L21:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -32(%rbp)
	movl	$0, -52(%rbp)
	jmp	.L22
.L23:
	movq	-32(%rbp), %rax
	movl	-52(%rbp), %edx
	movslq	%edx, %rdx
	movl	$0, (%rax,%rdx,4)
	movq	d(%rip), %rdx
	movl	-52(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	$2097153, (%rax)
	addl	$1, -52(%rbp)
.L22:
	movl	n(%rip), %eax
	cmpl	%eax, -52(%rbp)
	jl	.L23
	movl	$0, -48(%rbp)
	movq	d(%rip), %rdx
	movl	-48(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	$0, (%rax)
	jmp	.L24
.L29:
	movq	d(%rip), %rax
	movq	-32(%rbp), %rdx
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	Search
	movl	%eax, -44(%rbp)
	movq	-32(%rbp), %rax
	movl	-44(%rbp), %edx
	movslq	%edx, %rdx
	movl	$1, (%rax,%rdx,4)
	movl	$0, -52(%rbp)
	jmp	.L25
.L28:
	movq	-32(%rbp), %rax
	movl	-52(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	$1, %eax
	je	.L31
	movq	d(%rip), %rdx
	movl	-44(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movq	mat(%rip), %rcx
	movl	-44(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rcx, %rax
	movq	(%rax), %rcx
	movl	-52(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	addl	%eax, %edx
	movq	d(%rip), %rcx
	movl	-52(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jge	.L27
	movq	d(%rip), %rdx
	movl	-44(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %ecx
	movq	mat(%rip), %rdx
	movl	-44(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-52(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movq	d(%rip), %rsi
	movl	-52(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rsi, %rax
	addl	%ecx, %edx
	movl	%edx, (%rax)
	jmp	.L27
.L31:
	nop
.L27:
	addl	$1, -52(%rbp)
.L25:
	movl	n(%rip), %eax
	cmpl	%eax, -52(%rbp)
	jl	.L28
.L24:
	movq	-32(%rbp), %rax
	movq	%rax, %rdi
	call	Test_Set
	testl	%eax, %eax
	je	.L29
	movq	%rbx, %rsp
	nop
	movq	-24(%rbp), %rax
	subq	%fs:40, %rax
	je	.L30
	call	__stack_chk_fail@PLT
.L30:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	SSSP, .-SSSP
	.globl	Search
	.type	Search, @function
Search:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movl	$2097153, -8(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L33
.L36:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	$1, %eax
	je	.L38
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -8(%rbp)
	jle	.L35
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L35
.L38:
	nop
.L35:
	addl	$1, -12(%rbp)
.L33:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L36
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	Search, .-Search
	.globl	Test_Set
	.type	Test_Set, @function
Test_Set:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L40
.L43:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jne	.L41
	movl	$0, %eax
	jmp	.L42
.L41:
	addl	$1, -4(%rbp)
.L40:
	movl	n(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L43
	movl	$1, %eax
.L42:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	Test_Set, .-Test_Set
	.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	mat
	.bss
	.align 8
	.type	mat, @object
	.size	mat, 8
mat:
	.zero	8
	.globl	d
	.align 8
	.type	d, @object
	.size	d, 8
d:
	.zero	8
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.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	$40, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%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
	movl	n(%rip), %eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, d(%rip)
	movl	n(%rip), %eax
	cltq
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, mat(%rip)
	movl	$0, -32(%rbp)
	jmp	.L2
.L3:
	movl	n(%rip), %eax
	cltq
	salq	$2, %rax
	movq	mat(%rip), %rcx
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	salq	$3, %rdx
	leaq	(%rcx,%rdx), %rbx
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, (%rbx)
	addl	$1, -32(%rbp)
.L2:
	movl	n(%rip), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L3
	movl	$0, -32(%rbp)
	jmp	.L4
.L7:
	movl	$0, -28(%rbp)
	jmp	.L5
.L6:
	movq	mat(%rip), %rdx
	movl	-32(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-28(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	$2097153, (%rax)
	addl	$1, -28(%rbp)
.L5:
	movl	n(%rip), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L6
	addl	$1, -32(%rbp)
.L4:
	movl	n(%rip), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L7
	movl	$0, -32(%rbp)
	jmp	.L8
.L11:
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-44(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -28(%rbp)
	jmp	.L9
.L10:
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	mat(%rip), %rdx
	movl	-48(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-40(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	movl	-36(%rbp), %eax
	movl	%eax, (%rdx)
	addl	$1, -28(%rbp)
.L9:
	movl	-44(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L10
	addl	$1, -32(%rbp)
.L8:
	movl	n(%rip), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L11
	movl	$0, %eax
	call	SSSP
	movl	$0, -32(%rbp)
	jmp	.L12
.L13:
	movq	d(%rip), %rdx
	movl	-32(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-32(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -32(%rbp)
.L12:
	movl	n(%rip), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L13
	movq	d(%rip), %rax
	movq	%rax, %rdi
	call	free@PLT
	movl	$0, -32(%rbp)
	jmp	.L14
.L15:
	movq	mat(%rip), %rdx
	movl	-32(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, %rdi
	call	free@PLT
	addl	$1, -32(%rbp)
.L14:
	movl	n(%rip), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L15
	movq	mat(%rip), %rax
	movq	%rax, %rdi
	call	free@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.globl	SSSP
	.type	SSSP, @function
SSSP:
.LFB7:
	.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	%rsp, %rax
	movq	%rax, %rbx
	movl	n(%rip), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -40(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r8
	movl	$0, %r9d
	movslq	%eax, %rdx
	movq	%rdx, %rsi
	movl	$0, %edi
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L19:
	cmpq	%rdx, %rsp
	je	.L20
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L19
.L20:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L21
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L21:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -32(%rbp)
	movl	$0, -52(%rbp)
	jmp	.L22
.L23:
	movq	-32(%rbp), %rax
	movl	-52(%rbp), %edx
	movslq	%edx, %rdx
	movl	$0, (%rax,%rdx,4)
	movq	d(%rip), %rdx
	movl	-52(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	$2097153, (%rax)
	addl	$1, -52(%rbp)
.L22:
	movl	n(%rip), %eax
	cmpl	%eax, -52(%rbp)
	jl	.L23
	movl	$0, -48(%rbp)
	movq	d(%rip), %rdx
	movl	-48(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	$0, (%rax)
	jmp	.L24
.L29:
	movq	d(%rip), %rax
	movq	-32(%rbp), %rdx
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	Search
	movl	%eax, -44(%rbp)
	movq	-32(%rbp), %rax
	movl	-44(%rbp), %edx
	movslq	%edx, %rdx
	movl	$1, (%rax,%rdx,4)
	movl	$0, -52(%rbp)
	jmp	.L25
.L28:
	movq	-32(%rbp), %rax
	movl	-52(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	$1, %eax
	je	.L31
	movq	d(%rip), %rdx
	movl	-44(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movq	mat(%rip), %rcx
	movl	-44(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rcx, %rax
	movq	(%rax), %rcx
	movl	-52(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	addl	%eax, %edx
	movq	d(%rip), %rcx
	movl	-52(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jge	.L27
	movq	d(%rip), %rdx
	movl	-44(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %ecx
	movq	mat(%rip), %rdx
	movl	-44(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-52(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movq	d(%rip), %rsi
	movl	-52(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rsi, %rax
	addl	%ecx, %edx
	movl	%edx, (%rax)
	jmp	.L27
.L31:
	nop
.L27:
	addl	$1, -52(%rbp)
.L25:
	movl	n(%rip), %eax
	cmpl	%eax, -52(%rbp)
	jl	.L28
.L24:
	movq	-32(%rbp), %rax
	movq	%rax, %rdi
	call	Test_Set
	testl	%eax, %eax
	je	.L29
	movq	%rbx, %rsp
	nop
	movq	-24(%rbp), %rax
	subq	%fs:40, %rax
	je	.L30
	call	__stack_chk_fail@PLT
.L30:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	SSSP, .-SSSP
	.globl	Search
	.type	Search, @function
Search:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movl	$2097153, -8(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L33
.L36:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	$1, %eax
	je	.L38
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -8(%rbp)
	jle	.L35
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L35
.L38:
	nop
.L35:
	addl	$1, -12(%rbp)
.L33:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L36
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	Search, .-Search
	.globl	Test_Set
	.type	Test_Set, @function
Test_Set:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L40
.L43:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jne	.L41
	movl	$0, %eax
	jmp	.L42
.L41:
	addl	$1, -4(%rbp)
.L40:
	movl	n(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L43
	movl	$1, %eax
.L42:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	Test_Set, .-Test_Set
	.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:
