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

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

typedef struct {
  unsigned int b;
  char step;
} Board;

int qlen=32202;

typedef enum { U, D, L, R } Direction;

typedef struct {
  int pos;
  Direction dir;
} Motion;

const Motion motion[9][5] =
  {{{1,L},{3,U},{-1}}, {{0,R},{2,L},{4,U},{-1}}, {{1,R},{5,U},{-1}},
   {{0,D},{4,L},{6,U},{-1}}, {{1,D},{5,L},{7,U},{3,R},{-1}},
   {{2,D},{8,U},{4,R},{-1}},
   {{3,D},{7,L},{-1}}, {{4,D},{8,L},{6,R},{-1}}, {{5,D},{7,R},{-1}} };

int findzero(unsigned int b)
{
  for (int i=0; i<9; i++) {
    if (b%10==0) return 8-i;
    b/=10;
  }
  return -1;
}

unsigned int sq[] = {1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000,1000000000 };

#define HISTLEN 8765432

int main()
{
  int i, j, k;
  int qhead, qtail;
  qhead = qtail = 0;
  Board board;
  fscanf(stdin, "%d %d %d\n", &i, &j, &k);
  board.b = i*sq[8]+j*sq[7]+k*sq[6];
  fscanf(stdin, "%d %d %d\n", &i, &j, &k);
  board.b += i*sq[5]+j*sq[4]+k*sq[3];
  fscanf(stdin, "%d %d %d\n", &i, &j, &k);
  board.b += i*100+j*10+k;
  short int *used = (short int*)malloc(sizeof(short int)*HISTLEN);
  for (i=0; i<HISTLEN; i++) used[i]=0;
  Board *Q = (Board*)malloc(sizeof(Board)*qlen);
  board.step=0;
  Q[qhead++] = board;
  
  while (qhead>qtail) {
    board = Q[qtail++ %qlen];
    if (board.b==123456780)   break;
    
    int space = findzero(board.b);
    for (i=0; motion[space][i].pos>=0; i++) {
      Board b = board;
      Motion m = motion[space][i];
      if (m.pos==0 && b.b/sq[8]==1) continue;
      if ((m.pos==1||m.pos==2) && b.b/sq[8]==1&&(b.b%sq[8])/sq[7]==2&&(b.b%sq[7])/sq[6]==3) continue;
      int nn=b.b%sq[8-m.pos+1]/sq[8-m.pos];
      b.b = nn*sq[8-space]+b.b-nn*sq[8-m.pos];
      b.step = board.step+1;
      k=b.b/100;
      if ((used[k] & (1<<(b.b%10)))==(1<<(b.b%10))) continue;
      used[k] |= (1<<(board.b%10));
      Q[qhead++ %qlen] = b;
    }
  }
  printf("%d\n", board.step);
  return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	qlen
	.data
	.align 4
	.type	qlen, @object
	.size	qlen, 4
qlen:
	.long	32202
	.globl	motion
	.section	.rodata
	.align 32
	.type	motion, @object
	.size	motion, 360
motion:
	.long	1
	.long	2
	.long	3
	.long	0
	.long	-1
	.zero	4
	.zero	16
	.long	0
	.long	3
	.long	2
	.long	2
	.long	4
	.long	0
	.long	-1
	.zero	4
	.zero	8
	.long	1
	.long	3
	.long	5
	.long	0
	.long	-1
	.zero	4
	.zero	16
	.long	0
	.long	1
	.long	4
	.long	2
	.long	6
	.long	0
	.long	-1
	.zero	4
	.zero	8
	.long	1
	.long	1
	.long	5
	.long	2
	.long	7
	.long	0
	.long	3
	.long	3
	.long	-1
	.zero	4
	.long	2
	.long	1
	.long	8
	.long	0
	.long	4
	.long	3
	.long	-1
	.zero	4
	.zero	8
	.long	3
	.long	1
	.long	7
	.long	2
	.long	-1
	.zero	4
	.zero	16
	.long	4
	.long	1
	.long	8
	.long	2
	.long	6
	.long	3
	.long	-1
	.zero	4
	.zero	8
	.long	5
	.long	1
	.long	7
	.long	3
	.long	-1
	.zero	4
	.zero	16
	.text
	.globl	findzero
	.type	findzero, @function
findzero:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L2
.L5:
	movl	-20(%rbp), %ecx
	movl	%ecx, %edx
	movl	$3435973837, %eax
	imulq	%rdx, %rax
	shrq	$32, %rax
	movl	%eax, %edx
	shrl	$3, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	testl	%edx, %edx
	jne	.L3
	movl	$8, %eax
	subl	-4(%rbp), %eax
	jmp	.L4
.L3:
	movl	-20(%rbp), %eax
	movl	%eax, %edx
	movl	$3435973837, %eax
	imulq	%rdx, %rax
	shrq	$32, %rax
	shrl	$3, %eax
	movl	%eax, -20(%rbp)
	addl	$1, -4(%rbp)
.L2:
	cmpl	$8, -4(%rbp)
	jle	.L5
	movl	$-1, %eax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	findzero, .-findzero
	.globl	sq
	.data
	.align 32
	.type	sq, @object
	.size	sq, 40
sq:
	.long	1
	.long	10
	.long	100
	.long	1000
	.long	10000
	.long	100000
	.long	1000000
	.long	10000000
	.long	100000000
	.long	1000000000
	.section	.rodata
.LC0:
	.string	"%d %d %d\n"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$80, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -60(%rbp)
	movl	-60(%rbp), %eax
	movl	%eax, -64(%rbp)
	movq	stdin(%rip), %rax
	leaq	-68(%rbp), %rsi
	leaq	-72(%rbp), %rcx
	leaq	-76(%rbp), %rdx
	movq	%rsi, %r8
	leaq	.LC0(%rip), %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_fscanf@PLT
	movl	32+sq(%rip), %eax
	movl	-76(%rbp), %edx
	imull	%edx, %eax
	movl	%eax, %ecx
	movl	28+sq(%rip), %eax
	movl	-72(%rbp), %edx
	imull	%edx, %eax
	addl	%eax, %ecx
	movl	24+sq(%rip), %eax
	movl	-68(%rbp), %edx
	imull	%edx, %eax
	addl	%ecx, %eax
	movl	%eax, -32(%rbp)
	movq	stdin(%rip), %rax
	leaq	-68(%rbp), %rsi
	leaq	-72(%rbp), %rcx
	leaq	-76(%rbp), %rdx
	movq	%rsi, %r8
	leaq	.LC0(%rip), %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_fscanf@PLT
	movl	-32(%rbp), %ecx
	movl	20+sq(%rip), %eax
	movl	-76(%rbp), %edx
	imull	%edx, %eax
	movl	%eax, %esi
	movl	16+sq(%rip), %eax
	movl	-72(%rbp), %edx
	imull	%edx, %eax
	addl	%eax, %esi
	movl	12+sq(%rip), %eax
	movl	-68(%rbp), %edx
	imull	%edx, %eax
	addl	%esi, %eax
	addl	%ecx, %eax
	movl	%eax, -32(%rbp)
	movq	stdin(%rip), %rax
	leaq	-68(%rbp), %rsi
	leaq	-72(%rbp), %rcx
	leaq	-76(%rbp), %rdx
	movq	%rsi, %r8
	leaq	.LC0(%rip), %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_fscanf@PLT
	movl	-32(%rbp), %ecx
	movl	-76(%rbp), %eax
	imull	$100, %eax, %esi
	movl	-72(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	leal	(%rsi,%rax), %edx
	movl	-68(%rbp), %eax
	addl	%edx, %eax
	addl	%ecx, %eax
	movl	%eax, -32(%rbp)
	movl	$17530864, %edi
	call	malloc@PLT
	movq	%rax, -48(%rbp)
	movl	$0, -76(%rbp)
	jmp	.L7
.L8:
	movl	-76(%rbp), %eax
	cltq
	leaq	(%rax,%rax), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movw	$0, (%rax)
	movl	-76(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -76(%rbp)
.L7:
	movl	-76(%rbp), %eax
	cmpl	$8765431, %eax
	jle	.L8
	movl	qlen(%rip), %eax
	cltq
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -40(%rbp)
	movb	$0, -28(%rbp)
	movl	-64(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -64(%rbp)
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rax, %rdx
	movq	-32(%rbp), %rax
	movq	%rax, (%rdx)
	jmp	.L9
.L20:
	movl	-60(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -60(%rbp)
	movl	qlen(%rip), %ecx
	cltd
	idivl	%ecx
	movl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movl	-32(%rbp), %eax
	cmpl	$123456780, %eax
	je	.L23
	movl	-32(%rbp), %eax
	movl	%eax, %edi
	call	findzero
	movl	%eax, -56(%rbp)
	movl	$0, -76(%rbp)
	jmp	.L12
.L19:
	movq	-32(%rbp), %rax
	movq	%rax, -24(%rbp)
	movl	-76(%rbp), %eax
	movslq	%eax, %rcx
	movl	-56(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	motion(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, -16(%rbp)
	movl	-16(%rbp), %eax
	testl	%eax, %eax
	jne	.L13
	movl	-24(%rbp), %eax
	movl	32+sq(%rip), %edi
	movl	$0, %edx
	divl	%edi
	cmpl	$1, %eax
	je	.L24
.L13:
	movl	-16(%rbp), %eax
	cmpl	$1, %eax
	je	.L15
	movl	-16(%rbp), %eax
	cmpl	$2, %eax
	jne	.L16
.L15:
	movl	-24(%rbp), %eax
	movl	32+sq(%rip), %edi
	movl	$0, %edx
	divl	%edi
	cmpl	$1, %eax
	jne	.L16
	movl	-24(%rbp), %eax
	movl	32+sq(%rip), %ecx
	movl	$0, %edx
	divl	%ecx
	movl	%edx, %eax
	movl	28+sq(%rip), %edi
	movl	$0, %edx
	divl	%edi
	cmpl	$2, %eax
	jne	.L16
	movl	-24(%rbp), %eax
	movl	28+sq(%rip), %ecx
	movl	$0, %edx
	divl	%ecx
	movl	%edx, %eax
	movl	24+sq(%rip), %edi
	movl	$0, %edx
	divl	%edi
	cmpl	$3, %eax
	je	.L25
.L16:
	movl	-24(%rbp), %eax
	movl	-16(%rbp), %ecx
	movl	$9, %edx
	subl	%ecx, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	sq(%rip), %rdx
	movl	(%rcx,%rdx), %ecx
	movl	$0, %edx
	divl	%ecx
	movl	%edx, %ecx
	movl	-16(%rbp), %edx
	movl	$8, %eax
	subl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	sq(%rip), %rax
	movl	(%rdx,%rax), %edi
	movl	%ecx, %eax
	movl	$0, %edx
	divl	%edi
	movl	%eax, -52(%rbp)
	movl	$8, %eax
	subl	-56(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	sq(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-52(%rbp), %eax
	imull	%eax, %edx
	movl	-24(%rbp), %eax
	leal	(%rdx,%rax), %ecx
	movl	-16(%rbp), %edx
	movl	$8, %eax
	subl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	sq(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-52(%rbp), %eax
	imull	%eax, %edx
	movl	%ecx, %eax
	subl	%edx, %eax
	movl	%eax, -24(%rbp)
	movzbl	-28(%rbp), %eax
	addl	$1, %eax
	movb	%al, -20(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, %eax
	imulq	$1374389535, %rax, %rax
	shrq	$32, %rax
	shrl	$5, %eax
	movl	%eax, -68(%rbp)
	movl	-68(%rbp), %eax
	cltq
	leaq	(%rax,%rax), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movzwl	(%rax), %eax
	movswl	%ax, %esi
	movl	-24(%rbp), %ecx
	movl	%ecx, %edx
	movl	$3435973837, %eax
	imulq	%rdx, %rax
	shrq	$32, %rax
	movl	%eax, %edx
	shrl	$3, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	movl	$1, %eax
	movl	%edx, %ecx
	sall	%cl, %eax
	andl	%eax, %esi
	movl	-24(%rbp), %ecx
	movl	%ecx, %edx
	movl	$3435973837, %eax
	imulq	%rdx, %rax
	shrq	$32, %rax
	movl	%eax, %edx
	shrl	$3, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	movl	$1, %eax
	movl	%edx, %ecx
	sall	%cl, %eax
	cmpl	%eax, %esi
	je	.L26
	movl	-68(%rbp), %eax
	cltq
	leaq	(%rax,%rax), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movzwl	(%rax), %esi
	movl	-32(%rbp), %ecx
	movl	%ecx, %edx
	movl	$3435973837, %eax
	imulq	%rdx, %rax
	shrq	$32, %rax
	movl	%eax, %edx
	shrl	$3, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	movl	$1, %eax
	movl	%edx, %ecx
	sall	%cl, %eax
	movl	%eax, %ecx
	movl	-68(%rbp), %eax
	cltq
	leaq	(%rax,%rax), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	orl	%ecx, %esi
	movl	%esi, %edx
	movw	%dx, (%rax)
	movl	-64(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -64(%rbp)
	movl	qlen(%rip), %ecx
	cltd
	idivl	%ecx
	movl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rax, %rdx
	movq	-24(%rbp), %rax
	movq	%rax, (%rdx)
	jmp	.L18
.L24:
	nop
	jmp	.L18
.L25:
	nop
	jmp	.L18
.L26:
	nop
.L18:
	movl	-76(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -76(%rbp)
.L12:
	movl	-76(%rbp), %eax
	movslq	%eax, %rcx
	movl	-56(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	motion(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jns	.L19
.L9:
	movl	-64(%rbp), %eax
	cmpl	-60(%rbp), %eax
	jg	.L20
	jmp	.L11
.L23:
	nop
.L11:
	movzbl	-28(%rbp), %eax
	movsbl	%al, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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	findzero
	.type	findzero, @function
findzero:
.LFB51:
	.cfi_startproc
	endbr64
	imull	$-858993459, %edi, %eax
	rorl	%eax
	cmpl	$429496729, %eax
	jbe	.L4
	movl	%edi, %edi
	movl	$3435973837, %eax
	imulq	%rax, %rdi
	shrq	$35, %rdi
	imull	$-858993459, %edi, %edx
	rorl	%edx
	cmpl	$429496729, %edx
	jbe	.L5
	movl	%edi, %edi
	imulq	%rax, %rdi
	shrq	$35, %rdi
	imull	$-858993459, %edi, %edx
	rorl	%edx
	cmpl	$429496729, %edx
	jbe	.L6
	movl	%edi, %edi
	imulq	%rax, %rdi
	shrq	$35, %rdi
	imull	$-858993459, %edi, %edx
	rorl	%edx
	cmpl	$429496729, %edx
	jbe	.L7
	movl	%edi, %edi
	imulq	%rax, %rdi
	shrq	$35, %rdi
	imull	$-858993459, %edi, %edx
	rorl	%edx
	cmpl	$429496729, %edx
	jbe	.L8
	movl	%edi, %edi
	imulq	%rax, %rdi
	shrq	$35, %rdi
	imull	$-858993459, %edi, %edx
	rorl	%edx
	cmpl	$429496729, %edx
	jbe	.L9
	movl	%edi, %edi
	imulq	%rax, %rdi
	shrq	$35, %rdi
	imull	$-858993459, %edi, %edx
	rorl	%edx
	cmpl	$429496729, %edx
	jbe	.L10
	movl	%edi, %edi
	imulq	%rax, %rdi
	shrq	$35, %rdi
	imull	$-858993459, %edi, %edx
	rorl	%edx
	cmpl	$429496729, %edx
	jbe	.L11
	movl	%edi, %edx
	imulq	%rax, %rdx
	movl	$-1, %eax
	shrq	$35, %rdx
	imull	$-858993459, %edx, %edx
	rorl	%edx
	cmpl	$429496729, %edx
	jbe	.L14
	ret
.L4:
	xorl	%edx, %edx
.L2:
	movl	$8, %eax
	subl	%edx, %eax
	ret
.L5:
	movl	$1, %edx
	jmp	.L2
.L14:
	movl	$8, %edx
	jmp	.L2
.L6:
	movl	$2, %edx
	jmp	.L2
.L7:
	movl	$3, %edx
	jmp	.L2
.L8:
	movl	$4, %edx
	jmp	.L2
.L9:
	movl	$5, %edx
	jmp	.L2
.L10:
	movl	$6, %edx
	jmp	.L2
.L11:
	movl	$7, %edx
	jmp	.L2
	.cfi_endproc
.LFE51:
	.size	findzero, .-findzero
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d %d\n"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	.LC0(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%r14, %rsi
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$88, %rsp
	.cfi_def_cfa_offset 144
	movq	stdin(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 72(%rsp)
	xorl	%eax, %eax
	leaq	60(%rsp), %r15
	leaq	68(%rsp), %r8
	leaq	64(%rsp), %rcx
	movq	%r15, %rdx
	movq	%r8, 8(%rsp)
	movq	%rcx, (%rsp)
	call	__isoc99_fscanf@PLT
	movq	8(%rsp), %r8
	movq	%r15, %rdx
	movq	%r14, %rsi
	movl	32+sq(%rip), %ebx
	movl	28+sq(%rip), %eax
	imull	60(%rsp), %ebx
	movq	(%rsp), %rcx
	imull	64(%rsp), %eax
	movq	stdin(%rip), %rdi
	addl	%eax, %ebx
	movl	24+sq(%rip), %eax
	imull	68(%rsp), %eax
	addl	%eax, %ebx
	xorl	%eax, %eax
	call	__isoc99_fscanf@PLT
	movq	8(%rsp), %r8
	movq	%r15, %rdx
	movq	%r14, %rsi
	movl	20+sq(%rip), %r12d
	imull	60(%rsp), %r12d
	xorl	%r15d, %r15d
	movl	16+sq(%rip), %eax
	imull	64(%rsp), %eax
	movq	(%rsp), %rcx
	movq	stdin(%rip), %rdi
	addl	%ebx, %r12d
	addl	%eax, %r12d
	movl	12+sq(%rip), %eax
	imull	68(%rsp), %eax
	addl	%eax, %r12d
	xorl	%eax, %eax
	call	__isoc99_fscanf@PLT
	imull	$100, 60(%rsp), %edx
	movl	64(%rsp), %eax
	movl	$1, %esi
	movl	$17530864, %edi
	leal	(%rax,%rax,4), %eax
	leal	(%rdx,%rax,2), %ebx
	addl	68(%rsp), %ebx
	call	calloc@PLT
	movslq	qlen(%rip), %rdi
	addl	%r12d, %ebx
	movl	$8765432, 60(%rsp)
	movq	%rax, 24(%rsp)
	movl	%edi, 8(%rsp)
	salq	$3, %rdi
	call	malloc@PLT
	movl	$0, 36(%rsp)
	xorl	%r10d, %r10d
	movl	$1, %r8d
	movq	%rax, 16(%rsp)
	movl	$3435973837, %edi
	leaq	sq(%rip), %rsi
	movl	$8, %r11d
	movl	%ebx, (%rax)
	movb	$0, 4(%rax)
	movl	32+sq(%rip), %eax
	movl	%eax, 32(%rsp)
	movl	28+sq(%rip), %eax
	movl	%eax, 40(%rsp)
	movl	24+sq(%rip), %eax
	movl	%eax, 44(%rsp)
	xorl	%eax, %eax
	jmp	.L39
	.p2align 4,,10
	.p2align 3
.L27:
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	32(%rsp)
	cmpl	$1, %eax
	je	.L57
.L30:
	movl	%r11d, %eax
	movl	$9, %edx
	leal	1(%r15), %r14d
	subl	%ecx, %eax
	subl	%ecx, %edx
	cltq
	movslq	%edx, %rcx
	xorl	%edx, %edx
	movl	(%rsi,%rax,4), %r8d
	movl	%ebx, %eax
	divl	(%rsi,%rcx,4)
	movq	24(%rsp), %rcx
	movl	%edx, %eax
	xorl	%edx, %edx
	divl	%r8d
	movl	%r11d, %edx
	subl	%r12d, %edx
	movslq	%edx, %rdx
	movl	(%rsi,%rdx,4), %r10d
	imull	%eax, %r10d
	imull	%eax, %r8d
	addl	%ebx, %r10d
	subl	%r8d, %r10d
	movl	%r10d, %edx
	imulq	$1374389535, %rdx, %rbp
	imulq	%rdi, %rdx
	shrq	$37, %rbp
	shrq	$35, %rdx
	movl	%ebp, %eax
	leal	(%rdx,%rdx,4), %edx
	leaq	(%rcx,%rax,2), %r8
	movl	%r10d, %ecx
	addl	%edx, %edx
	movzwl	(%r8), %eax
	subl	%edx, %ecx
	movl	$1, %edx
	sall	%cl, %edx
	movl	%edx, %ecx
	movswl	%ax, %edx
	andl	%ecx, %edx
	cmpl	%edx, %ecx
	je	.L56
	orw	(%rsp), %ax
	movw	%ax, (%r8)
	movl	%r13d, %eax
	leal	1(%r13), %r8d
	cltd
	idivl	8(%rsp)
	movq	16(%rsp), %rax
	movslq	%edx, %rdx
	leaq	(%rax,%rdx,8), %rax
	movb	%r14b, 4(%rax)
	movl	%r10d, (%rax)
	movl	$1, %r10d
.L29:
	leaq	(%r9,%r9,4), %rax
	leaq	motion(%rip), %rcx
	movl	16(%rcx,%rax,8), %ecx
	testl	%ecx, %ecx
	js	.L58
	jne	.L80
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	32(%rsp)
	cmpl	$1, %eax
	je	.L60
.L34:
	movl	%r11d, %eax
	movl	$9, %edx
	leal	1(%r15), %r13d
	subl	%ecx, %eax
	subl	%ecx, %edx
	cltq
	movslq	%edx, %rcx
	xorl	%edx, %edx
	movl	(%rsi,%rax,4), %ebp
	movl	%ebx, %eax
	divl	(%rsi,%rcx,4)
	movq	24(%rsp), %rcx
	movl	%edx, %eax
	xorl	%edx, %edx
	divl	%ebp
	movl	%r11d, %edx
	subl	%r12d, %edx
	movslq	%edx, %rdx
	movl	(%rsi,%rdx,4), %r10d
	imull	%eax, %r10d
	imull	%eax, %ebp
	addl	%ebx, %r10d
	subl	%ebp, %r10d
	movl	%r10d, %edx
	imulq	$1374389535, %rdx, %rbp
	imulq	%rdi, %rdx
	shrq	$37, %rbp
	shrq	$35, %rdx
	movl	%ebp, %eax
	leal	(%rdx,%rdx,4), %edx
	leaq	(%rcx,%rax,2), %r14
	movl	%r10d, %ecx
	addl	%edx, %edx
	movzwl	(%r14), %eax
	subl	%edx, %ecx
	movl	$1, %edx
	sall	%cl, %edx
	movl	%edx, %ecx
	movswl	%ax, %edx
	andl	%ecx, %edx
	cmpl	%edx, %ecx
	je	.L59
	orw	(%rsp), %ax
	movw	%ax, (%r14)
	movl	%r8d, %eax
	leal	1(%r8), %r14d
	cltd
	idivl	8(%rsp)
	movq	16(%rsp), %rax
	movslq	%edx, %rdx
	leaq	(%rax,%rdx,8), %rax
	movb	%r13b, 4(%rax)
	movl	%r10d, (%rax)
	movl	$1, %r10d
.L33:
	leaq	(%r9,%r9,4), %rax
	leaq	motion(%rip), %rcx
	movl	24(%rcx,%rax,8), %ecx
	testl	%ecx, %ecx
	js	.L61
	jne	.L35
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	32(%rsp)
	cmpl	$1, %eax
	je	.L63
.L37:
	movl	%r11d, %eax
	movl	$9, %edx
	leal	1(%r15), %r10d
	subl	%ecx, %eax
	subl	%ecx, %edx
	cltq
	movslq	%edx, %rcx
	xorl	%edx, %edx
	movl	(%rsi,%rax,4), %r8d
	movl	%ebx, %eax
	divl	(%rsi,%rcx,4)
	movl	%edx, %eax
	xorl	%edx, %edx
	divl	%r8d
	movl	%r11d, %edx
	subl	%r12d, %edx
	movslq	%edx, %rdx
	movl	(%rsi,%rdx,4), %r9d
	imull	%eax, %r9d
	imull	%eax, %r8d
	addl	%ebx, %r9d
	movq	24(%rsp), %rbx
	subl	%r8d, %r9d
	movl	%r9d, %edx
	movl	%r9d, %ecx
	imulq	$1374389535, %rdx, %rbp
	imulq	%rdi, %rdx
	shrq	$37, %rbp
	movl	%ebp, %eax
	shrq	$35, %rdx
	leaq	(%rbx,%rax,2), %r8
	leal	(%rdx,%rdx,4), %edx
	movl	$1, %ebx
	addl	%edx, %edx
	movzwl	(%r8), %eax
	subl	%edx, %ecx
	sall	%cl, %ebx
	movswl	%ax, %edx
	andl	%ebx, %edx
	cmpl	%edx, %ebx
	je	.L64
	orw	(%rsp), %ax
	movw	%ax, (%r8)
	movl	%r14d, %eax
	leal	1(%r14), %r8d
	cltd
	idivl	8(%rsp)
	movq	16(%rsp), %rax
	movslq	%edx, %rdx
	leaq	(%rax,%rdx,8), %rax
	movl	%r9d, (%rax)
	movb	%r10b, 4(%rax)
	movl	$1, %r10d
.L36:
	movl	$4, %r13d
.L22:
	movl	36(%rsp), %eax
	cmpl	%r8d, %eax
	jge	.L79
	cltd
	idivl	8(%rsp)
	movq	16(%rsp), %rax
	movslq	%edx, %rdx
	leaq	(%rax,%rdx,8), %rax
	movl	(%rax), %ebx
	movzbl	4(%rax), %r15d
	movl	$1, %eax
.L39:
	addl	$1, 36(%rsp)
	cmpl	$123456780, %ebx
	je	.L81
	movl	%ebx, %ecx
	imulq	%rdi, %rcx
	shrq	$35, %rcx
	movl	%ecx, %eax
	movl	%ebx, %ecx
	leal	(%rax,%rax,4), %edx
	addl	%edx, %edx
	subl	%edx, %ecx
	je	.L42
	imull	$-858993459, %eax, %edx
	rorl	%edx
	cmpl	$429496729, %edx
	jbe	.L43
	imulq	%rdi, %rax
	shrq	$35, %rax
	imull	$-858993459, %eax, %edx
	rorl	%edx
	cmpl	$429496729, %edx
	jbe	.L44
	movl	%eax, %eax
	imulq	%rdi, %rax
	shrq	$35, %rax
	imull	$-858993459, %eax, %edx
	rorl	%edx
	cmpl	$429496729, %edx
	jbe	.L45
	movl	%eax, %eax
	imulq	%rdi, %rax
	shrq	$35, %rax
	imull	$-858993459, %eax, %edx
	rorl	%edx
	cmpl	$429496729, %edx
	jbe	.L46
	movl	%eax, %eax
	imulq	%rdi, %rax
	shrq	$35, %rax
	imull	$-858993459, %eax, %edx
	rorl	%edx
	cmpl	$429496729, %edx
	jbe	.L47
	movl	%eax, %eax
	imulq	%rdi, %rax
	shrq	$35, %rax
	imull	$-858993459, %eax, %edx
	rorl	%edx
	cmpl	$429496729, %edx
	jbe	.L48
	movl	%eax, %eax
	imulq	%rdi, %rax
	shrq	$35, %rax
	imull	$-858993459, %eax, %edx
	rorl	%edx
	cmpl	$429496729, %edx
	jbe	.L49
	movl	%eax, %eax
	imulq	%rdi, %rax
	shrq	$35, %rax
	imull	$-858993459, %eax, %eax
	rorl	%eax
	cmpl	$429496729, %eax
	jbe	.L50
	movl	$1, %eax
	movl	$-1, %r12d
	movq	$-1, %r9
	sall	%cl, %eax
	movl	%eax, (%rsp)
.L21:
	movl	%ebx, %eax
	xorl	%edx, %edx
	xorl	%r14d, %r14d
	divl	32(%rsp)
	cmpl	$1, %eax
	je	.L53
.L25:
	movl	%r11d, %eax
	movl	$9, %edx
	subl	%r14d, %eax
	subl	%r14d, %edx
	cltq
	movslq	%edx, %r14
	xorl	%edx, %edx
	movl	(%rsi,%rax,4), %ecx
	movl	%ebx, %eax
	divl	(%rsi,%r14,4)
	leal	1(%r15), %r14d
	movl	%edx, %eax
	xorl	%edx, %edx
	divl	%ecx
	movl	%r11d, %edx
	subl	%r12d, %edx
	movslq	%edx, %rdx
	movl	(%rsi,%rdx,4), %r10d
	imull	%eax, %r10d
	imull	%ecx, %eax
	movq	24(%rsp), %rcx
	addl	%ebx, %r10d
	subl	%eax, %r10d
	movl	%r10d, %edx
	imulq	$1374389535, %rdx, %rbp
	imulq	%rdi, %rdx
	shrq	$37, %rbp
	shrq	$35, %rdx
	movl	%ebp, %eax
	leal	(%rdx,%rdx,4), %edx
	leaq	(%rcx,%rax,2), %r13
	movl	%r10d, %ecx
	addl	%edx, %edx
	movzwl	0(%r13), %eax
	subl	%edx, %ecx
	movl	$1, %edx
	sall	%cl, %edx
	movl	%edx, %ecx
	movswl	%ax, %edx
	andl	%ecx, %edx
	cmpl	%edx, %ecx
	je	.L52
	orw	(%rsp), %ax
	movw	%ax, 0(%r13)
	movl	%r8d, %eax
	leal	1(%r8), %r13d
	cltd
	idivl	8(%rsp)
	movq	16(%rsp), %rax
	movslq	%edx, %rdx
	leaq	(%rax,%rdx,8), %rax
	movb	%r14b, 4(%rax)
	movl	%r10d, (%rax)
	movl	$1, %r10d
.L24:
	leaq	(%r9,%r9,4), %rax
	leaq	motion(%rip), %rcx
	movl	8(%rcx,%rax,8), %ecx
	testl	%ecx, %ecx
	js	.L55
	je	.L27
	leal	-1(%rcx), %eax
	cmpl	$1, %eax
	ja	.L30
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	32(%rsp)
	cmpl	$1, %eax
	jne	.L30
	movl	%edx, %eax
	xorl	%edx, %edx
	divl	40(%rsp)
	cmpl	$2, %eax
	jne	.L30
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	40(%rsp)
	movl	%edx, %eax
	xorl	%edx, %edx
	divl	44(%rsp)
	cmpl	$3, %eax
	jne	.L30
.L57:
	movl	%r13d, %r8d
	jmp	.L29
	.p2align 4,,10
	.p2align 3
.L80:
	leal	-1(%rcx), %eax
	cmpl	$1, %eax
	ja	.L34
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	32(%rsp)
	cmpl	$1, %eax
	jne	.L34
	movl	%edx, %eax
	xorl	%edx, %edx
	divl	40(%rsp)
	cmpl	$2, %eax
	jne	.L34
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	40(%rsp)
	movl	%edx, %eax
	xorl	%edx, %edx
	divl	44(%rsp)
	cmpl	$3, %eax
	jne	.L34
.L60:
	movl	%r8d, %r14d
	jmp	.L33
	.p2align 4,,10
	.p2align 3
.L35:
	leal	-1(%rcx), %eax
	cmpl	$1, %eax
	ja	.L37
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	32(%rsp)
	cmpl	$1, %eax
	jne	.L37
	movl	%edx, %eax
	xorl	%edx, %edx
	divl	40(%rsp)
	cmpl	$2, %eax
	jne	.L37
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	40(%rsp)
	movl	%edx, %eax
	xorl	%edx, %edx
	divl	44(%rsp)
	cmpl	$3, %eax
	jne	.L37
.L63:
	movl	%r14d, %r8d
	jmp	.L36
	.p2align 4,,10
	.p2align 3
.L52:
	movl	%r8d, %r13d
	movl	$1, %r10d
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L56:
	movl	%r13d, %r8d
	movl	$1, %r10d
	jmp	.L29
	.p2align 4,,10
	.p2align 3
.L59:
	movl	%r8d, %r14d
	movl	$1, %r10d
	jmp	.L33
	.p2align 4,,10
	.p2align 3
.L64:
	movl	%r14d, %r8d
	movl	$1, %r10d
	jmp	.L36
.L81:
	testb	%al, %al
	je	.L17
.L79:
	movl	%r13d, 60(%rsp)
.L17:
	testb	%r10b, %r10b
	je	.L19
	movl	%ebp, 68(%rsp)
.L19:
	xorl	%eax, %eax
	movsbl	%r15b, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	72(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L82
	addq	$88, %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
.L42:
	.cfi_restore_state
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L20:
	movl	%r11d, %r12d
	leaq	motion(%rip), %rdx
	xorl	%r13d, %r13d
	subl	%eax, %r12d
	movslq	%r12d, %r9
	leaq	(%r9,%r9,4), %rax
	movl	(%rdx,%rax,8), %r14d
	testl	%r14d, %r14d
	js	.L22
	movl	$1, %eax
	sall	%cl, %eax
	movl	%eax, (%rsp)
	testl	%r14d, %r14d
	je	.L21
	leal	-1(%r14), %eax
	cmpl	$1, %eax
	ja	.L25
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	32(%rsp)
	cmpl	$1, %eax
	jne	.L25
	movl	%edx, %eax
	xorl	%edx, %edx
	divl	40(%rsp)
	cmpl	$2, %eax
	jne	.L25
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	40(%rsp)
	movl	%edx, %eax
	xorl	%edx, %edx
	divl	44(%rsp)
	cmpl	$3, %eax
	jne	.L25
	.p2align 4,,10
	.p2align 3
.L53:
	movl	%r8d, %r13d
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L55:
	movl	%r13d, %r8d
	movl	$1, %r13d
	jmp	.L22
.L58:
	movl	$2, %r13d
	jmp	.L22
.L61:
	movl	%r14d, %r8d
	movl	$3, %r13d
	jmp	.L22
.L43:
	movl	$1, %eax
	jmp	.L20
.L44:
	movl	$2, %eax
	jmp	.L20
.L45:
	movl	$3, %eax
	jmp	.L20
.L46:
	movl	$4, %eax
	jmp	.L20
.L47:
	movl	$5, %eax
	jmp	.L20
.L48:
	movl	$6, %eax
	jmp	.L20
.L49:
	movl	$7, %eax
	jmp	.L20
.L50:
	movl	$8, %eax
	jmp	.L20
.L82:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.size	main, .-main
	.globl	sq
	.data
	.align 32
	.type	sq, @object
	.size	sq, 40
sq:
	.long	1
	.long	10
	.long	100
	.long	1000
	.long	10000
	.long	100000
	.long	1000000
	.long	10000000
	.long	100000000
	.long	1000000000
	.globl	motion
	.section	.rodata
	.align 32
	.type	motion, @object
	.size	motion, 360
motion:
	.long	1
	.long	2
	.long	3
	.long	0
	.long	-1
	.zero	4
	.zero	16
	.long	0
	.long	3
	.long	2
	.long	2
	.long	4
	.long	0
	.long	-1
	.zero	4
	.zero	8
	.long	1
	.long	3
	.long	5
	.long	0
	.long	-1
	.zero	4
	.zero	16
	.long	0
	.long	1
	.long	4
	.long	2
	.long	6
	.long	0
	.long	-1
	.zero	4
	.zero	8
	.long	1
	.long	1
	.long	5
	.long	2
	.long	7
	.long	0
	.long	3
	.long	3
	.long	-1
	.zero	4
	.long	2
	.long	1
	.long	8
	.long	0
	.long	4
	.long	3
	.long	-1
	.zero	4
	.zero	8
	.long	3
	.long	1
	.long	7
	.long	2
	.long	-1
	.zero	4
	.zero	16
	.long	4
	.long	1
	.long	8
	.long	2
	.long	6
	.long	3
	.long	-1
	.zero	4
	.zero	8
	.long	5
	.long	1
	.long	7
	.long	3
	.long	-1
	.zero	4
	.zero	16
	.globl	qlen
	.data
	.align 4
	.type	qlen, @object
	.size	qlen, 4
qlen:
	.long	32202
	.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	findzero
	.type	findzero, @function
findzero:
.LFB51:
	.cfi_startproc
	endbr64
	imull	$-858993459, %edi, %eax
	rorl	%eax
	cmpl	$429496729, %eax
	jbe	.L4
	movl	%edi, %edi
	movl	$3435973837, %eax
	imulq	%rax, %rdi
	shrq	$35, %rdi
	imull	$-858993459, %edi, %edx
	rorl	%edx
	cmpl	$429496729, %edx
	jbe	.L5
	movl	%edi, %edi
	imulq	%rax, %rdi
	shrq	$35, %rdi
	imull	$-858993459, %edi, %edx
	rorl	%edx
	cmpl	$429496729, %edx
	jbe	.L6
	movl	%edi, %edi
	imulq	%rax, %rdi
	shrq	$35, %rdi
	imull	$-858993459, %edi, %edx
	rorl	%edx
	cmpl	$429496729, %edx
	jbe	.L7
	movl	%edi, %edi
	imulq	%rax, %rdi
	shrq	$35, %rdi
	imull	$-858993459, %edi, %edx
	rorl	%edx
	cmpl	$429496729, %edx
	jbe	.L8
	movl	%edi, %edi
	imulq	%rax, %rdi
	shrq	$35, %rdi
	imull	$-858993459, %edi, %edx
	rorl	%edx
	cmpl	$429496729, %edx
	jbe	.L9
	movl	%edi, %edi
	imulq	%rax, %rdi
	shrq	$35, %rdi
	imull	$-858993459, %edi, %edx
	rorl	%edx
	cmpl	$429496729, %edx
	jbe	.L10
	movl	%edi, %edi
	imulq	%rax, %rdi
	shrq	$35, %rdi
	imull	$-858993459, %edi, %edx
	rorl	%edx
	cmpl	$429496729, %edx
	jbe	.L11
	movl	%edi, %edx
	imulq	%rax, %rdx
	movl	$-1, %eax
	shrq	$35, %rdx
	imull	$-858993459, %edx, %edx
	rorl	%edx
	cmpl	$429496729, %edx
	jbe	.L14
	ret
.L4:
	xorl	%edx, %edx
.L2:
	movl	$8, %eax
	subl	%edx, %eax
	ret
.L5:
	movl	$1, %edx
	jmp	.L2
.L14:
	movl	$8, %edx
	jmp	.L2
.L6:
	movl	$2, %edx
	jmp	.L2
.L7:
	movl	$3, %edx
	jmp	.L2
.L8:
	movl	$4, %edx
	jmp	.L2
.L9:
	movl	$5, %edx
	jmp	.L2
.L10:
	movl	$6, %edx
	jmp	.L2
.L11:
	movl	$7, %edx
	jmp	.L2
	.cfi_endproc
.LFE51:
	.size	findzero, .-findzero
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d %d\n"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	.LC0(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%r14, %rsi
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$88, %rsp
	.cfi_def_cfa_offset 144
	movq	stdin(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 72(%rsp)
	xorl	%eax, %eax
	leaq	60(%rsp), %r15
	leaq	68(%rsp), %r8
	leaq	64(%rsp), %rcx
	movq	%r15, %rdx
	movq	%r8, 8(%rsp)
	movq	%rcx, (%rsp)
	call	__isoc99_fscanf@PLT
	movq	8(%rsp), %r8
	movq	%r15, %rdx
	movq	%r14, %rsi
	movl	32+sq(%rip), %ebx
	movl	28+sq(%rip), %eax
	imull	60(%rsp), %ebx
	movq	(%rsp), %rcx
	imull	64(%rsp), %eax
	movq	stdin(%rip), %rdi
	addl	%eax, %ebx
	movl	24+sq(%rip), %eax
	imull	68(%rsp), %eax
	addl	%eax, %ebx
	xorl	%eax, %eax
	call	__isoc99_fscanf@PLT
	movq	8(%rsp), %r8
	movq	%r15, %rdx
	movq	%r14, %rsi
	movl	20+sq(%rip), %r12d
	imull	60(%rsp), %r12d
	xorl	%r15d, %r15d
	movl	16+sq(%rip), %eax
	imull	64(%rsp), %eax
	movq	(%rsp), %rcx
	movq	stdin(%rip), %rdi
	addl	%ebx, %r12d
	addl	%eax, %r12d
	movl	12+sq(%rip), %eax
	imull	68(%rsp), %eax
	addl	%eax, %r12d
	xorl	%eax, %eax
	call	__isoc99_fscanf@PLT
	imull	$100, 60(%rsp), %edx
	movl	64(%rsp), %eax
	movl	$1, %esi
	movl	$17530864, %edi
	leal	(%rax,%rax,4), %eax
	leal	(%rdx,%rax,2), %ebx
	addl	68(%rsp), %ebx
	call	calloc@PLT
	movslq	qlen(%rip), %rdi
	addl	%r12d, %ebx
	movl	$8765432, 60(%rsp)
	movq	%rax, 24(%rsp)
	movl	%edi, 8(%rsp)
	salq	$3, %rdi
	call	malloc@PLT
	movl	$0, 36(%rsp)
	xorl	%r10d, %r10d
	movl	$1, %r8d
	movq	%rax, 16(%rsp)
	movl	$3435973837, %edi
	leaq	sq(%rip), %rsi
	movl	$8, %r11d
	movl	%ebx, (%rax)
	movb	$0, 4(%rax)
	movl	32+sq(%rip), %eax
	movl	%eax, 32(%rsp)
	movl	28+sq(%rip), %eax
	movl	%eax, 40(%rsp)
	movl	24+sq(%rip), %eax
	movl	%eax, 44(%rsp)
	xorl	%eax, %eax
	jmp	.L39
	.p2align 4,,10
	.p2align 3
.L27:
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	32(%rsp)
	cmpl	$1, %eax
	je	.L57
.L30:
	movl	%r11d, %eax
	movl	$9, %edx
	leal	1(%r15), %r14d
	subl	%ecx, %eax
	subl	%ecx, %edx
	cltq
	movslq	%edx, %rcx
	xorl	%edx, %edx
	movl	(%rsi,%rax,4), %r8d
	movl	%ebx, %eax
	divl	(%rsi,%rcx,4)
	movq	24(%rsp), %rcx
	movl	%edx, %eax
	xorl	%edx, %edx
	divl	%r8d
	movl	%r11d, %edx
	subl	%r12d, %edx
	movslq	%edx, %rdx
	movl	(%rsi,%rdx,4), %r10d
	imull	%eax, %r10d
	imull	%eax, %r8d
	addl	%ebx, %r10d
	subl	%r8d, %r10d
	movl	%r10d, %edx
	imulq	$1374389535, %rdx, %rbp
	imulq	%rdi, %rdx
	shrq	$37, %rbp
	shrq	$35, %rdx
	movl	%ebp, %eax
	leal	(%rdx,%rdx,4), %edx
	leaq	(%rcx,%rax,2), %r8
	movl	%r10d, %ecx
	addl	%edx, %edx
	movzwl	(%r8), %eax
	subl	%edx, %ecx
	movl	$1, %edx
	sall	%cl, %edx
	movl	%edx, %ecx
	movswl	%ax, %edx
	andl	%ecx, %edx
	cmpl	%edx, %ecx
	je	.L56
	orw	(%rsp), %ax
	movw	%ax, (%r8)
	movl	%r13d, %eax
	leal	1(%r13), %r8d
	cltd
	idivl	8(%rsp)
	movq	16(%rsp), %rax
	movslq	%edx, %rdx
	leaq	(%rax,%rdx,8), %rax
	movb	%r14b, 4(%rax)
	movl	%r10d, (%rax)
	movl	$1, %r10d
.L29:
	leaq	(%r9,%r9,4), %rax
	leaq	motion(%rip), %rcx
	movl	16(%rcx,%rax,8), %ecx
	testl	%ecx, %ecx
	js	.L58
	jne	.L80
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	32(%rsp)
	cmpl	$1, %eax
	je	.L60
.L34:
	movl	%r11d, %eax
	movl	$9, %edx
	leal	1(%r15), %r13d
	subl	%ecx, %eax
	subl	%ecx, %edx
	cltq
	movslq	%edx, %rcx
	xorl	%edx, %edx
	movl	(%rsi,%rax,4), %ebp
	movl	%ebx, %eax
	divl	(%rsi,%rcx,4)
	movq	24(%rsp), %rcx
	movl	%edx, %eax
	xorl	%edx, %edx
	divl	%ebp
	movl	%r11d, %edx
	subl	%r12d, %edx
	movslq	%edx, %rdx
	movl	(%rsi,%rdx,4), %r10d
	imull	%eax, %r10d
	imull	%eax, %ebp
	addl	%ebx, %r10d
	subl	%ebp, %r10d
	movl	%r10d, %edx
	imulq	$1374389535, %rdx, %rbp
	imulq	%rdi, %rdx
	shrq	$37, %rbp
	shrq	$35, %rdx
	movl	%ebp, %eax
	leal	(%rdx,%rdx,4), %edx
	leaq	(%rcx,%rax,2), %r14
	movl	%r10d, %ecx
	addl	%edx, %edx
	movzwl	(%r14), %eax
	subl	%edx, %ecx
	movl	$1, %edx
	sall	%cl, %edx
	movl	%edx, %ecx
	movswl	%ax, %edx
	andl	%ecx, %edx
	cmpl	%edx, %ecx
	je	.L59
	orw	(%rsp), %ax
	movw	%ax, (%r14)
	movl	%r8d, %eax
	leal	1(%r8), %r14d
	cltd
	idivl	8(%rsp)
	movq	16(%rsp), %rax
	movslq	%edx, %rdx
	leaq	(%rax,%rdx,8), %rax
	movb	%r13b, 4(%rax)
	movl	%r10d, (%rax)
	movl	$1, %r10d
.L33:
	leaq	(%r9,%r9,4), %rax
	leaq	motion(%rip), %rcx
	movl	24(%rcx,%rax,8), %ecx
	testl	%ecx, %ecx
	js	.L61
	jne	.L35
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	32(%rsp)
	cmpl	$1, %eax
	je	.L63
.L37:
	movl	%r11d, %eax
	movl	$9, %edx
	leal	1(%r15), %r10d
	subl	%ecx, %eax
	subl	%ecx, %edx
	cltq
	movslq	%edx, %rcx
	xorl	%edx, %edx
	movl	(%rsi,%rax,4), %r8d
	movl	%ebx, %eax
	divl	(%rsi,%rcx,4)
	movl	%edx, %eax
	xorl	%edx, %edx
	divl	%r8d
	movl	%r11d, %edx
	subl	%r12d, %edx
	movslq	%edx, %rdx
	movl	(%rsi,%rdx,4), %r9d
	imull	%eax, %r9d
	imull	%eax, %r8d
	addl	%ebx, %r9d
	movq	24(%rsp), %rbx
	subl	%r8d, %r9d
	movl	%r9d, %edx
	movl	%r9d, %ecx
	imulq	$1374389535, %rdx, %rbp
	imulq	%rdi, %rdx
	shrq	$37, %rbp
	movl	%ebp, %eax
	shrq	$35, %rdx
	leaq	(%rbx,%rax,2), %r8
	leal	(%rdx,%rdx,4), %edx
	movl	$1, %ebx
	addl	%edx, %edx
	movzwl	(%r8), %eax
	subl	%edx, %ecx
	sall	%cl, %ebx
	movswl	%ax, %edx
	andl	%ebx, %edx
	cmpl	%edx, %ebx
	je	.L64
	orw	(%rsp), %ax
	movw	%ax, (%r8)
	movl	%r14d, %eax
	leal	1(%r14), %r8d
	cltd
	idivl	8(%rsp)
	movq	16(%rsp), %rax
	movslq	%edx, %rdx
	leaq	(%rax,%rdx,8), %rax
	movl	%r9d, (%rax)
	movb	%r10b, 4(%rax)
	movl	$1, %r10d
.L36:
	movl	$4, %r13d
.L22:
	movl	36(%rsp), %eax
	cmpl	%r8d, %eax
	jge	.L79
	cltd
	idivl	8(%rsp)
	movq	16(%rsp), %rax
	movslq	%edx, %rdx
	leaq	(%rax,%rdx,8), %rax
	movl	(%rax), %ebx
	movzbl	4(%rax), %r15d
	movl	$1, %eax
.L39:
	addl	$1, 36(%rsp)
	cmpl	$123456780, %ebx
	je	.L81
	movl	%ebx, %ecx
	imulq	%rdi, %rcx
	shrq	$35, %rcx
	movl	%ecx, %eax
	movl	%ebx, %ecx
	leal	(%rax,%rax,4), %edx
	addl	%edx, %edx
	subl	%edx, %ecx
	je	.L42
	imull	$-858993459, %eax, %edx
	rorl	%edx
	cmpl	$429496729, %edx
	jbe	.L43
	imulq	%rdi, %rax
	shrq	$35, %rax
	imull	$-858993459, %eax, %edx
	rorl	%edx
	cmpl	$429496729, %edx
	jbe	.L44
	movl	%eax, %eax
	imulq	%rdi, %rax
	shrq	$35, %rax
	imull	$-858993459, %eax, %edx
	rorl	%edx
	cmpl	$429496729, %edx
	jbe	.L45
	movl	%eax, %eax
	imulq	%rdi, %rax
	shrq	$35, %rax
	imull	$-858993459, %eax, %edx
	rorl	%edx
	cmpl	$429496729, %edx
	jbe	.L46
	movl	%eax, %eax
	imulq	%rdi, %rax
	shrq	$35, %rax
	imull	$-858993459, %eax, %edx
	rorl	%edx
	cmpl	$429496729, %edx
	jbe	.L47
	movl	%eax, %eax
	imulq	%rdi, %rax
	shrq	$35, %rax
	imull	$-858993459, %eax, %edx
	rorl	%edx
	cmpl	$429496729, %edx
	jbe	.L48
	movl	%eax, %eax
	imulq	%rdi, %rax
	shrq	$35, %rax
	imull	$-858993459, %eax, %edx
	rorl	%edx
	cmpl	$429496729, %edx
	jbe	.L49
	movl	%eax, %eax
	imulq	%rdi, %rax
	shrq	$35, %rax
	imull	$-858993459, %eax, %eax
	rorl	%eax
	cmpl	$429496729, %eax
	jbe	.L50
	movl	$1, %eax
	movl	$-1, %r12d
	movq	$-1, %r9
	sall	%cl, %eax
	movl	%eax, (%rsp)
.L21:
	movl	%ebx, %eax
	xorl	%edx, %edx
	xorl	%r14d, %r14d
	divl	32(%rsp)
	cmpl	$1, %eax
	je	.L53
.L25:
	movl	%r11d, %eax
	movl	$9, %edx
	subl	%r14d, %eax
	subl	%r14d, %edx
	cltq
	movslq	%edx, %r14
	xorl	%edx, %edx
	movl	(%rsi,%rax,4), %ecx
	movl	%ebx, %eax
	divl	(%rsi,%r14,4)
	leal	1(%r15), %r14d
	movl	%edx, %eax
	xorl	%edx, %edx
	divl	%ecx
	movl	%r11d, %edx
	subl	%r12d, %edx
	movslq	%edx, %rdx
	movl	(%rsi,%rdx,4), %r10d
	imull	%eax, %r10d
	imull	%ecx, %eax
	movq	24(%rsp), %rcx
	addl	%ebx, %r10d
	subl	%eax, %r10d
	movl	%r10d, %edx
	imulq	$1374389535, %rdx, %rbp
	imulq	%rdi, %rdx
	shrq	$37, %rbp
	shrq	$35, %rdx
	movl	%ebp, %eax
	leal	(%rdx,%rdx,4), %edx
	leaq	(%rcx,%rax,2), %r13
	movl	%r10d, %ecx
	addl	%edx, %edx
	movzwl	0(%r13), %eax
	subl	%edx, %ecx
	movl	$1, %edx
	sall	%cl, %edx
	movl	%edx, %ecx
	movswl	%ax, %edx
	andl	%ecx, %edx
	cmpl	%edx, %ecx
	je	.L52
	orw	(%rsp), %ax
	movw	%ax, 0(%r13)
	movl	%r8d, %eax
	leal	1(%r8), %r13d
	cltd
	idivl	8(%rsp)
	movq	16(%rsp), %rax
	movslq	%edx, %rdx
	leaq	(%rax,%rdx,8), %rax
	movb	%r14b, 4(%rax)
	movl	%r10d, (%rax)
	movl	$1, %r10d
.L24:
	leaq	(%r9,%r9,4), %rax
	leaq	motion(%rip), %rcx
	movl	8(%rcx,%rax,8), %ecx
	testl	%ecx, %ecx
	js	.L55
	je	.L27
	leal	-1(%rcx), %eax
	cmpl	$1, %eax
	ja	.L30
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	32(%rsp)
	cmpl	$1, %eax
	jne	.L30
	movl	%edx, %eax
	xorl	%edx, %edx
	divl	40(%rsp)
	cmpl	$2, %eax
	jne	.L30
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	40(%rsp)
	movl	%edx, %eax
	xorl	%edx, %edx
	divl	44(%rsp)
	cmpl	$3, %eax
	jne	.L30
.L57:
	movl	%r13d, %r8d
	jmp	.L29
	.p2align 4,,10
	.p2align 3
.L80:
	leal	-1(%rcx), %eax
	cmpl	$1, %eax
	ja	.L34
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	32(%rsp)
	cmpl	$1, %eax
	jne	.L34
	movl	%edx, %eax
	xorl	%edx, %edx
	divl	40(%rsp)
	cmpl	$2, %eax
	jne	.L34
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	40(%rsp)
	movl	%edx, %eax
	xorl	%edx, %edx
	divl	44(%rsp)
	cmpl	$3, %eax
	jne	.L34
.L60:
	movl	%r8d, %r14d
	jmp	.L33
	.p2align 4,,10
	.p2align 3
.L35:
	leal	-1(%rcx), %eax
	cmpl	$1, %eax
	ja	.L37
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	32(%rsp)
	cmpl	$1, %eax
	jne	.L37
	movl	%edx, %eax
	xorl	%edx, %edx
	divl	40(%rsp)
	cmpl	$2, %eax
	jne	.L37
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	40(%rsp)
	movl	%edx, %eax
	xorl	%edx, %edx
	divl	44(%rsp)
	cmpl	$3, %eax
	jne	.L37
.L63:
	movl	%r14d, %r8d
	jmp	.L36
	.p2align 4,,10
	.p2align 3
.L52:
	movl	%r8d, %r13d
	movl	$1, %r10d
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L56:
	movl	%r13d, %r8d
	movl	$1, %r10d
	jmp	.L29
	.p2align 4,,10
	.p2align 3
.L59:
	movl	%r8d, %r14d
	movl	$1, %r10d
	jmp	.L33
	.p2align 4,,10
	.p2align 3
.L64:
	movl	%r14d, %r8d
	movl	$1, %r10d
	jmp	.L36
.L81:
	testb	%al, %al
	je	.L17
.L79:
	movl	%r13d, 60(%rsp)
.L17:
	testb	%r10b, %r10b
	je	.L19
	movl	%ebp, 68(%rsp)
.L19:
	xorl	%eax, %eax
	movsbl	%r15b, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	72(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L82
	addq	$88, %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
.L42:
	.cfi_restore_state
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L20:
	movl	%r11d, %r12d
	leaq	motion(%rip), %rdx
	xorl	%r13d, %r13d
	subl	%eax, %r12d
	movslq	%r12d, %r9
	leaq	(%r9,%r9,4), %rax
	movl	(%rdx,%rax,8), %r14d
	testl	%r14d, %r14d
	js	.L22
	movl	$1, %eax
	sall	%cl, %eax
	movl	%eax, (%rsp)
	testl	%r14d, %r14d
	je	.L21
	leal	-1(%r14), %eax
	cmpl	$1, %eax
	ja	.L25
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	32(%rsp)
	cmpl	$1, %eax
	jne	.L25
	movl	%edx, %eax
	xorl	%edx, %edx
	divl	40(%rsp)
	cmpl	$2, %eax
	jne	.L25
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	40(%rsp)
	movl	%edx, %eax
	xorl	%edx, %edx
	divl	44(%rsp)
	cmpl	$3, %eax
	jne	.L25
	.p2align 4,,10
	.p2align 3
.L53:
	movl	%r8d, %r13d
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L55:
	movl	%r13d, %r8d
	movl	$1, %r13d
	jmp	.L22
.L58:
	movl	$2, %r13d
	jmp	.L22
.L61:
	movl	%r14d, %r8d
	movl	$3, %r13d
	jmp	.L22
.L43:
	movl	$1, %eax
	jmp	.L20
.L44:
	movl	$2, %eax
	jmp	.L20
.L45:
	movl	$3, %eax
	jmp	.L20
.L46:
	movl	$4, %eax
	jmp	.L20
.L47:
	movl	$5, %eax
	jmp	.L20
.L48:
	movl	$6, %eax
	jmp	.L20
.L49:
	movl	$7, %eax
	jmp	.L20
.L50:
	movl	$8, %eax
	jmp	.L20
.L82:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.size	main, .-main
	.globl	sq
	.data
	.align 32
	.type	sq, @object
	.size	sq, 40
sq:
	.long	1
	.long	10
	.long	100
	.long	1000
	.long	10000
	.long	100000
	.long	1000000
	.long	10000000
	.long	100000000
	.long	1000000000
	.globl	motion
	.section	.rodata
	.align 32
	.type	motion, @object
	.size	motion, 360
motion:
	.long	1
	.long	2
	.long	3
	.long	0
	.long	-1
	.zero	4
	.zero	16
	.long	0
	.long	3
	.long	2
	.long	2
	.long	4
	.long	0
	.long	-1
	.zero	4
	.zero	8
	.long	1
	.long	3
	.long	5
	.long	0
	.long	-1
	.zero	4
	.zero	16
	.long	0
	.long	1
	.long	4
	.long	2
	.long	6
	.long	0
	.long	-1
	.zero	4
	.zero	8
	.long	1
	.long	1
	.long	5
	.long	2
	.long	7
	.long	0
	.long	3
	.long	3
	.long	-1
	.zero	4
	.long	2
	.long	1
	.long	8
	.long	0
	.long	4
	.long	3
	.long	-1
	.zero	4
	.zero	8
	.long	3
	.long	1
	.long	7
	.long	2
	.long	-1
	.zero	4
	.zero	16
	.long	4
	.long	1
	.long	8
	.long	2
	.long	6
	.long	3
	.long	-1
	.zero	4
	.zero	8
	.long	5
	.long	1
	.long	7
	.long	3
	.long	-1
	.zero	4
	.zero	16
	.globl	qlen
	.data
	.align 4
	.type	qlen, @object
	.size	qlen, 4
qlen:
	.long	32202
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

typedef struct {
  unsigned int b;
  char step;
} Board;

int qlen=32202;

typedef enum { U, D, L, R } Direction;

typedef struct {
  int pos;
  Direction dir;
} Motion;

const Motion motion[9][5] =
  {{{1,L},{3,U},{-1}}, {{0,R},{2,L},{4,U},{-1}}, {{1,R},{5,U},{-1}},
   {{0,D},{4,L},{6,U},{-1}}, {{1,D},{5,L},{7,U},{3,R},{-1}},
   {{2,D},{8,U},{4,R},{-1}},
   {{3,D},{7,L},{-1}}, {{4,D},{8,L},{6,R},{-1}}, {{5,D},{7,R},{-1}} };

int findzero(unsigned int b)
{
  for (int i=0; i<9; i++) {
    if (b%10==0) return 8-i;
    b/=10;
  }
  return -1;
}

unsigned int sq[] = {1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000,1000000000 };

#define HISTLEN 8765432

int main()
{
  int i, j, k;
  int qhead, qtail;
  qhead = qtail = 0;
  Board board;
  fscanf(stdin, "%d %d %d\n", &i, &j, &k);
  board.b = i*sq[8]+j*sq[7]+k*sq[6];
  fscanf(stdin, "%d %d %d\n", &i, &j, &k);
  board.b += i*sq[5]+j*sq[4]+k*sq[3];
  fscanf(stdin, "%d %d %d\n", &i, &j, &k);
  board.b += i*100+j*10+k;
  short int *used = (short int*)malloc(sizeof(short int)*HISTLEN);
  for (i=0; i<HISTLEN; i++) used[i]=0;
  Board *Q = (Board*)malloc(sizeof(Board)*qlen);
  board.step=0;
  Q[qhead++] = board;
  
  while (qhead>qtail) {
    board = Q[qtail++ %qlen];
    if (board.b==123456780)   break;
    
    int space = findzero(board.b);
    for (i=0; motion[space][i].pos>=0; i++) {
      Board b = board;
      Motion m = motion[space][i];
      if (m.pos==0 && b.b/sq[8]==1) continue;
      if ((m.pos==1||m.pos==2) && b.b/sq[8]==1&&(b.b%sq[8])/sq[7]==2&&(b.b%sq[7])/sq[6]==3) continue;
      int nn=b.b%sq[8-m.pos+1]/sq[8-m.pos];
      b.b = nn*sq[8-space]+b.b-nn*sq[8-m.pos];
      b.step = board.step+1;
      k=b.b/100;
      if ((used[k] & (1<<(b.b%10)))==(1<<(b.b%10))) continue;
      used[k] |= (1<<(board.b%10));
      Q[qhead++ %qlen] = b;
    }
  }
  printf("%d\n", board.step);
  return 0;
}


1 4 0
5 2 3
7 8 6

20

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

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

typedef struct {
  unsigned int b;
  char step;
} Board;

int qlen=32202;

typedef enum { U, D, L, R } Direction;

typedef struct {
  int pos;
  Direction dir;
} Motion;

const Motion motion[9][5] =
  {{{1,L},{3,U},{-1}}, {{0,R},{2,L},{4,U},{-1}}, {{1,R},{5,U},{-1}},
   {{0,D},{4,L},{6,U},{-1}}, {{1,D},{5,L},{7,U},{3,R},{-1}},
   {{2,D},{8,U},{4,R},{-1}},
   {{3,D},{7,L},{-1}}, {{4,D},{8,L},{6,R},{-1}}, {{5,D},{7,R},{-1}} };

int findzero(unsigned int b)
{
  for (int i=0; i<9; i++) {
    if (b%10==0) return 8-i;
    b/=10;
  }
  return -1;
}

unsigned int sq[] = {1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000,1000000000 };

#define HISTLEN 8765432

int main()
{
  int i, j, k;
  int qhead, qtail;
  qhead = qtail = 0;
  Board board;
  fscanf(stdin, "%d %d %d\n", &i, &j, &k);
  board.b = i*sq[8]+j*sq[7]+k*sq[6];
  fscanf(stdin, "%d %d %d\n", &i, &j, &k);
  board.b += i*sq[5]+j*sq[4]+k*sq[3];
  fscanf(stdin, "%d %d %d\n", &i, &j, &k);
  board.b += i*100+j*10+k;
  short int *used = (short int*)malloc(sizeof(short int)*HISTLEN);
  for (i=0; i<HISTLEN; i++) used[i]=0;
  Board *Q = (Board*)malloc(sizeof(Board)*qlen);
  board.step=0;
  Q[qhead++] = board;
  
  while (qhead>qtail) {
    board = Q[qtail++ %qlen];
    if (board.b==123456780)   break;
    
    int space = findzero(board.b);
    for (i=0; motion[space][i].pos>=0; i++) {
      Board b = board;
      Motion m = motion[space][i];
      if (m.pos==0 && b.b/sq[8]==1) continue;
      if ((m.pos==1||m.pos==2) && b.b/sq[8]==1&&(b.b%sq[8])/sq[7]==2&&(b.b%sq[7])/sq[6]==3) continue;
      int nn=b.b%sq[8-m.pos+1]/sq[8-m.pos];
      b.b = nn*sq[8-space]+b.b-nn*sq[8-m.pos];
      b.step = board.step+1;
      k=b.b/100;
      if ((used[k] & (1<<(b.b%10)))==(1<<(b.b%10))) continue;
      used[k] |= (1<<(board.b%10));
      Q[qhead++ %qlen] = b;
    }
  }
  printf("%d\n", board.step);
  return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	qlen
	.data
	.align 4
	.type	qlen, @object
	.size	qlen, 4
qlen:
	.long	32202
	.globl	motion
	.section	.rodata
	.align 32
	.type	motion, @object
	.size	motion, 360
motion:
	.long	1
	.long	2
	.long	3
	.long	0
	.long	-1
	.zero	4
	.zero	16
	.long	0
	.long	3
	.long	2
	.long	2
	.long	4
	.long	0
	.long	-1
	.zero	4
	.zero	8
	.long	1
	.long	3
	.long	5
	.long	0
	.long	-1
	.zero	4
	.zero	16
	.long	0
	.long	1
	.long	4
	.long	2
	.long	6
	.long	0
	.long	-1
	.zero	4
	.zero	8
	.long	1
	.long	1
	.long	5
	.long	2
	.long	7
	.long	0
	.long	3
	.long	3
	.long	-1
	.zero	4
	.long	2
	.long	1
	.long	8
	.long	0
	.long	4
	.long	3
	.long	-1
	.zero	4
	.zero	8
	.long	3
	.long	1
	.long	7
	.long	2
	.long	-1
	.zero	4
	.zero	16
	.long	4
	.long	1
	.long	8
	.long	2
	.long	6
	.long	3
	.long	-1
	.zero	4
	.zero	8
	.long	5
	.long	1
	.long	7
	.long	3
	.long	-1
	.zero	4
	.zero	16
	.text
	.globl	findzero
	.type	findzero, @function
findzero:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L2
.L5:
	movl	-20(%rbp), %ecx
	movl	%ecx, %edx
	movl	$3435973837, %eax
	imulq	%rdx, %rax
	shrq	$32, %rax
	movl	%eax, %edx
	shrl	$3, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	testl	%edx, %edx
	jne	.L3
	movl	$8, %eax
	subl	-4(%rbp), %eax
	jmp	.L4
.L3:
	movl	-20(%rbp), %eax
	movl	%eax, %edx
	movl	$3435973837, %eax
	imulq	%rdx, %rax
	shrq	$32, %rax
	shrl	$3, %eax
	movl	%eax, -20(%rbp)
	addl	$1, -4(%rbp)
.L2:
	cmpl	$8, -4(%rbp)
	jle	.L5
	movl	$-1, %eax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	findzero, .-findzero
	.globl	sq
	.data
	.align 32
	.type	sq, @object
	.size	sq, 40
sq:
	.long	1
	.long	10
	.long	100
	.long	1000
	.long	10000
	.long	100000
	.long	1000000
	.long	10000000
	.long	100000000
	.long	1000000000
	.section	.rodata
.LC0:
	.string	"%d %d %d\n"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$80, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -60(%rbp)
	movl	-60(%rbp), %eax
	movl	%eax, -64(%rbp)
	movq	stdin(%rip), %rax
	leaq	-68(%rbp), %rsi
	leaq	-72(%rbp), %rcx
	leaq	-76(%rbp), %rdx
	movq	%rsi, %r8
	leaq	.LC0(%rip), %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_fscanf@PLT
	movl	32+sq(%rip), %eax
	movl	-76(%rbp), %edx
	imull	%edx, %eax
	movl	%eax, %ecx
	movl	28+sq(%rip), %eax
	movl	-72(%rbp), %edx
	imull	%edx, %eax
	addl	%eax, %ecx
	movl	24+sq(%rip), %eax
	movl	-68(%rbp), %edx
	imull	%edx, %eax
	addl	%ecx, %eax
	movl	%eax, -32(%rbp)
	movq	stdin(%rip), %rax
	leaq	-68(%rbp), %rsi
	leaq	-72(%rbp), %rcx
	leaq	-76(%rbp), %rdx
	movq	%rsi, %r8
	leaq	.LC0(%rip), %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_fscanf@PLT
	movl	-32(%rbp), %ecx
	movl	20+sq(%rip), %eax
	movl	-76(%rbp), %edx
	imull	%edx, %eax
	movl	%eax, %esi
	movl	16+sq(%rip), %eax
	movl	-72(%rbp), %edx
	imull	%edx, %eax
	addl	%eax, %esi
	movl	12+sq(%rip), %eax
	movl	-68(%rbp), %edx
	imull	%edx, %eax
	addl	%esi, %eax
	addl	%ecx, %eax
	movl	%eax, -32(%rbp)
	movq	stdin(%rip), %rax
	leaq	-68(%rbp), %rsi
	leaq	-72(%rbp), %rcx
	leaq	-76(%rbp), %rdx
	movq	%rsi, %r8
	leaq	.LC0(%rip), %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_fscanf@PLT
	movl	-32(%rbp), %ecx
	movl	-76(%rbp), %eax
	imull	$100, %eax, %esi
	movl	-72(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	leal	(%rsi,%rax), %edx
	movl	-68(%rbp), %eax
	addl	%edx, %eax
	addl	%ecx, %eax
	movl	%eax, -32(%rbp)
	movl	$17530864, %edi
	call	malloc@PLT
	movq	%rax, -48(%rbp)
	movl	$0, -76(%rbp)
	jmp	.L7
.L8:
	movl	-76(%rbp), %eax
	cltq
	leaq	(%rax,%rax), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movw	$0, (%rax)
	movl	-76(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -76(%rbp)
.L7:
	movl	-76(%rbp), %eax
	cmpl	$8765431, %eax
	jle	.L8
	movl	qlen(%rip), %eax
	cltq
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -40(%rbp)
	movb	$0, -28(%rbp)
	movl	-64(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -64(%rbp)
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rax, %rdx
	movq	-32(%rbp), %rax
	movq	%rax, (%rdx)
	jmp	.L9
.L20:
	movl	-60(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -60(%rbp)
	movl	qlen(%rip), %ecx
	cltd
	idivl	%ecx
	movl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movl	-32(%rbp), %eax
	cmpl	$123456780, %eax
	je	.L23
	movl	-32(%rbp), %eax
	movl	%eax, %edi
	call	findzero
	movl	%eax, -56(%rbp)
	movl	$0, -76(%rbp)
	jmp	.L12
.L19:
	movq	-32(%rbp), %rax
	movq	%rax, -24(%rbp)
	movl	-76(%rbp), %eax
	movslq	%eax, %rcx
	movl	-56(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	motion(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, -16(%rbp)
	movl	-16(%rbp), %eax
	testl	%eax, %eax
	jne	.L13
	movl	-24(%rbp), %eax
	movl	32+sq(%rip), %edi
	movl	$0, %edx
	divl	%edi
	cmpl	$1, %eax
	je	.L24
.L13:
	movl	-16(%rbp), %eax
	cmpl	$1, %eax
	je	.L15
	movl	-16(%rbp), %eax
	cmpl	$2, %eax
	jne	.L16
.L15:
	movl	-24(%rbp), %eax
	movl	32+sq(%rip), %edi
	movl	$0, %edx
	divl	%edi
	cmpl	$1, %eax
	jne	.L16
	movl	-24(%rbp), %eax
	movl	32+sq(%rip), %ecx
	movl	$0, %edx
	divl	%ecx
	movl	%edx, %eax
	movl	28+sq(%rip), %edi
	movl	$0, %edx
	divl	%edi
	cmpl	$2, %eax
	jne	.L16
	movl	-24(%rbp), %eax
	movl	28+sq(%rip), %ecx
	movl	$0, %edx
	divl	%ecx
	movl	%edx, %eax
	movl	24+sq(%rip), %edi
	movl	$0, %edx
	divl	%edi
	cmpl	$3, %eax
	je	.L25
.L16:
	movl	-24(%rbp), %eax
	movl	-16(%rbp), %ecx
	movl	$9, %edx
	subl	%ecx, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	sq(%rip), %rdx
	movl	(%rcx,%rdx), %ecx
	movl	$0, %edx
	divl	%ecx
	movl	%edx, %ecx
	movl	-16(%rbp), %edx
	movl	$8, %eax
	subl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	sq(%rip), %rax
	movl	(%rdx,%rax), %edi
	movl	%ecx, %eax
	movl	$0, %edx
	divl	%edi
	movl	%eax, -52(%rbp)
	movl	$8, %eax
	subl	-56(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	sq(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-52(%rbp), %eax
	imull	%eax, %edx
	movl	-24(%rbp), %eax
	leal	(%rdx,%rax), %ecx
	movl	-16(%rbp), %edx
	movl	$8, %eax
	subl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	sq(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-52(%rbp), %eax
	imull	%eax, %edx
	movl	%ecx, %eax
	subl	%edx, %eax
	movl	%eax, -24(%rbp)
	movzbl	-28(%rbp), %eax
	addl	$1, %eax
	movb	%al, -20(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, %eax
	imulq	$1374389535, %rax, %rax
	shrq	$32, %rax
	shrl	$5, %eax
	movl	%eax, -68(%rbp)
	movl	-68(%rbp), %eax
	cltq
	leaq	(%rax,%rax), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movzwl	(%rax), %eax
	movswl	%ax, %esi
	movl	-24(%rbp), %ecx
	movl	%ecx, %edx
	movl	$3435973837, %eax
	imulq	%rdx, %rax
	shrq	$32, %rax
	movl	%eax, %edx
	shrl	$3, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	movl	$1, %eax
	movl	%edx, %ecx
	sall	%cl, %eax
	andl	%eax, %esi
	movl	-24(%rbp), %ecx
	movl	%ecx, %edx
	movl	$3435973837, %eax
	imulq	%rdx, %rax
	shrq	$32, %rax
	movl	%eax, %edx
	shrl	$3, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	movl	$1, %eax
	movl	%edx, %ecx
	sall	%cl, %eax
	cmpl	%eax, %esi
	je	.L26
	movl	-68(%rbp), %eax
	cltq
	leaq	(%rax,%rax), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movzwl	(%rax), %esi
	movl	-32(%rbp), %ecx
	movl	%ecx, %edx
	movl	$3435973837, %eax
	imulq	%rdx, %rax
	shrq	$32, %rax
	movl	%eax, %edx
	shrl	$3, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	movl	$1, %eax
	movl	%edx, %ecx
	sall	%cl, %eax
	movl	%eax, %ecx
	movl	-68(%rbp), %eax
	cltq
	leaq	(%rax,%rax), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	orl	%ecx, %esi
	movl	%esi, %edx
	movw	%dx, (%rax)
	movl	-64(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -64(%rbp)
	movl	qlen(%rip), %ecx
	cltd
	idivl	%ecx
	movl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rax, %rdx
	movq	-24(%rbp), %rax
	movq	%rax, (%rdx)
	jmp	.L18
.L24:
	nop
	jmp	.L18
.L25:
	nop
	jmp	.L18
.L26:
	nop
.L18:
	movl	-76(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -76(%rbp)
.L12:
	movl	-76(%rbp), %eax
	movslq	%eax, %rcx
	movl	-56(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	motion(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jns	.L19
.L9:
	movl	-64(%rbp), %eax
	cmpl	-60(%rbp), %eax
	jg	.L20
	jmp	.L11
.L23:
	nop
.L11:
	movzbl	-28(%rbp), %eax
	movsbl	%al, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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	qlen
	.data
	.align 4
	.type	qlen, @object
	.size	qlen, 4
qlen:
	.long	32202
	.globl	motion
	.section	.rodata
	.align 32
	.type	motion, @object
	.size	motion, 360
motion:
	.long	1
	.long	2
	.long	3
	.long	0
	.long	-1
	.zero	4
	.zero	16
	.long	0
	.long	3
	.long	2
	.long	2
	.long	4
	.long	0
	.long	-1
	.zero	4
	.zero	8
	.long	1
	.long	3
	.long	5
	.long	0
	.long	-1
	.zero	4
	.zero	16
	.long	0
	.long	1
	.long	4
	.long	2
	.long	6
	.long	0
	.long	-1
	.zero	4
	.zero	8
	.long	1
	.long	1
	.long	5
	.long	2
	.long	7
	.long	0
	.long	3
	.long	3
	.long	-1
	.zero	4
	.long	2
	.long	1
	.long	8
	.long	0
	.long	4
	.long	3
	.long	-1
	.zero	4
	.zero	8
	.long	3
	.long	1
	.long	7
	.long	2
	.long	-1
	.zero	4
	.zero	16
	.long	4
	.long	1
	.long	8
	.long	2
	.long	6
	.long	3
	.long	-1
	.zero	4
	.zero	8
	.long	5
	.long	1
	.long	7
	.long	3
	.long	-1
	.zero	4
	.zero	16
	.text
	.globl	findzero
	.type	findzero, @function
findzero:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L2
.L5:
	movl	-20(%rbp), %ecx
	movl	%ecx, %edx
	movl	$3435973837, %eax
	imulq	%rdx, %rax
	shrq	$32, %rax
	movl	%eax, %edx
	shrl	$3, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	testl	%edx, %edx
	jne	.L3
	movl	$8, %eax
	subl	-4(%rbp), %eax
	jmp	.L4
.L3:
	movl	-20(%rbp), %eax
	movl	%eax, %edx
	movl	$3435973837, %eax
	imulq	%rdx, %rax
	shrq	$32, %rax
	shrl	$3, %eax
	movl	%eax, -20(%rbp)
	addl	$1, -4(%rbp)
.L2:
	cmpl	$8, -4(%rbp)
	jle	.L5
	movl	$-1, %eax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	findzero, .-findzero
	.globl	sq
	.data
	.align 32
	.type	sq, @object
	.size	sq, 40
sq:
	.long	1
	.long	10
	.long	100
	.long	1000
	.long	10000
	.long	100000
	.long	1000000
	.long	10000000
	.long	100000000
	.long	1000000000
	.section	.rodata
.LC0:
	.string	"%d %d %d\n"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$80, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -60(%rbp)
	movl	-60(%rbp), %eax
	movl	%eax, -64(%rbp)
	movq	stdin(%rip), %rax
	leaq	-68(%rbp), %rsi
	leaq	-72(%rbp), %rcx
	leaq	-76(%rbp), %rdx
	movq	%rsi, %r8
	leaq	.LC0(%rip), %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_fscanf@PLT
	movl	32+sq(%rip), %eax
	movl	-76(%rbp), %edx
	imull	%edx, %eax
	movl	%eax, %ecx
	movl	28+sq(%rip), %eax
	movl	-72(%rbp), %edx
	imull	%edx, %eax
	addl	%eax, %ecx
	movl	24+sq(%rip), %eax
	movl	-68(%rbp), %edx
	imull	%edx, %eax
	addl	%ecx, %eax
	movl	%eax, -32(%rbp)
	movq	stdin(%rip), %rax
	leaq	-68(%rbp), %rsi
	leaq	-72(%rbp), %rcx
	leaq	-76(%rbp), %rdx
	movq	%rsi, %r8
	leaq	.LC0(%rip), %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_fscanf@PLT
	movl	-32(%rbp), %ecx
	movl	20+sq(%rip), %eax
	movl	-76(%rbp), %edx
	imull	%edx, %eax
	movl	%eax, %esi
	movl	16+sq(%rip), %eax
	movl	-72(%rbp), %edx
	imull	%edx, %eax
	addl	%eax, %esi
	movl	12+sq(%rip), %eax
	movl	-68(%rbp), %edx
	imull	%edx, %eax
	addl	%esi, %eax
	addl	%ecx, %eax
	movl	%eax, -32(%rbp)
	movq	stdin(%rip), %rax
	leaq	-68(%rbp), %rsi
	leaq	-72(%rbp), %rcx
	leaq	-76(%rbp), %rdx
	movq	%rsi, %r8
	leaq	.LC0(%rip), %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_fscanf@PLT
	movl	-32(%rbp), %ecx
	movl	-76(%rbp), %eax
	imull	$100, %eax, %esi
	movl	-72(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	leal	(%rsi,%rax), %edx
	movl	-68(%rbp), %eax
	addl	%edx, %eax
	addl	%ecx, %eax
	movl	%eax, -32(%rbp)
	movl	$17530864, %edi
	call	malloc@PLT
	movq	%rax, -48(%rbp)
	movl	$0, -76(%rbp)
	jmp	.L7
.L8:
	movl	-76(%rbp), %eax
	cltq
	leaq	(%rax,%rax), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movw	$0, (%rax)
	movl	-76(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -76(%rbp)
.L7:
	movl	-76(%rbp), %eax
	cmpl	$8765431, %eax
	jle	.L8
	movl	qlen(%rip), %eax
	cltq
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -40(%rbp)
	movb	$0, -28(%rbp)
	movl	-64(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -64(%rbp)
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rax, %rdx
	movq	-32(%rbp), %rax
	movq	%rax, (%rdx)
	jmp	.L9
.L20:
	movl	-60(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -60(%rbp)
	movl	qlen(%rip), %ecx
	cltd
	idivl	%ecx
	movl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movl	-32(%rbp), %eax
	cmpl	$123456780, %eax
	je	.L23
	movl	-32(%rbp), %eax
	movl	%eax, %edi
	call	findzero
	movl	%eax, -56(%rbp)
	movl	$0, -76(%rbp)
	jmp	.L12
.L19:
	movq	-32(%rbp), %rax
	movq	%rax, -24(%rbp)
	movl	-76(%rbp), %eax
	movslq	%eax, %rcx
	movl	-56(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	motion(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, -16(%rbp)
	movl	-16(%rbp), %eax
	testl	%eax, %eax
	jne	.L13
	movl	-24(%rbp), %eax
	movl	32+sq(%rip), %edi
	movl	$0, %edx
	divl	%edi
	cmpl	$1, %eax
	je	.L24
.L13:
	movl	-16(%rbp), %eax
	cmpl	$1, %eax
	je	.L15
	movl	-16(%rbp), %eax
	cmpl	$2, %eax
	jne	.L16
.L15:
	movl	-24(%rbp), %eax
	movl	32+sq(%rip), %edi
	movl	$0, %edx
	divl	%edi
	cmpl	$1, %eax
	jne	.L16
	movl	-24(%rbp), %eax
	movl	32+sq(%rip), %ecx
	movl	$0, %edx
	divl	%ecx
	movl	%edx, %eax
	movl	28+sq(%rip), %edi
	movl	$0, %edx
	divl	%edi
	cmpl	$2, %eax
	jne	.L16
	movl	-24(%rbp), %eax
	movl	28+sq(%rip), %ecx
	movl	$0, %edx
	divl	%ecx
	movl	%edx, %eax
	movl	24+sq(%rip), %edi
	movl	$0, %edx
	divl	%edi
	cmpl	$3, %eax
	je	.L25
.L16:
	movl	-24(%rbp), %eax
	movl	-16(%rbp), %ecx
	movl	$9, %edx
	subl	%ecx, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	sq(%rip), %rdx
	movl	(%rcx,%rdx), %ecx
	movl	$0, %edx
	divl	%ecx
	movl	%edx, %ecx
	movl	-16(%rbp), %edx
	movl	$8, %eax
	subl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	sq(%rip), %rax
	movl	(%rdx,%rax), %edi
	movl	%ecx, %eax
	movl	$0, %edx
	divl	%edi
	movl	%eax, -52(%rbp)
	movl	$8, %eax
	subl	-56(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	sq(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-52(%rbp), %eax
	imull	%eax, %edx
	movl	-24(%rbp), %eax
	leal	(%rdx,%rax), %ecx
	movl	-16(%rbp), %edx
	movl	$8, %eax
	subl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	sq(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-52(%rbp), %eax
	imull	%eax, %edx
	movl	%ecx, %eax
	subl	%edx, %eax
	movl	%eax, -24(%rbp)
	movzbl	-28(%rbp), %eax
	addl	$1, %eax
	movb	%al, -20(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, %eax
	imulq	$1374389535, %rax, %rax
	shrq	$32, %rax
	shrl	$5, %eax
	movl	%eax, -68(%rbp)
	movl	-68(%rbp), %eax
	cltq
	leaq	(%rax,%rax), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movzwl	(%rax), %eax
	movswl	%ax, %esi
	movl	-24(%rbp), %ecx
	movl	%ecx, %edx
	movl	$3435973837, %eax
	imulq	%rdx, %rax
	shrq	$32, %rax
	movl	%eax, %edx
	shrl	$3, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	movl	$1, %eax
	movl	%edx, %ecx
	sall	%cl, %eax
	andl	%eax, %esi
	movl	-24(%rbp), %ecx
	movl	%ecx, %edx
	movl	$3435973837, %eax
	imulq	%rdx, %rax
	shrq	$32, %rax
	movl	%eax, %edx
	shrl	$3, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	movl	$1, %eax
	movl	%edx, %ecx
	sall	%cl, %eax
	cmpl	%eax, %esi
	je	.L26
	movl	-68(%rbp), %eax
	cltq
	leaq	(%rax,%rax), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movzwl	(%rax), %esi
	movl	-32(%rbp), %ecx
	movl	%ecx, %edx
	movl	$3435973837, %eax
	imulq	%rdx, %rax
	shrq	$32, %rax
	movl	%eax, %edx
	shrl	$3, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	movl	$1, %eax
	movl	%edx, %ecx
	sall	%cl, %eax
	movl	%eax, %ecx
	movl	-68(%rbp), %eax
	cltq
	leaq	(%rax,%rax), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	orl	%ecx, %esi
	movl	%esi, %edx
	movw	%dx, (%rax)
	movl	-64(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -64(%rbp)
	movl	qlen(%rip), %ecx
	cltd
	idivl	%ecx
	movl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rax, %rdx
	movq	-24(%rbp), %rax
	movq	%rax, (%rdx)
	jmp	.L18
.L24:
	nop
	jmp	.L18
.L25:
	nop
	jmp	.L18
.L26:
	nop
.L18:
	movl	-76(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -76(%rbp)
.L12:
	movl	-76(%rbp), %eax
	movslq	%eax, %rcx
	movl	-56(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	motion(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jns	.L19
.L9:
	movl	-64(%rbp), %eax
	cmpl	-60(%rbp), %eax
	jg	.L20
	jmp	.L11
.L23:
	nop
.L11:
	movzbl	-28(%rbp), %eax
	movsbl	%al, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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:
