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 main(){
       int n,k,i;
       long s,x;
     
       scanf("%d %d %ld",&n,&k,&s);
       if (s<1000000000) x=s+1;
       else              x=s-1;
       if (k>0) printf("%ld",s);
       else     printf("%ld",x);
       for (i=1;i<k;i++) printf(" %ld",s);
       if (k==0) i=1;
       else      i=0;
       for (;i<n-k;i++) printf(" %ld",x);
       puts("");
       return 0;
    }```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d %ld"
.LC1:
	.string	"%ld"
.LC2:
	.string	" %ld"
.LC3:
	.string	""
	.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	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-24(%rbp), %rcx
	leaq	-32(%rbp), %rdx
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-24(%rbp), %rax
	cmpq	$999999999, %rax
	jg	.L2
	movq	-24(%rbp), %rax
	addq	$1, %rax
	movq	%rax, -16(%rbp)
	jmp	.L3
.L2:
	movq	-24(%rbp), %rax
	subq	$1, %rax
	movq	%rax, -16(%rbp)
.L3:
	movl	-32(%rbp), %eax
	testl	%eax, %eax
	jle	.L4
	movq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L5
.L4:
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L5:
	movl	$1, -28(%rbp)
	jmp	.L6
.L7:
	movq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -28(%rbp)
.L6:
	movl	-32(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L7
	movl	-32(%rbp), %eax
	testl	%eax, %eax
	jne	.L8
	movl	$1, -28(%rbp)
	jmp	.L10
.L8:
	movl	$0, -28(%rbp)
	jmp	.L10
.L11:
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -28(%rbp)
.L10:
	movl	-36(%rbp), %eax
	movl	-32(%rbp), %edx
	subl	%edx, %eax
	cmpl	%eax, -28(%rbp)
	jl	.L11
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	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 %ld"
.LC1:
	.string	"%ld"
.LC2:
	.string	" %ld"
.LC3:
	.string	""
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$32, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rdx
	leaq	16(%rsp), %rcx
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movq	16(%rsp), %rdx
	leaq	1(%rdx), %rax
	leaq	-1(%rdx), %r12
	cmpq	$999999999, %rdx
	cmovle	%rax, %r12
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jg	.L19
	movq	%r12, %rdx
.L19:
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	$1, %ebx
	call	__printf_chk@PLT
	movl	12(%rsp), %eax
	leaq	.LC2(%rip), %rbp
	cmpl	$1, %eax
	jle	.L7
	.p2align 4,,10
	.p2align 3
.L6:
	movq	16(%rsp), %rdx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__printf_chk@PLT
	movl	12(%rsp), %eax
	cmpl	%ebx, %eax
	jg	.L6
.L7:
	movl	8(%rsp), %edx
	xorl	%ebx, %ebx
	testl	%eax, %eax
	leaq	.LC2(%rip), %rbp
	sete	%bl
	subl	%eax, %edx
	cmpl	%edx, %ebx
	jge	.L9
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r12, %rdx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addl	$1, %ebx
	movl	8(%rsp), %eax
	subl	12(%rsp), %eax
	cmpl	%ebx, %eax
	jg	.L8
.L9:
	leaq	.LC3(%rip), %rdi
	call	puts@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L21
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L21:
	.cfi_restore_state
	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
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d %ld"
.LC1:
	.string	"%ld"
.LC2:
	.string	" %ld"
.LC3:
	.string	""
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$32, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rdx
	leaq	16(%rsp), %rcx
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movq	16(%rsp), %rdx
	leaq	1(%rdx), %rax
	leaq	-1(%rdx), %r12
	cmpq	$999999999, %rdx
	cmovle	%rax, %r12
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jg	.L19
	movq	%r12, %rdx
.L19:
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	$1, %ebx
	call	__printf_chk@PLT
	movl	12(%rsp), %eax
	leaq	.LC2(%rip), %rbp
	cmpl	$1, %eax
	jle	.L7
	.p2align 4,,10
	.p2align 3
.L6:
	movq	16(%rsp), %rdx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__printf_chk@PLT
	movl	12(%rsp), %eax
	cmpl	%ebx, %eax
	jg	.L6
.L7:
	movl	8(%rsp), %edx
	xorl	%ebx, %ebx
	testl	%eax, %eax
	leaq	.LC2(%rip), %rbp
	sete	%bl
	subl	%eax, %edx
	cmpl	%edx, %ebx
	jge	.L9
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r12, %rdx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addl	$1, %ebx
	movl	8(%rsp), %eax
	subl	12(%rsp), %eax
	cmpl	%ebx, %eax
	jg	.L8
.L9:
	leaq	.LC3(%rip), %rdi
	call	puts@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L21
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L21:
	.cfi_restore_state
	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:

    #include <stdio.h>
     
    int main(){
       int n,k,i;
       long s,x;
     
       scanf("%d %d %ld",&n,&k,&s);
       if (s<1000000000) x=s+1;
       else              x=s-1;
       if (k>0) printf("%ld",s);
       else     printf("%ld",x);
       for (i=1;i<k;i++) printf(" %ld",s);
       if (k==0) i=1;
       else      i=0;
       for (;i<n-k;i++) printf(" %ld",x);
       puts("");
       return 0;
    }
5 3 000
 5 0 100
 4 1 3
 5 3 010
 4 0 3
 10 3 010
 8 0 3
 10 5 010
 8 1 3
 10 5 000

0 0 0 1 1
 101 101 101 101 101
 3 4 4 4
 10 10 10 11 11
 4 4 4 4
 10 10 10 11 11 11 11 11 11 11
 4 4 4 4 4 4 4 4
 10 10 10 10 10 11 11 11 11 11
 3 4 4 4 4 4 4 4
 0 0 0 0 0 1 1 1 1 1

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 main(){
       int n,k,i;
       long s,x;
     
       scanf("%d %d %ld",&n,&k,&s);
       if (s<1000000000) x=s+1;
       else              x=s-1;
       if (k>0) printf("%ld",s);
       else     printf("%ld",x);
       for (i=1;i<k;i++) printf(" %ld",s);
       if (k==0) i=1;
       else      i=0;
       for (;i<n-k;i++) printf(" %ld",x);
       puts("");
       return 0;
    }```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d %ld"
.LC1:
	.string	"%ld"
.LC2:
	.string	" %ld"
.LC3:
	.string	""
	.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	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-24(%rbp), %rcx
	leaq	-32(%rbp), %rdx
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-24(%rbp), %rax
	cmpq	$999999999, %rax
	jg	.L2
	movq	-24(%rbp), %rax
	addq	$1, %rax
	movq	%rax, -16(%rbp)
	jmp	.L3
.L2:
	movq	-24(%rbp), %rax
	subq	$1, %rax
	movq	%rax, -16(%rbp)
.L3:
	movl	-32(%rbp), %eax
	testl	%eax, %eax
	jle	.L4
	movq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L5
.L4:
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L5:
	movl	$1, -28(%rbp)
	jmp	.L6
.L7:
	movq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -28(%rbp)
.L6:
	movl	-32(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L7
	movl	-32(%rbp), %eax
	testl	%eax, %eax
	jne	.L8
	movl	$1, -28(%rbp)
	jmp	.L10
.L8:
	movl	$0, -28(%rbp)
	jmp	.L10
.L11:
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -28(%rbp)
.L10:
	movl	-36(%rbp), %eax
	movl	-32(%rbp), %edx
	subl	%edx, %eax
	cmpl	%eax, -28(%rbp)
	jl	.L11
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	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
	.section	.rodata
.LC0:
	.string	"%d %d %ld"
.LC1:
	.string	"%ld"
.LC2:
	.string	" %ld"
.LC3:
	.string	""
	.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	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-24(%rbp), %rcx
	leaq	-32(%rbp), %rdx
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-24(%rbp), %rax
	cmpq	$999999999, %rax
	jg	.L2
	movq	-24(%rbp), %rax
	addq	$1, %rax
	movq	%rax, -16(%rbp)
	jmp	.L3
.L2:
	movq	-24(%rbp), %rax
	subq	$1, %rax
	movq	%rax, -16(%rbp)
.L3:
	movl	-32(%rbp), %eax
	testl	%eax, %eax
	jle	.L4
	movq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L5
.L4:
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L5:
	movl	$1, -28(%rbp)
	jmp	.L6
.L7:
	movq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -28(%rbp)
.L6:
	movl	-32(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L7
	movl	-32(%rbp), %eax
	testl	%eax, %eax
	jne	.L8
	movl	$1, -28(%rbp)
	jmp	.L10
.L8:
	movl	$0, -28(%rbp)
	jmp	.L10
.L11:
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -28(%rbp)
.L10:
	movl	-36(%rbp), %eax
	movl	-32(%rbp), %edx
	subl	%edx, %eax
	cmpl	%eax, -28(%rbp)
	jl	.L11
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	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:
