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

```c
// Aizu Vol-1 0199: Chairs Where Demanding People Sit
// 2017.8.29 bal4u@uu

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

typedef struct { int w, p, h; } T;
T t[110]; int len;

char a[110]; 

int cmp(T *a, T *b) 
{
	int d, wa, wb;
	wa = a->w, wb = b->w;
	if (a->h) wa = (wa - 1)/2;
	else wa--;
	if (b->h) wb = (wb - 1)/2;
	else wb--;
	if (d = wb - wa) return d;
	return a->p - b->p;
}

int main()
{
	int n, m;
	int i, k, x, p;
	char buf[10], c;

	while (scanf("%d%d", &n, &m) && n) {
		memset(a, '#', n), a[n] = 0; k = 0;
		while (m-- > 0) {
			scanf("%s", buf), c = *buf;
			if (c == 'A') {
				for (i = 0; i < n; i++) 
					if (a[i] == '#') { a[i] = 'A';	break; }
			} else if (c == 'B') {
				for (i = n-1; i >= 0; i--) {
					if (a[i] == '#') {
						if ((i == n-1 || a[i+1] != 'A') && (i == 0 || a[i-1] != 'A')) {
							a[i] = 'B';	break;
						}
					}
				}
				if (i < 0) for (i = 0; i < n; i++)
					if (a[i] == '#') { a[i] = 'B';	break; }
			} else if (c == 'C') {
				if (k == 0) {
					i = (n & 1) ? (n+1)/2 : n/2+1;
					a[i-1] = 'C';
				} else for (i = 0; i < n; i++) {
					if (a[i] != '#') {
						if (i < n - 1 && a[i+1] == '#') { a[i+1] = 'C'; break; }
						if (i > 0 && a[i-1] == '#') { a[i-1] = 'C'; break; }
					}
				}
			} else {  // c == 'D'
				if (k == 0) a[0] = 'D';
				else {
					for (len = 0, x = 0, i = 0; i < n; i++) {
						if (a[i] == '#') {
							if (x == 0) p = i;
							x++;
						} else if (x > 0) {
							t[len].p = p, t[len].h = (p > 0), t[len++].w = x, x = 0;
						}
					}
					if (x > 0) t[len].p = p, t[len].w = x, t[len++].h = 0;
					qsort(t, len, sizeof(T), cmp);
					if (t[0].h) a[t[0].p+(t[0].w-1)/2] = 'D';
					else if (t[0].p == 0) a[0] = 'D';
					else a[n-1] = 'D';
				}
			}
			k++;
//			puts(a);
		}
		puts(a);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	t
	.bss
	.align 32
	.type	t, @object
	.size	t, 1320
t:
	.zero	1320
	.globl	len
	.align 4
	.type	len, @object
	.size	len, 4
len:
	.zero	4
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 110
a:
	.zero	110
	.text
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -12(%rbp)
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
	movq	-24(%rbp), %rax
	movl	8(%rax), %eax
	testl	%eax, %eax
	je	.L2
	movl	-12(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -12(%rbp)
	jmp	.L3
.L2:
	subl	$1, -12(%rbp)
.L3:
	movq	-32(%rbp), %rax
	movl	8(%rax), %eax
	testl	%eax, %eax
	je	.L4
	movl	-8(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -8(%rbp)
	jmp	.L5
.L4:
	subl	$1, -8(%rbp)
.L5:
	movl	-8(%rbp), %eax
	subl	-12(%rbp), %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	je	.L6
	movl	-4(%rbp), %eax
	jmp	.L7
.L6:
	movq	-24(%rbp), %rax
	movl	4(%rax), %edx
	movq	-32(%rbp), %rax
	movl	4(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
.L7:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	cmp, .-cmp
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"%d%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L9
.L48:
	movl	-44(%rbp), %eax
	cltq
	movq	%rax, %rdx
	movl	$35, %esi
	leaq	a(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	-44(%rbp), %eax
	cltq
	leaq	a(%rip), %rdx
	movb	$0, (%rax,%rdx)
	movl	$0, -32(%rbp)
	jmp	.L10
.L46:
	leaq	-18(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movzbl	-18(%rbp), %eax
	movb	%al, -45(%rbp)
	cmpb	$65, -45(%rbp)
	jne	.L11
	movl	$0, -36(%rbp)
	jmp	.L12
.L15:
	movl	-36(%rbp), %eax
	cltq
	leaq	a(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$35, %al
	jne	.L13
	movl	-36(%rbp), %eax
	cltq
	leaq	a(%rip), %rdx
	movb	$65, (%rax,%rdx)
	jmp	.L16
.L13:
	addl	$1, -36(%rbp)
.L12:
	movl	-44(%rbp), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L15
	jmp	.L16
.L11:
	cmpb	$66, -45(%rbp)
	jne	.L17
	movl	-44(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -36(%rbp)
	jmp	.L18
.L23:
	movl	-36(%rbp), %eax
	cltq
	leaq	a(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$35, %al
	jne	.L19
	movl	-44(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -36(%rbp)
	je	.L20
	movl	-36(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	a(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$65, %al
	je	.L19
.L20:
	cmpl	$0, -36(%rbp)
	je	.L21
	movl	-36(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	a(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$65, %al
	je	.L19
.L21:
	movl	-36(%rbp), %eax
	cltq
	leaq	a(%rip), %rdx
	movb	$66, (%rax,%rdx)
	jmp	.L22
.L19:
	subl	$1, -36(%rbp)
.L18:
	cmpl	$0, -36(%rbp)
	jns	.L23
.L22:
	cmpl	$0, -36(%rbp)
	jns	.L16
	movl	$0, -36(%rbp)
	jmp	.L25
.L27:
	movl	-36(%rbp), %eax
	cltq
	leaq	a(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$35, %al
	jne	.L26
	movl	-36(%rbp), %eax
	cltq
	leaq	a(%rip), %rdx
	movb	$66, (%rax,%rdx)
	jmp	.L16
.L26:
	addl	$1, -36(%rbp)
.L25:
	movl	-44(%rbp), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L27
	jmp	.L16
.L17:
	cmpb	$67, -45(%rbp)
	jne	.L28
	cmpl	$0, -32(%rbp)
	jne	.L29
	movl	-44(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L30
	movl	-44(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	jmp	.L31
.L30:
	movl	-44(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	addl	$1, %eax
.L31:
	movl	%eax, -36(%rbp)
	movl	-36(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	a(%rip), %rdx
	movb	$67, (%rax,%rdx)
	jmp	.L16
.L29:
	movl	$0, -36(%rbp)
	jmp	.L33
.L36:
	movl	-36(%rbp), %eax
	cltq
	leaq	a(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$35, %al
	je	.L34
	movl	-44(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -36(%rbp)
	jge	.L35
	movl	-36(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	a(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$35, %al
	jne	.L35
	movl	-36(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	a(%rip), %rdx
	movb	$67, (%rax,%rdx)
	jmp	.L16
.L35:
	cmpl	$0, -36(%rbp)
	jle	.L34
	movl	-36(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	a(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$35, %al
	jne	.L34
	movl	-36(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	a(%rip), %rdx
	movb	$67, (%rax,%rdx)
	jmp	.L16
.L34:
	addl	$1, -36(%rbp)
.L33:
	movl	-44(%rbp), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L36
	jmp	.L16
.L28:
	cmpl	$0, -32(%rbp)
	jne	.L37
	movb	$68, a(%rip)
	jmp	.L16
.L37:
	movl	$0, len(%rip)
	movl	$0, -28(%rbp)
	movl	$0, -36(%rbp)
	jmp	.L38
.L42:
	movl	-36(%rbp), %eax
	cltq
	leaq	a(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$35, %al
	jne	.L39
	cmpl	$0, -28(%rbp)
	jne	.L40
	movl	-36(%rbp), %eax
	movl	%eax, -24(%rbp)
.L40:
	addl	$1, -28(%rbp)
	jmp	.L41
.L39:
	cmpl	$0, -28(%rbp)
	jle	.L41
	movl	len(%rip), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	4+t(%rip), %rdx
	movl	-24(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	cmpl	$0, -24(%rbp)
	setg	%dl
	movl	len(%rip), %eax
	movzbl	%dl, %edx
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	8+t(%rip), %rax
	movl	%edx, (%rcx,%rax)
	movl	len(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, len(%rip)
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	t(%rip), %rdx
	movl	-28(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	$0, -28(%rbp)
.L41:
	addl	$1, -36(%rbp)
.L38:
	movl	-44(%rbp), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L42
	cmpl	$0, -28(%rbp)
	jle	.L43
	movl	len(%rip), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	4+t(%rip), %rdx
	movl	-24(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	len(%rip), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	t(%rip), %rdx
	movl	-28(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	len(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, len(%rip)
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+t(%rip), %rax
	movl	$0, (%rdx,%rax)
.L43:
	movl	len(%rip), %eax
	cltq
	leaq	cmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$12, %edx
	movq	%rax, %rsi
	leaq	t(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	8+t(%rip), %eax
	testl	%eax, %eax
	je	.L44
	movl	4+t(%rip), %edx
	movl	t(%rip), %eax
	subl	$1, %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%ecx, %eax
	sarl	%eax
	addl	%edx, %eax
	cltq
	leaq	a(%rip), %rdx
	movb	$68, (%rax,%rdx)
	jmp	.L16
.L44:
	movl	4+t(%rip), %eax
	testl	%eax, %eax
	jne	.L45
	movb	$68, a(%rip)
	jmp	.L16
.L45:
	movl	-44(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	a(%rip), %rdx
	movb	$68, (%rax,%rdx)
.L16:
	addl	$1, -32(%rbp)
.L10:
	movl	-40(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -40(%rbp)
	testl	%eax, %eax
	jg	.L46
	leaq	a(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L9:
	leaq	-40(%rbp), %rdx
	leaq	-44(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L47
	movl	-44(%rbp), %eax
	testl	%eax, %eax
	jne	.L48
.L47:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L50
	call	__stack_chk_fail@PLT
.L50:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.p2align 4
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rdi), %ecx
	movl	8(%rdi), %r8d
	movl	(%rsi), %eax
	leal	-1(%rcx), %edx
	testl	%r8d, %r8d
	je	.L2
	movl	%edx, %ecx
	shrl	$31, %ecx
	addl	%ecx, %edx
	sarl	%edx
.L2:
	movl	8(%rsi), %ecx
	subl	$1, %eax
	testl	%ecx, %ecx
	je	.L3
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%ecx, %eax
	sarl	%eax
.L3:
	subl	%edx, %eax
	jne	.L1
	movl	4(%rdi), %eax
	subl	4(%rsi), %eax
.L1:
	ret
	.cfi_endproc
.LFE51:
	.size	cmp, .-cmp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	a(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movq	%rax, 8(%rsp)
	leaq	20(%rsp), %rax
	movq	%rax, (%rsp)
	.p2align 4,,10
	.p2align 3
.L7:
	movq	8(%rsp), %rdx
	movq	(%rsp), %rsi
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L41
	movl	20(%rsp), %eax
	testl	%eax, %eax
	je	.L41
	movslq	%eax, %rbp
	movl	$110, %ecx
	movl	$35, %esi
	movq	%r15, %rdi
	movq	%rbp, %rdx
	call	__memset_chk@PLT
	movl	24(%rsp), %eax
	movb	$0, (%r15,%rbp)
	leal	-1(%rax), %edx
	movl	%edx, 24(%rsp)
	testl	%eax, %eax
	jle	.L8
	xorl	%r14d, %r14d
	leaq	30(%rsp), %r13
	leaq	.LC0(%rip), %r12
	leaq	t(%rip), %rbp
	jmp	.L40
	.p2align 4,,10
	.p2align 3
.L22:
	testl	%r14d, %r14d
	jne	.L30
.L71:
	movb	$68, a(%rip)
.L10:
	movl	24(%rsp), %eax
	addl	$1, %r14d
	leal	-1(%rax), %edx
	movl	%edx, 24(%rsp)
	testl	%eax, %eax
	jle	.L8
.L40:
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movzbl	30(%rsp), %eax
	cmpb	$65, %al
	je	.L73
	cmpb	$66, %al
	je	.L74
	cmpb	$67, %al
	jne	.L22
	movl	20(%rsp), %ecx
	testl	%r14d, %r14d
	jne	.L75
	testb	$1, %cl
	je	.L25
	addl	$1, %ecx
	movl	%ecx, %eax
	shrl	$31, %eax
	addl	%ecx, %eax
	sarl	%eax
	subl	$1, %eax
.L26:
	cltq
	movb	$67, (%r15,%rax)
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L73:
	movslq	20(%rsp), %rdx
	testl	%edx, %edx
	jle	.L10
	xorl	%eax, %eax
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L11:
	addq	$1, %rax
	cmpq	%rdx, %rax
	je	.L10
.L12:
	cmpb	$35, (%r15,%rax)
	movslq	%eax, %rcx
	jne	.L11
	movb	$65, (%r15,%rcx)
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L74:
	movslq	20(%rsp), %rdi
	movl	%edi, %r8d
	subl	$1, %r8d
	js	.L14
	movslq	%edi, %rdx
	leal	-2(%rdi), %eax
	movl	%r8d, %ecx
	addq	%r15, %rdx
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L15:
	cmpl	$-1, %eax
	je	.L14
.L18:
	subq	$1, %rdx
	subl	$1, %eax
	subl	$1, %ecx
.L19:
	cmpb	$35, -1(%rdx)
	jne	.L15
	cmpl	%ecx, %r8d
	je	.L16
	leal	2(%rax), %esi
	movslq	%esi, %rsi
	cmpb	$65, (%r15,%rsi)
	je	.L15
.L16:
	testl	%ecx, %ecx
	je	.L17
	movslq	%eax, %rsi
	cmpb	$65, (%r15,%rsi)
	je	.L18
.L17:
	movslq	%ecx, %rcx
	movb	$66, (%r15,%rcx)
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L30:
	movl	$0, len(%rip)
	movslq	20(%rsp), %rsi
	testl	%esi, %esi
	jle	.L44
	xorl	%eax, %eax
	xorl	%edi, %edi
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	jmp	.L35
	.p2align 4,,10
	.p2align 3
.L32:
	testl	%edx, %edx
	je	.L34
	movslq	%ecx, %rdx
	xorl	%edi, %edi
	testl	%ebx, %ebx
	setg	%dil
	leaq	(%rdx,%rdx,2), %rdx
	addl	$1, %ecx
	movl	%edi, 8(%rbp,%rdx,4)
	movl	$1, %edi
	movq	%xmm0, 0(%rbp,%rdx,4)
	xorl	%edx, %edx
.L34:
	addq	$1, %rax
	cmpq	%rsi, %rax
	je	.L76
.L35:
	movd	%edx, %xmm0
	movd	%ebx, %xmm1
	cmpb	$35, (%r15,%rax)
	punpckldq	%xmm1, %xmm0
	jne	.L32
	testl	%edx, %edx
	cmove	%eax, %ebx
	addq	$1, %rax
	addl	$1, %edx
	cmpq	%rsi, %rax
	jne	.L35
.L76:
	testb	%dil, %dil
	je	.L45
	movl	%ecx, len(%rip)
.L36:
	testl	%edx, %edx
	je	.L70
	movslq	%ecx, %rax
	addl	$1, %ecx
	leaq	(%rax,%rax,2), %rax
	movl	%ecx, len(%rip)
	leaq	0(%rbp,%rax,4), %rax
	movl	%ebx, 4(%rax)
	movl	%edx, (%rax)
	movl	$0, 8(%rax)
.L70:
	movslq	%ecx, %rsi
.L31:
	movl	$12, %edx
	leaq	cmp(%rip), %rcx
	movq	%rbp, %rdi
	call	qsort@PLT
	movl	8+t(%rip), %edx
	testl	%edx, %edx
	je	.L38
	movl	0(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, %eax
	shrl	$31, %eax
	addl	%edx, %eax
	sarl	%eax
	addl	4+t(%rip), %eax
	cltq
	movb	$68, (%r15,%rax)
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r15, %rdi
	call	puts@PLT
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L14:
	testl	%edi, %edi
	jle	.L10
	xorl	%eax, %eax
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L20:
	addq	$1, %rax
	cmpq	%rax, %rdi
	je	.L10
.L21:
	cmpb	$35, (%r15,%rax)
	movslq	%eax, %rdx
	jne	.L20
	movb	$66, (%r15,%rdx)
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L25:
	movl	%ecx, %eax
	shrl	$31, %eax
	addl	%ecx, %eax
	sarl	%eax
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L75:
	leaq	a(%rip), %rdx
	xorl	%eax, %eax
	leal	-1(%rcx), %esi
	testl	%ecx, %ecx
	jg	.L29
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L28:
	testl	%eax, %eax
	je	.L27
	cmpb	$35, -1(%rdx)
	leal	-1(%rax), %edi
	je	.L72
.L27:
	addl	$1, %eax
	addq	$1, %rdx
	cmpl	%ecx, %eax
	je	.L10
.L29:
	cmpb	$35, (%rdx)
	je	.L27
	cmpl	%eax, %esi
	jle	.L28
	cmpb	$35, 1(%rdx)
	leal	1(%rax), %edi
	jne	.L28
.L72:
	movslq	%edi, %rdi
	movb	$67, (%r15,%rdi)
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L38:
	movl	4+t(%rip), %eax
	testl	%eax, %eax
	je	.L71
	movl	20(%rsp), %eax
	subl	$1, %eax
	cltq
	movb	$68, (%r15,%rax)
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L45:
	xorl	%ecx, %ecx
	jmp	.L36
.L41:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L77
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L44:
	.cfi_restore_state
	xorl	%esi, %esi
	jmp	.L31
.L77:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.size	main, .-main
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 110
a:
	.zero	110
	.globl	len
	.align 4
	.type	len, @object
	.size	len, 4
len:
	.zero	4
	.globl	t
	.align 32
	.type	t, @object
	.size	t, 1320
t:
	.zero	1320
	.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	cmp
	.type	cmp, @function
cmp:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rdi), %ecx
	movl	8(%rdi), %r8d
	movl	(%rsi), %eax
	leal	-1(%rcx), %edx
	testl	%r8d, %r8d
	je	.L2
	movl	%edx, %ecx
	shrl	$31, %ecx
	addl	%ecx, %edx
	sarl	%edx
.L2:
	movl	8(%rsi), %ecx
	subl	$1, %eax
	testl	%ecx, %ecx
	je	.L3
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%ecx, %eax
	sarl	%eax
.L3:
	subl	%edx, %eax
	jne	.L1
	movl	4(%rdi), %eax
	subl	4(%rsi), %eax
.L1:
	ret
	.cfi_endproc
.LFE51:
	.size	cmp, .-cmp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	a(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movq	%rax, 8(%rsp)
	leaq	20(%rsp), %rax
	movq	%rax, (%rsp)
	.p2align 4,,10
	.p2align 3
.L7:
	movq	8(%rsp), %rdx
	movq	(%rsp), %rsi
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L41
	movl	20(%rsp), %eax
	testl	%eax, %eax
	je	.L41
	movslq	%eax, %rbp
	movl	$110, %ecx
	movl	$35, %esi
	movq	%r15, %rdi
	movq	%rbp, %rdx
	call	__memset_chk@PLT
	movl	24(%rsp), %eax
	movb	$0, (%r15,%rbp)
	leal	-1(%rax), %edx
	movl	%edx, 24(%rsp)
	testl	%eax, %eax
	jle	.L8
	xorl	%r14d, %r14d
	leaq	30(%rsp), %r13
	leaq	.LC0(%rip), %r12
	leaq	t(%rip), %rbp
	jmp	.L40
	.p2align 4,,10
	.p2align 3
.L22:
	testl	%r14d, %r14d
	jne	.L30
.L71:
	movb	$68, a(%rip)
.L10:
	movl	24(%rsp), %eax
	addl	$1, %r14d
	leal	-1(%rax), %edx
	movl	%edx, 24(%rsp)
	testl	%eax, %eax
	jle	.L8
.L40:
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movzbl	30(%rsp), %eax
	cmpb	$65, %al
	je	.L73
	cmpb	$66, %al
	je	.L74
	cmpb	$67, %al
	jne	.L22
	movl	20(%rsp), %ecx
	testl	%r14d, %r14d
	jne	.L75
	testb	$1, %cl
	je	.L25
	addl	$1, %ecx
	movl	%ecx, %eax
	shrl	$31, %eax
	addl	%ecx, %eax
	sarl	%eax
	subl	$1, %eax
.L26:
	cltq
	movb	$67, (%r15,%rax)
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L73:
	movslq	20(%rsp), %rdx
	testl	%edx, %edx
	jle	.L10
	xorl	%eax, %eax
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L11:
	addq	$1, %rax
	cmpq	%rdx, %rax
	je	.L10
.L12:
	cmpb	$35, (%r15,%rax)
	movslq	%eax, %rcx
	jne	.L11
	movb	$65, (%r15,%rcx)
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L74:
	movslq	20(%rsp), %rdi
	movl	%edi, %r8d
	subl	$1, %r8d
	js	.L14
	movslq	%edi, %rdx
	leal	-2(%rdi), %eax
	movl	%r8d, %ecx
	addq	%r15, %rdx
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L15:
	cmpl	$-1, %eax
	je	.L14
.L18:
	subq	$1, %rdx
	subl	$1, %eax
	subl	$1, %ecx
.L19:
	cmpb	$35, -1(%rdx)
	jne	.L15
	cmpl	%ecx, %r8d
	je	.L16
	leal	2(%rax), %esi
	movslq	%esi, %rsi
	cmpb	$65, (%r15,%rsi)
	je	.L15
.L16:
	testl	%ecx, %ecx
	je	.L17
	movslq	%eax, %rsi
	cmpb	$65, (%r15,%rsi)
	je	.L18
.L17:
	movslq	%ecx, %rcx
	movb	$66, (%r15,%rcx)
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L30:
	movl	$0, len(%rip)
	movslq	20(%rsp), %rsi
	testl	%esi, %esi
	jle	.L44
	xorl	%eax, %eax
	xorl	%edi, %edi
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	jmp	.L35
	.p2align 4,,10
	.p2align 3
.L32:
	testl	%edx, %edx
	je	.L34
	movslq	%ecx, %rdx
	xorl	%edi, %edi
	testl	%ebx, %ebx
	setg	%dil
	leaq	(%rdx,%rdx,2), %rdx
	addl	$1, %ecx
	movl	%edi, 8(%rbp,%rdx,4)
	movl	$1, %edi
	movq	%xmm0, 0(%rbp,%rdx,4)
	xorl	%edx, %edx
.L34:
	addq	$1, %rax
	cmpq	%rsi, %rax
	je	.L76
.L35:
	movd	%edx, %xmm0
	movd	%ebx, %xmm1
	cmpb	$35, (%r15,%rax)
	punpckldq	%xmm1, %xmm0
	jne	.L32
	testl	%edx, %edx
	cmove	%eax, %ebx
	addq	$1, %rax
	addl	$1, %edx
	cmpq	%rsi, %rax
	jne	.L35
.L76:
	testb	%dil, %dil
	je	.L45
	movl	%ecx, len(%rip)
.L36:
	testl	%edx, %edx
	je	.L70
	movslq	%ecx, %rax
	addl	$1, %ecx
	leaq	(%rax,%rax,2), %rax
	movl	%ecx, len(%rip)
	leaq	0(%rbp,%rax,4), %rax
	movl	%ebx, 4(%rax)
	movl	%edx, (%rax)
	movl	$0, 8(%rax)
.L70:
	movslq	%ecx, %rsi
.L31:
	movl	$12, %edx
	leaq	cmp(%rip), %rcx
	movq	%rbp, %rdi
	call	qsort@PLT
	movl	8+t(%rip), %edx
	testl	%edx, %edx
	je	.L38
	movl	0(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, %eax
	shrl	$31, %eax
	addl	%edx, %eax
	sarl	%eax
	addl	4+t(%rip), %eax
	cltq
	movb	$68, (%r15,%rax)
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r15, %rdi
	call	puts@PLT
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L14:
	testl	%edi, %edi
	jle	.L10
	xorl	%eax, %eax
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L20:
	addq	$1, %rax
	cmpq	%rax, %rdi
	je	.L10
.L21:
	cmpb	$35, (%r15,%rax)
	movslq	%eax, %rdx
	jne	.L20
	movb	$66, (%r15,%rdx)
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L25:
	movl	%ecx, %eax
	shrl	$31, %eax
	addl	%ecx, %eax
	sarl	%eax
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L75:
	leaq	a(%rip), %rdx
	xorl	%eax, %eax
	leal	-1(%rcx), %esi
	testl	%ecx, %ecx
	jg	.L29
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L28:
	testl	%eax, %eax
	je	.L27
	cmpb	$35, -1(%rdx)
	leal	-1(%rax), %edi
	je	.L72
.L27:
	addl	$1, %eax
	addq	$1, %rdx
	cmpl	%ecx, %eax
	je	.L10
.L29:
	cmpb	$35, (%rdx)
	je	.L27
	cmpl	%eax, %esi
	jle	.L28
	cmpb	$35, 1(%rdx)
	leal	1(%rax), %edi
	jne	.L28
.L72:
	movslq	%edi, %rdi
	movb	$67, (%r15,%rdi)
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L38:
	movl	4+t(%rip), %eax
	testl	%eax, %eax
	je	.L71
	movl	20(%rsp), %eax
	subl	$1, %eax
	cltq
	movb	$68, (%r15,%rax)
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L45:
	xorl	%ecx, %ecx
	jmp	.L36
.L41:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L77
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L44:
	.cfi_restore_state
	xorl	%esi, %esi
	jmp	.L31
.L77:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.size	main, .-main
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 110
a:
	.zero	110
	.globl	len
	.align 4
	.type	len, @object
	.size	len, 4
len:
	.zero	4
	.globl	t
	.align 32
	.type	t, @object
	.size	t, 1320
t:
	.zero	1320
	.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:

// Aizu Vol-1 0199: Chairs Where Demanding People Sit
// 2017.8.29 bal4u@uu

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

typedef struct { int w, p, h; } T;
T t[110]; int len;

char a[110]; 

int cmp(T *a, T *b) 
{
	int d, wa, wb;
	wa = a->w, wb = b->w;
	if (a->h) wa = (wa - 1)/2;
	else wa--;
	if (b->h) wb = (wb - 1)/2;
	else wb--;
	if (d = wb - wa) return d;
	return a->p - b->p;
}

int main()
{
	int n, m;
	int i, k, x, p;
	char buf[10], c;

	while (scanf("%d%d", &n, &m) && n) {
		memset(a, '#', n), a[n] = 0; k = 0;
		while (m-- > 0) {
			scanf("%s", buf), c = *buf;
			if (c == 'A') {
				for (i = 0; i < n; i++) 
					if (a[i] == '#') { a[i] = 'A';	break; }
			} else if (c == 'B') {
				for (i = n-1; i >= 0; i--) {
					if (a[i] == '#') {
						if ((i == n-1 || a[i+1] != 'A') && (i == 0 || a[i-1] != 'A')) {
							a[i] = 'B';	break;
						}
					}
				}
				if (i < 0) for (i = 0; i < n; i++)
					if (a[i] == '#') { a[i] = 'B';	break; }
			} else if (c == 'C') {
				if (k == 0) {
					i = (n & 1) ? (n+1)/2 : n/2+1;
					a[i-1] = 'C';
				} else for (i = 0; i < n; i++) {
					if (a[i] != '#') {
						if (i < n - 1 && a[i+1] == '#') { a[i+1] = 'C'; break; }
						if (i > 0 && a[i-1] == '#') { a[i-1] = 'C'; break; }
					}
				}
			} else {  // c == 'D'
				if (k == 0) a[0] = 'D';
				else {
					for (len = 0, x = 0, i = 0; i < n; i++) {
						if (a[i] == '#') {
							if (x == 0) p = i;
							x++;
						} else if (x > 0) {
							t[len].p = p, t[len].h = (p > 0), t[len++].w = x, x = 0;
						}
					}
					if (x > 0) t[len].p = p, t[len].w = x, t[len++].h = 0;
					qsort(t, len, sizeof(T), cmp);
					if (t[0].h) a[t[0].p+(t[0].w-1)/2] = 'D';
					else if (t[0].p == 0) a[0] = 'D';
					else a[n-1] = 'D';
				}
			}
			k++;
//			puts(a);
		}
		puts(a);
	}
	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
// Aizu Vol-1 0199: Chairs Where Demanding People Sit
// 2017.8.29 bal4u@uu

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

typedef struct { int w, p, h; } T;
T t[110]; int len;

char a[110]; 

int cmp(T *a, T *b) 
{
	int d, wa, wb;
	wa = a->w, wb = b->w;
	if (a->h) wa = (wa - 1)/2;
	else wa--;
	if (b->h) wb = (wb - 1)/2;
	else wb--;
	if (d = wb - wa) return d;
	return a->p - b->p;
}

int main()
{
	int n, m;
	int i, k, x, p;
	char buf[10], c;

	while (scanf("%d%d", &n, &m) && n) {
		memset(a, '#', n), a[n] = 0; k = 0;
		while (m-- > 0) {
			scanf("%s", buf), c = *buf;
			if (c == 'A') {
				for (i = 0; i < n; i++) 
					if (a[i] == '#') { a[i] = 'A';	break; }
			} else if (c == 'B') {
				for (i = n-1; i >= 0; i--) {
					if (a[i] == '#') {
						if ((i == n-1 || a[i+1] != 'A') && (i == 0 || a[i-1] != 'A')) {
							a[i] = 'B';	break;
						}
					}
				}
				if (i < 0) for (i = 0; i < n; i++)
					if (a[i] == '#') { a[i] = 'B';	break; }
			} else if (c == 'C') {
				if (k == 0) {
					i = (n & 1) ? (n+1)/2 : n/2+1;
					a[i-1] = 'C';
				} else for (i = 0; i < n; i++) {
					if (a[i] != '#') {
						if (i < n - 1 && a[i+1] == '#') { a[i+1] = 'C'; break; }
						if (i > 0 && a[i-1] == '#') { a[i-1] = 'C'; break; }
					}
				}
			} else {  // c == 'D'
				if (k == 0) a[0] = 'D';
				else {
					for (len = 0, x = 0, i = 0; i < n; i++) {
						if (a[i] == '#') {
							if (x == 0) p = i;
							x++;
						} else if (x > 0) {
							t[len].p = p, t[len].h = (p > 0), t[len++].w = x, x = 0;
						}
					}
					if (x > 0) t[len].p = p, t[len].w = x, t[len++].h = 0;
					qsort(t, len, sizeof(T), cmp);
					if (t[0].h) a[t[0].p+(t[0].w-1)/2] = 'D';
					else if (t[0].p == 0) a[0] = 'D';
					else a[n-1] = 'D';
				}
			}
			k++;
//			puts(a);
		}
		puts(a);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	t
	.bss
	.align 32
	.type	t, @object
	.size	t, 1320
t:
	.zero	1320
	.globl	len
	.align 4
	.type	len, @object
	.size	len, 4
len:
	.zero	4
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 110
a:
	.zero	110
	.text
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -12(%rbp)
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
	movq	-24(%rbp), %rax
	movl	8(%rax), %eax
	testl	%eax, %eax
	je	.L2
	movl	-12(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -12(%rbp)
	jmp	.L3
.L2:
	subl	$1, -12(%rbp)
.L3:
	movq	-32(%rbp), %rax
	movl	8(%rax), %eax
	testl	%eax, %eax
	je	.L4
	movl	-8(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -8(%rbp)
	jmp	.L5
.L4:
	subl	$1, -8(%rbp)
.L5:
	movl	-8(%rbp), %eax
	subl	-12(%rbp), %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	je	.L6
	movl	-4(%rbp), %eax
	jmp	.L7
.L6:
	movq	-24(%rbp), %rax
	movl	4(%rax), %edx
	movq	-32(%rbp), %rax
	movl	4(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
.L7:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	cmp, .-cmp
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"%d%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L9
.L48:
	movl	-44(%rbp), %eax
	cltq
	movq	%rax, %rdx
	movl	$35, %esi
	leaq	a(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	-44(%rbp), %eax
	cltq
	leaq	a(%rip), %rdx
	movb	$0, (%rax,%rdx)
	movl	$0, -32(%rbp)
	jmp	.L10
.L46:
	leaq	-18(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movzbl	-18(%rbp), %eax
	movb	%al, -45(%rbp)
	cmpb	$65, -45(%rbp)
	jne	.L11
	movl	$0, -36(%rbp)
	jmp	.L12
.L15:
	movl	-36(%rbp), %eax
	cltq
	leaq	a(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$35, %al
	jne	.L13
	movl	-36(%rbp), %eax
	cltq
	leaq	a(%rip), %rdx
	movb	$65, (%rax,%rdx)
	jmp	.L16
.L13:
	addl	$1, -36(%rbp)
.L12:
	movl	-44(%rbp), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L15
	jmp	.L16
.L11:
	cmpb	$66, -45(%rbp)
	jne	.L17
	movl	-44(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -36(%rbp)
	jmp	.L18
.L23:
	movl	-36(%rbp), %eax
	cltq
	leaq	a(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$35, %al
	jne	.L19
	movl	-44(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -36(%rbp)
	je	.L20
	movl	-36(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	a(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$65, %al
	je	.L19
.L20:
	cmpl	$0, -36(%rbp)
	je	.L21
	movl	-36(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	a(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$65, %al
	je	.L19
.L21:
	movl	-36(%rbp), %eax
	cltq
	leaq	a(%rip), %rdx
	movb	$66, (%rax,%rdx)
	jmp	.L22
.L19:
	subl	$1, -36(%rbp)
.L18:
	cmpl	$0, -36(%rbp)
	jns	.L23
.L22:
	cmpl	$0, -36(%rbp)
	jns	.L16
	movl	$0, -36(%rbp)
	jmp	.L25
.L27:
	movl	-36(%rbp), %eax
	cltq
	leaq	a(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$35, %al
	jne	.L26
	movl	-36(%rbp), %eax
	cltq
	leaq	a(%rip), %rdx
	movb	$66, (%rax,%rdx)
	jmp	.L16
.L26:
	addl	$1, -36(%rbp)
.L25:
	movl	-44(%rbp), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L27
	jmp	.L16
.L17:
	cmpb	$67, -45(%rbp)
	jne	.L28
	cmpl	$0, -32(%rbp)
	jne	.L29
	movl	-44(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L30
	movl	-44(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	jmp	.L31
.L30:
	movl	-44(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	addl	$1, %eax
.L31:
	movl	%eax, -36(%rbp)
	movl	-36(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	a(%rip), %rdx
	movb	$67, (%rax,%rdx)
	jmp	.L16
.L29:
	movl	$0, -36(%rbp)
	jmp	.L33
.L36:
	movl	-36(%rbp), %eax
	cltq
	leaq	a(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$35, %al
	je	.L34
	movl	-44(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -36(%rbp)
	jge	.L35
	movl	-36(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	a(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$35, %al
	jne	.L35
	movl	-36(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	a(%rip), %rdx
	movb	$67, (%rax,%rdx)
	jmp	.L16
.L35:
	cmpl	$0, -36(%rbp)
	jle	.L34
	movl	-36(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	a(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$35, %al
	jne	.L34
	movl	-36(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	a(%rip), %rdx
	movb	$67, (%rax,%rdx)
	jmp	.L16
.L34:
	addl	$1, -36(%rbp)
.L33:
	movl	-44(%rbp), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L36
	jmp	.L16
.L28:
	cmpl	$0, -32(%rbp)
	jne	.L37
	movb	$68, a(%rip)
	jmp	.L16
.L37:
	movl	$0, len(%rip)
	movl	$0, -28(%rbp)
	movl	$0, -36(%rbp)
	jmp	.L38
.L42:
	movl	-36(%rbp), %eax
	cltq
	leaq	a(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$35, %al
	jne	.L39
	cmpl	$0, -28(%rbp)
	jne	.L40
	movl	-36(%rbp), %eax
	movl	%eax, -24(%rbp)
.L40:
	addl	$1, -28(%rbp)
	jmp	.L41
.L39:
	cmpl	$0, -28(%rbp)
	jle	.L41
	movl	len(%rip), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	4+t(%rip), %rdx
	movl	-24(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	cmpl	$0, -24(%rbp)
	setg	%dl
	movl	len(%rip), %eax
	movzbl	%dl, %edx
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	8+t(%rip), %rax
	movl	%edx, (%rcx,%rax)
	movl	len(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, len(%rip)
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	t(%rip), %rdx
	movl	-28(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	$0, -28(%rbp)
.L41:
	addl	$1, -36(%rbp)
.L38:
	movl	-44(%rbp), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L42
	cmpl	$0, -28(%rbp)
	jle	.L43
	movl	len(%rip), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	4+t(%rip), %rdx
	movl	-24(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	len(%rip), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	t(%rip), %rdx
	movl	-28(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	len(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, len(%rip)
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+t(%rip), %rax
	movl	$0, (%rdx,%rax)
.L43:
	movl	len(%rip), %eax
	cltq
	leaq	cmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$12, %edx
	movq	%rax, %rsi
	leaq	t(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	8+t(%rip), %eax
	testl	%eax, %eax
	je	.L44
	movl	4+t(%rip), %edx
	movl	t(%rip), %eax
	subl	$1, %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%ecx, %eax
	sarl	%eax
	addl	%edx, %eax
	cltq
	leaq	a(%rip), %rdx
	movb	$68, (%rax,%rdx)
	jmp	.L16
.L44:
	movl	4+t(%rip), %eax
	testl	%eax, %eax
	jne	.L45
	movb	$68, a(%rip)
	jmp	.L16
.L45:
	movl	-44(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	a(%rip), %rdx
	movb	$68, (%rax,%rdx)
.L16:
	addl	$1, -32(%rbp)
.L10:
	movl	-40(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -40(%rbp)
	testl	%eax, %eax
	jg	.L46
	leaq	a(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L9:
	leaq	-40(%rbp), %rdx
	leaq	-44(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L47
	movl	-44(%rbp), %eax
	testl	%eax, %eax
	jne	.L48
.L47:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L50
	call	__stack_chk_fail@PLT
.L50:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.globl	t
	.bss
	.align 32
	.type	t, @object
	.size	t, 1320
t:
	.zero	1320
	.globl	len
	.align 4
	.type	len, @object
	.size	len, 4
len:
	.zero	4
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 110
a:
	.zero	110
	.text
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -12(%rbp)
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
	movq	-24(%rbp), %rax
	movl	8(%rax), %eax
	testl	%eax, %eax
	je	.L2
	movl	-12(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -12(%rbp)
	jmp	.L3
.L2:
	subl	$1, -12(%rbp)
.L3:
	movq	-32(%rbp), %rax
	movl	8(%rax), %eax
	testl	%eax, %eax
	je	.L4
	movl	-8(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -8(%rbp)
	jmp	.L5
.L4:
	subl	$1, -8(%rbp)
.L5:
	movl	-8(%rbp), %eax
	subl	-12(%rbp), %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	je	.L6
	movl	-4(%rbp), %eax
	jmp	.L7
.L6:
	movq	-24(%rbp), %rax
	movl	4(%rax), %edx
	movq	-32(%rbp), %rax
	movl	4(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
.L7:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	cmp, .-cmp
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"%d%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L9
.L48:
	movl	-44(%rbp), %eax
	cltq
	movq	%rax, %rdx
	movl	$35, %esi
	leaq	a(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	-44(%rbp), %eax
	cltq
	leaq	a(%rip), %rdx
	movb	$0, (%rax,%rdx)
	movl	$0, -32(%rbp)
	jmp	.L10
.L46:
	leaq	-18(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movzbl	-18(%rbp), %eax
	movb	%al, -45(%rbp)
	cmpb	$65, -45(%rbp)
	jne	.L11
	movl	$0, -36(%rbp)
	jmp	.L12
.L15:
	movl	-36(%rbp), %eax
	cltq
	leaq	a(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$35, %al
	jne	.L13
	movl	-36(%rbp), %eax
	cltq
	leaq	a(%rip), %rdx
	movb	$65, (%rax,%rdx)
	jmp	.L16
.L13:
	addl	$1, -36(%rbp)
.L12:
	movl	-44(%rbp), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L15
	jmp	.L16
.L11:
	cmpb	$66, -45(%rbp)
	jne	.L17
	movl	-44(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -36(%rbp)
	jmp	.L18
.L23:
	movl	-36(%rbp), %eax
	cltq
	leaq	a(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$35, %al
	jne	.L19
	movl	-44(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -36(%rbp)
	je	.L20
	movl	-36(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	a(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$65, %al
	je	.L19
.L20:
	cmpl	$0, -36(%rbp)
	je	.L21
	movl	-36(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	a(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$65, %al
	je	.L19
.L21:
	movl	-36(%rbp), %eax
	cltq
	leaq	a(%rip), %rdx
	movb	$66, (%rax,%rdx)
	jmp	.L22
.L19:
	subl	$1, -36(%rbp)
.L18:
	cmpl	$0, -36(%rbp)
	jns	.L23
.L22:
	cmpl	$0, -36(%rbp)
	jns	.L16
	movl	$0, -36(%rbp)
	jmp	.L25
.L27:
	movl	-36(%rbp), %eax
	cltq
	leaq	a(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$35, %al
	jne	.L26
	movl	-36(%rbp), %eax
	cltq
	leaq	a(%rip), %rdx
	movb	$66, (%rax,%rdx)
	jmp	.L16
.L26:
	addl	$1, -36(%rbp)
.L25:
	movl	-44(%rbp), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L27
	jmp	.L16
.L17:
	cmpb	$67, -45(%rbp)
	jne	.L28
	cmpl	$0, -32(%rbp)
	jne	.L29
	movl	-44(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L30
	movl	-44(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	jmp	.L31
.L30:
	movl	-44(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	addl	$1, %eax
.L31:
	movl	%eax, -36(%rbp)
	movl	-36(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	a(%rip), %rdx
	movb	$67, (%rax,%rdx)
	jmp	.L16
.L29:
	movl	$0, -36(%rbp)
	jmp	.L33
.L36:
	movl	-36(%rbp), %eax
	cltq
	leaq	a(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$35, %al
	je	.L34
	movl	-44(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -36(%rbp)
	jge	.L35
	movl	-36(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	a(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$35, %al
	jne	.L35
	movl	-36(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	a(%rip), %rdx
	movb	$67, (%rax,%rdx)
	jmp	.L16
.L35:
	cmpl	$0, -36(%rbp)
	jle	.L34
	movl	-36(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	a(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$35, %al
	jne	.L34
	movl	-36(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	a(%rip), %rdx
	movb	$67, (%rax,%rdx)
	jmp	.L16
.L34:
	addl	$1, -36(%rbp)
.L33:
	movl	-44(%rbp), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L36
	jmp	.L16
.L28:
	cmpl	$0, -32(%rbp)
	jne	.L37
	movb	$68, a(%rip)
	jmp	.L16
.L37:
	movl	$0, len(%rip)
	movl	$0, -28(%rbp)
	movl	$0, -36(%rbp)
	jmp	.L38
.L42:
	movl	-36(%rbp), %eax
	cltq
	leaq	a(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$35, %al
	jne	.L39
	cmpl	$0, -28(%rbp)
	jne	.L40
	movl	-36(%rbp), %eax
	movl	%eax, -24(%rbp)
.L40:
	addl	$1, -28(%rbp)
	jmp	.L41
.L39:
	cmpl	$0, -28(%rbp)
	jle	.L41
	movl	len(%rip), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	4+t(%rip), %rdx
	movl	-24(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	cmpl	$0, -24(%rbp)
	setg	%dl
	movl	len(%rip), %eax
	movzbl	%dl, %edx
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	8+t(%rip), %rax
	movl	%edx, (%rcx,%rax)
	movl	len(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, len(%rip)
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	t(%rip), %rdx
	movl	-28(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	$0, -28(%rbp)
.L41:
	addl	$1, -36(%rbp)
.L38:
	movl	-44(%rbp), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L42
	cmpl	$0, -28(%rbp)
	jle	.L43
	movl	len(%rip), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	4+t(%rip), %rdx
	movl	-24(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	len(%rip), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	t(%rip), %rdx
	movl	-28(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	len(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, len(%rip)
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+t(%rip), %rax
	movl	$0, (%rdx,%rax)
.L43:
	movl	len(%rip), %eax
	cltq
	leaq	cmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$12, %edx
	movq	%rax, %rsi
	leaq	t(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	8+t(%rip), %eax
	testl	%eax, %eax
	je	.L44
	movl	4+t(%rip), %edx
	movl	t(%rip), %eax
	subl	$1, %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%ecx, %eax
	sarl	%eax
	addl	%edx, %eax
	cltq
	leaq	a(%rip), %rdx
	movb	$68, (%rax,%rdx)
	jmp	.L16
.L44:
	movl	4+t(%rip), %eax
	testl	%eax, %eax
	jne	.L45
	movb	$68, a(%rip)
	jmp	.L16
.L45:
	movl	-44(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	a(%rip), %rdx
	movb	$68, (%rax,%rdx)
.L16:
	addl	$1, -32(%rbp)
.L10:
	movl	-40(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -40(%rbp)
	testl	%eax, %eax
	jg	.L46
	leaq	a(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L9:
	leaq	-40(%rbp), %rdx
	leaq	-44(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L47
	movl	-44(%rbp), %eax
	testl	%eax, %eax
	jne	.L48
.L47:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L50
	call	__stack_chk_fail@PLT
.L50:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
