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(){
	long s;int i,d,min=999;
	scanf("%ld",&s);
	for(i=0;i<8;i++){
	d=abs(s%1000-753);
	min=(min>d?d:min);
	s/=10;
	}
printf("%d",min);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%ld"
.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	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$999, -24(%rbp)
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -28(%rbp)
	jmp	.L2
.L3:
	movq	-16(%rbp), %rcx
	movabsq	$2361183241434822607, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	movq	%rdx, %rax
	sarq	$7, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	subq	$753, %rax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	movl	%eax, -20(%rbp)
	movl	-24(%rbp), %edx
	movl	-20(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	%eax, -24(%rbp)
	movq	-16(%rbp), %rcx
	movabsq	$7378697629483820647, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	movq	%rdx, %rax
	sarq	$2, %rax
	sarq	$63, %rcx
	movq	%rcx, %rdx
	subq	%rdx, %rax
	movq	%rax, -16(%rbp)
	addl	$1, -28(%rbp)
.L2:
	cmpl	$7, -28(%rbp)
	jle	.L3
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L5
	call	__stack_chk_fail@PLT
.L5:
	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	"%ld"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movq	(%rsp), %r8
	movabsq	$2361183241434822607, %rsi
	movq	%r8, %rax
	movq	%r8, %rdi
	imulq	%rsi
	sarq	$63, %rdi
	movq	%r8, %rax
	sarq	$7, %rdx
	subq	%rdi, %rdx
	movq	%rdx, %r9
	imulq	$1000, %rdx, %rdx
	subq	%rdx, %rax
	movabsq	$7378697629483820647, %rdx
	subq	$753, %rax
	movl	%eax, %r11d
	negl	%r11d
	cmovs	%eax, %r11d
	movl	$999, %eax
	cmpl	%eax, %r11d
	cmovg	%eax, %r11d
	movq	%r8, %rax
	imulq	%rdx
	sarq	$2, %rdx
	movq	%rdx, %rcx
	subq	%rdi, %rcx
	movq	%rcx, %rax
	imulq	%rsi
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$7, %rdx
	subq	%rax, %rdx
	movq	%r8, %rax
	imulq	$1000, %rdx, %rdx
	subq	%rdx, %rcx
	movabsq	$-6640827866535438581, %rdx
	subq	$753, %rcx
	movl	%ecx, %r10d
	negl	%r10d
	cmovs	%ecx, %r10d
	cmpl	%r11d, %r10d
	cmovg	%r11d, %r10d
	imulq	%rdx
	leaq	(%rdx,%r8), %rcx
	sarq	$6, %rcx
	subq	%rdi, %rcx
	movq	%rcx, %rax
	imulq	%rsi
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$7, %rdx
	subq	%rax, %rdx
	imulq	$1000, %rdx, %rdx
	subq	%rdx, %rcx
	subq	$753, %rcx
	movl	%ecx, %eax
	negl	%eax
	cmovns	%eax, %ecx
	movq	%r9, %rax
	cmpl	%r10d, %ecx
	cmovg	%r10d, %ecx
	imulq	%rsi
	movq	%r9, %rax
	sarq	$63, %rax
	sarq	$7, %rdx
	subq	%rax, %rdx
	movq	%r8, %rax
	imulq	$1000, %rdx, %rdx
	subq	%rdx, %r9
	movabsq	$3777893186295716171, %rdx
	subq	$753, %r9
	movl	%r9d, %r10d
	negl	%r10d
	cmovs	%r9d, %r10d
	cmpl	%ecx, %r10d
	cmovg	%ecx, %r10d
	imulq	%rdx
	sarq	$11, %rdx
	movq	%rdx, %rcx
	subq	%rdi, %rcx
	movq	%rcx, %rax
	imulq	%rsi
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$7, %rdx
	subq	%rax, %rdx
	movq	%r8, %rax
	imulq	$1000, %rdx, %rdx
	subq	%rdx, %rcx
	movabsq	$3022314549036572937, %rdx
	subq	$753, %rcx
	movl	%ecx, %r9d
	negl	%r9d
	cmovs	%ecx, %r9d
	cmpl	%r10d, %r9d
	cmovg	%r10d, %r9d
	imulq	%rdx
	sarq	$14, %rdx
	movq	%rdx, %rcx
	subq	%rdi, %rcx
	movq	%rcx, %rax
	imulq	%rsi
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$7, %rdx
	subq	%rax, %rdx
	movq	%r8, %rax
	imulq	$1000, %rdx, %rdx
	subq	%rdx, %rcx
	movabsq	$4835703278458516699, %rdx
	subq	$753, %rcx
	movl	%ecx, %r10d
	negl	%r10d
	cmovs	%ecx, %r10d
	cmpl	%r9d, %r10d
	cmovg	%r9d, %r10d
	imulq	%rdx
	sarq	$18, %rdx
	movq	%rdx, %rcx
	subq	%rdi, %rcx
	movq	%rcx, %rax
	imulq	%rsi
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$7, %rdx
	subq	%rax, %rdx
	movq	%r8, %rax
	imulq	$1000, %rdx, %rdx
	subq	%rdx, %rcx
	movabsq	$6189700196426901375, %rdx
	subq	$753, %rcx
	movl	%ecx, %r9d
	negl	%r9d
	cmovs	%ecx, %r9d
	cmpl	%r10d, %r9d
	cmovg	%r10d, %r9d
	imulq	%rdx
	movq	%r8, %rax
	sarq	$25, %rdx
	subq	%rdi, %rdx
	movq	%rdx, (%rsp)
	movabsq	$-2972493582642298179, %rdx
	imulq	%rdx
	leaq	(%rdx,%r8), %rcx
	sarq	$23, %rcx
	subq	%rdi, %rcx
	movl	$1, %edi
	movq	%rcx, %rax
	imulq	%rsi
	movq	%rcx, %rax
	leaq	.LC1(%rip), %rsi
	sarq	$63, %rax
	sarq	$7, %rdx
	subq	%rax, %rdx
	imulq	$1000, %rdx, %rdx
	subq	%rdx, %rcx
	subq	$753, %rcx
	movl	%ecx, %edx
	negl	%edx
	cmovs	%ecx, %edx
	cmpl	%r9d, %edx
	cmovg	%r9d, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L5
	xorl	%eax, %eax
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L5:
	.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	"%ld"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movq	(%rsp), %r8
	movabsq	$2361183241434822607, %rsi
	movq	%r8, %rax
	movq	%r8, %rdi
	imulq	%rsi
	sarq	$63, %rdi
	movq	%r8, %rax
	sarq	$7, %rdx
	subq	%rdi, %rdx
	movq	%rdx, %r9
	imulq	$1000, %rdx, %rdx
	subq	%rdx, %rax
	movabsq	$7378697629483820647, %rdx
	subq	$753, %rax
	movl	%eax, %r11d
	negl	%r11d
	cmovs	%eax, %r11d
	movl	$999, %eax
	cmpl	%eax, %r11d
	cmovg	%eax, %r11d
	movq	%r8, %rax
	imulq	%rdx
	sarq	$2, %rdx
	movq	%rdx, %rcx
	subq	%rdi, %rcx
	movq	%rcx, %rax
	imulq	%rsi
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$7, %rdx
	subq	%rax, %rdx
	movq	%r8, %rax
	imulq	$1000, %rdx, %rdx
	subq	%rdx, %rcx
	movabsq	$-6640827866535438581, %rdx
	subq	$753, %rcx
	movl	%ecx, %r10d
	negl	%r10d
	cmovs	%ecx, %r10d
	cmpl	%r11d, %r10d
	cmovg	%r11d, %r10d
	imulq	%rdx
	leaq	(%rdx,%r8), %rcx
	sarq	$6, %rcx
	subq	%rdi, %rcx
	movq	%rcx, %rax
	imulq	%rsi
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$7, %rdx
	subq	%rax, %rdx
	imulq	$1000, %rdx, %rdx
	subq	%rdx, %rcx
	subq	$753, %rcx
	movl	%ecx, %eax
	negl	%eax
	cmovns	%eax, %ecx
	movq	%r9, %rax
	cmpl	%r10d, %ecx
	cmovg	%r10d, %ecx
	imulq	%rsi
	movq	%r9, %rax
	sarq	$63, %rax
	sarq	$7, %rdx
	subq	%rax, %rdx
	movq	%r8, %rax
	imulq	$1000, %rdx, %rdx
	subq	%rdx, %r9
	movabsq	$3777893186295716171, %rdx
	subq	$753, %r9
	movl	%r9d, %r10d
	negl	%r10d
	cmovs	%r9d, %r10d
	cmpl	%ecx, %r10d
	cmovg	%ecx, %r10d
	imulq	%rdx
	sarq	$11, %rdx
	movq	%rdx, %rcx
	subq	%rdi, %rcx
	movq	%rcx, %rax
	imulq	%rsi
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$7, %rdx
	subq	%rax, %rdx
	movq	%r8, %rax
	imulq	$1000, %rdx, %rdx
	subq	%rdx, %rcx
	movabsq	$3022314549036572937, %rdx
	subq	$753, %rcx
	movl	%ecx, %r9d
	negl	%r9d
	cmovs	%ecx, %r9d
	cmpl	%r10d, %r9d
	cmovg	%r10d, %r9d
	imulq	%rdx
	sarq	$14, %rdx
	movq	%rdx, %rcx
	subq	%rdi, %rcx
	movq	%rcx, %rax
	imulq	%rsi
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$7, %rdx
	subq	%rax, %rdx
	movq	%r8, %rax
	imulq	$1000, %rdx, %rdx
	subq	%rdx, %rcx
	movabsq	$4835703278458516699, %rdx
	subq	$753, %rcx
	movl	%ecx, %r10d
	negl	%r10d
	cmovs	%ecx, %r10d
	cmpl	%r9d, %r10d
	cmovg	%r9d, %r10d
	imulq	%rdx
	sarq	$18, %rdx
	movq	%rdx, %rcx
	subq	%rdi, %rcx
	movq	%rcx, %rax
	imulq	%rsi
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$7, %rdx
	subq	%rax, %rdx
	movq	%r8, %rax
	imulq	$1000, %rdx, %rdx
	subq	%rdx, %rcx
	movabsq	$6189700196426901375, %rdx
	subq	$753, %rcx
	movl	%ecx, %r9d
	negl	%r9d
	cmovs	%ecx, %r9d
	cmpl	%r10d, %r9d
	cmovg	%r10d, %r9d
	imulq	%rdx
	movq	%r8, %rax
	sarq	$25, %rdx
	subq	%rdi, %rdx
	movq	%rdx, (%rsp)
	movabsq	$-2972493582642298179, %rdx
	imulq	%rdx
	leaq	(%rdx,%r8), %rcx
	sarq	$23, %rcx
	subq	%rdi, %rcx
	movl	$1, %edi
	movq	%rcx, %rax
	imulq	%rsi
	movq	%rcx, %rax
	leaq	.LC1(%rip), %rsi
	sarq	$63, %rax
	sarq	$7, %rdx
	subq	%rax, %rdx
	imulq	$1000, %rdx, %rdx
	subq	%rdx, %rcx
	subq	$753, %rcx
	movl	%ecx, %edx
	negl	%edx
	cmovs	%ecx, %edx
	cmpl	%r9d, %edx
	cmovg	%r9d, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L5
	xorl	%eax, %eax
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L5:
	.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(){
	long s;int i,d,min=999;
	scanf("%ld",&s);
	for(i=0;i<8;i++){
	d=abs(s%1000-753);
	min=(min>d?d:min);
	s/=10;
	}
printf("%d",min);
}
43594
 1133184093
 1110111111
 80343
 1646883079
 93622
 978408132
 120326
 1514858721
 226242

159 87 642 50 65 131 31 427 32 129
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(){
	long s;int i,d,min=999;
	scanf("%ld",&s);
	for(i=0;i<8;i++){
	d=abs(s%1000-753);
	min=(min>d?d:min);
	s/=10;
	}
printf("%d",min);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%ld"
.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	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$999, -24(%rbp)
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -28(%rbp)
	jmp	.L2
.L3:
	movq	-16(%rbp), %rcx
	movabsq	$2361183241434822607, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	movq	%rdx, %rax
	sarq	$7, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	subq	$753, %rax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	movl	%eax, -20(%rbp)
	movl	-24(%rbp), %edx
	movl	-20(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	%eax, -24(%rbp)
	movq	-16(%rbp), %rcx
	movabsq	$7378697629483820647, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	movq	%rdx, %rax
	sarq	$2, %rax
	sarq	$63, %rcx
	movq	%rcx, %rdx
	subq	%rdx, %rax
	movq	%rax, -16(%rbp)
	addl	$1, -28(%rbp)
.L2:
	cmpl	$7, -28(%rbp)
	jle	.L3
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L5
	call	__stack_chk_fail@PLT
.L5:
	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	"%ld"
.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	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$999, -24(%rbp)
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -28(%rbp)
	jmp	.L2
.L3:
	movq	-16(%rbp), %rcx
	movabsq	$2361183241434822607, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	movq	%rdx, %rax
	sarq	$7, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	subq	$753, %rax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	movl	%eax, -20(%rbp)
	movl	-24(%rbp), %edx
	movl	-20(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	%eax, -24(%rbp)
	movq	-16(%rbp), %rcx
	movabsq	$7378697629483820647, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	movq	%rdx, %rax
	sarq	$2, %rax
	sarq	$63, %rcx
	movq	%rcx, %rdx
	subq	%rdx, %rax
	movq	%rax, -16(%rbp)
	addl	$1, -28(%rbp)
.L2:
	cmpl	$7, -28(%rbp)
	jle	.L3
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L5
	call	__stack_chk_fail@PLT
.L5:
	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:
