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<stdint.h>
#include<inttypes.h>
#include<string.h>
#include<math.h>

typedef int32_t i32;
typedef int64_t i64;

#define MAX(a,b) ((a) > (b) ? (a) : (b))
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define ABS(a) ((a) > (0) ? (a) : -(a))
#define ALLOC(size,type) ((type*) calloc ((size), sizeof (type)))

void run (void) {
  i32 n, m;
  scanf ("%" SCNi32 "%" SCNi32, &n, &m);
  i32 *cnt = ALLOC (n + 1, i32);
  char *s = ALLOC (n + 1, char);
  for (i32 i = 0; i < m; ++i) {
    scanf ("%s", s);
    for (i32 j = 0; j < n; ++j) {
      cnt[j] += s[j] == 'E' ? 1 : 0;
    }
  }
  for (i32 i = n - 1; i >= 0; --i) {
    cnt[i] += cnt[i + 1];
  }
  i32 min_index = 0;
  i32 min = n * m - cnt[0];
  for (i32 i = 1; i <= n; ++i) {
    i32 v = (n - i) * m - cnt[i] + (cnt[0] - cnt[i]);
    if (v < min) {
      min = v;
      min_index = i;
    }
  }
  printf ("%" PRIi32 " %" PRIi32 "\n", min_index, min_index + 1);
}

int main (void) {
  run();
  return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%i%i"
.LC1:
	.string	"%s"
.LC2:
	.string	"%i %i\n"
	.text
	.globl	run
	.type	run, @function
run:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-56(%rbp), %rdx
	leaq	-60(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -24(%rbp)
	movl	-60(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	$1, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -16(%rbp)
	movl	$0, -52(%rbp)
	jmp	.L2
.L5:
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -48(%rbp)
	jmp	.L3
.L4:
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %ecx
	movl	-48(%rbp), %eax
	movslq	%eax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$69, %al
	sete	%al
	movzbl	%al, %edx
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rsi
	movq	-24(%rbp), %rax
	addq	%rsi, %rax
	addl	%ecx, %edx
	movl	%edx, (%rax)
	addl	$1, -48(%rbp)
.L3:
	movl	-60(%rbp), %eax
	cmpl	%eax, -48(%rbp)
	jl	.L4
	addl	$1, -52(%rbp)
.L2:
	movl	-56(%rbp), %eax
	cmpl	%eax, -52(%rbp)
	jl	.L5
	movl	-60(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -44(%rbp)
	jmp	.L6
.L7:
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %ecx
	movl	-44(%rbp), %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rsi
	movq	-24(%rbp), %rax
	addq	%rsi, %rax
	addl	%ecx, %edx
	movl	%edx, (%rax)
	subl	$1, -44(%rbp)
.L6:
	cmpl	$0, -44(%rbp)
	jns	.L7
	movl	$0, -40(%rbp)
	movl	-60(%rbp), %edx
	movl	-56(%rbp), %eax
	imull	%eax, %edx
	movq	-24(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -36(%rbp)
	movl	$1, -32(%rbp)
	jmp	.L8
.L10:
	movl	-60(%rbp), %eax
	subl	-32(%rbp), %eax
	movl	%eax, %edx
	movl	-56(%rbp), %eax
	imull	%edx, %eax
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rdx), %edx
	subl	%edx, %eax
	movl	%eax, %ecx
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rsi
	movq	-24(%rbp), %rdx
	addq	%rsi, %rdx
	movl	(%rdx), %edx
	subl	%edx, %eax
	addl	%ecx, %eax
	movl	%eax, -28(%rbp)
	movl	-28(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jge	.L9
	movl	-28(%rbp), %eax
	movl	%eax, -36(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -40(%rbp)
.L9:
	addl	$1, -32(%rbp)
.L8:
	movl	-60(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jle	.L10
	movl	-40(%rbp), %eax
	leal	1(%rax), %edx
	movl	-40(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	run, .-run
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	call	run
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%i%i"
.LC1:
	.string	"%s"
.LC4:
	.string	"%i %i\n"
	.text
	.p2align 4
	.globl	run
	.type	run, @function
run:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movl	(%rsp), %ebp
	movl	$4, %esi
	leal	1(%rbp), %r12d
	movslq	%r12d, %r12
	movq	%r12, %rdi
	call	calloc@PLT
	movl	$1, %esi
	movq	%r12, %rdi
	movq	%rax, %rbx
	call	calloc@PLT
	movl	4(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L2
	movq	%rax, %r13
	xorl	%r14d, %r14d
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L4:
	xorl	%eax, %eax
	movq	%r13, %rsi
	movq	%r12, %rdi
	call	__isoc99_scanf@PLT
	movl	(%rsp), %ebp
	pxor	%xmm4, %xmm4
	movdqa	.LC2(%rip), %xmm6
	movdqa	.LC3(%rip), %xmm5
	testl	%ebp, %ebp
	jle	.L8
	leal	-1(%rbp), %eax
	cmpl	$14, %eax
	jbe	.L18
	movl	%ebp, %ecx
	movq	%r13, %rdx
	pxor	%xmm2, %xmm2
	movq	%rbx, %rax
	shrl	$4, %ecx
	salq	$4, %rcx
	addq	%r13, %rcx
	.p2align 4,,10
	.p2align 3
.L6:
	movdqu	(%rdx), %xmm0
	movdqu	(%rax), %xmm7
	addq	$16, %rdx
	addq	$64, %rax
	pcmpeqb	%xmm6, %xmm0
	pand	%xmm5, %xmm0
	movdqa	%xmm0, %xmm1
	punpckhbw	%xmm4, %xmm0
	punpcklbw	%xmm4, %xmm1
	movdqa	%xmm1, %xmm3
	punpckhwd	%xmm2, %xmm1
	punpcklwd	%xmm2, %xmm3
	paddd	%xmm7, %xmm3
	movdqu	-48(%rax), %xmm7
	movups	%xmm3, -64(%rax)
	paddd	%xmm7, %xmm1
	movdqu	-32(%rax), %xmm7
	movups	%xmm1, -48(%rax)
	movdqa	%xmm0, %xmm1
	punpckhwd	%xmm2, %xmm0
	punpcklwd	%xmm2, %xmm1
	paddd	%xmm7, %xmm1
	movdqu	-16(%rax), %xmm7
	movups	%xmm1, -32(%rax)
	paddd	%xmm7, %xmm0
	movups	%xmm0, -16(%rax)
	cmpq	%rcx, %rdx
	jne	.L6
	movl	%ebp, %edx
	andl	$-16, %edx
	testb	$15, %bpl
	je	.L8
.L5:
	movslq	%edx, %rcx
	cmpb	$69, 0(%r13,%rcx)
	leaq	0(,%rcx,4), %rax
	sete	%cl
	movzbl	%cl, %ecx
	addl	%ecx, (%rbx,%rax)
	leal	1(%rdx), %ecx
	cmpl	%ebp, %ecx
	jge	.L8
	movslq	%ecx, %rcx
	cmpb	$69, 0(%r13,%rcx)
	sete	%cl
	movzbl	%cl, %ecx
	addl	%ecx, 4(%rbx,%rax)
	leal	2(%rdx), %ecx
	cmpl	%ecx, %ebp
	jle	.L8
	movslq	%ecx, %rcx
	cmpb	$69, 0(%r13,%rcx)
	sete	%cl
	movzbl	%cl, %ecx
	addl	%ecx, 8(%rbx,%rax)
	leal	3(%rdx), %ecx
	cmpl	%ecx, %ebp
	jle	.L8
	movslq	%ecx, %rcx
	cmpb	$69, 0(%r13,%rcx)
	sete	%cl
	movzbl	%cl, %ecx
	addl	%ecx, 12(%rbx,%rax)
	leal	4(%rdx), %ecx
	cmpl	%ecx, %ebp
	jle	.L8
	movslq	%ecx, %rcx
	cmpb	$69, 0(%r13,%rcx)
	sete	%cl
	movzbl	%cl, %ecx
	addl	%ecx, 16(%rbx,%rax)
	leal	5(%rdx), %ecx
	cmpl	%ecx, %ebp
	jle	.L8
	movslq	%ecx, %rcx
	cmpb	$69, 0(%r13,%rcx)
	sete	%cl
	movzbl	%cl, %ecx
	addl	%ecx, 20(%rbx,%rax)
	leal	6(%rdx), %ecx
	cmpl	%ecx, %ebp
	jle	.L8
	movslq	%ecx, %rcx
	cmpb	$69, 0(%r13,%rcx)
	sete	%cl
	movzbl	%cl, %ecx
	addl	%ecx, 24(%rbx,%rax)
	leal	7(%rdx), %ecx
	cmpl	%ecx, %ebp
	jle	.L8
	movslq	%ecx, %rcx
	cmpb	$69, 0(%r13,%rcx)
	sete	%cl
	movzbl	%cl, %ecx
	addl	%ecx, 28(%rbx,%rax)
	leal	8(%rdx), %ecx
	cmpl	%ecx, %ebp
	jle	.L8
	movslq	%ecx, %rcx
	cmpb	$69, 0(%r13,%rcx)
	sete	%cl
	movzbl	%cl, %ecx
	addl	%ecx, 32(%rbx,%rax)
	leal	9(%rdx), %ecx
	cmpl	%ecx, %ebp
	jle	.L8
	movslq	%ecx, %rcx
	cmpb	$69, 0(%r13,%rcx)
	sete	%cl
	movzbl	%cl, %ecx
	addl	%ecx, 36(%rbx,%rax)
	leal	10(%rdx), %ecx
	cmpl	%ecx, %ebp
	jle	.L8
	movslq	%ecx, %rcx
	cmpb	$69, 0(%r13,%rcx)
	sete	%cl
	movzbl	%cl, %ecx
	addl	%ecx, 40(%rbx,%rax)
	leal	11(%rdx), %ecx
	cmpl	%ecx, %ebp
	jle	.L8
	movslq	%ecx, %rcx
	cmpb	$69, 0(%r13,%rcx)
	sete	%cl
	movzbl	%cl, %ecx
	addl	%ecx, 44(%rbx,%rax)
	leal	12(%rdx), %ecx
	cmpl	%ecx, %ebp
	jle	.L8
	movslq	%ecx, %rcx
	cmpb	$69, 0(%r13,%rcx)
	sete	%cl
	movzbl	%cl, %ecx
	addl	%ecx, 48(%rbx,%rax)
	leal	13(%rdx), %ecx
	cmpl	%ecx, %ebp
	jle	.L8
	movslq	%ecx, %rcx
	cmpb	$69, 0(%r13,%rcx)
	sete	%cl
	addl	$14, %edx
	movzbl	%cl, %ecx
	addl	%ecx, 52(%rbx,%rax)
	cmpl	%edx, %ebp
	jle	.L8
	movslq	%edx, %rdx
	cmpb	$69, 0(%r13,%rdx)
	sete	%dl
	movzbl	%dl, %edx
	addl	%edx, 56(%rbx,%rax)
	.p2align 4,,10
	.p2align 3
.L8:
	movl	4(%rsp), %ecx
	addl	$1, %r14d
	cmpl	%r14d, %ecx
	jg	.L4
.L2:
	movl	%ebp, %eax
	subl	$1, %eax
	js	.L14
	movslq	%ebp, %rdx
	cltq
	movl	(%rbx,%rdx,4), %edx
	.p2align 4,,10
	.p2align 3
.L13:
	addl	(%rbx,%rax,4), %edx
	movl	%edx, (%rbx,%rax,4)
	subq	$1, %rax
	testl	%eax, %eax
	jns	.L13
.L14:
	movl	%ecx, %esi
	movl	(%rbx), %r9d
	imull	%ebp, %esi
	movl	%esi, %r8d
	subl	%r9d, %r8d
	testl	%ebp, %ebp
	jle	.L26
	subl	%ecx, %esi
	leal	1(%rbp), %r10d
	movl	$1, %eax
	xorl	%r11d, %r11d
	.p2align 4,,10
	.p2align 3
.L16:
	movl	%r9d, %edx
	movl	%esi, %edi
	subl	(%rbx,%rax,4), %edx
	subl	(%rbx,%rax,4), %edi
	addl	%edi, %edx
	cmpl	%r8d, %edx
	jge	.L15
	movl	%edx, %r8d
	movl	%eax, %r11d
.L15:
	addq	$1, %rax
	subl	%ecx, %esi
	cmpq	%r10, %rax
	jne	.L16
	leal	1(%r11), %ecx
.L12:
	xorl	%eax, %eax
	movl	%r11d, %edx
	movl	$1, %edi
	leaq	.LC4(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L27
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L18:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L5
.L26:
	movl	$1, %ecx
	xorl	%r11d, %r11d
	jmp	.L12
.L27:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.size	run, .-run
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	call	run
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE52:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC2:
	.byte	69
	.byte	69
	.byte	69
	.byte	69
	.byte	69
	.byte	69
	.byte	69
	.byte	69
	.byte	69
	.byte	69
	.byte	69
	.byte	69
	.byte	69
	.byte	69
	.byte	69
	.byte	69
	.align 16
.LC3:
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.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	"%i%i"
.LC1:
	.string	"%s"
.LC4:
	.string	"%i %i\n"
	.text
	.p2align 4
	.globl	run
	.type	run, @function
run:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movl	(%rsp), %ebp
	movl	$4, %esi
	leal	1(%rbp), %r12d
	movslq	%r12d, %r12
	movq	%r12, %rdi
	call	calloc@PLT
	movl	$1, %esi
	movq	%r12, %rdi
	movq	%rax, %rbx
	call	calloc@PLT
	movl	4(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L2
	movq	%rax, %r13
	xorl	%r14d, %r14d
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L4:
	xorl	%eax, %eax
	movq	%r13, %rsi
	movq	%r12, %rdi
	call	__isoc99_scanf@PLT
	movl	(%rsp), %ebp
	pxor	%xmm4, %xmm4
	movdqa	.LC2(%rip), %xmm6
	movdqa	.LC3(%rip), %xmm5
	testl	%ebp, %ebp
	jle	.L8
	leal	-1(%rbp), %eax
	cmpl	$14, %eax
	jbe	.L18
	movl	%ebp, %ecx
	movq	%r13, %rdx
	pxor	%xmm2, %xmm2
	movq	%rbx, %rax
	shrl	$4, %ecx
	salq	$4, %rcx
	addq	%r13, %rcx
	.p2align 4,,10
	.p2align 3
.L6:
	movdqu	(%rdx), %xmm0
	movdqu	(%rax), %xmm7
	addq	$16, %rdx
	addq	$64, %rax
	pcmpeqb	%xmm6, %xmm0
	pand	%xmm5, %xmm0
	movdqa	%xmm0, %xmm1
	punpckhbw	%xmm4, %xmm0
	punpcklbw	%xmm4, %xmm1
	movdqa	%xmm1, %xmm3
	punpckhwd	%xmm2, %xmm1
	punpcklwd	%xmm2, %xmm3
	paddd	%xmm7, %xmm3
	movdqu	-48(%rax), %xmm7
	movups	%xmm3, -64(%rax)
	paddd	%xmm7, %xmm1
	movdqu	-32(%rax), %xmm7
	movups	%xmm1, -48(%rax)
	movdqa	%xmm0, %xmm1
	punpckhwd	%xmm2, %xmm0
	punpcklwd	%xmm2, %xmm1
	paddd	%xmm7, %xmm1
	movdqu	-16(%rax), %xmm7
	movups	%xmm1, -32(%rax)
	paddd	%xmm7, %xmm0
	movups	%xmm0, -16(%rax)
	cmpq	%rcx, %rdx
	jne	.L6
	movl	%ebp, %edx
	andl	$-16, %edx
	testb	$15, %bpl
	je	.L8
.L5:
	movslq	%edx, %rcx
	cmpb	$69, 0(%r13,%rcx)
	leaq	0(,%rcx,4), %rax
	sete	%cl
	movzbl	%cl, %ecx
	addl	%ecx, (%rbx,%rax)
	leal	1(%rdx), %ecx
	cmpl	%ebp, %ecx
	jge	.L8
	movslq	%ecx, %rcx
	cmpb	$69, 0(%r13,%rcx)
	sete	%cl
	movzbl	%cl, %ecx
	addl	%ecx, 4(%rbx,%rax)
	leal	2(%rdx), %ecx
	cmpl	%ecx, %ebp
	jle	.L8
	movslq	%ecx, %rcx
	cmpb	$69, 0(%r13,%rcx)
	sete	%cl
	movzbl	%cl, %ecx
	addl	%ecx, 8(%rbx,%rax)
	leal	3(%rdx), %ecx
	cmpl	%ecx, %ebp
	jle	.L8
	movslq	%ecx, %rcx
	cmpb	$69, 0(%r13,%rcx)
	sete	%cl
	movzbl	%cl, %ecx
	addl	%ecx, 12(%rbx,%rax)
	leal	4(%rdx), %ecx
	cmpl	%ecx, %ebp
	jle	.L8
	movslq	%ecx, %rcx
	cmpb	$69, 0(%r13,%rcx)
	sete	%cl
	movzbl	%cl, %ecx
	addl	%ecx, 16(%rbx,%rax)
	leal	5(%rdx), %ecx
	cmpl	%ecx, %ebp
	jle	.L8
	movslq	%ecx, %rcx
	cmpb	$69, 0(%r13,%rcx)
	sete	%cl
	movzbl	%cl, %ecx
	addl	%ecx, 20(%rbx,%rax)
	leal	6(%rdx), %ecx
	cmpl	%ecx, %ebp
	jle	.L8
	movslq	%ecx, %rcx
	cmpb	$69, 0(%r13,%rcx)
	sete	%cl
	movzbl	%cl, %ecx
	addl	%ecx, 24(%rbx,%rax)
	leal	7(%rdx), %ecx
	cmpl	%ecx, %ebp
	jle	.L8
	movslq	%ecx, %rcx
	cmpb	$69, 0(%r13,%rcx)
	sete	%cl
	movzbl	%cl, %ecx
	addl	%ecx, 28(%rbx,%rax)
	leal	8(%rdx), %ecx
	cmpl	%ecx, %ebp
	jle	.L8
	movslq	%ecx, %rcx
	cmpb	$69, 0(%r13,%rcx)
	sete	%cl
	movzbl	%cl, %ecx
	addl	%ecx, 32(%rbx,%rax)
	leal	9(%rdx), %ecx
	cmpl	%ecx, %ebp
	jle	.L8
	movslq	%ecx, %rcx
	cmpb	$69, 0(%r13,%rcx)
	sete	%cl
	movzbl	%cl, %ecx
	addl	%ecx, 36(%rbx,%rax)
	leal	10(%rdx), %ecx
	cmpl	%ecx, %ebp
	jle	.L8
	movslq	%ecx, %rcx
	cmpb	$69, 0(%r13,%rcx)
	sete	%cl
	movzbl	%cl, %ecx
	addl	%ecx, 40(%rbx,%rax)
	leal	11(%rdx), %ecx
	cmpl	%ecx, %ebp
	jle	.L8
	movslq	%ecx, %rcx
	cmpb	$69, 0(%r13,%rcx)
	sete	%cl
	movzbl	%cl, %ecx
	addl	%ecx, 44(%rbx,%rax)
	leal	12(%rdx), %ecx
	cmpl	%ecx, %ebp
	jle	.L8
	movslq	%ecx, %rcx
	cmpb	$69, 0(%r13,%rcx)
	sete	%cl
	movzbl	%cl, %ecx
	addl	%ecx, 48(%rbx,%rax)
	leal	13(%rdx), %ecx
	cmpl	%ecx, %ebp
	jle	.L8
	movslq	%ecx, %rcx
	cmpb	$69, 0(%r13,%rcx)
	sete	%cl
	addl	$14, %edx
	movzbl	%cl, %ecx
	addl	%ecx, 52(%rbx,%rax)
	cmpl	%edx, %ebp
	jle	.L8
	movslq	%edx, %rdx
	cmpb	$69, 0(%r13,%rdx)
	sete	%dl
	movzbl	%dl, %edx
	addl	%edx, 56(%rbx,%rax)
	.p2align 4,,10
	.p2align 3
.L8:
	movl	4(%rsp), %ecx
	addl	$1, %r14d
	cmpl	%r14d, %ecx
	jg	.L4
.L2:
	movl	%ebp, %eax
	subl	$1, %eax
	js	.L14
	movslq	%ebp, %rdx
	cltq
	movl	(%rbx,%rdx,4), %edx
	.p2align 4,,10
	.p2align 3
.L13:
	addl	(%rbx,%rax,4), %edx
	movl	%edx, (%rbx,%rax,4)
	subq	$1, %rax
	testl	%eax, %eax
	jns	.L13
.L14:
	movl	%ecx, %esi
	movl	(%rbx), %r9d
	imull	%ebp, %esi
	movl	%esi, %r8d
	subl	%r9d, %r8d
	testl	%ebp, %ebp
	jle	.L26
	subl	%ecx, %esi
	leal	1(%rbp), %r10d
	movl	$1, %eax
	xorl	%r11d, %r11d
	.p2align 4,,10
	.p2align 3
.L16:
	movl	%r9d, %edx
	movl	%esi, %edi
	subl	(%rbx,%rax,4), %edx
	subl	(%rbx,%rax,4), %edi
	addl	%edi, %edx
	cmpl	%r8d, %edx
	jge	.L15
	movl	%edx, %r8d
	movl	%eax, %r11d
.L15:
	addq	$1, %rax
	subl	%ecx, %esi
	cmpq	%r10, %rax
	jne	.L16
	leal	1(%r11), %ecx
.L12:
	xorl	%eax, %eax
	movl	%r11d, %edx
	movl	$1, %edi
	leaq	.LC4(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L27
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L18:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L5
.L26:
	movl	$1, %ecx
	xorl	%r11d, %r11d
	jmp	.L12
.L27:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.size	run, .-run
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	call	run
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE52:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC2:
	.byte	69
	.byte	69
	.byte	69
	.byte	69
	.byte	69
	.byte	69
	.byte	69
	.byte	69
	.byte	69
	.byte	69
	.byte	69
	.byte	69
	.byte	69
	.byte	69
	.byte	69
	.byte	69
	.align 16
.LC3:
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.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<stdint.h>
#include<inttypes.h>
#include<string.h>
#include<math.h>

typedef int32_t i32;
typedef int64_t i64;

#define MAX(a,b) ((a) > (b) ? (a) : (b))
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define ABS(a) ((a) > (0) ? (a) : -(a))
#define ALLOC(size,type) ((type*) calloc ((size), sizeof (type)))

void run (void) {
  i32 n, m;
  scanf ("%" SCNi32 "%" SCNi32, &n, &m);
  i32 *cnt = ALLOC (n + 1, i32);
  char *s = ALLOC (n + 1, char);
  for (i32 i = 0; i < m; ++i) {
    scanf ("%s", s);
    for (i32 j = 0; j < n; ++j) {
      cnt[j] += s[j] == 'E' ? 1 : 0;
    }
  }
  for (i32 i = n - 1; i >= 0; --i) {
    cnt[i] += cnt[i + 1];
  }
  i32 min_index = 0;
  i32 min = n * m - cnt[0];
  for (i32 i = 1; i <= n; ++i) {
    i32 v = (n - i) * m - cnt[i] + (cnt[0] - cnt[i]);
    if (v < min) {
      min = v;
      min_index = i;
    }
  }
  printf ("%" PRIi32 " %" PRIi32 "\n", min_index, min_index + 1);
}

int main (void) {
  run();
  return 0;
}


3 1
WE
 3 0
WE
 1 1
WE
 1 0
WE
 2 0
WE
 4 0
WE
 3 0
EW
 1 0
EW
 2 1
EW
 4 0
EW

1 2
 0 1
 1 2
 0 1
 0 1
 0 1
 0 1
 0 1
 0 1
 0 1

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<stdint.h>
#include<inttypes.h>
#include<string.h>
#include<math.h>

typedef int32_t i32;
typedef int64_t i64;

#define MAX(a,b) ((a) > (b) ? (a) : (b))
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define ABS(a) ((a) > (0) ? (a) : -(a))
#define ALLOC(size,type) ((type*) calloc ((size), sizeof (type)))

void run (void) {
  i32 n, m;
  scanf ("%" SCNi32 "%" SCNi32, &n, &m);
  i32 *cnt = ALLOC (n + 1, i32);
  char *s = ALLOC (n + 1, char);
  for (i32 i = 0; i < m; ++i) {
    scanf ("%s", s);
    for (i32 j = 0; j < n; ++j) {
      cnt[j] += s[j] == 'E' ? 1 : 0;
    }
  }
  for (i32 i = n - 1; i >= 0; --i) {
    cnt[i] += cnt[i + 1];
  }
  i32 min_index = 0;
  i32 min = n * m - cnt[0];
  for (i32 i = 1; i <= n; ++i) {
    i32 v = (n - i) * m - cnt[i] + (cnt[0] - cnt[i]);
    if (v < min) {
      min = v;
      min_index = i;
    }
  }
  printf ("%" PRIi32 " %" PRIi32 "\n", min_index, min_index + 1);
}

int main (void) {
  run();
  return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%i%i"
.LC1:
	.string	"%s"
.LC2:
	.string	"%i %i\n"
	.text
	.globl	run
	.type	run, @function
run:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-56(%rbp), %rdx
	leaq	-60(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -24(%rbp)
	movl	-60(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	$1, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -16(%rbp)
	movl	$0, -52(%rbp)
	jmp	.L2
.L5:
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -48(%rbp)
	jmp	.L3
.L4:
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %ecx
	movl	-48(%rbp), %eax
	movslq	%eax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$69, %al
	sete	%al
	movzbl	%al, %edx
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rsi
	movq	-24(%rbp), %rax
	addq	%rsi, %rax
	addl	%ecx, %edx
	movl	%edx, (%rax)
	addl	$1, -48(%rbp)
.L3:
	movl	-60(%rbp), %eax
	cmpl	%eax, -48(%rbp)
	jl	.L4
	addl	$1, -52(%rbp)
.L2:
	movl	-56(%rbp), %eax
	cmpl	%eax, -52(%rbp)
	jl	.L5
	movl	-60(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -44(%rbp)
	jmp	.L6
.L7:
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %ecx
	movl	-44(%rbp), %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rsi
	movq	-24(%rbp), %rax
	addq	%rsi, %rax
	addl	%ecx, %edx
	movl	%edx, (%rax)
	subl	$1, -44(%rbp)
.L6:
	cmpl	$0, -44(%rbp)
	jns	.L7
	movl	$0, -40(%rbp)
	movl	-60(%rbp), %edx
	movl	-56(%rbp), %eax
	imull	%eax, %edx
	movq	-24(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -36(%rbp)
	movl	$1, -32(%rbp)
	jmp	.L8
.L10:
	movl	-60(%rbp), %eax
	subl	-32(%rbp), %eax
	movl	%eax, %edx
	movl	-56(%rbp), %eax
	imull	%edx, %eax
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rdx), %edx
	subl	%edx, %eax
	movl	%eax, %ecx
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rsi
	movq	-24(%rbp), %rdx
	addq	%rsi, %rdx
	movl	(%rdx), %edx
	subl	%edx, %eax
	addl	%ecx, %eax
	movl	%eax, -28(%rbp)
	movl	-28(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jge	.L9
	movl	-28(%rbp), %eax
	movl	%eax, -36(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -40(%rbp)
.L9:
	addl	$1, -32(%rbp)
.L8:
	movl	-60(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jle	.L10
	movl	-40(%rbp), %eax
	leal	1(%rax), %edx
	movl	-40(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	run, .-run
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	call	run
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%i%i"
.LC1:
	.string	"%s"
.LC2:
	.string	"%i %i\n"
	.text
	.globl	run
	.type	run, @function
run:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-56(%rbp), %rdx
	leaq	-60(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -24(%rbp)
	movl	-60(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	$1, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -16(%rbp)
	movl	$0, -52(%rbp)
	jmp	.L2
.L5:
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -48(%rbp)
	jmp	.L3
.L4:
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %ecx
	movl	-48(%rbp), %eax
	movslq	%eax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$69, %al
	sete	%al
	movzbl	%al, %edx
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rsi
	movq	-24(%rbp), %rax
	addq	%rsi, %rax
	addl	%ecx, %edx
	movl	%edx, (%rax)
	addl	$1, -48(%rbp)
.L3:
	movl	-60(%rbp), %eax
	cmpl	%eax, -48(%rbp)
	jl	.L4
	addl	$1, -52(%rbp)
.L2:
	movl	-56(%rbp), %eax
	cmpl	%eax, -52(%rbp)
	jl	.L5
	movl	-60(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -44(%rbp)
	jmp	.L6
.L7:
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %ecx
	movl	-44(%rbp), %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rsi
	movq	-24(%rbp), %rax
	addq	%rsi, %rax
	addl	%ecx, %edx
	movl	%edx, (%rax)
	subl	$1, -44(%rbp)
.L6:
	cmpl	$0, -44(%rbp)
	jns	.L7
	movl	$0, -40(%rbp)
	movl	-60(%rbp), %edx
	movl	-56(%rbp), %eax
	imull	%eax, %edx
	movq	-24(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -36(%rbp)
	movl	$1, -32(%rbp)
	jmp	.L8
.L10:
	movl	-60(%rbp), %eax
	subl	-32(%rbp), %eax
	movl	%eax, %edx
	movl	-56(%rbp), %eax
	imull	%edx, %eax
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rdx), %edx
	subl	%edx, %eax
	movl	%eax, %ecx
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rsi
	movq	-24(%rbp), %rdx
	addq	%rsi, %rdx
	movl	(%rdx), %edx
	subl	%edx, %eax
	addl	%ecx, %eax
	movl	%eax, -28(%rbp)
	movl	-28(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jge	.L9
	movl	-28(%rbp), %eax
	movl	%eax, -36(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -40(%rbp)
.L9:
	addl	$1, -32(%rbp)
.L8:
	movl	-60(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jle	.L10
	movl	-40(%rbp), %eax
	leal	1(%rax), %edx
	movl	-40(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	run, .-run
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	call	run
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
