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 <string.h>

/* 文字列を逆順にコピーする (末尾に空文字を付加しない) */
char* strncpyr(char *s1, const char *s2, int n, int reversal) {
	int l2, i;
	l2 = strlen(s2);
	if (reversal == 0) {
		/* strncpy(s1, s2, n); */
		if (l2 > n) l2 = n;
		for (i = 0; i < l2; i++) s1[i] = s2[i];
		/* for (i = l2; i < n; i++) s1[i] = '\0'; */
	} else {
		if (l2 > n) l2 = n;
		for (i = 0; i < l2; i++) s1[i] = s2[l2 - 1 - i];
		/* for (i = l2; i < n; i++) s1[i] = '\0'; */
	}
	return s1;
}

/* 列車を再編成する */
void rearrange(char *s1, const char *s2, int n, int division, int order, int reversal_l, int reversal_r) {
	if (order == 0) {
		/* 順 */
		strncpyr(s1, s2, division, reversal_l); /* 左側 */
		strncpyr(s1 + division, s2 + division, n - division, reversal_r); /* 右側 */
	} else {
		/* 逆順 */
		strncpyr(s1 + n - division, s2, division, reversal_l); /* 左側 */
		strncpyr(s1, s2 + division, n - division, reversal_r); /* 右側 */
	}
	s1[n] = '\0';
}

int main(void) {
	int m; /* データセット数 */
	int l; /* 列車の長さ */
	char t[73]; /* 入場する列車の編成 */
	char u[40896][73]; /* 構成可能な最終編成 */
	int n; /* 構成可能な最終編成の数 */
	int i, j, k, h, g;

	if (scanf("%d", &m) != 1) return 1;

	/* データセット毎の処理 */
	for (i = 0; i < m; i++) {
		/* 初期化する */
		n = 0;
		/* 入場してくる列車の編成を入力する */
		scanf("%72s", t);
		l = strlen(t);

		/* 連結方法を全通り調べ重複を除いた総数を数える */
		for (j = 1; j < l; j++) { /* 分割位置 */
			for (k = 0; k < 2; k++) { /* 連結順 */
				for (h = 0; h < 2 * 2; h++) { /* 左側・右側の前後反転の有無 */
					/* 再編成する */
					rearrange(u[n], t, l, j, k, h / 2, h % 2);
					n++;

					/* これまでに作った編成と重複していないか調べる */
					for (g = 0; g < n - 1; g++) {
						if (strcmp(u[n - 1], u[g]) == 0) {
							n--;
							break;
						}
					}
				}
			}
		}

		/* 再編成の総数を出力する */
		printf("%d\n", n);
	}

    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	strncpyr
	.type	strncpyr, @function
strncpyr:
.LFB0:
	.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	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movl	%edx, -36(%rbp)
	movl	%ecx, -40(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -8(%rbp)
	cmpl	$0, -40(%rbp)
	jne	.L2
	movl	-8(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jle	.L3
	movl	-36(%rbp), %eax
	movl	%eax, -8(%rbp)
.L3:
	movl	$0, -4(%rbp)
	jmp	.L4
.L5:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-32(%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)
	addl	$1, -4(%rbp)
.L4:
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jl	.L5
	jmp	.L6
.L2:
	movl	-8(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jle	.L7
	movl	-36(%rbp), %eax
	movl	%eax, -8(%rbp)
.L7:
	movl	$0, -4(%rbp)
	jmp	.L8
.L9:
	movl	-8(%rbp), %eax
	subl	$1, %eax
	subl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-32(%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)
	addl	$1, -4(%rbp)
.L8:
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jl	.L9
.L6:
	movq	-24(%rbp), %rax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	strncpyr, .-strncpyr
	.globl	rearrange
	.type	rearrange, @function
rearrange:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movl	%edx, -20(%rbp)
	movl	%ecx, -24(%rbp)
	movl	%r8d, -28(%rbp)
	movl	%r9d, -32(%rbp)
	cmpl	$0, -28(%rbp)
	jne	.L12
	movl	-32(%rbp), %ecx
	movl	-24(%rbp), %edx
	movq	-16(%rbp), %rsi
	movq	-8(%rbp), %rax
	movq	%rax, %rdi
	call	strncpyr
	movl	-20(%rbp), %eax
	subl	-24(%rbp), %eax
	movl	-24(%rbp), %edx
	movslq	%edx, %rcx
	movq	-16(%rbp), %rdx
	leaq	(%rcx,%rdx), %rsi
	movl	-24(%rbp), %edx
	movslq	%edx, %rcx
	movq	-8(%rbp), %rdx
	leaq	(%rcx,%rdx), %rdi
	movl	16(%rbp), %ecx
	movl	%eax, %edx
	call	strncpyr
	jmp	.L13
.L12:
	movl	-20(%rbp), %eax
	cltq
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	subq	%rdx, %rax
	movq	%rax, %rcx
	movq	-8(%rbp), %rax
	leaq	(%rcx,%rax), %rdi
	movl	-32(%rbp), %ecx
	movl	-24(%rbp), %edx
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	call	strncpyr
	movl	-20(%rbp), %eax
	subl	-24(%rbp), %eax
	movl	%eax, %edx
	movl	-24(%rbp), %eax
	movslq	%eax, %rcx
	movq	-16(%rbp), %rax
	leaq	(%rcx,%rax), %rsi
	movq	-8(%rbp), %rax
	movl	16(%rbp), %ecx
	movq	%rax, %rdi
	call	strncpyr
.L13:
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	movb	$0, (%rax)
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	rearrange, .-rearrange
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%72s"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-2981888(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3648, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-2985536(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L15
	movl	$1, %eax
	jmp	.L29
.L15:
	movl	$0, -2985528(%rbp)
	jmp	.L17
.L28:
	movl	$0, -2985532(%rbp)
	leaq	-96(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-96(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -2985508(%rbp)
	movl	$1, -2985524(%rbp)
	jmp	.L18
.L27:
	movl	$0, -2985520(%rbp)
	jmp	.L19
.L26:
	movl	$0, -2985516(%rbp)
	jmp	.L20
.L25:
	movl	-2985516(%rbp), %eax
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	movl	%eax, %r8d
	movl	-2985516(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %r9d
	leaq	-2985504(%rbp), %rcx
	movl	-2985532(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	leaq	(%rcx,%rax), %rdi
	movl	-2985520(%rbp), %esi
	movl	-2985524(%rbp), %ecx
	movl	-2985508(%rbp), %edx
	leaq	-96(%rbp), %rax
	subq	$8, %rsp
	pushq	%r8
	movl	%esi, %r8d
	movq	%rax, %rsi
	call	rearrange
	addq	$16, %rsp
	addl	$1, -2985532(%rbp)
	movl	$0, -2985512(%rbp)
	jmp	.L21
.L24:
	leaq	-2985504(%rbp), %rcx
	movl	-2985512(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rax, %rcx
	movl	-2985532(%rbp), %eax
	subl	$1, %eax
	leaq	-2985504(%rbp), %rsi
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L22
	subl	$1, -2985532(%rbp)
	jmp	.L23
.L22:
	addl	$1, -2985512(%rbp)
.L21:
	movl	-2985532(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -2985512(%rbp)
	jl	.L24
.L23:
	addl	$1, -2985516(%rbp)
.L20:
	cmpl	$3, -2985516(%rbp)
	jle	.L25
	addl	$1, -2985520(%rbp)
.L19:
	cmpl	$1, -2985520(%rbp)
	jle	.L26
	addl	$1, -2985524(%rbp)
.L18:
	movl	-2985524(%rbp), %eax
	cmpl	-2985508(%rbp), %eax
	jl	.L27
	movl	-2985532(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -2985528(%rbp)
.L17:
	movl	-2985536(%rbp), %eax
	cmpl	%eax, -2985528(%rbp)
	jl	.L28
	movl	$0, %eax
.L29:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L30
	call	__stack_chk_fail@PLT
.L30:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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	strncpyr
	.type	strncpyr, @function
strncpyr:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movl	%edx, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%rdi, %r12
	movq	%rsi, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movq	%rsi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movl	%ecx, %ebx
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	call	strlen@PLT
	cmpl	%eax, %r13d
	cmovle	%r13d, %eax
	testl	%ebx, %ebx
	jne	.L2
	testl	%eax, %eax
	jle	.L18
	leaq	1(%rbp), %rdi
	movq	%r12, %rsi
	leal	-1(%rax), %edx
	movl	%eax, %ecx
	subq	%rdi, %rsi
	cmpq	$14, %rsi
	jbe	.L4
	cmpl	$6, %edx
	jbe	.L4
	cmpl	$14, %edx
	jbe	.L15
	shrl	$4, %ecx
	xorl	%edx, %edx
	salq	$4, %rcx
	.p2align 4,,10
	.p2align 3
.L6:
	movdqu	0(%rbp,%rdx), %xmm0
	movups	%xmm0, (%r12,%rdx)
	addq	$16, %rdx
	cmpq	%rcx, %rdx
	jne	.L6
	movl	%eax, %edx
	andl	$-16, %edx
	movl	%edx, %ebx
	cmpl	%edx, %eax
	je	.L18
	movl	%eax, %ecx
	subl	%edx, %ecx
	leal	-1(%rcx), %esi
	cmpl	$6, %esi
	jbe	.L10
.L5:
	movq	0(%rbp,%rdx), %rsi
	movq	%rsi, (%r12,%rdx)
	movl	%ecx, %edx
	andl	$-8, %edx
	addl	%edx, %ebx
	cmpl	%edx, %ecx
	je	.L18
.L10:
	movslq	%ebx, %rdx
	movzbl	0(%rbp,%rdx), %ecx
	movb	%cl, (%r12,%rdx)
	leal	1(%rbx), %edx
	cmpl	%edx, %eax
	jle	.L18
	movslq	%edx, %rdx
	movzbl	0(%rbp,%rdx), %ecx
	movb	%cl, (%r12,%rdx)
	leal	2(%rbx), %edx
	cmpl	%eax, %edx
	jge	.L18
	movslq	%edx, %rdx
	movzbl	0(%rbp,%rdx), %ecx
	movb	%cl, (%r12,%rdx)
	leal	3(%rbx), %edx
	cmpl	%edx, %eax
	jle	.L18
	movslq	%edx, %rdx
	movzbl	0(%rbp,%rdx), %ecx
	movb	%cl, (%r12,%rdx)
	leal	4(%rbx), %edx
	cmpl	%edx, %eax
	jle	.L18
	movslq	%edx, %rdx
	movzbl	0(%rbp,%rdx), %ecx
	movb	%cl, (%r12,%rdx)
	leal	5(%rbx), %edx
	cmpl	%edx, %eax
	jle	.L18
	movslq	%edx, %rdx
	addl	$6, %ebx
	movzbl	0(%rbp,%rdx), %ecx
	movb	%cl, (%r12,%rdx)
	cmpl	%ebx, %eax
	jle	.L18
	movslq	%ebx, %rbx
	movzbl	0(%rbp,%rbx), %eax
	movb	%al, (%r12,%rbx)
.L18:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	movq	%r12, %rax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	testl	%eax, %eax
	jle	.L18
	leal	-1(%rax), %edi
	cltq
	movq	%r12, %rdx
	movslq	%edi, %rcx
	leaq	-2(%rbp,%rax), %rsi
	movl	%edi, %edi
	addq	%rbp, %rcx
	subq	%rdi, %rsi
	.p2align 4,,10
	.p2align 3
.L14:
	movzbl	(%rcx), %eax
	subq	$1, %rcx
	addq	$1, %rdx
	movb	%al, -1(%rdx)
	cmpq	%rsi, %rcx
	jne	.L14
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	movq	%r12, %rax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	movl	%eax, %eax
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L12:
	movzbl	0(%rbp,%rdx), %ecx
	movb	%cl, (%r12,%rdx)
	addq	$1, %rdx
	cmpq	%rax, %rdx
	jne	.L12
	jmp	.L18
.L15:
	xorl	%edx, %edx
	jmp	.L5
	.cfi_endproc
.LFE35:
	.size	strncpyr, .-strncpyr
	.p2align 4
	.globl	rearrange
	.type	rearrange, @function
rearrange:
.LFB36:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%edx, %rax
	movq	%rdi, %r15
	movq	%rsi, %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movslq	%ecx, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%r13, %r14
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%rsi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rax, %rbx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movl	%r8d, 24(%rsp)
	movl	96(%rsp), %r12d
	movl	%r9d, 16(%rsp)
	movq	%rax, 8(%rsp)
	call	strlen@PLT
	movl	24(%rsp), %r8d
	movl	16(%rsp), %r9d
	cmpl	%eax, %r13d
	cmovle	%r13d, %eax
	testl	%r8d, %r8d
	jne	.L29
	testl	%r9d, %r9d
	jne	.L30
	testl	%eax, %eax
	jle	.L38
	leaq	1(%rbp), %r8
	movq	%r15, %rdi
	leal	-1(%rax), %edx
	movl	%eax, %esi
	subq	%r8, %rdi
	cmpq	$14, %rdi
	jbe	.L34
	cmpl	$6, %edx
	jbe	.L34
	cmpl	$14, %edx
	jbe	.L82
	shrl	$4, %esi
	xorl	%edx, %edx
	salq	$4, %rsi
	.p2align 4,,10
	.p2align 3
.L36:
	movdqu	0(%rbp,%rdx), %xmm0
	movups	%xmm0, (%r15,%rdx)
	addq	$16, %rdx
	cmpq	%rsi, %rdx
	jne	.L36
	movl	%eax, %edx
	andl	$-16, %edx
	movl	%edx, %r9d
	cmpl	%edx, %eax
	je	.L38
	movl	%eax, %esi
	subl	%edx, %esi
	leal	-1(%rsi), %edi
	cmpl	$6, %edi
	jbe	.L40
.L35:
	movq	0(%rbp,%rdx), %rdi
	movq	%rdi, (%r15,%rdx)
	movl	%esi, %edx
	andl	$-8, %edx
	addl	%edx, %r9d
	cmpl	%edx, %esi
	je	.L38
.L40:
	movslq	%r9d, %rdx
	movzbl	0(%rbp,%rdx), %esi
	movb	%sil, (%r15,%rdx)
	leal	1(%r9), %edx
	cmpl	%eax, %edx
	jge	.L38
	movslq	%edx, %rdx
	movzbl	0(%rbp,%rdx), %esi
	movb	%sil, (%r15,%rdx)
	leal	2(%r9), %edx
	cmpl	%eax, %edx
	jge	.L38
	movslq	%edx, %rdx
	movzbl	0(%rbp,%rdx), %esi
	movb	%sil, (%r15,%rdx)
	leal	3(%r9), %edx
	cmpl	%eax, %edx
	jge	.L38
	movslq	%edx, %rdx
	movzbl	0(%rbp,%rdx), %esi
	movb	%sil, (%r15,%rdx)
	leal	4(%r9), %edx
	cmpl	%edx, %eax
	jle	.L38
	movslq	%edx, %rdx
	movzbl	0(%rbp,%rdx), %esi
	movb	%sil, (%r15,%rdx)
	leal	5(%r9), %edx
	cmpl	%edx, %eax
	jle	.L38
	movslq	%edx, %rdx
	addl	$6, %r9d
	movzbl	0(%rbp,%rdx), %esi
	movb	%sil, (%r15,%rdx)
	cmpl	%r9d, %eax
	jle	.L38
	movslq	%r9d, %r9
	movzbl	0(%rbp,%r9), %eax
	movb	%al, (%r15,%r9)
	.p2align 4,,10
	.p2align 3
.L38:
	leaq	0(%rbp,%r13), %rsi
	leaq	(%r15,%r13), %rdx
	subl	%r14d, %ebx
	movq	%rsi, %rdi
	movq	%rdx, 24(%rsp)
	movq	%rsi, 16(%rsp)
	call	strlen@PLT
	movq	16(%rsp), %rsi
	movq	24(%rsp), %rdx
	cmpl	%eax, %ebx
	cmovg	%eax, %ebx
	testl	%r12d, %r12d
	jne	.L126
	testl	%ebx, %ebx
	jle	.L50
	leaq	1(%rbp,%r13), %r8
	movq	%rdx, %rdi
	leal	-1(%rbx), %eax
	movl	%ebx, %ecx
	subq	%r8, %rdi
	cmpq	$14, %rdi
	jbe	.L46
	cmpl	$6, %eax
	jbe	.L46
	cmpl	$14, %eax
	jbe	.L83
	shrl	$4, %ecx
	xorl	%eax, %eax
	salq	$4, %rcx
	.p2align 4,,10
	.p2align 3
.L48:
	movdqu	(%rsi,%rax), %xmm1
	movups	%xmm1, (%rdx,%rax)
	addq	$16, %rax
	cmpq	%rax, %rcx
	jne	.L48
	movl	%ebx, %eax
	andl	$-16, %eax
	movl	%eax, %r12d
	cmpl	%eax, %ebx
	je	.L50
	movl	%ebx, %ecx
	subl	%eax, %ecx
	leal	-1(%rcx), %edi
	cmpl	$6, %edi
	jbe	.L52
.L47:
	addq	%r13, %rax
	movq	0(%rbp,%rax), %rdi
	movq	%rdi, (%r15,%rax)
	movl	%ecx, %eax
	andl	$-8, %eax
	addl	%eax, %r12d
	cmpl	%ecx, %eax
	je	.L50
.L52:
	movslq	%r12d, %rax
	movzbl	(%rsi,%rax), %ecx
	movb	%cl, (%rdx,%rax)
	leal	1(%r12), %eax
	cmpl	%ebx, %eax
	jge	.L50
	cltq
	movzbl	(%rsi,%rax), %ecx
	movb	%cl, (%rdx,%rax)
	leal	2(%r12), %eax
	cmpl	%ebx, %eax
	jge	.L50
	cltq
	movzbl	(%rsi,%rax), %ecx
	movb	%cl, (%rdx,%rax)
	leal	3(%r12), %eax
	cmpl	%eax, %ebx
	jle	.L50
	cltq
	movzbl	(%rsi,%rax), %ecx
	movb	%cl, (%rdx,%rax)
	leal	4(%r12), %eax
	cmpl	%eax, %ebx
	jle	.L50
	cltq
	movzbl	(%rsi,%rax), %ecx
	movb	%cl, (%rdx,%rax)
	leal	5(%r12), %eax
	cmpl	%eax, %ebx
	jle	.L50
	cltq
	addl	$6, %r12d
	movzbl	(%rsi,%rax), %ecx
	movb	%cl, (%rdx,%rax)
	cmpl	%ebx, %r12d
	jge	.L50
	movslq	%r12d, %r12
	movzbl	(%rsi,%r12), %eax
	movb	%al, (%rdx,%r12)
.L50:
	movq	8(%rsp), %rax
	movb	$0, (%r15,%rax)
	addq	$40, %rsp
	.cfi_remember_state
	.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
	ret
	.p2align 4,,10
	.p2align 3
.L29:
	.cfi_restore_state
	movslq	%ebx, %rsi
	subq	%r13, %rsi
	addq	%r15, %rsi
	testl	%r9d, %r9d
	jne	.L57
	testl	%eax, %eax
	jle	.L65
	leaq	1(%rbp), %r10
	movq	%rsi, %r8
	leal	-1(%rax), %edx
	movl	%eax, %edi
	subq	%r10, %r8
	cmpq	$14, %r8
	jbe	.L61
	cmpl	$6, %edx
	jbe	.L61
	cmpl	$14, %edx
	jbe	.L84
	shrl	$4, %edi
	xorl	%edx, %edx
	salq	$4, %rdi
	.p2align 4,,10
	.p2align 3
.L63:
	movdqu	0(%rbp,%rdx), %xmm2
	movups	%xmm2, (%rsi,%rdx)
	addq	$16, %rdx
	cmpq	%rdx, %rdi
	jne	.L63
	movl	%eax, %edx
	andl	$-16, %edx
	movl	%edx, %r9d
	cmpl	%edx, %eax
	je	.L65
	movl	%eax, %edi
	subl	%edx, %edi
	leal	-1(%rdi), %r8d
	cmpl	$6, %r8d
	jbe	.L67
.L62:
	movq	0(%rbp,%rdx), %r8
	movq	%r8, (%rsi,%rdx)
	movl	%edi, %edx
	andl	$-8, %edx
	addl	%edx, %r9d
	cmpl	%edx, %edi
	je	.L65
.L67:
	movslq	%r9d, %rdx
	movzbl	0(%rbp,%rdx), %edi
	movb	%dil, (%rsi,%rdx)
	leal	1(%r9), %edx
	cmpl	%edx, %eax
	jle	.L65
	movslq	%edx, %rdx
	movzbl	0(%rbp,%rdx), %edi
	movb	%dil, (%rsi,%rdx)
	leal	2(%r9), %edx
	cmpl	%edx, %eax
	jle	.L65
	movslq	%edx, %rdx
	movzbl	0(%rbp,%rdx), %edi
	movb	%dil, (%rsi,%rdx)
	leal	3(%r9), %edx
	cmpl	%edx, %eax
	jle	.L65
	movslq	%edx, %rdx
	movzbl	0(%rbp,%rdx), %edi
	movb	%dil, (%rsi,%rdx)
	leal	4(%r9), %edx
	cmpl	%edx, %eax
	jle	.L65
	movslq	%edx, %rdx
	movzbl	0(%rbp,%rdx), %edi
	movb	%dil, (%rsi,%rdx)
	leal	5(%r9), %edx
	cmpl	%edx, %eax
	jle	.L65
	movslq	%edx, %rdx
	addl	$6, %r9d
	movzbl	0(%rbp,%rdx), %edi
	movb	%dil, (%rsi,%rdx)
	cmpl	%r9d, %eax
	jle	.L65
	movslq	%r9d, %r9
	movzbl	0(%rbp,%r9), %eax
	movb	%al, (%rsi,%r9)
	.p2align 4,,10
	.p2align 3
.L65:
	leaq	0(%rbp,%r13), %rsi
	subl	%r14d, %ebx
	movq	%rsi, %rdi
	movq	%rsi, 16(%rsp)
	call	strlen@PLT
	movq	16(%rsp), %rsi
	cmpl	%eax, %ebx
	cmovg	%eax, %ebx
	testl	%r12d, %r12d
	jne	.L127
	testl	%ebx, %ebx
	jle	.L50
	leaq	1(%rbp,%r13), %rdi
	movq	%r15, %rcx
	leal	-1(%rbx), %eax
	movl	%ebx, %edx
	subq	%rdi, %rcx
	cmpq	$14, %rcx
	jbe	.L72
	cmpl	$6, %eax
	jbe	.L72
	cmpl	$14, %eax
	jbe	.L85
	shrl	$4, %edx
	xorl	%eax, %eax
	salq	$4, %rdx
	.p2align 4,,10
	.p2align 3
.L74:
	movdqu	(%rsi,%rax), %xmm3
	movups	%xmm3, (%r15,%rax)
	addq	$16, %rax
	cmpq	%rax, %rdx
	jne	.L74
	movl	%ebx, %eax
	andl	$-16, %eax
	movl	%eax, %r12d
	cmpl	%eax, %ebx
	je	.L50
	movl	%ebx, %edx
	subl	%eax, %edx
	leal	-1(%rdx), %ecx
	cmpl	$6, %ecx
	jbe	.L77
.L73:
	movq	(%rsi,%rax), %rcx
	movq	%rcx, (%r15,%rax)
	movl	%edx, %eax
	andl	$-8, %eax
	addl	%eax, %r12d
	cmpl	%eax, %edx
	je	.L50
.L77:
	movslq	%r12d, %rax
	movzbl	(%rsi,%rax), %edx
	movb	%dl, (%r15,%rax)
	leal	1(%r12), %eax
	cmpl	%eax, %ebx
	jle	.L50
	cltq
	movzbl	(%rsi,%rax), %edx
	movb	%dl, (%r15,%rax)
	leal	2(%r12), %eax
	cmpl	%eax, %ebx
	jle	.L50
	cltq
	movzbl	(%rsi,%rax), %edx
	movb	%dl, (%r15,%rax)
	leal	3(%r12), %eax
	cmpl	%eax, %ebx
	jle	.L50
	cltq
	movzbl	(%rsi,%rax), %edx
	movb	%dl, (%r15,%rax)
	leal	4(%r12), %eax
	cmpl	%eax, %ebx
	jle	.L50
	cltq
	movzbl	(%rsi,%rax), %edx
	movb	%dl, (%r15,%rax)
	leal	5(%r12), %eax
	cmpl	%eax, %ebx
	jle	.L50
	cltq
	addl	$6, %r12d
	movzbl	(%rsi,%rax), %edx
	movb	%dl, (%r15,%rax)
	cmpl	%r12d, %ebx
	jle	.L50
	movslq	%r12d, %r12
	movzbl	(%rsi,%r12), %eax
	movb	%al, (%r15,%r12)
	jmp	.L50
	.p2align 4,,10
	.p2align 3
.L57:
	testl	%eax, %eax
	jle	.L65
	leal	-1(%rax), %r8d
	cltq
	movslq	%r8d, %rdx
	leaq	-2(%rbp,%rax), %rdi
	movl	%r8d, %r8d
	addq	%rbp, %rdx
	subq	%r8, %rdi
	.p2align 4,,10
	.p2align 3
.L71:
	movzbl	(%rdx), %eax
	subq	$1, %rdx
	addq	$1, %rsi
	movb	%al, -1(%rsi)
	cmpq	%rdi, %rdx
	jne	.L71
	jmp	.L65
	.p2align 4,,10
	.p2align 3
.L30:
	testl	%eax, %eax
	jle	.L38
	leal	-1(%rax), %r8d
	cltq
	movq	%r15, %rsi
	movslq	%r8d, %rdx
	leaq	-2(%rbp,%rax), %rdi
	movl	%r8d, %r8d
	addq	%rbp, %rdx
	subq	%r8, %rdi
	.p2align 4,,10
	.p2align 3
.L44:
	movzbl	(%rdx), %eax
	subq	$1, %rdx
	addq	$1, %rsi
	movb	%al, -1(%rsi)
	cmpq	%rdx, %rdi
	jne	.L44
	jmp	.L38
	.p2align 4,,10
	.p2align 3
.L127:
	testl	%ebx, %ebx
	jle	.L50
	leal	-1(%rbx), %eax
	movslq	%ebx, %rbx
	movq	%r15, %rcx
	movslq	%eax, %rdx
	movl	%eax, %eax
	addq	%rsi, %rdx
	leaq	-2(%rbx,%rsi), %rsi
	subq	%rax, %rsi
	.p2align 4,,10
	.p2align 3
.L81:
	movzbl	(%rdx), %eax
	subq	$1, %rdx
	addq	$1, %rcx
	movb	%al, -1(%rcx)
	cmpq	%rsi, %rdx
	jne	.L81
	jmp	.L50
	.p2align 4,,10
	.p2align 3
.L126:
	testl	%ebx, %ebx
	jle	.L50
	leal	-1(%rbx), %eax
	movslq	%ebx, %rbx
	movslq	%eax, %rcx
	movl	%eax, %eax
	addq	%rsi, %rcx
	leaq	-2(%rsi,%rbx), %rsi
	subq	%rax, %rsi
	.p2align 4,,10
	.p2align 3
.L56:
	movzbl	(%rcx), %eax
	subq	$1, %rcx
	addq	$1, %rdx
	movb	%al, -1(%rdx)
	cmpq	%rcx, %rsi
	jne	.L56
	jmp	.L50
	.p2align 4,,10
	.p2align 3
.L34:
	movl	%eax, %eax
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L42:
	movzbl	0(%rbp,%rdx), %esi
	movb	%sil, (%r15,%rdx)
	addq	$1, %rdx
	cmpq	%rax, %rdx
	jne	.L42
	jmp	.L38
	.p2align 4,,10
	.p2align 3
.L72:
	movl	%ebx, %ebx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L79:
	movzbl	(%rsi,%rax), %edx
	movb	%dl, (%r15,%rax)
	addq	$1, %rax
	cmpq	%rax, %rbx
	jne	.L79
	jmp	.L50
	.p2align 4,,10
	.p2align 3
.L46:
	movl	%ebx, %ebx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L54:
	movzbl	(%rsi,%rax), %ecx
	movb	%cl, (%rdx,%rax)
	addq	$1, %rax
	cmpq	%rbx, %rax
	jne	.L54
	jmp	.L50
	.p2align 4,,10
	.p2align 3
.L61:
	movl	%eax, %eax
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L69:
	movzbl	0(%rbp,%rdx), %edi
	movb	%dil, (%rsi,%rdx)
	addq	$1, %rdx
	cmpq	%rdx, %rax
	jne	.L69
	jmp	.L65
.L82:
	xorl	%edx, %edx
	jmp	.L35
.L85:
	xorl	%eax, %eax
	jmp	.L73
.L84:
	xorl	%edx, %edx
	jmp	.L62
.L83:
	xorl	%eax, %eax
	jmp	.L47
	.cfi_endproc
.LFE36:
	.size	rearrange, .-rearrange
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%72s"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB37:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-2981888(%rsp), %r11
	.cfi_def_cfa 11, 2981944
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3768, %rsp
	.cfi_def_cfa_offset 2985712
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 2985640(%rsp)
	xorl	%eax, %eax
	leaq	140(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	%eax, %r8d
	movl	$1, %eax
	cmpl	$1, %r8d
	jne	.L128
	cmpl	$0, 140(%rsp)
	jle	.L171
	leaq	2985552(%rsp), %rax
	movl	$0, 124(%rsp)
	movq	%rax, 56(%rsp)
	leaq	144(%rsp), %rax
	movq	%rax, (%rsp)
.L130:
	movq	56(%rsp), %rbx
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	movq	%rbx, %rsi
	call	__isoc99_scanf@PLT
	movq	%rbx, %rdi
	call	strlen@PLT
	movq	%rax, 112(%rsp)
	cmpq	$1, %rax
	jbe	.L175
	movslq	%eax, %rdi
	movl	%eax, 44(%rsp)
	xorl	%r15d, %r15d
	leaq	217(%rsp), %rax
	movq	%rdi, 16(%rsp)
	leaq	2985553(%rsp), %r13
	movq	$1, 32(%rsp)
	movq	%r13, %r14
	movq	%rax, 48(%rsp)
	.p2align 4,,10
	.p2align 3
.L132:
	movq	32(%rsp), %rdx
	movl	112(%rsp), %eax
	movl	$0, 24(%rsp)
	movl	%edx, %edi
	cmpl	%eax, %edi
	movl	%edi, 40(%rsp)
	cmovle	%rdi, %rax
	leal	-1(%rax), %edi
	movq	%rax, %rbx
	movl	%eax, 28(%rsp)
	movq	%rax, 96(%rsp)
	movq	56(%rsp), %rax
	movl	%edi, 88(%rsp)
	movslq	%edi, %rdi
	movq	%rdi, 72(%rsp)
	movq	%rax, %rdi
	leaq	-2(%rax,%rdx), %rax
	addq	%rbx, %rdi
	movq	%rax, 80(%rsp)
	movq	%rdi, 104(%rsp)
.L170:
	movq	16(%rsp), %rax
	subq	32(%rsp), %rax
	xorl	%r12d, %r12d
	movq	%rax, 64(%rsp)
	movl	28(%rsp), %eax
	movl	%eax, %edi
	andl	$2, %eax
	andl	$4, %edi
	movl	%eax, 120(%rsp)
	movl	%edi, 92(%rsp)
.L168:
	movslq	%r15d, %rax
	movl	24(%rsp), %r10d
	movl	%r12d, %ebp
	movl	%r12d, %ecx
	leaq	(%rax,%rax,8), %rdx
	andl	$1, %ebp
	sarl	%ecx
	leaq	(%rax,%rdx,8), %rbx
	addq	(%rsp), %rbx
	testl	%r10d, %r10d
	jne	.L133
	testl	%ecx, %ecx
	jne	.L134
	cmpl	$8, 28(%rsp)
	jnb	.L135
	movl	92(%rsp), %r9d
	testl	%r9d, %r9d
	jne	.L217
	movl	28(%rsp), %r8d
	testl	%r8d, %r8d
	je	.L142
	movq	56(%rsp), %rax
	movzbl	(%rax), %eax
	movb	%al, (%rbx)
	movl	120(%rsp), %edi
	testl	%edi, %edi
	jne	.L218
	.p2align 4,,10
	.p2align 3
.L142:
	movq	32(%rsp), %rax
	movq	%r14, %rdi
	movl	44(%rsp), %r13d
	subl	40(%rsp), %r13d
	leaq	(%rbx,%rax), %rdx
	movq	%rdx, 8(%rsp)
	call	strlen@PLT
	testl	%ebp, %ebp
	movq	8(%rsp), %rdx
	jne	.L219
	cmpl	%eax, %r13d
	cmovg	%eax, %r13d
	testl	%r13d, %r13d
	jle	.L150
	cmpl	$8, %r13d
	jnb	.L146
	testb	$4, %r13b
	jne	.L220
	testl	%r13d, %r13d
	je	.L150
	movzbl	(%r14), %eax
	movb	%al, (%rdx)
	testb	$2, %r13b
	jne	.L221
	.p2align 4,,10
	.p2align 3
.L150:
	movq	16(%rsp), %rax
	movb	$0, (%rbx,%rax)
	leal	1(%r15), %eax
	movl	%eax, 8(%rsp)
	testl	%r15d, %r15d
	je	.L222
	leal	-1(%r15), %eax
	movq	(%rsp), %r13
	leaq	(%rax,%rax,8), %rcx
	leaq	(%rax,%rcx,8), %rbp
	addq	48(%rsp), %rbp
	jmp	.L167
	.p2align 4,,10
	.p2align 3
.L224:
	addq	$73, %r13
	cmpq	%r13, %rbp
	je	.L223
.L167:
	movq	%r13, %rsi
	movq	%rbx, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L224
.L145:
	addl	$1, %r12d
	cmpl	$4, %r12d
	jne	.L168
	cmpl	$1, 24(%rsp)
	je	.L169
	movl	$1, 24(%rsp)
	jmp	.L170
	.p2align 4,,10
	.p2align 3
.L169:
	addq	$1, 32(%rsp)
	addq	$1, %r14
	movq	32(%rsp), %rax
	cmpq	%rax, 112(%rsp)
	jne	.L132
.L131:
	movl	%r15d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addl	$1, 124(%rsp)
	movl	124(%rsp), %eax
	cmpl	%eax, 140(%rsp)
	jg	.L130
.L171:
	xorl	%eax, %eax
.L128:
	movq	2985640(%rsp), %rdx
	subq	%fs:40, %rdx
	jne	.L225
	addq	$2985656, %rsp
	.cfi_remember_state
	.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
	ret
	.p2align 4,,10
	.p2align 3
.L133:
	.cfi_restore_state
	movq	64(%rsp), %rax
	addq	%rbx, %rax
	testl	%ecx, %ecx
	jne	.L226
	cmpl	$8, 28(%rsp)
	jnb	.L156
	movl	92(%rsp), %esi
	testl	%esi, %esi
	jne	.L227
	movl	28(%rsp), %ecx
	testl	%ecx, %ecx
	je	.L160
	movq	56(%rsp), %rdi
	movzbl	(%rdi), %edx
	movb	%dl, (%rax)
	movl	120(%rsp), %edx
	testl	%edx, %edx
	jne	.L228
	.p2align 4,,10
	.p2align 3
.L160:
	movq	%r14, %rdi
	call	strlen@PLT
	movl	44(%rsp), %ecx
	subl	40(%rsp), %ecx
	cmpl	%eax, %ecx
	cmovg	%eax, %ecx
	testl	%ebp, %ebp
	jne	.L229
	testl	%ecx, %ecx
	jle	.L150
	cmpl	$8, %ecx
	jnb	.L162
	testb	$4, %cl
	jne	.L230
	testl	%ecx, %ecx
	je	.L150
	movzbl	(%r14), %eax
	movb	%al, (%rbx)
	testb	$2, %cl
	je	.L150
	movl	%ecx, %ecx
	movzwl	-2(%r14,%rcx), %eax
	movw	%ax, -2(%rbx,%rcx)
	jmp	.L150
	.p2align 4,,10
	.p2align 3
.L223:
	movl	8(%rsp), %r15d
	jmp	.L145
	.p2align 4,,10
	.p2align 3
.L219:
	cmpl	%eax, %r13d
	cmovg	%eax, %r13d
	testl	%r13d, %r13d
	jle	.L150
	movq	80(%rsp), %rax
	leal	-1(%r13), %ecx
	movslq	%r13d, %r13
	movslq	%ecx, %rsi
	movl	%ecx, %ecx
	addq	%r13, %rax
	addq	%r14, %rsi
	subq	%rcx, %rax
	.p2align 4,,10
	.p2align 3
.L151:
	movzbl	(%rsi), %ecx
	subq	$1, %rsi
	addq	$1, %rdx
	movb	%cl, -1(%rdx)
	cmpq	%rsi, %rax
	jne	.L151
	jmp	.L150
	.p2align 4,,10
	.p2align 3
.L134:
	movl	88(%rsp), %ecx
	movq	56(%rsp), %rdx
	movq	%rbx, %rax
	addq	72(%rsp), %rdx
	leaq	1(%rbx,%rcx), %rsi
	.p2align 4,,10
	.p2align 3
.L141:
	movzbl	(%rdx), %ecx
	addq	$1, %rax
	subq	$1, %rdx
	movb	%cl, -1(%rax)
	cmpq	%rax, %rsi
	jne	.L141
	jmp	.L142
	.p2align 4,,10
	.p2align 3
.L229:
	testl	%ecx, %ecx
	jle	.L150
	leal	-1(%rcx), %esi
	movslq	%ecx, %rcx
	addq	80(%rsp), %rcx
	movq	%rbx, %rdx
	movslq	%esi, %rax
	movl	%esi, %esi
	addq	%r14, %rax
	subq	%rsi, %rcx
	.p2align 4,,10
	.p2align 3
.L166:
	movzbl	(%rax), %esi
	subq	$1, %rax
	addq	$1, %rdx
	movb	%sil, -1(%rdx)
	cmpq	%rax, %rcx
	jne	.L166
	jmp	.L150
	.p2align 4,,10
	.p2align 3
.L226:
	movl	88(%rsp), %esi
	movq	56(%rsp), %rdx
	addq	72(%rsp), %rdx
	addq	%rax, %rsi
	.p2align 4,,10
	.p2align 3
.L161:
	movzbl	(%rdx), %ecx
	subq	$1, %rdx
	movb	%cl, (%rax)
	movq	%rax, %rcx
	addq	$1, %rax
	cmpq	%rcx, %rsi
	jne	.L161
	jmp	.L160
	.p2align 4,,10
	.p2align 3
.L135:
	movq	56(%rsp), %rdx
	movq	(%rdx), %rax
	movq	%rax, (%rbx)
	movq	104(%rsp), %rax
	movq	96(%rsp), %rdi
	movq	-8(%rax), %rax
	movq	%rax, -8(%rbx,%rdi)
	leaq	8(%rbx), %rdi
	movq	%rbx, %rax
	andq	$-8, %rdi
	subq	%rdi, %rax
	subq	%rax, %rdx
	addl	28(%rsp), %eax
	shrl	$3, %eax
	movq	%rdx, %rsi
	movl	%eax, %ecx
	rep movsq
	jmp	.L142
	.p2align 4,,10
	.p2align 3
.L156:
	movq	56(%rsp), %rsi
	movq	(%rsi), %rdx
	movq	%rdx, (%rax)
	movq	104(%rsp), %rdi
	movq	-8(%rdi), %rdx
	movq	96(%rsp), %rdi
	movq	%rdx, -8(%rax,%rdi)
	leaq	8(%rax), %rdi
	andq	$-8, %rdi
	subq	%rdi, %rax
	subq	%rax, %rsi
	addl	28(%rsp), %eax
	shrl	$3, %eax
	movl	%eax, %ecx
	rep movsq
	jmp	.L160
	.p2align 4,,10
	.p2align 3
.L162:
	movq	(%r14), %rax
	leaq	8(%rbx), %rdi
	movq	%r14, %rsi
	andq	$-8, %rdi
	movq	%rax, (%rbx)
	movl	%ecx, %eax
	movq	-8(%r14,%rax), %rdx
	movq	%rdx, -8(%rbx,%rax)
	movq	%rbx, %rax
	subq	%rdi, %rax
	subq	%rax, %rsi
	addl	%ecx, %eax
	shrl	$3, %eax
	movl	%eax, %ecx
	rep movsq
	jmp	.L150
	.p2align 4,,10
	.p2align 3
.L146:
	movq	(%r14), %rax
	leaq	8(%rdx), %rdi
	movq	%r14, %rsi
	andq	$-8, %rdi
	movq	%rax, (%rdx)
	movl	%r13d, %eax
	movq	-8(%r14,%rax), %rcx
	movq	%rcx, -8(%rdx,%rax)
	subq	%rdi, %rdx
	addl	%edx, %r13d
	subq	%rdx, %rsi
	shrl	$3, %r13d
	movl	%r13d, %ecx
	rep movsq
	jmp	.L150
.L222:
	movl	%eax, %r15d
	jmp	.L145
.L217:
	movq	56(%rsp), %rax
	movl	(%rax), %eax
	movl	%eax, (%rbx)
	movq	104(%rsp), %rax
	movq	96(%rsp), %rdi
	movl	-4(%rax), %eax
	movl	%eax, -4(%rbx,%rdi)
	jmp	.L142
.L230:
	movl	(%r14), %eax
	movl	%ecx, %ecx
	movl	%eax, (%rbx)
	movl	-4(%r14,%rcx), %eax
	movl	%eax, -4(%rbx,%rcx)
	jmp	.L150
.L220:
	movl	(%r14), %eax
	movl	%r13d, %r13d
	movl	%eax, (%rdx)
	movl	-4(%r14,%r13), %eax
	movl	%eax, -4(%rdx,%r13)
	jmp	.L150
.L227:
	movq	56(%rsp), %rdi
	movl	(%rdi), %edx
	movl	%edx, (%rax)
	movq	104(%rsp), %rdi
	movl	-4(%rdi), %edx
	movq	96(%rsp), %rdi
	movl	%edx, -4(%rax,%rdi)
	jmp	.L160
.L218:
	movq	104(%rsp), %rax
	movq	96(%rsp), %rdi
	movzwl	-2(%rax), %eax
	movw	%ax, -2(%rbx,%rdi)
	jmp	.L142
.L228:
	movq	104(%rsp), %rdi
	movzwl	-2(%rdi), %edx
	movq	96(%rsp), %rdi
	movw	%dx, -2(%rax,%rdi)
	jmp	.L160
.L221:
	movl	%r13d, %r13d
	movzwl	-2(%r14,%r13), %eax
	movw	%ax, -2(%rdx,%r13)
	jmp	.L150
.L175:
	xorl	%r15d, %r15d
	jmp	.L131
.L225:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE37:
	.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
	.globl	strncpyr
	.type	strncpyr, @function
strncpyr:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movl	%edx, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%rdi, %r12
	movq	%rsi, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movq	%rsi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movl	%ecx, %ebx
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	call	strlen@PLT
	cmpl	%eax, %r13d
	cmovle	%r13d, %eax
	testl	%ebx, %ebx
	jne	.L2
	testl	%eax, %eax
	jle	.L18
	leaq	1(%rbp), %rdi
	movq	%r12, %rsi
	leal	-1(%rax), %edx
	movl	%eax, %ecx
	subq	%rdi, %rsi
	cmpq	$14, %rsi
	jbe	.L4
	cmpl	$6, %edx
	jbe	.L4
	cmpl	$14, %edx
	jbe	.L15
	shrl	$4, %ecx
	xorl	%edx, %edx
	salq	$4, %rcx
	.p2align 4,,10
	.p2align 3
.L6:
	movdqu	0(%rbp,%rdx), %xmm0
	movups	%xmm0, (%r12,%rdx)
	addq	$16, %rdx
	cmpq	%rcx, %rdx
	jne	.L6
	movl	%eax, %edx
	andl	$-16, %edx
	movl	%edx, %ebx
	cmpl	%edx, %eax
	je	.L18
	movl	%eax, %ecx
	subl	%edx, %ecx
	leal	-1(%rcx), %esi
	cmpl	$6, %esi
	jbe	.L10
.L5:
	movq	0(%rbp,%rdx), %rsi
	movq	%rsi, (%r12,%rdx)
	movl	%ecx, %edx
	andl	$-8, %edx
	addl	%edx, %ebx
	cmpl	%edx, %ecx
	je	.L18
.L10:
	movslq	%ebx, %rdx
	movzbl	0(%rbp,%rdx), %ecx
	movb	%cl, (%r12,%rdx)
	leal	1(%rbx), %edx
	cmpl	%edx, %eax
	jle	.L18
	movslq	%edx, %rdx
	movzbl	0(%rbp,%rdx), %ecx
	movb	%cl, (%r12,%rdx)
	leal	2(%rbx), %edx
	cmpl	%eax, %edx
	jge	.L18
	movslq	%edx, %rdx
	movzbl	0(%rbp,%rdx), %ecx
	movb	%cl, (%r12,%rdx)
	leal	3(%rbx), %edx
	cmpl	%edx, %eax
	jle	.L18
	movslq	%edx, %rdx
	movzbl	0(%rbp,%rdx), %ecx
	movb	%cl, (%r12,%rdx)
	leal	4(%rbx), %edx
	cmpl	%edx, %eax
	jle	.L18
	movslq	%edx, %rdx
	movzbl	0(%rbp,%rdx), %ecx
	movb	%cl, (%r12,%rdx)
	leal	5(%rbx), %edx
	cmpl	%edx, %eax
	jle	.L18
	movslq	%edx, %rdx
	addl	$6, %ebx
	movzbl	0(%rbp,%rdx), %ecx
	movb	%cl, (%r12,%rdx)
	cmpl	%ebx, %eax
	jle	.L18
	movslq	%ebx, %rbx
	movzbl	0(%rbp,%rbx), %eax
	movb	%al, (%r12,%rbx)
.L18:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	movq	%r12, %rax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	testl	%eax, %eax
	jle	.L18
	leal	-1(%rax), %edi
	cltq
	movq	%r12, %rdx
	movslq	%edi, %rcx
	leaq	-2(%rbp,%rax), %rsi
	movl	%edi, %edi
	addq	%rbp, %rcx
	subq	%rdi, %rsi
	.p2align 4,,10
	.p2align 3
.L14:
	movzbl	(%rcx), %eax
	subq	$1, %rcx
	addq	$1, %rdx
	movb	%al, -1(%rdx)
	cmpq	%rsi, %rcx
	jne	.L14
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	movq	%r12, %rax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	movl	%eax, %eax
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L12:
	movzbl	0(%rbp,%rdx), %ecx
	movb	%cl, (%r12,%rdx)
	addq	$1, %rdx
	cmpq	%rax, %rdx
	jne	.L12
	jmp	.L18
.L15:
	xorl	%edx, %edx
	jmp	.L5
	.cfi_endproc
.LFE35:
	.size	strncpyr, .-strncpyr
	.p2align 4
	.globl	rearrange
	.type	rearrange, @function
rearrange:
.LFB36:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%edx, %rax
	movq	%rdi, %r15
	movq	%rsi, %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movslq	%ecx, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%r13, %r14
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%rsi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rax, %rbx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movl	%r8d, 24(%rsp)
	movl	96(%rsp), %r12d
	movl	%r9d, 16(%rsp)
	movq	%rax, 8(%rsp)
	call	strlen@PLT
	movl	24(%rsp), %r8d
	movl	16(%rsp), %r9d
	cmpl	%eax, %r13d
	cmovle	%r13d, %eax
	testl	%r8d, %r8d
	jne	.L29
	testl	%r9d, %r9d
	jne	.L30
	testl	%eax, %eax
	jle	.L38
	leaq	1(%rbp), %r8
	movq	%r15, %rdi
	leal	-1(%rax), %edx
	movl	%eax, %esi
	subq	%r8, %rdi
	cmpq	$14, %rdi
	jbe	.L34
	cmpl	$6, %edx
	jbe	.L34
	cmpl	$14, %edx
	jbe	.L82
	shrl	$4, %esi
	xorl	%edx, %edx
	salq	$4, %rsi
	.p2align 4,,10
	.p2align 3
.L36:
	movdqu	0(%rbp,%rdx), %xmm0
	movups	%xmm0, (%r15,%rdx)
	addq	$16, %rdx
	cmpq	%rsi, %rdx
	jne	.L36
	movl	%eax, %edx
	andl	$-16, %edx
	movl	%edx, %r9d
	cmpl	%edx, %eax
	je	.L38
	movl	%eax, %esi
	subl	%edx, %esi
	leal	-1(%rsi), %edi
	cmpl	$6, %edi
	jbe	.L40
.L35:
	movq	0(%rbp,%rdx), %rdi
	movq	%rdi, (%r15,%rdx)
	movl	%esi, %edx
	andl	$-8, %edx
	addl	%edx, %r9d
	cmpl	%edx, %esi
	je	.L38
.L40:
	movslq	%r9d, %rdx
	movzbl	0(%rbp,%rdx), %esi
	movb	%sil, (%r15,%rdx)
	leal	1(%r9), %edx
	cmpl	%eax, %edx
	jge	.L38
	movslq	%edx, %rdx
	movzbl	0(%rbp,%rdx), %esi
	movb	%sil, (%r15,%rdx)
	leal	2(%r9), %edx
	cmpl	%eax, %edx
	jge	.L38
	movslq	%edx, %rdx
	movzbl	0(%rbp,%rdx), %esi
	movb	%sil, (%r15,%rdx)
	leal	3(%r9), %edx
	cmpl	%eax, %edx
	jge	.L38
	movslq	%edx, %rdx
	movzbl	0(%rbp,%rdx), %esi
	movb	%sil, (%r15,%rdx)
	leal	4(%r9), %edx
	cmpl	%edx, %eax
	jle	.L38
	movslq	%edx, %rdx
	movzbl	0(%rbp,%rdx), %esi
	movb	%sil, (%r15,%rdx)
	leal	5(%r9), %edx
	cmpl	%edx, %eax
	jle	.L38
	movslq	%edx, %rdx
	addl	$6, %r9d
	movzbl	0(%rbp,%rdx), %esi
	movb	%sil, (%r15,%rdx)
	cmpl	%r9d, %eax
	jle	.L38
	movslq	%r9d, %r9
	movzbl	0(%rbp,%r9), %eax
	movb	%al, (%r15,%r9)
	.p2align 4,,10
	.p2align 3
.L38:
	leaq	0(%rbp,%r13), %rsi
	leaq	(%r15,%r13), %rdx
	subl	%r14d, %ebx
	movq	%rsi, %rdi
	movq	%rdx, 24(%rsp)
	movq	%rsi, 16(%rsp)
	call	strlen@PLT
	movq	16(%rsp), %rsi
	movq	24(%rsp), %rdx
	cmpl	%eax, %ebx
	cmovg	%eax, %ebx
	testl	%r12d, %r12d
	jne	.L126
	testl	%ebx, %ebx
	jle	.L50
	leaq	1(%rbp,%r13), %r8
	movq	%rdx, %rdi
	leal	-1(%rbx), %eax
	movl	%ebx, %ecx
	subq	%r8, %rdi
	cmpq	$14, %rdi
	jbe	.L46
	cmpl	$6, %eax
	jbe	.L46
	cmpl	$14, %eax
	jbe	.L83
	shrl	$4, %ecx
	xorl	%eax, %eax
	salq	$4, %rcx
	.p2align 4,,10
	.p2align 3
.L48:
	movdqu	(%rsi,%rax), %xmm1
	movups	%xmm1, (%rdx,%rax)
	addq	$16, %rax
	cmpq	%rax, %rcx
	jne	.L48
	movl	%ebx, %eax
	andl	$-16, %eax
	movl	%eax, %r12d
	cmpl	%eax, %ebx
	je	.L50
	movl	%ebx, %ecx
	subl	%eax, %ecx
	leal	-1(%rcx), %edi
	cmpl	$6, %edi
	jbe	.L52
.L47:
	addq	%r13, %rax
	movq	0(%rbp,%rax), %rdi
	movq	%rdi, (%r15,%rax)
	movl	%ecx, %eax
	andl	$-8, %eax
	addl	%eax, %r12d
	cmpl	%ecx, %eax
	je	.L50
.L52:
	movslq	%r12d, %rax
	movzbl	(%rsi,%rax), %ecx
	movb	%cl, (%rdx,%rax)
	leal	1(%r12), %eax
	cmpl	%ebx, %eax
	jge	.L50
	cltq
	movzbl	(%rsi,%rax), %ecx
	movb	%cl, (%rdx,%rax)
	leal	2(%r12), %eax
	cmpl	%ebx, %eax
	jge	.L50
	cltq
	movzbl	(%rsi,%rax), %ecx
	movb	%cl, (%rdx,%rax)
	leal	3(%r12), %eax
	cmpl	%eax, %ebx
	jle	.L50
	cltq
	movzbl	(%rsi,%rax), %ecx
	movb	%cl, (%rdx,%rax)
	leal	4(%r12), %eax
	cmpl	%eax, %ebx
	jle	.L50
	cltq
	movzbl	(%rsi,%rax), %ecx
	movb	%cl, (%rdx,%rax)
	leal	5(%r12), %eax
	cmpl	%eax, %ebx
	jle	.L50
	cltq
	addl	$6, %r12d
	movzbl	(%rsi,%rax), %ecx
	movb	%cl, (%rdx,%rax)
	cmpl	%ebx, %r12d
	jge	.L50
	movslq	%r12d, %r12
	movzbl	(%rsi,%r12), %eax
	movb	%al, (%rdx,%r12)
.L50:
	movq	8(%rsp), %rax
	movb	$0, (%r15,%rax)
	addq	$40, %rsp
	.cfi_remember_state
	.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
	ret
	.p2align 4,,10
	.p2align 3
.L29:
	.cfi_restore_state
	movslq	%ebx, %rsi
	subq	%r13, %rsi
	addq	%r15, %rsi
	testl	%r9d, %r9d
	jne	.L57
	testl	%eax, %eax
	jle	.L65
	leaq	1(%rbp), %r10
	movq	%rsi, %r8
	leal	-1(%rax), %edx
	movl	%eax, %edi
	subq	%r10, %r8
	cmpq	$14, %r8
	jbe	.L61
	cmpl	$6, %edx
	jbe	.L61
	cmpl	$14, %edx
	jbe	.L84
	shrl	$4, %edi
	xorl	%edx, %edx
	salq	$4, %rdi
	.p2align 4,,10
	.p2align 3
.L63:
	movdqu	0(%rbp,%rdx), %xmm2
	movups	%xmm2, (%rsi,%rdx)
	addq	$16, %rdx
	cmpq	%rdx, %rdi
	jne	.L63
	movl	%eax, %edx
	andl	$-16, %edx
	movl	%edx, %r9d
	cmpl	%edx, %eax
	je	.L65
	movl	%eax, %edi
	subl	%edx, %edi
	leal	-1(%rdi), %r8d
	cmpl	$6, %r8d
	jbe	.L67
.L62:
	movq	0(%rbp,%rdx), %r8
	movq	%r8, (%rsi,%rdx)
	movl	%edi, %edx
	andl	$-8, %edx
	addl	%edx, %r9d
	cmpl	%edx, %edi
	je	.L65
.L67:
	movslq	%r9d, %rdx
	movzbl	0(%rbp,%rdx), %edi
	movb	%dil, (%rsi,%rdx)
	leal	1(%r9), %edx
	cmpl	%edx, %eax
	jle	.L65
	movslq	%edx, %rdx
	movzbl	0(%rbp,%rdx), %edi
	movb	%dil, (%rsi,%rdx)
	leal	2(%r9), %edx
	cmpl	%edx, %eax
	jle	.L65
	movslq	%edx, %rdx
	movzbl	0(%rbp,%rdx), %edi
	movb	%dil, (%rsi,%rdx)
	leal	3(%r9), %edx
	cmpl	%edx, %eax
	jle	.L65
	movslq	%edx, %rdx
	movzbl	0(%rbp,%rdx), %edi
	movb	%dil, (%rsi,%rdx)
	leal	4(%r9), %edx
	cmpl	%edx, %eax
	jle	.L65
	movslq	%edx, %rdx
	movzbl	0(%rbp,%rdx), %edi
	movb	%dil, (%rsi,%rdx)
	leal	5(%r9), %edx
	cmpl	%edx, %eax
	jle	.L65
	movslq	%edx, %rdx
	addl	$6, %r9d
	movzbl	0(%rbp,%rdx), %edi
	movb	%dil, (%rsi,%rdx)
	cmpl	%r9d, %eax
	jle	.L65
	movslq	%r9d, %r9
	movzbl	0(%rbp,%r9), %eax
	movb	%al, (%rsi,%r9)
	.p2align 4,,10
	.p2align 3
.L65:
	leaq	0(%rbp,%r13), %rsi
	subl	%r14d, %ebx
	movq	%rsi, %rdi
	movq	%rsi, 16(%rsp)
	call	strlen@PLT
	movq	16(%rsp), %rsi
	cmpl	%eax, %ebx
	cmovg	%eax, %ebx
	testl	%r12d, %r12d
	jne	.L127
	testl	%ebx, %ebx
	jle	.L50
	leaq	1(%rbp,%r13), %rdi
	movq	%r15, %rcx
	leal	-1(%rbx), %eax
	movl	%ebx, %edx
	subq	%rdi, %rcx
	cmpq	$14, %rcx
	jbe	.L72
	cmpl	$6, %eax
	jbe	.L72
	cmpl	$14, %eax
	jbe	.L85
	shrl	$4, %edx
	xorl	%eax, %eax
	salq	$4, %rdx
	.p2align 4,,10
	.p2align 3
.L74:
	movdqu	(%rsi,%rax), %xmm3
	movups	%xmm3, (%r15,%rax)
	addq	$16, %rax
	cmpq	%rax, %rdx
	jne	.L74
	movl	%ebx, %eax
	andl	$-16, %eax
	movl	%eax, %r12d
	cmpl	%eax, %ebx
	je	.L50
	movl	%ebx, %edx
	subl	%eax, %edx
	leal	-1(%rdx), %ecx
	cmpl	$6, %ecx
	jbe	.L77
.L73:
	movq	(%rsi,%rax), %rcx
	movq	%rcx, (%r15,%rax)
	movl	%edx, %eax
	andl	$-8, %eax
	addl	%eax, %r12d
	cmpl	%eax, %edx
	je	.L50
.L77:
	movslq	%r12d, %rax
	movzbl	(%rsi,%rax), %edx
	movb	%dl, (%r15,%rax)
	leal	1(%r12), %eax
	cmpl	%eax, %ebx
	jle	.L50
	cltq
	movzbl	(%rsi,%rax), %edx
	movb	%dl, (%r15,%rax)
	leal	2(%r12), %eax
	cmpl	%eax, %ebx
	jle	.L50
	cltq
	movzbl	(%rsi,%rax), %edx
	movb	%dl, (%r15,%rax)
	leal	3(%r12), %eax
	cmpl	%eax, %ebx
	jle	.L50
	cltq
	movzbl	(%rsi,%rax), %edx
	movb	%dl, (%r15,%rax)
	leal	4(%r12), %eax
	cmpl	%eax, %ebx
	jle	.L50
	cltq
	movzbl	(%rsi,%rax), %edx
	movb	%dl, (%r15,%rax)
	leal	5(%r12), %eax
	cmpl	%eax, %ebx
	jle	.L50
	cltq
	addl	$6, %r12d
	movzbl	(%rsi,%rax), %edx
	movb	%dl, (%r15,%rax)
	cmpl	%r12d, %ebx
	jle	.L50
	movslq	%r12d, %r12
	movzbl	(%rsi,%r12), %eax
	movb	%al, (%r15,%r12)
	jmp	.L50
	.p2align 4,,10
	.p2align 3
.L57:
	testl	%eax, %eax
	jle	.L65
	leal	-1(%rax), %r8d
	cltq
	movslq	%r8d, %rdx
	leaq	-2(%rbp,%rax), %rdi
	movl	%r8d, %r8d
	addq	%rbp, %rdx
	subq	%r8, %rdi
	.p2align 4,,10
	.p2align 3
.L71:
	movzbl	(%rdx), %eax
	subq	$1, %rdx
	addq	$1, %rsi
	movb	%al, -1(%rsi)
	cmpq	%rdi, %rdx
	jne	.L71
	jmp	.L65
	.p2align 4,,10
	.p2align 3
.L30:
	testl	%eax, %eax
	jle	.L38
	leal	-1(%rax), %r8d
	cltq
	movq	%r15, %rsi
	movslq	%r8d, %rdx
	leaq	-2(%rbp,%rax), %rdi
	movl	%r8d, %r8d
	addq	%rbp, %rdx
	subq	%r8, %rdi
	.p2align 4,,10
	.p2align 3
.L44:
	movzbl	(%rdx), %eax
	subq	$1, %rdx
	addq	$1, %rsi
	movb	%al, -1(%rsi)
	cmpq	%rdx, %rdi
	jne	.L44
	jmp	.L38
	.p2align 4,,10
	.p2align 3
.L127:
	testl	%ebx, %ebx
	jle	.L50
	leal	-1(%rbx), %eax
	movslq	%ebx, %rbx
	movq	%r15, %rcx
	movslq	%eax, %rdx
	movl	%eax, %eax
	addq	%rsi, %rdx
	leaq	-2(%rbx,%rsi), %rsi
	subq	%rax, %rsi
	.p2align 4,,10
	.p2align 3
.L81:
	movzbl	(%rdx), %eax
	subq	$1, %rdx
	addq	$1, %rcx
	movb	%al, -1(%rcx)
	cmpq	%rsi, %rdx
	jne	.L81
	jmp	.L50
	.p2align 4,,10
	.p2align 3
.L126:
	testl	%ebx, %ebx
	jle	.L50
	leal	-1(%rbx), %eax
	movslq	%ebx, %rbx
	movslq	%eax, %rcx
	movl	%eax, %eax
	addq	%rsi, %rcx
	leaq	-2(%rsi,%rbx), %rsi
	subq	%rax, %rsi
	.p2align 4,,10
	.p2align 3
.L56:
	movzbl	(%rcx), %eax
	subq	$1, %rcx
	addq	$1, %rdx
	movb	%al, -1(%rdx)
	cmpq	%rcx, %rsi
	jne	.L56
	jmp	.L50
	.p2align 4,,10
	.p2align 3
.L34:
	movl	%eax, %eax
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L42:
	movzbl	0(%rbp,%rdx), %esi
	movb	%sil, (%r15,%rdx)
	addq	$1, %rdx
	cmpq	%rax, %rdx
	jne	.L42
	jmp	.L38
	.p2align 4,,10
	.p2align 3
.L72:
	movl	%ebx, %ebx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L79:
	movzbl	(%rsi,%rax), %edx
	movb	%dl, (%r15,%rax)
	addq	$1, %rax
	cmpq	%rax, %rbx
	jne	.L79
	jmp	.L50
	.p2align 4,,10
	.p2align 3
.L46:
	movl	%ebx, %ebx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L54:
	movzbl	(%rsi,%rax), %ecx
	movb	%cl, (%rdx,%rax)
	addq	$1, %rax
	cmpq	%rbx, %rax
	jne	.L54
	jmp	.L50
	.p2align 4,,10
	.p2align 3
.L61:
	movl	%eax, %eax
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L69:
	movzbl	0(%rbp,%rdx), %edi
	movb	%dil, (%rsi,%rdx)
	addq	$1, %rdx
	cmpq	%rdx, %rax
	jne	.L69
	jmp	.L65
.L82:
	xorl	%edx, %edx
	jmp	.L35
.L85:
	xorl	%eax, %eax
	jmp	.L73
.L84:
	xorl	%edx, %edx
	jmp	.L62
.L83:
	xorl	%eax, %eax
	jmp	.L47
	.cfi_endproc
.LFE36:
	.size	rearrange, .-rearrange
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%72s"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB37:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-2981888(%rsp), %r11
	.cfi_def_cfa 11, 2981944
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3768, %rsp
	.cfi_def_cfa_offset 2985712
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 2985640(%rsp)
	xorl	%eax, %eax
	leaq	140(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	%eax, %r8d
	movl	$1, %eax
	cmpl	$1, %r8d
	jne	.L128
	cmpl	$0, 140(%rsp)
	jle	.L171
	leaq	2985552(%rsp), %rax
	movl	$0, 124(%rsp)
	movq	%rax, 56(%rsp)
	leaq	144(%rsp), %rax
	movq	%rax, (%rsp)
.L130:
	movq	56(%rsp), %rbx
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	movq	%rbx, %rsi
	call	__isoc99_scanf@PLT
	movq	%rbx, %rdi
	call	strlen@PLT
	movq	%rax, 112(%rsp)
	cmpq	$1, %rax
	jbe	.L175
	movslq	%eax, %rdi
	movl	%eax, 44(%rsp)
	xorl	%r15d, %r15d
	leaq	217(%rsp), %rax
	movq	%rdi, 16(%rsp)
	leaq	2985553(%rsp), %r13
	movq	$1, 32(%rsp)
	movq	%r13, %r14
	movq	%rax, 48(%rsp)
	.p2align 4,,10
	.p2align 3
.L132:
	movq	32(%rsp), %rdx
	movl	112(%rsp), %eax
	movl	$0, 24(%rsp)
	movl	%edx, %edi
	cmpl	%eax, %edi
	movl	%edi, 40(%rsp)
	cmovle	%rdi, %rax
	leal	-1(%rax), %edi
	movq	%rax, %rbx
	movl	%eax, 28(%rsp)
	movq	%rax, 96(%rsp)
	movq	56(%rsp), %rax
	movl	%edi, 88(%rsp)
	movslq	%edi, %rdi
	movq	%rdi, 72(%rsp)
	movq	%rax, %rdi
	leaq	-2(%rax,%rdx), %rax
	addq	%rbx, %rdi
	movq	%rax, 80(%rsp)
	movq	%rdi, 104(%rsp)
.L170:
	movq	16(%rsp), %rax
	subq	32(%rsp), %rax
	xorl	%r12d, %r12d
	movq	%rax, 64(%rsp)
	movl	28(%rsp), %eax
	movl	%eax, %edi
	andl	$2, %eax
	andl	$4, %edi
	movl	%eax, 120(%rsp)
	movl	%edi, 92(%rsp)
.L168:
	movslq	%r15d, %rax
	movl	24(%rsp), %r10d
	movl	%r12d, %ebp
	movl	%r12d, %ecx
	leaq	(%rax,%rax,8), %rdx
	andl	$1, %ebp
	sarl	%ecx
	leaq	(%rax,%rdx,8), %rbx
	addq	(%rsp), %rbx
	testl	%r10d, %r10d
	jne	.L133
	testl	%ecx, %ecx
	jne	.L134
	cmpl	$8, 28(%rsp)
	jnb	.L135
	movl	92(%rsp), %r9d
	testl	%r9d, %r9d
	jne	.L217
	movl	28(%rsp), %r8d
	testl	%r8d, %r8d
	je	.L142
	movq	56(%rsp), %rax
	movzbl	(%rax), %eax
	movb	%al, (%rbx)
	movl	120(%rsp), %edi
	testl	%edi, %edi
	jne	.L218
	.p2align 4,,10
	.p2align 3
.L142:
	movq	32(%rsp), %rax
	movq	%r14, %rdi
	movl	44(%rsp), %r13d
	subl	40(%rsp), %r13d
	leaq	(%rbx,%rax), %rdx
	movq	%rdx, 8(%rsp)
	call	strlen@PLT
	testl	%ebp, %ebp
	movq	8(%rsp), %rdx
	jne	.L219
	cmpl	%eax, %r13d
	cmovg	%eax, %r13d
	testl	%r13d, %r13d
	jle	.L150
	cmpl	$8, %r13d
	jnb	.L146
	testb	$4, %r13b
	jne	.L220
	testl	%r13d, %r13d
	je	.L150
	movzbl	(%r14), %eax
	movb	%al, (%rdx)
	testb	$2, %r13b
	jne	.L221
	.p2align 4,,10
	.p2align 3
.L150:
	movq	16(%rsp), %rax
	movb	$0, (%rbx,%rax)
	leal	1(%r15), %eax
	movl	%eax, 8(%rsp)
	testl	%r15d, %r15d
	je	.L222
	leal	-1(%r15), %eax
	movq	(%rsp), %r13
	leaq	(%rax,%rax,8), %rcx
	leaq	(%rax,%rcx,8), %rbp
	addq	48(%rsp), %rbp
	jmp	.L167
	.p2align 4,,10
	.p2align 3
.L224:
	addq	$73, %r13
	cmpq	%r13, %rbp
	je	.L223
.L167:
	movq	%r13, %rsi
	movq	%rbx, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L224
.L145:
	addl	$1, %r12d
	cmpl	$4, %r12d
	jne	.L168
	cmpl	$1, 24(%rsp)
	je	.L169
	movl	$1, 24(%rsp)
	jmp	.L170
	.p2align 4,,10
	.p2align 3
.L169:
	addq	$1, 32(%rsp)
	addq	$1, %r14
	movq	32(%rsp), %rax
	cmpq	%rax, 112(%rsp)
	jne	.L132
.L131:
	movl	%r15d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addl	$1, 124(%rsp)
	movl	124(%rsp), %eax
	cmpl	%eax, 140(%rsp)
	jg	.L130
.L171:
	xorl	%eax, %eax
.L128:
	movq	2985640(%rsp), %rdx
	subq	%fs:40, %rdx
	jne	.L225
	addq	$2985656, %rsp
	.cfi_remember_state
	.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
	ret
	.p2align 4,,10
	.p2align 3
.L133:
	.cfi_restore_state
	movq	64(%rsp), %rax
	addq	%rbx, %rax
	testl	%ecx, %ecx
	jne	.L226
	cmpl	$8, 28(%rsp)
	jnb	.L156
	movl	92(%rsp), %esi
	testl	%esi, %esi
	jne	.L227
	movl	28(%rsp), %ecx
	testl	%ecx, %ecx
	je	.L160
	movq	56(%rsp), %rdi
	movzbl	(%rdi), %edx
	movb	%dl, (%rax)
	movl	120(%rsp), %edx
	testl	%edx, %edx
	jne	.L228
	.p2align 4,,10
	.p2align 3
.L160:
	movq	%r14, %rdi
	call	strlen@PLT
	movl	44(%rsp), %ecx
	subl	40(%rsp), %ecx
	cmpl	%eax, %ecx
	cmovg	%eax, %ecx
	testl	%ebp, %ebp
	jne	.L229
	testl	%ecx, %ecx
	jle	.L150
	cmpl	$8, %ecx
	jnb	.L162
	testb	$4, %cl
	jne	.L230
	testl	%ecx, %ecx
	je	.L150
	movzbl	(%r14), %eax
	movb	%al, (%rbx)
	testb	$2, %cl
	je	.L150
	movl	%ecx, %ecx
	movzwl	-2(%r14,%rcx), %eax
	movw	%ax, -2(%rbx,%rcx)
	jmp	.L150
	.p2align 4,,10
	.p2align 3
.L223:
	movl	8(%rsp), %r15d
	jmp	.L145
	.p2align 4,,10
	.p2align 3
.L219:
	cmpl	%eax, %r13d
	cmovg	%eax, %r13d
	testl	%r13d, %r13d
	jle	.L150
	movq	80(%rsp), %rax
	leal	-1(%r13), %ecx
	movslq	%r13d, %r13
	movslq	%ecx, %rsi
	movl	%ecx, %ecx
	addq	%r13, %rax
	addq	%r14, %rsi
	subq	%rcx, %rax
	.p2align 4,,10
	.p2align 3
.L151:
	movzbl	(%rsi), %ecx
	subq	$1, %rsi
	addq	$1, %rdx
	movb	%cl, -1(%rdx)
	cmpq	%rsi, %rax
	jne	.L151
	jmp	.L150
	.p2align 4,,10
	.p2align 3
.L134:
	movl	88(%rsp), %ecx
	movq	56(%rsp), %rdx
	movq	%rbx, %rax
	addq	72(%rsp), %rdx
	leaq	1(%rbx,%rcx), %rsi
	.p2align 4,,10
	.p2align 3
.L141:
	movzbl	(%rdx), %ecx
	addq	$1, %rax
	subq	$1, %rdx
	movb	%cl, -1(%rax)
	cmpq	%rax, %rsi
	jne	.L141
	jmp	.L142
	.p2align 4,,10
	.p2align 3
.L229:
	testl	%ecx, %ecx
	jle	.L150
	leal	-1(%rcx), %esi
	movslq	%ecx, %rcx
	addq	80(%rsp), %rcx
	movq	%rbx, %rdx
	movslq	%esi, %rax
	movl	%esi, %esi
	addq	%r14, %rax
	subq	%rsi, %rcx
	.p2align 4,,10
	.p2align 3
.L166:
	movzbl	(%rax), %esi
	subq	$1, %rax
	addq	$1, %rdx
	movb	%sil, -1(%rdx)
	cmpq	%rax, %rcx
	jne	.L166
	jmp	.L150
	.p2align 4,,10
	.p2align 3
.L226:
	movl	88(%rsp), %esi
	movq	56(%rsp), %rdx
	addq	72(%rsp), %rdx
	addq	%rax, %rsi
	.p2align 4,,10
	.p2align 3
.L161:
	movzbl	(%rdx), %ecx
	subq	$1, %rdx
	movb	%cl, (%rax)
	movq	%rax, %rcx
	addq	$1, %rax
	cmpq	%rcx, %rsi
	jne	.L161
	jmp	.L160
	.p2align 4,,10
	.p2align 3
.L135:
	movq	56(%rsp), %rdx
	movq	(%rdx), %rax
	movq	%rax, (%rbx)
	movq	104(%rsp), %rax
	movq	96(%rsp), %rdi
	movq	-8(%rax), %rax
	movq	%rax, -8(%rbx,%rdi)
	leaq	8(%rbx), %rdi
	movq	%rbx, %rax
	andq	$-8, %rdi
	subq	%rdi, %rax
	subq	%rax, %rdx
	addl	28(%rsp), %eax
	shrl	$3, %eax
	movq	%rdx, %rsi
	movl	%eax, %ecx
	rep movsq
	jmp	.L142
	.p2align 4,,10
	.p2align 3
.L156:
	movq	56(%rsp), %rsi
	movq	(%rsi), %rdx
	movq	%rdx, (%rax)
	movq	104(%rsp), %rdi
	movq	-8(%rdi), %rdx
	movq	96(%rsp), %rdi
	movq	%rdx, -8(%rax,%rdi)
	leaq	8(%rax), %rdi
	andq	$-8, %rdi
	subq	%rdi, %rax
	subq	%rax, %rsi
	addl	28(%rsp), %eax
	shrl	$3, %eax
	movl	%eax, %ecx
	rep movsq
	jmp	.L160
	.p2align 4,,10
	.p2align 3
.L162:
	movq	(%r14), %rax
	leaq	8(%rbx), %rdi
	movq	%r14, %rsi
	andq	$-8, %rdi
	movq	%rax, (%rbx)
	movl	%ecx, %eax
	movq	-8(%r14,%rax), %rdx
	movq	%rdx, -8(%rbx,%rax)
	movq	%rbx, %rax
	subq	%rdi, %rax
	subq	%rax, %rsi
	addl	%ecx, %eax
	shrl	$3, %eax
	movl	%eax, %ecx
	rep movsq
	jmp	.L150
	.p2align 4,,10
	.p2align 3
.L146:
	movq	(%r14), %rax
	leaq	8(%rdx), %rdi
	movq	%r14, %rsi
	andq	$-8, %rdi
	movq	%rax, (%rdx)
	movl	%r13d, %eax
	movq	-8(%r14,%rax), %rcx
	movq	%rcx, -8(%rdx,%rax)
	subq	%rdi, %rdx
	addl	%edx, %r13d
	subq	%rdx, %rsi
	shrl	$3, %r13d
	movl	%r13d, %ecx
	rep movsq
	jmp	.L150
.L222:
	movl	%eax, %r15d
	jmp	.L145
.L217:
	movq	56(%rsp), %rax
	movl	(%rax), %eax
	movl	%eax, (%rbx)
	movq	104(%rsp), %rax
	movq	96(%rsp), %rdi
	movl	-4(%rax), %eax
	movl	%eax, -4(%rbx,%rdi)
	jmp	.L142
.L230:
	movl	(%r14), %eax
	movl	%ecx, %ecx
	movl	%eax, (%rbx)
	movl	-4(%r14,%rcx), %eax
	movl	%eax, -4(%rbx,%rcx)
	jmp	.L150
.L220:
	movl	(%r14), %eax
	movl	%r13d, %r13d
	movl	%eax, (%rdx)
	movl	-4(%r14,%r13), %eax
	movl	%eax, -4(%rdx,%r13)
	jmp	.L150
.L227:
	movq	56(%rsp), %rdi
	movl	(%rdi), %edx
	movl	%edx, (%rax)
	movq	104(%rsp), %rdi
	movl	-4(%rdi), %edx
	movq	96(%rsp), %rdi
	movl	%edx, -4(%rax,%rdi)
	jmp	.L160
.L218:
	movq	104(%rsp), %rax
	movq	96(%rsp), %rdi
	movzwl	-2(%rax), %eax
	movw	%ax, -2(%rbx,%rdi)
	jmp	.L142
.L228:
	movq	104(%rsp), %rdi
	movzwl	-2(%rdi), %edx
	movq	96(%rsp), %rdi
	movw	%dx, -2(%rax,%rdi)
	jmp	.L160
.L221:
	movl	%r13d, %r13d
	movzwl	-2(%r14,%r13), %eax
	movw	%ax, -2(%rdx,%r13)
	jmp	.L150
.L175:
	xorl	%r15d, %r15d
	jmp	.L131
.L225:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE37:
	.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 <string.h>

/* 文字列を逆順にコピーする (末尾に空文字を付加しない) */
char* strncpyr(char *s1, const char *s2, int n, int reversal) {
	int l2, i;
	l2 = strlen(s2);
	if (reversal == 0) {
		/* strncpy(s1, s2, n); */
		if (l2 > n) l2 = n;
		for (i = 0; i < l2; i++) s1[i] = s2[i];
		/* for (i = l2; i < n; i++) s1[i] = '\0'; */
	} else {
		if (l2 > n) l2 = n;
		for (i = 0; i < l2; i++) s1[i] = s2[l2 - 1 - i];
		/* for (i = l2; i < n; i++) s1[i] = '\0'; */
	}
	return s1;
}

/* 列車を再編成する */
void rearrange(char *s1, const char *s2, int n, int division, int order, int reversal_l, int reversal_r) {
	if (order == 0) {
		/* 順 */
		strncpyr(s1, s2, division, reversal_l); /* 左側 */
		strncpyr(s1 + division, s2 + division, n - division, reversal_r); /* 右側 */
	} else {
		/* 逆順 */
		strncpyr(s1 + n - division, s2, division, reversal_l); /* 左側 */
		strncpyr(s1, s2 + division, n - division, reversal_r); /* 右側 */
	}
	s1[n] = '\0';
}

int main(void) {
	int m; /* データセット数 */
	int l; /* 列車の長さ */
	char t[73]; /* 入場する列車の編成 */
	char u[40896][73]; /* 構成可能な最終編成 */
	int n; /* 構成可能な最終編成の数 */
	int i, j, k, h, g;

	if (scanf("%d", &m) != 1) return 1;

	/* データセット毎の処理 */
	for (i = 0; i < m; i++) {
		/* 初期化する */
		n = 0;
		/* 入場してくる列車の編成を入力する */
		scanf("%72s", t);
		l = strlen(t);

		/* 連結方法を全通り調べ重複を除いた総数を数える */
		for (j = 1; j < l; j++) { /* 分割位置 */
			for (k = 0; k < 2; k++) { /* 連結順 */
				for (h = 0; h < 2 * 2; h++) { /* 左側・右側の前後反転の有無 */
					/* 再編成する */
					rearrange(u[n], t, l, j, k, h / 2, h % 2);
					n++;

					/* これまでに作った編成と重複していないか調べる */
					for (g = 0; g < n - 1; g++) {
						if (strcmp(u[n - 1], u[g]) == 0) {
							n--;
							break;
						}
					}
				}
			}
		}

		/* 再編成の総数を出力する */
		printf("%d\n", n);
	}

    return 0;
}
4
aa
abba
bbcd
abcde
 4
ab
abba
bbcd
edcba
 4
b`
abba
bcbe
bbced
 4
`b
abba
bebe
becbd
 4
`b
aabb
bebe
becbd
 4
`c
aabb
bebe
becce
 4
e`
a`bb
bbee
eddeb
 4
e`
a`ba
bbee
eddeb
 4
_f
a`ba
ebbe
eddea
 4
_e
a`ba
ebbf
eddea

1
6
8
18
 2
6
8
18
 2
6
8
14
 2
6
4
18
 2
4
4
18
 2
4
4
13
 2
8
4
13
 2
12
4
13
 2
12
6
13
 2
12
12
13

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 <string.h>

/* 文字列を逆順にコピーする (末尾に空文字を付加しない) */
char* strncpyr(char *s1, const char *s2, int n, int reversal) {
	int l2, i;
	l2 = strlen(s2);
	if (reversal == 0) {
		/* strncpy(s1, s2, n); */
		if (l2 > n) l2 = n;
		for (i = 0; i < l2; i++) s1[i] = s2[i];
		/* for (i = l2; i < n; i++) s1[i] = '\0'; */
	} else {
		if (l2 > n) l2 = n;
		for (i = 0; i < l2; i++) s1[i] = s2[l2 - 1 - i];
		/* for (i = l2; i < n; i++) s1[i] = '\0'; */
	}
	return s1;
}

/* 列車を再編成する */
void rearrange(char *s1, const char *s2, int n, int division, int order, int reversal_l, int reversal_r) {
	if (order == 0) {
		/* 順 */
		strncpyr(s1, s2, division, reversal_l); /* 左側 */
		strncpyr(s1 + division, s2 + division, n - division, reversal_r); /* 右側 */
	} else {
		/* 逆順 */
		strncpyr(s1 + n - division, s2, division, reversal_l); /* 左側 */
		strncpyr(s1, s2 + division, n - division, reversal_r); /* 右側 */
	}
	s1[n] = '\0';
}

int main(void) {
	int m; /* データセット数 */
	int l; /* 列車の長さ */
	char t[73]; /* 入場する列車の編成 */
	char u[40896][73]; /* 構成可能な最終編成 */
	int n; /* 構成可能な最終編成の数 */
	int i, j, k, h, g;

	if (scanf("%d", &m) != 1) return 1;

	/* データセット毎の処理 */
	for (i = 0; i < m; i++) {
		/* 初期化する */
		n = 0;
		/* 入場してくる列車の編成を入力する */
		scanf("%72s", t);
		l = strlen(t);

		/* 連結方法を全通り調べ重複を除いた総数を数える */
		for (j = 1; j < l; j++) { /* 分割位置 */
			for (k = 0; k < 2; k++) { /* 連結順 */
				for (h = 0; h < 2 * 2; h++) { /* 左側・右側の前後反転の有無 */
					/* 再編成する */
					rearrange(u[n], t, l, j, k, h / 2, h % 2);
					n++;

					/* これまでに作った編成と重複していないか調べる */
					for (g = 0; g < n - 1; g++) {
						if (strcmp(u[n - 1], u[g]) == 0) {
							n--;
							break;
						}
					}
				}
			}
		}

		/* 再編成の総数を出力する */
		printf("%d\n", n);
	}

    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	strncpyr
	.type	strncpyr, @function
strncpyr:
.LFB0:
	.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	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movl	%edx, -36(%rbp)
	movl	%ecx, -40(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -8(%rbp)
	cmpl	$0, -40(%rbp)
	jne	.L2
	movl	-8(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jle	.L3
	movl	-36(%rbp), %eax
	movl	%eax, -8(%rbp)
.L3:
	movl	$0, -4(%rbp)
	jmp	.L4
.L5:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-32(%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)
	addl	$1, -4(%rbp)
.L4:
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jl	.L5
	jmp	.L6
.L2:
	movl	-8(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jle	.L7
	movl	-36(%rbp), %eax
	movl	%eax, -8(%rbp)
.L7:
	movl	$0, -4(%rbp)
	jmp	.L8
.L9:
	movl	-8(%rbp), %eax
	subl	$1, %eax
	subl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-32(%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)
	addl	$1, -4(%rbp)
.L8:
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jl	.L9
.L6:
	movq	-24(%rbp), %rax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	strncpyr, .-strncpyr
	.globl	rearrange
	.type	rearrange, @function
rearrange:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movl	%edx, -20(%rbp)
	movl	%ecx, -24(%rbp)
	movl	%r8d, -28(%rbp)
	movl	%r9d, -32(%rbp)
	cmpl	$0, -28(%rbp)
	jne	.L12
	movl	-32(%rbp), %ecx
	movl	-24(%rbp), %edx
	movq	-16(%rbp), %rsi
	movq	-8(%rbp), %rax
	movq	%rax, %rdi
	call	strncpyr
	movl	-20(%rbp), %eax
	subl	-24(%rbp), %eax
	movl	-24(%rbp), %edx
	movslq	%edx, %rcx
	movq	-16(%rbp), %rdx
	leaq	(%rcx,%rdx), %rsi
	movl	-24(%rbp), %edx
	movslq	%edx, %rcx
	movq	-8(%rbp), %rdx
	leaq	(%rcx,%rdx), %rdi
	movl	16(%rbp), %ecx
	movl	%eax, %edx
	call	strncpyr
	jmp	.L13
.L12:
	movl	-20(%rbp), %eax
	cltq
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	subq	%rdx, %rax
	movq	%rax, %rcx
	movq	-8(%rbp), %rax
	leaq	(%rcx,%rax), %rdi
	movl	-32(%rbp), %ecx
	movl	-24(%rbp), %edx
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	call	strncpyr
	movl	-20(%rbp), %eax
	subl	-24(%rbp), %eax
	movl	%eax, %edx
	movl	-24(%rbp), %eax
	movslq	%eax, %rcx
	movq	-16(%rbp), %rax
	leaq	(%rcx,%rax), %rsi
	movq	-8(%rbp), %rax
	movl	16(%rbp), %ecx
	movq	%rax, %rdi
	call	strncpyr
.L13:
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	movb	$0, (%rax)
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	rearrange, .-rearrange
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%72s"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-2981888(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3648, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-2985536(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L15
	movl	$1, %eax
	jmp	.L29
.L15:
	movl	$0, -2985528(%rbp)
	jmp	.L17
.L28:
	movl	$0, -2985532(%rbp)
	leaq	-96(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-96(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -2985508(%rbp)
	movl	$1, -2985524(%rbp)
	jmp	.L18
.L27:
	movl	$0, -2985520(%rbp)
	jmp	.L19
.L26:
	movl	$0, -2985516(%rbp)
	jmp	.L20
.L25:
	movl	-2985516(%rbp), %eax
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	movl	%eax, %r8d
	movl	-2985516(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %r9d
	leaq	-2985504(%rbp), %rcx
	movl	-2985532(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	leaq	(%rcx,%rax), %rdi
	movl	-2985520(%rbp), %esi
	movl	-2985524(%rbp), %ecx
	movl	-2985508(%rbp), %edx
	leaq	-96(%rbp), %rax
	subq	$8, %rsp
	pushq	%r8
	movl	%esi, %r8d
	movq	%rax, %rsi
	call	rearrange
	addq	$16, %rsp
	addl	$1, -2985532(%rbp)
	movl	$0, -2985512(%rbp)
	jmp	.L21
.L24:
	leaq	-2985504(%rbp), %rcx
	movl	-2985512(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rax, %rcx
	movl	-2985532(%rbp), %eax
	subl	$1, %eax
	leaq	-2985504(%rbp), %rsi
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L22
	subl	$1, -2985532(%rbp)
	jmp	.L23
.L22:
	addl	$1, -2985512(%rbp)
.L21:
	movl	-2985532(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -2985512(%rbp)
	jl	.L24
.L23:
	addl	$1, -2985516(%rbp)
.L20:
	cmpl	$3, -2985516(%rbp)
	jle	.L25
	addl	$1, -2985520(%rbp)
.L19:
	cmpl	$1, -2985520(%rbp)
	jle	.L26
	addl	$1, -2985524(%rbp)
.L18:
	movl	-2985524(%rbp), %eax
	cmpl	-2985508(%rbp), %eax
	jl	.L27
	movl	-2985532(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -2985528(%rbp)
.L17:
	movl	-2985536(%rbp), %eax
	cmpl	%eax, -2985528(%rbp)
	jl	.L28
	movl	$0, %eax
.L29:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L30
	call	__stack_chk_fail@PLT
.L30:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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	strncpyr
	.type	strncpyr, @function
strncpyr:
.LFB0:
	.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	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movl	%edx, -36(%rbp)
	movl	%ecx, -40(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -8(%rbp)
	cmpl	$0, -40(%rbp)
	jne	.L2
	movl	-8(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jle	.L3
	movl	-36(%rbp), %eax
	movl	%eax, -8(%rbp)
.L3:
	movl	$0, -4(%rbp)
	jmp	.L4
.L5:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-32(%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)
	addl	$1, -4(%rbp)
.L4:
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jl	.L5
	jmp	.L6
.L2:
	movl	-8(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jle	.L7
	movl	-36(%rbp), %eax
	movl	%eax, -8(%rbp)
.L7:
	movl	$0, -4(%rbp)
	jmp	.L8
.L9:
	movl	-8(%rbp), %eax
	subl	$1, %eax
	subl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-32(%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)
	addl	$1, -4(%rbp)
.L8:
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jl	.L9
.L6:
	movq	-24(%rbp), %rax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	strncpyr, .-strncpyr
	.globl	rearrange
	.type	rearrange, @function
rearrange:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movl	%edx, -20(%rbp)
	movl	%ecx, -24(%rbp)
	movl	%r8d, -28(%rbp)
	movl	%r9d, -32(%rbp)
	cmpl	$0, -28(%rbp)
	jne	.L12
	movl	-32(%rbp), %ecx
	movl	-24(%rbp), %edx
	movq	-16(%rbp), %rsi
	movq	-8(%rbp), %rax
	movq	%rax, %rdi
	call	strncpyr
	movl	-20(%rbp), %eax
	subl	-24(%rbp), %eax
	movl	-24(%rbp), %edx
	movslq	%edx, %rcx
	movq	-16(%rbp), %rdx
	leaq	(%rcx,%rdx), %rsi
	movl	-24(%rbp), %edx
	movslq	%edx, %rcx
	movq	-8(%rbp), %rdx
	leaq	(%rcx,%rdx), %rdi
	movl	16(%rbp), %ecx
	movl	%eax, %edx
	call	strncpyr
	jmp	.L13
.L12:
	movl	-20(%rbp), %eax
	cltq
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	subq	%rdx, %rax
	movq	%rax, %rcx
	movq	-8(%rbp), %rax
	leaq	(%rcx,%rax), %rdi
	movl	-32(%rbp), %ecx
	movl	-24(%rbp), %edx
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	call	strncpyr
	movl	-20(%rbp), %eax
	subl	-24(%rbp), %eax
	movl	%eax, %edx
	movl	-24(%rbp), %eax
	movslq	%eax, %rcx
	movq	-16(%rbp), %rax
	leaq	(%rcx,%rax), %rsi
	movq	-8(%rbp), %rax
	movl	16(%rbp), %ecx
	movq	%rax, %rdi
	call	strncpyr
.L13:
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	movb	$0, (%rax)
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	rearrange, .-rearrange
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%72s"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-2981888(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3648, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-2985536(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L15
	movl	$1, %eax
	jmp	.L29
.L15:
	movl	$0, -2985528(%rbp)
	jmp	.L17
.L28:
	movl	$0, -2985532(%rbp)
	leaq	-96(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-96(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -2985508(%rbp)
	movl	$1, -2985524(%rbp)
	jmp	.L18
.L27:
	movl	$0, -2985520(%rbp)
	jmp	.L19
.L26:
	movl	$0, -2985516(%rbp)
	jmp	.L20
.L25:
	movl	-2985516(%rbp), %eax
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	movl	%eax, %r8d
	movl	-2985516(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %r9d
	leaq	-2985504(%rbp), %rcx
	movl	-2985532(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	leaq	(%rcx,%rax), %rdi
	movl	-2985520(%rbp), %esi
	movl	-2985524(%rbp), %ecx
	movl	-2985508(%rbp), %edx
	leaq	-96(%rbp), %rax
	subq	$8, %rsp
	pushq	%r8
	movl	%esi, %r8d
	movq	%rax, %rsi
	call	rearrange
	addq	$16, %rsp
	addl	$1, -2985532(%rbp)
	movl	$0, -2985512(%rbp)
	jmp	.L21
.L24:
	leaq	-2985504(%rbp), %rcx
	movl	-2985512(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rax, %rcx
	movl	-2985532(%rbp), %eax
	subl	$1, %eax
	leaq	-2985504(%rbp), %rsi
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L22
	subl	$1, -2985532(%rbp)
	jmp	.L23
.L22:
	addl	$1, -2985512(%rbp)
.L21:
	movl	-2985532(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -2985512(%rbp)
	jl	.L24
.L23:
	addl	$1, -2985516(%rbp)
.L20:
	cmpl	$3, -2985516(%rbp)
	jle	.L25
	addl	$1, -2985520(%rbp)
.L19:
	cmpl	$1, -2985520(%rbp)
	jle	.L26
	addl	$1, -2985524(%rbp)
.L18:
	movl	-2985524(%rbp), %eax
	cmpl	-2985508(%rbp), %eax
	jl	.L27
	movl	-2985532(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -2985528(%rbp)
.L17:
	movl	-2985536(%rbp), %eax
	cmpl	%eax, -2985528(%rbp)
	jl	.L28
	movl	$0, %eax
.L29:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L30
	call	__stack_chk_fail@PLT
.L30:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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:
