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>

int N;
char S[114514];

int main(void) {
	int i;
	int kita = 0, higasi = 0;
	if (scanf("%d", &N) != 1) return 1;
	if (scanf("%114513s", S) != 1) return 1;
	for (i = 0; i < N; i++) {
		if ('A' <= S[i] && S[i] <=  'M') kita++;
		else if ('N' <= S[i] && S[i] <= 'Z') kita--;
		else if ('a' <= S[i] && S[i] <= 'm') higasi++;
		else if ('n' <= S[i] && S[i] <= 'z') higasi--;
	}
	printf("%d\n", abs(kita) + abs(higasi));
	if (kita > 0) {
		for (i = 0; i < kita; i++) putchar('A');
	} else if (kita < 0) {
		for (i = 0; i > kita; i--) putchar('N');
	}
	if (higasi > 0) {
		for (i = 0; i < higasi; i++) putchar('a');
	} else if (higasi < 0) {
		for (i = 0; i > higasi; i--) putchar('n');
	}
	putchar('\n');
	return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	S
	.align 32
	.type	S, @object
	.size	S, 114514
S:
	.zero	114514
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%114513s"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	$0, -8(%rbp)
	movl	$0, -4(%rbp)
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L2
	movl	$1, %eax
	jmp	.L3
.L2:
	leaq	S(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L4
	movl	$1, %eax
	jmp	.L3
.L4:
	movl	$0, -12(%rbp)
	jmp	.L5
.L10:
	movl	-12(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$64, %al
	jle	.L6
	movl	-12(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$77, %al
	jg	.L6
	addl	$1, -8(%rbp)
	jmp	.L7
.L6:
	movl	-12(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$77, %al
	jle	.L8
	movl	-12(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$90, %al
	jg	.L8
	subl	$1, -8(%rbp)
	jmp	.L7
.L8:
	movl	-12(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$96, %al
	jle	.L9
	movl	-12(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$109, %al
	jg	.L9
	addl	$1, -4(%rbp)
	jmp	.L7
.L9:
	movl	-12(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$109, %al
	jle	.L7
	movl	-12(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$122, %al
	jg	.L7
	subl	$1, -4(%rbp)
.L7:
	addl	$1, -12(%rbp)
.L5:
	movl	N(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L10
	movl	-8(%rbp), %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	movl	%eax, %ecx
	movl	-4(%rbp), %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	addl	%ecx, %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	cmpl	$0, -8(%rbp)
	jle	.L11
	movl	$0, -12(%rbp)
	jmp	.L12
.L13:
	movl	$65, %edi
	call	putchar@PLT
	addl	$1, -12(%rbp)
.L12:
	movl	-12(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jl	.L13
	jmp	.L14
.L11:
	cmpl	$0, -8(%rbp)
	jns	.L14
	movl	$0, -12(%rbp)
	jmp	.L15
.L16:
	movl	$78, %edi
	call	putchar@PLT
	subl	$1, -12(%rbp)
.L15:
	movl	-12(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jg	.L16
.L14:
	cmpl	$0, -4(%rbp)
	jle	.L17
	movl	$0, -12(%rbp)
	jmp	.L18
.L19:
	movl	$97, %edi
	call	putchar@PLT
	addl	$1, -12(%rbp)
.L18:
	movl	-12(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jl	.L19
	jmp	.L20
.L17:
	cmpl	$0, -4(%rbp)
	jns	.L20
	movl	$0, -12(%rbp)
	jmp	.L21
.L22:
	movl	$110, %edi
	call	putchar@PLT
	subl	$1, -12(%rbp)
.L21:
	movl	-12(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jg	.L22
.L20:
	movl	$10, %edi
	call	putchar@PLT
	movl	$0, %eax
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%114513s"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	xorl	%eax, %eax
	leaq	N(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L2
.L4:
	movl	$1, %eax
.L1:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L2:
	.cfi_restore_state
	leaq	S(%rip), %rbx
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rdi
	movq	%rbx, %rsi
	call	__isoc99_scanf@PLT
	subl	$1, %eax
	jne	.L4
	movl	N(%rip), %edx
	testl	%edx, %edx
	jle	.L5
	leaq	1(%rbx), %rsi
	subl	$1, %edx
	movq	%rbx, %rax
	xorl	%ebp, %ebp
	addq	%rdx, %rsi
	xorl	%ebx, %ebx
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L33:
	addl	$1, %ebx
.L7:
	addq	$1, %rax
	cmpq	%rax, %rsi
	je	.L32
.L10:
	movzbl	(%rax), %edx
	leal	-65(%rdx), %ecx
	cmpb	$12, %cl
	jbe	.L33
	leal	-78(%rdx), %ecx
	cmpb	$12, %cl
	ja	.L8
	subl	$1, %ebx
	jmp	.L7
.L8:
	leal	-97(%rdx), %ecx
	cmpb	$12, %cl
	ja	.L9
	addl	$1, %ebp
	jmp	.L7
.L9:
	subl	$110, %edx
	cmpb	$13, %dl
	sbbl	$0, %ebp
	jmp	.L7
.L32:
	movl	%ebx, %edx
	movl	%ebp, %eax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	negl	%edx
	cmovs	%ebx, %edx
	negl	%eax
	cmovs	%ebp, %eax
	addl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	testl	%ebx, %ebx
	jle	.L11
	xorl	%r12d, %r12d
	.p2align 4,,10
	.p2align 3
.L12:
	movq	stdout(%rip), %rsi
	movl	$65, %edi
	addl	$1, %r12d
	call	putc@PLT
	cmpl	%r12d, %ebx
	jne	.L12
.L13:
	testl	%ebp, %ebp
	jle	.L15
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L16:
	movq	stdout(%rip), %rsi
	movl	$97, %edi
	addl	$1, %ebx
	call	putc@PLT
	cmpl	%ebx, %ebp
	jne	.L16
.L17:
	movq	stdout(%rip), %rsi
	movl	$10, %edi
	call	putc@PLT
	xorl	%eax, %eax
	jmp	.L1
.L11:
	je	.L13
	xorl	%r12d, %r12d
.L14:
	movq	stdout(%rip), %rsi
	movl	$78, %edi
	subl	$1, %r12d
	call	putc@PLT
	cmpl	%r12d, %ebx
	jl	.L14
	jmp	.L13
.L15:
	je	.L17
	xorl	%ebx, %ebx
.L18:
	movq	stdout(%rip), %rsi
	movl	$110, %edi
	subl	$1, %ebx
	call	putc@PLT
	cmpl	%ebx, %ebp
	jl	.L18
	jmp	.L17
.L5:
	xorl	%edx, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L17
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.globl	S
	.bss
	.align 32
	.type	S, @object
	.size	S, 114514
S:
	.zero	114514
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%114513s"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	xorl	%eax, %eax
	leaq	N(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L2
.L4:
	movl	$1, %eax
.L1:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L2:
	.cfi_restore_state
	leaq	S(%rip), %rbx
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rdi
	movq	%rbx, %rsi
	call	__isoc99_scanf@PLT
	subl	$1, %eax
	jne	.L4
	movl	N(%rip), %edx
	testl	%edx, %edx
	jle	.L5
	leaq	1(%rbx), %rsi
	subl	$1, %edx
	movq	%rbx, %rax
	xorl	%ebp, %ebp
	addq	%rdx, %rsi
	xorl	%ebx, %ebx
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L33:
	addl	$1, %ebx
.L7:
	addq	$1, %rax
	cmpq	%rax, %rsi
	je	.L32
.L10:
	movzbl	(%rax), %edx
	leal	-65(%rdx), %ecx
	cmpb	$12, %cl
	jbe	.L33
	leal	-78(%rdx), %ecx
	cmpb	$12, %cl
	ja	.L8
	subl	$1, %ebx
	jmp	.L7
.L8:
	leal	-97(%rdx), %ecx
	cmpb	$12, %cl
	ja	.L9
	addl	$1, %ebp
	jmp	.L7
.L9:
	subl	$110, %edx
	cmpb	$13, %dl
	sbbl	$0, %ebp
	jmp	.L7
.L32:
	movl	%ebx, %edx
	movl	%ebp, %eax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	negl	%edx
	cmovs	%ebx, %edx
	negl	%eax
	cmovs	%ebp, %eax
	addl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	testl	%ebx, %ebx
	jle	.L11
	xorl	%r12d, %r12d
	.p2align 4,,10
	.p2align 3
.L12:
	movq	stdout(%rip), %rsi
	movl	$65, %edi
	addl	$1, %r12d
	call	putc@PLT
	cmpl	%r12d, %ebx
	jne	.L12
.L13:
	testl	%ebp, %ebp
	jle	.L15
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L16:
	movq	stdout(%rip), %rsi
	movl	$97, %edi
	addl	$1, %ebx
	call	putc@PLT
	cmpl	%ebx, %ebp
	jne	.L16
.L17:
	movq	stdout(%rip), %rsi
	movl	$10, %edi
	call	putc@PLT
	xorl	%eax, %eax
	jmp	.L1
.L11:
	je	.L13
	xorl	%r12d, %r12d
.L14:
	movq	stdout(%rip), %rsi
	movl	$78, %edi
	subl	$1, %r12d
	call	putc@PLT
	cmpl	%r12d, %ebx
	jl	.L14
	jmp	.L13
.L15:
	je	.L17
	xorl	%ebx, %ebx
.L18:
	movq	stdout(%rip), %rsi
	movl	$110, %edi
	subl	$1, %ebx
	call	putc@PLT
	cmpl	%ebx, %ebp
	jl	.L18
	jmp	.L17
.L5:
	xorl	%edx, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L17
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.globl	S
	.bss
	.align 32
	.type	S, @object
	.size	S, 114514
S:
	.zero	114514
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.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>

int N;
char S[114514];

int main(void) {
	int i;
	int kita = 0, higasi = 0;
	if (scanf("%d", &N) != 1) return 1;
	if (scanf("%114513s", S) != 1) return 1;
	for (i = 0; i < N; i++) {
		if ('A' <= S[i] && S[i] <=  'M') kita++;
		else if ('N' <= S[i] && S[i] <= 'Z') kita--;
		else if ('a' <= S[i] && S[i] <= 'm') higasi++;
		else if ('n' <= S[i] && S[i] <= 'z') higasi--;
	}
	printf("%d\n", abs(kita) + abs(higasi));
	if (kita > 0) {
		for (i = 0; i < kita; i++) putchar('A');
	} else if (kita < 0) {
		for (i = 0; i > kita; i--) putchar('N');
	}
	if (higasi > 0) {
		for (i = 0; i < higasi; i++) putchar('a');
	} else if (higasi < 0) {
		for (i = 0; i > higasi; i--) putchar('n');
	}
	putchar('\n');
	return 0;
}


5
AzaNA
 5
AMazA
 5
zAaNA
 5
AzaAN
 5
zAaNB
 5
AMAza
 5
AzaBN
 5
zAaNC
 5
AMBza
 5
NBazA

1
A
 3
AAA
 1
A
 1
A
 1
A
 3
AAA
 1
A
 1
A
 3
AAA
 1
A

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>

int N;
char S[114514];

int main(void) {
	int i;
	int kita = 0, higasi = 0;
	if (scanf("%d", &N) != 1) return 1;
	if (scanf("%114513s", S) != 1) return 1;
	for (i = 0; i < N; i++) {
		if ('A' <= S[i] && S[i] <=  'M') kita++;
		else if ('N' <= S[i] && S[i] <= 'Z') kita--;
		else if ('a' <= S[i] && S[i] <= 'm') higasi++;
		else if ('n' <= S[i] && S[i] <= 'z') higasi--;
	}
	printf("%d\n", abs(kita) + abs(higasi));
	if (kita > 0) {
		for (i = 0; i < kita; i++) putchar('A');
	} else if (kita < 0) {
		for (i = 0; i > kita; i--) putchar('N');
	}
	if (higasi > 0) {
		for (i = 0; i < higasi; i++) putchar('a');
	} else if (higasi < 0) {
		for (i = 0; i > higasi; i--) putchar('n');
	}
	putchar('\n');
	return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	S
	.align 32
	.type	S, @object
	.size	S, 114514
S:
	.zero	114514
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%114513s"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	$0, -8(%rbp)
	movl	$0, -4(%rbp)
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L2
	movl	$1, %eax
	jmp	.L3
.L2:
	leaq	S(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L4
	movl	$1, %eax
	jmp	.L3
.L4:
	movl	$0, -12(%rbp)
	jmp	.L5
.L10:
	movl	-12(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$64, %al
	jle	.L6
	movl	-12(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$77, %al
	jg	.L6
	addl	$1, -8(%rbp)
	jmp	.L7
.L6:
	movl	-12(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$77, %al
	jle	.L8
	movl	-12(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$90, %al
	jg	.L8
	subl	$1, -8(%rbp)
	jmp	.L7
.L8:
	movl	-12(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$96, %al
	jle	.L9
	movl	-12(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$109, %al
	jg	.L9
	addl	$1, -4(%rbp)
	jmp	.L7
.L9:
	movl	-12(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$109, %al
	jle	.L7
	movl	-12(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$122, %al
	jg	.L7
	subl	$1, -4(%rbp)
.L7:
	addl	$1, -12(%rbp)
.L5:
	movl	N(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L10
	movl	-8(%rbp), %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	movl	%eax, %ecx
	movl	-4(%rbp), %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	addl	%ecx, %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	cmpl	$0, -8(%rbp)
	jle	.L11
	movl	$0, -12(%rbp)
	jmp	.L12
.L13:
	movl	$65, %edi
	call	putchar@PLT
	addl	$1, -12(%rbp)
.L12:
	movl	-12(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jl	.L13
	jmp	.L14
.L11:
	cmpl	$0, -8(%rbp)
	jns	.L14
	movl	$0, -12(%rbp)
	jmp	.L15
.L16:
	movl	$78, %edi
	call	putchar@PLT
	subl	$1, -12(%rbp)
.L15:
	movl	-12(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jg	.L16
.L14:
	cmpl	$0, -4(%rbp)
	jle	.L17
	movl	$0, -12(%rbp)
	jmp	.L18
.L19:
	movl	$97, %edi
	call	putchar@PLT
	addl	$1, -12(%rbp)
.L18:
	movl	-12(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jl	.L19
	jmp	.L20
.L17:
	cmpl	$0, -4(%rbp)
	jns	.L20
	movl	$0, -12(%rbp)
	jmp	.L21
.L22:
	movl	$110, %edi
	call	putchar@PLT
	subl	$1, -12(%rbp)
.L21:
	movl	-12(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jg	.L22
.L20:
	movl	$10, %edi
	call	putchar@PLT
	movl	$0, %eax
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	S
	.align 32
	.type	S, @object
	.size	S, 114514
S:
	.zero	114514
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%114513s"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	$0, -8(%rbp)
	movl	$0, -4(%rbp)
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L2
	movl	$1, %eax
	jmp	.L3
.L2:
	leaq	S(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L4
	movl	$1, %eax
	jmp	.L3
.L4:
	movl	$0, -12(%rbp)
	jmp	.L5
.L10:
	movl	-12(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$64, %al
	jle	.L6
	movl	-12(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$77, %al
	jg	.L6
	addl	$1, -8(%rbp)
	jmp	.L7
.L6:
	movl	-12(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$77, %al
	jle	.L8
	movl	-12(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$90, %al
	jg	.L8
	subl	$1, -8(%rbp)
	jmp	.L7
.L8:
	movl	-12(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$96, %al
	jle	.L9
	movl	-12(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$109, %al
	jg	.L9
	addl	$1, -4(%rbp)
	jmp	.L7
.L9:
	movl	-12(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$109, %al
	jle	.L7
	movl	-12(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$122, %al
	jg	.L7
	subl	$1, -4(%rbp)
.L7:
	addl	$1, -12(%rbp)
.L5:
	movl	N(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L10
	movl	-8(%rbp), %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	movl	%eax, %ecx
	movl	-4(%rbp), %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	addl	%ecx, %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	cmpl	$0, -8(%rbp)
	jle	.L11
	movl	$0, -12(%rbp)
	jmp	.L12
.L13:
	movl	$65, %edi
	call	putchar@PLT
	addl	$1, -12(%rbp)
.L12:
	movl	-12(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jl	.L13
	jmp	.L14
.L11:
	cmpl	$0, -8(%rbp)
	jns	.L14
	movl	$0, -12(%rbp)
	jmp	.L15
.L16:
	movl	$78, %edi
	call	putchar@PLT
	subl	$1, -12(%rbp)
.L15:
	movl	-12(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jg	.L16
.L14:
	cmpl	$0, -4(%rbp)
	jle	.L17
	movl	$0, -12(%rbp)
	jmp	.L18
.L19:
	movl	$97, %edi
	call	putchar@PLT
	addl	$1, -12(%rbp)
.L18:
	movl	-12(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jl	.L19
	jmp	.L20
.L17:
	cmpl	$0, -4(%rbp)
	jns	.L20
	movl	$0, -12(%rbp)
	jmp	.L21
.L22:
	movl	$110, %edi
	call	putchar@PLT
	subl	$1, -12(%rbp)
.L21:
	movl	-12(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jg	.L22
.L20:
	movl	$10, %edi
	call	putchar@PLT
	movl	$0, %eax
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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:
