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

```c
/*
  AOJ #3100
  Strange Plants
  @kankichi57301
 */
#include <stdio.h>
#include <string.h>
#define max(a,b) ((a)>(b)?(a):(b))

int x,a,b,n;
char s[10];
int main()
{
  int i;
  
  scanf("%d %d %d",&x,&a,&b);
  scanf("%d",&n);
  for(i=0;i<n;i++)
  {
    scanf("%s",s);
    if(0==strcmp(s,"nobiro"))
      x = max(0,x+a);
    else if(0==strcmp(s,"tidime"))
      x = max(0,x+b);
    else if(0==strcmp(s,"karero"))
      x = 0;
    //printf("%d\n",x);
  }

  printf("%d\n",x);
  return (0);
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	x
	.bss
	.align 4
	.type	x, @object
	.size	x, 4
x:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	b
	.align 4
	.type	b, @object
	.size	b, 4
b:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	s
	.align 8
	.type	s, @object
	.size	s, 10
s:
	.zero	10
	.section	.rodata
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%s"
.LC3:
	.string	"nobiro"
.LC4:
	.string	"tidime"
.LC5:
	.string	"karero"
.LC6:
	.string	"%d\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
	subq	$16, %rsp
	leaq	b(%rip), %rax
	movq	%rax, %rcx
	leaq	a(%rip), %rax
	movq	%rax, %rdx
	leaq	x(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -4(%rbp)
	jmp	.L2
.L6:
	leaq	s(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	.LC3(%rip), %rax
	movq	%rax, %rsi
	leaq	s(%rip), %rax
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L3
	movl	x(%rip), %edx
	movl	a(%rip), %eax
	addl	%edx, %eax
	movl	$0, %edx
	testl	%eax, %eax
	cmovs	%edx, %eax
	movl	%eax, x(%rip)
	jmp	.L4
.L3:
	leaq	.LC4(%rip), %rax
	movq	%rax, %rsi
	leaq	s(%rip), %rax
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L5
	movl	x(%rip), %edx
	movl	b(%rip), %eax
	addl	%edx, %eax
	movl	$0, %edx
	testl	%eax, %eax
	cmovs	%edx, %eax
	movl	%eax, x(%rip)
	jmp	.L4
.L5:
	leaq	.LC5(%rip), %rax
	movq	%rax, %rsi
	leaq	s(%rip), %rax
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L4
	movl	$0, x(%rip)
.L4:
	addl	$1, -4(%rbp)
.L2:
	movl	n(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L6
	movl	x(%rip), %eax
	movl	%eax, %esi
	leaq	.LC6(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	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	"%d %d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%s"
.LC3:
	.string	"nobiro"
.LC4:
	.string	"tidime"
.LC5:
	.string	"karero"
.LC6:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	b(%rip), %rcx
	xorl	%eax, %eax
	leaq	a(%rip), %rdx
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	leaq	x(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	call	__isoc99_scanf@PLT
	leaq	n(%rip), %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	n(%rip), %eax
	testl	%eax, %eax
	jle	.L2
	xorl	%ebp, %ebp
	leaq	s(%rip), %rbx
	leaq	.LC2(%rip), %r12
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L3:
	cmpl	$1768188276, (%rbx)
	je	.L17
.L7:
	cmpl	$1701994859, (%rbx)
	je	.L18
.L6:
	addl	$1, %ebp
	cmpl	%ebp, n(%rip)
	jle	.L2
.L12:
	xorl	%eax, %eax
	movq	%rbx, %rsi
	movq	%r12, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$1768058734, (%rbx)
	jne	.L3
	cmpw	$28530, 4+s(%rip)
	jne	.L3
	cmpb	$0, 6+s(%rip)
	movl	a(%rip), %eax
	jne	.L3
.L15:
	addl	%eax, x(%rip)
	movl	x(%rip), %eax
	xorl	%edx, %edx
	testl	%eax, %eax
	cmovs	%edx, %eax
	addl	$1, %ebp
	cmpl	%ebp, n(%rip)
	movl	%eax, x(%rip)
	jg	.L12
.L2:
	movl	x(%rip), %edx
	leaq	.LC6(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L17:
	.cfi_restore_state
	cmpw	$25965, 4+s(%rip)
	jne	.L7
	cmpb	$0, 6+s(%rip)
	jne	.L7
	movl	b(%rip), %eax
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L18:
	cmpw	$28530, 4+s(%rip)
	jne	.L6
	cmpb	$0, 6+s(%rip)
	jne	.L6
	movl	$0, x(%rip)
	jmp	.L6
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	s
	.bss
	.align 8
	.type	s, @object
	.size	s, 10
s:
	.zero	10
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	b
	.align 4
	.type	b, @object
	.size	b, 4
b:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	x
	.align 4
	.type	x, @object
	.size	x, 4
x:
	.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 %d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%s"
.LC3:
	.string	"nobiro"
.LC4:
	.string	"tidime"
.LC5:
	.string	"karero"
.LC6:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	b(%rip), %rcx
	xorl	%eax, %eax
	leaq	a(%rip), %rdx
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	leaq	x(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	call	__isoc99_scanf@PLT
	leaq	n(%rip), %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	n(%rip), %eax
	testl	%eax, %eax
	jle	.L2
	xorl	%ebp, %ebp
	leaq	s(%rip), %rbx
	leaq	.LC2(%rip), %r12
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L3:
	cmpl	$1768188276, (%rbx)
	je	.L17
.L7:
	cmpl	$1701994859, (%rbx)
	je	.L18
.L6:
	addl	$1, %ebp
	cmpl	%ebp, n(%rip)
	jle	.L2
.L12:
	xorl	%eax, %eax
	movq	%rbx, %rsi
	movq	%r12, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$1768058734, (%rbx)
	jne	.L3
	cmpw	$28530, 4+s(%rip)
	jne	.L3
	cmpb	$0, 6+s(%rip)
	movl	a(%rip), %eax
	jne	.L3
.L15:
	addl	%eax, x(%rip)
	movl	x(%rip), %eax
	xorl	%edx, %edx
	testl	%eax, %eax
	cmovs	%edx, %eax
	addl	$1, %ebp
	cmpl	%ebp, n(%rip)
	movl	%eax, x(%rip)
	jg	.L12
.L2:
	movl	x(%rip), %edx
	leaq	.LC6(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L17:
	.cfi_restore_state
	cmpw	$25965, 4+s(%rip)
	jne	.L7
	cmpb	$0, 6+s(%rip)
	jne	.L7
	movl	b(%rip), %eax
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L18:
	cmpw	$28530, 4+s(%rip)
	jne	.L6
	cmpb	$0, 6+s(%rip)
	jne	.L6
	movl	$0, x(%rip)
	jmp	.L6
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	s
	.bss
	.align 8
	.type	s, @object
	.size	s, 10
s:
	.zero	10
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	b
	.align 4
	.type	b, @object
	.size	b, 4
b:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	x
	.align 4
	.type	x, @object
	.size	x, 4
x:
	.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:

/*
  AOJ #3100
  Strange Plants
  @kankichi57301
 */
#include <stdio.h>
#include <string.h>
#define max(a,b) ((a)>(b)?(a):(b))

int x,a,b,n;
char s[10];
int main()
{
  int i;
  
  scanf("%d %d %d",&x,&a,&b);
  scanf("%d",&n);
  for(i=0;i<n;i++)
  {
    scanf("%s",s);
    if(0==strcmp(s,"nobiro"))
      x = max(0,x+a);
    else if(0==strcmp(s,"tidime"))
      x = max(0,x+b);
    else if(0==strcmp(s,"karero"))
      x = 0;
    //printf("%d\n",x);
  }

  printf("%d\n",x);
  return (0);
}


10 30 10
0
nobiro
nobiro
tidime
 18 30 10
0
nobiro
nobiro
tidime
 15 30 9
0
noairo
oribon
midite
 23 30 9
0
noairo
oribon
midite
 44 30 5
0
noairo
nobiro
tidime
 59 30 5
0
oriaon
nobiro
tieimd
 83 48 5
0
orioan
nobiro
dmifit
 31 48 5
0
orioan
nobiro
dmifit
 19 48 5
0
orioan
nnciro
dmifit
 8 48 5
0
orioan
nnciro
dmifit

10
 18
 15
 23
 44
 59
 83
 31
 19
 8

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

```c
/*
  AOJ #3100
  Strange Plants
  @kankichi57301
 */
#include <stdio.h>
#include <string.h>
#define max(a,b) ((a)>(b)?(a):(b))

int x,a,b,n;
char s[10];
int main()
{
  int i;
  
  scanf("%d %d %d",&x,&a,&b);
  scanf("%d",&n);
  for(i=0;i<n;i++)
  {
    scanf("%s",s);
    if(0==strcmp(s,"nobiro"))
      x = max(0,x+a);
    else if(0==strcmp(s,"tidime"))
      x = max(0,x+b);
    else if(0==strcmp(s,"karero"))
      x = 0;
    //printf("%d\n",x);
  }

  printf("%d\n",x);
  return (0);
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	x
	.bss
	.align 4
	.type	x, @object
	.size	x, 4
x:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	b
	.align 4
	.type	b, @object
	.size	b, 4
b:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	s
	.align 8
	.type	s, @object
	.size	s, 10
s:
	.zero	10
	.section	.rodata
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%s"
.LC3:
	.string	"nobiro"
.LC4:
	.string	"tidime"
.LC5:
	.string	"karero"
.LC6:
	.string	"%d\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
	subq	$16, %rsp
	leaq	b(%rip), %rax
	movq	%rax, %rcx
	leaq	a(%rip), %rax
	movq	%rax, %rdx
	leaq	x(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -4(%rbp)
	jmp	.L2
.L6:
	leaq	s(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	.LC3(%rip), %rax
	movq	%rax, %rsi
	leaq	s(%rip), %rax
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L3
	movl	x(%rip), %edx
	movl	a(%rip), %eax
	addl	%edx, %eax
	movl	$0, %edx
	testl	%eax, %eax
	cmovs	%edx, %eax
	movl	%eax, x(%rip)
	jmp	.L4
.L3:
	leaq	.LC4(%rip), %rax
	movq	%rax, %rsi
	leaq	s(%rip), %rax
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L5
	movl	x(%rip), %edx
	movl	b(%rip), %eax
	addl	%edx, %eax
	movl	$0, %edx
	testl	%eax, %eax
	cmovs	%edx, %eax
	movl	%eax, x(%rip)
	jmp	.L4
.L5:
	leaq	.LC5(%rip), %rax
	movq	%rax, %rsi
	leaq	s(%rip), %rax
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L4
	movl	$0, x(%rip)
.L4:
	addl	$1, -4(%rbp)
.L2:
	movl	n(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L6
	movl	x(%rip), %eax
	movl	%eax, %esi
	leaq	.LC6(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	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
	.globl	x
	.bss
	.align 4
	.type	x, @object
	.size	x, 4
x:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	b
	.align 4
	.type	b, @object
	.size	b, 4
b:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	s
	.align 8
	.type	s, @object
	.size	s, 10
s:
	.zero	10
	.section	.rodata
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%s"
.LC3:
	.string	"nobiro"
.LC4:
	.string	"tidime"
.LC5:
	.string	"karero"
.LC6:
	.string	"%d\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
	subq	$16, %rsp
	leaq	b(%rip), %rax
	movq	%rax, %rcx
	leaq	a(%rip), %rax
	movq	%rax, %rdx
	leaq	x(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -4(%rbp)
	jmp	.L2
.L6:
	leaq	s(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	.LC3(%rip), %rax
	movq	%rax, %rsi
	leaq	s(%rip), %rax
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L3
	movl	x(%rip), %edx
	movl	a(%rip), %eax
	addl	%edx, %eax
	movl	$0, %edx
	testl	%eax, %eax
	cmovs	%edx, %eax
	movl	%eax, x(%rip)
	jmp	.L4
.L3:
	leaq	.LC4(%rip), %rax
	movq	%rax, %rsi
	leaq	s(%rip), %rax
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L5
	movl	x(%rip), %edx
	movl	b(%rip), %eax
	addl	%edx, %eax
	movl	$0, %edx
	testl	%eax, %eax
	cmovs	%edx, %eax
	movl	%eax, x(%rip)
	jmp	.L4
.L5:
	leaq	.LC5(%rip), %rax
	movq	%rax, %rsi
	leaq	s(%rip), %rax
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L4
	movl	$0, x(%rip)
.L4:
	addl	$1, -4(%rbp)
.L2:
	movl	n(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L6
	movl	x(%rip), %eax
	movl	%eax, %esi
	leaq	.LC6(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	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:
