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

char next_char(char c, int n) {
  return c + (n % 26);
}

int main() {
  char WORD[100000];
  int N;

  scanf("%s", WORD);
  scanf("%d", &N);

  int len = strlen(WORD);

  int n = N;

  for (int i = 0; i < len; i++) {
    if (WORD[i] == 'a') { continue; }

    int required_n = (122 - WORD[i] + 1);

    if (n >= required_n) {
      WORD[i] = 'a';
      n -= required_n;
    }
    else {
      continue;
    }
  }

  if (n >= 0) {
    WORD[len-1] = next_char(WORD[len-1], n);
  }

  printf("%s\n", WORD);

  return 0;
}

```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	next_char
	.type	next_char, @function
next_char:
.LFB35:
	.cfi_startproc
	endbr64
	movslq	%esi, %rdx
	movl	%esi, %eax
	imulq	$1321528399, %rdx, %rdx
	sarl	$31, %eax
	sarq	$35, %rdx
	subl	%eax, %edx
	imull	$26, %edx, %edx
	subl	%edx, %esi
	leal	(%rdi,%rsi), %eax
	ret
	.cfi_endproc
.LFE35:
	.size	next_char, .-next_char
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB36:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	-98304(%rsp), %r11
	.cfi_def_cfa 11, 98320
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1728, %rsp
	.cfi_def_cfa_offset 100048
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 100024(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rbp
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	leaq	12(%rsp), %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%rbp, %rdi
	call	strlen@PLT
	movq	%rax, %r8
	movl	12(%rsp), %eax
	testq	%r8, %r8
	je	.L4
	leal	-1(%r8), %ecx
	movq	%rbp, %rdx
	movl	$123, %r9d
	leaq	17(%rsp,%rcx), %rdi
	.p2align 4,,10
	.p2align 3
.L6:
	movsbl	(%rdx), %ecx
	cmpb	$97, %cl
	je	.L5
	movl	%r9d, %esi
	subl	%ecx, %esi
	cmpl	%eax, %esi
	jg	.L5
	movb	$97, (%rdx)
	subl	%esi, %eax
.L5:
	addq	$1, %rdx
	cmpq	%rdi, %rdx
	jne	.L6
.L4:
	testl	%eax, %eax
	js	.L7
	movl	$26, %ecx
	cltd
	subl	$1, %r8d
	idivl	%ecx
	movslq	%r8d, %r8
	addb	%dl, 16(%rsp,%r8)
.L7:
	movq	%rbp, %rdi
	call	puts@PLT
	movq	100024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$100032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L17:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE36:
	.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
	.p2align 4
	.globl	next_char
	.type	next_char, @function
next_char:
.LFB35:
	.cfi_startproc
	endbr64
	movslq	%esi, %rdx
	movl	%esi, %eax
	imulq	$1321528399, %rdx, %rdx
	sarl	$31, %eax
	sarq	$35, %rdx
	subl	%eax, %edx
	imull	$26, %edx, %edx
	subl	%edx, %esi
	leal	(%rdi,%rsi), %eax
	ret
	.cfi_endproc
.LFE35:
	.size	next_char, .-next_char
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB36:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	-98304(%rsp), %r11
	.cfi_def_cfa 11, 98320
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1728, %rsp
	.cfi_def_cfa_offset 100048
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 100024(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rbp
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	leaq	12(%rsp), %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%rbp, %rdi
	call	strlen@PLT
	movq	%rax, %r8
	movl	12(%rsp), %eax
	testq	%r8, %r8
	je	.L4
	leal	-1(%r8), %ecx
	movq	%rbp, %rdx
	movl	$123, %r9d
	leaq	17(%rsp,%rcx), %rdi
	.p2align 4,,10
	.p2align 3
.L6:
	movsbl	(%rdx), %ecx
	cmpb	$97, %cl
	je	.L5
	movl	%r9d, %esi
	subl	%ecx, %esi
	cmpl	%eax, %esi
	jg	.L5
	movb	$97, (%rdx)
	subl	%esi, %eax
.L5:
	addq	$1, %rdx
	cmpq	%rdi, %rdx
	jne	.L6
.L4:
	testl	%eax, %eax
	js	.L7
	movl	$26, %ecx
	cltd
	subl	$1, %r8d
	idivl	%ecx
	movslq	%r8d, %r8
	addb	%dl, 16(%rsp,%r8)
.L7:
	movq	%rbp, %rdi
	call	puts@PLT
	movq	100024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$100032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L17:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE36:
	.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
	.p2align 4
	.globl	next_char
	.type	next_char, @function
next_char:
.LFB35:
	.cfi_startproc
	endbr64
	movslq	%esi, %rdx
	movl	%esi, %eax
	imulq	$1321528399, %rdx, %rdx
	sarl	$31, %eax
	sarq	$35, %rdx
	subl	%eax, %edx
	imull	$26, %edx, %edx
	subl	%edx, %esi
	leal	(%rdi,%rsi), %eax
	ret
	.cfi_endproc
.LFE35:
	.size	next_char, .-next_char
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB36:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	-98304(%rsp), %r11
	.cfi_def_cfa 11, 98320
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1728, %rsp
	.cfi_def_cfa_offset 100048
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 100024(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rbp
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	leaq	12(%rsp), %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%rbp, %rdi
	call	strlen@PLT
	movq	%rax, %r8
	movl	12(%rsp), %eax
	testq	%r8, %r8
	je	.L4
	leal	-1(%r8), %ecx
	movq	%rbp, %rdx
	movl	$123, %r9d
	leaq	17(%rsp,%rcx), %rdi
	.p2align 4,,10
	.p2align 3
.L6:
	movsbl	(%rdx), %ecx
	cmpb	$97, %cl
	je	.L5
	movl	%r9d, %esi
	subl	%ecx, %esi
	cmpl	%eax, %esi
	jg	.L5
	movb	$97, (%rdx)
	subl	%esi, %eax
.L5:
	addq	$1, %rdx
	cmpq	%rdi, %rdx
	jne	.L6
.L4:
	testl	%eax, %eax
	js	.L7
	movl	$26, %ecx
	cltd
	subl	$1, %r8d
	idivl	%ecx
	movslq	%r8d, %r8
	addb	%dl, 16(%rsp,%r8)
.L7:
	movq	%rbp, %rdi
	call	puts@PLT
	movq	100024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$100032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L17:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE36:
	.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>
#include <string.h>

char next_char(char c, int n) {
  return c + (n % 26);
}

int main() {
  char WORD[100000];
  int N;

  scanf("%s", WORD);
  scanf("%d", &N);

  int len = strlen(WORD);

  int n = N;

  for (int i = 0; i < len; i++) {
    if (WORD[i] == 'a') { continue; }

    int required_n = (122 - WORD[i] + 1);

    if (n >= required_n) {
      WORD[i] = 'a';
      n -= required_n;
    }
    else {
      continue;
    }
  }

  if (n >= 0) {
    WORD[len-1] = next_char(WORD[len-1], n);
  }

  printf("%s\n", WORD);

  return 0;
}

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

```c
#include <stdio.h>
#include <string.h>

char next_char(char c, int n) {
  return c + (n % 26);
}

int main() {
  char WORD[100000];
  int N;

  scanf("%s", WORD);
  scanf("%d", &N);

  int len = strlen(WORD);

  int n = N;

  for (int i = 0; i < len; i++) {
    if (WORD[i] == 'a') { continue; }

    int required_n = (122 - WORD[i] + 1);

    if (n >= required_n) {
      WORD[i] = 'a';
      n -= required_n;
    }
    else {
      continue;
    }
  }

  if (n >= 0) {
    WORD[len-1] = next_char(WORD[len-1], n);
  }

  printf("%s\n", WORD);

  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:

codefestival
101
 xyz
1
 zyx
1
 cdoeffstival
101
 zyx
2
 cdoeffstival
111
 zyx
3
 lavitsffeodc
111
 xyz
2
 caoeffstivdl
111

aaaafeaaiaal
 xya
 ayx
 aaaaffaaiaal
 ayy
 aaaaafativam
 aax
 aaaaaaaaeadg
 xaz
 aaaaaaativdo

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

char next_char(char c, int n) {
  return c + (n % 26);
}

int main() {
  char WORD[100000];
  int N;

  scanf("%s", WORD);
  scanf("%d", &N);

  int len = strlen(WORD);

  int n = N;

  for (int i = 0; i < len; i++) {
    if (WORD[i] == 'a') { continue; }

    int required_n = (122 - WORD[i] + 1);

    if (n >= required_n) {
      WORD[i] = 'a';
      n -= required_n;
    }
    else {
      continue;
    }
  }

  if (n >= 0) {
    WORD[len-1] = next_char(WORD[len-1], n);
  }

  printf("%s\n", WORD);

  return 0;
}

```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	next_char
	.type	next_char, @function
next_char:
.LFB35:
	.cfi_startproc
	endbr64
	movslq	%esi, %rdx
	movl	%esi, %eax
	imulq	$1321528399, %rdx, %rdx
	sarl	$31, %eax
	sarq	$35, %rdx
	subl	%eax, %edx
	imull	$26, %edx, %edx
	subl	%edx, %esi
	leal	(%rdi,%rsi), %eax
	ret
	.cfi_endproc
.LFE35:
	.size	next_char, .-next_char
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB36:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	-98304(%rsp), %r11
	.cfi_def_cfa 11, 98320
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1728, %rsp
	.cfi_def_cfa_offset 100048
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 100024(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rbp
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	leaq	12(%rsp), %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%rbp, %rdi
	call	strlen@PLT
	movq	%rax, %r8
	movl	12(%rsp), %eax
	testq	%r8, %r8
	je	.L4
	leal	-1(%r8), %ecx
	movq	%rbp, %rdx
	movl	$123, %r9d
	leaq	17(%rsp,%rcx), %rdi
	.p2align 4,,10
	.p2align 3
.L6:
	movsbl	(%rdx), %ecx
	cmpb	$97, %cl
	je	.L5
	movl	%r9d, %esi
	subl	%ecx, %esi
	cmpl	%eax, %esi
	jg	.L5
	movb	$97, (%rdx)
	subl	%esi, %eax
.L5:
	addq	$1, %rdx
	cmpq	%rdi, %rdx
	jne	.L6
.L4:
	testl	%eax, %eax
	js	.L7
	movl	$26, %ecx
	cltd
	subl	$1, %r8d
	idivl	%ecx
	movslq	%r8d, %r8
	addb	%dl, 16(%rsp,%r8)
.L7:
	movq	%rbp, %rdi
	call	puts@PLT
	movq	100024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$100032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L17:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE36:
	.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
	.p2align 4
	.globl	next_char
	.type	next_char, @function
next_char:
.LFB35:
	.cfi_startproc
	endbr64
	movslq	%esi, %rdx
	movl	%esi, %eax
	imulq	$1321528399, %rdx, %rdx
	sarl	$31, %eax
	sarq	$35, %rdx
	subl	%eax, %edx
	imull	$26, %edx, %edx
	subl	%edx, %esi
	leal	(%rdi,%rsi), %eax
	ret
	.cfi_endproc
.LFE35:
	.size	next_char, .-next_char
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB36:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	-98304(%rsp), %r11
	.cfi_def_cfa 11, 98320
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1728, %rsp
	.cfi_def_cfa_offset 100048
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 100024(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rbp
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	leaq	12(%rsp), %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%rbp, %rdi
	call	strlen@PLT
	movq	%rax, %r8
	movl	12(%rsp), %eax
	testq	%r8, %r8
	je	.L4
	leal	-1(%r8), %ecx
	movq	%rbp, %rdx
	movl	$123, %r9d
	leaq	17(%rsp,%rcx), %rdi
	.p2align 4,,10
	.p2align 3
.L6:
	movsbl	(%rdx), %ecx
	cmpb	$97, %cl
	je	.L5
	movl	%r9d, %esi
	subl	%ecx, %esi
	cmpl	%eax, %esi
	jg	.L5
	movb	$97, (%rdx)
	subl	%esi, %eax
.L5:
	addq	$1, %rdx
	cmpq	%rdi, %rdx
	jne	.L6
.L4:
	testl	%eax, %eax
	js	.L7
	movl	$26, %ecx
	cltd
	subl	$1, %r8d
	idivl	%ecx
	movslq	%r8d, %r8
	addb	%dl, 16(%rsp,%r8)
.L7:
	movq	%rbp, %rdi
	call	puts@PLT
	movq	100024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$100032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L17:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE36:
	.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:
```