Given the following C code and assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>

int main(){
  int a;
  int num=0;
  int k;
  char s;
  char str[10000];
  int i;
  scanf("%d",&a);

  for(i=0;i<a;i++){
    scanf("%s %d",str,&k);
    if(str[1]==0){
      if(str[0]=='(') num+=k;
      else if(str[0]==')') num-=k;
    }
    if(num<0){
      break;
    }
  }
  puts(num==0?"YES":"NO");

  return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"YES"
.LC1:
	.string	"NO"
.LC2:
	.string	"%d"
.LC3:
	.string	"%s %d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	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	$4096, %rsp
	.cfi_def_cfa_offset 4144
	orq	$0, (%rsp)
	subq	$4096, %rsp
	.cfi_def_cfa_offset 8240
	orq	$0, (%rsp)
	subq	$1840, %rsp
	.cfi_def_cfa_offset 10080
	leaq	.LC2(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 10024(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	xorl	%ebx, %ebx
	leaq	12(%rsp), %r13
	leaq	16(%rsp), %r12
	xorl	%r14d, %r14d
	leaq	.LC3(%rip), %rbp
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L4:
	cmpb	$41, %al
	je	.L18
.L3:
	addl	$1, %ebx
	cmpl	%ebx, 8(%rsp)
	jle	.L19
.L7:
	xorl	%eax, %eax
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	cmpb	$0, 17(%rsp)
	jne	.L3
	movzbl	16(%rsp), %eax
	cmpb	$40, %al
	jne	.L4
	addl	12(%rsp), %r14d
.L5:
	testl	%r14d, %r14d
	jns	.L3
.L10:
	leaq	.LC1(%rip), %rdi
.L6:
	call	puts@PLT
	movq	10024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	addq	$10032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	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
	.p2align 4,,10
	.p2align 3
.L18:
	.cfi_restore_state
	subl	12(%rsp), %r14d
	jmp	.L5
.L19:
	testl	%r14d, %r14d
	jne	.L10
.L2:
	leaq	.LC0(%rip), %rdi
	jmp	.L6
.L20:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"YES"
.LC1:
	.string	"NO"
.LC2:
	.string	"%d"
.LC3:
	.string	"%s %d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	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	$4096, %rsp
	.cfi_def_cfa_offset 4144
	orq	$0, (%rsp)
	subq	$4096, %rsp
	.cfi_def_cfa_offset 8240
	orq	$0, (%rsp)
	subq	$1840, %rsp
	.cfi_def_cfa_offset 10080
	leaq	.LC2(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 10024(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	xorl	%ebx, %ebx
	leaq	12(%rsp), %r13
	leaq	16(%rsp), %r12
	xorl	%r14d, %r14d
	leaq	.LC3(%rip), %rbp
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L4:
	cmpb	$41, %al
	je	.L18
.L3:
	addl	$1, %ebx
	cmpl	%ebx, 8(%rsp)
	jle	.L19
.L7:
	xorl	%eax, %eax
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	cmpb	$0, 17(%rsp)
	jne	.L3
	movzbl	16(%rsp), %eax
	cmpb	$40, %al
	jne	.L4
	addl	12(%rsp), %r14d
.L5:
	testl	%r14d, %r14d
	jns	.L3
.L10:
	leaq	.LC1(%rip), %rdi
.L6:
	call	puts@PLT
	movq	10024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	addq	$10032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	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
	.p2align 4,,10
	.p2align 3
.L18:
	.cfi_restore_state
	subl	12(%rsp), %r14d
	jmp	.L5
.L19:
	testl	%r14d, %r14d
	jne	.L10
.L2:
	leaq	.LC0(%rip), %rdi
	jmp	.L6
.L20:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"YES"
.LC1:
	.string	"NO"
.LC2:
	.string	"%d"
.LC3:
	.string	"%s %d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	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	$4096, %rsp
	.cfi_def_cfa_offset 4144
	orq	$0, (%rsp)
	subq	$4096, %rsp
	.cfi_def_cfa_offset 8240
	orq	$0, (%rsp)
	subq	$1840, %rsp
	.cfi_def_cfa_offset 10080
	leaq	.LC2(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 10024(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	xorl	%ebx, %ebx
	leaq	12(%rsp), %r13
	leaq	16(%rsp), %r12
	xorl	%r14d, %r14d
	leaq	.LC3(%rip), %rbp
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L4:
	cmpb	$41, %al
	je	.L18
.L3:
	addl	$1, %ebx
	cmpl	%ebx, 8(%rsp)
	jle	.L19
.L7:
	xorl	%eax, %eax
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	cmpb	$0, 17(%rsp)
	jne	.L3
	movzbl	16(%rsp), %eax
	cmpb	$40, %al
	jne	.L4
	addl	12(%rsp), %r14d
.L5:
	testl	%r14d, %r14d
	jns	.L3
.L10:
	leaq	.LC1(%rip), %rdi
.L6:
	call	puts@PLT
	movq	10024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	addq	$10032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	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
	.p2align 4,,10
	.p2align 3
.L18:
	.cfi_restore_state
	subl	12(%rsp), %r14d
	jmp	.L5
.L19:
	testl	%r14d, %r14d
	jne	.L10
.L2:
	leaq	.LC0(%rip), %rdi
	jmp	.L6
.L20:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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:
```
```c
#include<stdio.h>

int main(){
  int a;
  int num=0;
  int k;
  char s;
  char str[10000];
  int i;
  scanf("%d",&a);

  for(i=0;i<a;i++){
    scanf("%s %d",str,&k);
    if(str[1]==0){
      if(str[0]=='(') num+=k;
      else if(str[0]==')') num-=k;
    }
    if(num<0){
      break;
    }
  }
  puts(num==0?"YES":"NO");

  return 0;
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>

int main(){
  int a;
  int num=0;
  int k;
  char s;
  char str[10000];
  int i;
  scanf("%d",&a);

  for(i=0;i<a;i++){
    scanf("%s %d",str,&k);
    if(str[1]==0){
      if(str[0]=='(') num+=k;
      else if(str[0]==')') num-=k;
    }
    if(num<0){
      break;
    }
  }
  puts(num==0?"YES":"NO");

  return 0;
}```

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.
Optimized Assembly Code:

2
) 1
' 1
 3
( 5
* 4
) 1
 5
( 2
) 2
( 3
) 1
) 4
 2
) 1
' 2
 3
( 5
* 4
) 2
 5
( 2
) 0
( 3
) 1
) 4
 2
) 1
' 4
 3
) 5
* 4
) 2
 5
( 2
) 0
( 2
) 1
) 4
 2
* 1
' 4

NO
 NO
 NO
 NO
 NO
 YES
 NO
 NO
 NO
 YES

Given the following C code and assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>

int main(){
  int a;
  int num=0;
  int k;
  char s;
  char str[10000];
  int i;
  scanf("%d",&a);

  for(i=0;i<a;i++){
    scanf("%s %d",str,&k);
    if(str[1]==0){
      if(str[0]=='(') num+=k;
      else if(str[0]==')') num-=k;
    }
    if(num<0){
      break;
    }
  }
  puts(num==0?"YES":"NO");

  return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"YES"
.LC1:
	.string	"NO"
.LC2:
	.string	"%d"
.LC3:
	.string	"%s %d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	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	$4096, %rsp
	.cfi_def_cfa_offset 4144
	orq	$0, (%rsp)
	subq	$4096, %rsp
	.cfi_def_cfa_offset 8240
	orq	$0, (%rsp)
	subq	$1840, %rsp
	.cfi_def_cfa_offset 10080
	leaq	.LC2(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 10024(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	xorl	%ebx, %ebx
	leaq	12(%rsp), %r13
	leaq	16(%rsp), %r12
	xorl	%r14d, %r14d
	leaq	.LC3(%rip), %rbp
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L4:
	cmpb	$41, %al
	je	.L18
.L3:
	addl	$1, %ebx
	cmpl	%ebx, 8(%rsp)
	jle	.L19
.L7:
	xorl	%eax, %eax
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	cmpb	$0, 17(%rsp)
	jne	.L3
	movzbl	16(%rsp), %eax
	cmpb	$40, %al
	jne	.L4
	addl	12(%rsp), %r14d
.L5:
	testl	%r14d, %r14d
	jns	.L3
.L10:
	leaq	.LC1(%rip), %rdi
.L6:
	call	puts@PLT
	movq	10024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	addq	$10032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	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
	.p2align 4,,10
	.p2align 3
.L18:
	.cfi_restore_state
	subl	12(%rsp), %r14d
	jmp	.L5
.L19:
	testl	%r14d, %r14d
	jne	.L10
.L2:
	leaq	.LC0(%rip), %rdi
	jmp	.L6
.L20:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"YES"
.LC1:
	.string	"NO"
.LC2:
	.string	"%d"
.LC3:
	.string	"%s %d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	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	$4096, %rsp
	.cfi_def_cfa_offset 4144
	orq	$0, (%rsp)
	subq	$4096, %rsp
	.cfi_def_cfa_offset 8240
	orq	$0, (%rsp)
	subq	$1840, %rsp
	.cfi_def_cfa_offset 10080
	leaq	.LC2(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 10024(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	xorl	%ebx, %ebx
	leaq	12(%rsp), %r13
	leaq	16(%rsp), %r12
	xorl	%r14d, %r14d
	leaq	.LC3(%rip), %rbp
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L4:
	cmpb	$41, %al
	je	.L18
.L3:
	addl	$1, %ebx
	cmpl	%ebx, 8(%rsp)
	jle	.L19
.L7:
	xorl	%eax, %eax
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	cmpb	$0, 17(%rsp)
	jne	.L3
	movzbl	16(%rsp), %eax
	cmpb	$40, %al
	jne	.L4
	addl	12(%rsp), %r14d
.L5:
	testl	%r14d, %r14d
	jns	.L3
.L10:
	leaq	.LC1(%rip), %rdi
.L6:
	call	puts@PLT
	movq	10024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	addq	$10032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	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
	.p2align 4,,10
	.p2align 3
.L18:
	.cfi_restore_state
	subl	12(%rsp), %r14d
	jmp	.L5
.L19:
	testl	%r14d, %r14d
	jne	.L10
.L2:
	leaq	.LC0(%rip), %rdi
	jmp	.L6
.L20:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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:
```