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>

char S[123456];
int K;

int main() {
	scanf("%s", &S);
	scanf("%d", &K);

	// fixed code
	int weight = strlen(S);
	for (int i = 0; i < weight; ++i){
		if (S[i] == 'a'){
			continue;
		}
		else if (K >= 'z' - S[i] + 1){
			K -= 'z' - S[i] + 1;
			S[i] = 'a';
		}
		
	}
	S[weight - 1] += K % 26;

	// Original code
	/*int weight = strlen(S);
	for (int i = 0; i < weight; ++i) {
		s[i] = S[i] - 96;
	}
	for (int i = 0; i < weight && K>0; ++i) {
		if (s[i] - 1 <= K) {
			K -= s[i] - 1;
			S[i] = 'a';
		}
		else {
			for (int j = i; j < weight; j++) {
				if (j == i) {.;p,gvhjk
					memo = j, tmp = s[j] - 1;
				}
				else if (tmp > j - i) {
					memo = j, tmp = s[j] - 1;
				}
			}
			S[i] = (char)((s[memo] + K + 1) % 26 + 96);
			K = 0;
		}
	}*/

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

	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	S
	.bss
	.align 32
	.type	S, @object
	.size	S, 123456
S:
	.zero	123456
	.globl	K
	.align 4
	.type	K, @object
	.size	K, 4
K:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.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	$16, %rsp
	leaq	S(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	K(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	S(%rip), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -4(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L2
.L5:
	movl	-8(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$97, %al
	je	.L7
	movl	-8(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	movl	$123, %edx
	subl	%eax, %edx
	movl	K(%rip), %eax
	cmpl	%eax, %edx
	jg	.L4
	movl	K(%rip), %edx
	movl	-8(%rbp), %eax
	cltq
	leaq	S(%rip), %rcx
	movzbl	(%rax,%rcx), %eax
	movsbl	%al, %eax
	movl	$123, %ecx
	subl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, K(%rip)
	movl	-8(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movb	$97, (%rax,%rdx)
	jmp	.L4
.L7:
	nop
.L4:
	addl	$1, -8(%rbp)
.L2:
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jl	.L5
	movl	-4(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movl	%eax, %esi
	movl	K(%rip), %eax
	movslq	%eax, %rdx
	imulq	$1321528399, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$3, %edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	imull	$26, %edx, %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	movl	%edx, %eax
	leal	(%rsi,%rax), %edx
	movl	-4(%rbp), %eax
	subl	$1, %eax
	movl	%edx, %ecx
	cltq
	leaq	S(%rip), %rdx
	movb	%cl, (%rax,%rdx)
	leaq	S(%rip), %rax
	movq	%rax, %rdi
	call	puts@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	"%s"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	S(%rip), %rbp
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	leaq	K(%rip), %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%rbp, %rdi
	call	strlen@PLT
	movl	K(%rip), %r9d
	testq	%rax, %rax
	je	.L16
	leal	-1(%rax), %ecx
	leaq	1(%rbp), %r8
	movl	%r9d, %edi
	movq	%rbp, %rdx
	movq	%rcx, %rax
	addq	%rcx, %r8
	xorl	%r11d, %r11d
	movl	$123, %r10d
	.p2align 4,,10
	.p2align 3
.L5:
	movsbl	(%rdx), %ecx
	cmpb	$97, %cl
	je	.L4
	movl	%r10d, %esi
	subl	%ecx, %esi
	cmpl	%edi, %esi
	jg	.L4
	movb	$97, (%rdx)
	subl	%esi, %edi
	movl	$1, %r11d
.L4:
	addq	$1, %rdx
	cmpq	%rdx, %r8
	jne	.L5
	testb	%r11b, %r11b
	je	.L3
	movl	%edi, K(%rip)
	movl	%edi, %r9d
.L3:
	movslq	%r9d, %rdx
	movl	%r9d, %ecx
	cltq
	movq	%rbp, %rdi
	imulq	$1321528399, %rdx, %rdx
	sarl	$31, %ecx
	sarq	$35, %rdx
	subl	%ecx, %edx
	imull	$26, %edx, %edx
	subl	%edx, %r9d
	addb	%r9b, 0(%rbp,%rax)
	call	puts@PLT
	xorl	%eax, %eax
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L16:
	.cfi_restore_state
	orl	$-1, %eax
	jmp	.L3
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	K
	.bss
	.align 4
	.type	K, @object
	.size	K, 4
K:
	.zero	4
	.globl	S
	.align 32
	.type	S, @object
	.size	S, 123456
S:
	.zero	123456
	.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	"%s"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	S(%rip), %rbp
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	leaq	K(%rip), %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%rbp, %rdi
	call	strlen@PLT
	movl	K(%rip), %r9d
	testq	%rax, %rax
	je	.L16
	leal	-1(%rax), %ecx
	leaq	1(%rbp), %r8
	movl	%r9d, %edi
	movq	%rbp, %rdx
	movq	%rcx, %rax
	addq	%rcx, %r8
	xorl	%r11d, %r11d
	movl	$123, %r10d
	.p2align 4,,10
	.p2align 3
.L5:
	movsbl	(%rdx), %ecx
	cmpb	$97, %cl
	je	.L4
	movl	%r10d, %esi
	subl	%ecx, %esi
	cmpl	%edi, %esi
	jg	.L4
	movb	$97, (%rdx)
	subl	%esi, %edi
	movl	$1, %r11d
.L4:
	addq	$1, %rdx
	cmpq	%rdx, %r8
	jne	.L5
	testb	%r11b, %r11b
	je	.L3
	movl	%edi, K(%rip)
	movl	%edi, %r9d
.L3:
	movslq	%r9d, %rdx
	movl	%r9d, %ecx
	cltq
	movq	%rbp, %rdi
	imulq	$1321528399, %rdx, %rdx
	sarl	$31, %ecx
	sarq	$35, %rdx
	subl	%ecx, %edx
	imull	$26, %edx, %edx
	subl	%edx, %r9d
	addb	%r9b, 0(%rbp,%rax)
	call	puts@PLT
	xorl	%eax, %eax
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L16:
	.cfi_restore_state
	orl	$-1, %eax
	jmp	.L3
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	K
	.bss
	.align 4
	.type	K, @object
	.size	K, 4
K:
	.zero	4
	.globl	S
	.align 32
	.type	S, @object
	.size	S, 123456
S:
	.zero	123456
	.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>

char S[123456];
int K;

int main() {
	scanf("%s", &S);
	scanf("%d", &K);

	// fixed code
	int weight = strlen(S);
	for (int i = 0; i < weight; ++i){
		if (S[i] == 'a'){
			continue;
		}
		else if (K >= 'z' - S[i] + 1){
			K -= 'z' - S[i] + 1;
			S[i] = 'a';
		}
		
	}
	S[weight - 1] += K % 26;

	// Original code
	/*int weight = strlen(S);
	for (int i = 0; i < weight; ++i) {
		s[i] = S[i] - 96;
	}
	for (int i = 0; i < weight && K>0; ++i) {
		if (s[i] - 1 <= K) {
			K -= s[i] - 1;
			S[i] = 'a';
		}
		else {
			for (int j = i; j < weight; j++) {
				if (j == i) {.;p,gvhjk
					memo = j, tmp = s[j] - 1;
				}
				else if (tmp > j - i) {
					memo = j, tmp = s[j] - 1;
				}
			}
			S[i] = (char)((s[memo] + K + 1) % 26 + 96);
			K = 0;
		}
	}*/

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

	return 0;
}
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 unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

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

char S[123456];
int K;

int main() {
	scanf("%s", &S);
	scanf("%d", &K);

	// fixed code
	int weight = strlen(S);
	for (int i = 0; i < weight; ++i){
		if (S[i] == 'a'){
			continue;
		}
		else if (K >= 'z' - S[i] + 1){
			K -= 'z' - S[i] + 1;
			S[i] = 'a';
		}
		
	}
	S[weight - 1] += K % 26;

	// Original code
	/*int weight = strlen(S);
	for (int i = 0; i < weight; ++i) {
		s[i] = S[i] - 96;
	}
	for (int i = 0; i < weight && K>0; ++i) {
		if (s[i] - 1 <= K) {
			K -= s[i] - 1;
			S[i] = 'a';
		}
		else {
			for (int j = i; j < weight; j++) {
				if (j == i) {.;p,gvhjk
					memo = j, tmp = s[j] - 1;
				}
				else if (tmp > j - i) {
					memo = j, tmp = s[j] - 1;
				}
			}
			S[i] = (char)((s[memo] + K + 1) % 26 + 96);
			K = 0;
		}
	}*/

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

	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	S
	.bss
	.align 32
	.type	S, @object
	.size	S, 123456
S:
	.zero	123456
	.globl	K
	.align 4
	.type	K, @object
	.size	K, 4
K:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.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	$16, %rsp
	leaq	S(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	K(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	S(%rip), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -4(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L2
.L5:
	movl	-8(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$97, %al
	je	.L7
	movl	-8(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	movl	$123, %edx
	subl	%eax, %edx
	movl	K(%rip), %eax
	cmpl	%eax, %edx
	jg	.L4
	movl	K(%rip), %edx
	movl	-8(%rbp), %eax
	cltq
	leaq	S(%rip), %rcx
	movzbl	(%rax,%rcx), %eax
	movsbl	%al, %eax
	movl	$123, %ecx
	subl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, K(%rip)
	movl	-8(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movb	$97, (%rax,%rdx)
	jmp	.L4
.L7:
	nop
.L4:
	addl	$1, -8(%rbp)
.L2:
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jl	.L5
	movl	-4(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movl	%eax, %esi
	movl	K(%rip), %eax
	movslq	%eax, %rdx
	imulq	$1321528399, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$3, %edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	imull	$26, %edx, %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	movl	%edx, %eax
	leal	(%rsi,%rax), %edx
	movl	-4(%rbp), %eax
	subl	$1, %eax
	movl	%edx, %ecx
	cltq
	leaq	S(%rip), %rdx
	movb	%cl, (%rax,%rdx)
	leaq	S(%rip), %rax
	movq	%rax, %rdi
	call	puts@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	S
	.bss
	.align 32
	.type	S, @object
	.size	S, 123456
S:
	.zero	123456
	.globl	K
	.align 4
	.type	K, @object
	.size	K, 4
K:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.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	$16, %rsp
	leaq	S(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	K(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	S(%rip), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -4(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L2
.L5:
	movl	-8(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$97, %al
	je	.L7
	movl	-8(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	movl	$123, %edx
	subl	%eax, %edx
	movl	K(%rip), %eax
	cmpl	%eax, %edx
	jg	.L4
	movl	K(%rip), %edx
	movl	-8(%rbp), %eax
	cltq
	leaq	S(%rip), %rcx
	movzbl	(%rax,%rcx), %eax
	movsbl	%al, %eax
	movl	$123, %ecx
	subl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, K(%rip)
	movl	-8(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movb	$97, (%rax,%rdx)
	jmp	.L4
.L7:
	nop
.L4:
	addl	$1, -8(%rbp)
.L2:
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jl	.L5
	movl	-4(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movl	%eax, %esi
	movl	K(%rip), %eax
	movslq	%eax, %rdx
	imulq	$1321528399, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$3, %edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	imull	$26, %edx, %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	movl	%edx, %eax
	leal	(%rsi,%rax), %edx
	movl	-4(%rbp), %eax
	subl	$1, %eax
	movl	%edx, %ecx
	cltq
	leaq	S(%rip), %rdx
	movb	%cl, (%rax,%rdx)
	leaq	S(%rip), %rax
	movq	%rax, %rdi
	call	puts@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:
