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

```c
/*
  AOJ 0199
  Title:Chairs Where Demanding People Sit
  @kankichi573
*/
#include <stdio.h>
#include <string.h>
#define max(x,y) (((x)>(y))?(x):(y))
#define min(x,y) (((x)<(y))?(x):(y))

int n,m;
char seat[101];

void sit_down_D(char seat[])
{
  char dist[101];
  int i,j,max_,max_s;

  memset(dist,127,sizeof(dist));
  for(i=0;i<n;i++)
    if(seat[i]!='#')
      for(j=0;j<n;j++)
	{
	  if(i-j>=0) 
	    dist[i-j]=min(dist[i-j],j);
	  if(i+j<n) 
	    dist[i+j]=min(dist[i+j],j);
	}
#ifdef DEBUG
  for(i=0;i<n;i++)
    printf("%d",dist[i]);
  printf("\n");
#endif
  for(i=max_=0;i<n;i++)
    if(max_<dist[i])
      {
	max_=dist[i];
	max_s=i;
      }
  seat[max_s]='D';
}
void sit_down(char seat[],char guest,int order)
{
  char *p;
  int i;

  if(guest=='A')
    {
      p=strchr(seat,'#');
      *p='A';
    }
  else if(guest=='B')
    {
      if(seat[n-1]=='#' && seat[n-2]!='A')
	seat[n-1]='B';
      else 
	{
	  for(i=n-2;i>0;i--)
	    if(seat[i-1]!='A' && seat[i+1]!='A' && seat[i]=='#')
	      {
		seat[i]='B';
		return;
	      }
	  p=strchr(seat,'#');
	  *p='B';
	}
    }
  else if(guest=='C')
    {
      if(order==0)
	{
	  if(n & 1)
	    seat[(n+1)/2-1]='C';
	  else
	    seat[n/2]='C';
	}
      else
	{
	  for(i=0;i<n-1;i++)
	    if(strchr("ABCD",seat[i]))
	      {
		if(i<n-1 && seat[i+1]=='#')
		  {
		    seat[i+1]='C';
		    return;
		  }
		if(i>0 && seat[i-1]=='#')
		  {
		    seat[i-1]='C';
		    return;
		  }
	      }
	}
    }
  else if(guest=='D')
    {
      if(order==0)
	seat[0]='D';
      else
	sit_down_D(seat);
    }
}
void display()
{
  int i;
  for(i=0;i<n;i++)
    printf("%c",seat[i]);
  printf("\n");
}

main()
{
  int i,ret;
  char guest;
  
  while(scanf("%d %d ",&n,&m)  && (n||m))
    {
      memset(seat,'#',sizeof(seat));
      seat[100]='\0';
      for(i=0;i<m;i++)
	{
	  scanf("%c ",&guest);
	  sit_down(seat,guest,i);
#ifdef DEBUG
	  display();
#endif
	}
      display();
    }
  return(0);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	seat
	.align 32
	.type	seat, @object
	.size	seat, 101
seat:
	.zero	101
	.text
	.globl	sit_down_D
	.type	sit_down_D, @function
sit_down_D:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$144, %rsp
	movq	%rdi, -136(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-112(%rbp), %rax
	movl	$101, %edx
	movl	$127, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -128(%rbp)
	jmp	.L2
.L8:
	movl	-128(%rbp), %eax
	movslq	%eax, %rdx
	movq	-136(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	je	.L3
	movl	$0, -124(%rbp)
	jmp	.L4
.L7:
	movl	-128(%rbp), %eax
	subl	-124(%rbp), %eax
	testl	%eax, %eax
	js	.L5
	movl	-128(%rbp), %eax
	subl	-124(%rbp), %eax
	cltq
	movzbl	-112(%rbp,%rax), %eax
	movsbl	%al, %edx
	movl	-124(%rbp), %eax
	cmpl	%eax, %edx
	cmovg	%eax, %edx
	movl	-128(%rbp), %eax
	subl	-124(%rbp), %eax
	cltq
	movb	%dl, -112(%rbp,%rax)
.L5:
	movl	-128(%rbp), %edx
	movl	-124(%rbp), %eax
	addl	%eax, %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jge	.L6
	movl	-128(%rbp), %edx
	movl	-124(%rbp), %eax
	addl	%edx, %eax
	cltq
	movzbl	-112(%rbp,%rax), %eax
	movsbl	%al, %edx
	movl	-124(%rbp), %eax
	cmpl	%eax, %edx
	cmovg	%eax, %edx
	movl	-128(%rbp), %ecx
	movl	-124(%rbp), %eax
	addl	%ecx, %eax
	cltq
	movb	%dl, -112(%rbp,%rax)
.L6:
	addl	$1, -124(%rbp)
.L4:
	movl	n(%rip), %eax
	cmpl	%eax, -124(%rbp)
	jl	.L7
.L3:
	addl	$1, -128(%rbp)
.L2:
	movl	n(%rip), %eax
	cmpl	%eax, -128(%rbp)
	jl	.L8
	movl	$0, -120(%rbp)
	movl	-120(%rbp), %eax
	movl	%eax, -128(%rbp)
	jmp	.L9
.L11:
	movl	-128(%rbp), %eax
	cltq
	movzbl	-112(%rbp,%rax), %eax
	movsbl	%al, %eax
	cmpl	%eax, -120(%rbp)
	jge	.L10
	movl	-128(%rbp), %eax
	cltq
	movzbl	-112(%rbp,%rax), %eax
	movsbl	%al, %eax
	movl	%eax, -120(%rbp)
	movl	-128(%rbp), %eax
	movl	%eax, -116(%rbp)
.L10:
	addl	$1, -128(%rbp)
.L9:
	movl	n(%rip), %eax
	cmpl	%eax, -128(%rbp)
	jl	.L11
	movl	-116(%rbp), %eax
	movslq	%eax, %rdx
	movq	-136(%rbp), %rax
	addq	%rdx, %rax
	movb	$68, (%rax)
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	sit_down_D, .-sit_down_D
	.section	.rodata
.LC0:
	.string	"ABCD"
	.text
	.globl	sit_down
	.type	sit_down, @function
sit_down:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	movl	%esi, %eax
	movl	%edx, -32(%rbp)
	movb	%al, -28(%rbp)
	cmpb	$65, -28(%rbp)
	jne	.L14
	movq	-24(%rbp), %rax
	movl	$35, %esi
	movq	%rax, %rdi
	call	strchr@PLT
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	movb	$65, (%rax)
	jmp	.L13
.L14:
	cmpb	$66, -28(%rbp)
	jne	.L16
	movl	n(%rip), %eax
	cltq
	leaq	-1(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L17
	movl	n(%rip), %eax
	cltq
	leaq	-2(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$65, %al
	je	.L17
	movl	n(%rip), %eax
	cltq
	leaq	-1(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movb	$66, (%rax)
	jmp	.L13
.L17:
	movl	n(%rip), %eax
	subl	$2, %eax
	movl	%eax, -12(%rbp)
	jmp	.L19
.L21:
	movl	-12(%rbp), %eax
	cltq
	leaq	-1(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$65, %al
	je	.L20
	movl	-12(%rbp), %eax
	cltq
	leaq	1(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$65, %al
	je	.L20
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L20
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movb	$66, (%rax)
	jmp	.L13
.L20:
	subl	$1, -12(%rbp)
.L19:
	cmpl	$0, -12(%rbp)
	jg	.L21
	movq	-24(%rbp), %rax
	movl	$35, %esi
	movq	%rax, %rdi
	call	strchr@PLT
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	movb	$66, (%rax)
	jmp	.L13
.L16:
	cmpb	$67, -28(%rbp)
	jne	.L22
	cmpl	$0, -32(%rbp)
	jne	.L23
	movl	n(%rip), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L24
	movl	n(%rip), %eax
	addl	$1, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cltq
	leaq	-1(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movb	$67, (%rax)
	jmp	.L13
.L24:
	movl	n(%rip), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movb	$67, (%rax)
	jmp	.L13
.L23:
	movl	$0, -12(%rbp)
	jmp	.L25
.L28:
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	strchr@PLT
	testq	%rax, %rax
	je	.L26
	movl	n(%rip), %eax
	subl	$1, %eax
	cmpl	%eax, -12(%rbp)
	jge	.L27
	movl	-12(%rbp), %eax
	cltq
	leaq	1(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L27
	movl	-12(%rbp), %eax
	cltq
	leaq	1(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movb	$67, (%rax)
	jmp	.L13
.L27:
	cmpl	$0, -12(%rbp)
	jle	.L26
	movl	-12(%rbp), %eax
	cltq
	leaq	-1(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L26
	movl	-12(%rbp), %eax
	cltq
	leaq	-1(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movb	$67, (%rax)
	jmp	.L13
.L26:
	addl	$1, -12(%rbp)
.L25:
	movl	n(%rip), %eax
	subl	$1, %eax
	cmpl	%eax, -12(%rbp)
	jl	.L28
	jmp	.L13
.L22:
	cmpb	$68, -28(%rbp)
	jne	.L13
	cmpl	$0, -32(%rbp)
	jne	.L29
	movq	-24(%rbp), %rax
	movb	$68, (%rax)
	jmp	.L13
.L29:
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	sit_down_D
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	sit_down, .-sit_down
	.globl	display
	.type	display, @function
display:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	$0, -4(%rbp)
	jmp	.L31
.L32:
	movl	-4(%rbp), %eax
	cltq
	leaq	seat(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar@PLT
	addl	$1, -4(%rbp)
.L31:
	movl	n(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L32
	movl	$10, %edi
	call	putchar@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	display, .-display
	.section	.rodata
.LC1:
	.string	"%c "
.LC2:
	.string	"%d %d "
	.text
	.globl	main
	.type	main, @function
main:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L34
.L38:
	movl	$101, %edx
	movl	$35, %esi
	leaq	seat(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movb	$0, 100+seat(%rip)
	movl	$0, -12(%rbp)
	jmp	.L35
.L36:
	leaq	-13(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movzbl	-13(%rbp), %eax
	movsbl	%al, %eax
	movl	-12(%rbp), %edx
	movl	%eax, %esi
	leaq	seat(%rip), %rax
	movq	%rax, %rdi
	call	sit_down
	addl	$1, -12(%rbp)
.L35:
	movl	m(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L36
	movl	$0, %eax
	call	display
.L34:
	leaq	m(%rip), %rax
	movq	%rax, %rdx
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L37
	movl	n(%rip), %eax
	testl	%eax, %eax
	jne	.L38
	movl	m(%rip), %eax
	testl	%eax, %eax
	jne	.L38
.L37:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L40
	call	__stack_chk_fail@PLT
.L40:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.p2align 4
	.globl	sit_down_D
	.type	sit_down_D, @function
sit_down_D:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$112, %rsp
	.cfi_def_cfa_offset 160
	movdqa	.LC0(%rip), %xmm0
	movl	n(%rip), %ebx
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	movl	$2139062143, 96(%rsp)
	movb	$127, 100(%rsp)
	movaps	%xmm0, (%rsp)
	movaps	%xmm0, 16(%rsp)
	movaps	%xmm0, 32(%rsp)
	movaps	%xmm0, 48(%rsp)
	movaps	%xmm0, 64(%rsp)
	movaps	%xmm0, 80(%rsp)
	testl	%ebx, %ebx
	jle	.L2
	movq	%rsp, %r13
	movslq	%ebx, %r10
	xorl	%r11d, %r11d
	movq	%r13, %r9
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L3:
	addq	$1, %r11
	addq	$1, %r9
	cmpq	%r10, %r11
	je	.L16
.L7:
	cmpb	$35, 0(%rbp,%r11)
	movl	%r11d, %edi
	je	.L3
	movq	%r9, %rcx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L6:
	movl	%eax, %edx
	movl	%eax, %r8d
	cmpl	%eax, %edi
	js	.L4
	movsbl	(%rcx), %esi
	cmpl	%eax, %esi
	cmovg	%eax, %esi
	movb	%sil, (%rcx)
.L4:
	addl	%edi, %edx
	cmpl	%edx, %ebx
	jle	.L5
	movsbl	(%r9,%rax), %edx
	cmpl	%r8d, %edx
	cmovg	%r8d, %edx
	movb	%dl, (%r9,%rax)
.L5:
	addq	$1, %rax
	subq	$1, %rcx
	cmpq	%r10, %rax
	jne	.L6
	addq	$1, %r11
	addq	$1, %r9
	cmpq	%r10, %r11
	jne	.L7
.L16:
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L9:
	movsbl	0(%r13,%rax), %edx
	cmpl	%ecx, %edx
	jle	.L8
	movslq	%eax, %r12
	movl	%edx, %ecx
.L8:
	addq	$1, %rax
	cmpq	%r10, %rax
	jne	.L9
.L2:
	movb	$68, 0(%rbp,%r12)
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$112, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L17:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	sit_down_D, .-sit_down_D
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"ABCD"
	.text
	.p2align 4
	.type	sit_down.part.0, @function
sit_down.part.0:
.LFB39:
	.cfi_startproc
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	cmpb	$66, %sil
	je	.L45
	cmpb	$67, %sil
	je	.L46
	cmpb	$68, %sil
	je	.L47
.L18:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L46:
	.cfi_restore_state
	movl	n(%rip), %r12d
	testl	%edx, %edx
	je	.L26
	subl	$1, %r12d
	leaq	-1(%rdi), %rbx
	xorl	%ebp, %ebp
	leaq	.LC1(%rip), %r13
	testl	%r12d, %r12d
	jg	.L31
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L30:
	testl	%ebp, %ebp
	je	.L29
	cmpb	$35, (%rbx)
	je	.L48
.L29:
	addl	$1, %ebp
	addq	$1, %rbx
	cmpl	%r12d, %ebp
	je	.L18
.L31:
	movsbl	1(%rbx), %esi
	movq	%r13, %rdi
	call	strchr@PLT
	testq	%rax, %rax
	je	.L29
	cmpb	$35, 2(%rbx)
	jne	.L30
	movb	$67, 2(%rbx)
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L45:
	movslq	n(%rip), %rdx
	leaq	-1(%rdi,%rdx), %rax
	movq	%rdx, %rcx
	cmpb	$35, (%rax)
	je	.L49
.L20:
	leal	-2(%rcx), %eax
	testl	%eax, %eax
	jle	.L22
	subq	$3, %rdx
	subl	$3, %ecx
	cltq
	subq	%rcx, %rdx
	addq	%rdi, %rax
	addq	%rdi, %rdx
	.p2align 4,,10
	.p2align 3
.L24:
	cmpb	$65, -1(%rax)
	je	.L23
	cmpb	$65, 1(%rax)
	je	.L23
	cmpb	$35, (%rax)
	je	.L44
.L23:
	subq	$1, %rax
	cmpq	%rax, %rdx
	jne	.L24
.L22:
	movl	$35, %esi
	call	strchr@PLT
.L44:
	movb	$66, (%rax)
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L26:
	.cfi_restore_state
	testb	$1, %r12b
	je	.L28
	addl	$1, %r12d
	movl	%r12d, %eax
	shrl	$31, %eax
	addl	%r12d, %eax
	sarl	%eax
	cltq
	movb	$67, -1(%rdi,%rax)
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L47:
	testl	%edx, %edx
	jne	.L32
	movb	$68, (%rdi)
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L49:
	cmpb	$65, -2(%rdi,%rdx)
	jne	.L44
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L28:
	movl	%r12d, %eax
	shrl	$31, %eax
	addl	%r12d, %eax
	sarl	%eax
	cltq
	movb	$67, (%rdi,%rax)
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L32:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	jmp	sit_down_D
.L48:
	.cfi_restore_state
	movb	$67, (%rbx)
	jmp	.L18
	.cfi_endproc
.LFE39:
	.size	sit_down.part.0, .-sit_down.part.0
	.p2align 4
	.globl	sit_down
	.type	sit_down, @function
sit_down:
.LFB36:
	.cfi_startproc
	endbr64
	cmpb	$65, %sil
	je	.L57
	movsbl	%sil, %esi
	jmp	sit_down.part.0
	.p2align 4,,10
	.p2align 3
.L57:
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	movl	$35, %esi
	call	strchr@PLT
	movb	$65, (%rax)
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE36:
	.size	sit_down, .-sit_down
	.p2align 4
	.globl	display
	.type	display, @function
display:
.LFB37:
	.cfi_startproc
	endbr64
	movl	n(%rip), %eax
	testl	%eax, %eax
	jle	.L63
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	seat(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	xorl	%ebx, %ebx
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	.p2align 4,,10
	.p2align 3
.L60:
	movsbl	0(%rbp,%rbx), %edi
	addq	$1, %rbx
	call	putchar@PLT
	cmpl	%ebx, n(%rip)
	jg	.L60
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	movl	$10, %edi
	popq	%rbx
	.cfi_restore 3
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_restore 6
	.cfi_def_cfa_offset 8
	jmp	putchar@PLT
	.p2align 4,,10
	.p2align 3
.L63:
	movl	$10, %edi
	jmp	putchar@PLT
	.cfi_endproc
.LFE37:
	.size	display, .-display
	.section	.rodata.str1.1
.LC2:
	.string	"%c "
.LC3:
	.string	"%d %d "
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB38:
	.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	.LC2(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movabsq	$2531906049332683555, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movabsq	$2531906049332683555, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	seat(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	7(%rsp), %r15
	.p2align 4,,10
	.p2align 3
.L67:
	xorl	%eax, %eax
	leaq	m(%rip), %rdx
	leaq	n(%rip), %rsi
	leaq	.LC3(%rip), %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L75
	movl	n(%rip), %edx
	movl	m(%rip), %eax
	testl	%edx, %edx
	jne	.L76
	testl	%eax, %eax
	je	.L75
	movq	%r12, seat(%rip)
	movq	%r13, 8+seat(%rip)
	movq	%r12, 16+seat(%rip)
	movq	%r13, 24+seat(%rip)
	movq	%r12, 32+seat(%rip)
	movq	%r13, 40+seat(%rip)
	movq	%r12, 48+seat(%rip)
	movq	%r13, 56+seat(%rip)
	movq	%r12, 64+seat(%rip)
	movq	%r13, 72+seat(%rip)
	movq	%r12, 80+seat(%rip)
	movq	%r13, 88+seat(%rip)
	movl	$589505315, 96+seat(%rip)
	movb	$0, 100+seat(%rip)
	jle	.L70
.L68:
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L74:
	movq	%r15, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movsbl	7(%rsp), %esi
	cmpb	$65, %sil
	je	.L87
	movl	%ebx, %edx
	movq	%rbp, %rdi
	addl	$1, %ebx
	call	sit_down.part.0
	cmpl	%ebx, m(%rip)
	jg	.L74
.L73:
	movl	n(%rip), %ecx
	xorl	%ebx, %ebx
	testl	%ecx, %ecx
	jle	.L70
	.p2align 4,,10
	.p2align 3
.L69:
	movsbl	0(%rbp,%rbx), %edi
	addq	$1, %rbx
	call	putchar@PLT
	cmpl	%ebx, n(%rip)
	jg	.L69
.L70:
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L67
	.p2align 4,,10
	.p2align 3
.L87:
	movl	$35, %esi
	movq	%rbp, %rdi
	addl	$1, %ebx
	call	strchr@PLT
	cmpl	m(%rip), %ebx
	movb	$65, (%rax)
	jl	.L74
	jmp	.L73
	.p2align 4,,10
	.p2align 3
.L76:
	movq	%r12, seat(%rip)
	movq	%r13, 8+seat(%rip)
	movq	%r12, 16+seat(%rip)
	movq	%r13, 24+seat(%rip)
	movq	%r12, 32+seat(%rip)
	movq	%r13, 40+seat(%rip)
	movq	%r12, 48+seat(%rip)
	movq	%r13, 56+seat(%rip)
	movq	%r12, 64+seat(%rip)
	movq	%r13, 72+seat(%rip)
	movq	%r12, 80+seat(%rip)
	movq	%r13, 88+seat(%rip)
	movl	$589505315, 96+seat(%rip)
	movb	$0, 100+seat(%rip)
	testl	%eax, %eax
	jg	.L68
	jmp	.L73
	.p2align 4,,10
	.p2align 3
.L75:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L88
	addq	$24, %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
.L88:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE38:
	.size	main, .-main
	.globl	seat
	.bss
	.align 32
	.type	seat, @object
	.size	seat, 101
seat:
	.zero	101
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.quad	9187201950435737471
	.quad	9187201950435737471
	.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	sit_down_D
	.type	sit_down_D, @function
sit_down_D:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$112, %rsp
	.cfi_def_cfa_offset 160
	movdqa	.LC0(%rip), %xmm0
	movl	n(%rip), %ebx
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	movl	$2139062143, 96(%rsp)
	movb	$127, 100(%rsp)
	movaps	%xmm0, (%rsp)
	movaps	%xmm0, 16(%rsp)
	movaps	%xmm0, 32(%rsp)
	movaps	%xmm0, 48(%rsp)
	movaps	%xmm0, 64(%rsp)
	movaps	%xmm0, 80(%rsp)
	testl	%ebx, %ebx
	jle	.L2
	movq	%rsp, %r13
	movslq	%ebx, %r10
	xorl	%r11d, %r11d
	movq	%r13, %r9
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L3:
	addq	$1, %r11
	addq	$1, %r9
	cmpq	%r10, %r11
	je	.L16
.L7:
	cmpb	$35, 0(%rbp,%r11)
	movl	%r11d, %edi
	je	.L3
	movq	%r9, %rcx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L6:
	movl	%eax, %edx
	movl	%eax, %r8d
	cmpl	%eax, %edi
	js	.L4
	movsbl	(%rcx), %esi
	cmpl	%eax, %esi
	cmovg	%eax, %esi
	movb	%sil, (%rcx)
.L4:
	addl	%edi, %edx
	cmpl	%edx, %ebx
	jle	.L5
	movsbl	(%r9,%rax), %edx
	cmpl	%r8d, %edx
	cmovg	%r8d, %edx
	movb	%dl, (%r9,%rax)
.L5:
	addq	$1, %rax
	subq	$1, %rcx
	cmpq	%r10, %rax
	jne	.L6
	addq	$1, %r11
	addq	$1, %r9
	cmpq	%r10, %r11
	jne	.L7
.L16:
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L9:
	movsbl	0(%r13,%rax), %edx
	cmpl	%ecx, %edx
	jle	.L8
	movslq	%eax, %r12
	movl	%edx, %ecx
.L8:
	addq	$1, %rax
	cmpq	%r10, %rax
	jne	.L9
.L2:
	movb	$68, 0(%rbp,%r12)
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$112, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L17:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	sit_down_D, .-sit_down_D
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"ABCD"
	.text
	.p2align 4
	.type	sit_down.part.0, @function
sit_down.part.0:
.LFB39:
	.cfi_startproc
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	cmpb	$66, %sil
	je	.L45
	cmpb	$67, %sil
	je	.L46
	cmpb	$68, %sil
	je	.L47
.L18:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L46:
	.cfi_restore_state
	movl	n(%rip), %r12d
	testl	%edx, %edx
	je	.L26
	subl	$1, %r12d
	leaq	-1(%rdi), %rbx
	xorl	%ebp, %ebp
	leaq	.LC1(%rip), %r13
	testl	%r12d, %r12d
	jg	.L31
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L30:
	testl	%ebp, %ebp
	je	.L29
	cmpb	$35, (%rbx)
	je	.L48
.L29:
	addl	$1, %ebp
	addq	$1, %rbx
	cmpl	%r12d, %ebp
	je	.L18
.L31:
	movsbl	1(%rbx), %esi
	movq	%r13, %rdi
	call	strchr@PLT
	testq	%rax, %rax
	je	.L29
	cmpb	$35, 2(%rbx)
	jne	.L30
	movb	$67, 2(%rbx)
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L45:
	movslq	n(%rip), %rdx
	leaq	-1(%rdi,%rdx), %rax
	movq	%rdx, %rcx
	cmpb	$35, (%rax)
	je	.L49
.L20:
	leal	-2(%rcx), %eax
	testl	%eax, %eax
	jle	.L22
	subq	$3, %rdx
	subl	$3, %ecx
	cltq
	subq	%rcx, %rdx
	addq	%rdi, %rax
	addq	%rdi, %rdx
	.p2align 4,,10
	.p2align 3
.L24:
	cmpb	$65, -1(%rax)
	je	.L23
	cmpb	$65, 1(%rax)
	je	.L23
	cmpb	$35, (%rax)
	je	.L44
.L23:
	subq	$1, %rax
	cmpq	%rax, %rdx
	jne	.L24
.L22:
	movl	$35, %esi
	call	strchr@PLT
.L44:
	movb	$66, (%rax)
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L26:
	.cfi_restore_state
	testb	$1, %r12b
	je	.L28
	addl	$1, %r12d
	movl	%r12d, %eax
	shrl	$31, %eax
	addl	%r12d, %eax
	sarl	%eax
	cltq
	movb	$67, -1(%rdi,%rax)
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L47:
	testl	%edx, %edx
	jne	.L32
	movb	$68, (%rdi)
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L49:
	cmpb	$65, -2(%rdi,%rdx)
	jne	.L44
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L28:
	movl	%r12d, %eax
	shrl	$31, %eax
	addl	%r12d, %eax
	sarl	%eax
	cltq
	movb	$67, (%rdi,%rax)
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L32:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	jmp	sit_down_D
.L48:
	.cfi_restore_state
	movb	$67, (%rbx)
	jmp	.L18
	.cfi_endproc
.LFE39:
	.size	sit_down.part.0, .-sit_down.part.0
	.p2align 4
	.globl	sit_down
	.type	sit_down, @function
sit_down:
.LFB36:
	.cfi_startproc
	endbr64
	cmpb	$65, %sil
	je	.L57
	movsbl	%sil, %esi
	jmp	sit_down.part.0
	.p2align 4,,10
	.p2align 3
.L57:
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	movl	$35, %esi
	call	strchr@PLT
	movb	$65, (%rax)
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE36:
	.size	sit_down, .-sit_down
	.p2align 4
	.globl	display
	.type	display, @function
display:
.LFB37:
	.cfi_startproc
	endbr64
	movl	n(%rip), %eax
	testl	%eax, %eax
	jle	.L63
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	seat(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	xorl	%ebx, %ebx
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	.p2align 4,,10
	.p2align 3
.L60:
	movsbl	0(%rbp,%rbx), %edi
	addq	$1, %rbx
	call	putchar@PLT
	cmpl	%ebx, n(%rip)
	jg	.L60
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	movl	$10, %edi
	popq	%rbx
	.cfi_restore 3
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_restore 6
	.cfi_def_cfa_offset 8
	jmp	putchar@PLT
	.p2align 4,,10
	.p2align 3
.L63:
	movl	$10, %edi
	jmp	putchar@PLT
	.cfi_endproc
.LFE37:
	.size	display, .-display
	.section	.rodata.str1.1
.LC2:
	.string	"%c "
.LC3:
	.string	"%d %d "
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB38:
	.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	.LC2(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movabsq	$2531906049332683555, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movabsq	$2531906049332683555, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	seat(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	7(%rsp), %r15
	.p2align 4,,10
	.p2align 3
.L67:
	xorl	%eax, %eax
	leaq	m(%rip), %rdx
	leaq	n(%rip), %rsi
	leaq	.LC3(%rip), %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L75
	movl	n(%rip), %edx
	movl	m(%rip), %eax
	testl	%edx, %edx
	jne	.L76
	testl	%eax, %eax
	je	.L75
	movq	%r12, seat(%rip)
	movq	%r13, 8+seat(%rip)
	movq	%r12, 16+seat(%rip)
	movq	%r13, 24+seat(%rip)
	movq	%r12, 32+seat(%rip)
	movq	%r13, 40+seat(%rip)
	movq	%r12, 48+seat(%rip)
	movq	%r13, 56+seat(%rip)
	movq	%r12, 64+seat(%rip)
	movq	%r13, 72+seat(%rip)
	movq	%r12, 80+seat(%rip)
	movq	%r13, 88+seat(%rip)
	movl	$589505315, 96+seat(%rip)
	movb	$0, 100+seat(%rip)
	jle	.L70
.L68:
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L74:
	movq	%r15, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movsbl	7(%rsp), %esi
	cmpb	$65, %sil
	je	.L87
	movl	%ebx, %edx
	movq	%rbp, %rdi
	addl	$1, %ebx
	call	sit_down.part.0
	cmpl	%ebx, m(%rip)
	jg	.L74
.L73:
	movl	n(%rip), %ecx
	xorl	%ebx, %ebx
	testl	%ecx, %ecx
	jle	.L70
	.p2align 4,,10
	.p2align 3
.L69:
	movsbl	0(%rbp,%rbx), %edi
	addq	$1, %rbx
	call	putchar@PLT
	cmpl	%ebx, n(%rip)
	jg	.L69
.L70:
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L67
	.p2align 4,,10
	.p2align 3
.L87:
	movl	$35, %esi
	movq	%rbp, %rdi
	addl	$1, %ebx
	call	strchr@PLT
	cmpl	m(%rip), %ebx
	movb	$65, (%rax)
	jl	.L74
	jmp	.L73
	.p2align 4,,10
	.p2align 3
.L76:
	movq	%r12, seat(%rip)
	movq	%r13, 8+seat(%rip)
	movq	%r12, 16+seat(%rip)
	movq	%r13, 24+seat(%rip)
	movq	%r12, 32+seat(%rip)
	movq	%r13, 40+seat(%rip)
	movq	%r12, 48+seat(%rip)
	movq	%r13, 56+seat(%rip)
	movq	%r12, 64+seat(%rip)
	movq	%r13, 72+seat(%rip)
	movq	%r12, 80+seat(%rip)
	movq	%r13, 88+seat(%rip)
	movl	$589505315, 96+seat(%rip)
	movb	$0, 100+seat(%rip)
	testl	%eax, %eax
	jg	.L68
	jmp	.L73
	.p2align 4,,10
	.p2align 3
.L75:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L88
	addq	$24, %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
.L88:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE38:
	.size	main, .-main
	.globl	seat
	.bss
	.align 32
	.type	seat, @object
	.size	seat, 101
seat:
	.zero	101
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.quad	9187201950435737471
	.quad	9187201950435737471
	.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:

/*
  AOJ 0199
  Title:Chairs Where Demanding People Sit
  @kankichi573
*/
#include <stdio.h>
#include <string.h>
#define max(x,y) (((x)>(y))?(x):(y))
#define min(x,y) (((x)<(y))?(x):(y))

int n,m;
char seat[101];

void sit_down_D(char seat[])
{
  char dist[101];
  int i,j,max_,max_s;

  memset(dist,127,sizeof(dist));
  for(i=0;i<n;i++)
    if(seat[i]!='#')
      for(j=0;j<n;j++)
	{
	  if(i-j>=0) 
	    dist[i-j]=min(dist[i-j],j);
	  if(i+j<n) 
	    dist[i+j]=min(dist[i+j],j);
	}
#ifdef DEBUG
  for(i=0;i<n;i++)
    printf("%d",dist[i]);
  printf("\n");
#endif
  for(i=max_=0;i<n;i++)
    if(max_<dist[i])
      {
	max_=dist[i];
	max_s=i;
      }
  seat[max_s]='D';
}
void sit_down(char seat[],char guest,int order)
{
  char *p;
  int i;

  if(guest=='A')
    {
      p=strchr(seat,'#');
      *p='A';
    }
  else if(guest=='B')
    {
      if(seat[n-1]=='#' && seat[n-2]!='A')
	seat[n-1]='B';
      else 
	{
	  for(i=n-2;i>0;i--)
	    if(seat[i-1]!='A' && seat[i+1]!='A' && seat[i]=='#')
	      {
		seat[i]='B';
		return;
	      }
	  p=strchr(seat,'#');
	  *p='B';
	}
    }
  else if(guest=='C')
    {
      if(order==0)
	{
	  if(n & 1)
	    seat[(n+1)/2-1]='C';
	  else
	    seat[n/2]='C';
	}
      else
	{
	  for(i=0;i<n-1;i++)
	    if(strchr("ABCD",seat[i]))
	      {
		if(i<n-1 && seat[i+1]=='#')
		  {
		    seat[i+1]='C';
		    return;
		  }
		if(i>0 && seat[i-1]=='#')
		  {
		    seat[i-1]='C';
		    return;
		  }
	      }
	}
    }
  else if(guest=='D')
    {
      if(order==0)
	seat[0]='D';
      else
	sit_down_D(seat);
    }
}
void display()
{
  int i;
  for(i=0;i<n;i++)
    printf("%c",seat[i]);
  printf("\n");
}

main()
{
  int i,ret;
  char guest;
  
  while(scanf("%d %d ",&n,&m)  && (n||m))
    {
      memset(seat,'#',sizeof(seat));
      seat[100]='\0';
      for(i=0;i<m;i++)
	{
	  scanf("%c ",&guest);
	  sit_down(seat,guest,i);
#ifdef DEBUG
	  display();
#endif
	}
      display();
    }
  return(0);
}
5 4
A
C
C
D
5 4
D
C
B
A
0 0
 5 4
A
C
C
D
5 4
D
D
B
A
0 0
 5 4
A
C
C
D
4 4
D
C
B
A
0 0
 5 4
A
D
C
D
5 4
D
D
B
A
0 0
 5 4
A
C
C
D
4 4
D
C
C
A
0 0
 5 4
A
C
B
D
4 4
D
C
C
A
0 0
 5 4
A
C
C
D
4 4
D
B
B
A
0 0
 5 4
A
B
B
D
4 4
D
C
C
A
0 0
 5 4
A
C
D
D
4 4
D
B
B
A
0 0
 5 4
A
C
D
D
8 4
D
B
B
A
0 0

ACC#D
DCA#B
 ACC#D
DA#BD
 ACC#D
DCAB
 ACD#D
DA#BD
 ACC#D
DCCA
 ACD#B
DCCA
 ACC#D
DABB
 AD#BB
DCCA
 ACD#D
DABB
 ACD#D
DA####BB

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

```c
/*
  AOJ 0199
  Title:Chairs Where Demanding People Sit
  @kankichi573
*/
#include <stdio.h>
#include <string.h>
#define max(x,y) (((x)>(y))?(x):(y))
#define min(x,y) (((x)<(y))?(x):(y))

int n,m;
char seat[101];

void sit_down_D(char seat[])
{
  char dist[101];
  int i,j,max_,max_s;

  memset(dist,127,sizeof(dist));
  for(i=0;i<n;i++)
    if(seat[i]!='#')
      for(j=0;j<n;j++)
	{
	  if(i-j>=0) 
	    dist[i-j]=min(dist[i-j],j);
	  if(i+j<n) 
	    dist[i+j]=min(dist[i+j],j);
	}
#ifdef DEBUG
  for(i=0;i<n;i++)
    printf("%d",dist[i]);
  printf("\n");
#endif
  for(i=max_=0;i<n;i++)
    if(max_<dist[i])
      {
	max_=dist[i];
	max_s=i;
      }
  seat[max_s]='D';
}
void sit_down(char seat[],char guest,int order)
{
  char *p;
  int i;

  if(guest=='A')
    {
      p=strchr(seat,'#');
      *p='A';
    }
  else if(guest=='B')
    {
      if(seat[n-1]=='#' && seat[n-2]!='A')
	seat[n-1]='B';
      else 
	{
	  for(i=n-2;i>0;i--)
	    if(seat[i-1]!='A' && seat[i+1]!='A' && seat[i]=='#')
	      {
		seat[i]='B';
		return;
	      }
	  p=strchr(seat,'#');
	  *p='B';
	}
    }
  else if(guest=='C')
    {
      if(order==0)
	{
	  if(n & 1)
	    seat[(n+1)/2-1]='C';
	  else
	    seat[n/2]='C';
	}
      else
	{
	  for(i=0;i<n-1;i++)
	    if(strchr("ABCD",seat[i]))
	      {
		if(i<n-1 && seat[i+1]=='#')
		  {
		    seat[i+1]='C';
		    return;
		  }
		if(i>0 && seat[i-1]=='#')
		  {
		    seat[i-1]='C';
		    return;
		  }
	      }
	}
    }
  else if(guest=='D')
    {
      if(order==0)
	seat[0]='D';
      else
	sit_down_D(seat);
    }
}
void display()
{
  int i;
  for(i=0;i<n;i++)
    printf("%c",seat[i]);
  printf("\n");
}

main()
{
  int i,ret;
  char guest;
  
  while(scanf("%d %d ",&n,&m)  && (n||m))
    {
      memset(seat,'#',sizeof(seat));
      seat[100]='\0';
      for(i=0;i<m;i++)
	{
	  scanf("%c ",&guest);
	  sit_down(seat,guest,i);
#ifdef DEBUG
	  display();
#endif
	}
      display();
    }
  return(0);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	seat
	.align 32
	.type	seat, @object
	.size	seat, 101
seat:
	.zero	101
	.text
	.globl	sit_down_D
	.type	sit_down_D, @function
sit_down_D:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$144, %rsp
	movq	%rdi, -136(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-112(%rbp), %rax
	movl	$101, %edx
	movl	$127, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -128(%rbp)
	jmp	.L2
.L8:
	movl	-128(%rbp), %eax
	movslq	%eax, %rdx
	movq	-136(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	je	.L3
	movl	$0, -124(%rbp)
	jmp	.L4
.L7:
	movl	-128(%rbp), %eax
	subl	-124(%rbp), %eax
	testl	%eax, %eax
	js	.L5
	movl	-128(%rbp), %eax
	subl	-124(%rbp), %eax
	cltq
	movzbl	-112(%rbp,%rax), %eax
	movsbl	%al, %edx
	movl	-124(%rbp), %eax
	cmpl	%eax, %edx
	cmovg	%eax, %edx
	movl	-128(%rbp), %eax
	subl	-124(%rbp), %eax
	cltq
	movb	%dl, -112(%rbp,%rax)
.L5:
	movl	-128(%rbp), %edx
	movl	-124(%rbp), %eax
	addl	%eax, %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jge	.L6
	movl	-128(%rbp), %edx
	movl	-124(%rbp), %eax
	addl	%edx, %eax
	cltq
	movzbl	-112(%rbp,%rax), %eax
	movsbl	%al, %edx
	movl	-124(%rbp), %eax
	cmpl	%eax, %edx
	cmovg	%eax, %edx
	movl	-128(%rbp), %ecx
	movl	-124(%rbp), %eax
	addl	%ecx, %eax
	cltq
	movb	%dl, -112(%rbp,%rax)
.L6:
	addl	$1, -124(%rbp)
.L4:
	movl	n(%rip), %eax
	cmpl	%eax, -124(%rbp)
	jl	.L7
.L3:
	addl	$1, -128(%rbp)
.L2:
	movl	n(%rip), %eax
	cmpl	%eax, -128(%rbp)
	jl	.L8
	movl	$0, -120(%rbp)
	movl	-120(%rbp), %eax
	movl	%eax, -128(%rbp)
	jmp	.L9
.L11:
	movl	-128(%rbp), %eax
	cltq
	movzbl	-112(%rbp,%rax), %eax
	movsbl	%al, %eax
	cmpl	%eax, -120(%rbp)
	jge	.L10
	movl	-128(%rbp), %eax
	cltq
	movzbl	-112(%rbp,%rax), %eax
	movsbl	%al, %eax
	movl	%eax, -120(%rbp)
	movl	-128(%rbp), %eax
	movl	%eax, -116(%rbp)
.L10:
	addl	$1, -128(%rbp)
.L9:
	movl	n(%rip), %eax
	cmpl	%eax, -128(%rbp)
	jl	.L11
	movl	-116(%rbp), %eax
	movslq	%eax, %rdx
	movq	-136(%rbp), %rax
	addq	%rdx, %rax
	movb	$68, (%rax)
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	sit_down_D, .-sit_down_D
	.section	.rodata
.LC0:
	.string	"ABCD"
	.text
	.globl	sit_down
	.type	sit_down, @function
sit_down:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	movl	%esi, %eax
	movl	%edx, -32(%rbp)
	movb	%al, -28(%rbp)
	cmpb	$65, -28(%rbp)
	jne	.L14
	movq	-24(%rbp), %rax
	movl	$35, %esi
	movq	%rax, %rdi
	call	strchr@PLT
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	movb	$65, (%rax)
	jmp	.L13
.L14:
	cmpb	$66, -28(%rbp)
	jne	.L16
	movl	n(%rip), %eax
	cltq
	leaq	-1(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L17
	movl	n(%rip), %eax
	cltq
	leaq	-2(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$65, %al
	je	.L17
	movl	n(%rip), %eax
	cltq
	leaq	-1(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movb	$66, (%rax)
	jmp	.L13
.L17:
	movl	n(%rip), %eax
	subl	$2, %eax
	movl	%eax, -12(%rbp)
	jmp	.L19
.L21:
	movl	-12(%rbp), %eax
	cltq
	leaq	-1(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$65, %al
	je	.L20
	movl	-12(%rbp), %eax
	cltq
	leaq	1(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$65, %al
	je	.L20
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L20
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movb	$66, (%rax)
	jmp	.L13
.L20:
	subl	$1, -12(%rbp)
.L19:
	cmpl	$0, -12(%rbp)
	jg	.L21
	movq	-24(%rbp), %rax
	movl	$35, %esi
	movq	%rax, %rdi
	call	strchr@PLT
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	movb	$66, (%rax)
	jmp	.L13
.L16:
	cmpb	$67, -28(%rbp)
	jne	.L22
	cmpl	$0, -32(%rbp)
	jne	.L23
	movl	n(%rip), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L24
	movl	n(%rip), %eax
	addl	$1, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cltq
	leaq	-1(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movb	$67, (%rax)
	jmp	.L13
.L24:
	movl	n(%rip), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movb	$67, (%rax)
	jmp	.L13
.L23:
	movl	$0, -12(%rbp)
	jmp	.L25
.L28:
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	strchr@PLT
	testq	%rax, %rax
	je	.L26
	movl	n(%rip), %eax
	subl	$1, %eax
	cmpl	%eax, -12(%rbp)
	jge	.L27
	movl	-12(%rbp), %eax
	cltq
	leaq	1(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L27
	movl	-12(%rbp), %eax
	cltq
	leaq	1(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movb	$67, (%rax)
	jmp	.L13
.L27:
	cmpl	$0, -12(%rbp)
	jle	.L26
	movl	-12(%rbp), %eax
	cltq
	leaq	-1(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L26
	movl	-12(%rbp), %eax
	cltq
	leaq	-1(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movb	$67, (%rax)
	jmp	.L13
.L26:
	addl	$1, -12(%rbp)
.L25:
	movl	n(%rip), %eax
	subl	$1, %eax
	cmpl	%eax, -12(%rbp)
	jl	.L28
	jmp	.L13
.L22:
	cmpb	$68, -28(%rbp)
	jne	.L13
	cmpl	$0, -32(%rbp)
	jne	.L29
	movq	-24(%rbp), %rax
	movb	$68, (%rax)
	jmp	.L13
.L29:
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	sit_down_D
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	sit_down, .-sit_down
	.globl	display
	.type	display, @function
display:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	$0, -4(%rbp)
	jmp	.L31
.L32:
	movl	-4(%rbp), %eax
	cltq
	leaq	seat(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar@PLT
	addl	$1, -4(%rbp)
.L31:
	movl	n(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L32
	movl	$10, %edi
	call	putchar@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	display, .-display
	.section	.rodata
.LC1:
	.string	"%c "
.LC2:
	.string	"%d %d "
	.text
	.globl	main
	.type	main, @function
main:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L34
.L38:
	movl	$101, %edx
	movl	$35, %esi
	leaq	seat(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movb	$0, 100+seat(%rip)
	movl	$0, -12(%rbp)
	jmp	.L35
.L36:
	leaq	-13(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movzbl	-13(%rbp), %eax
	movsbl	%al, %eax
	movl	-12(%rbp), %edx
	movl	%eax, %esi
	leaq	seat(%rip), %rax
	movq	%rax, %rdi
	call	sit_down
	addl	$1, -12(%rbp)
.L35:
	movl	m(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L36
	movl	$0, %eax
	call	display
.L34:
	leaq	m(%rip), %rax
	movq	%rax, %rdx
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L37
	movl	n(%rip), %eax
	testl	%eax, %eax
	jne	.L38
	movl	m(%rip), %eax
	testl	%eax, %eax
	jne	.L38
.L37:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L40
	call	__stack_chk_fail@PLT
.L40:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	seat
	.align 32
	.type	seat, @object
	.size	seat, 101
seat:
	.zero	101
	.text
	.globl	sit_down_D
	.type	sit_down_D, @function
sit_down_D:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$144, %rsp
	movq	%rdi, -136(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-112(%rbp), %rax
	movl	$101, %edx
	movl	$127, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -128(%rbp)
	jmp	.L2
.L8:
	movl	-128(%rbp), %eax
	movslq	%eax, %rdx
	movq	-136(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	je	.L3
	movl	$0, -124(%rbp)
	jmp	.L4
.L7:
	movl	-128(%rbp), %eax
	subl	-124(%rbp), %eax
	testl	%eax, %eax
	js	.L5
	movl	-128(%rbp), %eax
	subl	-124(%rbp), %eax
	cltq
	movzbl	-112(%rbp,%rax), %eax
	movsbl	%al, %edx
	movl	-124(%rbp), %eax
	cmpl	%eax, %edx
	cmovg	%eax, %edx
	movl	-128(%rbp), %eax
	subl	-124(%rbp), %eax
	cltq
	movb	%dl, -112(%rbp,%rax)
.L5:
	movl	-128(%rbp), %edx
	movl	-124(%rbp), %eax
	addl	%eax, %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jge	.L6
	movl	-128(%rbp), %edx
	movl	-124(%rbp), %eax
	addl	%edx, %eax
	cltq
	movzbl	-112(%rbp,%rax), %eax
	movsbl	%al, %edx
	movl	-124(%rbp), %eax
	cmpl	%eax, %edx
	cmovg	%eax, %edx
	movl	-128(%rbp), %ecx
	movl	-124(%rbp), %eax
	addl	%ecx, %eax
	cltq
	movb	%dl, -112(%rbp,%rax)
.L6:
	addl	$1, -124(%rbp)
.L4:
	movl	n(%rip), %eax
	cmpl	%eax, -124(%rbp)
	jl	.L7
.L3:
	addl	$1, -128(%rbp)
.L2:
	movl	n(%rip), %eax
	cmpl	%eax, -128(%rbp)
	jl	.L8
	movl	$0, -120(%rbp)
	movl	-120(%rbp), %eax
	movl	%eax, -128(%rbp)
	jmp	.L9
.L11:
	movl	-128(%rbp), %eax
	cltq
	movzbl	-112(%rbp,%rax), %eax
	movsbl	%al, %eax
	cmpl	%eax, -120(%rbp)
	jge	.L10
	movl	-128(%rbp), %eax
	cltq
	movzbl	-112(%rbp,%rax), %eax
	movsbl	%al, %eax
	movl	%eax, -120(%rbp)
	movl	-128(%rbp), %eax
	movl	%eax, -116(%rbp)
.L10:
	addl	$1, -128(%rbp)
.L9:
	movl	n(%rip), %eax
	cmpl	%eax, -128(%rbp)
	jl	.L11
	movl	-116(%rbp), %eax
	movslq	%eax, %rdx
	movq	-136(%rbp), %rax
	addq	%rdx, %rax
	movb	$68, (%rax)
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	sit_down_D, .-sit_down_D
	.section	.rodata
.LC0:
	.string	"ABCD"
	.text
	.globl	sit_down
	.type	sit_down, @function
sit_down:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	movl	%esi, %eax
	movl	%edx, -32(%rbp)
	movb	%al, -28(%rbp)
	cmpb	$65, -28(%rbp)
	jne	.L14
	movq	-24(%rbp), %rax
	movl	$35, %esi
	movq	%rax, %rdi
	call	strchr@PLT
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	movb	$65, (%rax)
	jmp	.L13
.L14:
	cmpb	$66, -28(%rbp)
	jne	.L16
	movl	n(%rip), %eax
	cltq
	leaq	-1(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L17
	movl	n(%rip), %eax
	cltq
	leaq	-2(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$65, %al
	je	.L17
	movl	n(%rip), %eax
	cltq
	leaq	-1(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movb	$66, (%rax)
	jmp	.L13
.L17:
	movl	n(%rip), %eax
	subl	$2, %eax
	movl	%eax, -12(%rbp)
	jmp	.L19
.L21:
	movl	-12(%rbp), %eax
	cltq
	leaq	-1(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$65, %al
	je	.L20
	movl	-12(%rbp), %eax
	cltq
	leaq	1(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$65, %al
	je	.L20
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L20
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movb	$66, (%rax)
	jmp	.L13
.L20:
	subl	$1, -12(%rbp)
.L19:
	cmpl	$0, -12(%rbp)
	jg	.L21
	movq	-24(%rbp), %rax
	movl	$35, %esi
	movq	%rax, %rdi
	call	strchr@PLT
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	movb	$66, (%rax)
	jmp	.L13
.L16:
	cmpb	$67, -28(%rbp)
	jne	.L22
	cmpl	$0, -32(%rbp)
	jne	.L23
	movl	n(%rip), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L24
	movl	n(%rip), %eax
	addl	$1, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cltq
	leaq	-1(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movb	$67, (%rax)
	jmp	.L13
.L24:
	movl	n(%rip), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movb	$67, (%rax)
	jmp	.L13
.L23:
	movl	$0, -12(%rbp)
	jmp	.L25
.L28:
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	strchr@PLT
	testq	%rax, %rax
	je	.L26
	movl	n(%rip), %eax
	subl	$1, %eax
	cmpl	%eax, -12(%rbp)
	jge	.L27
	movl	-12(%rbp), %eax
	cltq
	leaq	1(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L27
	movl	-12(%rbp), %eax
	cltq
	leaq	1(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movb	$67, (%rax)
	jmp	.L13
.L27:
	cmpl	$0, -12(%rbp)
	jle	.L26
	movl	-12(%rbp), %eax
	cltq
	leaq	-1(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L26
	movl	-12(%rbp), %eax
	cltq
	leaq	-1(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movb	$67, (%rax)
	jmp	.L13
.L26:
	addl	$1, -12(%rbp)
.L25:
	movl	n(%rip), %eax
	subl	$1, %eax
	cmpl	%eax, -12(%rbp)
	jl	.L28
	jmp	.L13
.L22:
	cmpb	$68, -28(%rbp)
	jne	.L13
	cmpl	$0, -32(%rbp)
	jne	.L29
	movq	-24(%rbp), %rax
	movb	$68, (%rax)
	jmp	.L13
.L29:
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	sit_down_D
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	sit_down, .-sit_down
	.globl	display
	.type	display, @function
display:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	$0, -4(%rbp)
	jmp	.L31
.L32:
	movl	-4(%rbp), %eax
	cltq
	leaq	seat(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar@PLT
	addl	$1, -4(%rbp)
.L31:
	movl	n(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L32
	movl	$10, %edi
	call	putchar@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	display, .-display
	.section	.rodata
.LC1:
	.string	"%c "
.LC2:
	.string	"%d %d "
	.text
	.globl	main
	.type	main, @function
main:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L34
.L38:
	movl	$101, %edx
	movl	$35, %esi
	leaq	seat(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movb	$0, 100+seat(%rip)
	movl	$0, -12(%rbp)
	jmp	.L35
.L36:
	leaq	-13(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movzbl	-13(%rbp), %eax
	movsbl	%al, %eax
	movl	-12(%rbp), %edx
	movl	%eax, %esi
	leaq	seat(%rip), %rax
	movq	%rax, %rdi
	call	sit_down
	addl	$1, -12(%rbp)
.L35:
	movl	m(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L36
	movl	$0, %eax
	call	display
.L34:
	leaq	m(%rip), %rax
	movq	%rax, %rdx
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L37
	movl	n(%rip), %eax
	testl	%eax, %eax
	jne	.L38
	movl	m(%rip), %eax
	testl	%eax, %eax
	jne	.L38
.L37:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L40
	call	__stack_chk_fail@PLT
.L40:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
