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

```c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX_LENGTH 72

/* Naive 0/1 Trie */

typedef struct trie *trie;
struct trie { trie children[26]; char flag; };

trie trie_cons(char* str, trie t)
{
    if(!t)
        t = (trie)calloc(1, sizeof(struct trie));

    if(*str)
        t->children[*str - 'a'] = trie_cons(str + 1, t->children[*str - 'a']);
    else
        t->flag = 1;

    return t;
}

int trie_count(trie t)
{
    if(!t)
        return 0;
    else
    {
        int res = (t->flag != 0), i;
        for(i = 0; i < 26; i++)
            res += trie_count(t->children[i]);
        return res;
    }
}

void trie_free(trie t)
{
    int i;

    if(t)
    {
        for(i = 0; i < 26; i++)
            trie_free(t->children[i]);
        free(t);
    }
}

/* --- */

void reverse(char* buf, int size)
{
    int i;
    char t;

    for(i = 0; i < size / 2; i++)
    {
        t = buf[i];
        buf[i] = buf[size - i - 1];
        buf[size - i - 1] = t;
    }
}

int main(void)
{
    trie t;
    int split_pos, len, i;
    char buf[MAX_LENGTH + 1], swapped[MAX_LENGTH + 1];

    scanf("%*d%*c");

    while(~scanf("%s%*c", buf))
    {
        t = NULL, len = strlen(buf);

        for(split_pos = 1; split_pos < len; split_pos++)
            for(i = 0; i < 4; i++)
            {
                /* reverse */
                if(i & 2) reverse(buf, split_pos);
                if(i & 1) reverse(buf + split_pos, len - split_pos);

                /* swap */
                memcpy(swapped, buf + split_pos, len - split_pos);
                memcpy(swapped + (len - split_pos), buf, split_pos);
                swapped[len] = '\0';

                /* push to the trie */
                t = trie_cons(buf, trie_cons(swapped, t));

                /* undo reverse */
                if(i & 2) reverse(buf, split_pos);
                if(i & 1) reverse(buf + split_pos, len - split_pos);
            }

        printf("%d\n", trie_count(t));
        trie_free(t);
    }

    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	trie_cons
	.type	trie_cons, @function
trie_cons:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 3, -24
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	cmpq	$0, -32(%rbp)
	jne	.L2
	movl	$216, %esi
	movl	$1, %edi
	call	calloc@PLT
	movq	%rax, -32(%rbp)
.L2:
	movq	-24(%rbp), %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	je	.L3
	movq	-24(%rbp), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	leal	-97(%rax), %edx
	movq	-32(%rbp), %rax
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	-24(%rbp), %rdx
	addq	$1, %rdx
	movq	-24(%rbp), %rcx
	movzbl	(%rcx), %ecx
	movsbl	%cl, %ecx
	leal	-97(%rcx), %ebx
	movq	%rax, %rsi
	movq	%rdx, %rdi
	call	trie_cons
	movq	-32(%rbp), %rdx
	movslq	%ebx, %rcx
	movq	%rax, (%rdx,%rcx,8)
	jmp	.L4
.L3:
	movq	-32(%rbp), %rax
	movb	$1, 208(%rax)
.L4:
	movq	-32(%rbp), %rax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	trie_cons, .-trie_cons
	.globl	trie_count
	.type	trie_count, @function
trie_count:
.LFB7:
	.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)
	cmpq	$0, -24(%rbp)
	jne	.L7
	movl	$0, %eax
	jmp	.L8
.L7:
	movq	-24(%rbp), %rax
	movzbl	208(%rax), %eax
	testb	%al, %al
	setne	%al
	movzbl	%al, %eax
	movl	%eax, -8(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L9
.L10:
	movq	-24(%rbp), %rax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, %rdi
	call	trie_count
	addl	%eax, -8(%rbp)
	addl	$1, -4(%rbp)
.L9:
	cmpl	$25, -4(%rbp)
	jle	.L10
	movl	-8(%rbp), %eax
.L8:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	trie_count, .-trie_count
	.globl	trie_free
	.type	trie_free, @function
trie_free:
.LFB8:
	.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)
	cmpq	$0, -24(%rbp)
	je	.L15
	movl	$0, -4(%rbp)
	jmp	.L13
.L14:
	movq	-24(%rbp), %rax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, %rdi
	call	trie_free
	addl	$1, -4(%rbp)
.L13:
	cmpl	$25, -4(%rbp)
	jle	.L14
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
.L15:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	trie_free, .-trie_free
	.globl	reverse
	.type	reverse, @function
reverse:
.LFB9:
	.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)
	movl	%esi, -28(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L17
.L18:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movb	%al, -5(%rbp)
	movl	-28(%rbp), %eax
	subl	-4(%rbp), %eax
	cltq
	leaq	-1(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	-4(%rbp), %edx
	movslq	%edx, %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	movzbl	(%rax), %eax
	movb	%al, (%rdx)
	movl	-28(%rbp), %eax
	subl	-4(%rbp), %eax
	cltq
	leaq	-1(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rax, %rdx
	movzbl	-5(%rbp), %eax
	movb	%al, (%rdx)
	addl	$1, -4(%rbp)
.L17:
	movl	-28(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cmpl	%eax, -4(%rbp)
	jl	.L18
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	reverse, .-reverse
	.section	.rodata
.LC0:
	.string	"%*d%*c"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%s%*c"
	.text
	.globl	main
	.type	main, @function
main:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$208, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L20
.L29:
	movq	$0, -184(%rbp)
	leaq	-176(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -188(%rbp)
	movl	$1, -196(%rbp)
	jmp	.L21
.L28:
	movl	$0, -192(%rbp)
	jmp	.L22
.L27:
	movl	-192(%rbp), %eax
	andl	$2, %eax
	testl	%eax, %eax
	je	.L23
	movl	-196(%rbp), %edx
	leaq	-176(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	reverse
.L23:
	movl	-192(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L24
	movl	-188(%rbp), %eax
	subl	-196(%rbp), %eax
	movl	-196(%rbp), %edx
	movslq	%edx, %rdx
	leaq	-176(%rbp), %rcx
	addq	%rcx, %rdx
	movl	%eax, %esi
	movq	%rdx, %rdi
	call	reverse
.L24:
	movl	-188(%rbp), %eax
	subl	-196(%rbp), %eax
	movslq	%eax, %rdx
	movl	-196(%rbp), %eax
	cltq
	leaq	-176(%rbp), %rcx
	addq	%rax, %rcx
	leaq	-96(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	memcpy@PLT
	movl	-196(%rbp), %eax
	movslq	%eax, %rdx
	movl	-188(%rbp), %eax
	subl	-196(%rbp), %eax
	cltq
	leaq	-96(%rbp), %rcx
	addq	%rax, %rcx
	leaq	-176(%rbp), %rax
	movq	%rax, %rsi
	movq	%rcx, %rdi
	call	memcpy@PLT
	movl	-188(%rbp), %eax
	cltq
	movb	$0, -96(%rbp,%rax)
	movq	-184(%rbp), %rdx
	leaq	-96(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	trie_cons
	movq	%rax, %rdx
	leaq	-176(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	trie_cons
	movq	%rax, -184(%rbp)
	movl	-192(%rbp), %eax
	andl	$2, %eax
	testl	%eax, %eax
	je	.L25
	movl	-196(%rbp), %edx
	leaq	-176(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	reverse
.L25:
	movl	-192(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L26
	movl	-188(%rbp), %eax
	subl	-196(%rbp), %eax
	movl	-196(%rbp), %edx
	movslq	%edx, %rdx
	leaq	-176(%rbp), %rcx
	addq	%rcx, %rdx
	movl	%eax, %esi
	movq	%rdx, %rdi
	call	reverse
.L26:
	addl	$1, -192(%rbp)
.L22:
	cmpl	$3, -192(%rbp)
	jle	.L27
	addl	$1, -196(%rbp)
.L21:
	movl	-196(%rbp), %eax
	cmpl	-188(%rbp), %eax
	jl	.L28
	movq	-184(%rbp), %rax
	movq	%rax, %rdi
	call	trie_count
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	-184(%rbp), %rax
	movq	%rax, %rdi
	call	trie_free
.L20:
	leaq	-176(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	jne	.L29
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L31
	call	__stack_chk_fail@PLT
.L31:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.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
	.type	trie_free.part.0, @function
trie_free.part.0:
.LFB56:
	.cfi_startproc
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	208(%rdi), %rax
	movq	%rdi, %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	$88, %rsp
	.cfi_def_cfa_offset 144
	movq	%rax, 40(%rsp)
	movq	%rdi, 48(%rsp)
.L11:
	movq	(%r15), %r13
	testq	%r13, %r13
	je	.L2
	leaq	208(%r13), %rax
	movq	%r13, 56(%rsp)
	movq	%r13, %r14
	movq	%rax, 32(%rsp)
.L10:
	movq	(%r14), %rbp
	testq	%rbp, %rbp
	je	.L3
	leaq	208(%rbp), %rax
	movq	%rbp, %rbx
	movq	%rax, 8(%rsp)
.L9:
	movq	(%rbx), %r12
	testq	%r12, %r12
	je	.L4
	leaq	208(%r12), %rax
	movq	%rbx, 64(%rsp)
	movq	%r12, %rbx
	movq	%rax, 24(%rsp)
.L8:
	movq	(%rbx), %r8
	testq	%r8, %r8
	je	.L5
	leaq	208(%r8), %rdx
	movq	%r15, 72(%rsp)
	movq	%r8, %r13
	movq	%rbx, %r15
	movq	%rdx, 16(%rsp)
	movq	%r8, %rbx
.L7:
	movq	(%rbx), %rdi
	testq	%rdi, %rdi
	je	.L6
	call	trie_free.part.0
	.p2align 4,,10
	.p2align 3
.L6:
	addq	$8, %rbx
	cmpq	16(%rsp), %rbx
	jne	.L7
	movq	%r13, %rdi
	movq	%r15, %rbx
	movq	72(%rsp), %r15
	call	free@PLT
.L5:
	addq	$8, %rbx
	cmpq	24(%rsp), %rbx
	jne	.L8
	movq	%r12, %rdi
	movq	64(%rsp), %rbx
	call	free@PLT
.L4:
	addq	$8, %rbx
	cmpq	%rbx, 8(%rsp)
	jne	.L9
	movq	%rbp, %rdi
	call	free@PLT
.L3:
	addq	$8, %r14
	cmpq	32(%rsp), %r14
	jne	.L10
	movq	56(%rsp), %rdi
	call	free@PLT
.L2:
	addq	$8, %r15
	cmpq	40(%rsp), %r15
	jne	.L11
	movq	48(%rsp), %rdi
	addq	$88, %rsp
	.cfi_def_cfa_offset 56
	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
	jmp	free@PLT
	.cfi_endproc
.LFE56:
	.size	trie_free.part.0, .-trie_free.part.0
	.p2align 4
	.globl	trie_cons
	.type	trie_cons, @function
trie_cons:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%rsi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	testq	%rsi, %rsi
	je	.L46
.L35:
	movzbl	0(%rbp), %eax
	testb	%al, %al
	jne	.L47
	movb	$1, 208(%r12)
.L43:
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movq	%r12, %rax
	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
	.p2align 4,,10
	.p2align 3
.L47:
	.cfi_restore_state
	movsbl	%al, %ebx
	subl	$97, %ebx
	movslq	%ebx, %rbx
	movq	(%r12,%rbx,8), %r13
	testq	%r13, %r13
	je	.L48
.L37:
	movzbl	1(%rbp), %eax
	testb	%al, %al
	jne	.L49
	movb	$1, 208(%r13)
.L42:
	movq	%r13, (%r12,%rbx,8)
	jmp	.L43
	.p2align 4,,10
	.p2align 3
.L46:
	movl	$216, %esi
	movl	$1, %edi
	call	calloc@PLT
	movq	%rax, %r12
	jmp	.L35
	.p2align 4,,10
	.p2align 3
.L49:
	movsbl	%al, %r14d
	subl	$97, %r14d
	movslq	%r14d, %r14
	movq	0(%r13,%r14,8), %r15
	testq	%r15, %r15
	je	.L50
.L39:
	movzbl	2(%rbp), %eax
	testb	%al, %al
	jne	.L51
	movb	$1, 208(%r15)
.L41:
	movq	%r15, 0(%r13,%r14,8)
	jmp	.L42
	.p2align 4,,10
	.p2align 3
.L48:
	movl	$216, %esi
	movl	$1, %edi
	call	calloc@PLT
	movq	%rax, %r13
	jmp	.L37
	.p2align 4,,10
	.p2align 3
.L51:
	movsbl	%al, %edx
	leaq	3(%rbp), %rdi
	subl	$97, %edx
	movslq	%edx, %rdx
	movq	(%r15,%rdx,8), %rsi
	movq	%rdx, 8(%rsp)
	call	trie_cons
	movq	8(%rsp), %rdx
	movq	%rax, (%r15,%rdx,8)
	jmp	.L41
	.p2align 4,,10
	.p2align 3
.L50:
	movl	$216, %esi
	movl	$1, %edi
	call	calloc@PLT
	movq	%rax, %r15
	jmp	.L39
	.cfi_endproc
.LFE51:
	.size	trie_cons, .-trie_cons
	.p2align 4
	.globl	trie_count
	.type	trie_count, @function
trie_count:
.LFB52:
	.cfi_startproc
	endbr64
	testq	%rdi, %rdi
	je	.L106
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	208(%rdi), %rax
	xorl	%r8d, %r8d
	movq	%rdi, %rcx
	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	$152, %rsp
	.cfi_def_cfa_offset 208
	cmpb	$0, 208(%rdi)
	movq	%rax, 16(%rsp)
	setne	%r8b
	movl	%r8d, %esi
.L70:
	movq	(%rcx), %rax
	testq	%rax, %rax
	je	.L54
	xorl	%edi, %edi
	cmpb	$0, 208(%rax)
	movq	%rax, %r8
	movq	%rcx, 88(%rsp)
	setne	%dil
	leaq	208(%rax), %rax
	movl	%esi, 104(%rsp)
	movq	%r8, %r15
	movl	%edi, 8(%rsp)
	movq	%rax, 24(%rsp)
.L69:
	movq	(%r15), %rax
	testq	%rax, %rax
	je	.L55
	xorl	%edi, %edi
	cmpb	$0, 208(%rax)
	movq	%rax, %rcx
	movq	%r15, 96(%rsp)
	setne	%dil
	leaq	208(%rax), %rax
	movq	%rcx, %r14
	movl	%edi, 12(%rsp)
	movq	%rax, 32(%rsp)
.L68:
	movq	(%r14), %rax
	testq	%rax, %rax
	je	.L56
	xorl	%r15d, %r15d
	movq	%rax, %r13
	cmpb	$0, 208(%rax)
	movq	%r14, %r12
	leaq	208(%rax), %rax
	setne	%r15b
	movq	%rax, 40(%rsp)
	movl	%r15d, %r14d
.L67:
	movq	0(%r13), %rax
	testq	%rax, %rax
	je	.L57
	xorl	%r15d, %r15d
	movq	%rax, %rsi
	cmpb	$0, 208(%rax)
	movl	%r14d, 108(%rsp)
	leaq	208(%rax), %rax
	setne	%r15b
	movq	%r13, %r14
	movq	%r12, %r13
	movq	%rax, 48(%rsp)
	movl	%r15d, %r10d
	movq	%rsi, %r15
.L66:
	movq	(%r15), %rbx
	testq	%rbx, %rbx
	je	.L58
	leaq	208(%rbx), %rax
	movl	%r10d, 120(%rsp)
	xorl	%esi, %esi
	movq	%r15, %r11
	movq	%rax, 56(%rsp)
	cmpb	$0, 208(%rbx)
	movq	%r14, %r15
	movq	%r13, %r14
	setne	%sil
	movq	%rbx, %r13
.L65:
	movq	0(%r13), %rbp
	testq	%rbp, %rbp
	je	.L59
	leaq	208(%rbp), %rax
	xorl	%edx, %edx
	cmpb	$0, 208(%rbp)
	movq	%r13, %r9
	movq	%rax, 64(%rsp)
	setne	%dl
.L64:
	movq	0(%rbp), %rbx
	testq	%rbx, %rbx
	je	.L60
	leaq	208(%rbx), %rax
	xorl	%r13d, %r13d
	movq	%rbp, %r8
	cmpb	$0, 208(%rbx)
	movq	%rax, 72(%rsp)
	movq	%r15, %rax
	setne	%r13b
	movq	%r14, %r15
	movq	%rax, %r14
.L63:
	movq	(%rbx), %r12
	testq	%r12, %r12
	je	.L61
	leaq	208(%r12), %rax
	xorl	%ebp, %ebp
	movq	%rbx, 112(%rsp)
	cmpb	$0, 208(%r12)
	movq	%rax, 80(%rsp)
	setne	%bpl
	movq	%r11, %rbx
	movl	%r13d, 124(%rsp)
	movq	%r9, %r13
.L62:
	movq	(%r12), %rdi
	movl	%edx, 140(%rsp)
	addq	$8, %r12
	movl	%esi, 136(%rsp)
	movq	%r8, 128(%rsp)
	call	trie_count
	movq	128(%rsp), %r8
	movl	136(%rsp), %esi
	addl	%eax, %ebp
	cmpq	%r12, 80(%rsp)
	movl	140(%rsp), %edx
	jne	.L62
	movq	%r13, %r9
	movl	124(%rsp), %r13d
	movq	%rbx, %r11
	movq	112(%rsp), %rbx
	addl	%ebp, %r13d
.L61:
	addq	$8, %rbx
	cmpq	%rbx, 72(%rsp)
	jne	.L63
	movq	%r14, %rax
	movq	%r8, %rbp
	movq	%r15, %r14
	addl	%r13d, %edx
	movq	%rax, %r15
.L60:
	addq	$8, %rbp
	cmpq	%rbp, 64(%rsp)
	jne	.L64
	movq	%r9, %r13
	addl	%edx, %esi
.L59:
	addq	$8, %r13
	cmpq	%r13, 56(%rsp)
	jne	.L65
	movl	120(%rsp), %r10d
	movq	%r14, %r13
	movq	%r15, %r14
	movq	%r11, %r15
	addl	%esi, %r10d
.L58:
	addq	$8, %r15
	cmpq	%r15, 48(%rsp)
	jne	.L66
	movq	%r13, %r12
	movq	%r14, %r13
	movl	108(%rsp), %r14d
	addl	%r10d, %r14d
.L57:
	addq	$8, %r13
	cmpq	%r13, 40(%rsp)
	jne	.L67
	movl	%r14d, %r15d
	addl	%r15d, 12(%rsp)
	movq	%r12, %r14
.L56:
	addq	$8, %r14
	cmpq	%r14, 32(%rsp)
	jne	.L68
	movl	12(%rsp), %edi
	addl	%edi, 8(%rsp)
	movq	96(%rsp), %r15
.L55:
	addq	$8, %r15
	cmpq	%r15, 24(%rsp)
	jne	.L69
	movq	88(%rsp), %rcx
	movl	104(%rsp), %esi
	addl	8(%rsp), %esi
.L54:
	addq	$8, %rcx
	cmpq	%rcx, 16(%rsp)
	jne	.L70
	addq	$152, %rsp
	.cfi_def_cfa_offset 56
	movl	%esi, %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
.L106:
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	.cfi_restore 13
	.cfi_restore 14
	.cfi_restore 15
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE52:
	.size	trie_count, .-trie_count
	.p2align 4
	.globl	trie_free
	.type	trie_free, @function
trie_free:
.LFB53:
	.cfi_startproc
	endbr64
	testq	%rdi, %rdi
	je	.L111
	jmp	trie_free.part.0
	.p2align 4,,10
	.p2align 3
.L111:
	ret
	.cfi_endproc
.LFE53:
	.size	trie_free, .-trie_free
	.p2align 4
	.globl	reverse
	.type	reverse, @function
reverse:
.LFB54:
	.cfi_startproc
	endbr64
	movl	%esi, %r8d
	shrl	$31, %r8d
	addl	%esi, %r8d
	sarl	%r8d
	cmpl	$1, %esi
	jle	.L113
	movslq	%esi, %rsi
	xorl	%eax, %eax
	leaq	-1(%rdi,%rsi), %rdx
	.p2align 4,,10
	.p2align 3
.L115:
	movzbl	(%rdx), %esi
	movzbl	(%rdi,%rax), %ecx
	subq	$1, %rdx
	movb	%sil, (%rdi,%rax)
	addq	$1, %rax
	movb	%cl, 1(%rdx)
	cmpl	%eax, %r8d
	jg	.L115
.L113:
	ret
	.cfi_endproc
.LFE54:
	.size	reverse, .-reverse
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%*d%*c"
.LC1:
	.string	"%s%*c"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB55:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	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	$376, %rsp
	.cfi_def_cfa_offset 432
	movq	%fs:40, %rax
	movq	%rax, 360(%rsp)
	xorl	%eax, %eax
	leaq	192(%rsp), %r15
	call	__isoc99_scanf@PLT
	leaq	193(%rsp), %rax
	movq	%rax, 64(%rsp)
	.p2align 4,,10
	.p2align 3
.L188:
	xorl	%eax, %eax
	movq	%r15, %rsi
	leaq	.LC1(%rip), %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L227
	movq	%r15, %rdi
	call	strlen@PLT
	movl	%eax, %edx
	cmpq	$1, %rax
	jbe	.L119
	subl	$1, %eax
	movq	%r15, %rbp
	xorl	%r12d, %r12d
	movl	$1, %r13d
	movl	%eax, 48(%rsp)
	leaq	272(%rsp), %rax
	movq	%r12, %r15
	movq	%r13, %r14
	movq	%rax, 24(%rsp)
	movslq	%edx, %rax
	movq	%rbp, %r12
	movq	%rax, 40(%rsp)
	leaq	279(%rsp), %rax
	movq	%rax, 104(%rsp)
	.p2align 4,,10
	.p2align 3
.L180:
	movl	48(%rsp), %eax
	movq	24(%rsp), %rdi
	movl	%r14d, %ebx
	xorl	%r10d, %r10d
	sarl	%ebx
	movl	$0, 12(%rsp)
	movq	%r12, %r9
	movl	%eax, %r11d
	addq	%rax, %rdi
	movq	%rax, 16(%rsp)
	leal	-1(%rbx), %eax
	movq	%rax, 72(%rsp)
	addq	64(%rsp), %rax
	sarl	%r11d
	movq	%rdi, 32(%rsp)
	movl	%r11d, %r12d
	movq	%rax, 80(%rsp)
	movl	%ebx, 52(%rsp)
	movl	%r10d, %ebx
	movq	%rbp, 56(%rsp)
	addq	$1, %rbp
.L120:
	movl	%ebx, %eax
	andl	$1, %eax
	movl	%eax, 8(%rsp)
	jne	.L124
.L131:
	movq	16(%rsp), %rdx
	movq	24(%rsp), %rdi
	movl	$73, %ecx
	movq	%rbp, %rsi
	movq	%r9, (%rsp)
	call	__memcpy_chk@PLT
	cmpl	$8, %r14d
	movq	(%rsp), %r9
	movl	%r14d, %ecx
	jnb	.L125
	testb	$4, %r14b
	jne	.L228
	testl	%ecx, %ecx
	je	.L126
	movzbl	(%r9), %eax
	movq	32(%rsp), %rdi
	movb	%al, (%rdi)
	testb	$2, %cl
	jne	.L229
.L126:
	movq	40(%rsp), %rax
	movb	$0, 272(%rsp,%rax)
	testq	%r15, %r15
	je	.L230
.L130:
	movsbl	272(%rsp), %r13d
	testb	%r13b, %r13b
	jne	.L231
	movsbl	192(%rsp), %r13d
	movb	$1, 208(%r15)
	testb	%r13b, %r13b
	jne	.L232
.L224:
	movl	12(%rsp), %ecx
	movb	$1, 208(%r15)
	testl	%ecx, %ecx
	jne	.L172
.L175:
	movl	8(%rsp), %edx
	testl	%edx, %edx
	jne	.L233
.L174:
	addl	$1, %ebx
	cmpl	$4, %ebx
	je	.L234
.L177:
	movl	%ebx, %eax
	andl	$2, %eax
	movl	%eax, 12(%rsp)
	je	.L120
	movl	52(%rsp), %esi
	testl	%esi, %esi
	je	.L120
	movq	56(%rsp), %rdx
	movq	64(%rsp), %rdi
	movq	%r9, %rax
	addq	72(%rsp), %rdi
	.p2align 4,,10
	.p2align 3
.L123:
	movzbl	(%rdx), %esi
	movzbl	(%rax), %ecx
	addq	$1, %rax
	subq	$1, %rdx
	movb	%sil, -1(%rax)
	movb	%cl, 1(%rdx)
	cmpq	%rax, %rdi
	jne	.L123
	movl	%ebx, %eax
	andl	$1, %eax
	movl	%eax, 8(%rsp)
	je	.L131
.L124:
	cmpl	$1, 48(%rsp)
	je	.L131
	movq	16(%rsp), %rax
	leaq	-1(%rax,%rbp), %rdx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L132:
	movzbl	(%rdx), %esi
	movzbl	0(%rbp,%rax), %ecx
	subq	$1, %rdx
	movb	%sil, 0(%rbp,%rax)
	addq	$1, %rax
	movb	%cl, 1(%rdx)
	cmpl	%eax, %r12d
	jg	.L132
	jmp	.L131
	.p2align 4,,10
	.p2align 3
.L125:
	movq	32(%rsp), %rdi
	movq	(%r9), %rax
	movq	%r9, %rsi
	movq	%rax, (%rdi)
	movl	%r14d, %eax
	movq	-8(%r9,%rax), %rdx
	movq	%rdx, -8(%rdi,%rax)
	movq	%rdi, %rax
	leaq	8(%rdi), %rdi
	andq	$-8, %rdi
	subq	%rdi, %rax
	movq	%rax, %rcx
	subq	%rax, %rsi
	addl	%r14d, %ecx
	shrl	$3, %ecx
	rep movsq
	jmp	.L126
	.p2align 4,,10
	.p2align 3
.L231:
	subl	$97, %r13d
	movslq	%r13d, %r13
	movq	(%r15,%r13,8), %rdx
	testq	%rdx, %rdx
	je	.L235
.L134:
	movzbl	273(%rsp), %eax
	testb	%al, %al
	jne	.L236
	movb	$1, 208(%rdx)
.L151:
	movq	%rdx, (%r15,%r13,8)
	movsbl	192(%rsp), %r13d
	testb	%r13b, %r13b
	je	.L224
.L232:
	subl	$97, %r13d
	movslq	%r13d, %r13
	movq	(%r15,%r13,8), %rdx
	testq	%rdx, %rdx
	je	.L237
.L153:
	movzbl	193(%rsp), %eax
	testb	%al, %al
	jne	.L238
	movb	$1, 208(%rdx)
.L170:
	movl	12(%rsp), %ecx
	movq	%rdx, (%r15,%r13,8)
	testl	%ecx, %ecx
	je	.L175
.L172:
	movl	52(%rsp), %eax
	testl	%eax, %eax
	je	.L175
	movq	56(%rsp), %rdx
	movq	80(%rsp), %rdi
	movq	%r9, %rax
	.p2align 4,,10
	.p2align 3
.L176:
	movzbl	(%rdx), %esi
	movzbl	(%rax), %ecx
	addq	$1, %rax
	subq	$1, %rdx
	movb	%sil, -1(%rax)
	movb	%cl, 1(%rdx)
	cmpq	%rax, %rdi
	jne	.L176
	movl	8(%rsp), %edx
	testl	%edx, %edx
	je	.L174
.L233:
	cmpl	$1, 48(%rsp)
	je	.L174
	movq	16(%rsp), %rax
	leaq	-1(%rax,%rbp), %rdx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L179:
	movzbl	(%rdx), %esi
	movzbl	0(%rbp,%rax), %ecx
	subq	$1, %rdx
	movb	%sil, 0(%rbp,%rax)
	addq	$1, %rax
	movb	%cl, 1(%rdx)
	cmpl	%eax, %r12d
	jg	.L179
	addl	$1, %ebx
	cmpl	$4, %ebx
	jne	.L177
.L234:
	addq	$1, %r14
	subl	$1, 48(%rsp)
	movq	%r9, %r12
	jne	.L180
	movq	%r15, %r12
	movq	%r9, %r15
	testq	%r12, %r12
	je	.L119
	movq	%r12, %r14
	xorl	%r12d, %r12d
	cmpb	$0, 208(%r14)
	movq	%r14, %rbx
	leaq	208(%r14), %rbp
	movq	%r14, %r13
	setne	%r12b
	.p2align 4,,10
	.p2align 3
.L181:
	movq	0(%r13), %rdi
	addq	$8, %r13
	call	trie_count
	addl	%eax, %r12d
	cmpq	%r13, %rbp
	jne	.L181
	movl	%r12d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	.p2align 4,,10
	.p2align 3
.L184:
	movq	(%rbx), %rdi
	testq	%rdi, %rdi
	je	.L183
	call	trie_free.part.0
.L183:
	addq	$8, %rbx
	cmpq	%rbx, %rbp
	jne	.L184
	movq	%r14, %rdi
	call	free@PLT
	jmp	.L188
	.p2align 4,,10
	.p2align 3
.L230:
	movl	$216, %esi
	movl	$1, %edi
	movq	%r9, (%rsp)
	call	calloc@PLT
	movq	(%rsp), %r9
	movq	%rax, %r15
	jmp	.L130
	.p2align 4,,10
	.p2align 3
.L238:
	movsbl	%al, %ecx
	subl	$97, %ecx
	movslq	%ecx, %rcx
	movq	(%rdx,%rcx,8), %r10
	testq	%r10, %r10
	je	.L239
.L155:
	movsbl	194(%rsp), %eax
	testb	%al, %al
	jne	.L240
	movb	$1, 208(%r10)
.L169:
	movq	%r10, (%rdx,%rcx,8)
	jmp	.L170
	.p2align 4,,10
	.p2align 3
.L236:
	movsbl	%al, %ecx
	subl	$97, %ecx
	movslq	%ecx, %rcx
	movq	(%rdx,%rcx,8), %r10
	testq	%r10, %r10
	je	.L241
.L136:
	movsbl	274(%rsp), %eax
	testb	%al, %al
	jne	.L242
	movb	$1, 208(%r10)
.L150:
	movq	%r10, (%rdx,%rcx,8)
	jmp	.L151
	.p2align 4,,10
	.p2align 3
.L237:
	movl	$216, %esi
	movl	$1, %edi
	movq	%r9, (%rsp)
	call	calloc@PLT
	movq	(%rsp), %r9
	movq	%rax, %rdx
	jmp	.L153
	.p2align 4,,10
	.p2align 3
.L235:
	movl	$216, %esi
	movl	$1, %edi
	movq	%r9, (%rsp)
	call	calloc@PLT
	movq	(%rsp), %r9
	movq	%rax, %rdx
	jmp	.L134
	.p2align 4,,10
	.p2align 3
.L228:
	movl	(%r9), %eax
	movq	32(%rsp), %rdi
	movl	%eax, (%rdi)
	movl	-4(%r9,%rcx), %eax
	movl	%eax, -4(%rdi,%rcx)
	jmp	.L126
	.p2align 4,,10
	.p2align 3
.L242:
	subl	$97, %eax
	movslq	%eax, %r8
	movq	(%r10,%r8,8), %r11
	testq	%r11, %r11
	je	.L243
.L138:
	movsbl	275(%rsp), %eax
	testb	%al, %al
	jne	.L244
	movb	$1, 208(%r11)
.L149:
	movq	%r11, (%r10,%r8,8)
	jmp	.L150
	.p2align 4,,10
	.p2align 3
.L240:
	subl	$97, %eax
	movslq	%eax, %r8
	movq	(%r10,%r8,8), %r11
	testq	%r11, %r11
	je	.L245
.L157:
	movsbl	195(%rsp), %eax
	testb	%al, %al
	jne	.L246
	movb	$1, 208(%r11)
.L168:
	movq	%r11, (%r10,%r8,8)
	jmp	.L169
.L229:
	movzwl	-2(%r9,%rcx), %eax
	movq	32(%rsp), %rdi
	movw	%ax, -2(%rdi,%rcx)
	jmp	.L126
.L241:
	movl	$216, %esi
	movl	$1, %edi
	movq	%r9, 96(%rsp)
	movq	%rcx, 88(%rsp)
	movq	%rdx, (%rsp)
	call	calloc@PLT
	movq	96(%rsp), %r9
	movq	88(%rsp), %rcx
	movq	(%rsp), %rdx
	movq	%rax, %r10
	jmp	.L136
.L239:
	movl	$216, %esi
	movl	$1, %edi
	movq	%r9, 96(%rsp)
	movq	%rcx, 88(%rsp)
	movq	%rdx, (%rsp)
	call	calloc@PLT
	movq	96(%rsp), %r9
	movq	88(%rsp), %rcx
	movq	(%rsp), %rdx
	movq	%rax, %r10
	jmp	.L155
.L244:
	subl	$97, %eax
	cltq
	movq	%rax, 88(%rsp)
	movq	(%r11,%rax,8), %rax
	movq	%rax, (%rsp)
	testq	%rax, %rax
	je	.L247
.L140:
	movsbl	276(%rsp), %eax
	testb	%al, %al
	jne	.L248
	movq	(%rsp), %rax
	movb	$1, 208(%rax)
	movq	%rax, %rdi
.L148:
	movq	88(%rsp), %rax
	movq	%rdi, (%r11,%rax,8)
	jmp	.L149
.L246:
	subl	$97, %eax
	cltq
	movq	%rax, 88(%rsp)
	movq	(%r11,%rax,8), %rax
	movq	%rax, (%rsp)
	testq	%rax, %rax
	je	.L249
.L159:
	movsbl	196(%rsp), %eax
	testb	%al, %al
	jne	.L250
	movq	(%rsp), %rax
	movb	$1, 208(%rax)
	movq	%rax, %rdi
.L167:
	movq	88(%rsp), %rax
	movq	%rdi, (%r11,%rax,8)
	jmp	.L168
.L119:
	xorl	%edx, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L188
.L243:
	movl	$216, %esi
	movl	$1, %edi
	movq	%r9, 120(%rsp)
	movq	%r8, 112(%rsp)
	movq	%rcx, 96(%rsp)
	movq	%r10, 88(%rsp)
	movq	%rdx, (%rsp)
	call	calloc@PLT
	movq	120(%rsp), %r9
	movq	112(%rsp), %r8
	movq	96(%rsp), %rcx
	movq	88(%rsp), %r10
	movq	%rax, %r11
	movq	(%rsp), %rdx
	jmp	.L138
.L245:
	movl	$216, %esi
	movl	$1, %edi
	movq	%r9, 120(%rsp)
	movq	%r8, 112(%rsp)
	movq	%rcx, 96(%rsp)
	movq	%r10, 88(%rsp)
	movq	%rdx, (%rsp)
	call	calloc@PLT
	movq	120(%rsp), %r9
	movq	112(%rsp), %r8
	movq	96(%rsp), %rcx
	movq	88(%rsp), %r10
	movq	%rax, %r11
	movq	(%rsp), %rdx
	jmp	.L157
.L248:
	movq	(%rsp), %rdi
	subl	$97, %eax
	cltq
	movq	%rax, 128(%rsp)
	movq	(%rdi,%rax,8), %rax
	movq	%rax, 96(%rsp)
	testq	%rax, %rax
	je	.L251
.L142:
	movsbl	277(%rsp), %eax
	testb	%al, %al
	jne	.L252
	movq	96(%rsp), %rax
	movb	$1, 208(%rax)
	movq	%rax, %rsi
.L147:
	movq	(%rsp), %rax
	movq	128(%rsp), %rdi
	movq	%rsi, (%rax,%rdi,8)
	movq	%rax, %rdi
	jmp	.L148
.L250:
	movq	(%rsp), %rdi
	subl	$97, %eax
	cltq
	movq	%rax, 128(%rsp)
	movq	(%rdi,%rax,8), %rax
	movq	%rax, 96(%rsp)
	testq	%rax, %rax
	je	.L253
.L161:
	movsbl	197(%rsp), %eax
	testb	%al, %al
	jne	.L254
	movq	96(%rsp), %rax
	movb	$1, 208(%rax)
	movq	%rax, %rsi
.L166:
	movq	(%rsp), %rax
	movq	128(%rsp), %rdi
	movq	%rsi, (%rax,%rdi,8)
	movq	%rax, %rdi
	jmp	.L167
.L247:
	movl	$216, %esi
	movl	$1, %edi
	movq	%r9, 144(%rsp)
	movq	%r8, 136(%rsp)
	movq	%rcx, 128(%rsp)
	movq	%r11, 120(%rsp)
	movq	%r10, 112(%rsp)
	movq	%rdx, 96(%rsp)
	call	calloc@PLT
	movq	120(%rsp), %r11
	movq	112(%rsp), %r10
	movq	%rax, (%rsp)
	movq	144(%rsp), %r9
	movq	136(%rsp), %r8
	movq	128(%rsp), %rcx
	movq	96(%rsp), %rdx
	jmp	.L140
.L249:
	movl	$216, %esi
	movl	$1, %edi
	movq	%r9, 144(%rsp)
	movq	%r8, 136(%rsp)
	movq	%rcx, 128(%rsp)
	movq	%r11, 120(%rsp)
	movq	%r10, 112(%rsp)
	movq	%rdx, 96(%rsp)
	call	calloc@PLT
	movq	120(%rsp), %r11
	movq	112(%rsp), %r10
	movq	%rax, (%rsp)
	movq	144(%rsp), %r9
	movq	136(%rsp), %r8
	movq	128(%rsp), %rcx
	movq	96(%rsp), %rdx
	jmp	.L159
.L227:
	movq	360(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L255
	addq	$376, %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
.L252:
	.cfi_restore_state
	movq	96(%rsp), %rdi
	subl	$97, %eax
	cltq
	movq	%rax, 136(%rsp)
	movq	(%rdi,%rax,8), %rax
	movq	%rax, 112(%rsp)
	testq	%rax, %rax
	je	.L256
.L144:
	movsbl	278(%rsp), %eax
	testb	%al, %al
	jne	.L257
	movq	112(%rsp), %rax
	movb	$1, 208(%rax)
	movq	%rax, %rsi
.L146:
	movq	96(%rsp), %rax
	movq	136(%rsp), %rdi
	movq	%rsi, (%rax,%rdi,8)
	movq	%rax, %rsi
	jmp	.L147
.L254:
	movq	96(%rsp), %rdi
	subl	$97, %eax
	cltq
	movq	%rax, 136(%rsp)
	movq	(%rdi,%rax,8), %rax
	movq	%rax, 112(%rsp)
	testq	%rax, %rax
	je	.L258
.L163:
	movsbl	198(%rsp), %eax
	testb	%al, %al
	jne	.L259
	movq	112(%rsp), %rax
	movb	$1, 208(%rax)
	movq	%rax, %rsi
.L165:
	movq	96(%rsp), %rax
	movq	136(%rsp), %rdi
	movq	%rsi, (%rax,%rdi,8)
	movq	%rax, %rsi
	jmp	.L166
.L257:
	movq	112(%rsp), %rsi
	subl	$97, %eax
	movq	104(%rsp), %rdi
	movq	%r9, 184(%rsp)
	cltq
	movq	%r8, 176(%rsp)
	movq	(%rsi,%rax,8), %rsi
	movq	%rcx, 168(%rsp)
	movq	%r11, 160(%rsp)
	movq	%r10, 152(%rsp)
	movq	%rdx, 144(%rsp)
	movq	%rax, 120(%rsp)
	call	trie_cons
	movq	112(%rsp), %rsi
	movq	120(%rsp), %rdi
	movq	144(%rsp), %rdx
	movq	152(%rsp), %r10
	movq	%rax, (%rsi,%rdi,8)
	movq	160(%rsp), %r11
	movq	168(%rsp), %rcx
	movq	176(%rsp), %r8
	movq	184(%rsp), %r9
	jmp	.L146
.L259:
	movq	112(%rsp), %rsi
	subl	$97, %eax
	leaq	199(%rsp), %rdi
	movq	%r9, 184(%rsp)
	cltq
	movq	%r8, 176(%rsp)
	movq	(%rsi,%rax,8), %rsi
	movq	%rcx, 168(%rsp)
	movq	%r11, 160(%rsp)
	movq	%r10, 152(%rsp)
	movq	%rdx, 144(%rsp)
	movq	%rax, 120(%rsp)
	call	trie_cons
	movq	112(%rsp), %rsi
	movq	120(%rsp), %rdi
	movq	144(%rsp), %rdx
	movq	152(%rsp), %r10
	movq	%rax, (%rsi,%rdi,8)
	movq	160(%rsp), %r11
	movq	168(%rsp), %rcx
	movq	176(%rsp), %r8
	movq	184(%rsp), %r9
	jmp	.L165
.L253:
	movl	$216, %esi
	movl	$1, %edi
	movq	%r9, 160(%rsp)
	movq	%r8, 152(%rsp)
	movq	%rcx, 144(%rsp)
	movq	%r11, 136(%rsp)
	movq	%r10, 120(%rsp)
	movq	%rdx, 112(%rsp)
	call	calloc@PLT
	movq	160(%rsp), %r9
	movq	152(%rsp), %r8
	movq	120(%rsp), %r10
	movq	112(%rsp), %rdx
	movq	%rax, 96(%rsp)
	movq	144(%rsp), %rcx
	movq	136(%rsp), %r11
	jmp	.L161
.L251:
	movl	$216, %esi
	movl	$1, %edi
	movq	%r9, 160(%rsp)
	movq	%r8, 152(%rsp)
	movq	%rcx, 144(%rsp)
	movq	%r11, 136(%rsp)
	movq	%r10, 120(%rsp)
	movq	%rdx, 112(%rsp)
	call	calloc@PLT
	movq	160(%rsp), %r9
	movq	152(%rsp), %r8
	movq	120(%rsp), %r10
	movq	112(%rsp), %rdx
	movq	%rax, 96(%rsp)
	movq	144(%rsp), %rcx
	movq	136(%rsp), %r11
	jmp	.L142
.L258:
	movl	$216, %esi
	movl	$1, %edi
	movq	%r9, 176(%rsp)
	movq	%r8, 168(%rsp)
	movq	%rcx, 160(%rsp)
	movq	%r11, 152(%rsp)
	movq	%r10, 144(%rsp)
	movq	%rdx, 120(%rsp)
	call	calloc@PLT
	movq	176(%rsp), %r9
	movq	168(%rsp), %r8
	movq	%rax, 112(%rsp)
	movq	160(%rsp), %rcx
	movq	152(%rsp), %r11
	movq	144(%rsp), %r10
	movq	120(%rsp), %rdx
	jmp	.L163
.L256:
	movl	$216, %esi
	movl	$1, %edi
	movq	%r9, 176(%rsp)
	movq	%r8, 168(%rsp)
	movq	%rcx, 160(%rsp)
	movq	%r11, 152(%rsp)
	movq	%r10, 144(%rsp)
	movq	%rdx, 120(%rsp)
	call	calloc@PLT
	movq	176(%rsp), %r9
	movq	168(%rsp), %r8
	movq	%rax, 112(%rsp)
	movq	160(%rsp), %rcx
	movq	152(%rsp), %r11
	movq	144(%rsp), %r10
	movq	120(%rsp), %rdx
	jmp	.L144
.L255:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE55:
	.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:

rule
	.file	"temp.c"
	.text
	.p2align 4
	.type	trie_free.part.0, @function
trie_free.part.0:
.LFB56:
	.cfi_startproc
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	208(%rdi), %rax
	movq	%rdi, %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	$88, %rsp
	.cfi_def_cfa_offset 144
	movq	%rax, 40(%rsp)
	movq	%rdi, 48(%rsp)
.L11:
	movq	(%r15), %r13
	testq	%r13, %r13
	je	.L2
	leaq	208(%r13), %rax
	movq	%r13, 56(%rsp)
	movq	%r13, %r14
	movq	%rax, 32(%rsp)
.L10:
	movq	(%r14), %rbp
	testq	%rbp, %rbp
	je	.L3
	leaq	208(%rbp), %rax
	movq	%rbp, %rbx
	movq	%rax, 8(%rsp)
.L9:
	movq	(%rbx), %r12
	testq	%r12, %r12
	je	.L4
	leaq	208(%r12), %rax
	movq	%rbx, 64(%rsp)
	movq	%r12, %rbx
	movq	%rax, 24(%rsp)
.L8:
	movq	(%rbx), %r8
	testq	%r8, %r8
	je	.L5
	leaq	208(%r8), %rdx
	movq	%r15, 72(%rsp)
	movq	%r8, %r13
	movq	%rbx, %r15
	movq	%rdx, 16(%rsp)
	movq	%r8, %rbx
.L7:
	movq	(%rbx), %rdi
	testq	%rdi, %rdi
	je	.L6
	call	trie_free.part.0
	.p2align 4,,10
	.p2align 3
.L6:
	addq	$8, %rbx
	cmpq	16(%rsp), %rbx
	jne	.L7
	movq	%r13, %rdi
	movq	%r15, %rbx
	movq	72(%rsp), %r15
	call	free@PLT
.L5:
	addq	$8, %rbx
	cmpq	24(%rsp), %rbx
	jne	.L8
	movq	%r12, %rdi
	movq	64(%rsp), %rbx
	call	free@PLT
.L4:
	addq	$8, %rbx
	cmpq	%rbx, 8(%rsp)
	jne	.L9
	movq	%rbp, %rdi
	call	free@PLT
.L3:
	addq	$8, %r14
	cmpq	32(%rsp), %r14
	jne	.L10
	movq	56(%rsp), %rdi
	call	free@PLT
.L2:
	addq	$8, %r15
	cmpq	40(%rsp), %r15
	jne	.L11
	movq	48(%rsp), %rdi
	addq	$88, %rsp
	.cfi_def_cfa_offset 56
	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
	jmp	free@PLT
	.cfi_endproc
.LFE56:
	.size	trie_free.part.0, .-trie_free.part.0
	.p2align 4
	.globl	trie_cons
	.type	trie_cons, @function
trie_cons:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%rsi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	testq	%rsi, %rsi
	je	.L46
.L35:
	movzbl	0(%rbp), %eax
	testb	%al, %al
	jne	.L47
	movb	$1, 208(%r12)
.L43:
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movq	%r12, %rax
	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
	.p2align 4,,10
	.p2align 3
.L47:
	.cfi_restore_state
	movsbl	%al, %ebx
	subl	$97, %ebx
	movslq	%ebx, %rbx
	movq	(%r12,%rbx,8), %r13
	testq	%r13, %r13
	je	.L48
.L37:
	movzbl	1(%rbp), %eax
	testb	%al, %al
	jne	.L49
	movb	$1, 208(%r13)
.L42:
	movq	%r13, (%r12,%rbx,8)
	jmp	.L43
	.p2align 4,,10
	.p2align 3
.L46:
	movl	$216, %esi
	movl	$1, %edi
	call	calloc@PLT
	movq	%rax, %r12
	jmp	.L35
	.p2align 4,,10
	.p2align 3
.L49:
	movsbl	%al, %r14d
	subl	$97, %r14d
	movslq	%r14d, %r14
	movq	0(%r13,%r14,8), %r15
	testq	%r15, %r15
	je	.L50
.L39:
	movzbl	2(%rbp), %eax
	testb	%al, %al
	jne	.L51
	movb	$1, 208(%r15)
.L41:
	movq	%r15, 0(%r13,%r14,8)
	jmp	.L42
	.p2align 4,,10
	.p2align 3
.L48:
	movl	$216, %esi
	movl	$1, %edi
	call	calloc@PLT
	movq	%rax, %r13
	jmp	.L37
	.p2align 4,,10
	.p2align 3
.L51:
	movsbl	%al, %edx
	leaq	3(%rbp), %rdi
	subl	$97, %edx
	movslq	%edx, %rdx
	movq	(%r15,%rdx,8), %rsi
	movq	%rdx, 8(%rsp)
	call	trie_cons
	movq	8(%rsp), %rdx
	movq	%rax, (%r15,%rdx,8)
	jmp	.L41
	.p2align 4,,10
	.p2align 3
.L50:
	movl	$216, %esi
	movl	$1, %edi
	call	calloc@PLT
	movq	%rax, %r15
	jmp	.L39
	.cfi_endproc
.LFE51:
	.size	trie_cons, .-trie_cons
	.p2align 4
	.globl	trie_count
	.type	trie_count, @function
trie_count:
.LFB52:
	.cfi_startproc
	endbr64
	testq	%rdi, %rdi
	je	.L106
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	208(%rdi), %rax
	xorl	%r8d, %r8d
	movq	%rdi, %rcx
	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	$152, %rsp
	.cfi_def_cfa_offset 208
	cmpb	$0, 208(%rdi)
	movq	%rax, 16(%rsp)
	setne	%r8b
	movl	%r8d, %esi
.L70:
	movq	(%rcx), %rax
	testq	%rax, %rax
	je	.L54
	xorl	%edi, %edi
	cmpb	$0, 208(%rax)
	movq	%rax, %r8
	movq	%rcx, 88(%rsp)
	setne	%dil
	leaq	208(%rax), %rax
	movl	%esi, 104(%rsp)
	movq	%r8, %r15
	movl	%edi, 8(%rsp)
	movq	%rax, 24(%rsp)
.L69:
	movq	(%r15), %rax
	testq	%rax, %rax
	je	.L55
	xorl	%edi, %edi
	cmpb	$0, 208(%rax)
	movq	%rax, %rcx
	movq	%r15, 96(%rsp)
	setne	%dil
	leaq	208(%rax), %rax
	movq	%rcx, %r14
	movl	%edi, 12(%rsp)
	movq	%rax, 32(%rsp)
.L68:
	movq	(%r14), %rax
	testq	%rax, %rax
	je	.L56
	xorl	%r15d, %r15d
	movq	%rax, %r13
	cmpb	$0, 208(%rax)
	movq	%r14, %r12
	leaq	208(%rax), %rax
	setne	%r15b
	movq	%rax, 40(%rsp)
	movl	%r15d, %r14d
.L67:
	movq	0(%r13), %rax
	testq	%rax, %rax
	je	.L57
	xorl	%r15d, %r15d
	movq	%rax, %rsi
	cmpb	$0, 208(%rax)
	movl	%r14d, 108(%rsp)
	leaq	208(%rax), %rax
	setne	%r15b
	movq	%r13, %r14
	movq	%r12, %r13
	movq	%rax, 48(%rsp)
	movl	%r15d, %r10d
	movq	%rsi, %r15
.L66:
	movq	(%r15), %rbx
	testq	%rbx, %rbx
	je	.L58
	leaq	208(%rbx), %rax
	movl	%r10d, 120(%rsp)
	xorl	%esi, %esi
	movq	%r15, %r11
	movq	%rax, 56(%rsp)
	cmpb	$0, 208(%rbx)
	movq	%r14, %r15
	movq	%r13, %r14
	setne	%sil
	movq	%rbx, %r13
.L65:
	movq	0(%r13), %rbp
	testq	%rbp, %rbp
	je	.L59
	leaq	208(%rbp), %rax
	xorl	%edx, %edx
	cmpb	$0, 208(%rbp)
	movq	%r13, %r9
	movq	%rax, 64(%rsp)
	setne	%dl
.L64:
	movq	0(%rbp), %rbx
	testq	%rbx, %rbx
	je	.L60
	leaq	208(%rbx), %rax
	xorl	%r13d, %r13d
	movq	%rbp, %r8
	cmpb	$0, 208(%rbx)
	movq	%rax, 72(%rsp)
	movq	%r15, %rax
	setne	%r13b
	movq	%r14, %r15
	movq	%rax, %r14
.L63:
	movq	(%rbx), %r12
	testq	%r12, %r12
	je	.L61
	leaq	208(%r12), %rax
	xorl	%ebp, %ebp
	movq	%rbx, 112(%rsp)
	cmpb	$0, 208(%r12)
	movq	%rax, 80(%rsp)
	setne	%bpl
	movq	%r11, %rbx
	movl	%r13d, 124(%rsp)
	movq	%r9, %r13
.L62:
	movq	(%r12), %rdi
	movl	%edx, 140(%rsp)
	addq	$8, %r12
	movl	%esi, 136(%rsp)
	movq	%r8, 128(%rsp)
	call	trie_count
	movq	128(%rsp), %r8
	movl	136(%rsp), %esi
	addl	%eax, %ebp
	cmpq	%r12, 80(%rsp)
	movl	140(%rsp), %edx
	jne	.L62
	movq	%r13, %r9
	movl	124(%rsp), %r13d
	movq	%rbx, %r11
	movq	112(%rsp), %rbx
	addl	%ebp, %r13d
.L61:
	addq	$8, %rbx
	cmpq	%rbx, 72(%rsp)
	jne	.L63
	movq	%r14, %rax
	movq	%r8, %rbp
	movq	%r15, %r14
	addl	%r13d, %edx
	movq	%rax, %r15
.L60:
	addq	$8, %rbp
	cmpq	%rbp, 64(%rsp)
	jne	.L64
	movq	%r9, %r13
	addl	%edx, %esi
.L59:
	addq	$8, %r13
	cmpq	%r13, 56(%rsp)
	jne	.L65
	movl	120(%rsp), %r10d
	movq	%r14, %r13
	movq	%r15, %r14
	movq	%r11, %r15
	addl	%esi, %r10d
.L58:
	addq	$8, %r15
	cmpq	%r15, 48(%rsp)
	jne	.L66
	movq	%r13, %r12
	movq	%r14, %r13
	movl	108(%rsp), %r14d
	addl	%r10d, %r14d
.L57:
	addq	$8, %r13
	cmpq	%r13, 40(%rsp)
	jne	.L67
	movl	%r14d, %r15d
	addl	%r15d, 12(%rsp)
	movq	%r12, %r14
.L56:
	addq	$8, %r14
	cmpq	%r14, 32(%rsp)
	jne	.L68
	movl	12(%rsp), %edi
	addl	%edi, 8(%rsp)
	movq	96(%rsp), %r15
.L55:
	addq	$8, %r15
	cmpq	%r15, 24(%rsp)
	jne	.L69
	movq	88(%rsp), %rcx
	movl	104(%rsp), %esi
	addl	8(%rsp), %esi
.L54:
	addq	$8, %rcx
	cmpq	%rcx, 16(%rsp)
	jne	.L70
	addq	$152, %rsp
	.cfi_def_cfa_offset 56
	movl	%esi, %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
.L106:
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	.cfi_restore 13
	.cfi_restore 14
	.cfi_restore 15
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE52:
	.size	trie_count, .-trie_count
	.p2align 4
	.globl	trie_free
	.type	trie_free, @function
trie_free:
.LFB53:
	.cfi_startproc
	endbr64
	testq	%rdi, %rdi
	je	.L111
	jmp	trie_free.part.0
	.p2align 4,,10
	.p2align 3
.L111:
	ret
	.cfi_endproc
.LFE53:
	.size	trie_free, .-trie_free
	.p2align 4
	.globl	reverse
	.type	reverse, @function
reverse:
.LFB54:
	.cfi_startproc
	endbr64
	movl	%esi, %r8d
	shrl	$31, %r8d
	addl	%esi, %r8d
	sarl	%r8d
	cmpl	$1, %esi
	jle	.L113
	movslq	%esi, %rsi
	xorl	%eax, %eax
	leaq	-1(%rdi,%rsi), %rdx
	.p2align 4,,10
	.p2align 3
.L115:
	movzbl	(%rdx), %esi
	movzbl	(%rdi,%rax), %ecx
	subq	$1, %rdx
	movb	%sil, (%rdi,%rax)
	addq	$1, %rax
	movb	%cl, 1(%rdx)
	cmpl	%eax, %r8d
	jg	.L115
.L113:
	ret
	.cfi_endproc
.LFE54:
	.size	reverse, .-reverse
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%*d%*c"
.LC1:
	.string	"%s%*c"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB55:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	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	$376, %rsp
	.cfi_def_cfa_offset 432
	movq	%fs:40, %rax
	movq	%rax, 360(%rsp)
	xorl	%eax, %eax
	leaq	192(%rsp), %r15
	call	__isoc99_scanf@PLT
	leaq	193(%rsp), %rax
	movq	%rax, 64(%rsp)
	.p2align 4,,10
	.p2align 3
.L188:
	xorl	%eax, %eax
	movq	%r15, %rsi
	leaq	.LC1(%rip), %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L227
	movq	%r15, %rdi
	call	strlen@PLT
	movl	%eax, %edx
	cmpq	$1, %rax
	jbe	.L119
	subl	$1, %eax
	movq	%r15, %rbp
	xorl	%r12d, %r12d
	movl	$1, %r13d
	movl	%eax, 48(%rsp)
	leaq	272(%rsp), %rax
	movq	%r12, %r15
	movq	%r13, %r14
	movq	%rax, 24(%rsp)
	movslq	%edx, %rax
	movq	%rbp, %r12
	movq	%rax, 40(%rsp)
	leaq	279(%rsp), %rax
	movq	%rax, 104(%rsp)
	.p2align 4,,10
	.p2align 3
.L180:
	movl	48(%rsp), %eax
	movq	24(%rsp), %rdi
	movl	%r14d, %ebx
	xorl	%r10d, %r10d
	sarl	%ebx
	movl	$0, 12(%rsp)
	movq	%r12, %r9
	movl	%eax, %r11d
	addq	%rax, %rdi
	movq	%rax, 16(%rsp)
	leal	-1(%rbx), %eax
	movq	%rax, 72(%rsp)
	addq	64(%rsp), %rax
	sarl	%r11d
	movq	%rdi, 32(%rsp)
	movl	%r11d, %r12d
	movq	%rax, 80(%rsp)
	movl	%ebx, 52(%rsp)
	movl	%r10d, %ebx
	movq	%rbp, 56(%rsp)
	addq	$1, %rbp
.L120:
	movl	%ebx, %eax
	andl	$1, %eax
	movl	%eax, 8(%rsp)
	jne	.L124
.L131:
	movq	16(%rsp), %rdx
	movq	24(%rsp), %rdi
	movl	$73, %ecx
	movq	%rbp, %rsi
	movq	%r9, (%rsp)
	call	__memcpy_chk@PLT
	cmpl	$8, %r14d
	movq	(%rsp), %r9
	movl	%r14d, %ecx
	jnb	.L125
	testb	$4, %r14b
	jne	.L228
	testl	%ecx, %ecx
	je	.L126
	movzbl	(%r9), %eax
	movq	32(%rsp), %rdi
	movb	%al, (%rdi)
	testb	$2, %cl
	jne	.L229
.L126:
	movq	40(%rsp), %rax
	movb	$0, 272(%rsp,%rax)
	testq	%r15, %r15
	je	.L230
.L130:
	movsbl	272(%rsp), %r13d
	testb	%r13b, %r13b
	jne	.L231
	movsbl	192(%rsp), %r13d
	movb	$1, 208(%r15)
	testb	%r13b, %r13b
	jne	.L232
.L224:
	movl	12(%rsp), %ecx
	movb	$1, 208(%r15)
	testl	%ecx, %ecx
	jne	.L172
.L175:
	movl	8(%rsp), %edx
	testl	%edx, %edx
	jne	.L233
.L174:
	addl	$1, %ebx
	cmpl	$4, %ebx
	je	.L234
.L177:
	movl	%ebx, %eax
	andl	$2, %eax
	movl	%eax, 12(%rsp)
	je	.L120
	movl	52(%rsp), %esi
	testl	%esi, %esi
	je	.L120
	movq	56(%rsp), %rdx
	movq	64(%rsp), %rdi
	movq	%r9, %rax
	addq	72(%rsp), %rdi
	.p2align 4,,10
	.p2align 3
.L123:
	movzbl	(%rdx), %esi
	movzbl	(%rax), %ecx
	addq	$1, %rax
	subq	$1, %rdx
	movb	%sil, -1(%rax)
	movb	%cl, 1(%rdx)
	cmpq	%rax, %rdi
	jne	.L123
	movl	%ebx, %eax
	andl	$1, %eax
	movl	%eax, 8(%rsp)
	je	.L131
.L124:
	cmpl	$1, 48(%rsp)
	je	.L131
	movq	16(%rsp), %rax
	leaq	-1(%rax,%rbp), %rdx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L132:
	movzbl	(%rdx), %esi
	movzbl	0(%rbp,%rax), %ecx
	subq	$1, %rdx
	movb	%sil, 0(%rbp,%rax)
	addq	$1, %rax
	movb	%cl, 1(%rdx)
	cmpl	%eax, %r12d
	jg	.L132
	jmp	.L131
	.p2align 4,,10
	.p2align 3
.L125:
	movq	32(%rsp), %rdi
	movq	(%r9), %rax
	movq	%r9, %rsi
	movq	%rax, (%rdi)
	movl	%r14d, %eax
	movq	-8(%r9,%rax), %rdx
	movq	%rdx, -8(%rdi,%rax)
	movq	%rdi, %rax
	leaq	8(%rdi), %rdi
	andq	$-8, %rdi
	subq	%rdi, %rax
	movq	%rax, %rcx
	subq	%rax, %rsi
	addl	%r14d, %ecx
	shrl	$3, %ecx
	rep movsq
	jmp	.L126
	.p2align 4,,10
	.p2align 3
.L231:
	subl	$97, %r13d
	movslq	%r13d, %r13
	movq	(%r15,%r13,8), %rdx
	testq	%rdx, %rdx
	je	.L235
.L134:
	movzbl	273(%rsp), %eax
	testb	%al, %al
	jne	.L236
	movb	$1, 208(%rdx)
.L151:
	movq	%rdx, (%r15,%r13,8)
	movsbl	192(%rsp), %r13d
	testb	%r13b, %r13b
	je	.L224
.L232:
	subl	$97, %r13d
	movslq	%r13d, %r13
	movq	(%r15,%r13,8), %rdx
	testq	%rdx, %rdx
	je	.L237
.L153:
	movzbl	193(%rsp), %eax
	testb	%al, %al
	jne	.L238
	movb	$1, 208(%rdx)
.L170:
	movl	12(%rsp), %ecx
	movq	%rdx, (%r15,%r13,8)
	testl	%ecx, %ecx
	je	.L175
.L172:
	movl	52(%rsp), %eax
	testl	%eax, %eax
	je	.L175
	movq	56(%rsp), %rdx
	movq	80(%rsp), %rdi
	movq	%r9, %rax
	.p2align 4,,10
	.p2align 3
.L176:
	movzbl	(%rdx), %esi
	movzbl	(%rax), %ecx
	addq	$1, %rax
	subq	$1, %rdx
	movb	%sil, -1(%rax)
	movb	%cl, 1(%rdx)
	cmpq	%rax, %rdi
	jne	.L176
	movl	8(%rsp), %edx
	testl	%edx, %edx
	je	.L174
.L233:
	cmpl	$1, 48(%rsp)
	je	.L174
	movq	16(%rsp), %rax
	leaq	-1(%rax,%rbp), %rdx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L179:
	movzbl	(%rdx), %esi
	movzbl	0(%rbp,%rax), %ecx
	subq	$1, %rdx
	movb	%sil, 0(%rbp,%rax)
	addq	$1, %rax
	movb	%cl, 1(%rdx)
	cmpl	%eax, %r12d
	jg	.L179
	addl	$1, %ebx
	cmpl	$4, %ebx
	jne	.L177
.L234:
	addq	$1, %r14
	subl	$1, 48(%rsp)
	movq	%r9, %r12
	jne	.L180
	movq	%r15, %r12
	movq	%r9, %r15
	testq	%r12, %r12
	je	.L119
	movq	%r12, %r14
	xorl	%r12d, %r12d
	cmpb	$0, 208(%r14)
	movq	%r14, %rbx
	leaq	208(%r14), %rbp
	movq	%r14, %r13
	setne	%r12b
	.p2align 4,,10
	.p2align 3
.L181:
	movq	0(%r13), %rdi
	addq	$8, %r13
	call	trie_count
	addl	%eax, %r12d
	cmpq	%r13, %rbp
	jne	.L181
	movl	%r12d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	.p2align 4,,10
	.p2align 3
.L184:
	movq	(%rbx), %rdi
	testq	%rdi, %rdi
	je	.L183
	call	trie_free.part.0
.L183:
	addq	$8, %rbx
	cmpq	%rbx, %rbp
	jne	.L184
	movq	%r14, %rdi
	call	free@PLT
	jmp	.L188
	.p2align 4,,10
	.p2align 3
.L230:
	movl	$216, %esi
	movl	$1, %edi
	movq	%r9, (%rsp)
	call	calloc@PLT
	movq	(%rsp), %r9
	movq	%rax, %r15
	jmp	.L130
	.p2align 4,,10
	.p2align 3
.L238:
	movsbl	%al, %ecx
	subl	$97, %ecx
	movslq	%ecx, %rcx
	movq	(%rdx,%rcx,8), %r10
	testq	%r10, %r10
	je	.L239
.L155:
	movsbl	194(%rsp), %eax
	testb	%al, %al
	jne	.L240
	movb	$1, 208(%r10)
.L169:
	movq	%r10, (%rdx,%rcx,8)
	jmp	.L170
	.p2align 4,,10
	.p2align 3
.L236:
	movsbl	%al, %ecx
	subl	$97, %ecx
	movslq	%ecx, %rcx
	movq	(%rdx,%rcx,8), %r10
	testq	%r10, %r10
	je	.L241
.L136:
	movsbl	274(%rsp), %eax
	testb	%al, %al
	jne	.L242
	movb	$1, 208(%r10)
.L150:
	movq	%r10, (%rdx,%rcx,8)
	jmp	.L151
	.p2align 4,,10
	.p2align 3
.L237:
	movl	$216, %esi
	movl	$1, %edi
	movq	%r9, (%rsp)
	call	calloc@PLT
	movq	(%rsp), %r9
	movq	%rax, %rdx
	jmp	.L153
	.p2align 4,,10
	.p2align 3
.L235:
	movl	$216, %esi
	movl	$1, %edi
	movq	%r9, (%rsp)
	call	calloc@PLT
	movq	(%rsp), %r9
	movq	%rax, %rdx
	jmp	.L134
	.p2align 4,,10
	.p2align 3
.L228:
	movl	(%r9), %eax
	movq	32(%rsp), %rdi
	movl	%eax, (%rdi)
	movl	-4(%r9,%rcx), %eax
	movl	%eax, -4(%rdi,%rcx)
	jmp	.L126
	.p2align 4,,10
	.p2align 3
.L242:
	subl	$97, %eax
	movslq	%eax, %r8
	movq	(%r10,%r8,8), %r11
	testq	%r11, %r11
	je	.L243
.L138:
	movsbl	275(%rsp), %eax
	testb	%al, %al
	jne	.L244
	movb	$1, 208(%r11)
.L149:
	movq	%r11, (%r10,%r8,8)
	jmp	.L150
	.p2align 4,,10
	.p2align 3
.L240:
	subl	$97, %eax
	movslq	%eax, %r8
	movq	(%r10,%r8,8), %r11
	testq	%r11, %r11
	je	.L245
.L157:
	movsbl	195(%rsp), %eax
	testb	%al, %al
	jne	.L246
	movb	$1, 208(%r11)
.L168:
	movq	%r11, (%r10,%r8,8)
	jmp	.L169
.L229:
	movzwl	-2(%r9,%rcx), %eax
	movq	32(%rsp), %rdi
	movw	%ax, -2(%rdi,%rcx)
	jmp	.L126
.L241:
	movl	$216, %esi
	movl	$1, %edi
	movq	%r9, 96(%rsp)
	movq	%rcx, 88(%rsp)
	movq	%rdx, (%rsp)
	call	calloc@PLT
	movq	96(%rsp), %r9
	movq	88(%rsp), %rcx
	movq	(%rsp), %rdx
	movq	%rax, %r10
	jmp	.L136
.L239:
	movl	$216, %esi
	movl	$1, %edi
	movq	%r9, 96(%rsp)
	movq	%rcx, 88(%rsp)
	movq	%rdx, (%rsp)
	call	calloc@PLT
	movq	96(%rsp), %r9
	movq	88(%rsp), %rcx
	movq	(%rsp), %rdx
	movq	%rax, %r10
	jmp	.L155
.L244:
	subl	$97, %eax
	cltq
	movq	%rax, 88(%rsp)
	movq	(%r11,%rax,8), %rax
	movq	%rax, (%rsp)
	testq	%rax, %rax
	je	.L247
.L140:
	movsbl	276(%rsp), %eax
	testb	%al, %al
	jne	.L248
	movq	(%rsp), %rax
	movb	$1, 208(%rax)
	movq	%rax, %rdi
.L148:
	movq	88(%rsp), %rax
	movq	%rdi, (%r11,%rax,8)
	jmp	.L149
.L246:
	subl	$97, %eax
	cltq
	movq	%rax, 88(%rsp)
	movq	(%r11,%rax,8), %rax
	movq	%rax, (%rsp)
	testq	%rax, %rax
	je	.L249
.L159:
	movsbl	196(%rsp), %eax
	testb	%al, %al
	jne	.L250
	movq	(%rsp), %rax
	movb	$1, 208(%rax)
	movq	%rax, %rdi
.L167:
	movq	88(%rsp), %rax
	movq	%rdi, (%r11,%rax,8)
	jmp	.L168
.L119:
	xorl	%edx, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L188
.L243:
	movl	$216, %esi
	movl	$1, %edi
	movq	%r9, 120(%rsp)
	movq	%r8, 112(%rsp)
	movq	%rcx, 96(%rsp)
	movq	%r10, 88(%rsp)
	movq	%rdx, (%rsp)
	call	calloc@PLT
	movq	120(%rsp), %r9
	movq	112(%rsp), %r8
	movq	96(%rsp), %rcx
	movq	88(%rsp), %r10
	movq	%rax, %r11
	movq	(%rsp), %rdx
	jmp	.L138
.L245:
	movl	$216, %esi
	movl	$1, %edi
	movq	%r9, 120(%rsp)
	movq	%r8, 112(%rsp)
	movq	%rcx, 96(%rsp)
	movq	%r10, 88(%rsp)
	movq	%rdx, (%rsp)
	call	calloc@PLT
	movq	120(%rsp), %r9
	movq	112(%rsp), %r8
	movq	96(%rsp), %rcx
	movq	88(%rsp), %r10
	movq	%rax, %r11
	movq	(%rsp), %rdx
	jmp	.L157
.L248:
	movq	(%rsp), %rdi
	subl	$97, %eax
	cltq
	movq	%rax, 128(%rsp)
	movq	(%rdi,%rax,8), %rax
	movq	%rax, 96(%rsp)
	testq	%rax, %rax
	je	.L251
.L142:
	movsbl	277(%rsp), %eax
	testb	%al, %al
	jne	.L252
	movq	96(%rsp), %rax
	movb	$1, 208(%rax)
	movq	%rax, %rsi
.L147:
	movq	(%rsp), %rax
	movq	128(%rsp), %rdi
	movq	%rsi, (%rax,%rdi,8)
	movq	%rax, %rdi
	jmp	.L148
.L250:
	movq	(%rsp), %rdi
	subl	$97, %eax
	cltq
	movq	%rax, 128(%rsp)
	movq	(%rdi,%rax,8), %rax
	movq	%rax, 96(%rsp)
	testq	%rax, %rax
	je	.L253
.L161:
	movsbl	197(%rsp), %eax
	testb	%al, %al
	jne	.L254
	movq	96(%rsp), %rax
	movb	$1, 208(%rax)
	movq	%rax, %rsi
.L166:
	movq	(%rsp), %rax
	movq	128(%rsp), %rdi
	movq	%rsi, (%rax,%rdi,8)
	movq	%rax, %rdi
	jmp	.L167
.L247:
	movl	$216, %esi
	movl	$1, %edi
	movq	%r9, 144(%rsp)
	movq	%r8, 136(%rsp)
	movq	%rcx, 128(%rsp)
	movq	%r11, 120(%rsp)
	movq	%r10, 112(%rsp)
	movq	%rdx, 96(%rsp)
	call	calloc@PLT
	movq	120(%rsp), %r11
	movq	112(%rsp), %r10
	movq	%rax, (%rsp)
	movq	144(%rsp), %r9
	movq	136(%rsp), %r8
	movq	128(%rsp), %rcx
	movq	96(%rsp), %rdx
	jmp	.L140
.L249:
	movl	$216, %esi
	movl	$1, %edi
	movq	%r9, 144(%rsp)
	movq	%r8, 136(%rsp)
	movq	%rcx, 128(%rsp)
	movq	%r11, 120(%rsp)
	movq	%r10, 112(%rsp)
	movq	%rdx, 96(%rsp)
	call	calloc@PLT
	movq	120(%rsp), %r11
	movq	112(%rsp), %r10
	movq	%rax, (%rsp)
	movq	144(%rsp), %r9
	movq	136(%rsp), %r8
	movq	128(%rsp), %rcx
	movq	96(%rsp), %rdx
	jmp	.L159
.L227:
	movq	360(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L255
	addq	$376, %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
.L252:
	.cfi_restore_state
	movq	96(%rsp), %rdi
	subl	$97, %eax
	cltq
	movq	%rax, 136(%rsp)
	movq	(%rdi,%rax,8), %rax
	movq	%rax, 112(%rsp)
	testq	%rax, %rax
	je	.L256
.L144:
	movsbl	278(%rsp), %eax
	testb	%al, %al
	jne	.L257
	movq	112(%rsp), %rax
	movb	$1, 208(%rax)
	movq	%rax, %rsi
.L146:
	movq	96(%rsp), %rax
	movq	136(%rsp), %rdi
	movq	%rsi, (%rax,%rdi,8)
	movq	%rax, %rsi
	jmp	.L147
.L254:
	movq	96(%rsp), %rdi
	subl	$97, %eax
	cltq
	movq	%rax, 136(%rsp)
	movq	(%rdi,%rax,8), %rax
	movq	%rax, 112(%rsp)
	testq	%rax, %rax
	je	.L258
.L163:
	movsbl	198(%rsp), %eax
	testb	%al, %al
	jne	.L259
	movq	112(%rsp), %rax
	movb	$1, 208(%rax)
	movq	%rax, %rsi
.L165:
	movq	96(%rsp), %rax
	movq	136(%rsp), %rdi
	movq	%rsi, (%rax,%rdi,8)
	movq	%rax, %rsi
	jmp	.L166
.L257:
	movq	112(%rsp), %rsi
	subl	$97, %eax
	movq	104(%rsp), %rdi
	movq	%r9, 184(%rsp)
	cltq
	movq	%r8, 176(%rsp)
	movq	(%rsi,%rax,8), %rsi
	movq	%rcx, 168(%rsp)
	movq	%r11, 160(%rsp)
	movq	%r10, 152(%rsp)
	movq	%rdx, 144(%rsp)
	movq	%rax, 120(%rsp)
	call	trie_cons
	movq	112(%rsp), %rsi
	movq	120(%rsp), %rdi
	movq	144(%rsp), %rdx
	movq	152(%rsp), %r10
	movq	%rax, (%rsi,%rdi,8)
	movq	160(%rsp), %r11
	movq	168(%rsp), %rcx
	movq	176(%rsp), %r8
	movq	184(%rsp), %r9
	jmp	.L146
.L259:
	movq	112(%rsp), %rsi
	subl	$97, %eax
	leaq	199(%rsp), %rdi
	movq	%r9, 184(%rsp)
	cltq
	movq	%r8, 176(%rsp)
	movq	(%rsi,%rax,8), %rsi
	movq	%rcx, 168(%rsp)
	movq	%r11, 160(%rsp)
	movq	%r10, 152(%rsp)
	movq	%rdx, 144(%rsp)
	movq	%rax, 120(%rsp)
	call	trie_cons
	movq	112(%rsp), %rsi
	movq	120(%rsp), %rdi
	movq	144(%rsp), %rdx
	movq	152(%rsp), %r10
	movq	%rax, (%rsi,%rdi,8)
	movq	160(%rsp), %r11
	movq	168(%rsp), %rcx
	movq	176(%rsp), %r8
	movq	184(%rsp), %r9
	jmp	.L165
.L253:
	movl	$216, %esi
	movl	$1, %edi
	movq	%r9, 160(%rsp)
	movq	%r8, 152(%rsp)
	movq	%rcx, 144(%rsp)
	movq	%r11, 136(%rsp)
	movq	%r10, 120(%rsp)
	movq	%rdx, 112(%rsp)
	call	calloc@PLT
	movq	160(%rsp), %r9
	movq	152(%rsp), %r8
	movq	120(%rsp), %r10
	movq	112(%rsp), %rdx
	movq	%rax, 96(%rsp)
	movq	144(%rsp), %rcx
	movq	136(%rsp), %r11
	jmp	.L161
.L251:
	movl	$216, %esi
	movl	$1, %edi
	movq	%r9, 160(%rsp)
	movq	%r8, 152(%rsp)
	movq	%rcx, 144(%rsp)
	movq	%r11, 136(%rsp)
	movq	%r10, 120(%rsp)
	movq	%rdx, 112(%rsp)
	call	calloc@PLT
	movq	160(%rsp), %r9
	movq	152(%rsp), %r8
	movq	120(%rsp), %r10
	movq	112(%rsp), %rdx
	movq	%rax, 96(%rsp)
	movq	144(%rsp), %rcx
	movq	136(%rsp), %r11
	jmp	.L142
.L258:
	movl	$216, %esi
	movl	$1, %edi
	movq	%r9, 176(%rsp)
	movq	%r8, 168(%rsp)
	movq	%rcx, 160(%rsp)
	movq	%r11, 152(%rsp)
	movq	%r10, 144(%rsp)
	movq	%rdx, 120(%rsp)
	call	calloc@PLT
	movq	176(%rsp), %r9
	movq	168(%rsp), %r8
	movq	%rax, 112(%rsp)
	movq	160(%rsp), %rcx
	movq	152(%rsp), %r11
	movq	144(%rsp), %r10
	movq	120(%rsp), %rdx
	jmp	.L163
.L256:
	movl	$216, %esi
	movl	$1, %edi
	movq	%r9, 176(%rsp)
	movq	%r8, 168(%rsp)
	movq	%rcx, 160(%rsp)
	movq	%r11, 152(%rsp)
	movq	%r10, 144(%rsp)
	movq	%rdx, 120(%rsp)
	call	calloc@PLT
	movq	176(%rsp), %r9
	movq	168(%rsp), %r8
	movq	%rax, 112(%rsp)
	movq	160(%rsp), %rcx
	movq	152(%rsp), %r11
	movq	144(%rsp), %r10
	movq	120(%rsp), %rdx
	jmp	.L144
.L255:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE55:
	.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:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX_LENGTH 72

/* Naive 0/1 Trie */

typedef struct trie *trie;
struct trie { trie children[26]; char flag; };

trie trie_cons(char* str, trie t)
{
    if(!t)
        t = (trie)calloc(1, sizeof(struct trie));

    if(*str)
        t->children[*str - 'a'] = trie_cons(str + 1, t->children[*str - 'a']);
    else
        t->flag = 1;

    return t;
}

int trie_count(trie t)
{
    if(!t)
        return 0;
    else
    {
        int res = (t->flag != 0), i;
        for(i = 0; i < 26; i++)
            res += trie_count(t->children[i]);
        return res;
    }
}

void trie_free(trie t)
{
    int i;

    if(t)
    {
        for(i = 0; i < 26; i++)
            trie_free(t->children[i]);
        free(t);
    }
}

/* --- */

void reverse(char* buf, int size)
{
    int i;
    char t;

    for(i = 0; i < size / 2; i++)
    {
        t = buf[i];
        buf[i] = buf[size - i - 1];
        buf[size - i - 1] = t;
    }
}

int main(void)
{
    trie t;
    int split_pos, len, i;
    char buf[MAX_LENGTH + 1], swapped[MAX_LENGTH + 1];

    scanf("%*d%*c");

    while(~scanf("%s%*c", buf))
    {
        t = NULL, len = strlen(buf);

        for(split_pos = 1; split_pos < len; split_pos++)
            for(i = 0; i < 4; i++)
            {
                /* reverse */
                if(i & 2) reverse(buf, split_pos);
                if(i & 1) reverse(buf + split_pos, len - split_pos);

                /* swap */
                memcpy(swapped, buf + split_pos, len - split_pos);
                memcpy(swapped + (len - split_pos), buf, split_pos);
                swapped[len] = '\0';

                /* push to the trie */
                t = trie_cons(buf, trie_cons(swapped, t));

                /* undo reverse */
                if(i & 2) reverse(buf, split_pos);
                if(i & 1) reverse(buf + split_pos, len - split_pos);
            }

        printf("%d\n", trie_count(t));
        trie_free(t);
    }

    return 0;
}
4
aa
abba
bbcd
abcde
 4
ab
abba
bbcd
edcba

1
6
8
18
 2
6
8
18

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

```c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX_LENGTH 72

/* Naive 0/1 Trie */

typedef struct trie *trie;
struct trie { trie children[26]; char flag; };

trie trie_cons(char* str, trie t)
{
    if(!t)
        t = (trie)calloc(1, sizeof(struct trie));

    if(*str)
        t->children[*str - 'a'] = trie_cons(str + 1, t->children[*str - 'a']);
    else
        t->flag = 1;

    return t;
}

int trie_count(trie t)
{
    if(!t)
        return 0;
    else
    {
        int res = (t->flag != 0), i;
        for(i = 0; i < 26; i++)
            res += trie_count(t->children[i]);
        return res;
    }
}

void trie_free(trie t)
{
    int i;

    if(t)
    {
        for(i = 0; i < 26; i++)
            trie_free(t->children[i]);
        free(t);
    }
}

/* --- */

void reverse(char* buf, int size)
{
    int i;
    char t;

    for(i = 0; i < size / 2; i++)
    {
        t = buf[i];
        buf[i] = buf[size - i - 1];
        buf[size - i - 1] = t;
    }
}

int main(void)
{
    trie t;
    int split_pos, len, i;
    char buf[MAX_LENGTH + 1], swapped[MAX_LENGTH + 1];

    scanf("%*d%*c");

    while(~scanf("%s%*c", buf))
    {
        t = NULL, len = strlen(buf);

        for(split_pos = 1; split_pos < len; split_pos++)
            for(i = 0; i < 4; i++)
            {
                /* reverse */
                if(i & 2) reverse(buf, split_pos);
                if(i & 1) reverse(buf + split_pos, len - split_pos);

                /* swap */
                memcpy(swapped, buf + split_pos, len - split_pos);
                memcpy(swapped + (len - split_pos), buf, split_pos);
                swapped[len] = '\0';

                /* push to the trie */
                t = trie_cons(buf, trie_cons(swapped, t));

                /* undo reverse */
                if(i & 2) reverse(buf, split_pos);
                if(i & 1) reverse(buf + split_pos, len - split_pos);
            }

        printf("%d\n", trie_count(t));
        trie_free(t);
    }

    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	trie_cons
	.type	trie_cons, @function
trie_cons:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 3, -24
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	cmpq	$0, -32(%rbp)
	jne	.L2
	movl	$216, %esi
	movl	$1, %edi
	call	calloc@PLT
	movq	%rax, -32(%rbp)
.L2:
	movq	-24(%rbp), %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	je	.L3
	movq	-24(%rbp), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	leal	-97(%rax), %edx
	movq	-32(%rbp), %rax
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	-24(%rbp), %rdx
	addq	$1, %rdx
	movq	-24(%rbp), %rcx
	movzbl	(%rcx), %ecx
	movsbl	%cl, %ecx
	leal	-97(%rcx), %ebx
	movq	%rax, %rsi
	movq	%rdx, %rdi
	call	trie_cons
	movq	-32(%rbp), %rdx
	movslq	%ebx, %rcx
	movq	%rax, (%rdx,%rcx,8)
	jmp	.L4
.L3:
	movq	-32(%rbp), %rax
	movb	$1, 208(%rax)
.L4:
	movq	-32(%rbp), %rax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	trie_cons, .-trie_cons
	.globl	trie_count
	.type	trie_count, @function
trie_count:
.LFB7:
	.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)
	cmpq	$0, -24(%rbp)
	jne	.L7
	movl	$0, %eax
	jmp	.L8
.L7:
	movq	-24(%rbp), %rax
	movzbl	208(%rax), %eax
	testb	%al, %al
	setne	%al
	movzbl	%al, %eax
	movl	%eax, -8(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L9
.L10:
	movq	-24(%rbp), %rax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, %rdi
	call	trie_count
	addl	%eax, -8(%rbp)
	addl	$1, -4(%rbp)
.L9:
	cmpl	$25, -4(%rbp)
	jle	.L10
	movl	-8(%rbp), %eax
.L8:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	trie_count, .-trie_count
	.globl	trie_free
	.type	trie_free, @function
trie_free:
.LFB8:
	.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)
	cmpq	$0, -24(%rbp)
	je	.L15
	movl	$0, -4(%rbp)
	jmp	.L13
.L14:
	movq	-24(%rbp), %rax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, %rdi
	call	trie_free
	addl	$1, -4(%rbp)
.L13:
	cmpl	$25, -4(%rbp)
	jle	.L14
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
.L15:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	trie_free, .-trie_free
	.globl	reverse
	.type	reverse, @function
reverse:
.LFB9:
	.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)
	movl	%esi, -28(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L17
.L18:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movb	%al, -5(%rbp)
	movl	-28(%rbp), %eax
	subl	-4(%rbp), %eax
	cltq
	leaq	-1(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	-4(%rbp), %edx
	movslq	%edx, %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	movzbl	(%rax), %eax
	movb	%al, (%rdx)
	movl	-28(%rbp), %eax
	subl	-4(%rbp), %eax
	cltq
	leaq	-1(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rax, %rdx
	movzbl	-5(%rbp), %eax
	movb	%al, (%rdx)
	addl	$1, -4(%rbp)
.L17:
	movl	-28(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cmpl	%eax, -4(%rbp)
	jl	.L18
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	reverse, .-reverse
	.section	.rodata
.LC0:
	.string	"%*d%*c"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%s%*c"
	.text
	.globl	main
	.type	main, @function
main:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$208, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L20
.L29:
	movq	$0, -184(%rbp)
	leaq	-176(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -188(%rbp)
	movl	$1, -196(%rbp)
	jmp	.L21
.L28:
	movl	$0, -192(%rbp)
	jmp	.L22
.L27:
	movl	-192(%rbp), %eax
	andl	$2, %eax
	testl	%eax, %eax
	je	.L23
	movl	-196(%rbp), %edx
	leaq	-176(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	reverse
.L23:
	movl	-192(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L24
	movl	-188(%rbp), %eax
	subl	-196(%rbp), %eax
	movl	-196(%rbp), %edx
	movslq	%edx, %rdx
	leaq	-176(%rbp), %rcx
	addq	%rcx, %rdx
	movl	%eax, %esi
	movq	%rdx, %rdi
	call	reverse
.L24:
	movl	-188(%rbp), %eax
	subl	-196(%rbp), %eax
	movslq	%eax, %rdx
	movl	-196(%rbp), %eax
	cltq
	leaq	-176(%rbp), %rcx
	addq	%rax, %rcx
	leaq	-96(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	memcpy@PLT
	movl	-196(%rbp), %eax
	movslq	%eax, %rdx
	movl	-188(%rbp), %eax
	subl	-196(%rbp), %eax
	cltq
	leaq	-96(%rbp), %rcx
	addq	%rax, %rcx
	leaq	-176(%rbp), %rax
	movq	%rax, %rsi
	movq	%rcx, %rdi
	call	memcpy@PLT
	movl	-188(%rbp), %eax
	cltq
	movb	$0, -96(%rbp,%rax)
	movq	-184(%rbp), %rdx
	leaq	-96(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	trie_cons
	movq	%rax, %rdx
	leaq	-176(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	trie_cons
	movq	%rax, -184(%rbp)
	movl	-192(%rbp), %eax
	andl	$2, %eax
	testl	%eax, %eax
	je	.L25
	movl	-196(%rbp), %edx
	leaq	-176(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	reverse
.L25:
	movl	-192(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L26
	movl	-188(%rbp), %eax
	subl	-196(%rbp), %eax
	movl	-196(%rbp), %edx
	movslq	%edx, %rdx
	leaq	-176(%rbp), %rcx
	addq	%rcx, %rdx
	movl	%eax, %esi
	movq	%rdx, %rdi
	call	reverse
.L26:
	addl	$1, -192(%rbp)
.L22:
	cmpl	$3, -192(%rbp)
	jle	.L27
	addl	$1, -196(%rbp)
.L21:
	movl	-196(%rbp), %eax
	cmpl	-188(%rbp), %eax
	jl	.L28
	movq	-184(%rbp), %rax
	movq	%rax, %rdi
	call	trie_count
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	-184(%rbp), %rax
	movq	%rax, %rdi
	call	trie_free
.L20:
	leaq	-176(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	jne	.L29
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L31
	call	__stack_chk_fail@PLT
.L31:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.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	trie_cons
	.type	trie_cons, @function
trie_cons:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 3, -24
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	cmpq	$0, -32(%rbp)
	jne	.L2
	movl	$216, %esi
	movl	$1, %edi
	call	calloc@PLT
	movq	%rax, -32(%rbp)
.L2:
	movq	-24(%rbp), %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	je	.L3
	movq	-24(%rbp), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	leal	-97(%rax), %edx
	movq	-32(%rbp), %rax
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	-24(%rbp), %rdx
	addq	$1, %rdx
	movq	-24(%rbp), %rcx
	movzbl	(%rcx), %ecx
	movsbl	%cl, %ecx
	leal	-97(%rcx), %ebx
	movq	%rax, %rsi
	movq	%rdx, %rdi
	call	trie_cons
	movq	-32(%rbp), %rdx
	movslq	%ebx, %rcx
	movq	%rax, (%rdx,%rcx,8)
	jmp	.L4
.L3:
	movq	-32(%rbp), %rax
	movb	$1, 208(%rax)
.L4:
	movq	-32(%rbp), %rax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	trie_cons, .-trie_cons
	.globl	trie_count
	.type	trie_count, @function
trie_count:
.LFB7:
	.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)
	cmpq	$0, -24(%rbp)
	jne	.L7
	movl	$0, %eax
	jmp	.L8
.L7:
	movq	-24(%rbp), %rax
	movzbl	208(%rax), %eax
	testb	%al, %al
	setne	%al
	movzbl	%al, %eax
	movl	%eax, -8(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L9
.L10:
	movq	-24(%rbp), %rax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, %rdi
	call	trie_count
	addl	%eax, -8(%rbp)
	addl	$1, -4(%rbp)
.L9:
	cmpl	$25, -4(%rbp)
	jle	.L10
	movl	-8(%rbp), %eax
.L8:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	trie_count, .-trie_count
	.globl	trie_free
	.type	trie_free, @function
trie_free:
.LFB8:
	.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)
	cmpq	$0, -24(%rbp)
	je	.L15
	movl	$0, -4(%rbp)
	jmp	.L13
.L14:
	movq	-24(%rbp), %rax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, %rdi
	call	trie_free
	addl	$1, -4(%rbp)
.L13:
	cmpl	$25, -4(%rbp)
	jle	.L14
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
.L15:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	trie_free, .-trie_free
	.globl	reverse
	.type	reverse, @function
reverse:
.LFB9:
	.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)
	movl	%esi, -28(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L17
.L18:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movb	%al, -5(%rbp)
	movl	-28(%rbp), %eax
	subl	-4(%rbp), %eax
	cltq
	leaq	-1(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	-4(%rbp), %edx
	movslq	%edx, %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	movzbl	(%rax), %eax
	movb	%al, (%rdx)
	movl	-28(%rbp), %eax
	subl	-4(%rbp), %eax
	cltq
	leaq	-1(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rax, %rdx
	movzbl	-5(%rbp), %eax
	movb	%al, (%rdx)
	addl	$1, -4(%rbp)
.L17:
	movl	-28(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cmpl	%eax, -4(%rbp)
	jl	.L18
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	reverse, .-reverse
	.section	.rodata
.LC0:
	.string	"%*d%*c"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%s%*c"
	.text
	.globl	main
	.type	main, @function
main:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$208, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L20
.L29:
	movq	$0, -184(%rbp)
	leaq	-176(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -188(%rbp)
	movl	$1, -196(%rbp)
	jmp	.L21
.L28:
	movl	$0, -192(%rbp)
	jmp	.L22
.L27:
	movl	-192(%rbp), %eax
	andl	$2, %eax
	testl	%eax, %eax
	je	.L23
	movl	-196(%rbp), %edx
	leaq	-176(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	reverse
.L23:
	movl	-192(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L24
	movl	-188(%rbp), %eax
	subl	-196(%rbp), %eax
	movl	-196(%rbp), %edx
	movslq	%edx, %rdx
	leaq	-176(%rbp), %rcx
	addq	%rcx, %rdx
	movl	%eax, %esi
	movq	%rdx, %rdi
	call	reverse
.L24:
	movl	-188(%rbp), %eax
	subl	-196(%rbp), %eax
	movslq	%eax, %rdx
	movl	-196(%rbp), %eax
	cltq
	leaq	-176(%rbp), %rcx
	addq	%rax, %rcx
	leaq	-96(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	memcpy@PLT
	movl	-196(%rbp), %eax
	movslq	%eax, %rdx
	movl	-188(%rbp), %eax
	subl	-196(%rbp), %eax
	cltq
	leaq	-96(%rbp), %rcx
	addq	%rax, %rcx
	leaq	-176(%rbp), %rax
	movq	%rax, %rsi
	movq	%rcx, %rdi
	call	memcpy@PLT
	movl	-188(%rbp), %eax
	cltq
	movb	$0, -96(%rbp,%rax)
	movq	-184(%rbp), %rdx
	leaq	-96(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	trie_cons
	movq	%rax, %rdx
	leaq	-176(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	trie_cons
	movq	%rax, -184(%rbp)
	movl	-192(%rbp), %eax
	andl	$2, %eax
	testl	%eax, %eax
	je	.L25
	movl	-196(%rbp), %edx
	leaq	-176(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	reverse
.L25:
	movl	-192(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L26
	movl	-188(%rbp), %eax
	subl	-196(%rbp), %eax
	movl	-196(%rbp), %edx
	movslq	%edx, %rdx
	leaq	-176(%rbp), %rcx
	addq	%rcx, %rdx
	movl	%eax, %esi
	movq	%rdx, %rdi
	call	reverse
.L26:
	addl	$1, -192(%rbp)
.L22:
	cmpl	$3, -192(%rbp)
	jle	.L27
	addl	$1, -196(%rbp)
.L21:
	movl	-196(%rbp), %eax
	cmpl	-188(%rbp), %eax
	jl	.L28
	movq	-184(%rbp), %rax
	movq	%rax, %rdi
	call	trie_count
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	-184(%rbp), %rax
	movq	%rax, %rdi
	call	trie_free
.L20:
	leaq	-176(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	jne	.L29
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L31
	call	__stack_chk_fail@PLT
.L31:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.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:
