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>

int main(void){

  char inputs[6], tmp[51];
  int inputs_shuffle[51][2], inputs_nr[2], stack[52];
  int loop1, loop2, loop3;

  while(1){
    inputs_nr[0] = '\0';
    inputs_nr[1] = '\0';
    
    for(loop1 = 0; loop1 < 51; loop1++){
      inputs_shuffle[loop1][0] = '\0';
      inputs_shuffle[loop1][1] = '\0';
    }
    for(loop1 = 0; loop1 < 52; loop1++){
      stack[loop1] = '\0';
    }


    while((inputs_nr[0] == '\0') || (inputs_nr[1] == '\0')){ // get <n r>
      //      printf("input 'n r'\n");
      scanf("%d %d", &loop1, &loop2);
      
      inputs_nr[0] = loop1;
      inputs_nr[1] = loop2;
      
    if((inputs_nr[0] == 0) && (inputs_nr[1] == 0)) break;    
      
      if((inputs_nr[0] < 1) || (inputs_nr[0] > 50)){
	//	printf("<n> must be more than 1 and less than 50.\n");
	inputs_nr[0] = '\0';      // 1 <= n <= 50
	inputs_nr[1] = '\0';
      }
      
      if((inputs_nr[1] < 1) || (inputs_nr[1] > 50)){
	//	printf("<r> must be more than 1 and less than 50.\n");
	inputs_nr[1] = '\0';      // 1 <= r <= 50
	inputs_nr[0] = '\0';
      }


    }
    
    if((inputs_nr[0] == 0) && (inputs_nr[1] == 0)) break;    
    
    
    for(loop1 = 0; loop1 < inputs_nr[1]; loop1++){  // get <p c>
      
      //      printf("input 'p c'[%d]\n", loop1 + 1);
      scanf("%d %d", &loop2, &loop3);
      
      inputs_shuffle[loop1][0] = loop2;
      inputs_shuffle[loop1][1] = loop3;
      
      
      if((inputs_shuffle[loop1][0] + inputs_shuffle[loop1][1]) > (inputs_nr[0] + 1)){
	//	printf("(p + c) must be less than (%d + 1)\n", inputs_nr[0]);
	loop1--;   //  (p + c) must be less than (n + 1).
      }
      else if((inputs_shuffle[loop1][0] == 0) && (inputs_shuffle[loop1][1] == 0)){
	break;     //  if ((p == 0) && (c == 0)), escape this loop.
      }
    }
    loop1--;
    if((inputs_shuffle[loop1][0] == 0) && (inputs_shuffle[loop1][1] == 0)){
      break;     //  if ((p == 0) && (c == 0)), escape this loop.
    }

    for(loop1 = 0; loop1 < 52; loop1++){  // make the stack
      if(inputs_nr[0] != 0){
	stack[loop1] = inputs_nr[0];
	inputs_nr[0]--;
      }
      else       stack[loop1] = '\0';
    }
    // stack[0], stack[1], stack[2], .......
    //       n ,      n-1,      n-2, .......
    
    loop1 = 0;
    
    while(((inputs_shuffle[loop1][0] != 0) && (inputs_shuffle[loop1][1] != 0)) && loop1 != 51){
      
      for(loop2 = 0; loop2 < (inputs_shuffle[loop1][0] - 1); loop2++){ //
	tmp[loop2] = stack[loop2];
      }
      
      for(loop3 = 0; loop3 < inputs_shuffle[loop1][1]; loop3++, loop2++){
	stack[loop3] = stack[loop2];
      }
      
      for(loop2 = 0; loop2 < (inputs_shuffle[loop1][0] - 1); loop2++, loop3++){
	stack[loop3] = tmp[loop2];
      }
      
      for(loop2 = 0; loop2 < 52; loop2++){
	tmp[loop2] = '\0';
      }
      
      loop1++;
    }
    
    printf("%d\n", stack[0]);
    
  }
  return 0;
  
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$720, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L36:
	movl	$0, -696(%rbp)
	movl	$0, -692(%rbp)
	movl	$0, -708(%rbp)
	jmp	.L2
.L3:
	movl	-708(%rbp), %eax
	cltq
	movl	$0, -480(%rbp,%rax,8)
	movl	-708(%rbp), %eax
	cltq
	movl	$0, -476(%rbp,%rax,8)
	movl	-708(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -708(%rbp)
.L2:
	movl	-708(%rbp), %eax
	cmpl	$50, %eax
	jle	.L3
	movl	$0, -708(%rbp)
	jmp	.L4
.L5:
	movl	-708(%rbp), %eax
	cltq
	movl	$0, -688(%rbp,%rax,4)
	movl	-708(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -708(%rbp)
.L4:
	movl	-708(%rbp), %eax
	cmpl	$51, %eax
	jle	.L5
	jmp	.L6
.L12:
	leaq	-704(%rbp), %rdx
	leaq	-708(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-708(%rbp), %eax
	movl	%eax, -696(%rbp)
	movl	-704(%rbp), %eax
	movl	%eax, -692(%rbp)
	movl	-696(%rbp), %eax
	testl	%eax, %eax
	jne	.L7
	movl	-692(%rbp), %eax
	testl	%eax, %eax
	je	.L39
.L7:
	movl	-696(%rbp), %eax
	testl	%eax, %eax
	jle	.L9
	movl	-696(%rbp), %eax
	cmpl	$50, %eax
	jle	.L10
.L9:
	movl	$0, -696(%rbp)
	movl	$0, -692(%rbp)
.L10:
	movl	-692(%rbp), %eax
	testl	%eax, %eax
	jle	.L11
	movl	-692(%rbp), %eax
	cmpl	$50, %eax
	jle	.L6
.L11:
	movl	$0, -692(%rbp)
	movl	$0, -696(%rbp)
.L6:
	movl	-696(%rbp), %eax
	testl	%eax, %eax
	je	.L12
	movl	-692(%rbp), %eax
	testl	%eax, %eax
	je	.L12
	jmp	.L8
.L39:
	nop
.L8:
	movl	-696(%rbp), %eax
	testl	%eax, %eax
	jne	.L13
	movl	-692(%rbp), %eax
	testl	%eax, %eax
	je	.L40
.L13:
	movl	$0, -708(%rbp)
	jmp	.L15
.L19:
	leaq	-700(%rbp), %rdx
	leaq	-704(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-708(%rbp), %eax
	movl	-704(%rbp), %edx
	cltq
	movl	%edx, -480(%rbp,%rax,8)
	movl	-708(%rbp), %eax
	movl	-700(%rbp), %edx
	cltq
	movl	%edx, -476(%rbp,%rax,8)
	movl	-708(%rbp), %eax
	cltq
	movl	-480(%rbp,%rax,8), %edx
	movl	-708(%rbp), %eax
	cltq
	movl	-476(%rbp,%rax,8), %eax
	addl	%eax, %edx
	movl	-696(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, %edx
	jle	.L16
	movl	-708(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -708(%rbp)
	jmp	.L17
.L16:
	movl	-708(%rbp), %eax
	cltq
	movl	-480(%rbp,%rax,8), %eax
	testl	%eax, %eax
	jne	.L17
	movl	-708(%rbp), %eax
	cltq
	movl	-476(%rbp,%rax,8), %eax
	testl	%eax, %eax
	je	.L41
.L17:
	movl	-708(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -708(%rbp)
.L15:
	movl	-692(%rbp), %edx
	movl	-708(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L19
	jmp	.L18
.L41:
	nop
.L18:
	movl	-708(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -708(%rbp)
	movl	-708(%rbp), %eax
	cltq
	movl	-480(%rbp,%rax,8), %eax
	testl	%eax, %eax
	jne	.L20
	movl	-708(%rbp), %eax
	cltq
	movl	-476(%rbp,%rax,8), %eax
	testl	%eax, %eax
	je	.L42
.L20:
	movl	$0, -708(%rbp)
	jmp	.L21
.L24:
	movl	-696(%rbp), %eax
	testl	%eax, %eax
	je	.L22
	movl	-708(%rbp), %eax
	movl	-696(%rbp), %edx
	cltq
	movl	%edx, -688(%rbp,%rax,4)
	movl	-696(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -696(%rbp)
	jmp	.L23
.L22:
	movl	-708(%rbp), %eax
	cltq
	movl	$0, -688(%rbp,%rax,4)
.L23:
	movl	-708(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -708(%rbp)
.L21:
	movl	-708(%rbp), %eax
	cmpl	$51, %eax
	jle	.L24
	movl	$0, -708(%rbp)
	jmp	.L25
.L35:
	movl	$0, -704(%rbp)
	jmp	.L26
.L27:
	movl	-704(%rbp), %eax
	cltq
	movl	-688(%rbp,%rax,4), %edx
	movl	-704(%rbp), %eax
	cltq
	movb	%dl, -64(%rbp,%rax)
	movl	-704(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -704(%rbp)
.L26:
	movl	-708(%rbp), %eax
	cltq
	movl	-480(%rbp,%rax,8), %eax
	leal	-1(%rax), %edx
	movl	-704(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L27
	movl	$0, -700(%rbp)
	jmp	.L28
.L29:
	movl	-704(%rbp), %eax
	movl	-700(%rbp), %ecx
	cltq
	movl	-688(%rbp,%rax,4), %edx
	movslq	%ecx, %rax
	movl	%edx, -688(%rbp,%rax,4)
	movl	-700(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -700(%rbp)
	movl	-704(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -704(%rbp)
.L28:
	movl	-708(%rbp), %eax
	cltq
	movl	-476(%rbp,%rax,8), %edx
	movl	-700(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L29
	movl	$0, -704(%rbp)
	jmp	.L30
.L31:
	movl	-704(%rbp), %eax
	cltq
	movzbl	-64(%rbp,%rax), %edx
	movl	-700(%rbp), %eax
	movsbl	%dl, %edx
	cltq
	movl	%edx, -688(%rbp,%rax,4)
	movl	-704(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -704(%rbp)
	movl	-700(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -700(%rbp)
.L30:
	movl	-708(%rbp), %eax
	cltq
	movl	-480(%rbp,%rax,8), %eax
	leal	-1(%rax), %edx
	movl	-704(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L31
	movl	$0, -704(%rbp)
	jmp	.L32
.L33:
	movl	-704(%rbp), %eax
	cltq
	movb	$0, -64(%rbp,%rax)
	movl	-704(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -704(%rbp)
.L32:
	movl	-704(%rbp), %eax
	cmpl	$51, %eax
	jle	.L33
	movl	-708(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -708(%rbp)
.L25:
	movl	-708(%rbp), %eax
	cltq
	movl	-480(%rbp,%rax,8), %eax
	testl	%eax, %eax
	je	.L34
	movl	-708(%rbp), %eax
	cltq
	movl	-476(%rbp,%rax,8), %eax
	testl	%eax, %eax
	je	.L34
	movl	-708(%rbp), %eax
	cmpl	$51, %eax
	jne	.L35
.L34:
	movl	-688(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L36
.L40:
	nop
	jmp	.L14
.L42:
	nop
.L14:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L38
	call	__stack_chk_fail@PLT
.L38:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	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
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$760, %rsp
	.cfi_def_cfa_offset 816
	movq	%fs:40, %rax
	movq	%rax, 744(%rsp)
	xorl	%eax, %eax
	leaq	672(%rsp), %rax
	leaq	272(%rsp), %rbx
	movq	%rax, 40(%rsp)
	leaq	64(%rsp), %rax
	leaq	56(%rsp), %r12
	movq	%rax, 8(%rsp)
	leaq	52(%rsp), %rax
	movq	%rax, 16(%rsp)
	.p2align 4,,10
	.p2align 3
.L33:
	movq	40(%rsp), %rdx
	movq	%rbx, %rax
	pxor	%xmm0, %xmm0
	.p2align 4,,10
	.p2align 3
.L2:
	movaps	%xmm0, (%rax)
	addq	$16, %rax
	cmpq	%rdx, %rax
	jne	.L2
	movq	8(%rsp), %rdi
	xorl	%eax, %eax
	movl	$26, %ecx
	movq	$0, 672(%rsp)
	movl	$52, 52(%rsp)
	movq	16(%rsp), %r13
	rep stosq
.L85:
	xorl	%eax, %eax
	movq	%r12, %rdx
	movq	%r13, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	movl	52(%rsp), %r14d
	movl	56(%rsp), %r15d
	movl	%r14d, %eax
	orl	%r15d, %eax
	je	.L3
	leal	-1(%r14), %eax
	cmpl	$49, %eax
	ja	.L85
	leal	-1(%r15), %eax
	cmpl	$49, %eax
	ja	.L85
	leal	1(%r14), %eax
	leaq	60(%rsp), %r13
	movl	%r14d, 28(%rsp)
	movq	%r12, %r14
	movl	$0, 52(%rsp)
	movl	%r15d, %r12d
	movq	%r13, %r15
	movl	%eax, %r13d
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L111:
	movl	%eax, 52(%rsp)
	leal	-1(%rax), %edx
	cmpl	%eax, %r12d
	jle	.L110
.L9:
	movq	%r15, %rdx
	movq	%r14, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	56(%rsp), %r8d
	movl	60(%rsp), %ecx
	movslq	52(%rsp), %rdx
	movd	%r8d, %xmm0
	movd	%ecx, %xmm6
	punpckldq	%xmm6, %xmm0
	movq	%rdx, %rax
	movq	%xmm0, (%rbx,%rdx,8)
	leal	(%r8,%rcx), %edx
	cmpl	%r13d, %edx
	jg	.L111
	movl	%r8d, %esi
	orl	%ecx, %esi
	je	.L8
	movl	%eax, %edx
	addl	$1, %eax
	movl	%eax, 52(%rsp)
	cmpl	%eax, %r12d
	jg	.L9
.L110:
	movq	%r14, %r12
	movl	28(%rsp), %r14d
.L10:
	movslq	%edx, %rdx
	movl	272(%rsp,%rdx,8), %esi
	testl	%esi, %esi
	jne	.L11
	movl	276(%rsp,%rdx,8), %eax
	testl	%eax, %eax
	je	.L3
.L11:
	movl	%r14d, 64(%rsp)
	movq	8(%rsp), %r9
	movl	%r14d, %edi
	movl	$1, %eax
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L112:
	movl	%edx, (%r9,%rax,4)
	addq	$1, %rax
	cmpq	$52, %rax
	je	.L14
.L13:
	movl	%r14d, %edx
	movslq	%eax, %rsi
	subl	%eax, %edx
	cmpq	%rdi, %rax
	jne	.L112
	movl	$51, %eax
	movl	%ecx, 36(%rsp)
	subl	%esi, %eax
	movl	%r8d, 28(%rsp)
	leaq	4(,%rax,4), %rdx
	movq	8(%rsp), %rax
	leaq	(%rax,%rsi,4), %rdi
	xorl	%esi, %esi
	call	memset@PLT
	movl	36(%rsp), %ecx
	movl	28(%rsp), %r8d
.L14:
	movl	$1, %edi
	pxor	%xmm3, %xmm3
	pxor	%xmm2, %xmm2
	xorl	%eax, %eax
	movl	272(%rsp), %r10d
	movl	$0, 52(%rsp)
	leaq	68(%rsp), %r9
	testl	%r10d, %r10d
	je	.L16
	movl	32(%rsp), %r11d
	movq	8(%rsp), %rsi
	.p2align 4,,10
	.p2align 3
.L15:
	movl	-4(%rbx,%rdi,8), %edx
	testl	%edx, %edx
	je	.L113
	leal	-1(%r10), %ecx
	testl	%ecx, %ecx
	jle	.L17
	leal	-2(%r10), %r11d
	cmpl	$14, %r11d
	jbe	.L38
	movdqa	64(%rsp), %xmm0
	movl	%ecx, %eax
	shrl	$4, %eax
	movdqa	%xmm0, %xmm1
	punpcklwd	80(%rsp), %xmm0
	punpckhwd	80(%rsp), %xmm1
	movdqa	%xmm0, %xmm4
	punpcklwd	%xmm1, %xmm0
	punpckhwd	%xmm1, %xmm4
	movdqa	96(%rsp), %xmm1
	punpcklwd	%xmm4, %xmm0
	pand	.LC1(%rip), %xmm0
	movdqa	%xmm1, %xmm4
	punpcklwd	112(%rsp), %xmm1
	punpckhwd	112(%rsp), %xmm4
	movdqa	%xmm1, %xmm5
	punpcklwd	%xmm4, %xmm1
	punpckhwd	%xmm4, %xmm5
	punpcklwd	%xmm5, %xmm1
	pand	.LC1(%rip), %xmm1
	packuswb	%xmm1, %xmm0
	movaps	%xmm0, 688(%rsp)
	cmpl	$1, %eax
	je	.L19
	movdqa	128(%rsp), %xmm0
	movdqa	%xmm0, %xmm1
	punpcklwd	144(%rsp), %xmm0
	punpckhwd	144(%rsp), %xmm1
	movdqa	%xmm0, %xmm4
	punpcklwd	%xmm1, %xmm0
	punpckhwd	%xmm1, %xmm4
	movdqa	160(%rsp), %xmm1
	punpcklwd	%xmm4, %xmm0
	pand	.LC1(%rip), %xmm0
	movdqa	%xmm1, %xmm4
	punpcklwd	176(%rsp), %xmm1
	punpckhwd	176(%rsp), %xmm4
	movdqa	%xmm1, %xmm5
	punpcklwd	%xmm4, %xmm1
	punpckhwd	%xmm4, %xmm5
	punpcklwd	%xmm5, %xmm1
	pand	.LC1(%rip), %xmm1
	packuswb	%xmm1, %xmm0
	movaps	%xmm0, 704(%rsp)
	cmpl	$2, %eax
	je	.L19
	movdqa	192(%rsp), %xmm0
	movdqa	%xmm0, %xmm1
	punpcklwd	208(%rsp), %xmm0
	punpckhwd	208(%rsp), %xmm1
	movdqa	%xmm0, %xmm4
	punpcklwd	%xmm1, %xmm0
	punpckhwd	%xmm1, %xmm4
	movdqa	224(%rsp), %xmm1
	punpcklwd	%xmm4, %xmm0
	pand	.LC1(%rip), %xmm0
	movdqa	%xmm1, %xmm4
	punpcklwd	240(%rsp), %xmm1
	punpckhwd	240(%rsp), %xmm4
	movdqa	%xmm1, %xmm5
	punpcklwd	%xmm4, %xmm1
	punpckhwd	%xmm4, %xmm5
	punpcklwd	%xmm5, %xmm1
	pand	.LC1(%rip), %xmm1
	packuswb	%xmm1, %xmm0
	movaps	%xmm0, 720(%rsp)
.L19:
	movl	%ecx, %eax
	andl	$-16, %eax
	testb	$15, %cl
	je	.L20
.L18:
	movslq	%eax, %r8
	movl	64(%rsp,%r8,4), %r13d
	movb	%r13b, 688(%rsp,%r8)
	leal	1(%rax), %r8d
	cmpl	%r8d, %ecx
	jle	.L20
	movslq	%r8d, %r8
	movl	64(%rsp,%r8,4), %r13d
	movb	%r13b, 688(%rsp,%r8)
	leal	2(%rax), %r8d
	cmpl	%r8d, %ecx
	jle	.L20
	movslq	%r8d, %r8
	movl	64(%rsp,%r8,4), %r13d
	movb	%r13b, 688(%rsp,%r8)
	leal	3(%rax), %r8d
	cmpl	%r8d, %ecx
	jle	.L20
	movslq	%r8d, %r8
	movl	64(%rsp,%r8,4), %r13d
	movb	%r13b, 688(%rsp,%r8)
	leal	4(%rax), %r8d
	cmpl	%r8d, %ecx
	jle	.L20
	movslq	%r8d, %r8
	movl	64(%rsp,%r8,4), %r13d
	movb	%r13b, 688(%rsp,%r8)
	leal	5(%rax), %r8d
	cmpl	%r8d, %ecx
	jle	.L20
	movslq	%r8d, %r8
	movl	64(%rsp,%r8,4), %r13d
	movb	%r13b, 688(%rsp,%r8)
	leal	6(%rax), %r8d
	cmpl	%r8d, %ecx
	jle	.L20
	movslq	%r8d, %r8
	movl	64(%rsp,%r8,4), %r13d
	movb	%r13b, 688(%rsp,%r8)
	leal	7(%rax), %r8d
	cmpl	%r8d, %ecx
	jle	.L20
	movslq	%r8d, %r8
	movl	64(%rsp,%r8,4), %r13d
	movb	%r13b, 688(%rsp,%r8)
	leal	8(%rax), %r8d
	cmpl	%r8d, %ecx
	jle	.L20
	movslq	%r8d, %r8
	movl	64(%rsp,%r8,4), %r13d
	movb	%r13b, 688(%rsp,%r8)
	leal	9(%rax), %r8d
	cmpl	%r8d, %ecx
	jle	.L20
	movslq	%r8d, %r8
	movl	64(%rsp,%r8,4), %r13d
	movb	%r13b, 688(%rsp,%r8)
	leal	10(%rax), %r8d
	cmpl	%r8d, %ecx
	jle	.L20
	movslq	%r8d, %r8
	movl	64(%rsp,%r8,4), %r13d
	movb	%r13b, 688(%rsp,%r8)
	leal	11(%rax), %r8d
	cmpl	%r8d, %ecx
	jle	.L20
	movslq	%r8d, %r8
	movl	64(%rsp,%r8,4), %r13d
	movb	%r13b, 688(%rsp,%r8)
	leal	12(%rax), %r8d
	cmpl	%r8d, %ecx
	jle	.L20
	movslq	%r8d, %r8
	movl	64(%rsp,%r8,4), %r13d
	movb	%r13b, 688(%rsp,%r8)
	leal	13(%rax), %r8d
	cmpl	%r8d, %ecx
	jle	.L20
	movslq	%r8d, %r8
	addl	$14, %eax
	movl	64(%rsp,%r8,4), %r13d
	movb	%r13b, 688(%rsp,%r8)
	cmpl	%eax, %ecx
	jle	.L20
	cltq
	movl	64(%rsp,%rax,4), %r8d
	movb	%r8b, 688(%rsp,%rax)
	.p2align 4,,10
	.p2align 3
.L20:
	testl	%edx, %edx
	jle	.L39
	movslq	%ecx, %r8
.L35:
	leal	-1(%rdx), %r11d
	cmpl	$2, %r11d
	jbe	.L22
	movslq	%r8d, %rax
	movl	%edx, %r11d
	leaq	(%rsi,%rax,4), %rax
	shrl	$2, %r11d
	movdqu	(%rax), %xmm7
	movaps	%xmm7, 64(%rsp)
	cmpl	$1, %r11d
	je	.L23
	movdqu	16(%rax), %xmm7
	movaps	%xmm7, 80(%rsp)
	cmpl	$2, %r11d
	je	.L23
	movdqu	32(%rax), %xmm7
	movaps	%xmm7, 96(%rsp)
	cmpl	$3, %r11d
	je	.L23
	movdqu	48(%rax), %xmm6
	movaps	%xmm6, 112(%rsp)
	cmpl	$4, %r11d
	je	.L23
	movdqu	64(%rax), %xmm7
	movaps	%xmm7, 128(%rsp)
	cmpl	$5, %r11d
	je	.L23
	movdqu	80(%rax), %xmm6
	movaps	%xmm6, 144(%rsp)
	cmpl	$6, %r11d
	je	.L23
	movdqu	96(%rax), %xmm7
	movaps	%xmm7, 160(%rsp)
	cmpl	$7, %r11d
	je	.L23
	movdqu	112(%rax), %xmm7
	movaps	%xmm7, 176(%rsp)
	cmpl	$8, %r11d
	je	.L23
	movdqu	128(%rax), %xmm6
	movaps	%xmm6, 192(%rsp)
	cmpl	$9, %r11d
	je	.L23
	movdqu	144(%rax), %xmm6
	movaps	%xmm6, 208(%rsp)
	cmpl	$10, %r11d
	je	.L23
	movdqu	160(%rax), %xmm7
	movaps	%xmm7, 224(%rsp)
	cmpl	$11, %r11d
	je	.L23
	movdqu	176(%rax), %xmm7
	movaps	%xmm7, 240(%rsp)
	cmpl	$12, %r11d
	je	.L23
	movdqu	192(%rax), %xmm6
	movaps	%xmm6, 256(%rsp)
	.p2align 4,,10
	.p2align 3
.L23:
	movl	%edx, %eax
	andl	$-4, %eax
	addl	%eax, %r8d
	cmpl	%eax, %edx
	je	.L26
	movslq	%r8d, %r11
	movl	64(%rsp,%r11,4), %r13d
	movslq	%eax, %r11
	movl	%r13d, 64(%rsp,%r11,4)
	leal	1(%rax), %r11d
	leal	1(%r8), %r13d
	cmpl	%r11d, %edx
	jle	.L26
	movslq	%r13d, %r13
	movslq	%r11d, %r11
	addl	$2, %eax
	addl	$2, %r8d
	movl	64(%rsp,%r13,4), %r13d
	movl	%r13d, 64(%rsp,%r11,4)
	cmpl	%eax, %edx
	jle	.L26
	movslq	%r8d, %r8
	cltq
	movl	64(%rsp,%r8,4), %r8d
	movl	%r8d, 64(%rsp,%rax,4)
.L26:
	testl	%ecx, %ecx
	jle	.L40
.L114:
	leal	-2(%r10), %r11d
	cmpl	$14, %r11d
	jbe	.L41
.L115:
	movdqa	688(%rsp), %xmm0
	movdqa	%xmm3, %xmm4
	movslq	%edx, %rax
	movl	%ecx, %r8d
	leaq	(%rsi,%rax,4), %rax
	shrl	$4, %r8d
	pcmpgtb	%xmm0, %xmm4
	movdqa	%xmm0, %xmm1
	punpcklbw	%xmm4, %xmm1
	punpckhbw	%xmm4, %xmm0
	movdqa	%xmm2, %xmm4
	pcmpgtw	%xmm1, %xmm4
	movdqa	%xmm1, %xmm5
	punpckhwd	%xmm4, %xmm1
	punpcklwd	%xmm4, %xmm5
	movdqa	%xmm0, %xmm4
	movups	%xmm1, 16(%rax)
	movdqa	%xmm2, %xmm1
	pcmpgtw	%xmm0, %xmm1
	movups	%xmm5, (%rax)
	punpcklwd	%xmm1, %xmm4
	punpckhwd	%xmm1, %xmm0
	movups	%xmm4, 32(%rax)
	movups	%xmm0, 48(%rax)
	cmpl	$1, %r8d
	je	.L29
	movdqa	704(%rsp), %xmm0
	movdqa	%xmm3, %xmm4
	pcmpgtb	%xmm0, %xmm4
	movdqa	%xmm0, %xmm1
	punpcklbw	%xmm4, %xmm1
	punpckhbw	%xmm4, %xmm0
	movdqa	%xmm2, %xmm4
	pcmpgtw	%xmm1, %xmm4
	movdqa	%xmm1, %xmm5
	punpckhwd	%xmm4, %xmm1
	punpcklwd	%xmm4, %xmm5
	movdqa	%xmm0, %xmm4
	movups	%xmm1, 80(%rax)
	movdqa	%xmm2, %xmm1
	pcmpgtw	%xmm0, %xmm1
	movups	%xmm5, 64(%rax)
	punpcklwd	%xmm1, %xmm4
	punpckhwd	%xmm1, %xmm0
	movups	%xmm4, 96(%rax)
	movups	%xmm0, 112(%rax)
	cmpl	$2, %r8d
	je	.L29
	movdqa	720(%rsp), %xmm0
	movdqa	%xmm3, %xmm4
	pcmpgtb	%xmm0, %xmm4
	movdqa	%xmm0, %xmm1
	punpcklbw	%xmm4, %xmm1
	punpckhbw	%xmm4, %xmm0
	movdqa	%xmm2, %xmm4
	pcmpgtw	%xmm1, %xmm4
	movdqa	%xmm1, %xmm5
	punpckhwd	%xmm4, %xmm1
	punpcklwd	%xmm4, %xmm5
	movdqa	%xmm0, %xmm4
	movups	%xmm1, 144(%rax)
	movdqa	%xmm2, %xmm1
	pcmpgtw	%xmm0, %xmm1
	movups	%xmm5, 128(%rax)
	punpcklwd	%xmm1, %xmm4
	punpckhwd	%xmm1, %xmm0
	movups	%xmm4, 160(%rax)
	movups	%xmm0, 176(%rax)
.L29:
	movl	%ecx, %eax
	andl	$-16, %eax
	leal	(%rax,%rdx), %r8d
	cmpl	%eax, %ecx
	je	.L30
.L28:
	movslq	%eax, %r11
	movslq	%r8d, %r10
	movsbl	688(%rsp,%r11), %r11d
	movl	%r11d, 64(%rsp,%r10,4)
	leal	1(%rax), %r10d
	leal	1(%r8), %r11d
	cmpl	%r10d, %ecx
	jle	.L30
	movslq	%r10d, %r10
	movslq	%r11d, %r11
	movsbl	688(%rsp,%r10), %r10d
	movl	%r10d, 64(%rsp,%r11,4)
	leal	2(%rax), %r10d
	leal	2(%r8), %r11d
	cmpl	%ecx, %r10d
	jge	.L30
	movslq	%r10d, %r10
	movslq	%r11d, %r11
	movsbl	688(%rsp,%r10), %r10d
	movl	%r10d, 64(%rsp,%r11,4)
	leal	3(%rax), %r10d
	leal	3(%r8), %r11d
	cmpl	%ecx, %r10d
	jge	.L30
	movslq	%r10d, %r10
	movslq	%r11d, %r11
	movsbl	688(%rsp,%r10), %r10d
	movl	%r10d, 64(%rsp,%r11,4)
	leal	4(%rax), %r10d
	leal	4(%r8), %r11d
	cmpl	%ecx, %r10d
	jge	.L30
	movslq	%r10d, %r10
	movslq	%r11d, %r11
	movsbl	688(%rsp,%r10), %r10d
	movl	%r10d, 64(%rsp,%r11,4)
	leal	5(%rax), %r10d
	leal	5(%r8), %r11d
	cmpl	%r10d, %ecx
	jle	.L30
	movslq	%r10d, %r10
	movslq	%r11d, %r11
	movsbl	688(%rsp,%r10), %r10d
	movl	%r10d, 64(%rsp,%r11,4)
	leal	6(%rax), %r10d
	leal	6(%r8), %r11d
	cmpl	%r10d, %ecx
	jle	.L30
	movslq	%r10d, %r10
	movslq	%r11d, %r11
	movsbl	688(%rsp,%r10), %r10d
	movl	%r10d, 64(%rsp,%r11,4)
	leal	7(%rax), %r10d
	leal	7(%r8), %r11d
	cmpl	%r10d, %ecx
	jle	.L30
	movslq	%r10d, %r10
	movslq	%r11d, %r11
	movsbl	688(%rsp,%r10), %r10d
	movl	%r10d, 64(%rsp,%r11,4)
	leal	8(%rax), %r10d
	leal	8(%r8), %r11d
	cmpl	%r10d, %ecx
	jle	.L30
	movslq	%r10d, %r10
	movslq	%r11d, %r11
	movsbl	688(%rsp,%r10), %r10d
	movl	%r10d, 64(%rsp,%r11,4)
	leal	9(%rax), %r10d
	leal	9(%r8), %r11d
	cmpl	%r10d, %ecx
	jle	.L30
	movslq	%r10d, %r10
	movslq	%r11d, %r11
	movsbl	688(%rsp,%r10), %r10d
	movl	%r10d, 64(%rsp,%r11,4)
	leal	10(%rax), %r10d
	leal	10(%r8), %r11d
	cmpl	%r10d, %ecx
	jle	.L30
	movslq	%r10d, %r10
	movslq	%r11d, %r11
	movsbl	688(%rsp,%r10), %r10d
	movl	%r10d, 64(%rsp,%r11,4)
	leal	11(%rax), %r10d
	leal	11(%r8), %r11d
	cmpl	%r10d, %ecx
	jle	.L30
	movslq	%r10d, %r10
	movslq	%r11d, %r11
	movsbl	688(%rsp,%r10), %r10d
	movl	%r10d, 64(%rsp,%r11,4)
	leal	12(%rax), %r10d
	leal	12(%r8), %r11d
	cmpl	%r10d, %ecx
	jle	.L30
	movslq	%r10d, %r10
	movslq	%r11d, %r11
	movsbl	688(%rsp,%r10), %r10d
	movl	%r10d, 64(%rsp,%r11,4)
	leal	13(%rax), %r10d
	leal	13(%r8), %r11d
	cmpl	%r10d, %ecx
	jle	.L30
	movslq	%r10d, %r10
	movslq	%r11d, %r11
	addl	$14, %eax
	addl	$14, %r8d
	movsbl	688(%rsp,%r10), %r10d
	movl	%r10d, 64(%rsp,%r11,4)
	cmpl	%eax, %ecx
	jle	.L30
	cltq
	movslq	%r8d, %r8
	movsbl	688(%rsp,%rax), %eax
	movl	%eax, 64(%rsp,%r8,4)
	.p2align 4,,10
	.p2align 3
.L30:
	addl	%edx, %ecx
.L27:
	movl	%edi, %r11d
	addq	$1, %rdi
	pxor	%xmm0, %xmm0
	movl	$0, 736(%rsp)
	movl	-8(%rbx,%rdi,8), %r10d
	movaps	%xmm0, 688(%rsp)
	movl	$52, %r8d
	movl	$1, %eax
	movaps	%xmm0, 704(%rsp)
	movaps	%xmm0, 720(%rsp)
	testl	%r10d, %r10d
	jne	.L15
	movl	%r11d, 32(%rsp)
	movl	%r11d, 52(%rsp)
	movl	%ecx, 60(%rsp)
	movl	$52, 56(%rsp)
.L16:
	movl	64(%rsp), %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L33
	.p2align 4,,10
	.p2align 3
.L22:
	movq	%rsi, %rax
	leaq	(%r9,%r11,4), %r13
	.p2align 4,,10
	.p2align 3
.L25:
	movl	(%rax,%r8,4), %r11d
	addq	$4, %rax
	movl	%r11d, -4(%rax)
	cmpq	%rax, %r13
	jne	.L25
	testl	%ecx, %ecx
	jg	.L114
	.p2align 4,,10
	.p2align 3
.L40:
	movl	%edx, %ecx
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L17:
	xorl	%r8d, %r8d
	testl	%edx, %edx
	jg	.L35
	xorl	%ecx, %ecx
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L39:
	xorl	%edx, %edx
	cmpl	$14, %r11d
	ja	.L115
.L41:
	movl	%edx, %r8d
	xorl	%eax, %eax
	jmp	.L28
.L38:
	xorl	%eax, %eax
	jmp	.L18
.L113:
	movl	%r11d, 32(%rsp)
	testb	%al, %al
	je	.L16
	movl	%r11d, 52(%rsp)
	movl	%ecx, 60(%rsp)
	movl	%r8d, 56(%rsp)
	jmp	.L16
.L3:
	movq	744(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L116
	addq	$760, %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
.L8:
	.cfi_restore_state
	movq	%r14, %r12
	leal	-1(%rax), %edx
	movl	28(%rsp), %r14d
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	jmp	.L10
.L116:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.value	255
	.value	255
	.value	255
	.value	255
	.value	255
	.value	255
	.value	255
	.value	255
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	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
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$760, %rsp
	.cfi_def_cfa_offset 816
	movq	%fs:40, %rax
	movq	%rax, 744(%rsp)
	xorl	%eax, %eax
	leaq	672(%rsp), %rax
	leaq	272(%rsp), %rbx
	movq	%rax, 40(%rsp)
	leaq	64(%rsp), %rax
	leaq	56(%rsp), %r12
	movq	%rax, 8(%rsp)
	leaq	52(%rsp), %rax
	movq	%rax, 16(%rsp)
	.p2align 4,,10
	.p2align 3
.L33:
	movq	40(%rsp), %rdx
	movq	%rbx, %rax
	pxor	%xmm0, %xmm0
	.p2align 4,,10
	.p2align 3
.L2:
	movaps	%xmm0, (%rax)
	addq	$16, %rax
	cmpq	%rdx, %rax
	jne	.L2
	movq	8(%rsp), %rdi
	xorl	%eax, %eax
	movl	$26, %ecx
	movq	$0, 672(%rsp)
	movl	$52, 52(%rsp)
	movq	16(%rsp), %r13
	rep stosq
.L85:
	xorl	%eax, %eax
	movq	%r12, %rdx
	movq	%r13, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	movl	52(%rsp), %r14d
	movl	56(%rsp), %r15d
	movl	%r14d, %eax
	orl	%r15d, %eax
	je	.L3
	leal	-1(%r14), %eax
	cmpl	$49, %eax
	ja	.L85
	leal	-1(%r15), %eax
	cmpl	$49, %eax
	ja	.L85
	leal	1(%r14), %eax
	leaq	60(%rsp), %r13
	movl	%r14d, 28(%rsp)
	movq	%r12, %r14
	movl	$0, 52(%rsp)
	movl	%r15d, %r12d
	movq	%r13, %r15
	movl	%eax, %r13d
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L111:
	movl	%eax, 52(%rsp)
	leal	-1(%rax), %edx
	cmpl	%eax, %r12d
	jle	.L110
.L9:
	movq	%r15, %rdx
	movq	%r14, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	56(%rsp), %r8d
	movl	60(%rsp), %ecx
	movslq	52(%rsp), %rdx
	movd	%r8d, %xmm0
	movd	%ecx, %xmm6
	punpckldq	%xmm6, %xmm0
	movq	%rdx, %rax
	movq	%xmm0, (%rbx,%rdx,8)
	leal	(%r8,%rcx), %edx
	cmpl	%r13d, %edx
	jg	.L111
	movl	%r8d, %esi
	orl	%ecx, %esi
	je	.L8
	movl	%eax, %edx
	addl	$1, %eax
	movl	%eax, 52(%rsp)
	cmpl	%eax, %r12d
	jg	.L9
.L110:
	movq	%r14, %r12
	movl	28(%rsp), %r14d
.L10:
	movslq	%edx, %rdx
	movl	272(%rsp,%rdx,8), %esi
	testl	%esi, %esi
	jne	.L11
	movl	276(%rsp,%rdx,8), %eax
	testl	%eax, %eax
	je	.L3
.L11:
	movl	%r14d, 64(%rsp)
	movq	8(%rsp), %r9
	movl	%r14d, %edi
	movl	$1, %eax
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L112:
	movl	%edx, (%r9,%rax,4)
	addq	$1, %rax
	cmpq	$52, %rax
	je	.L14
.L13:
	movl	%r14d, %edx
	movslq	%eax, %rsi
	subl	%eax, %edx
	cmpq	%rdi, %rax
	jne	.L112
	movl	$51, %eax
	movl	%ecx, 36(%rsp)
	subl	%esi, %eax
	movl	%r8d, 28(%rsp)
	leaq	4(,%rax,4), %rdx
	movq	8(%rsp), %rax
	leaq	(%rax,%rsi,4), %rdi
	xorl	%esi, %esi
	call	memset@PLT
	movl	36(%rsp), %ecx
	movl	28(%rsp), %r8d
.L14:
	movl	$1, %edi
	pxor	%xmm3, %xmm3
	pxor	%xmm2, %xmm2
	xorl	%eax, %eax
	movl	272(%rsp), %r10d
	movl	$0, 52(%rsp)
	leaq	68(%rsp), %r9
	testl	%r10d, %r10d
	je	.L16
	movl	32(%rsp), %r11d
	movq	8(%rsp), %rsi
	.p2align 4,,10
	.p2align 3
.L15:
	movl	-4(%rbx,%rdi,8), %edx
	testl	%edx, %edx
	je	.L113
	leal	-1(%r10), %ecx
	testl	%ecx, %ecx
	jle	.L17
	leal	-2(%r10), %r11d
	cmpl	$14, %r11d
	jbe	.L38
	movdqa	64(%rsp), %xmm0
	movl	%ecx, %eax
	shrl	$4, %eax
	movdqa	%xmm0, %xmm1
	punpcklwd	80(%rsp), %xmm0
	punpckhwd	80(%rsp), %xmm1
	movdqa	%xmm0, %xmm4
	punpcklwd	%xmm1, %xmm0
	punpckhwd	%xmm1, %xmm4
	movdqa	96(%rsp), %xmm1
	punpcklwd	%xmm4, %xmm0
	pand	.LC1(%rip), %xmm0
	movdqa	%xmm1, %xmm4
	punpcklwd	112(%rsp), %xmm1
	punpckhwd	112(%rsp), %xmm4
	movdqa	%xmm1, %xmm5
	punpcklwd	%xmm4, %xmm1
	punpckhwd	%xmm4, %xmm5
	punpcklwd	%xmm5, %xmm1
	pand	.LC1(%rip), %xmm1
	packuswb	%xmm1, %xmm0
	movaps	%xmm0, 688(%rsp)
	cmpl	$1, %eax
	je	.L19
	movdqa	128(%rsp), %xmm0
	movdqa	%xmm0, %xmm1
	punpcklwd	144(%rsp), %xmm0
	punpckhwd	144(%rsp), %xmm1
	movdqa	%xmm0, %xmm4
	punpcklwd	%xmm1, %xmm0
	punpckhwd	%xmm1, %xmm4
	movdqa	160(%rsp), %xmm1
	punpcklwd	%xmm4, %xmm0
	pand	.LC1(%rip), %xmm0
	movdqa	%xmm1, %xmm4
	punpcklwd	176(%rsp), %xmm1
	punpckhwd	176(%rsp), %xmm4
	movdqa	%xmm1, %xmm5
	punpcklwd	%xmm4, %xmm1
	punpckhwd	%xmm4, %xmm5
	punpcklwd	%xmm5, %xmm1
	pand	.LC1(%rip), %xmm1
	packuswb	%xmm1, %xmm0
	movaps	%xmm0, 704(%rsp)
	cmpl	$2, %eax
	je	.L19
	movdqa	192(%rsp), %xmm0
	movdqa	%xmm0, %xmm1
	punpcklwd	208(%rsp), %xmm0
	punpckhwd	208(%rsp), %xmm1
	movdqa	%xmm0, %xmm4
	punpcklwd	%xmm1, %xmm0
	punpckhwd	%xmm1, %xmm4
	movdqa	224(%rsp), %xmm1
	punpcklwd	%xmm4, %xmm0
	pand	.LC1(%rip), %xmm0
	movdqa	%xmm1, %xmm4
	punpcklwd	240(%rsp), %xmm1
	punpckhwd	240(%rsp), %xmm4
	movdqa	%xmm1, %xmm5
	punpcklwd	%xmm4, %xmm1
	punpckhwd	%xmm4, %xmm5
	punpcklwd	%xmm5, %xmm1
	pand	.LC1(%rip), %xmm1
	packuswb	%xmm1, %xmm0
	movaps	%xmm0, 720(%rsp)
.L19:
	movl	%ecx, %eax
	andl	$-16, %eax
	testb	$15, %cl
	je	.L20
.L18:
	movslq	%eax, %r8
	movl	64(%rsp,%r8,4), %r13d
	movb	%r13b, 688(%rsp,%r8)
	leal	1(%rax), %r8d
	cmpl	%r8d, %ecx
	jle	.L20
	movslq	%r8d, %r8
	movl	64(%rsp,%r8,4), %r13d
	movb	%r13b, 688(%rsp,%r8)
	leal	2(%rax), %r8d
	cmpl	%r8d, %ecx
	jle	.L20
	movslq	%r8d, %r8
	movl	64(%rsp,%r8,4), %r13d
	movb	%r13b, 688(%rsp,%r8)
	leal	3(%rax), %r8d
	cmpl	%r8d, %ecx
	jle	.L20
	movslq	%r8d, %r8
	movl	64(%rsp,%r8,4), %r13d
	movb	%r13b, 688(%rsp,%r8)
	leal	4(%rax), %r8d
	cmpl	%r8d, %ecx
	jle	.L20
	movslq	%r8d, %r8
	movl	64(%rsp,%r8,4), %r13d
	movb	%r13b, 688(%rsp,%r8)
	leal	5(%rax), %r8d
	cmpl	%r8d, %ecx
	jle	.L20
	movslq	%r8d, %r8
	movl	64(%rsp,%r8,4), %r13d
	movb	%r13b, 688(%rsp,%r8)
	leal	6(%rax), %r8d
	cmpl	%r8d, %ecx
	jle	.L20
	movslq	%r8d, %r8
	movl	64(%rsp,%r8,4), %r13d
	movb	%r13b, 688(%rsp,%r8)
	leal	7(%rax), %r8d
	cmpl	%r8d, %ecx
	jle	.L20
	movslq	%r8d, %r8
	movl	64(%rsp,%r8,4), %r13d
	movb	%r13b, 688(%rsp,%r8)
	leal	8(%rax), %r8d
	cmpl	%r8d, %ecx
	jle	.L20
	movslq	%r8d, %r8
	movl	64(%rsp,%r8,4), %r13d
	movb	%r13b, 688(%rsp,%r8)
	leal	9(%rax), %r8d
	cmpl	%r8d, %ecx
	jle	.L20
	movslq	%r8d, %r8
	movl	64(%rsp,%r8,4), %r13d
	movb	%r13b, 688(%rsp,%r8)
	leal	10(%rax), %r8d
	cmpl	%r8d, %ecx
	jle	.L20
	movslq	%r8d, %r8
	movl	64(%rsp,%r8,4), %r13d
	movb	%r13b, 688(%rsp,%r8)
	leal	11(%rax), %r8d
	cmpl	%r8d, %ecx
	jle	.L20
	movslq	%r8d, %r8
	movl	64(%rsp,%r8,4), %r13d
	movb	%r13b, 688(%rsp,%r8)
	leal	12(%rax), %r8d
	cmpl	%r8d, %ecx
	jle	.L20
	movslq	%r8d, %r8
	movl	64(%rsp,%r8,4), %r13d
	movb	%r13b, 688(%rsp,%r8)
	leal	13(%rax), %r8d
	cmpl	%r8d, %ecx
	jle	.L20
	movslq	%r8d, %r8
	addl	$14, %eax
	movl	64(%rsp,%r8,4), %r13d
	movb	%r13b, 688(%rsp,%r8)
	cmpl	%eax, %ecx
	jle	.L20
	cltq
	movl	64(%rsp,%rax,4), %r8d
	movb	%r8b, 688(%rsp,%rax)
	.p2align 4,,10
	.p2align 3
.L20:
	testl	%edx, %edx
	jle	.L39
	movslq	%ecx, %r8
.L35:
	leal	-1(%rdx), %r11d
	cmpl	$2, %r11d
	jbe	.L22
	movslq	%r8d, %rax
	movl	%edx, %r11d
	leaq	(%rsi,%rax,4), %rax
	shrl	$2, %r11d
	movdqu	(%rax), %xmm7
	movaps	%xmm7, 64(%rsp)
	cmpl	$1, %r11d
	je	.L23
	movdqu	16(%rax), %xmm7
	movaps	%xmm7, 80(%rsp)
	cmpl	$2, %r11d
	je	.L23
	movdqu	32(%rax), %xmm7
	movaps	%xmm7, 96(%rsp)
	cmpl	$3, %r11d
	je	.L23
	movdqu	48(%rax), %xmm6
	movaps	%xmm6, 112(%rsp)
	cmpl	$4, %r11d
	je	.L23
	movdqu	64(%rax), %xmm7
	movaps	%xmm7, 128(%rsp)
	cmpl	$5, %r11d
	je	.L23
	movdqu	80(%rax), %xmm6
	movaps	%xmm6, 144(%rsp)
	cmpl	$6, %r11d
	je	.L23
	movdqu	96(%rax), %xmm7
	movaps	%xmm7, 160(%rsp)
	cmpl	$7, %r11d
	je	.L23
	movdqu	112(%rax), %xmm7
	movaps	%xmm7, 176(%rsp)
	cmpl	$8, %r11d
	je	.L23
	movdqu	128(%rax), %xmm6
	movaps	%xmm6, 192(%rsp)
	cmpl	$9, %r11d
	je	.L23
	movdqu	144(%rax), %xmm6
	movaps	%xmm6, 208(%rsp)
	cmpl	$10, %r11d
	je	.L23
	movdqu	160(%rax), %xmm7
	movaps	%xmm7, 224(%rsp)
	cmpl	$11, %r11d
	je	.L23
	movdqu	176(%rax), %xmm7
	movaps	%xmm7, 240(%rsp)
	cmpl	$12, %r11d
	je	.L23
	movdqu	192(%rax), %xmm6
	movaps	%xmm6, 256(%rsp)
	.p2align 4,,10
	.p2align 3
.L23:
	movl	%edx, %eax
	andl	$-4, %eax
	addl	%eax, %r8d
	cmpl	%eax, %edx
	je	.L26
	movslq	%r8d, %r11
	movl	64(%rsp,%r11,4), %r13d
	movslq	%eax, %r11
	movl	%r13d, 64(%rsp,%r11,4)
	leal	1(%rax), %r11d
	leal	1(%r8), %r13d
	cmpl	%r11d, %edx
	jle	.L26
	movslq	%r13d, %r13
	movslq	%r11d, %r11
	addl	$2, %eax
	addl	$2, %r8d
	movl	64(%rsp,%r13,4), %r13d
	movl	%r13d, 64(%rsp,%r11,4)
	cmpl	%eax, %edx
	jle	.L26
	movslq	%r8d, %r8
	cltq
	movl	64(%rsp,%r8,4), %r8d
	movl	%r8d, 64(%rsp,%rax,4)
.L26:
	testl	%ecx, %ecx
	jle	.L40
.L114:
	leal	-2(%r10), %r11d
	cmpl	$14, %r11d
	jbe	.L41
.L115:
	movdqa	688(%rsp), %xmm0
	movdqa	%xmm3, %xmm4
	movslq	%edx, %rax
	movl	%ecx, %r8d
	leaq	(%rsi,%rax,4), %rax
	shrl	$4, %r8d
	pcmpgtb	%xmm0, %xmm4
	movdqa	%xmm0, %xmm1
	punpcklbw	%xmm4, %xmm1
	punpckhbw	%xmm4, %xmm0
	movdqa	%xmm2, %xmm4
	pcmpgtw	%xmm1, %xmm4
	movdqa	%xmm1, %xmm5
	punpckhwd	%xmm4, %xmm1
	punpcklwd	%xmm4, %xmm5
	movdqa	%xmm0, %xmm4
	movups	%xmm1, 16(%rax)
	movdqa	%xmm2, %xmm1
	pcmpgtw	%xmm0, %xmm1
	movups	%xmm5, (%rax)
	punpcklwd	%xmm1, %xmm4
	punpckhwd	%xmm1, %xmm0
	movups	%xmm4, 32(%rax)
	movups	%xmm0, 48(%rax)
	cmpl	$1, %r8d
	je	.L29
	movdqa	704(%rsp), %xmm0
	movdqa	%xmm3, %xmm4
	pcmpgtb	%xmm0, %xmm4
	movdqa	%xmm0, %xmm1
	punpcklbw	%xmm4, %xmm1
	punpckhbw	%xmm4, %xmm0
	movdqa	%xmm2, %xmm4
	pcmpgtw	%xmm1, %xmm4
	movdqa	%xmm1, %xmm5
	punpckhwd	%xmm4, %xmm1
	punpcklwd	%xmm4, %xmm5
	movdqa	%xmm0, %xmm4
	movups	%xmm1, 80(%rax)
	movdqa	%xmm2, %xmm1
	pcmpgtw	%xmm0, %xmm1
	movups	%xmm5, 64(%rax)
	punpcklwd	%xmm1, %xmm4
	punpckhwd	%xmm1, %xmm0
	movups	%xmm4, 96(%rax)
	movups	%xmm0, 112(%rax)
	cmpl	$2, %r8d
	je	.L29
	movdqa	720(%rsp), %xmm0
	movdqa	%xmm3, %xmm4
	pcmpgtb	%xmm0, %xmm4
	movdqa	%xmm0, %xmm1
	punpcklbw	%xmm4, %xmm1
	punpckhbw	%xmm4, %xmm0
	movdqa	%xmm2, %xmm4
	pcmpgtw	%xmm1, %xmm4
	movdqa	%xmm1, %xmm5
	punpckhwd	%xmm4, %xmm1
	punpcklwd	%xmm4, %xmm5
	movdqa	%xmm0, %xmm4
	movups	%xmm1, 144(%rax)
	movdqa	%xmm2, %xmm1
	pcmpgtw	%xmm0, %xmm1
	movups	%xmm5, 128(%rax)
	punpcklwd	%xmm1, %xmm4
	punpckhwd	%xmm1, %xmm0
	movups	%xmm4, 160(%rax)
	movups	%xmm0, 176(%rax)
.L29:
	movl	%ecx, %eax
	andl	$-16, %eax
	leal	(%rax,%rdx), %r8d
	cmpl	%eax, %ecx
	je	.L30
.L28:
	movslq	%eax, %r11
	movslq	%r8d, %r10
	movsbl	688(%rsp,%r11), %r11d
	movl	%r11d, 64(%rsp,%r10,4)
	leal	1(%rax), %r10d
	leal	1(%r8), %r11d
	cmpl	%r10d, %ecx
	jle	.L30
	movslq	%r10d, %r10
	movslq	%r11d, %r11
	movsbl	688(%rsp,%r10), %r10d
	movl	%r10d, 64(%rsp,%r11,4)
	leal	2(%rax), %r10d
	leal	2(%r8), %r11d
	cmpl	%ecx, %r10d
	jge	.L30
	movslq	%r10d, %r10
	movslq	%r11d, %r11
	movsbl	688(%rsp,%r10), %r10d
	movl	%r10d, 64(%rsp,%r11,4)
	leal	3(%rax), %r10d
	leal	3(%r8), %r11d
	cmpl	%ecx, %r10d
	jge	.L30
	movslq	%r10d, %r10
	movslq	%r11d, %r11
	movsbl	688(%rsp,%r10), %r10d
	movl	%r10d, 64(%rsp,%r11,4)
	leal	4(%rax), %r10d
	leal	4(%r8), %r11d
	cmpl	%ecx, %r10d
	jge	.L30
	movslq	%r10d, %r10
	movslq	%r11d, %r11
	movsbl	688(%rsp,%r10), %r10d
	movl	%r10d, 64(%rsp,%r11,4)
	leal	5(%rax), %r10d
	leal	5(%r8), %r11d
	cmpl	%r10d, %ecx
	jle	.L30
	movslq	%r10d, %r10
	movslq	%r11d, %r11
	movsbl	688(%rsp,%r10), %r10d
	movl	%r10d, 64(%rsp,%r11,4)
	leal	6(%rax), %r10d
	leal	6(%r8), %r11d
	cmpl	%r10d, %ecx
	jle	.L30
	movslq	%r10d, %r10
	movslq	%r11d, %r11
	movsbl	688(%rsp,%r10), %r10d
	movl	%r10d, 64(%rsp,%r11,4)
	leal	7(%rax), %r10d
	leal	7(%r8), %r11d
	cmpl	%r10d, %ecx
	jle	.L30
	movslq	%r10d, %r10
	movslq	%r11d, %r11
	movsbl	688(%rsp,%r10), %r10d
	movl	%r10d, 64(%rsp,%r11,4)
	leal	8(%rax), %r10d
	leal	8(%r8), %r11d
	cmpl	%r10d, %ecx
	jle	.L30
	movslq	%r10d, %r10
	movslq	%r11d, %r11
	movsbl	688(%rsp,%r10), %r10d
	movl	%r10d, 64(%rsp,%r11,4)
	leal	9(%rax), %r10d
	leal	9(%r8), %r11d
	cmpl	%r10d, %ecx
	jle	.L30
	movslq	%r10d, %r10
	movslq	%r11d, %r11
	movsbl	688(%rsp,%r10), %r10d
	movl	%r10d, 64(%rsp,%r11,4)
	leal	10(%rax), %r10d
	leal	10(%r8), %r11d
	cmpl	%r10d, %ecx
	jle	.L30
	movslq	%r10d, %r10
	movslq	%r11d, %r11
	movsbl	688(%rsp,%r10), %r10d
	movl	%r10d, 64(%rsp,%r11,4)
	leal	11(%rax), %r10d
	leal	11(%r8), %r11d
	cmpl	%r10d, %ecx
	jle	.L30
	movslq	%r10d, %r10
	movslq	%r11d, %r11
	movsbl	688(%rsp,%r10), %r10d
	movl	%r10d, 64(%rsp,%r11,4)
	leal	12(%rax), %r10d
	leal	12(%r8), %r11d
	cmpl	%r10d, %ecx
	jle	.L30
	movslq	%r10d, %r10
	movslq	%r11d, %r11
	movsbl	688(%rsp,%r10), %r10d
	movl	%r10d, 64(%rsp,%r11,4)
	leal	13(%rax), %r10d
	leal	13(%r8), %r11d
	cmpl	%r10d, %ecx
	jle	.L30
	movslq	%r10d, %r10
	movslq	%r11d, %r11
	addl	$14, %eax
	addl	$14, %r8d
	movsbl	688(%rsp,%r10), %r10d
	movl	%r10d, 64(%rsp,%r11,4)
	cmpl	%eax, %ecx
	jle	.L30
	cltq
	movslq	%r8d, %r8
	movsbl	688(%rsp,%rax), %eax
	movl	%eax, 64(%rsp,%r8,4)
	.p2align 4,,10
	.p2align 3
.L30:
	addl	%edx, %ecx
.L27:
	movl	%edi, %r11d
	addq	$1, %rdi
	pxor	%xmm0, %xmm0
	movl	$0, 736(%rsp)
	movl	-8(%rbx,%rdi,8), %r10d
	movaps	%xmm0, 688(%rsp)
	movl	$52, %r8d
	movl	$1, %eax
	movaps	%xmm0, 704(%rsp)
	movaps	%xmm0, 720(%rsp)
	testl	%r10d, %r10d
	jne	.L15
	movl	%r11d, 32(%rsp)
	movl	%r11d, 52(%rsp)
	movl	%ecx, 60(%rsp)
	movl	$52, 56(%rsp)
.L16:
	movl	64(%rsp), %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L33
	.p2align 4,,10
	.p2align 3
.L22:
	movq	%rsi, %rax
	leaq	(%r9,%r11,4), %r13
	.p2align 4,,10
	.p2align 3
.L25:
	movl	(%rax,%r8,4), %r11d
	addq	$4, %rax
	movl	%r11d, -4(%rax)
	cmpq	%rax, %r13
	jne	.L25
	testl	%ecx, %ecx
	jg	.L114
	.p2align 4,,10
	.p2align 3
.L40:
	movl	%edx, %ecx
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L17:
	xorl	%r8d, %r8d
	testl	%edx, %edx
	jg	.L35
	xorl	%ecx, %ecx
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L39:
	xorl	%edx, %edx
	cmpl	$14, %r11d
	ja	.L115
.L41:
	movl	%edx, %r8d
	xorl	%eax, %eax
	jmp	.L28
.L38:
	xorl	%eax, %eax
	jmp	.L18
.L113:
	movl	%r11d, 32(%rsp)
	testb	%al, %al
	je	.L16
	movl	%r11d, 52(%rsp)
	movl	%ecx, 60(%rsp)
	movl	%r8d, 56(%rsp)
	jmp	.L16
.L3:
	movq	744(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L116
	addq	$760, %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
.L8:
	.cfi_restore_state
	movq	%r14, %r12
	leal	-1(%rax), %edx
	movl	28(%rsp), %r14d
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	jmp	.L10
.L116:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.value	255
	.value	255
	.value	255
	.value	255
	.value	255
	.value	255
	.value	255
	.value	255
	.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>

int main(void){

  char inputs[6], tmp[51];
  int inputs_shuffle[51][2], inputs_nr[2], stack[52];
  int loop1, loop2, loop3;

  while(1){
    inputs_nr[0] = '\0';
    inputs_nr[1] = '\0';
    
    for(loop1 = 0; loop1 < 51; loop1++){
      inputs_shuffle[loop1][0] = '\0';
      inputs_shuffle[loop1][1] = '\0';
    }
    for(loop1 = 0; loop1 < 52; loop1++){
      stack[loop1] = '\0';
    }


    while((inputs_nr[0] == '\0') || (inputs_nr[1] == '\0')){ // get <n r>
      //      printf("input 'n r'\n");
      scanf("%d %d", &loop1, &loop2);
      
      inputs_nr[0] = loop1;
      inputs_nr[1] = loop2;
      
    if((inputs_nr[0] == 0) && (inputs_nr[1] == 0)) break;    
      
      if((inputs_nr[0] < 1) || (inputs_nr[0] > 50)){
	//	printf("<n> must be more than 1 and less than 50.\n");
	inputs_nr[0] = '\0';      // 1 <= n <= 50
	inputs_nr[1] = '\0';
      }
      
      if((inputs_nr[1] < 1) || (inputs_nr[1] > 50)){
	//	printf("<r> must be more than 1 and less than 50.\n");
	inputs_nr[1] = '\0';      // 1 <= r <= 50
	inputs_nr[0] = '\0';
      }


    }
    
    if((inputs_nr[0] == 0) && (inputs_nr[1] == 0)) break;    
    
    
    for(loop1 = 0; loop1 < inputs_nr[1]; loop1++){  // get <p c>
      
      //      printf("input 'p c'[%d]\n", loop1 + 1);
      scanf("%d %d", &loop2, &loop3);
      
      inputs_shuffle[loop1][0] = loop2;
      inputs_shuffle[loop1][1] = loop3;
      
      
      if((inputs_shuffle[loop1][0] + inputs_shuffle[loop1][1]) > (inputs_nr[0] + 1)){
	//	printf("(p + c) must be less than (%d + 1)\n", inputs_nr[0]);
	loop1--;   //  (p + c) must be less than (n + 1).
      }
      else if((inputs_shuffle[loop1][0] == 0) && (inputs_shuffle[loop1][1] == 0)){
	break;     //  if ((p == 0) && (c == 0)), escape this loop.
      }
    }
    loop1--;
    if((inputs_shuffle[loop1][0] == 0) && (inputs_shuffle[loop1][1] == 0)){
      break;     //  if ((p == 0) && (c == 0)), escape this loop.
    }

    for(loop1 = 0; loop1 < 52; loop1++){  // make the stack
      if(inputs_nr[0] != 0){
	stack[loop1] = inputs_nr[0];
	inputs_nr[0]--;
      }
      else       stack[loop1] = '\0';
    }
    // stack[0], stack[1], stack[2], .......
    //       n ,      n-1,      n-2, .......
    
    loop1 = 0;
    
    while(((inputs_shuffle[loop1][0] != 0) && (inputs_shuffle[loop1][1] != 0)) && loop1 != 51){
      
      for(loop2 = 0; loop2 < (inputs_shuffle[loop1][0] - 1); loop2++){ //
	tmp[loop2] = stack[loop2];
      }
      
      for(loop3 = 0; loop3 < inputs_shuffle[loop1][1]; loop3++, loop2++){
	stack[loop3] = stack[loop2];
      }
      
      for(loop2 = 0; loop2 < (inputs_shuffle[loop1][0] - 1); loop2++, loop3++){
	stack[loop3] = tmp[loop2];
      }
      
      for(loop2 = 0; loop2 < 52; loop2++){
	tmp[loop2] = '\0';
      }
      
      loop1++;
    }
    
    printf("%d\n", stack[0]);
    
  }
  return 0;
  
}
5 2
3 1
3 1
10 3
1 10
10 1
8 0
0 0
 5 0
3 1
3 1
10 3
1 10
10 1
8 0
0 0
 5 0
3 1
3 1
10 2
1 10
10 1
11 0
0 0

4
1
 1
1
 1
1

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>

int main(void){

  char inputs[6], tmp[51];
  int inputs_shuffle[51][2], inputs_nr[2], stack[52];
  int loop1, loop2, loop3;

  while(1){
    inputs_nr[0] = '\0';
    inputs_nr[1] = '\0';
    
    for(loop1 = 0; loop1 < 51; loop1++){
      inputs_shuffle[loop1][0] = '\0';
      inputs_shuffle[loop1][1] = '\0';
    }
    for(loop1 = 0; loop1 < 52; loop1++){
      stack[loop1] = '\0';
    }


    while((inputs_nr[0] == '\0') || (inputs_nr[1] == '\0')){ // get <n r>
      //      printf("input 'n r'\n");
      scanf("%d %d", &loop1, &loop2);
      
      inputs_nr[0] = loop1;
      inputs_nr[1] = loop2;
      
    if((inputs_nr[0] == 0) && (inputs_nr[1] == 0)) break;    
      
      if((inputs_nr[0] < 1) || (inputs_nr[0] > 50)){
	//	printf("<n> must be more than 1 and less than 50.\n");
	inputs_nr[0] = '\0';      // 1 <= n <= 50
	inputs_nr[1] = '\0';
      }
      
      if((inputs_nr[1] < 1) || (inputs_nr[1] > 50)){
	//	printf("<r> must be more than 1 and less than 50.\n");
	inputs_nr[1] = '\0';      // 1 <= r <= 50
	inputs_nr[0] = '\0';
      }


    }
    
    if((inputs_nr[0] == 0) && (inputs_nr[1] == 0)) break;    
    
    
    for(loop1 = 0; loop1 < inputs_nr[1]; loop1++){  // get <p c>
      
      //      printf("input 'p c'[%d]\n", loop1 + 1);
      scanf("%d %d", &loop2, &loop3);
      
      inputs_shuffle[loop1][0] = loop2;
      inputs_shuffle[loop1][1] = loop3;
      
      
      if((inputs_shuffle[loop1][0] + inputs_shuffle[loop1][1]) > (inputs_nr[0] + 1)){
	//	printf("(p + c) must be less than (%d + 1)\n", inputs_nr[0]);
	loop1--;   //  (p + c) must be less than (n + 1).
      }
      else if((inputs_shuffle[loop1][0] == 0) && (inputs_shuffle[loop1][1] == 0)){
	break;     //  if ((p == 0) && (c == 0)), escape this loop.
      }
    }
    loop1--;
    if((inputs_shuffle[loop1][0] == 0) && (inputs_shuffle[loop1][1] == 0)){
      break;     //  if ((p == 0) && (c == 0)), escape this loop.
    }

    for(loop1 = 0; loop1 < 52; loop1++){  // make the stack
      if(inputs_nr[0] != 0){
	stack[loop1] = inputs_nr[0];
	inputs_nr[0]--;
      }
      else       stack[loop1] = '\0';
    }
    // stack[0], stack[1], stack[2], .......
    //       n ,      n-1,      n-2, .......
    
    loop1 = 0;
    
    while(((inputs_shuffle[loop1][0] != 0) && (inputs_shuffle[loop1][1] != 0)) && loop1 != 51){
      
      for(loop2 = 0; loop2 < (inputs_shuffle[loop1][0] - 1); loop2++){ //
	tmp[loop2] = stack[loop2];
      }
      
      for(loop3 = 0; loop3 < inputs_shuffle[loop1][1]; loop3++, loop2++){
	stack[loop3] = stack[loop2];
      }
      
      for(loop2 = 0; loop2 < (inputs_shuffle[loop1][0] - 1); loop2++, loop3++){
	stack[loop3] = tmp[loop2];
      }
      
      for(loop2 = 0; loop2 < 52; loop2++){
	tmp[loop2] = '\0';
      }
      
      loop1++;
    }
    
    printf("%d\n", stack[0]);
    
  }
  return 0;
  
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$720, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L36:
	movl	$0, -696(%rbp)
	movl	$0, -692(%rbp)
	movl	$0, -708(%rbp)
	jmp	.L2
.L3:
	movl	-708(%rbp), %eax
	cltq
	movl	$0, -480(%rbp,%rax,8)
	movl	-708(%rbp), %eax
	cltq
	movl	$0, -476(%rbp,%rax,8)
	movl	-708(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -708(%rbp)
.L2:
	movl	-708(%rbp), %eax
	cmpl	$50, %eax
	jle	.L3
	movl	$0, -708(%rbp)
	jmp	.L4
.L5:
	movl	-708(%rbp), %eax
	cltq
	movl	$0, -688(%rbp,%rax,4)
	movl	-708(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -708(%rbp)
.L4:
	movl	-708(%rbp), %eax
	cmpl	$51, %eax
	jle	.L5
	jmp	.L6
.L12:
	leaq	-704(%rbp), %rdx
	leaq	-708(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-708(%rbp), %eax
	movl	%eax, -696(%rbp)
	movl	-704(%rbp), %eax
	movl	%eax, -692(%rbp)
	movl	-696(%rbp), %eax
	testl	%eax, %eax
	jne	.L7
	movl	-692(%rbp), %eax
	testl	%eax, %eax
	je	.L39
.L7:
	movl	-696(%rbp), %eax
	testl	%eax, %eax
	jle	.L9
	movl	-696(%rbp), %eax
	cmpl	$50, %eax
	jle	.L10
.L9:
	movl	$0, -696(%rbp)
	movl	$0, -692(%rbp)
.L10:
	movl	-692(%rbp), %eax
	testl	%eax, %eax
	jle	.L11
	movl	-692(%rbp), %eax
	cmpl	$50, %eax
	jle	.L6
.L11:
	movl	$0, -692(%rbp)
	movl	$0, -696(%rbp)
.L6:
	movl	-696(%rbp), %eax
	testl	%eax, %eax
	je	.L12
	movl	-692(%rbp), %eax
	testl	%eax, %eax
	je	.L12
	jmp	.L8
.L39:
	nop
.L8:
	movl	-696(%rbp), %eax
	testl	%eax, %eax
	jne	.L13
	movl	-692(%rbp), %eax
	testl	%eax, %eax
	je	.L40
.L13:
	movl	$0, -708(%rbp)
	jmp	.L15
.L19:
	leaq	-700(%rbp), %rdx
	leaq	-704(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-708(%rbp), %eax
	movl	-704(%rbp), %edx
	cltq
	movl	%edx, -480(%rbp,%rax,8)
	movl	-708(%rbp), %eax
	movl	-700(%rbp), %edx
	cltq
	movl	%edx, -476(%rbp,%rax,8)
	movl	-708(%rbp), %eax
	cltq
	movl	-480(%rbp,%rax,8), %edx
	movl	-708(%rbp), %eax
	cltq
	movl	-476(%rbp,%rax,8), %eax
	addl	%eax, %edx
	movl	-696(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, %edx
	jle	.L16
	movl	-708(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -708(%rbp)
	jmp	.L17
.L16:
	movl	-708(%rbp), %eax
	cltq
	movl	-480(%rbp,%rax,8), %eax
	testl	%eax, %eax
	jne	.L17
	movl	-708(%rbp), %eax
	cltq
	movl	-476(%rbp,%rax,8), %eax
	testl	%eax, %eax
	je	.L41
.L17:
	movl	-708(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -708(%rbp)
.L15:
	movl	-692(%rbp), %edx
	movl	-708(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L19
	jmp	.L18
.L41:
	nop
.L18:
	movl	-708(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -708(%rbp)
	movl	-708(%rbp), %eax
	cltq
	movl	-480(%rbp,%rax,8), %eax
	testl	%eax, %eax
	jne	.L20
	movl	-708(%rbp), %eax
	cltq
	movl	-476(%rbp,%rax,8), %eax
	testl	%eax, %eax
	je	.L42
.L20:
	movl	$0, -708(%rbp)
	jmp	.L21
.L24:
	movl	-696(%rbp), %eax
	testl	%eax, %eax
	je	.L22
	movl	-708(%rbp), %eax
	movl	-696(%rbp), %edx
	cltq
	movl	%edx, -688(%rbp,%rax,4)
	movl	-696(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -696(%rbp)
	jmp	.L23
.L22:
	movl	-708(%rbp), %eax
	cltq
	movl	$0, -688(%rbp,%rax,4)
.L23:
	movl	-708(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -708(%rbp)
.L21:
	movl	-708(%rbp), %eax
	cmpl	$51, %eax
	jle	.L24
	movl	$0, -708(%rbp)
	jmp	.L25
.L35:
	movl	$0, -704(%rbp)
	jmp	.L26
.L27:
	movl	-704(%rbp), %eax
	cltq
	movl	-688(%rbp,%rax,4), %edx
	movl	-704(%rbp), %eax
	cltq
	movb	%dl, -64(%rbp,%rax)
	movl	-704(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -704(%rbp)
.L26:
	movl	-708(%rbp), %eax
	cltq
	movl	-480(%rbp,%rax,8), %eax
	leal	-1(%rax), %edx
	movl	-704(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L27
	movl	$0, -700(%rbp)
	jmp	.L28
.L29:
	movl	-704(%rbp), %eax
	movl	-700(%rbp), %ecx
	cltq
	movl	-688(%rbp,%rax,4), %edx
	movslq	%ecx, %rax
	movl	%edx, -688(%rbp,%rax,4)
	movl	-700(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -700(%rbp)
	movl	-704(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -704(%rbp)
.L28:
	movl	-708(%rbp), %eax
	cltq
	movl	-476(%rbp,%rax,8), %edx
	movl	-700(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L29
	movl	$0, -704(%rbp)
	jmp	.L30
.L31:
	movl	-704(%rbp), %eax
	cltq
	movzbl	-64(%rbp,%rax), %edx
	movl	-700(%rbp), %eax
	movsbl	%dl, %edx
	cltq
	movl	%edx, -688(%rbp,%rax,4)
	movl	-704(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -704(%rbp)
	movl	-700(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -700(%rbp)
.L30:
	movl	-708(%rbp), %eax
	cltq
	movl	-480(%rbp,%rax,8), %eax
	leal	-1(%rax), %edx
	movl	-704(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L31
	movl	$0, -704(%rbp)
	jmp	.L32
.L33:
	movl	-704(%rbp), %eax
	cltq
	movb	$0, -64(%rbp,%rax)
	movl	-704(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -704(%rbp)
.L32:
	movl	-704(%rbp), %eax
	cmpl	$51, %eax
	jle	.L33
	movl	-708(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -708(%rbp)
.L25:
	movl	-708(%rbp), %eax
	cltq
	movl	-480(%rbp,%rax,8), %eax
	testl	%eax, %eax
	je	.L34
	movl	-708(%rbp), %eax
	cltq
	movl	-476(%rbp,%rax,8), %eax
	testl	%eax, %eax
	je	.L34
	movl	-708(%rbp), %eax
	cmpl	$51, %eax
	jne	.L35
.L34:
	movl	-688(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L36
.L40:
	nop
	jmp	.L14
.L42:
	nop
.L14:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L38
	call	__stack_chk_fail@PLT
.L38:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$720, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L36:
	movl	$0, -696(%rbp)
	movl	$0, -692(%rbp)
	movl	$0, -708(%rbp)
	jmp	.L2
.L3:
	movl	-708(%rbp), %eax
	cltq
	movl	$0, -480(%rbp,%rax,8)
	movl	-708(%rbp), %eax
	cltq
	movl	$0, -476(%rbp,%rax,8)
	movl	-708(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -708(%rbp)
.L2:
	movl	-708(%rbp), %eax
	cmpl	$50, %eax
	jle	.L3
	movl	$0, -708(%rbp)
	jmp	.L4
.L5:
	movl	-708(%rbp), %eax
	cltq
	movl	$0, -688(%rbp,%rax,4)
	movl	-708(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -708(%rbp)
.L4:
	movl	-708(%rbp), %eax
	cmpl	$51, %eax
	jle	.L5
	jmp	.L6
.L12:
	leaq	-704(%rbp), %rdx
	leaq	-708(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-708(%rbp), %eax
	movl	%eax, -696(%rbp)
	movl	-704(%rbp), %eax
	movl	%eax, -692(%rbp)
	movl	-696(%rbp), %eax
	testl	%eax, %eax
	jne	.L7
	movl	-692(%rbp), %eax
	testl	%eax, %eax
	je	.L39
.L7:
	movl	-696(%rbp), %eax
	testl	%eax, %eax
	jle	.L9
	movl	-696(%rbp), %eax
	cmpl	$50, %eax
	jle	.L10
.L9:
	movl	$0, -696(%rbp)
	movl	$0, -692(%rbp)
.L10:
	movl	-692(%rbp), %eax
	testl	%eax, %eax
	jle	.L11
	movl	-692(%rbp), %eax
	cmpl	$50, %eax
	jle	.L6
.L11:
	movl	$0, -692(%rbp)
	movl	$0, -696(%rbp)
.L6:
	movl	-696(%rbp), %eax
	testl	%eax, %eax
	je	.L12
	movl	-692(%rbp), %eax
	testl	%eax, %eax
	je	.L12
	jmp	.L8
.L39:
	nop
.L8:
	movl	-696(%rbp), %eax
	testl	%eax, %eax
	jne	.L13
	movl	-692(%rbp), %eax
	testl	%eax, %eax
	je	.L40
.L13:
	movl	$0, -708(%rbp)
	jmp	.L15
.L19:
	leaq	-700(%rbp), %rdx
	leaq	-704(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-708(%rbp), %eax
	movl	-704(%rbp), %edx
	cltq
	movl	%edx, -480(%rbp,%rax,8)
	movl	-708(%rbp), %eax
	movl	-700(%rbp), %edx
	cltq
	movl	%edx, -476(%rbp,%rax,8)
	movl	-708(%rbp), %eax
	cltq
	movl	-480(%rbp,%rax,8), %edx
	movl	-708(%rbp), %eax
	cltq
	movl	-476(%rbp,%rax,8), %eax
	addl	%eax, %edx
	movl	-696(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, %edx
	jle	.L16
	movl	-708(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -708(%rbp)
	jmp	.L17
.L16:
	movl	-708(%rbp), %eax
	cltq
	movl	-480(%rbp,%rax,8), %eax
	testl	%eax, %eax
	jne	.L17
	movl	-708(%rbp), %eax
	cltq
	movl	-476(%rbp,%rax,8), %eax
	testl	%eax, %eax
	je	.L41
.L17:
	movl	-708(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -708(%rbp)
.L15:
	movl	-692(%rbp), %edx
	movl	-708(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L19
	jmp	.L18
.L41:
	nop
.L18:
	movl	-708(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -708(%rbp)
	movl	-708(%rbp), %eax
	cltq
	movl	-480(%rbp,%rax,8), %eax
	testl	%eax, %eax
	jne	.L20
	movl	-708(%rbp), %eax
	cltq
	movl	-476(%rbp,%rax,8), %eax
	testl	%eax, %eax
	je	.L42
.L20:
	movl	$0, -708(%rbp)
	jmp	.L21
.L24:
	movl	-696(%rbp), %eax
	testl	%eax, %eax
	je	.L22
	movl	-708(%rbp), %eax
	movl	-696(%rbp), %edx
	cltq
	movl	%edx, -688(%rbp,%rax,4)
	movl	-696(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -696(%rbp)
	jmp	.L23
.L22:
	movl	-708(%rbp), %eax
	cltq
	movl	$0, -688(%rbp,%rax,4)
.L23:
	movl	-708(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -708(%rbp)
.L21:
	movl	-708(%rbp), %eax
	cmpl	$51, %eax
	jle	.L24
	movl	$0, -708(%rbp)
	jmp	.L25
.L35:
	movl	$0, -704(%rbp)
	jmp	.L26
.L27:
	movl	-704(%rbp), %eax
	cltq
	movl	-688(%rbp,%rax,4), %edx
	movl	-704(%rbp), %eax
	cltq
	movb	%dl, -64(%rbp,%rax)
	movl	-704(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -704(%rbp)
.L26:
	movl	-708(%rbp), %eax
	cltq
	movl	-480(%rbp,%rax,8), %eax
	leal	-1(%rax), %edx
	movl	-704(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L27
	movl	$0, -700(%rbp)
	jmp	.L28
.L29:
	movl	-704(%rbp), %eax
	movl	-700(%rbp), %ecx
	cltq
	movl	-688(%rbp,%rax,4), %edx
	movslq	%ecx, %rax
	movl	%edx, -688(%rbp,%rax,4)
	movl	-700(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -700(%rbp)
	movl	-704(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -704(%rbp)
.L28:
	movl	-708(%rbp), %eax
	cltq
	movl	-476(%rbp,%rax,8), %edx
	movl	-700(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L29
	movl	$0, -704(%rbp)
	jmp	.L30
.L31:
	movl	-704(%rbp), %eax
	cltq
	movzbl	-64(%rbp,%rax), %edx
	movl	-700(%rbp), %eax
	movsbl	%dl, %edx
	cltq
	movl	%edx, -688(%rbp,%rax,4)
	movl	-704(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -704(%rbp)
	movl	-700(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -700(%rbp)
.L30:
	movl	-708(%rbp), %eax
	cltq
	movl	-480(%rbp,%rax,8), %eax
	leal	-1(%rax), %edx
	movl	-704(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L31
	movl	$0, -704(%rbp)
	jmp	.L32
.L33:
	movl	-704(%rbp), %eax
	cltq
	movb	$0, -64(%rbp,%rax)
	movl	-704(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -704(%rbp)
.L32:
	movl	-704(%rbp), %eax
	cmpl	$51, %eax
	jle	.L33
	movl	-708(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -708(%rbp)
.L25:
	movl	-708(%rbp), %eax
	cltq
	movl	-480(%rbp,%rax,8), %eax
	testl	%eax, %eax
	je	.L34
	movl	-708(%rbp), %eax
	cltq
	movl	-476(%rbp,%rax,8), %eax
	testl	%eax, %eax
	je	.L34
	movl	-708(%rbp), %eax
	cmpl	$51, %eax
	jne	.L35
.L34:
	movl	-688(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L36
.L40:
	nop
	jmp	.L14
.L42:
	nop
.L14:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L38
	call	__stack_chk_fail@PLT
.L38:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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:
