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>

int main(void)
{
	int i;
	int answer = 0;
	int length;
	char data[1024];
	
	while(1){
		fgets(data, sizeof(data), stdin);
		if(strcmp("END OF INPUT\n",data) == 0
			|| strcmp("END OF INPUT",data) == 0) break;
		
		length = strlen(data);
		for(i = 0; i < length; i++){
			if(data[i] == ' ' || data[i] == '\n'){
				printf("%d", answer);
				answer = 0;
			}
			else{
				answer += 1;
			}
		}
		
		printf("\n");
	}

	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"END OF INPUT\n"
.LC1:
	.string	"END OF INPUT"
.LC2:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$1056, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -1048(%rbp)
.L8:
	movq	stdin(%rip), %rdx
	leaq	-1040(%rbp), %rax
	movl	$1024, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	leaq	-1040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	je	.L2
	leaq	-1040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	je	.L2
	leaq	-1040(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -1044(%rbp)
	movl	$0, -1052(%rbp)
	jmp	.L3
.L7:
	movl	-1052(%rbp), %eax
	cltq
	movzbl	-1040(%rbp,%rax), %eax
	cmpb	$32, %al
	je	.L4
	movl	-1052(%rbp), %eax
	cltq
	movzbl	-1040(%rbp,%rax), %eax
	cmpb	$10, %al
	jne	.L5
.L4:
	movl	-1048(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, -1048(%rbp)
	jmp	.L6
.L5:
	addl	$1, -1048(%rbp)
.L6:
	addl	$1, -1052(%rbp)
.L3:
	movl	-1052(%rbp), %eax
	cmpl	-1044(%rbp), %eax
	jl	.L7
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L8
.L2:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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	"END OF INPUT\n"
.LC1:
	.string	"END OF INPUT"
.LC2:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%r15d, %r15d
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movabsq	$5269288869681188421, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	.LC2(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$1064, %rsp
	.cfi_def_cfa_offset 1120
	movq	%fs:40, %rax
	movq	%rax, 1048(%rsp)
	xorl	%eax, %eax
	leaq	17(%rsp), %rax
	leaq	16(%rsp), %rbp
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L12:
	movq	stdin(%rip), %rdx
	movl	$1024, %esi
	movq	%rbp, %rdi
	call	fgets@PLT
	cmpq	%r13, 0(%rbp)
	je	.L23
.L2:
	cmpq	%r13, 0(%rbp)
	je	.L24
.L5:
	movq	%rbp, %rdi
	call	strlen@PLT
	testq	%rax, %rax
	je	.L7
	leal	-1(%rax), %ecx
	movq	8(%rsp), %rax
	movq	%rbp, %rbx
	leaq	(%rcx,%rax), %r14
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L8:
	addq	$1, %rbx
	addl	$1, %r15d
	cmpq	%r14, %rbx
	je	.L7
.L11:
	movzbl	(%rbx), %eax
	cmpb	$32, %al
	je	.L14
	cmpb	$10, %al
	jne	.L8
.L14:
	movl	%r15d, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addq	$1, %rbx
	xorl	%r15d, %r15d
	cmpq	%r14, %rbx
	jne	.L11
.L7:
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L23:
	cmpl	$1414877262, 8(%rbp)
	jne	.L2
	cmpw	$10, 12(%rbp)
	jne	.L2
.L4:
	movq	1048(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$1064, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L24:
	.cfi_restore_state
	cmpl	$1414877262, 8(%rbp)
	jne	.L5
	cmpb	$0, 12(%rbp)
	je	.L4
	jmp	.L5
.L25:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"END OF INPUT\n"
.LC1:
	.string	"END OF INPUT"
.LC2:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%r15d, %r15d
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movabsq	$5269288869681188421, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	.LC2(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$1064, %rsp
	.cfi_def_cfa_offset 1120
	movq	%fs:40, %rax
	movq	%rax, 1048(%rsp)
	xorl	%eax, %eax
	leaq	17(%rsp), %rax
	leaq	16(%rsp), %rbp
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L12:
	movq	stdin(%rip), %rdx
	movl	$1024, %esi
	movq	%rbp, %rdi
	call	fgets@PLT
	cmpq	%r13, 0(%rbp)
	je	.L23
.L2:
	cmpq	%r13, 0(%rbp)
	je	.L24
.L5:
	movq	%rbp, %rdi
	call	strlen@PLT
	testq	%rax, %rax
	je	.L7
	leal	-1(%rax), %ecx
	movq	8(%rsp), %rax
	movq	%rbp, %rbx
	leaq	(%rcx,%rax), %r14
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L8:
	addq	$1, %rbx
	addl	$1, %r15d
	cmpq	%r14, %rbx
	je	.L7
.L11:
	movzbl	(%rbx), %eax
	cmpb	$32, %al
	je	.L14
	cmpb	$10, %al
	jne	.L8
.L14:
	movl	%r15d, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addq	$1, %rbx
	xorl	%r15d, %r15d
	cmpq	%r14, %rbx
	jne	.L11
.L7:
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L23:
	cmpl	$1414877262, 8(%rbp)
	jne	.L2
	cmpw	$10, 12(%rbp)
	jne	.L2
.L4:
	movq	1048(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$1064, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L24:
	.cfi_restore_state
	cmpl	$1414877262, 8(%rbp)
	jne	.L5
	cmpb	$0, 12(%rbp)
	je	.L4
	jmp	.L5
.L25:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.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>

int main(void)
{
	int i;
	int answer = 0;
	int length;
	char data[1024];
	
	while(1){
		fgets(data, sizeof(data), stdin);
		if(strcmp("END OF INPUT\n",data) == 0
			|| strcmp("END OF INPUT",data) == 0) break;
		
		length = strlen(data);
		for(i = 0; i < length; i++){
			if(data[i] == ' ' || data[i] == '\n'){
				printf("%d", answer);
				answer = 0;
			}
			else{
				answer += 1;
			}
		}
		
		printf("\n");
	}

	return 0;
}
Yes I have a number
How I wish I could calculate an unused bolor for space
Thank you
END OF INPUT
 Yes I have a rebmun
How I wish I could calculate an unused bolor for space
Thank you
END OF INPUT
 Yes I have a rebmun
How J wish I could calculate an unused bolor for space
Thank you
END OF INPUT
 Yes H have a rebmun
How J wish I could calculate an unused bolor for space
Thank you
END OF INPUT
 Yes H have a rebmun
How J hisw I could calculate an unused bolor for space
Thank you
END OF INPUT
 Yes H have a rebmun
How J hisw J could calculate an unused bolor for space
Thank you
END OF INPUT
 Yes H have a rebmun
How J hisw J could calculate an unused bolor rof space
Thank you
END OF INPUT
 Yes H havd a rebmun
How J hisw J could calculate an unused bolor rof space
Thank you
END OF INPUT
 Yes H hvad a rebmun
How J hisw J could calculate an unused bolor rof space
Thank you
END OF INPUT
 Yes H hvad a rebmun
How J hisw J could calculate an unused bolor rof space
Tiank you
END OF INPUT

31416
31415926535
53
 31416
31415926535
53
 31416
31415926535
53
 31416
31415926535
53
 31416
31415926535
53
 31416
31415926535
53
 31416
31415926535
53
 31416
31415926535
53
 31416
31415926535
53
 31416
31415926535
53

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>

int main(void)
{
	int i;
	int answer = 0;
	int length;
	char data[1024];
	
	while(1){
		fgets(data, sizeof(data), stdin);
		if(strcmp("END OF INPUT\n",data) == 0
			|| strcmp("END OF INPUT",data) == 0) break;
		
		length = strlen(data);
		for(i = 0; i < length; i++){
			if(data[i] == ' ' || data[i] == '\n'){
				printf("%d", answer);
				answer = 0;
			}
			else{
				answer += 1;
			}
		}
		
		printf("\n");
	}

	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"END OF INPUT\n"
.LC1:
	.string	"END OF INPUT"
.LC2:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$1056, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -1048(%rbp)
.L8:
	movq	stdin(%rip), %rdx
	leaq	-1040(%rbp), %rax
	movl	$1024, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	leaq	-1040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	je	.L2
	leaq	-1040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	je	.L2
	leaq	-1040(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -1044(%rbp)
	movl	$0, -1052(%rbp)
	jmp	.L3
.L7:
	movl	-1052(%rbp), %eax
	cltq
	movzbl	-1040(%rbp,%rax), %eax
	cmpb	$32, %al
	je	.L4
	movl	-1052(%rbp), %eax
	cltq
	movzbl	-1040(%rbp,%rax), %eax
	cmpb	$10, %al
	jne	.L5
.L4:
	movl	-1048(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, -1048(%rbp)
	jmp	.L6
.L5:
	addl	$1, -1048(%rbp)
.L6:
	addl	$1, -1052(%rbp)
.L3:
	movl	-1052(%rbp), %eax
	cmpl	-1044(%rbp), %eax
	jl	.L7
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L8
.L2:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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	"END OF INPUT\n"
.LC1:
	.string	"END OF INPUT"
.LC2:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$1056, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -1048(%rbp)
.L8:
	movq	stdin(%rip), %rdx
	leaq	-1040(%rbp), %rax
	movl	$1024, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	leaq	-1040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	je	.L2
	leaq	-1040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	je	.L2
	leaq	-1040(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -1044(%rbp)
	movl	$0, -1052(%rbp)
	jmp	.L3
.L7:
	movl	-1052(%rbp), %eax
	cltq
	movzbl	-1040(%rbp,%rax), %eax
	cmpb	$32, %al
	je	.L4
	movl	-1052(%rbp), %eax
	cltq
	movzbl	-1040(%rbp,%rax), %eax
	cmpb	$10, %al
	jne	.L5
.L4:
	movl	-1048(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, -1048(%rbp)
	jmp	.L6
.L5:
	addl	$1, -1048(%rbp)
.L6:
	addl	$1, -1052(%rbp)
.L3:
	movl	-1052(%rbp), %eax
	cmpl	-1044(%rbp), %eax
	jl	.L7
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L8
.L2:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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:
