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>
 
int c, p, l, lp;
long long r;
int main() {
  for(; (c = getchar_unlocked()) != EOF && c > ' '; r += ++l) {
    if(c != p) { 
      if(c == '<')
        r -= l < lp ? l : lp;
      p = c, lp = l, l = 0;
    }
  }
  if(p == '>')
    r -= l < lp ? l : lp;
  printf("%lld\n", r);
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	c
	.bss
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.zero	4
	.globl	p
	.align 4
	.type	p, @object
	.size	p, 4
p:
	.zero	4
	.globl	l
	.align 4
	.type	l, @object
	.size	l, 4
l:
	.zero	4
	.globl	lp
	.align 4
	.type	lp, @object
	.size	lp, 4
lp:
	.zero	4
	.globl	r
	.align 8
	.type	r, @object
	.size	r, 8
r:
	.zero	8
	.section	.rodata
.LC0:
	.string	"%lld\n"
	.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
	jmp	.L2
.L6:
	movl	c(%rip), %edx
	movl	p(%rip), %eax
	cmpl	%eax, %edx
	je	.L3
	movl	c(%rip), %eax
	cmpl	$60, %eax
	jne	.L4
	movq	r(%rip), %rcx
	movl	lp(%rip), %edx
	movl	l(%rip), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movslq	%eax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, r(%rip)
.L4:
	movl	c(%rip), %eax
	movl	%eax, p(%rip)
	movl	l(%rip), %eax
	movl	%eax, lp(%rip)
	movl	$0, l(%rip)
.L3:
	movl	l(%rip), %eax
	addl	$1, %eax
	movl	%eax, l(%rip)
	movl	l(%rip), %eax
	movslq	%eax, %rdx
	movq	r(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, r(%rip)
.L2:
	call	getchar_unlocked@PLT
	movl	%eax, c(%rip)
	movl	c(%rip), %eax
	cmpl	$-1, %eax
	je	.L5
	movl	c(%rip), %eax
	cmpl	$32, %eax
	jg	.L6
.L5:
	movl	p(%rip), %eax
	cmpl	$62, %eax
	jne	.L7
	movq	r(%rip), %rcx
	movl	lp(%rip), %edx
	movl	l(%rip), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movslq	%eax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, r(%rip)
.L7:
	movq	r(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	popq	%rbp
	.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	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L3:
	cmpl	$60, %eax
	jne	.L5
	movslq	lp(%rip), %rsi
	cmpl	%esi, %edx
	cmovle	%rdx, %rsi
	subq	%rsi, %rcx
.L5:
	movl	%eax, p(%rip)
	movl	$1, %eax
	movl	%edx, lp(%rip)
	movl	$1, %edx
.L4:
	addq	%rcx, %rax
	movl	%edx, l(%rip)
	movq	%rax, r(%rip)
.L2:
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rax
	cmpq	16(%rdi), %rax
	jnb	.L14
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
	movl	%eax, c(%rip)
.L7:
	movl	p(%rip), %esi
	movq	r(%rip), %rcx
	cmpl	$32, %eax
	jle	.L11
	movslq	l(%rip), %rdx
	cmpl	%esi, %eax
	jne	.L3
	addl	$1, %edx
	movslq	%edx, %rax
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L14:
	call	__uflow@PLT
	movl	%eax, c(%rip)
	cmpl	$-1, %eax
	jne	.L7
.L11:
	cmpl	$62, p(%rip)
	jne	.L9
	movslq	lp(%rip), %rax
	movslq	l(%rip), %rdx
	cmpl	%edx, %eax
	cmovg	%rdx, %rax
	subq	%rax, r(%rip)
.L9:
	movq	r(%rip), %rdx
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	r
	.bss
	.align 8
	.type	r, @object
	.size	r, 8
r:
	.zero	8
	.globl	lp
	.align 4
	.type	lp, @object
	.size	lp, 4
lp:
	.zero	4
	.globl	l
	.align 4
	.type	l, @object
	.size	l, 4
l:
	.zero	4
	.globl	p
	.align 4
	.type	p, @object
	.size	p, 4
p:
	.zero	4
	.globl	c
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.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	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L3:
	cmpl	$60, %eax
	jne	.L5
	movslq	lp(%rip), %rsi
	cmpl	%esi, %edx
	cmovle	%rdx, %rsi
	subq	%rsi, %rcx
.L5:
	movl	%eax, p(%rip)
	movl	$1, %eax
	movl	%edx, lp(%rip)
	movl	$1, %edx
.L4:
	addq	%rcx, %rax
	movl	%edx, l(%rip)
	movq	%rax, r(%rip)
.L2:
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rax
	cmpq	16(%rdi), %rax
	jnb	.L14
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
	movl	%eax, c(%rip)
.L7:
	movl	p(%rip), %esi
	movq	r(%rip), %rcx
	cmpl	$32, %eax
	jle	.L11
	movslq	l(%rip), %rdx
	cmpl	%esi, %eax
	jne	.L3
	addl	$1, %edx
	movslq	%edx, %rax
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L14:
	call	__uflow@PLT
	movl	%eax, c(%rip)
	cmpl	$-1, %eax
	jne	.L7
.L11:
	cmpl	$62, p(%rip)
	jne	.L9
	movslq	lp(%rip), %rax
	movslq	l(%rip), %rdx
	cmpl	%edx, %eax
	cmovg	%rdx, %rax
	subq	%rax, r(%rip)
.L9:
	movq	r(%rip), %rdx
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	r
	.bss
	.align 8
	.type	r, @object
	.size	r, 8
r:
	.zero	8
	.globl	lp
	.align 4
	.type	lp, @object
	.size	lp, 4
lp:
	.zero	4
	.globl	l
	.align 4
	.type	l, @object
	.size	l, 4
l:
	.zero	4
	.globl	p
	.align 4
	.type	p, @object
	.size	p, 4
p:
	.zero	4
	.globl	c
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.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>
 
int c, p, l, lp;
long long r;
int main() {
  for(; (c = getchar_unlocked()) != EOF && c > ' '; r += ++l) {
    if(c != p) { 
      if(c == '<')
        r -= l < lp ? l : lp;
      p = c, lp = l, l = 0;
    }
  }
  if(p == '>')
    r -= l < lp ? l : lp;
  printf("%lld\n", r);
  return 0;
}

>><
 <>>><<<<<><<>>><
 ><>
 <>>>><<<<><<<>><
 <>><<<><<<<>>>><
 <<>><<><<<<>>>><
 <>>>><<<<><<>><<
 <>>>>><<<><<<><<
 <>>><>><<><<<><<
 <<><<<><<>><>>><

4
 29
 2
 28
 26
 24
 27
 30
 21
 20

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>
 
int c, p, l, lp;
long long r;
int main() {
  for(; (c = getchar_unlocked()) != EOF && c > ' '; r += ++l) {
    if(c != p) { 
      if(c == '<')
        r -= l < lp ? l : lp;
      p = c, lp = l, l = 0;
    }
  }
  if(p == '>')
    r -= l < lp ? l : lp;
  printf("%lld\n", r);
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	c
	.bss
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.zero	4
	.globl	p
	.align 4
	.type	p, @object
	.size	p, 4
p:
	.zero	4
	.globl	l
	.align 4
	.type	l, @object
	.size	l, 4
l:
	.zero	4
	.globl	lp
	.align 4
	.type	lp, @object
	.size	lp, 4
lp:
	.zero	4
	.globl	r
	.align 8
	.type	r, @object
	.size	r, 8
r:
	.zero	8
	.section	.rodata
.LC0:
	.string	"%lld\n"
	.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
	jmp	.L2
.L6:
	movl	c(%rip), %edx
	movl	p(%rip), %eax
	cmpl	%eax, %edx
	je	.L3
	movl	c(%rip), %eax
	cmpl	$60, %eax
	jne	.L4
	movq	r(%rip), %rcx
	movl	lp(%rip), %edx
	movl	l(%rip), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movslq	%eax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, r(%rip)
.L4:
	movl	c(%rip), %eax
	movl	%eax, p(%rip)
	movl	l(%rip), %eax
	movl	%eax, lp(%rip)
	movl	$0, l(%rip)
.L3:
	movl	l(%rip), %eax
	addl	$1, %eax
	movl	%eax, l(%rip)
	movl	l(%rip), %eax
	movslq	%eax, %rdx
	movq	r(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, r(%rip)
.L2:
	call	getchar_unlocked@PLT
	movl	%eax, c(%rip)
	movl	c(%rip), %eax
	cmpl	$-1, %eax
	je	.L5
	movl	c(%rip), %eax
	cmpl	$32, %eax
	jg	.L6
.L5:
	movl	p(%rip), %eax
	cmpl	$62, %eax
	jne	.L7
	movq	r(%rip), %rcx
	movl	lp(%rip), %edx
	movl	l(%rip), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movslq	%eax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, r(%rip)
.L7:
	movq	r(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	popq	%rbp
	.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
	.globl	c
	.bss
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.zero	4
	.globl	p
	.align 4
	.type	p, @object
	.size	p, 4
p:
	.zero	4
	.globl	l
	.align 4
	.type	l, @object
	.size	l, 4
l:
	.zero	4
	.globl	lp
	.align 4
	.type	lp, @object
	.size	lp, 4
lp:
	.zero	4
	.globl	r
	.align 8
	.type	r, @object
	.size	r, 8
r:
	.zero	8
	.section	.rodata
.LC0:
	.string	"%lld\n"
	.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
	jmp	.L2
.L6:
	movl	c(%rip), %edx
	movl	p(%rip), %eax
	cmpl	%eax, %edx
	je	.L3
	movl	c(%rip), %eax
	cmpl	$60, %eax
	jne	.L4
	movq	r(%rip), %rcx
	movl	lp(%rip), %edx
	movl	l(%rip), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movslq	%eax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, r(%rip)
.L4:
	movl	c(%rip), %eax
	movl	%eax, p(%rip)
	movl	l(%rip), %eax
	movl	%eax, lp(%rip)
	movl	$0, l(%rip)
.L3:
	movl	l(%rip), %eax
	addl	$1, %eax
	movl	%eax, l(%rip)
	movl	l(%rip), %eax
	movslq	%eax, %rdx
	movq	r(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, r(%rip)
.L2:
	call	getchar_unlocked@PLT
	movl	%eax, c(%rip)
	movl	c(%rip), %eax
	cmpl	$-1, %eax
	je	.L5
	movl	c(%rip), %eax
	cmpl	$32, %eax
	jg	.L6
.L5:
	movl	p(%rip), %eax
	cmpl	$62, %eax
	jne	.L7
	movq	r(%rip), %rcx
	movl	lp(%rip), %edx
	movl	l(%rip), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movslq	%eax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, r(%rip)
.L7:
	movq	r(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	popq	%rbp
	.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:
