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

```c
// AOJ 2728: Change a Password
// 2017.10.8 bal4u@uu

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

#define ABS(a) ((a)>=0?(a):-(a))
#define MIN(a,b) ((a)<=(b)?(a):(b))

char s[11], t[11], x[11]; int n;
long long  ns, pow10, diff;
char c['9'+1];

void try(int i, int mode)
{
	int j;
	long long a, b;

	if (i >= n) {
		for (a = 0, j = 0; j < n; j++) a = 10*a + (t[j]-'0');
		b = MIN(ABS(ns-a), pow10-ABS(ns-a));
		if (b > diff) diff = b, memcpy(x, t, sizeof(x));
		return;
	}
	if (mode) {
		for (j = '9'; c[j] && j >= '0'; j--);
		c[j] = 1; t[i] = j;
		try(i+1, mode);
	} else {
		for (j = '0'; c[j] && j <= '9'; j++);
		c[j] = 1; t[i] = j;
		try(i+1, mode);
	}
}

int main()
{
	int i, j;
	char *ans;

	scanf("%s", s); n = strlen(s);
	ns = 0, pow10 = 1; 
	for (i = 0; i < n; i++)
		ns = 10*ns + (s[i]-'0'), pow10 = 10*pow10;

	if (s[0] >= '5') t[0] = s[0]-5; else t[0] = s[0]+5;
	c[t[0]] = 1;
	for (i = 1; i < n; i++) {
		j = s[i];
		if (c[j]) break;
		t[i] = j, c[j] = 1;
	}

	if (i == n) ans = t;
	else {
		char c0['9'+1], t0[11]; int i0;
		diff = 0, ans = x, i0 = i;
		i0 = i, memcpy(c0, c, sizeof(c0)), memcpy(t0, t, sizeof(t0));
		for (j = s[i]-1; c[j] && j >= '0'; j--);
		if (j < '0') {
			for (j = i-1; j >= 0 && t[j] == '0'; j--) c['0'] = 0;
			i = j;
			for (c[t[i]] = 0, j = t[i]-1; c[j] && j >= '0'; j--);
		}
		c[j] = 1; t[i] = j;
		try(i+1, 1);

		i = i0, memcpy(c, c0, sizeof(c0)), memcpy(t, t0, sizeof(t0));
		for (j = s[i]+1; c[j] && j <= '9'; j++);
		if (j > '9') {
			for (j = i-1; j >= 0 && t[j] == '9'; j--) c['9'] = 0;
			i = j;
			for (c[t[i]] = 0, j = t[i]+1; c[j] && j <= '9'; j++);
		}
		c[j] = 1; t[i] = j;
		try(i+1, 0);
	}
	puts(ans);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	s
	.bss
	.align 8
	.type	s, @object
	.size	s, 11
s:
	.zero	11
	.globl	t
	.align 8
	.type	t, @object
	.size	t, 11
t:
	.zero	11
	.globl	x
	.align 8
	.type	x, @object
	.size	x, 11
x:
	.zero	11
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	ns
	.align 8
	.type	ns, @object
	.size	ns, 8
ns:
	.zero	8
	.globl	pow10
	.align 8
	.type	pow10, @object
	.size	pow10, 8
pow10:
	.zero	8
	.globl	diff
	.align 8
	.type	diff, @object
	.size	diff, 8
diff:
	.zero	8
	.globl	c
	.align 32
	.type	c, @object
	.size	c, 58
c:
	.zero	58
	.text
	.globl	try
	.type	try, @function
try:
.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
	movl	%edi, -36(%rbp)
	movl	%esi, -40(%rbp)
	movl	n(%rip), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L2
	movq	$0, -16(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L3
.L4:
	movq	-16(%rbp), %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	movq	%rax, %rcx
	movl	-20(%rbp), %eax
	cltq
	leaq	t(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	subl	$48, %eax
	cltq
	addq	%rcx, %rax
	movq	%rax, -16(%rbp)
	addl	$1, -20(%rbp)
.L3:
	movl	n(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L4
	movq	ns(%rip), %rax
	subq	-16(%rbp), %rax
	movq	%rax, %rdx
	negq	%rdx
	cmovs	%rax, %rdx
	movq	pow10(%rip), %rcx
	movq	ns(%rip), %rax
	subq	-16(%rbp), %rax
	movq	%rax, %rsi
	negq	%rsi
	cmovs	%rax, %rsi
	movq	%rcx, %rax
	subq	%rsi, %rax
	cmpq	%rax, %rdx
	cmovle	%rdx, %rax
	movq	%rax, -8(%rbp)
	movq	diff(%rip), %rax
	cmpq	%rax, -8(%rbp)
	jle	.L14
	movq	-8(%rbp), %rax
	movq	%rax, diff(%rip)
	movq	t(%rip), %rax
	movq	%rax, x(%rip)
	movzwl	8+t(%rip), %eax
	movw	%ax, 8+x(%rip)
	movzbl	10+t(%rip), %eax
	movb	%al, 10+x(%rip)
	jmp	.L14
.L2:
	cmpl	$0, -40(%rbp)
	je	.L7
	movl	$57, -20(%rbp)
	jmp	.L8
.L10:
	subl	$1, -20(%rbp)
.L8:
	movl	-20(%rbp), %eax
	cltq
	leaq	c(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	je	.L9
	cmpl	$47, -20(%rbp)
	jg	.L10
.L9:
	movl	-20(%rbp), %eax
	cltq
	leaq	c(%rip), %rdx
	movb	$1, (%rax,%rdx)
	movl	-20(%rbp), %eax
	movl	%eax, %ecx
	movl	-36(%rbp), %eax
	cltq
	leaq	t(%rip), %rdx
	movb	%cl, (%rax,%rdx)
	movl	-36(%rbp), %eax
	leal	1(%rax), %edx
	movl	-40(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	try
	jmp	.L1
.L7:
	movl	$48, -20(%rbp)
	jmp	.L11
.L13:
	addl	$1, -20(%rbp)
.L11:
	movl	-20(%rbp), %eax
	cltq
	leaq	c(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	je	.L12
	cmpl	$57, -20(%rbp)
	jle	.L13
.L12:
	movl	-20(%rbp), %eax
	cltq
	leaq	c(%rip), %rdx
	movb	$1, (%rax,%rdx)
	movl	-20(%rbp), %eax
	movl	%eax, %ecx
	movl	-36(%rbp), %eax
	cltq
	leaq	t(%rip), %rdx
	movb	%cl, (%rax,%rdx)
	movl	-36(%rbp), %eax
	leal	1(%rax), %edx
	movl	-40(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	try
	jmp	.L1
.L14:
	nop
.L1:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	try, .-try
	.section	.rodata
.LC0:
	.string	"%s"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	addq	$-128, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	s(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	s(%rip), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, n(%rip)
	movq	$0, ns(%rip)
	movq	$1, pow10(%rip)
	movl	$0, -116(%rbp)
	jmp	.L16
.L17:
	movq	ns(%rip), %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	movq	%rax, %rcx
	movl	-116(%rbp), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	subl	$48, %eax
	cltq
	addq	%rcx, %rax
	movq	%rax, ns(%rip)
	movq	pow10(%rip), %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	movq	%rax, pow10(%rip)
	addl	$1, -116(%rbp)
.L16:
	movl	n(%rip), %eax
	cmpl	%eax, -116(%rbp)
	jl	.L17
	movzbl	s(%rip), %eax
	cmpb	$52, %al
	jle	.L18
	movzbl	s(%rip), %eax
	subl	$5, %eax
	movb	%al, t(%rip)
	jmp	.L19
.L18:
	movzbl	s(%rip), %eax
	addl	$5, %eax
	movb	%al, t(%rip)
.L19:
	movzbl	t(%rip), %eax
	movsbl	%al, %eax
	cltq
	leaq	c(%rip), %rdx
	movb	$1, (%rax,%rdx)
	movl	$1, -116(%rbp)
	jmp	.L20
.L23:
	movl	-116(%rbp), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	movl	%eax, -112(%rbp)
	movl	-112(%rbp), %eax
	cltq
	leaq	c(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	jne	.L46
	movl	-112(%rbp), %eax
	movl	%eax, %ecx
	movl	-116(%rbp), %eax
	cltq
	leaq	t(%rip), %rdx
	movb	%cl, (%rax,%rdx)
	movl	-112(%rbp), %eax
	cltq
	leaq	c(%rip), %rdx
	movb	$1, (%rax,%rdx)
	addl	$1, -116(%rbp)
.L20:
	movl	n(%rip), %eax
	cmpl	%eax, -116(%rbp)
	jl	.L23
	jmp	.L22
.L46:
	nop
.L22:
	movl	n(%rip), %eax
	cmpl	%eax, -116(%rbp)
	jne	.L24
	leaq	t(%rip), %rax
	movq	%rax, -104(%rbp)
	jmp	.L25
.L24:
	movq	$0, diff(%rip)
	leaq	x(%rip), %rax
	movq	%rax, -104(%rbp)
	movl	-116(%rbp), %eax
	movl	%eax, -108(%rbp)
	movl	-116(%rbp), %eax
	movl	%eax, -108(%rbp)
	movq	c(%rip), %rax
	movq	8+c(%rip), %rdx
	movq	%rax, -80(%rbp)
	movq	%rdx, -72(%rbp)
	movq	16+c(%rip), %rax
	movq	24+c(%rip), %rdx
	movq	%rax, -64(%rbp)
	movq	%rdx, -56(%rbp)
	movq	32+c(%rip), %rax
	movq	40+c(%rip), %rdx
	movq	%rax, -48(%rbp)
	movq	%rdx, -40(%rbp)
	movq	48+c(%rip), %rax
	movq	%rax, -32(%rbp)
	movzwl	56+c(%rip), %eax
	movw	%ax, -24(%rbp)
	movq	t(%rip), %rax
	movq	%rax, -91(%rbp)
	movzwl	8+t(%rip), %eax
	movw	%ax, -83(%rbp)
	movzbl	10+t(%rip), %eax
	movb	%al, -81(%rbp)
	movl	-116(%rbp), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	subl	$1, %eax
	movl	%eax, -112(%rbp)
	jmp	.L26
.L28:
	subl	$1, -112(%rbp)
.L26:
	movl	-112(%rbp), %eax
	cltq
	leaq	c(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	je	.L27
	cmpl	$47, -112(%rbp)
	jg	.L28
.L27:
	cmpl	$47, -112(%rbp)
	jg	.L29
	movl	-116(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -112(%rbp)
	jmp	.L30
.L32:
	movb	$0, 48+c(%rip)
	subl	$1, -112(%rbp)
.L30:
	cmpl	$0, -112(%rbp)
	js	.L31
	movl	-112(%rbp), %eax
	cltq
	leaq	t(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$48, %al
	je	.L32
.L31:
	movl	-112(%rbp), %eax
	movl	%eax, -116(%rbp)
	movl	-116(%rbp), %eax
	cltq
	leaq	t(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	cltq
	leaq	c(%rip), %rdx
	movb	$0, (%rax,%rdx)
	movl	-116(%rbp), %eax
	cltq
	leaq	t(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	subl	$1, %eax
	movl	%eax, -112(%rbp)
	jmp	.L33
.L34:
	subl	$1, -112(%rbp)
.L33:
	movl	-112(%rbp), %eax
	cltq
	leaq	c(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	je	.L29
	cmpl	$47, -112(%rbp)
	jg	.L34
.L29:
	movl	-112(%rbp), %eax
	cltq
	leaq	c(%rip), %rdx
	movb	$1, (%rax,%rdx)
	movl	-112(%rbp), %eax
	movl	%eax, %ecx
	movl	-116(%rbp), %eax
	cltq
	leaq	t(%rip), %rdx
	movb	%cl, (%rax,%rdx)
	movl	-116(%rbp), %eax
	addl	$1, %eax
	movl	$1, %esi
	movl	%eax, %edi
	call	try
	movl	-108(%rbp), %eax
	movl	%eax, -116(%rbp)
	movq	-80(%rbp), %rax
	movq	-72(%rbp), %rdx
	movq	%rax, c(%rip)
	movq	%rdx, 8+c(%rip)
	movq	-64(%rbp), %rax
	movq	-56(%rbp), %rdx
	movq	%rax, 16+c(%rip)
	movq	%rdx, 24+c(%rip)
	movq	-48(%rbp), %rax
	movq	-40(%rbp), %rdx
	movq	%rax, 32+c(%rip)
	movq	%rdx, 40+c(%rip)
	movq	-32(%rbp), %rax
	movq	%rax, 48+c(%rip)
	movzwl	-24(%rbp), %eax
	movw	%ax, 56+c(%rip)
	movq	-91(%rbp), %rax
	movq	%rax, t(%rip)
	movzwl	-83(%rbp), %eax
	movw	%ax, 8+t(%rip)
	movzbl	-81(%rbp), %eax
	movb	%al, 10+t(%rip)
	movl	-116(%rbp), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	addl	$1, %eax
	movl	%eax, -112(%rbp)
	jmp	.L35
.L37:
	addl	$1, -112(%rbp)
.L35:
	movl	-112(%rbp), %eax
	cltq
	leaq	c(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	je	.L36
	cmpl	$57, -112(%rbp)
	jle	.L37
.L36:
	cmpl	$57, -112(%rbp)
	jle	.L38
	movl	-116(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -112(%rbp)
	jmp	.L39
.L41:
	movb	$0, 57+c(%rip)
	subl	$1, -112(%rbp)
.L39:
	cmpl	$0, -112(%rbp)
	js	.L40
	movl	-112(%rbp), %eax
	cltq
	leaq	t(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$57, %al
	je	.L41
.L40:
	movl	-112(%rbp), %eax
	movl	%eax, -116(%rbp)
	movl	-116(%rbp), %eax
	cltq
	leaq	t(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	cltq
	leaq	c(%rip), %rdx
	movb	$0, (%rax,%rdx)
	movl	-116(%rbp), %eax
	cltq
	leaq	t(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	addl	$1, %eax
	movl	%eax, -112(%rbp)
	jmp	.L42
.L43:
	addl	$1, -112(%rbp)
.L42:
	movl	-112(%rbp), %eax
	cltq
	leaq	c(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	je	.L38
	cmpl	$57, -112(%rbp)
	jle	.L43
.L38:
	movl	-112(%rbp), %eax
	cltq
	leaq	c(%rip), %rdx
	movb	$1, (%rax,%rdx)
	movl	-112(%rbp), %eax
	movl	%eax, %ecx
	movl	-116(%rbp), %eax
	cltq
	leaq	t(%rip), %rdx
	movb	%cl, (%rax,%rdx)
	movl	-116(%rbp), %eax
	addl	$1, %eax
	movl	$0, %esi
	movl	%eax, %edi
	call	try
.L25:
	movq	-104(%rbp), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L45
	call	__stack_chk_fail@PLT
.L45:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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
	.p2align 4
	.globl	try
	.type	try, @function
try:
.LFB35:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	movl	n(%rip), %edi
	cmpl	%edi, %eax
	jge	.L2
	testl	%esi, %esi
	je	.L65
	movslq	%eax, %rcx
	leaq	t(%rip), %rdx
	leaq	1+t(%rip), %r8
	addq	%rcx, %r8
	addq	%rcx, %rdx
	leal	-1(%rdi), %ecx
	subl	%eax, %ecx
	leaq	c(%rip), %rsi
	addq	%rcx, %r8
	.p2align 4,,10
	.p2align 3
.L11:
	cmpb	$0, 57+c(%rip)
	je	.L15
	cmpb	$0, 56+c(%rip)
	je	.L16
	cmpb	$0, 55+c(%rip)
	je	.L17
	cmpb	$0, 54+c(%rip)
	je	.L18
	cmpb	$0, 53+c(%rip)
	je	.L19
	cmpb	$0, 52+c(%rip)
	je	.L20
	cmpb	$0, 51+c(%rip)
	je	.L21
	cmpb	$0, 50+c(%rip)
	je	.L22
	cmpb	$0, 49+c(%rip)
	je	.L23
	movzbl	48+c(%rip), %eax
	negb	%al
	movzbl	48+c(%rip), %eax
	sbbb	%cl, %cl
	addl	$48, %ecx
	negb	%al
	sbbl	%eax, %eax
	addl	$48, %eax
.L10:
	movb	%cl, (%rdx)
	cltq
	addq	$1, %rdx
	movb	$1, (%rsi,%rax)
	cmpq	%rdx, %r8
	jne	.L11
.L2:
	testl	%edi, %edi
	jle	.L14
.L66:
	movsbl	t(%rip), %eax
	subl	$48, %eax
	cltq
	cmpl	$1, %edi
	je	.L5
	movsbl	1+t(%rip), %edx
	leaq	(%rax,%rax,4), %rax
	subl	$48, %edx
	movslq	%edx, %rdx
	leaq	(%rdx,%rax,2), %rax
	cmpl	$2, %edi
	je	.L5
	leaq	(%rax,%rax,4), %rdx
	movsbl	2+t(%rip), %eax
	subl	$48, %eax
	cltq
	leaq	(%rax,%rdx,2), %rax
	cmpl	$3, %edi
	je	.L5
	leaq	(%rax,%rax,4), %rdx
	movsbl	3+t(%rip), %eax
	subl	$48, %eax
	cltq
	leaq	(%rax,%rdx,2), %rax
	cmpl	$4, %edi
	je	.L5
	leaq	(%rax,%rax,4), %rdx
	movsbl	4+t(%rip), %eax
	subl	$48, %eax
	cltq
	leaq	(%rax,%rdx,2), %rax
	cmpl	$5, %edi
	je	.L5
	leaq	(%rax,%rax,4), %rdx
	movsbl	5+t(%rip), %eax
	subl	$48, %eax
	cltq
	leaq	(%rax,%rdx,2), %rax
	cmpl	$6, %edi
	je	.L5
	leaq	(%rax,%rax,4), %rdx
	movsbl	6+t(%rip), %eax
	subl	$48, %eax
	cltq
	leaq	(%rax,%rdx,2), %rax
	cmpl	$7, %edi
	je	.L5
	leaq	(%rax,%rax,4), %rdx
	movsbl	7+t(%rip), %eax
	subl	$48, %eax
	cltq
	leaq	(%rax,%rdx,2), %rax
	cmpl	$8, %edi
	je	.L5
	leaq	(%rax,%rax,4), %rdx
	movsbl	8+t(%rip), %eax
	subl	$48, %eax
	cltq
	leaq	(%rax,%rdx,2), %rax
	cmpl	$9, %edi
	je	.L5
	leaq	(%rax,%rax,4), %rdx
	movsbl	9+t(%rip), %eax
	subl	$48, %eax
	cltq
	leaq	(%rax,%rdx,2), %rax
	cmpl	$10, %edi
	je	.L5
	leaq	(%rax,%rax,4), %rdx
	movsbl	10+t(%rip), %eax
	subl	$48, %eax
	cltq
	leaq	(%rax,%rdx,2), %rax
.L5:
	movq	ns(%rip), %rcx
	subq	%rax, %rcx
	movq	pow10(%rip), %rax
	movq	%rcx, %rdx
	negq	%rdx
	cmovs	%rcx, %rdx
	subq	%rdx, %rax
	cmpq	%rdx, %rax
	cmovg	%rdx, %rax
	cmpq	%rax, diff(%rip)
	jge	.L1
	movq	%rax, diff(%rip)
	movq	t(%rip), %rax
	movq	%rax, x(%rip)
	movzwl	8+t(%rip), %eax
	movw	%ax, 8+x(%rip)
	movzbl	10+t(%rip), %eax
	movb	%al, 10+x(%rip)
	ret
	.p2align 4,,10
	.p2align 3
.L1:
	ret
.L15:
	movl	$57, %ecx
	movl	$57, %eax
	jmp	.L10
.L16:
	movl	$56, %ecx
	movl	$56, %eax
	jmp	.L10
.L17:
	movl	$55, %ecx
	movl	$55, %eax
	jmp	.L10
.L18:
	movl	$54, %ecx
	movl	$54, %eax
	jmp	.L10
.L19:
	movl	$53, %ecx
	movl	$53, %eax
	jmp	.L10
.L65:
	movslq	%eax, %rcx
	leaq	t(%rip), %rdx
	leaq	1+t(%rip), %r8
	addq	%rcx, %r8
	addq	%rcx, %rdx
	leal	-1(%rdi), %ecx
	subl	%eax, %ecx
	leaq	c(%rip), %rsi
	addq	%rcx, %r8
	.p2align 4,,10
	.p2align 3
.L13:
	cmpb	$0, 48+c(%rip)
	movl	$48, %ecx
	movl	$48, %eax
	je	.L9
	cmpb	$0, 49+c(%rip)
	je	.L25
	cmpb	$0, 50+c(%rip)
	je	.L26
	cmpb	$0, 51+c(%rip)
	je	.L27
	cmpb	$0, 52+c(%rip)
	je	.L28
	cmpb	$0, 53+c(%rip)
	je	.L29
	cmpb	$0, 54+c(%rip)
	je	.L30
	cmpb	$0, 55+c(%rip)
	je	.L31
	cmpb	$1, 56+c(%rip)
	movl	$56, %eax
	sbbl	$-1, %eax
.L12:
	movl	%eax, %ecx
.L9:
	movb	%cl, (%rdx)
	cltq
	addq	$1, %rdx
	movb	$1, (%rsi,%rax)
	cmpq	%r8, %rdx
	jne	.L13
	testl	%edi, %edi
	jg	.L66
.L14:
	xorl	%eax, %eax
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L25:
	movl	$49, %eax
	jmp	.L12
.L26:
	movl	$50, %eax
	jmp	.L12
.L27:
	movl	$51, %eax
	jmp	.L12
.L28:
	movl	$52, %eax
	jmp	.L12
.L29:
	movl	$53, %eax
	jmp	.L12
.L30:
	movl	$54, %eax
	jmp	.L12
.L31:
	movl	$55, %eax
	jmp	.L12
.L20:
	movl	$52, %ecx
	movl	$52, %eax
	jmp	.L10
.L21:
	movl	$51, %ecx
	movl	$51, %eax
	jmp	.L10
.L22:
	movl	$50, %ecx
	movl	$50, %eax
	jmp	.L10
.L23:
	movl	$49, %ecx
	movl	$49, %eax
	jmp	.L10
	.cfi_endproc
.LFE35:
	.size	try, .-try
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB36:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	s(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movq	%rbp, %rsi
	subq	$96, %rsp
	.cfi_def_cfa_offset 144
	movq	%fs:40, %rax
	movq	%rax, 88(%rsp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%rbp, %rdi
	call	strlen@PLT
	movq	$0, ns(%rip)
	movl	%eax, n(%rip)
	movq	%rax, %rdx
	movq	$1, pow10(%rip)
	testq	%rax, %rax
	je	.L68
	movsbl	s(%rip), %eax
	subl	$48, %eax
	cltq
	cmpl	$1, %edx
	je	.L98
	movsbl	1+s(%rip), %ecx
	leaq	(%rax,%rax,4), %rax
	subl	$48, %ecx
	movslq	%ecx, %rcx
	leaq	(%rcx,%rax,2), %rax
	cmpl	$2, %edx
	je	.L99
	movsbl	2+s(%rip), %ecx
	leaq	(%rax,%rax,4), %rax
	subl	$48, %ecx
	movslq	%ecx, %rcx
	leaq	(%rcx,%rax,2), %rax
	cmpl	$3, %edx
	je	.L100
	movsbl	3+s(%rip), %ecx
	imulq	$10, %rax, %rax
	subl	$48, %ecx
	movslq	%ecx, %rcx
	addq	%rcx, %rax
	cmpl	$4, %edx
	je	.L101
	movsbl	4+s(%rip), %ecx
	imulq	$10, %rax, %rax
	subl	$48, %ecx
	movslq	%ecx, %rcx
	addq	%rcx, %rax
	cmpl	$5, %edx
	je	.L102
	movsbl	5+s(%rip), %ecx
	imulq	$10, %rax, %rax
	subl	$48, %ecx
	movslq	%ecx, %rcx
	addq	%rcx, %rax
	cmpl	$6, %edx
	je	.L103
	movsbl	6+s(%rip), %ecx
	imulq	$10, %rax, %rax
	subl	$48, %ecx
	movslq	%ecx, %rcx
	addq	%rcx, %rax
	cmpl	$7, %edx
	je	.L104
	movsbl	7+s(%rip), %ecx
	imulq	$10, %rax, %rax
	subl	$48, %ecx
	movslq	%ecx, %rcx
	addq	%rcx, %rax
	cmpl	$8, %edx
	je	.L105
	movsbl	8+s(%rip), %ecx
	imulq	$10, %rax, %rax
	subl	$48, %ecx
	movslq	%ecx, %rcx
	addq	%rcx, %rax
	cmpl	$10, %edx
	jne	.L106
	movsbl	9+s(%rip), %ecx
	imulq	$10, %rax, %rax
	subl	$48, %ecx
	movslq	%ecx, %rcx
	addq	%rcx, %rax
	movl	$9765625, %ecx
	salq	$10, %rcx
.L69:
	movq	%rax, ns(%rip)
	movq	%rcx, pow10(%rip)
.L68:
	movzbl	s(%rip), %eax
	leaq	c(%rip), %r9
	leal	-5(%rax), %ecx
	leal	5(%rax), %r8d
	cmpb	$53, %al
	cmovge	%ecx, %r8d
	movsbq	%r8b, %rax
	movb	%r8b, t(%rip)
	movb	$1, (%r9,%rax)
	cmpq	$1, %rdx
	jbe	.L107
	movsbq	1+s(%rip), %rax
	cmpb	$0, (%r9,%rax)
	jne	.L108
	movb	%al, 1+t(%rip)
	movb	$1, (%r9,%rax)
	cmpl	$2, %edx
	je	.L109
	movsbq	2+s(%rip), %rax
	cmpb	$0, (%r9,%rax)
	jne	.L110
	movb	%al, 2+t(%rip)
	movb	$1, (%r9,%rax)
	cmpl	$3, %edx
	je	.L111
	movsbq	3+s(%rip), %rax
	cmpb	$0, (%r9,%rax)
	jne	.L112
	movb	%al, 3+t(%rip)
	movb	$1, (%r9,%rax)
	cmpl	$4, %edx
	je	.L113
	movsbq	4+s(%rip), %rax
	cmpb	$0, (%r9,%rax)
	jne	.L114
	movb	%al, 4+t(%rip)
	movb	$1, (%r9,%rax)
	cmpl	$5, %edx
	je	.L115
	movsbq	5+s(%rip), %rax
	cmpb	$0, (%r9,%rax)
	jne	.L116
	movb	%al, 5+t(%rip)
	movb	$1, (%r9,%rax)
	cmpl	$6, %edx
	je	.L117
	movsbq	6+s(%rip), %rax
	cmpb	$0, (%r9,%rax)
	jne	.L118
	movb	%al, 6+t(%rip)
	movb	$1, (%r9,%rax)
	cmpl	$7, %edx
	je	.L119
	movsbq	7+s(%rip), %rax
	cmpb	$0, (%r9,%rax)
	jne	.L120
	movb	%al, 7+t(%rip)
	movb	$1, (%r9,%rax)
	cmpl	$8, %edx
	je	.L121
	movsbq	8+s(%rip), %rax
	cmpb	$0, (%r9,%rax)
	jne	.L122
	movb	%al, 8+t(%rip)
	movb	$1, (%r9,%rax)
	cmpl	$10, %edx
	jne	.L123
	movsbq	9+s(%rip), %rax
	cmpb	$0, (%r9,%rax)
	jne	.L124
	movb	%al, 9+t(%rip)
	movl	$10, %r10d
	movb	$1, (%r9,%rax)
.L72:
	leaq	t(%rip), %rdi
	cmpl	%r10d, %edx
	je	.L75
.L96:
	leaq	16(%rsp), %r13
	leaq	5(%rsp), %r12
	movslq	%r10d, %rbx
	movq	%r9, %rsi
	leaq	t(%rip), %r11
	movl	$58, %ecx
	movq	%r13, %rdi
	movq	$0, diff(%rip)
	rep movsb
	movl	$11, %ecx
	movq	%r12, %rdi
	movq	%r11, %rsi
	rep movsb
	movsbq	0(%rbp,%rbx), %rsi
	leal	-1(%rsi), %edx
	movq	%rsi, %rcx
	movslq	%edx, %r14
	cmpb	$0, (%r9,%r14)
	je	.L76
	cmpl	$47, %edx
	jle	.L77
	leal	-2(%rsi), %eax
	subq	$3, %rcx
	leal	-49(%rsi), %edx
	cltq
	subq	%rdx, %rcx
	jmp	.L78
	.p2align 4,,10
	.p2align 3
.L200:
	subq	$1, %rax
	cmpq	%rcx, %rax
	je	.L77
.L78:
	cmpb	$0, (%r9,%rax)
	movl	%eax, %edx
	jne	.L200
.L76:
	cmpl	$47, %edx
	jle	.L77
	movl	%r10d, %edi
	movslq	%edx, %r14
	movslq	%r10d, %rsi
.L79:
	movb	$1, (%r9,%r14)
	addl	$1, %edi
	movb	%dl, (%r11,%rsi)
	movl	$1, %esi
	call	try
	movl	$58, %ecx
	movq	%r9, %rdi
	movq	%r13, %rsi
	rep movsb
	movl	$11, %ecx
	movq	%r11, %rdi
	movq	%r12, %rsi
	rep movsb
	movsbq	0(%rbp,%rbx), %rdi
	leal	1(%rdi), %edx
	movslq	%edx, %rcx
	cmpb	$0, (%r9,%rcx)
	je	.L86
	cmpl	$57, %edx
	jg	.L87
	movl	$56, %edx
	leal	2(%rdi), %eax
	subl	%edi, %edx
	cltq
	leaq	3(%rdi,%rdx), %rcx
	jmp	.L88
	.p2align 4,,10
	.p2align 3
.L201:
	addq	$1, %rax
	cmpq	%rcx, %rax
	je	.L87
.L88:
	cmpb	$0, (%r9,%rax)
	movl	%eax, %edx
	jne	.L201
.L86:
	movslq	%edx, %rcx
	cmpl	$57, %edx
	jg	.L87
.L89:
	movb	$1, (%r9,%rcx)
	leal	1(%r10), %edi
	xorl	%esi, %esi
	movb	%dl, (%r11,%rbx)
	call	try
	leaq	x(%rip), %rdi
.L75:
	call	puts@PLT
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L202
	addq	$96, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L87:
	.cfi_restore_state
	leal	-1(%r10), %eax
	movslq	%eax, %rdx
	cmpb	$57, (%r11,%rdx)
	jne	.L90
	leal	-2(%r10), %eax
	cmpl	$1, %r10d
	je	.L91
	movslq	%eax, %rdx
	cmpb	$57, (%r11,%rdx)
	jne	.L92
	leal	-3(%r10), %eax
	cmpl	$2, %r10d
	je	.L91
	movslq	%eax, %rdx
	cmpb	$57, (%r11,%rdx)
	jne	.L92
	leal	-4(%r10), %eax
	cmpl	$3, %r10d
	je	.L91
	movslq	%eax, %rdx
	cmpb	$57, (%r11,%rdx)
	jne	.L92
	leal	-5(%r10), %eax
	cmpl	$4, %r10d
	je	.L91
	movslq	%eax, %rdx
	cmpb	$57, (%r11,%rdx)
	jne	.L92
	leal	-6(%r10), %eax
	cmpl	$5, %r10d
	je	.L91
	movslq	%eax, %rdx
	cmpb	$57, (%r11,%rdx)
	jne	.L92
	leal	-7(%r10), %eax
	cmpl	$6, %r10d
	je	.L91
	movslq	%eax, %rdx
	cmpb	$57, (%r11,%rdx)
	jne	.L92
	leal	-8(%r10), %eax
	cmpl	$7, %r10d
	je	.L91
	movslq	%eax, %rdx
	cmpb	$57, (%r11,%rdx)
	jne	.L92
	leal	-9(%r10), %eax
	cmpl	$8, %r10d
	je	.L91
	movslq	%eax, %rdx
	cmpb	$57, (%r11,%rdx)
	jne	.L92
	cmpl	$9, %r10d
	je	.L91
	cmpb	$57, t(%rip)
	jne	.L203
.L91:
	movb	$0, 57+c(%rip)
	orl	$-1, %r10d
.L94:
	movslq	%r10d, %rbx
	movsbq	(%r11,%rbx), %rdx
	movb	$0, (%r9,%rdx)
	movq	%rdx, %rax
	leal	1(%rdx), %edx
	movslq	%edx, %rcx
	cmpb	$0, (%r9,%rcx)
	je	.L89
	cmpl	$57, %edx
	jg	.L89
	addl	$2, %eax
	cltq
	.p2align 4,,10
	.p2align 3
.L95:
	cmpb	$0, (%r9,%rax)
	movl	%eax, %edx
	setne	%sil
	cmpl	$57, %eax
	setle	%cl
	addq	$1, %rax
	testb	%cl, %sil
	jne	.L95
	movslq	%edx, %rcx
	jmp	.L89
.L77:
	leal	-1(%r10), %edi
	movslq	%edi, %rsi
	cmpb	$48, (%r11,%rsi)
	jne	.L84
	leal	-2(%r10), %edi
	cmpl	$1, %r10d
	je	.L81
	movslq	%edi, %rsi
	cmpb	$48, (%r11,%rsi)
	jne	.L82
	leal	-3(%r10), %edi
	cmpl	$2, %r10d
	je	.L81
	movslq	%edi, %rsi
	cmpb	$48, (%r11,%rsi)
	jne	.L82
	leal	-4(%r10), %edi
	cmpl	$3, %r10d
	je	.L81
	movslq	%edi, %rsi
	cmpb	$48, (%r11,%rsi)
	jne	.L82
	leal	-5(%r10), %edi
	cmpl	$4, %r10d
	je	.L81
	movslq	%edi, %rsi
	cmpb	$48, (%r11,%rsi)
	jne	.L82
	leal	-6(%r10), %edi
	cmpl	$5, %r10d
	je	.L81
	movslq	%edi, %rsi
	cmpb	$48, (%r11,%rsi)
	jne	.L82
	leal	-7(%r10), %edi
	cmpl	$6, %r10d
	je	.L81
	movslq	%edi, %rsi
	cmpb	$48, (%r11,%rsi)
	jne	.L82
	leal	-8(%r10), %edi
	cmpl	$7, %r10d
	je	.L81
	movslq	%edi, %rsi
	cmpb	$48, (%r11,%rsi)
	jne	.L82
	leal	-9(%r10), %edi
	cmpl	$8, %r10d
	je	.L81
	movslq	%edi, %rsi
	cmpb	$48, (%r11,%rsi)
	jne	.L82
	cmpl	$9, %r10d
	je	.L81
	cmpb	$48, %r8b
	jne	.L204
.L81:
	movb	$0, 48+c(%rip)
	orl	$-1, %edi
	orq	$-1, %rsi
.L84:
	movsbq	(%r11,%rsi), %rdx
	movb	$0, (%r9,%rdx)
	movq	%rdx, %rax
	leal	-1(%rdx), %edx
	movslq	%edx, %r14
	cmpb	$0, (%r9,%r14)
	je	.L79
	cmpl	$47, %edx
	jle	.L79
	subl	$2, %eax
	cltq
	.p2align 4,,10
	.p2align 3
.L85:
	cmpb	$0, (%r9,%rax)
	movl	%eax, %edx
	setne	%r8b
	cmpl	$47, %eax
	setg	%cl
	subq	$1, %rax
	testb	%cl, %r8b
	jne	.L85
	movslq	%edx, %r14
	jmp	.L79
.L102:
	movl	$100000, %ecx
	jmp	.L69
.L204:
	xorl	%edi, %edi
	xorl	%esi, %esi
.L82:
	movb	$0, 48+c(%rip)
	jmp	.L84
.L203:
	xorl	%eax, %eax
.L92:
	movb	$0, 57+c(%rip)
.L90:
	movl	%eax, %r10d
	jmp	.L94
.L98:
	movl	$10, %ecx
	jmp	.L69
.L99:
	movl	$100, %ecx
	jmp	.L69
.L100:
	movl	$1000, %ecx
	jmp	.L69
.L101:
	movl	$10000, %ecx
	jmp	.L69
.L107:
	movl	$1, %r10d
	jmp	.L72
.L103:
	movl	$1000000, %ecx
	jmp	.L69
.L108:
	movl	$1, %r10d
	jmp	.L96
.L119:
	movl	$7, %r10d
	jmp	.L72
.L109:
	movl	$2, %r10d
	jmp	.L72
.L104:
	movl	$10000000, %ecx
	jmp	.L69
.L110:
	movl	$2, %r10d
	jmp	.L96
.L111:
	movl	$3, %r10d
	jmp	.L72
.L105:
	movl	$100000000, %ecx
	jmp	.L69
.L112:
	movl	$3, %r10d
	jmp	.L96
.L113:
	movl	$4, %r10d
	jmp	.L72
.L106:
	movl	$1000000000, %ecx
	jmp	.L69
.L114:
	movl	$4, %r10d
	jmp	.L96
.L115:
	movl	$5, %r10d
	jmp	.L72
.L116:
	movl	$5, %r10d
	jmp	.L96
.L117:
	movl	$6, %r10d
	jmp	.L72
.L118:
	movl	$6, %r10d
	jmp	.L96
.L120:
	movl	$7, %r10d
	jmp	.L96
.L121:
	movl	$8, %r10d
	jmp	.L72
.L122:
	movl	$8, %r10d
	jmp	.L96
.L123:
	movl	$9, %r10d
	jmp	.L72
.L124:
	movl	$9, %r10d
	jmp	.L96
.L202:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE36:
	.size	main, .-main
	.globl	c
	.bss
	.align 32
	.type	c, @object
	.size	c, 58
c:
	.zero	58
	.globl	diff
	.align 8
	.type	diff, @object
	.size	diff, 8
diff:
	.zero	8
	.globl	pow10
	.align 8
	.type	pow10, @object
	.size	pow10, 8
pow10:
	.zero	8
	.globl	ns
	.align 8
	.type	ns, @object
	.size	ns, 8
ns:
	.zero	8
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	x
	.align 8
	.type	x, @object
	.size	x, 11
x:
	.zero	11
	.globl	t
	.align 8
	.type	t, @object
	.size	t, 11
t:
	.zero	11
	.globl	s
	.align 8
	.type	s, @object
	.size	s, 11
s:
	.zero	11
	.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
	.p2align 4
	.globl	try
	.type	try, @function
try:
.LFB35:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	movl	n(%rip), %edi
	cmpl	%edi, %eax
	jge	.L2
	testl	%esi, %esi
	je	.L65
	movslq	%eax, %rcx
	leaq	t(%rip), %rdx
	leaq	1+t(%rip), %r8
	addq	%rcx, %r8
	addq	%rcx, %rdx
	leal	-1(%rdi), %ecx
	subl	%eax, %ecx
	leaq	c(%rip), %rsi
	addq	%rcx, %r8
	.p2align 4,,10
	.p2align 3
.L11:
	cmpb	$0, 57+c(%rip)
	je	.L15
	cmpb	$0, 56+c(%rip)
	je	.L16
	cmpb	$0, 55+c(%rip)
	je	.L17
	cmpb	$0, 54+c(%rip)
	je	.L18
	cmpb	$0, 53+c(%rip)
	je	.L19
	cmpb	$0, 52+c(%rip)
	je	.L20
	cmpb	$0, 51+c(%rip)
	je	.L21
	cmpb	$0, 50+c(%rip)
	je	.L22
	cmpb	$0, 49+c(%rip)
	je	.L23
	movzbl	48+c(%rip), %eax
	negb	%al
	movzbl	48+c(%rip), %eax
	sbbb	%cl, %cl
	addl	$48, %ecx
	negb	%al
	sbbl	%eax, %eax
	addl	$48, %eax
.L10:
	movb	%cl, (%rdx)
	cltq
	addq	$1, %rdx
	movb	$1, (%rsi,%rax)
	cmpq	%rdx, %r8
	jne	.L11
.L2:
	testl	%edi, %edi
	jle	.L14
.L66:
	movsbl	t(%rip), %eax
	subl	$48, %eax
	cltq
	cmpl	$1, %edi
	je	.L5
	movsbl	1+t(%rip), %edx
	leaq	(%rax,%rax,4), %rax
	subl	$48, %edx
	movslq	%edx, %rdx
	leaq	(%rdx,%rax,2), %rax
	cmpl	$2, %edi
	je	.L5
	leaq	(%rax,%rax,4), %rdx
	movsbl	2+t(%rip), %eax
	subl	$48, %eax
	cltq
	leaq	(%rax,%rdx,2), %rax
	cmpl	$3, %edi
	je	.L5
	leaq	(%rax,%rax,4), %rdx
	movsbl	3+t(%rip), %eax
	subl	$48, %eax
	cltq
	leaq	(%rax,%rdx,2), %rax
	cmpl	$4, %edi
	je	.L5
	leaq	(%rax,%rax,4), %rdx
	movsbl	4+t(%rip), %eax
	subl	$48, %eax
	cltq
	leaq	(%rax,%rdx,2), %rax
	cmpl	$5, %edi
	je	.L5
	leaq	(%rax,%rax,4), %rdx
	movsbl	5+t(%rip), %eax
	subl	$48, %eax
	cltq
	leaq	(%rax,%rdx,2), %rax
	cmpl	$6, %edi
	je	.L5
	leaq	(%rax,%rax,4), %rdx
	movsbl	6+t(%rip), %eax
	subl	$48, %eax
	cltq
	leaq	(%rax,%rdx,2), %rax
	cmpl	$7, %edi
	je	.L5
	leaq	(%rax,%rax,4), %rdx
	movsbl	7+t(%rip), %eax
	subl	$48, %eax
	cltq
	leaq	(%rax,%rdx,2), %rax
	cmpl	$8, %edi
	je	.L5
	leaq	(%rax,%rax,4), %rdx
	movsbl	8+t(%rip), %eax
	subl	$48, %eax
	cltq
	leaq	(%rax,%rdx,2), %rax
	cmpl	$9, %edi
	je	.L5
	leaq	(%rax,%rax,4), %rdx
	movsbl	9+t(%rip), %eax
	subl	$48, %eax
	cltq
	leaq	(%rax,%rdx,2), %rax
	cmpl	$10, %edi
	je	.L5
	leaq	(%rax,%rax,4), %rdx
	movsbl	10+t(%rip), %eax
	subl	$48, %eax
	cltq
	leaq	(%rax,%rdx,2), %rax
.L5:
	movq	ns(%rip), %rcx
	subq	%rax, %rcx
	movq	pow10(%rip), %rax
	movq	%rcx, %rdx
	negq	%rdx
	cmovs	%rcx, %rdx
	subq	%rdx, %rax
	cmpq	%rdx, %rax
	cmovg	%rdx, %rax
	cmpq	%rax, diff(%rip)
	jge	.L1
	movq	%rax, diff(%rip)
	movq	t(%rip), %rax
	movq	%rax, x(%rip)
	movzwl	8+t(%rip), %eax
	movw	%ax, 8+x(%rip)
	movzbl	10+t(%rip), %eax
	movb	%al, 10+x(%rip)
	ret
	.p2align 4,,10
	.p2align 3
.L1:
	ret
.L15:
	movl	$57, %ecx
	movl	$57, %eax
	jmp	.L10
.L16:
	movl	$56, %ecx
	movl	$56, %eax
	jmp	.L10
.L17:
	movl	$55, %ecx
	movl	$55, %eax
	jmp	.L10
.L18:
	movl	$54, %ecx
	movl	$54, %eax
	jmp	.L10
.L19:
	movl	$53, %ecx
	movl	$53, %eax
	jmp	.L10
.L65:
	movslq	%eax, %rcx
	leaq	t(%rip), %rdx
	leaq	1+t(%rip), %r8
	addq	%rcx, %r8
	addq	%rcx, %rdx
	leal	-1(%rdi), %ecx
	subl	%eax, %ecx
	leaq	c(%rip), %rsi
	addq	%rcx, %r8
	.p2align 4,,10
	.p2align 3
.L13:
	cmpb	$0, 48+c(%rip)
	movl	$48, %ecx
	movl	$48, %eax
	je	.L9
	cmpb	$0, 49+c(%rip)
	je	.L25
	cmpb	$0, 50+c(%rip)
	je	.L26
	cmpb	$0, 51+c(%rip)
	je	.L27
	cmpb	$0, 52+c(%rip)
	je	.L28
	cmpb	$0, 53+c(%rip)
	je	.L29
	cmpb	$0, 54+c(%rip)
	je	.L30
	cmpb	$0, 55+c(%rip)
	je	.L31
	cmpb	$1, 56+c(%rip)
	movl	$56, %eax
	sbbl	$-1, %eax
.L12:
	movl	%eax, %ecx
.L9:
	movb	%cl, (%rdx)
	cltq
	addq	$1, %rdx
	movb	$1, (%rsi,%rax)
	cmpq	%r8, %rdx
	jne	.L13
	testl	%edi, %edi
	jg	.L66
.L14:
	xorl	%eax, %eax
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L25:
	movl	$49, %eax
	jmp	.L12
.L26:
	movl	$50, %eax
	jmp	.L12
.L27:
	movl	$51, %eax
	jmp	.L12
.L28:
	movl	$52, %eax
	jmp	.L12
.L29:
	movl	$53, %eax
	jmp	.L12
.L30:
	movl	$54, %eax
	jmp	.L12
.L31:
	movl	$55, %eax
	jmp	.L12
.L20:
	movl	$52, %ecx
	movl	$52, %eax
	jmp	.L10
.L21:
	movl	$51, %ecx
	movl	$51, %eax
	jmp	.L10
.L22:
	movl	$50, %ecx
	movl	$50, %eax
	jmp	.L10
.L23:
	movl	$49, %ecx
	movl	$49, %eax
	jmp	.L10
	.cfi_endproc
.LFE35:
	.size	try, .-try
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB36:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	s(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movq	%rbp, %rsi
	subq	$96, %rsp
	.cfi_def_cfa_offset 144
	movq	%fs:40, %rax
	movq	%rax, 88(%rsp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%rbp, %rdi
	call	strlen@PLT
	movq	$0, ns(%rip)
	movl	%eax, n(%rip)
	movq	%rax, %rdx
	movq	$1, pow10(%rip)
	testq	%rax, %rax
	je	.L68
	movsbl	s(%rip), %eax
	subl	$48, %eax
	cltq
	cmpl	$1, %edx
	je	.L98
	movsbl	1+s(%rip), %ecx
	leaq	(%rax,%rax,4), %rax
	subl	$48, %ecx
	movslq	%ecx, %rcx
	leaq	(%rcx,%rax,2), %rax
	cmpl	$2, %edx
	je	.L99
	movsbl	2+s(%rip), %ecx
	leaq	(%rax,%rax,4), %rax
	subl	$48, %ecx
	movslq	%ecx, %rcx
	leaq	(%rcx,%rax,2), %rax
	cmpl	$3, %edx
	je	.L100
	movsbl	3+s(%rip), %ecx
	imulq	$10, %rax, %rax
	subl	$48, %ecx
	movslq	%ecx, %rcx
	addq	%rcx, %rax
	cmpl	$4, %edx
	je	.L101
	movsbl	4+s(%rip), %ecx
	imulq	$10, %rax, %rax
	subl	$48, %ecx
	movslq	%ecx, %rcx
	addq	%rcx, %rax
	cmpl	$5, %edx
	je	.L102
	movsbl	5+s(%rip), %ecx
	imulq	$10, %rax, %rax
	subl	$48, %ecx
	movslq	%ecx, %rcx
	addq	%rcx, %rax
	cmpl	$6, %edx
	je	.L103
	movsbl	6+s(%rip), %ecx
	imulq	$10, %rax, %rax
	subl	$48, %ecx
	movslq	%ecx, %rcx
	addq	%rcx, %rax
	cmpl	$7, %edx
	je	.L104
	movsbl	7+s(%rip), %ecx
	imulq	$10, %rax, %rax
	subl	$48, %ecx
	movslq	%ecx, %rcx
	addq	%rcx, %rax
	cmpl	$8, %edx
	je	.L105
	movsbl	8+s(%rip), %ecx
	imulq	$10, %rax, %rax
	subl	$48, %ecx
	movslq	%ecx, %rcx
	addq	%rcx, %rax
	cmpl	$10, %edx
	jne	.L106
	movsbl	9+s(%rip), %ecx
	imulq	$10, %rax, %rax
	subl	$48, %ecx
	movslq	%ecx, %rcx
	addq	%rcx, %rax
	movl	$9765625, %ecx
	salq	$10, %rcx
.L69:
	movq	%rax, ns(%rip)
	movq	%rcx, pow10(%rip)
.L68:
	movzbl	s(%rip), %eax
	leaq	c(%rip), %r9
	leal	-5(%rax), %ecx
	leal	5(%rax), %r8d
	cmpb	$53, %al
	cmovge	%ecx, %r8d
	movsbq	%r8b, %rax
	movb	%r8b, t(%rip)
	movb	$1, (%r9,%rax)
	cmpq	$1, %rdx
	jbe	.L107
	movsbq	1+s(%rip), %rax
	cmpb	$0, (%r9,%rax)
	jne	.L108
	movb	%al, 1+t(%rip)
	movb	$1, (%r9,%rax)
	cmpl	$2, %edx
	je	.L109
	movsbq	2+s(%rip), %rax
	cmpb	$0, (%r9,%rax)
	jne	.L110
	movb	%al, 2+t(%rip)
	movb	$1, (%r9,%rax)
	cmpl	$3, %edx
	je	.L111
	movsbq	3+s(%rip), %rax
	cmpb	$0, (%r9,%rax)
	jne	.L112
	movb	%al, 3+t(%rip)
	movb	$1, (%r9,%rax)
	cmpl	$4, %edx
	je	.L113
	movsbq	4+s(%rip), %rax
	cmpb	$0, (%r9,%rax)
	jne	.L114
	movb	%al, 4+t(%rip)
	movb	$1, (%r9,%rax)
	cmpl	$5, %edx
	je	.L115
	movsbq	5+s(%rip), %rax
	cmpb	$0, (%r9,%rax)
	jne	.L116
	movb	%al, 5+t(%rip)
	movb	$1, (%r9,%rax)
	cmpl	$6, %edx
	je	.L117
	movsbq	6+s(%rip), %rax
	cmpb	$0, (%r9,%rax)
	jne	.L118
	movb	%al, 6+t(%rip)
	movb	$1, (%r9,%rax)
	cmpl	$7, %edx
	je	.L119
	movsbq	7+s(%rip), %rax
	cmpb	$0, (%r9,%rax)
	jne	.L120
	movb	%al, 7+t(%rip)
	movb	$1, (%r9,%rax)
	cmpl	$8, %edx
	je	.L121
	movsbq	8+s(%rip), %rax
	cmpb	$0, (%r9,%rax)
	jne	.L122
	movb	%al, 8+t(%rip)
	movb	$1, (%r9,%rax)
	cmpl	$10, %edx
	jne	.L123
	movsbq	9+s(%rip), %rax
	cmpb	$0, (%r9,%rax)
	jne	.L124
	movb	%al, 9+t(%rip)
	movl	$10, %r10d
	movb	$1, (%r9,%rax)
.L72:
	leaq	t(%rip), %rdi
	cmpl	%r10d, %edx
	je	.L75
.L96:
	leaq	16(%rsp), %r13
	leaq	5(%rsp), %r12
	movslq	%r10d, %rbx
	movq	%r9, %rsi
	leaq	t(%rip), %r11
	movl	$58, %ecx
	movq	%r13, %rdi
	movq	$0, diff(%rip)
	rep movsb
	movl	$11, %ecx
	movq	%r12, %rdi
	movq	%r11, %rsi
	rep movsb
	movsbq	0(%rbp,%rbx), %rsi
	leal	-1(%rsi), %edx
	movq	%rsi, %rcx
	movslq	%edx, %r14
	cmpb	$0, (%r9,%r14)
	je	.L76
	cmpl	$47, %edx
	jle	.L77
	leal	-2(%rsi), %eax
	subq	$3, %rcx
	leal	-49(%rsi), %edx
	cltq
	subq	%rdx, %rcx
	jmp	.L78
	.p2align 4,,10
	.p2align 3
.L200:
	subq	$1, %rax
	cmpq	%rcx, %rax
	je	.L77
.L78:
	cmpb	$0, (%r9,%rax)
	movl	%eax, %edx
	jne	.L200
.L76:
	cmpl	$47, %edx
	jle	.L77
	movl	%r10d, %edi
	movslq	%edx, %r14
	movslq	%r10d, %rsi
.L79:
	movb	$1, (%r9,%r14)
	addl	$1, %edi
	movb	%dl, (%r11,%rsi)
	movl	$1, %esi
	call	try
	movl	$58, %ecx
	movq	%r9, %rdi
	movq	%r13, %rsi
	rep movsb
	movl	$11, %ecx
	movq	%r11, %rdi
	movq	%r12, %rsi
	rep movsb
	movsbq	0(%rbp,%rbx), %rdi
	leal	1(%rdi), %edx
	movslq	%edx, %rcx
	cmpb	$0, (%r9,%rcx)
	je	.L86
	cmpl	$57, %edx
	jg	.L87
	movl	$56, %edx
	leal	2(%rdi), %eax
	subl	%edi, %edx
	cltq
	leaq	3(%rdi,%rdx), %rcx
	jmp	.L88
	.p2align 4,,10
	.p2align 3
.L201:
	addq	$1, %rax
	cmpq	%rcx, %rax
	je	.L87
.L88:
	cmpb	$0, (%r9,%rax)
	movl	%eax, %edx
	jne	.L201
.L86:
	movslq	%edx, %rcx
	cmpl	$57, %edx
	jg	.L87
.L89:
	movb	$1, (%r9,%rcx)
	leal	1(%r10), %edi
	xorl	%esi, %esi
	movb	%dl, (%r11,%rbx)
	call	try
	leaq	x(%rip), %rdi
.L75:
	call	puts@PLT
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L202
	addq	$96, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L87:
	.cfi_restore_state
	leal	-1(%r10), %eax
	movslq	%eax, %rdx
	cmpb	$57, (%r11,%rdx)
	jne	.L90
	leal	-2(%r10), %eax
	cmpl	$1, %r10d
	je	.L91
	movslq	%eax, %rdx
	cmpb	$57, (%r11,%rdx)
	jne	.L92
	leal	-3(%r10), %eax
	cmpl	$2, %r10d
	je	.L91
	movslq	%eax, %rdx
	cmpb	$57, (%r11,%rdx)
	jne	.L92
	leal	-4(%r10), %eax
	cmpl	$3, %r10d
	je	.L91
	movslq	%eax, %rdx
	cmpb	$57, (%r11,%rdx)
	jne	.L92
	leal	-5(%r10), %eax
	cmpl	$4, %r10d
	je	.L91
	movslq	%eax, %rdx
	cmpb	$57, (%r11,%rdx)
	jne	.L92
	leal	-6(%r10), %eax
	cmpl	$5, %r10d
	je	.L91
	movslq	%eax, %rdx
	cmpb	$57, (%r11,%rdx)
	jne	.L92
	leal	-7(%r10), %eax
	cmpl	$6, %r10d
	je	.L91
	movslq	%eax, %rdx
	cmpb	$57, (%r11,%rdx)
	jne	.L92
	leal	-8(%r10), %eax
	cmpl	$7, %r10d
	je	.L91
	movslq	%eax, %rdx
	cmpb	$57, (%r11,%rdx)
	jne	.L92
	leal	-9(%r10), %eax
	cmpl	$8, %r10d
	je	.L91
	movslq	%eax, %rdx
	cmpb	$57, (%r11,%rdx)
	jne	.L92
	cmpl	$9, %r10d
	je	.L91
	cmpb	$57, t(%rip)
	jne	.L203
.L91:
	movb	$0, 57+c(%rip)
	orl	$-1, %r10d
.L94:
	movslq	%r10d, %rbx
	movsbq	(%r11,%rbx), %rdx
	movb	$0, (%r9,%rdx)
	movq	%rdx, %rax
	leal	1(%rdx), %edx
	movslq	%edx, %rcx
	cmpb	$0, (%r9,%rcx)
	je	.L89
	cmpl	$57, %edx
	jg	.L89
	addl	$2, %eax
	cltq
	.p2align 4,,10
	.p2align 3
.L95:
	cmpb	$0, (%r9,%rax)
	movl	%eax, %edx
	setne	%sil
	cmpl	$57, %eax
	setle	%cl
	addq	$1, %rax
	testb	%cl, %sil
	jne	.L95
	movslq	%edx, %rcx
	jmp	.L89
.L77:
	leal	-1(%r10), %edi
	movslq	%edi, %rsi
	cmpb	$48, (%r11,%rsi)
	jne	.L84
	leal	-2(%r10), %edi
	cmpl	$1, %r10d
	je	.L81
	movslq	%edi, %rsi
	cmpb	$48, (%r11,%rsi)
	jne	.L82
	leal	-3(%r10), %edi
	cmpl	$2, %r10d
	je	.L81
	movslq	%edi, %rsi
	cmpb	$48, (%r11,%rsi)
	jne	.L82
	leal	-4(%r10), %edi
	cmpl	$3, %r10d
	je	.L81
	movslq	%edi, %rsi
	cmpb	$48, (%r11,%rsi)
	jne	.L82
	leal	-5(%r10), %edi
	cmpl	$4, %r10d
	je	.L81
	movslq	%edi, %rsi
	cmpb	$48, (%r11,%rsi)
	jne	.L82
	leal	-6(%r10), %edi
	cmpl	$5, %r10d
	je	.L81
	movslq	%edi, %rsi
	cmpb	$48, (%r11,%rsi)
	jne	.L82
	leal	-7(%r10), %edi
	cmpl	$6, %r10d
	je	.L81
	movslq	%edi, %rsi
	cmpb	$48, (%r11,%rsi)
	jne	.L82
	leal	-8(%r10), %edi
	cmpl	$7, %r10d
	je	.L81
	movslq	%edi, %rsi
	cmpb	$48, (%r11,%rsi)
	jne	.L82
	leal	-9(%r10), %edi
	cmpl	$8, %r10d
	je	.L81
	movslq	%edi, %rsi
	cmpb	$48, (%r11,%rsi)
	jne	.L82
	cmpl	$9, %r10d
	je	.L81
	cmpb	$48, %r8b
	jne	.L204
.L81:
	movb	$0, 48+c(%rip)
	orl	$-1, %edi
	orq	$-1, %rsi
.L84:
	movsbq	(%r11,%rsi), %rdx
	movb	$0, (%r9,%rdx)
	movq	%rdx, %rax
	leal	-1(%rdx), %edx
	movslq	%edx, %r14
	cmpb	$0, (%r9,%r14)
	je	.L79
	cmpl	$47, %edx
	jle	.L79
	subl	$2, %eax
	cltq
	.p2align 4,,10
	.p2align 3
.L85:
	cmpb	$0, (%r9,%rax)
	movl	%eax, %edx
	setne	%r8b
	cmpl	$47, %eax
	setg	%cl
	subq	$1, %rax
	testb	%cl, %r8b
	jne	.L85
	movslq	%edx, %r14
	jmp	.L79
.L102:
	movl	$100000, %ecx
	jmp	.L69
.L204:
	xorl	%edi, %edi
	xorl	%esi, %esi
.L82:
	movb	$0, 48+c(%rip)
	jmp	.L84
.L203:
	xorl	%eax, %eax
.L92:
	movb	$0, 57+c(%rip)
.L90:
	movl	%eax, %r10d
	jmp	.L94
.L98:
	movl	$10, %ecx
	jmp	.L69
.L99:
	movl	$100, %ecx
	jmp	.L69
.L100:
	movl	$1000, %ecx
	jmp	.L69
.L101:
	movl	$10000, %ecx
	jmp	.L69
.L107:
	movl	$1, %r10d
	jmp	.L72
.L103:
	movl	$1000000, %ecx
	jmp	.L69
.L108:
	movl	$1, %r10d
	jmp	.L96
.L119:
	movl	$7, %r10d
	jmp	.L72
.L109:
	movl	$2, %r10d
	jmp	.L72
.L104:
	movl	$10000000, %ecx
	jmp	.L69
.L110:
	movl	$2, %r10d
	jmp	.L96
.L111:
	movl	$3, %r10d
	jmp	.L72
.L105:
	movl	$100000000, %ecx
	jmp	.L69
.L112:
	movl	$3, %r10d
	jmp	.L96
.L113:
	movl	$4, %r10d
	jmp	.L72
.L106:
	movl	$1000000000, %ecx
	jmp	.L69
.L114:
	movl	$4, %r10d
	jmp	.L96
.L115:
	movl	$5, %r10d
	jmp	.L72
.L116:
	movl	$5, %r10d
	jmp	.L96
.L117:
	movl	$6, %r10d
	jmp	.L72
.L118:
	movl	$6, %r10d
	jmp	.L96
.L120:
	movl	$7, %r10d
	jmp	.L96
.L121:
	movl	$8, %r10d
	jmp	.L72
.L122:
	movl	$8, %r10d
	jmp	.L96
.L123:
	movl	$9, %r10d
	jmp	.L72
.L124:
	movl	$9, %r10d
	jmp	.L96
.L202:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE36:
	.size	main, .-main
	.globl	c
	.bss
	.align 32
	.type	c, @object
	.size	c, 58
c:
	.zero	58
	.globl	diff
	.align 8
	.type	diff, @object
	.size	diff, 8
diff:
	.zero	8
	.globl	pow10
	.align 8
	.type	pow10, @object
	.size	pow10, 8
pow10:
	.zero	8
	.globl	ns
	.align 8
	.type	ns, @object
	.size	ns, 8
ns:
	.zero	8
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	x
	.align 8
	.type	x, @object
	.size	x, 11
x:
	.zero	11
	.globl	t
	.align 8
	.type	t, @object
	.size	t, 11
t:
	.zero	11
	.globl	s
	.align 8
	.type	s, @object
	.size	s, 11
s:
	.zero	11
	.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 2728: Change a Password
// 2017.10.8 bal4u@uu

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

#define ABS(a) ((a)>=0?(a):-(a))
#define MIN(a,b) ((a)<=(b)?(a):(b))

char s[11], t[11], x[11]; int n;
long long  ns, pow10, diff;
char c['9'+1];

void try(int i, int mode)
{
	int j;
	long long a, b;

	if (i >= n) {
		for (a = 0, j = 0; j < n; j++) a = 10*a + (t[j]-'0');
		b = MIN(ABS(ns-a), pow10-ABS(ns-a));
		if (b > diff) diff = b, memcpy(x, t, sizeof(x));
		return;
	}
	if (mode) {
		for (j = '9'; c[j] && j >= '0'; j--);
		c[j] = 1; t[i] = j;
		try(i+1, mode);
	} else {
		for (j = '0'; c[j] && j <= '9'; j++);
		c[j] = 1; t[i] = j;
		try(i+1, mode);
	}
}

int main()
{
	int i, j;
	char *ans;

	scanf("%s", s); n = strlen(s);
	ns = 0, pow10 = 1; 
	for (i = 0; i < n; i++)
		ns = 10*ns + (s[i]-'0'), pow10 = 10*pow10;

	if (s[0] >= '5') t[0] = s[0]-5; else t[0] = s[0]+5;
	c[t[0]] = 1;
	for (i = 1; i < n; i++) {
		j = s[i];
		if (c[j]) break;
		t[i] = j, c[j] = 1;
	}

	if (i == n) ans = t;
	else {
		char c0['9'+1], t0[11]; int i0;
		diff = 0, ans = x, i0 = i;
		i0 = i, memcpy(c0, c, sizeof(c0)), memcpy(t0, t, sizeof(t0));
		for (j = s[i]-1; c[j] && j >= '0'; j--);
		if (j < '0') {
			for (j = i-1; j >= 0 && t[j] == '0'; j--) c['0'] = 0;
			i = j;
			for (c[t[i]] = 0, j = t[i]-1; c[j] && j >= '0'; j--);
		}
		c[j] = 1; t[i] = j;
		try(i+1, 1);

		i = i0, memcpy(c, c0, sizeof(c0)), memcpy(t, t0, sizeof(t0));
		for (j = s[i]+1; c[j] && j <= '9'; j++);
		if (j > '9') {
			for (j = i-1; j >= 0 && t[j] == '9'; j--) c['9'] = 0;
			i = j;
			for (c[t[i]] = 0, j = t[i]+1; c[j] && j <= '9'; j++);
		}
		c[j] = 1; t[i] = j;
		try(i+1, 0);
	}
	puts(ans);
	return 0;
}
27
 36
 44
 57
 76
 148
 2
 4
 3
 5

76
 86
 94
 07
 26
 648
 7
 9
 8
 0

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

```c
// AOJ 2728: Change a Password
// 2017.10.8 bal4u@uu

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

#define ABS(a) ((a)>=0?(a):-(a))
#define MIN(a,b) ((a)<=(b)?(a):(b))

char s[11], t[11], x[11]; int n;
long long  ns, pow10, diff;
char c['9'+1];

void try(int i, int mode)
{
	int j;
	long long a, b;

	if (i >= n) {
		for (a = 0, j = 0; j < n; j++) a = 10*a + (t[j]-'0');
		b = MIN(ABS(ns-a), pow10-ABS(ns-a));
		if (b > diff) diff = b, memcpy(x, t, sizeof(x));
		return;
	}
	if (mode) {
		for (j = '9'; c[j] && j >= '0'; j--);
		c[j] = 1; t[i] = j;
		try(i+1, mode);
	} else {
		for (j = '0'; c[j] && j <= '9'; j++);
		c[j] = 1; t[i] = j;
		try(i+1, mode);
	}
}

int main()
{
	int i, j;
	char *ans;

	scanf("%s", s); n = strlen(s);
	ns = 0, pow10 = 1; 
	for (i = 0; i < n; i++)
		ns = 10*ns + (s[i]-'0'), pow10 = 10*pow10;

	if (s[0] >= '5') t[0] = s[0]-5; else t[0] = s[0]+5;
	c[t[0]] = 1;
	for (i = 1; i < n; i++) {
		j = s[i];
		if (c[j]) break;
		t[i] = j, c[j] = 1;
	}

	if (i == n) ans = t;
	else {
		char c0['9'+1], t0[11]; int i0;
		diff = 0, ans = x, i0 = i;
		i0 = i, memcpy(c0, c, sizeof(c0)), memcpy(t0, t, sizeof(t0));
		for (j = s[i]-1; c[j] && j >= '0'; j--);
		if (j < '0') {
			for (j = i-1; j >= 0 && t[j] == '0'; j--) c['0'] = 0;
			i = j;
			for (c[t[i]] = 0, j = t[i]-1; c[j] && j >= '0'; j--);
		}
		c[j] = 1; t[i] = j;
		try(i+1, 1);

		i = i0, memcpy(c, c0, sizeof(c0)), memcpy(t, t0, sizeof(t0));
		for (j = s[i]+1; c[j] && j <= '9'; j++);
		if (j > '9') {
			for (j = i-1; j >= 0 && t[j] == '9'; j--) c['9'] = 0;
			i = j;
			for (c[t[i]] = 0, j = t[i]+1; c[j] && j <= '9'; j++);
		}
		c[j] = 1; t[i] = j;
		try(i+1, 0);
	}
	puts(ans);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	s
	.bss
	.align 8
	.type	s, @object
	.size	s, 11
s:
	.zero	11
	.globl	t
	.align 8
	.type	t, @object
	.size	t, 11
t:
	.zero	11
	.globl	x
	.align 8
	.type	x, @object
	.size	x, 11
x:
	.zero	11
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	ns
	.align 8
	.type	ns, @object
	.size	ns, 8
ns:
	.zero	8
	.globl	pow10
	.align 8
	.type	pow10, @object
	.size	pow10, 8
pow10:
	.zero	8
	.globl	diff
	.align 8
	.type	diff, @object
	.size	diff, 8
diff:
	.zero	8
	.globl	c
	.align 32
	.type	c, @object
	.size	c, 58
c:
	.zero	58
	.text
	.globl	try
	.type	try, @function
try:
.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
	movl	%edi, -36(%rbp)
	movl	%esi, -40(%rbp)
	movl	n(%rip), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L2
	movq	$0, -16(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L3
.L4:
	movq	-16(%rbp), %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	movq	%rax, %rcx
	movl	-20(%rbp), %eax
	cltq
	leaq	t(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	subl	$48, %eax
	cltq
	addq	%rcx, %rax
	movq	%rax, -16(%rbp)
	addl	$1, -20(%rbp)
.L3:
	movl	n(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L4
	movq	ns(%rip), %rax
	subq	-16(%rbp), %rax
	movq	%rax, %rdx
	negq	%rdx
	cmovs	%rax, %rdx
	movq	pow10(%rip), %rcx
	movq	ns(%rip), %rax
	subq	-16(%rbp), %rax
	movq	%rax, %rsi
	negq	%rsi
	cmovs	%rax, %rsi
	movq	%rcx, %rax
	subq	%rsi, %rax
	cmpq	%rax, %rdx
	cmovle	%rdx, %rax
	movq	%rax, -8(%rbp)
	movq	diff(%rip), %rax
	cmpq	%rax, -8(%rbp)
	jle	.L14
	movq	-8(%rbp), %rax
	movq	%rax, diff(%rip)
	movq	t(%rip), %rax
	movq	%rax, x(%rip)
	movzwl	8+t(%rip), %eax
	movw	%ax, 8+x(%rip)
	movzbl	10+t(%rip), %eax
	movb	%al, 10+x(%rip)
	jmp	.L14
.L2:
	cmpl	$0, -40(%rbp)
	je	.L7
	movl	$57, -20(%rbp)
	jmp	.L8
.L10:
	subl	$1, -20(%rbp)
.L8:
	movl	-20(%rbp), %eax
	cltq
	leaq	c(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	je	.L9
	cmpl	$47, -20(%rbp)
	jg	.L10
.L9:
	movl	-20(%rbp), %eax
	cltq
	leaq	c(%rip), %rdx
	movb	$1, (%rax,%rdx)
	movl	-20(%rbp), %eax
	movl	%eax, %ecx
	movl	-36(%rbp), %eax
	cltq
	leaq	t(%rip), %rdx
	movb	%cl, (%rax,%rdx)
	movl	-36(%rbp), %eax
	leal	1(%rax), %edx
	movl	-40(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	try
	jmp	.L1
.L7:
	movl	$48, -20(%rbp)
	jmp	.L11
.L13:
	addl	$1, -20(%rbp)
.L11:
	movl	-20(%rbp), %eax
	cltq
	leaq	c(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	je	.L12
	cmpl	$57, -20(%rbp)
	jle	.L13
.L12:
	movl	-20(%rbp), %eax
	cltq
	leaq	c(%rip), %rdx
	movb	$1, (%rax,%rdx)
	movl	-20(%rbp), %eax
	movl	%eax, %ecx
	movl	-36(%rbp), %eax
	cltq
	leaq	t(%rip), %rdx
	movb	%cl, (%rax,%rdx)
	movl	-36(%rbp), %eax
	leal	1(%rax), %edx
	movl	-40(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	try
	jmp	.L1
.L14:
	nop
.L1:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	try, .-try
	.section	.rodata
.LC0:
	.string	"%s"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	addq	$-128, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	s(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	s(%rip), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, n(%rip)
	movq	$0, ns(%rip)
	movq	$1, pow10(%rip)
	movl	$0, -116(%rbp)
	jmp	.L16
.L17:
	movq	ns(%rip), %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	movq	%rax, %rcx
	movl	-116(%rbp), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	subl	$48, %eax
	cltq
	addq	%rcx, %rax
	movq	%rax, ns(%rip)
	movq	pow10(%rip), %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	movq	%rax, pow10(%rip)
	addl	$1, -116(%rbp)
.L16:
	movl	n(%rip), %eax
	cmpl	%eax, -116(%rbp)
	jl	.L17
	movzbl	s(%rip), %eax
	cmpb	$52, %al
	jle	.L18
	movzbl	s(%rip), %eax
	subl	$5, %eax
	movb	%al, t(%rip)
	jmp	.L19
.L18:
	movzbl	s(%rip), %eax
	addl	$5, %eax
	movb	%al, t(%rip)
.L19:
	movzbl	t(%rip), %eax
	movsbl	%al, %eax
	cltq
	leaq	c(%rip), %rdx
	movb	$1, (%rax,%rdx)
	movl	$1, -116(%rbp)
	jmp	.L20
.L23:
	movl	-116(%rbp), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	movl	%eax, -112(%rbp)
	movl	-112(%rbp), %eax
	cltq
	leaq	c(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	jne	.L46
	movl	-112(%rbp), %eax
	movl	%eax, %ecx
	movl	-116(%rbp), %eax
	cltq
	leaq	t(%rip), %rdx
	movb	%cl, (%rax,%rdx)
	movl	-112(%rbp), %eax
	cltq
	leaq	c(%rip), %rdx
	movb	$1, (%rax,%rdx)
	addl	$1, -116(%rbp)
.L20:
	movl	n(%rip), %eax
	cmpl	%eax, -116(%rbp)
	jl	.L23
	jmp	.L22
.L46:
	nop
.L22:
	movl	n(%rip), %eax
	cmpl	%eax, -116(%rbp)
	jne	.L24
	leaq	t(%rip), %rax
	movq	%rax, -104(%rbp)
	jmp	.L25
.L24:
	movq	$0, diff(%rip)
	leaq	x(%rip), %rax
	movq	%rax, -104(%rbp)
	movl	-116(%rbp), %eax
	movl	%eax, -108(%rbp)
	movl	-116(%rbp), %eax
	movl	%eax, -108(%rbp)
	movq	c(%rip), %rax
	movq	8+c(%rip), %rdx
	movq	%rax, -80(%rbp)
	movq	%rdx, -72(%rbp)
	movq	16+c(%rip), %rax
	movq	24+c(%rip), %rdx
	movq	%rax, -64(%rbp)
	movq	%rdx, -56(%rbp)
	movq	32+c(%rip), %rax
	movq	40+c(%rip), %rdx
	movq	%rax, -48(%rbp)
	movq	%rdx, -40(%rbp)
	movq	48+c(%rip), %rax
	movq	%rax, -32(%rbp)
	movzwl	56+c(%rip), %eax
	movw	%ax, -24(%rbp)
	movq	t(%rip), %rax
	movq	%rax, -91(%rbp)
	movzwl	8+t(%rip), %eax
	movw	%ax, -83(%rbp)
	movzbl	10+t(%rip), %eax
	movb	%al, -81(%rbp)
	movl	-116(%rbp), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	subl	$1, %eax
	movl	%eax, -112(%rbp)
	jmp	.L26
.L28:
	subl	$1, -112(%rbp)
.L26:
	movl	-112(%rbp), %eax
	cltq
	leaq	c(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	je	.L27
	cmpl	$47, -112(%rbp)
	jg	.L28
.L27:
	cmpl	$47, -112(%rbp)
	jg	.L29
	movl	-116(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -112(%rbp)
	jmp	.L30
.L32:
	movb	$0, 48+c(%rip)
	subl	$1, -112(%rbp)
.L30:
	cmpl	$0, -112(%rbp)
	js	.L31
	movl	-112(%rbp), %eax
	cltq
	leaq	t(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$48, %al
	je	.L32
.L31:
	movl	-112(%rbp), %eax
	movl	%eax, -116(%rbp)
	movl	-116(%rbp), %eax
	cltq
	leaq	t(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	cltq
	leaq	c(%rip), %rdx
	movb	$0, (%rax,%rdx)
	movl	-116(%rbp), %eax
	cltq
	leaq	t(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	subl	$1, %eax
	movl	%eax, -112(%rbp)
	jmp	.L33
.L34:
	subl	$1, -112(%rbp)
.L33:
	movl	-112(%rbp), %eax
	cltq
	leaq	c(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	je	.L29
	cmpl	$47, -112(%rbp)
	jg	.L34
.L29:
	movl	-112(%rbp), %eax
	cltq
	leaq	c(%rip), %rdx
	movb	$1, (%rax,%rdx)
	movl	-112(%rbp), %eax
	movl	%eax, %ecx
	movl	-116(%rbp), %eax
	cltq
	leaq	t(%rip), %rdx
	movb	%cl, (%rax,%rdx)
	movl	-116(%rbp), %eax
	addl	$1, %eax
	movl	$1, %esi
	movl	%eax, %edi
	call	try
	movl	-108(%rbp), %eax
	movl	%eax, -116(%rbp)
	movq	-80(%rbp), %rax
	movq	-72(%rbp), %rdx
	movq	%rax, c(%rip)
	movq	%rdx, 8+c(%rip)
	movq	-64(%rbp), %rax
	movq	-56(%rbp), %rdx
	movq	%rax, 16+c(%rip)
	movq	%rdx, 24+c(%rip)
	movq	-48(%rbp), %rax
	movq	-40(%rbp), %rdx
	movq	%rax, 32+c(%rip)
	movq	%rdx, 40+c(%rip)
	movq	-32(%rbp), %rax
	movq	%rax, 48+c(%rip)
	movzwl	-24(%rbp), %eax
	movw	%ax, 56+c(%rip)
	movq	-91(%rbp), %rax
	movq	%rax, t(%rip)
	movzwl	-83(%rbp), %eax
	movw	%ax, 8+t(%rip)
	movzbl	-81(%rbp), %eax
	movb	%al, 10+t(%rip)
	movl	-116(%rbp), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	addl	$1, %eax
	movl	%eax, -112(%rbp)
	jmp	.L35
.L37:
	addl	$1, -112(%rbp)
.L35:
	movl	-112(%rbp), %eax
	cltq
	leaq	c(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	je	.L36
	cmpl	$57, -112(%rbp)
	jle	.L37
.L36:
	cmpl	$57, -112(%rbp)
	jle	.L38
	movl	-116(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -112(%rbp)
	jmp	.L39
.L41:
	movb	$0, 57+c(%rip)
	subl	$1, -112(%rbp)
.L39:
	cmpl	$0, -112(%rbp)
	js	.L40
	movl	-112(%rbp), %eax
	cltq
	leaq	t(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$57, %al
	je	.L41
.L40:
	movl	-112(%rbp), %eax
	movl	%eax, -116(%rbp)
	movl	-116(%rbp), %eax
	cltq
	leaq	t(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	cltq
	leaq	c(%rip), %rdx
	movb	$0, (%rax,%rdx)
	movl	-116(%rbp), %eax
	cltq
	leaq	t(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	addl	$1, %eax
	movl	%eax, -112(%rbp)
	jmp	.L42
.L43:
	addl	$1, -112(%rbp)
.L42:
	movl	-112(%rbp), %eax
	cltq
	leaq	c(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	je	.L38
	cmpl	$57, -112(%rbp)
	jle	.L43
.L38:
	movl	-112(%rbp), %eax
	cltq
	leaq	c(%rip), %rdx
	movb	$1, (%rax,%rdx)
	movl	-112(%rbp), %eax
	movl	%eax, %ecx
	movl	-116(%rbp), %eax
	cltq
	leaq	t(%rip), %rdx
	movb	%cl, (%rax,%rdx)
	movl	-116(%rbp), %eax
	addl	$1, %eax
	movl	$0, %esi
	movl	%eax, %edi
	call	try
.L25:
	movq	-104(%rbp), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L45
	call	__stack_chk_fail@PLT
.L45:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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 8
	.type	s, @object
	.size	s, 11
s:
	.zero	11
	.globl	t
	.align 8
	.type	t, @object
	.size	t, 11
t:
	.zero	11
	.globl	x
	.align 8
	.type	x, @object
	.size	x, 11
x:
	.zero	11
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	ns
	.align 8
	.type	ns, @object
	.size	ns, 8
ns:
	.zero	8
	.globl	pow10
	.align 8
	.type	pow10, @object
	.size	pow10, 8
pow10:
	.zero	8
	.globl	diff
	.align 8
	.type	diff, @object
	.size	diff, 8
diff:
	.zero	8
	.globl	c
	.align 32
	.type	c, @object
	.size	c, 58
c:
	.zero	58
	.text
	.globl	try
	.type	try, @function
try:
.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
	movl	%edi, -36(%rbp)
	movl	%esi, -40(%rbp)
	movl	n(%rip), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L2
	movq	$0, -16(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L3
.L4:
	movq	-16(%rbp), %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	movq	%rax, %rcx
	movl	-20(%rbp), %eax
	cltq
	leaq	t(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	subl	$48, %eax
	cltq
	addq	%rcx, %rax
	movq	%rax, -16(%rbp)
	addl	$1, -20(%rbp)
.L3:
	movl	n(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L4
	movq	ns(%rip), %rax
	subq	-16(%rbp), %rax
	movq	%rax, %rdx
	negq	%rdx
	cmovs	%rax, %rdx
	movq	pow10(%rip), %rcx
	movq	ns(%rip), %rax
	subq	-16(%rbp), %rax
	movq	%rax, %rsi
	negq	%rsi
	cmovs	%rax, %rsi
	movq	%rcx, %rax
	subq	%rsi, %rax
	cmpq	%rax, %rdx
	cmovle	%rdx, %rax
	movq	%rax, -8(%rbp)
	movq	diff(%rip), %rax
	cmpq	%rax, -8(%rbp)
	jle	.L14
	movq	-8(%rbp), %rax
	movq	%rax, diff(%rip)
	movq	t(%rip), %rax
	movq	%rax, x(%rip)
	movzwl	8+t(%rip), %eax
	movw	%ax, 8+x(%rip)
	movzbl	10+t(%rip), %eax
	movb	%al, 10+x(%rip)
	jmp	.L14
.L2:
	cmpl	$0, -40(%rbp)
	je	.L7
	movl	$57, -20(%rbp)
	jmp	.L8
.L10:
	subl	$1, -20(%rbp)
.L8:
	movl	-20(%rbp), %eax
	cltq
	leaq	c(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	je	.L9
	cmpl	$47, -20(%rbp)
	jg	.L10
.L9:
	movl	-20(%rbp), %eax
	cltq
	leaq	c(%rip), %rdx
	movb	$1, (%rax,%rdx)
	movl	-20(%rbp), %eax
	movl	%eax, %ecx
	movl	-36(%rbp), %eax
	cltq
	leaq	t(%rip), %rdx
	movb	%cl, (%rax,%rdx)
	movl	-36(%rbp), %eax
	leal	1(%rax), %edx
	movl	-40(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	try
	jmp	.L1
.L7:
	movl	$48, -20(%rbp)
	jmp	.L11
.L13:
	addl	$1, -20(%rbp)
.L11:
	movl	-20(%rbp), %eax
	cltq
	leaq	c(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	je	.L12
	cmpl	$57, -20(%rbp)
	jle	.L13
.L12:
	movl	-20(%rbp), %eax
	cltq
	leaq	c(%rip), %rdx
	movb	$1, (%rax,%rdx)
	movl	-20(%rbp), %eax
	movl	%eax, %ecx
	movl	-36(%rbp), %eax
	cltq
	leaq	t(%rip), %rdx
	movb	%cl, (%rax,%rdx)
	movl	-36(%rbp), %eax
	leal	1(%rax), %edx
	movl	-40(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	try
	jmp	.L1
.L14:
	nop
.L1:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	try, .-try
	.section	.rodata
.LC0:
	.string	"%s"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	addq	$-128, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	s(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	s(%rip), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, n(%rip)
	movq	$0, ns(%rip)
	movq	$1, pow10(%rip)
	movl	$0, -116(%rbp)
	jmp	.L16
.L17:
	movq	ns(%rip), %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	movq	%rax, %rcx
	movl	-116(%rbp), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	subl	$48, %eax
	cltq
	addq	%rcx, %rax
	movq	%rax, ns(%rip)
	movq	pow10(%rip), %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	movq	%rax, pow10(%rip)
	addl	$1, -116(%rbp)
.L16:
	movl	n(%rip), %eax
	cmpl	%eax, -116(%rbp)
	jl	.L17
	movzbl	s(%rip), %eax
	cmpb	$52, %al
	jle	.L18
	movzbl	s(%rip), %eax
	subl	$5, %eax
	movb	%al, t(%rip)
	jmp	.L19
.L18:
	movzbl	s(%rip), %eax
	addl	$5, %eax
	movb	%al, t(%rip)
.L19:
	movzbl	t(%rip), %eax
	movsbl	%al, %eax
	cltq
	leaq	c(%rip), %rdx
	movb	$1, (%rax,%rdx)
	movl	$1, -116(%rbp)
	jmp	.L20
.L23:
	movl	-116(%rbp), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	movl	%eax, -112(%rbp)
	movl	-112(%rbp), %eax
	cltq
	leaq	c(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	jne	.L46
	movl	-112(%rbp), %eax
	movl	%eax, %ecx
	movl	-116(%rbp), %eax
	cltq
	leaq	t(%rip), %rdx
	movb	%cl, (%rax,%rdx)
	movl	-112(%rbp), %eax
	cltq
	leaq	c(%rip), %rdx
	movb	$1, (%rax,%rdx)
	addl	$1, -116(%rbp)
.L20:
	movl	n(%rip), %eax
	cmpl	%eax, -116(%rbp)
	jl	.L23
	jmp	.L22
.L46:
	nop
.L22:
	movl	n(%rip), %eax
	cmpl	%eax, -116(%rbp)
	jne	.L24
	leaq	t(%rip), %rax
	movq	%rax, -104(%rbp)
	jmp	.L25
.L24:
	movq	$0, diff(%rip)
	leaq	x(%rip), %rax
	movq	%rax, -104(%rbp)
	movl	-116(%rbp), %eax
	movl	%eax, -108(%rbp)
	movl	-116(%rbp), %eax
	movl	%eax, -108(%rbp)
	movq	c(%rip), %rax
	movq	8+c(%rip), %rdx
	movq	%rax, -80(%rbp)
	movq	%rdx, -72(%rbp)
	movq	16+c(%rip), %rax
	movq	24+c(%rip), %rdx
	movq	%rax, -64(%rbp)
	movq	%rdx, -56(%rbp)
	movq	32+c(%rip), %rax
	movq	40+c(%rip), %rdx
	movq	%rax, -48(%rbp)
	movq	%rdx, -40(%rbp)
	movq	48+c(%rip), %rax
	movq	%rax, -32(%rbp)
	movzwl	56+c(%rip), %eax
	movw	%ax, -24(%rbp)
	movq	t(%rip), %rax
	movq	%rax, -91(%rbp)
	movzwl	8+t(%rip), %eax
	movw	%ax, -83(%rbp)
	movzbl	10+t(%rip), %eax
	movb	%al, -81(%rbp)
	movl	-116(%rbp), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	subl	$1, %eax
	movl	%eax, -112(%rbp)
	jmp	.L26
.L28:
	subl	$1, -112(%rbp)
.L26:
	movl	-112(%rbp), %eax
	cltq
	leaq	c(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	je	.L27
	cmpl	$47, -112(%rbp)
	jg	.L28
.L27:
	cmpl	$47, -112(%rbp)
	jg	.L29
	movl	-116(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -112(%rbp)
	jmp	.L30
.L32:
	movb	$0, 48+c(%rip)
	subl	$1, -112(%rbp)
.L30:
	cmpl	$0, -112(%rbp)
	js	.L31
	movl	-112(%rbp), %eax
	cltq
	leaq	t(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$48, %al
	je	.L32
.L31:
	movl	-112(%rbp), %eax
	movl	%eax, -116(%rbp)
	movl	-116(%rbp), %eax
	cltq
	leaq	t(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	cltq
	leaq	c(%rip), %rdx
	movb	$0, (%rax,%rdx)
	movl	-116(%rbp), %eax
	cltq
	leaq	t(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	subl	$1, %eax
	movl	%eax, -112(%rbp)
	jmp	.L33
.L34:
	subl	$1, -112(%rbp)
.L33:
	movl	-112(%rbp), %eax
	cltq
	leaq	c(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	je	.L29
	cmpl	$47, -112(%rbp)
	jg	.L34
.L29:
	movl	-112(%rbp), %eax
	cltq
	leaq	c(%rip), %rdx
	movb	$1, (%rax,%rdx)
	movl	-112(%rbp), %eax
	movl	%eax, %ecx
	movl	-116(%rbp), %eax
	cltq
	leaq	t(%rip), %rdx
	movb	%cl, (%rax,%rdx)
	movl	-116(%rbp), %eax
	addl	$1, %eax
	movl	$1, %esi
	movl	%eax, %edi
	call	try
	movl	-108(%rbp), %eax
	movl	%eax, -116(%rbp)
	movq	-80(%rbp), %rax
	movq	-72(%rbp), %rdx
	movq	%rax, c(%rip)
	movq	%rdx, 8+c(%rip)
	movq	-64(%rbp), %rax
	movq	-56(%rbp), %rdx
	movq	%rax, 16+c(%rip)
	movq	%rdx, 24+c(%rip)
	movq	-48(%rbp), %rax
	movq	-40(%rbp), %rdx
	movq	%rax, 32+c(%rip)
	movq	%rdx, 40+c(%rip)
	movq	-32(%rbp), %rax
	movq	%rax, 48+c(%rip)
	movzwl	-24(%rbp), %eax
	movw	%ax, 56+c(%rip)
	movq	-91(%rbp), %rax
	movq	%rax, t(%rip)
	movzwl	-83(%rbp), %eax
	movw	%ax, 8+t(%rip)
	movzbl	-81(%rbp), %eax
	movb	%al, 10+t(%rip)
	movl	-116(%rbp), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	addl	$1, %eax
	movl	%eax, -112(%rbp)
	jmp	.L35
.L37:
	addl	$1, -112(%rbp)
.L35:
	movl	-112(%rbp), %eax
	cltq
	leaq	c(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	je	.L36
	cmpl	$57, -112(%rbp)
	jle	.L37
.L36:
	cmpl	$57, -112(%rbp)
	jle	.L38
	movl	-116(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -112(%rbp)
	jmp	.L39
.L41:
	movb	$0, 57+c(%rip)
	subl	$1, -112(%rbp)
.L39:
	cmpl	$0, -112(%rbp)
	js	.L40
	movl	-112(%rbp), %eax
	cltq
	leaq	t(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$57, %al
	je	.L41
.L40:
	movl	-112(%rbp), %eax
	movl	%eax, -116(%rbp)
	movl	-116(%rbp), %eax
	cltq
	leaq	t(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	cltq
	leaq	c(%rip), %rdx
	movb	$0, (%rax,%rdx)
	movl	-116(%rbp), %eax
	cltq
	leaq	t(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	addl	$1, %eax
	movl	%eax, -112(%rbp)
	jmp	.L42
.L43:
	addl	$1, -112(%rbp)
.L42:
	movl	-112(%rbp), %eax
	cltq
	leaq	c(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	je	.L38
	cmpl	$57, -112(%rbp)
	jle	.L43
.L38:
	movl	-112(%rbp), %eax
	cltq
	leaq	c(%rip), %rdx
	movb	$1, (%rax,%rdx)
	movl	-112(%rbp), %eax
	movl	%eax, %ecx
	movl	-116(%rbp), %eax
	cltq
	leaq	t(%rip), %rdx
	movb	%cl, (%rax,%rdx)
	movl	-116(%rbp), %eax
	addl	$1, %eax
	movl	$0, %esi
	movl	%eax, %edi
	call	try
.L25:
	movq	-104(%rbp), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L45
	call	__stack_chk_fail@PLT
.L45:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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:
