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>
#define N 8

int Q[N][N];

int queen(int *r,int *c,int k){
  int i;

  for(i=0;i<k;i++){
    if(r[i]==r[k])
      return 0;
    if(c[i]==c[k])
      return 0;
    if(r[i]+c[i]==r[k]+c[k])
      return 0;
    if(r[i]-c[i]==r[k]-c[k])
      return 0;
  }
  return 1;
}

void print(){
  int i,j;

  for(i=0;i<N;i++){
    for(j=0;j<N;j++){
      if(Q[j][i]==1)
        printf("Q");
      else
        printf(".");
    }
    printf("\n");
  }
}

int main(){

  int i,j;
  int n,k;
  int r[N],c[N];

  for(i=0;i<N;i++){
    r[i]=0;
    c[i]=0;
    for(j=0;j<N;j++){
      Q[j][i]=0;
    }
  }

 scanf("%d",&n);
  k=n;

  for(i=0;i<n;i++)
    scanf("%d%d",&r[i],&c[i]);

  while(k<N){
    if(c[k]==N-1){
      r[k]++;
      c[k]=0;
    }
    else
      c[k]++;

    if(r[k]>N-1){
      r[k]=0;
      c[k]=0;
      k--;
    }
    else if(queen(r,c,k))
      k++;
  }

  for(i=0;i<N;i++)
    Q[c[i]][r[i]]=1;

  print();

  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	Q
	.bss
	.align 32
	.type	Q, @object
	.size	Q, 256
Q:
	.zero	256
	.text
	.globl	queen
	.type	queen, @function
queen:
.LFB0:
	.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	%edx, -36(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L2
.L8:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jne	.L3
	movl	$0, %eax
	jmp	.L4
.L3:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-32(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jne	.L5
	movl	$0, %eax
	jmp	.L4
.L5:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-32(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	addl	%eax, %edx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %ecx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rsi
	movq	-32(%rbp), %rax
	addq	%rsi, %rax
	movl	(%rax), %eax
	addl	%ecx, %eax
	cmpl	%eax, %edx
	jne	.L6
	movl	$0, %eax
	jmp	.L4
.L6:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-32(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rdx), %edx
	subl	%edx, %eax
	movl	%eax, %ecx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-36(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rsi
	movq	-32(%rbp), %rdx
	addq	%rsi, %rdx
	movl	(%rdx), %edx
	subl	%edx, %eax
	cmpl	%eax, %ecx
	jne	.L7
	movl	$0, %eax
	jmp	.L4
.L7:
	addl	$1, -4(%rbp)
.L2:
	movl	-4(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jl	.L8
	movl	$1, %eax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	queen, .-queen
	.globl	print
	.type	print, @function
print:
.LFB1:
	.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	$0, -8(%rbp)
	jmp	.L10
.L15:
	movl	$0, -4(%rbp)
	jmp	.L11
.L14:
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movl	-4(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	Q(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L12
	movl	$81, %edi
	call	putchar@PLT
	jmp	.L13
.L12:
	movl	$46, %edi
	call	putchar@PLT
.L13:
	addl	$1, -4(%rbp)
.L11:
	cmpl	$7, -4(%rbp)
	jle	.L14
	movl	$10, %edi
	call	putchar@PLT
	addl	$1, -8(%rbp)
.L10:
	cmpl	$7, -8(%rbp)
	jle	.L15
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	print, .-print
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$96, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -92(%rbp)
	jmp	.L17
.L20:
	movl	-92(%rbp), %eax
	cltq
	movl	$0, -80(%rbp,%rax,4)
	movl	-92(%rbp), %eax
	cltq
	movl	$0, -48(%rbp,%rax,4)
	movl	$0, -88(%rbp)
	jmp	.L18
.L19:
	movl	-92(%rbp), %eax
	movslq	%eax, %rdx
	movl	-88(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	Q(%rip), %rax
	movl	$0, (%rdx,%rax)
	addl	$1, -88(%rbp)
.L18:
	cmpl	$7, -88(%rbp)
	jle	.L19
	addl	$1, -92(%rbp)
.L17:
	cmpl	$7, -92(%rbp)
	jle	.L20
	leaq	-96(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-96(%rbp), %eax
	movl	%eax, -84(%rbp)
	movl	$0, -92(%rbp)
	jmp	.L21
.L22:
	leaq	-48(%rbp), %rdx
	movl	-92(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-80(%rbp), %rcx
	movl	-92(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -92(%rbp)
.L21:
	movl	-96(%rbp), %eax
	cmpl	%eax, -92(%rbp)
	jl	.L22
	jmp	.L23
.L27:
	movl	-84(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	cmpl	$7, %eax
	jne	.L24
	movl	-84(%rbp), %eax
	cltq
	movl	-80(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-84(%rbp), %eax
	cltq
	movl	%edx, -80(%rbp,%rax,4)
	movl	-84(%rbp), %eax
	cltq
	movl	$0, -48(%rbp,%rax,4)
	jmp	.L25
.L24:
	movl	-84(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-84(%rbp), %eax
	cltq
	movl	%edx, -48(%rbp,%rax,4)
.L25:
	movl	-84(%rbp), %eax
	cltq
	movl	-80(%rbp,%rax,4), %eax
	cmpl	$7, %eax
	jle	.L26
	movl	-84(%rbp), %eax
	cltq
	movl	$0, -80(%rbp,%rax,4)
	movl	-84(%rbp), %eax
	cltq
	movl	$0, -48(%rbp,%rax,4)
	subl	$1, -84(%rbp)
	jmp	.L23
.L26:
	movl	-84(%rbp), %edx
	leaq	-48(%rbp), %rcx
	leaq	-80(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	queen
	testl	%eax, %eax
	je	.L23
	addl	$1, -84(%rbp)
.L23:
	cmpl	$7, -84(%rbp)
	jle	.L27
	movl	$0, -92(%rbp)
	jmp	.L28
.L29:
	movl	-92(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %edx
	movl	-92(%rbp), %eax
	cltq
	movl	-80(%rbp,%rax,4), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	Q(%rip), %rax
	movl	$1, (%rdx,%rax)
	addl	$1, -92(%rbp)
.L28:
	cmpl	$7, -92(%rbp)
	jle	.L29
	movl	$0, %eax
	call	print
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L31
	call	__stack_chk_fail@PLT
.L31:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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	queen
	.type	queen, @function
queen:
.LFB23:
	.cfi_startproc
	endbr64
	testl	%edx, %edx
	jle	.L4
	movslq	%edx, %rdx
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rdi, %r11
	xorl	%ecx, %ecx
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	(%rsi,%rdx,4), %rbp
	movl	(%rdi,%rdx,4), %r8d
	movq	%rsi, %rbx
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L16:
	movl	(%rbx,%rcx,4), %edi
	movl	0(%rbp), %esi
	cmpl	%esi, %edi
	je	.L8
	leal	(%rax,%rdi), %r10d
	leal	(%r8,%rsi), %r9d
	cmpl	%r9d, %r10d
	je	.L8
	subl	%edi, %eax
	movl	%r8d, %edi
	subl	%esi, %edi
	cmpl	%edi, %eax
	je	.L8
	addq	$1, %rcx
	cmpq	%rdx, %rcx
	je	.L15
.L3:
	movl	(%r11,%rcx,4), %eax
	cmpl	%r8d, %eax
	jne	.L16
.L8:
	xorl	%eax, %eax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L15:
	.cfi_restore_state
	movl	$1, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L4:
	.cfi_restore 3
	.cfi_restore 6
	movl	$1, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	queen, .-queen
	.p2align 4
	.globl	print
	.type	print, @function
print:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	leaq	256+Q(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	32(%rbp), %r12
	.p2align 4,,10
	.p2align 3
.L18:
	leaq	-256(%rbp), %rbx
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L19:
	movl	$46, %edi
	addq	$32, %rbx
	call	putchar@PLT
	cmpq	%rbp, %rbx
	je	.L25
.L21:
	cmpl	$1, (%rbx)
	jne	.L19
	movl	$81, %edi
	addq	$32, %rbx
	call	putchar@PLT
	cmpq	%rbp, %rbx
	jne	.L21
.L25:
	movl	$10, %edi
	leaq	4(%rbx), %rbp
	call	putchar@PLT
	cmpq	%r12, %rbp
	jne	.L18
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE24:
	.size	print, .-print
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$32, %ecx
	pxor	%xmm0, %xmm0
	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	Q(%rip), %rbx
	movq	%rbx, %rdi
	subq	$120, %rsp
	.cfi_def_cfa_offset 176
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	movaps	%xmm0, 32(%rsp)
	leaq	32(%rsp), %rbp
	movaps	%xmm0, 48(%rsp)
	movaps	%xmm0, 64(%rsp)
	movaps	%xmm0, 80(%rsp)
	rep stosq
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %r12d
	testl	%r12d, %r12d
	jle	.L28
	leaq	64(%rsp), %rax
	movq	%rbp, %r15
	xorl	%r13d, %r13d
	movq	%rax, 8(%rsp)
	leaq	.LC1(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L31:
	movq	8(%rsp), %rax
	movq	%r15, %rsi
	movq	%r14, %rdi
	addq	$4, %r15
	leaq	(%rax,%r13,4), %rdx
	xorl	%eax, %eax
	addq	$1, %r13
	call	__isoc99_scanf@PLT
	cmpl	%r13d, 28(%rsp)
	jg	.L31
	cmpl	$7, %r12d
	jg	.L29
.L28:
	movslq	%r12d, %r11
	leaq	64(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L30:
	movl	64(%rsp,%r11,4), %edx
	movl	32(%rsp,%r11,4), %eax
	leal	1(%rdx), %ecx
	cmpl	$7, %edx
	jne	.L34
	addl	$1, %eax
	xorl	%ecx, %ecx
	movl	%eax, 32(%rsp,%r11,4)
.L34:
	movl	%ecx, 64(%rsp,%r11,4)
	cmpl	$7, %eax
	jg	.L35
	testl	%r12d, %r12d
	jle	.L37
	leaq	0(,%r11,4), %r10
	xorl	%edx, %edx
	movl	32(%rsp,%r10), %edi
	addq	%r13, %r10
	.p2align 4,,10
	.p2align 3
.L40:
	movl	0(%rbp,%rdx,4), %eax
	cmpl	%edi, %eax
	je	.L30
	movl	0(%r13,%rdx,4), %esi
	movl	(%r10), %ecx
	cmpl	%ecx, %esi
	je	.L30
	leal	(%rax,%rsi), %r9d
	leal	(%rdi,%rcx), %r8d
	cmpl	%r8d, %r9d
	je	.L30
	subl	%esi, %eax
	movl	%edi, %esi
	subl	%ecx, %esi
	cmpl	%esi, %eax
	je	.L30
	addq	$1, %rdx
	cmpl	%edx, %r12d
	jg	.L40
.L37:
	addl	$1, %r12d
	cmpl	$8, %r12d
	je	.L29
	movslq	%r12d, %r11
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L35:
	movl	$0, 32(%rsp,%r11,4)
	subl	$1, %r12d
	movl	$0, 64(%rsp,%r11,4)
	movslq	%r12d, %r11
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L29:
	movslq	64(%rsp), %rdx
	movslq	32(%rsp), %rax
	leaq	(%rax,%rdx,8), %rax
	movslq	68(%rsp), %rdx
	movl	$1, (%rbx,%rax,4)
	movslq	36(%rsp), %rax
	leaq	(%rax,%rdx,8), %rax
	movslq	72(%rsp), %rdx
	movl	$1, (%rbx,%rax,4)
	movslq	40(%rsp), %rax
	leaq	(%rax,%rdx,8), %rax
	movslq	76(%rsp), %rdx
	movl	$1, (%rbx,%rax,4)
	movslq	44(%rsp), %rax
	leaq	(%rax,%rdx,8), %rax
	movslq	80(%rsp), %rdx
	movl	$1, (%rbx,%rax,4)
	movslq	48(%rsp), %rax
	leaq	(%rax,%rdx,8), %rax
	movslq	84(%rsp), %rdx
	movl	$1, (%rbx,%rax,4)
	movslq	52(%rsp), %rax
	leaq	(%rax,%rdx,8), %rax
	movslq	88(%rsp), %rdx
	movl	$1, (%rbx,%rax,4)
	movslq	56(%rsp), %rax
	leaq	(%rax,%rdx,8), %rax
	movslq	92(%rsp), %rdx
	movl	$1, (%rbx,%rax,4)
	movslq	60(%rsp), %rax
	leaq	(%rax,%rdx,8), %rax
	movl	$1, (%rbx,%rax,4)
	xorl	%eax, %eax
	call	print
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L48
	addq	$120, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L48:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.globl	Q
	.bss
	.align 32
	.type	Q, @object
	.size	Q, 256
Q:
	.zero	256
	.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	queen
	.type	queen, @function
queen:
.LFB23:
	.cfi_startproc
	endbr64
	testl	%edx, %edx
	jle	.L4
	movslq	%edx, %rdx
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rdi, %r11
	xorl	%ecx, %ecx
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	(%rsi,%rdx,4), %rbp
	movl	(%rdi,%rdx,4), %r8d
	movq	%rsi, %rbx
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L16:
	movl	(%rbx,%rcx,4), %edi
	movl	0(%rbp), %esi
	cmpl	%esi, %edi
	je	.L8
	leal	(%rax,%rdi), %r10d
	leal	(%r8,%rsi), %r9d
	cmpl	%r9d, %r10d
	je	.L8
	subl	%edi, %eax
	movl	%r8d, %edi
	subl	%esi, %edi
	cmpl	%edi, %eax
	je	.L8
	addq	$1, %rcx
	cmpq	%rdx, %rcx
	je	.L15
.L3:
	movl	(%r11,%rcx,4), %eax
	cmpl	%r8d, %eax
	jne	.L16
.L8:
	xorl	%eax, %eax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L15:
	.cfi_restore_state
	movl	$1, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L4:
	.cfi_restore 3
	.cfi_restore 6
	movl	$1, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	queen, .-queen
	.p2align 4
	.globl	print
	.type	print, @function
print:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	leaq	256+Q(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	32(%rbp), %r12
	.p2align 4,,10
	.p2align 3
.L18:
	leaq	-256(%rbp), %rbx
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L19:
	movl	$46, %edi
	addq	$32, %rbx
	call	putchar@PLT
	cmpq	%rbp, %rbx
	je	.L25
.L21:
	cmpl	$1, (%rbx)
	jne	.L19
	movl	$81, %edi
	addq	$32, %rbx
	call	putchar@PLT
	cmpq	%rbp, %rbx
	jne	.L21
.L25:
	movl	$10, %edi
	leaq	4(%rbx), %rbp
	call	putchar@PLT
	cmpq	%r12, %rbp
	jne	.L18
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE24:
	.size	print, .-print
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$32, %ecx
	pxor	%xmm0, %xmm0
	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	Q(%rip), %rbx
	movq	%rbx, %rdi
	subq	$120, %rsp
	.cfi_def_cfa_offset 176
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	movaps	%xmm0, 32(%rsp)
	leaq	32(%rsp), %rbp
	movaps	%xmm0, 48(%rsp)
	movaps	%xmm0, 64(%rsp)
	movaps	%xmm0, 80(%rsp)
	rep stosq
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %r12d
	testl	%r12d, %r12d
	jle	.L28
	leaq	64(%rsp), %rax
	movq	%rbp, %r15
	xorl	%r13d, %r13d
	movq	%rax, 8(%rsp)
	leaq	.LC1(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L31:
	movq	8(%rsp), %rax
	movq	%r15, %rsi
	movq	%r14, %rdi
	addq	$4, %r15
	leaq	(%rax,%r13,4), %rdx
	xorl	%eax, %eax
	addq	$1, %r13
	call	__isoc99_scanf@PLT
	cmpl	%r13d, 28(%rsp)
	jg	.L31
	cmpl	$7, %r12d
	jg	.L29
.L28:
	movslq	%r12d, %r11
	leaq	64(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L30:
	movl	64(%rsp,%r11,4), %edx
	movl	32(%rsp,%r11,4), %eax
	leal	1(%rdx), %ecx
	cmpl	$7, %edx
	jne	.L34
	addl	$1, %eax
	xorl	%ecx, %ecx
	movl	%eax, 32(%rsp,%r11,4)
.L34:
	movl	%ecx, 64(%rsp,%r11,4)
	cmpl	$7, %eax
	jg	.L35
	testl	%r12d, %r12d
	jle	.L37
	leaq	0(,%r11,4), %r10
	xorl	%edx, %edx
	movl	32(%rsp,%r10), %edi
	addq	%r13, %r10
	.p2align 4,,10
	.p2align 3
.L40:
	movl	0(%rbp,%rdx,4), %eax
	cmpl	%edi, %eax
	je	.L30
	movl	0(%r13,%rdx,4), %esi
	movl	(%r10), %ecx
	cmpl	%ecx, %esi
	je	.L30
	leal	(%rax,%rsi), %r9d
	leal	(%rdi,%rcx), %r8d
	cmpl	%r8d, %r9d
	je	.L30
	subl	%esi, %eax
	movl	%edi, %esi
	subl	%ecx, %esi
	cmpl	%esi, %eax
	je	.L30
	addq	$1, %rdx
	cmpl	%edx, %r12d
	jg	.L40
.L37:
	addl	$1, %r12d
	cmpl	$8, %r12d
	je	.L29
	movslq	%r12d, %r11
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L35:
	movl	$0, 32(%rsp,%r11,4)
	subl	$1, %r12d
	movl	$0, 64(%rsp,%r11,4)
	movslq	%r12d, %r11
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L29:
	movslq	64(%rsp), %rdx
	movslq	32(%rsp), %rax
	leaq	(%rax,%rdx,8), %rax
	movslq	68(%rsp), %rdx
	movl	$1, (%rbx,%rax,4)
	movslq	36(%rsp), %rax
	leaq	(%rax,%rdx,8), %rax
	movslq	72(%rsp), %rdx
	movl	$1, (%rbx,%rax,4)
	movslq	40(%rsp), %rax
	leaq	(%rax,%rdx,8), %rax
	movslq	76(%rsp), %rdx
	movl	$1, (%rbx,%rax,4)
	movslq	44(%rsp), %rax
	leaq	(%rax,%rdx,8), %rax
	movslq	80(%rsp), %rdx
	movl	$1, (%rbx,%rax,4)
	movslq	48(%rsp), %rax
	leaq	(%rax,%rdx,8), %rax
	movslq	84(%rsp), %rdx
	movl	$1, (%rbx,%rax,4)
	movslq	52(%rsp), %rax
	leaq	(%rax,%rdx,8), %rax
	movslq	88(%rsp), %rdx
	movl	$1, (%rbx,%rax,4)
	movslq	56(%rsp), %rax
	leaq	(%rax,%rdx,8), %rax
	movslq	92(%rsp), %rdx
	movl	$1, (%rbx,%rax,4)
	movslq	60(%rsp), %rax
	leaq	(%rax,%rdx,8), %rax
	movl	$1, (%rbx,%rax,4)
	xorl	%eax, %eax
	call	print
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L48
	addq	$120, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L48:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.globl	Q
	.bss
	.align 32
	.type	Q, @object
	.size	Q, 256
Q:
	.zero	256
	.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>
#define N 8

int Q[N][N];

int queen(int *r,int *c,int k){
  int i;

  for(i=0;i<k;i++){
    if(r[i]==r[k])
      return 0;
    if(c[i]==c[k])
      return 0;
    if(r[i]+c[i]==r[k]+c[k])
      return 0;
    if(r[i]-c[i]==r[k]-c[k])
      return 0;
  }
  return 1;
}

void print(){
  int i,j;

  for(i=0;i<N;i++){
    for(j=0;j<N;j++){
      if(Q[j][i]==1)
        printf("Q");
      else
        printf(".");
    }
    printf("\n");
  }
}

int main(){

  int i,j;
  int n,k;
  int r[N],c[N];

  for(i=0;i<N;i++){
    r[i]=0;
    c[i]=0;
    for(j=0;j<N;j++){
      Q[j][i]=0;
    }
  }

 scanf("%d",&n);
  k=n;

  for(i=0;i<n;i++)
    scanf("%d%d",&r[i],&c[i]);

  while(k<N){
    if(c[k]==N-1){
      r[k]++;
      c[k]=0;
    }
    else
      c[k]++;

    if(r[k]>N-1){
      r[k]=0;
      c[k]=0;
      k--;
    }
    else if(queen(r,c,k))
      k++;
  }

  for(i=0;i<N;i++)
    Q[c[i]][r[i]]=1;

  print();

  return 0;
}
2
1 4
5 3
 2
0 4
5 3
 2
0 4
5 2
 2
1 4
6 3
 2
1 0
5 3
 2
2 4
6 3
 2
0 0
5 1
 2
3 0
5 5
 2
0 4
4 3
 2
2 0
5 5

..Q.....
....Q...
.Q......
.......Q
.....Q..
...Q....
......Q.
Q.......
 ....Q...
.Q......
.....Q..
Q.......
......Q.
...Q....
.......Q
..Q.....
 ....Q...
.Q......
...Q....
.....Q..
.......Q
..Q.....
Q.......
......Q.
 ..Q.....
....Q...
.Q......
.......Q
Q.......
......Q.
...Q....
.....Q..
 ......Q.
Q.......
..Q.....
.......Q
.....Q..
...Q....
.Q......
....Q...
 .......Q
.Q......
....Q...
..Q.....
Q.......
......Q.
...Q....
.....Q..
 Q.......
......Q.
...Q....
.....Q..
.......Q
.Q......
....Q...
..Q.....
 ....Q...
.......Q
...Q....
Q.......
..Q.....
.....Q..
.Q......
......Q.
 ....Q...
.Q......
.......Q
Q.......
...Q....
......Q.
..Q.....
.....Q..
 ....Q...
......Q.
Q.......
..Q.....
.......Q
.....Q..
...Q....
.Q......

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>
#define N 8

int Q[N][N];

int queen(int *r,int *c,int k){
  int i;

  for(i=0;i<k;i++){
    if(r[i]==r[k])
      return 0;
    if(c[i]==c[k])
      return 0;
    if(r[i]+c[i]==r[k]+c[k])
      return 0;
    if(r[i]-c[i]==r[k]-c[k])
      return 0;
  }
  return 1;
}

void print(){
  int i,j;

  for(i=0;i<N;i++){
    for(j=0;j<N;j++){
      if(Q[j][i]==1)
        printf("Q");
      else
        printf(".");
    }
    printf("\n");
  }
}

int main(){

  int i,j;
  int n,k;
  int r[N],c[N];

  for(i=0;i<N;i++){
    r[i]=0;
    c[i]=0;
    for(j=0;j<N;j++){
      Q[j][i]=0;
    }
  }

 scanf("%d",&n);
  k=n;

  for(i=0;i<n;i++)
    scanf("%d%d",&r[i],&c[i]);

  while(k<N){
    if(c[k]==N-1){
      r[k]++;
      c[k]=0;
    }
    else
      c[k]++;

    if(r[k]>N-1){
      r[k]=0;
      c[k]=0;
      k--;
    }
    else if(queen(r,c,k))
      k++;
  }

  for(i=0;i<N;i++)
    Q[c[i]][r[i]]=1;

  print();

  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	Q
	.bss
	.align 32
	.type	Q, @object
	.size	Q, 256
Q:
	.zero	256
	.text
	.globl	queen
	.type	queen, @function
queen:
.LFB0:
	.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	%edx, -36(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L2
.L8:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jne	.L3
	movl	$0, %eax
	jmp	.L4
.L3:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-32(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jne	.L5
	movl	$0, %eax
	jmp	.L4
.L5:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-32(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	addl	%eax, %edx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %ecx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rsi
	movq	-32(%rbp), %rax
	addq	%rsi, %rax
	movl	(%rax), %eax
	addl	%ecx, %eax
	cmpl	%eax, %edx
	jne	.L6
	movl	$0, %eax
	jmp	.L4
.L6:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-32(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rdx), %edx
	subl	%edx, %eax
	movl	%eax, %ecx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-36(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rsi
	movq	-32(%rbp), %rdx
	addq	%rsi, %rdx
	movl	(%rdx), %edx
	subl	%edx, %eax
	cmpl	%eax, %ecx
	jne	.L7
	movl	$0, %eax
	jmp	.L4
.L7:
	addl	$1, -4(%rbp)
.L2:
	movl	-4(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jl	.L8
	movl	$1, %eax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	queen, .-queen
	.globl	print
	.type	print, @function
print:
.LFB1:
	.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	$0, -8(%rbp)
	jmp	.L10
.L15:
	movl	$0, -4(%rbp)
	jmp	.L11
.L14:
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movl	-4(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	Q(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L12
	movl	$81, %edi
	call	putchar@PLT
	jmp	.L13
.L12:
	movl	$46, %edi
	call	putchar@PLT
.L13:
	addl	$1, -4(%rbp)
.L11:
	cmpl	$7, -4(%rbp)
	jle	.L14
	movl	$10, %edi
	call	putchar@PLT
	addl	$1, -8(%rbp)
.L10:
	cmpl	$7, -8(%rbp)
	jle	.L15
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	print, .-print
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$96, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -92(%rbp)
	jmp	.L17
.L20:
	movl	-92(%rbp), %eax
	cltq
	movl	$0, -80(%rbp,%rax,4)
	movl	-92(%rbp), %eax
	cltq
	movl	$0, -48(%rbp,%rax,4)
	movl	$0, -88(%rbp)
	jmp	.L18
.L19:
	movl	-92(%rbp), %eax
	movslq	%eax, %rdx
	movl	-88(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	Q(%rip), %rax
	movl	$0, (%rdx,%rax)
	addl	$1, -88(%rbp)
.L18:
	cmpl	$7, -88(%rbp)
	jle	.L19
	addl	$1, -92(%rbp)
.L17:
	cmpl	$7, -92(%rbp)
	jle	.L20
	leaq	-96(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-96(%rbp), %eax
	movl	%eax, -84(%rbp)
	movl	$0, -92(%rbp)
	jmp	.L21
.L22:
	leaq	-48(%rbp), %rdx
	movl	-92(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-80(%rbp), %rcx
	movl	-92(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -92(%rbp)
.L21:
	movl	-96(%rbp), %eax
	cmpl	%eax, -92(%rbp)
	jl	.L22
	jmp	.L23
.L27:
	movl	-84(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	cmpl	$7, %eax
	jne	.L24
	movl	-84(%rbp), %eax
	cltq
	movl	-80(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-84(%rbp), %eax
	cltq
	movl	%edx, -80(%rbp,%rax,4)
	movl	-84(%rbp), %eax
	cltq
	movl	$0, -48(%rbp,%rax,4)
	jmp	.L25
.L24:
	movl	-84(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-84(%rbp), %eax
	cltq
	movl	%edx, -48(%rbp,%rax,4)
.L25:
	movl	-84(%rbp), %eax
	cltq
	movl	-80(%rbp,%rax,4), %eax
	cmpl	$7, %eax
	jle	.L26
	movl	-84(%rbp), %eax
	cltq
	movl	$0, -80(%rbp,%rax,4)
	movl	-84(%rbp), %eax
	cltq
	movl	$0, -48(%rbp,%rax,4)
	subl	$1, -84(%rbp)
	jmp	.L23
.L26:
	movl	-84(%rbp), %edx
	leaq	-48(%rbp), %rcx
	leaq	-80(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	queen
	testl	%eax, %eax
	je	.L23
	addl	$1, -84(%rbp)
.L23:
	cmpl	$7, -84(%rbp)
	jle	.L27
	movl	$0, -92(%rbp)
	jmp	.L28
.L29:
	movl	-92(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %edx
	movl	-92(%rbp), %eax
	cltq
	movl	-80(%rbp,%rax,4), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	Q(%rip), %rax
	movl	$1, (%rdx,%rax)
	addl	$1, -92(%rbp)
.L28:
	cmpl	$7, -92(%rbp)
	jle	.L29
	movl	$0, %eax
	call	print
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L31
	call	__stack_chk_fail@PLT
.L31:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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	Q
	.bss
	.align 32
	.type	Q, @object
	.size	Q, 256
Q:
	.zero	256
	.text
	.globl	queen
	.type	queen, @function
queen:
.LFB0:
	.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	%edx, -36(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L2
.L8:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jne	.L3
	movl	$0, %eax
	jmp	.L4
.L3:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-32(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jne	.L5
	movl	$0, %eax
	jmp	.L4
.L5:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-32(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	addl	%eax, %edx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %ecx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rsi
	movq	-32(%rbp), %rax
	addq	%rsi, %rax
	movl	(%rax), %eax
	addl	%ecx, %eax
	cmpl	%eax, %edx
	jne	.L6
	movl	$0, %eax
	jmp	.L4
.L6:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-32(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rdx), %edx
	subl	%edx, %eax
	movl	%eax, %ecx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-36(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rsi
	movq	-32(%rbp), %rdx
	addq	%rsi, %rdx
	movl	(%rdx), %edx
	subl	%edx, %eax
	cmpl	%eax, %ecx
	jne	.L7
	movl	$0, %eax
	jmp	.L4
.L7:
	addl	$1, -4(%rbp)
.L2:
	movl	-4(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jl	.L8
	movl	$1, %eax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	queen, .-queen
	.globl	print
	.type	print, @function
print:
.LFB1:
	.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	$0, -8(%rbp)
	jmp	.L10
.L15:
	movl	$0, -4(%rbp)
	jmp	.L11
.L14:
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movl	-4(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	Q(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L12
	movl	$81, %edi
	call	putchar@PLT
	jmp	.L13
.L12:
	movl	$46, %edi
	call	putchar@PLT
.L13:
	addl	$1, -4(%rbp)
.L11:
	cmpl	$7, -4(%rbp)
	jle	.L14
	movl	$10, %edi
	call	putchar@PLT
	addl	$1, -8(%rbp)
.L10:
	cmpl	$7, -8(%rbp)
	jle	.L15
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	print, .-print
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$96, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -92(%rbp)
	jmp	.L17
.L20:
	movl	-92(%rbp), %eax
	cltq
	movl	$0, -80(%rbp,%rax,4)
	movl	-92(%rbp), %eax
	cltq
	movl	$0, -48(%rbp,%rax,4)
	movl	$0, -88(%rbp)
	jmp	.L18
.L19:
	movl	-92(%rbp), %eax
	movslq	%eax, %rdx
	movl	-88(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	Q(%rip), %rax
	movl	$0, (%rdx,%rax)
	addl	$1, -88(%rbp)
.L18:
	cmpl	$7, -88(%rbp)
	jle	.L19
	addl	$1, -92(%rbp)
.L17:
	cmpl	$7, -92(%rbp)
	jle	.L20
	leaq	-96(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-96(%rbp), %eax
	movl	%eax, -84(%rbp)
	movl	$0, -92(%rbp)
	jmp	.L21
.L22:
	leaq	-48(%rbp), %rdx
	movl	-92(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-80(%rbp), %rcx
	movl	-92(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -92(%rbp)
.L21:
	movl	-96(%rbp), %eax
	cmpl	%eax, -92(%rbp)
	jl	.L22
	jmp	.L23
.L27:
	movl	-84(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	cmpl	$7, %eax
	jne	.L24
	movl	-84(%rbp), %eax
	cltq
	movl	-80(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-84(%rbp), %eax
	cltq
	movl	%edx, -80(%rbp,%rax,4)
	movl	-84(%rbp), %eax
	cltq
	movl	$0, -48(%rbp,%rax,4)
	jmp	.L25
.L24:
	movl	-84(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-84(%rbp), %eax
	cltq
	movl	%edx, -48(%rbp,%rax,4)
.L25:
	movl	-84(%rbp), %eax
	cltq
	movl	-80(%rbp,%rax,4), %eax
	cmpl	$7, %eax
	jle	.L26
	movl	-84(%rbp), %eax
	cltq
	movl	$0, -80(%rbp,%rax,4)
	movl	-84(%rbp), %eax
	cltq
	movl	$0, -48(%rbp,%rax,4)
	subl	$1, -84(%rbp)
	jmp	.L23
.L26:
	movl	-84(%rbp), %edx
	leaq	-48(%rbp), %rcx
	leaq	-80(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	queen
	testl	%eax, %eax
	je	.L23
	addl	$1, -84(%rbp)
.L23:
	cmpl	$7, -84(%rbp)
	jle	.L27
	movl	$0, -92(%rbp)
	jmp	.L28
.L29:
	movl	-92(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %edx
	movl	-92(%rbp), %eax
	cltq
	movl	-80(%rbp,%rax,4), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	Q(%rip), %rax
	movl	$1, (%rdx,%rax)
	addl	$1, -92(%rbp)
.L28:
	cmpl	$7, -92(%rbp)
	jle	.L29
	movl	$0, %eax
	call	print
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L31
	call	__stack_chk_fail@PLT
.L31:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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:
