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

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

long f(char *s, int d, int a){
	long sum=0;
	long now=s[0]-'0';
	int i;
	for(i=1; i<d; i++){
		if((a&(1<<(i-1)))!=0){
			sum+=now;
			now=s[i]-'0';
		}else{
			now=now*10+s[i]-'0';
		}
	}
	sum+=now;
	return sum;
}

int main(void){
	char c, n=0, s[11];
	while((c=getchar())!=10) s[n++]=c;
	s[n]=0;
	int i, l=1<<(n-1);
	long sum=0;
	for(i=0; i<l; i++){
		sum+=f(s, n, i);
	}
	printf("%ld\n", sum);
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	f
	.type	f, @function
f:
.LFB51:
	.cfi_startproc
	endbr64
	movsbl	(%rdi), %r8d
	subl	$48, %r8d
	movslq	%r8d, %r8
	cmpl	$1, %esi
	jle	.L1
	leal	-1(%rsi), %r9d
	xorl	%eax, %eax
	xorl	%esi, %esi
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L9:
	subl	$48, %ecx
	addq	$1, %rax
	addq	%r8, %rsi
	movslq	%ecx, %r8
	cmpq	%rax, %r9
	je	.L8
.L5:
	btl	%eax, %edx
	movsbq	1(%rdi,%rax), %rcx
	jc	.L9
	leaq	(%r8,%r8,4), %r8
	addq	$1, %rax
	leaq	-48(%rcx,%r8,2), %r8
	cmpq	%rax, %r9
	jne	.L5
.L8:
	addq	%rsi, %r8
.L1:
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE51:
	.size	f, .-f
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	xorl	%ebx, %ebx
	subq	$40, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L12:
	movb	%al, 13(%rsp,%r10)
	addl	$1, %ebx
.L11:
	movq	stdin(%rip), %rdi
	call	getc@PLT
	movsbq	%bl, %r10
	cmpb	$10, %al
	jne	.L12
	leal	-1(%r10), %ecx
	movl	$1, %ebp
	movslq	%r10d, %rax
	sall	%cl, %ebp
	movb	$0, 13(%rsp,%rax)
	testl	%ebp, %ebp
	jle	.L20
	movsbl	13(%rsp), %ebx
	xorl	%r11d, %r11d
	xorl	%esi, %esi
	movl	%ecx, %r8d
	leaq	14(%rsp), %r9
	subl	$48, %ebx
	movslq	%ebx, %rbx
	.p2align 4,,10
	.p2align 3
.L18:
	movq	%rbx, %rcx
	cmpl	$1, %r10d
	jle	.L14
	xorl	%eax, %eax
	xorl	%edi, %edi
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L26:
	subl	$48, %edx
	addq	$1, %rax
	addq	%rcx, %rdi
	movslq	%edx, %rcx
	cmpq	%rax, %r8
	je	.L25
.L17:
	btl	%eax, %esi
	movsbq	(%r9,%rax), %rdx
	jc	.L26
	leaq	(%rcx,%rcx,4), %rcx
	addq	$1, %rax
	leaq	-48(%rdx,%rcx,2), %rcx
	cmpq	%rax, %r8
	jne	.L17
.L25:
	addq	%rdi, %rcx
.L14:
	addl	$1, %esi
	addq	%rcx, %r11
	cmpl	%esi, %ebp
	jne	.L18
.L13:
	xorl	%eax, %eax
	movq	%r11, %rdx
	movl	$1, %edi
	leaq	.LC0(%rip), %rsi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L27
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L20:
	.cfi_restore_state
	xorl	%r11d, %r11d
	jmp	.L13
.L27:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	f
	.type	f, @function
f:
.LFB51:
	.cfi_startproc
	endbr64
	movsbl	(%rdi), %r8d
	subl	$48, %r8d
	movslq	%r8d, %r8
	cmpl	$1, %esi
	jle	.L1
	leal	-1(%rsi), %r9d
	xorl	%eax, %eax
	xorl	%esi, %esi
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L9:
	subl	$48, %ecx
	addq	$1, %rax
	addq	%r8, %rsi
	movslq	%ecx, %r8
	cmpq	%rax, %r9
	je	.L8
.L5:
	btl	%eax, %edx
	movsbq	1(%rdi,%rax), %rcx
	jc	.L9
	leaq	(%r8,%r8,4), %r8
	addq	$1, %rax
	leaq	-48(%rcx,%r8,2), %r8
	cmpq	%rax, %r9
	jne	.L5
.L8:
	addq	%rsi, %r8
.L1:
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE51:
	.size	f, .-f
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	xorl	%ebx, %ebx
	subq	$40, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L12:
	movb	%al, 13(%rsp,%r10)
	addl	$1, %ebx
.L11:
	movq	stdin(%rip), %rdi
	call	getc@PLT
	movsbq	%bl, %r10
	cmpb	$10, %al
	jne	.L12
	leal	-1(%r10), %ecx
	movl	$1, %ebp
	movslq	%r10d, %rax
	sall	%cl, %ebp
	movb	$0, 13(%rsp,%rax)
	testl	%ebp, %ebp
	jle	.L20
	movsbl	13(%rsp), %ebx
	xorl	%r11d, %r11d
	xorl	%esi, %esi
	movl	%ecx, %r8d
	leaq	14(%rsp), %r9
	subl	$48, %ebx
	movslq	%ebx, %rbx
	.p2align 4,,10
	.p2align 3
.L18:
	movq	%rbx, %rcx
	cmpl	$1, %r10d
	jle	.L14
	xorl	%eax, %eax
	xorl	%edi, %edi
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L26:
	subl	$48, %edx
	addq	$1, %rax
	addq	%rcx, %rdi
	movslq	%edx, %rcx
	cmpq	%rax, %r8
	je	.L25
.L17:
	btl	%eax, %esi
	movsbq	(%r9,%rax), %rdx
	jc	.L26
	leaq	(%rcx,%rcx,4), %rcx
	addq	$1, %rax
	leaq	-48(%rdx,%rcx,2), %rcx
	cmpq	%rax, %r8
	jne	.L17
.L25:
	addq	%rdi, %rcx
.L14:
	addl	$1, %esi
	addq	%rcx, %r11
	cmpl	%esi, %ebp
	jne	.L18
.L13:
	xorl	%eax, %eax
	movq	%r11, %rdx
	movl	$1, %edi
	leaq	.LC0(%rip), %rsi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L27
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L20:
	.cfi_restore_state
	xorl	%r11d, %r11d
	jmp	.L13
.L27:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```
rule
```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	f
	.type	f, @function
f:
.LFB51:
	.cfi_startproc
	endbr64
	movsbl	(%rdi), %r8d
	subl	$48, %r8d
	movslq	%r8d, %r8
	cmpl	$1, %esi
	jle	.L1
	leal	-1(%rsi), %r9d
	xorl	%eax, %eax
	xorl	%esi, %esi
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L9:
	subl	$48, %ecx
	addq	$1, %rax
	addq	%r8, %rsi
	movslq	%ecx, %r8
	cmpq	%rax, %r9
	je	.L8
.L5:
	btl	%eax, %edx
	movsbq	1(%rdi,%rax), %rcx
	jc	.L9
	leaq	(%r8,%r8,4), %r8
	addq	$1, %rax
	leaq	-48(%rcx,%r8,2), %r8
	cmpq	%rax, %r9
	jne	.L5
.L8:
	addq	%rsi, %r8
.L1:
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE51:
	.size	f, .-f
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	xorl	%ebx, %ebx
	subq	$40, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L12:
	movb	%al, 13(%rsp,%r10)
	addl	$1, %ebx
.L11:
	movq	stdin(%rip), %rdi
	call	getc@PLT
	movsbq	%bl, %r10
	cmpb	$10, %al
	jne	.L12
	leal	-1(%r10), %ecx
	movl	$1, %ebp
	movslq	%r10d, %rax
	sall	%cl, %ebp
	movb	$0, 13(%rsp,%rax)
	testl	%ebp, %ebp
	jle	.L20
	movsbl	13(%rsp), %ebx
	xorl	%r11d, %r11d
	xorl	%esi, %esi
	movl	%ecx, %r8d
	leaq	14(%rsp), %r9
	subl	$48, %ebx
	movslq	%ebx, %rbx
	.p2align 4,,10
	.p2align 3
.L18:
	movq	%rbx, %rcx
	cmpl	$1, %r10d
	jle	.L14
	xorl	%eax, %eax
	xorl	%edi, %edi
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L26:
	subl	$48, %edx
	addq	$1, %rax
	addq	%rcx, %rdi
	movslq	%edx, %rcx
	cmpq	%rax, %r8
	je	.L25
.L17:
	btl	%eax, %esi
	movsbq	(%r9,%rax), %rdx
	jc	.L26
	leaq	(%rcx,%rcx,4), %rcx
	addq	$1, %rax
	leaq	-48(%rdx,%rcx,2), %rcx
	cmpq	%rax, %r8
	jne	.L17
.L25:
	addq	%rdi, %rcx
.L14:
	addl	$1, %esi
	addq	%rcx, %r11
	cmpl	%esi, %ebp
	jne	.L18
.L13:
	xorl	%eax, %eax
	movq	%r11, %rdx
	movl	$1, %edi
	leaq	.LC0(%rip), %rsi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L27
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L20:
	.cfi_restore_state
	xorl	%r11d, %r11d
	jmp	.L13
.L27:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```
```c
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

long f(char *s, int d, int a){
	long sum=0;
	long now=s[0]-'0';
	int i;
	for(i=1; i<d; i++){
		if((a&(1<<(i-1)))!=0){
			sum+=now;
			now=s[i]-'0';
		}else{
			now=now*10+s[i]-'0';
		}
	}
	sum+=now;
	return sum;
}

int main(void){
	char c, n=0, s[11];
	while((c=getchar())!=10) s[n++]=c;
	s[n]=0;
	int i, l=1<<(n-1);
	long sum=0;
	for(i=0; i<l; i++){
		sum+=f(s, n, i);
	}
	printf("%ld\n", sum);
}
```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

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

long f(char *s, int d, int a){
	long sum=0;
	long now=s[0]-'0';
	int i;
	for(i=1; i<d; i++){
		if((a&(1<<(i-1)))!=0){
			sum+=now;
			now=s[i]-'0';
		}else{
			now=now*10+s[i]-'0';
		}
	}
	sum+=now;
	return sum;
}

int main(void){
	char c, n=0, s[11];
	while((c=getchar())!=10) s[n++]=c;
	s[n]=0;
	int i, l=1<<(n-1);
	long sum=0;
	for(i=0; i<l; i++){
		sum+=f(s, n, i);
	}
	printf("%ld\n", sum);
}
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
Optimized Assembly Code:

88
 131
 189
 292
 348
 260
 11
 16
 0
 1

104
 182
 324
 430
 456
 356
 13
 23
 0
 1

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

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

long f(char *s, int d, int a){
	long sum=0;
	long now=s[0]-'0';
	int i;
	for(i=1; i<d; i++){
		if((a&(1<<(i-1)))!=0){
			sum+=now;
			now=s[i]-'0';
		}else{
			now=now*10+s[i]-'0';
		}
	}
	sum+=now;
	return sum;
}

int main(void){
	char c, n=0, s[11];
	while((c=getchar())!=10) s[n++]=c;
	s[n]=0;
	int i, l=1<<(n-1);
	long sum=0;
	for(i=0; i<l; i++){
		sum+=f(s, n, i);
	}
	printf("%ld\n", sum);
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	f
	.type	f, @function
f:
.LFB51:
	.cfi_startproc
	endbr64
	movsbl	(%rdi), %r8d
	subl	$48, %r8d
	movslq	%r8d, %r8
	cmpl	$1, %esi
	jle	.L1
	leal	-1(%rsi), %r9d
	xorl	%eax, %eax
	xorl	%esi, %esi
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L9:
	subl	$48, %ecx
	addq	$1, %rax
	addq	%r8, %rsi
	movslq	%ecx, %r8
	cmpq	%rax, %r9
	je	.L8
.L5:
	btl	%eax, %edx
	movsbq	1(%rdi,%rax), %rcx
	jc	.L9
	leaq	(%r8,%r8,4), %r8
	addq	$1, %rax
	leaq	-48(%rcx,%r8,2), %r8
	cmpq	%rax, %r9
	jne	.L5
.L8:
	addq	%rsi, %r8
.L1:
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE51:
	.size	f, .-f
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	xorl	%ebx, %ebx
	subq	$40, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L12:
	movb	%al, 13(%rsp,%r10)
	addl	$1, %ebx
.L11:
	movq	stdin(%rip), %rdi
	call	getc@PLT
	movsbq	%bl, %r10
	cmpb	$10, %al
	jne	.L12
	leal	-1(%r10), %ecx
	movl	$1, %ebp
	movslq	%r10d, %rax
	sall	%cl, %ebp
	movb	$0, 13(%rsp,%rax)
	testl	%ebp, %ebp
	jle	.L20
	movsbl	13(%rsp), %ebx
	xorl	%r11d, %r11d
	xorl	%esi, %esi
	movl	%ecx, %r8d
	leaq	14(%rsp), %r9
	subl	$48, %ebx
	movslq	%ebx, %rbx
	.p2align 4,,10
	.p2align 3
.L18:
	movq	%rbx, %rcx
	cmpl	$1, %r10d
	jle	.L14
	xorl	%eax, %eax
	xorl	%edi, %edi
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L26:
	subl	$48, %edx
	addq	$1, %rax
	addq	%rcx, %rdi
	movslq	%edx, %rcx
	cmpq	%rax, %r8
	je	.L25
.L17:
	btl	%eax, %esi
	movsbq	(%r9,%rax), %rdx
	jc	.L26
	leaq	(%rcx,%rcx,4), %rcx
	addq	$1, %rax
	leaq	-48(%rdx,%rcx,2), %rcx
	cmpq	%rax, %r8
	jne	.L17
.L25:
	addq	%rdi, %rcx
.L14:
	addl	$1, %esi
	addq	%rcx, %r11
	cmpl	%esi, %ebp
	jne	.L18
.L13:
	xorl	%eax, %eax
	movq	%r11, %rdx
	movl	$1, %edi
	leaq	.LC0(%rip), %rsi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L27
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L20:
	.cfi_restore_state
	xorl	%r11d, %r11d
	jmp	.L13
.L27:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	f
	.type	f, @function
f:
.LFB51:
	.cfi_startproc
	endbr64
	movsbl	(%rdi), %r8d
	subl	$48, %r8d
	movslq	%r8d, %r8
	cmpl	$1, %esi
	jle	.L1
	leal	-1(%rsi), %r9d
	xorl	%eax, %eax
	xorl	%esi, %esi
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L9:
	subl	$48, %ecx
	addq	$1, %rax
	addq	%r8, %rsi
	movslq	%ecx, %r8
	cmpq	%rax, %r9
	je	.L8
.L5:
	btl	%eax, %edx
	movsbq	1(%rdi,%rax), %rcx
	jc	.L9
	leaq	(%r8,%r8,4), %r8
	addq	$1, %rax
	leaq	-48(%rcx,%r8,2), %r8
	cmpq	%rax, %r9
	jne	.L5
.L8:
	addq	%rsi, %r8
.L1:
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE51:
	.size	f, .-f
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	xorl	%ebx, %ebx
	subq	$40, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L12:
	movb	%al, 13(%rsp,%r10)
	addl	$1, %ebx
.L11:
	movq	stdin(%rip), %rdi
	call	getc@PLT
	movsbq	%bl, %r10
	cmpb	$10, %al
	jne	.L12
	leal	-1(%r10), %ecx
	movl	$1, %ebp
	movslq	%r10d, %rax
	sall	%cl, %ebp
	movb	$0, 13(%rsp,%rax)
	testl	%ebp, %ebp
	jle	.L20
	movsbl	13(%rsp), %ebx
	xorl	%r11d, %r11d
	xorl	%esi, %esi
	movl	%ecx, %r8d
	leaq	14(%rsp), %r9
	subl	$48, %ebx
	movslq	%ebx, %rbx
	.p2align 4,,10
	.p2align 3
.L18:
	movq	%rbx, %rcx
	cmpl	$1, %r10d
	jle	.L14
	xorl	%eax, %eax
	xorl	%edi, %edi
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L26:
	subl	$48, %edx
	addq	$1, %rax
	addq	%rcx, %rdi
	movslq	%edx, %rcx
	cmpq	%rax, %r8
	je	.L25
.L17:
	btl	%eax, %esi
	movsbq	(%r9,%rax), %rdx
	jc	.L26
	leaq	(%rcx,%rcx,4), %rcx
	addq	$1, %rax
	leaq	-48(%rdx,%rcx,2), %rcx
	cmpq	%rax, %r8
	jne	.L17
.L25:
	addq	%rdi, %rcx
.L14:
	addl	$1, %esi
	addq	%rcx, %r11
	cmpl	%esi, %ebp
	jne	.L18
.L13:
	xorl	%eax, %eax
	movq	%r11, %rdx
	movl	$1, %edi
	leaq	.LC0(%rip), %rsi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L27
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L20:
	.cfi_restore_state
	xorl	%r11d, %r11d
	jmp	.L13
.L27:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.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:
```