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

```c
#include <stdio.h>
int soma(int a){
	int som=0;
	while(a!=0){
		som+=a%10;
		a/=10;
	}
		return som;
}
int main(void){
	int n,resul;
	scanf("%d", &n);
	if(n%2){
		resul = soma(n);
	}
	if(!(n%2)){
		if(soma(n/2)*2<=soma(n-1)+1){
			resul = soma(n/2)*2;
		}
		else resul=soma(n);
	}
	printf("%d\n", resul);
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	soma
	.type	soma, @function
soma:
.LFB23:
	.cfi_startproc
	endbr64
	xorl	%r8d, %r8d
	testl	%edi, %edi
	je	.L1
	.p2align 4,,10
	.p2align 3
.L3:
	movslq	%edi, %rax
	movl	%edi, %edx
	imulq	$1717986919, %rax, %rax
	sarl	$31, %edx
	sarq	$34, %rax
	subl	%edx, %eax
	leal	(%rax,%rax,4), %edx
	addl	%edx, %edx
	subl	%edx, %edi
	addl	%edi, %r8d
	movl	%eax, %edi
	testl	%eax, %eax
	jne	.L3
.L1:
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	soma, .-soma
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.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
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %ecx
	testb	$1, %cl
	je	.L8
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L9:
	movslq	%ecx, %rax
	movl	%ecx, %esi
	imulq	$1717986919, %rax, %rax
	sarl	$31, %esi
	sarq	$34, %rax
	subl	%esi, %eax
	leal	(%rax,%rax,4), %esi
	addl	%esi, %esi
	subl	%esi, %ecx
	addl	%ecx, %edx
	movl	%eax, %ecx
	testl	%eax, %eax
	jne	.L9
.L10:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L38
	xorl	%eax, %eax
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L8:
	.cfi_restore_state
	movl	%ecx, %eax
	movl	$2, %esi
	xorl	%r9d, %r9d
	cltd
	idivl	%esi
	movl	%eax, %edi
	movl	%eax, %esi
	testl	%eax, %eax
	je	.L39
	.p2align 4,,10
	.p2align 3
.L11:
	movslq	%esi, %rdx
	movl	%esi, %r8d
	imulq	$1717986919, %rdx, %rdx
	sarl	$31, %r8d
	sarq	$34, %rdx
	subl	%r8d, %edx
	leal	(%rdx,%rdx,4), %r8d
	addl	%r8d, %r8d
	subl	%r8d, %esi
	addl	%esi, %r9d
	movl	%edx, %esi
	testl	%edx, %edx
	jne	.L11
	movl	%ecx, %edx
	addl	%r9d, %r9d
	subl	$1, %edx
	je	.L12
.L19:
	xorl	%r10d, %r10d
	.p2align 4,,10
	.p2align 3
.L13:
	movslq	%edx, %rsi
	movl	%edx, %r8d
	imulq	$1717986919, %rsi, %rsi
	sarl	$31, %r8d
	sarq	$34, %rsi
	subl	%r8d, %esi
	leal	(%rsi,%rsi,4), %r8d
	addl	%r8d, %r8d
	subl	%r8d, %edx
	addl	%edx, %r10d
	movl	%esi, %edx
	testl	%esi, %esi
	jne	.L13
	addl	$1, %r10d
	cmpl	%r9d, %r10d
	jl	.L37
	testl	%eax, %eax
	je	.L16
	.p2align 4,,10
	.p2align 3
.L17:
	movslq	%edi, %rax
	movl	%edi, %ecx
	imulq	$1717986919, %rax, %rax
	sarl	$31, %ecx
	sarq	$34, %rax
	subl	%ecx, %eax
	leal	(%rax,%rax,4), %ecx
	addl	%ecx, %ecx
	subl	%ecx, %edi
	addl	%edi, %edx
	movl	%eax, %edi
	testl	%eax, %eax
	jne	.L17
.L16:
	addl	%edx, %edx
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L15:
	movslq	%ecx, %rax
	movl	%ecx, %esi
	imulq	$1717986919, %rax, %rax
	sarl	$31, %esi
	sarq	$34, %rax
	subl	%esi, %eax
	leal	(%rax,%rax,4), %esi
	addl	%esi, %esi
	subl	%esi, %ecx
	addl	%ecx, %edx
	movl	%eax, %ecx
.L37:
	testl	%ecx, %ecx
	jne	.L15
	jmp	.L10
.L39:
	movl	%ecx, %edx
	xorl	%r9d, %r9d
	subl	$1, %edx
	jne	.L19
	addl	%edx, %edx
	jmp	.L10
.L12:
	subl	$1, %r9d
	jle	.L16
	movl	$1, %edx
	jmp	.L10
.L38:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.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	soma
	.type	soma, @function
soma:
.LFB23:
	.cfi_startproc
	endbr64
	xorl	%r8d, %r8d
	testl	%edi, %edi
	je	.L1
	.p2align 4,,10
	.p2align 3
.L3:
	movslq	%edi, %rax
	movl	%edi, %edx
	imulq	$1717986919, %rax, %rax
	sarl	$31, %edx
	sarq	$34, %rax
	subl	%edx, %eax
	leal	(%rax,%rax,4), %edx
	addl	%edx, %edx
	subl	%edx, %edi
	addl	%edi, %r8d
	movl	%eax, %edi
	testl	%eax, %eax
	jne	.L3
.L1:
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	soma, .-soma
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.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
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %ecx
	testb	$1, %cl
	je	.L8
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L9:
	movslq	%ecx, %rax
	movl	%ecx, %esi
	imulq	$1717986919, %rax, %rax
	sarl	$31, %esi
	sarq	$34, %rax
	subl	%esi, %eax
	leal	(%rax,%rax,4), %esi
	addl	%esi, %esi
	subl	%esi, %ecx
	addl	%ecx, %edx
	movl	%eax, %ecx
	testl	%eax, %eax
	jne	.L9
.L10:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L38
	xorl	%eax, %eax
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L8:
	.cfi_restore_state
	movl	%ecx, %eax
	movl	$2, %esi
	xorl	%r9d, %r9d
	cltd
	idivl	%esi
	movl	%eax, %edi
	movl	%eax, %esi
	testl	%eax, %eax
	je	.L39
	.p2align 4,,10
	.p2align 3
.L11:
	movslq	%esi, %rdx
	movl	%esi, %r8d
	imulq	$1717986919, %rdx, %rdx
	sarl	$31, %r8d
	sarq	$34, %rdx
	subl	%r8d, %edx
	leal	(%rdx,%rdx,4), %r8d
	addl	%r8d, %r8d
	subl	%r8d, %esi
	addl	%esi, %r9d
	movl	%edx, %esi
	testl	%edx, %edx
	jne	.L11
	movl	%ecx, %edx
	addl	%r9d, %r9d
	subl	$1, %edx
	je	.L12
.L19:
	xorl	%r10d, %r10d
	.p2align 4,,10
	.p2align 3
.L13:
	movslq	%edx, %rsi
	movl	%edx, %r8d
	imulq	$1717986919, %rsi, %rsi
	sarl	$31, %r8d
	sarq	$34, %rsi
	subl	%r8d, %esi
	leal	(%rsi,%rsi,4), %r8d
	addl	%r8d, %r8d
	subl	%r8d, %edx
	addl	%edx, %r10d
	movl	%esi, %edx
	testl	%esi, %esi
	jne	.L13
	addl	$1, %r10d
	cmpl	%r9d, %r10d
	jl	.L37
	testl	%eax, %eax
	je	.L16
	.p2align 4,,10
	.p2align 3
.L17:
	movslq	%edi, %rax
	movl	%edi, %ecx
	imulq	$1717986919, %rax, %rax
	sarl	$31, %ecx
	sarq	$34, %rax
	subl	%ecx, %eax
	leal	(%rax,%rax,4), %ecx
	addl	%ecx, %ecx
	subl	%ecx, %edi
	addl	%edi, %edx
	movl	%eax, %edi
	testl	%eax, %eax
	jne	.L17
.L16:
	addl	%edx, %edx
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L15:
	movslq	%ecx, %rax
	movl	%ecx, %esi
	imulq	$1717986919, %rax, %rax
	sarl	$31, %esi
	sarq	$34, %rax
	subl	%esi, %eax
	leal	(%rax,%rax,4), %esi
	addl	%esi, %esi
	subl	%esi, %ecx
	addl	%ecx, %edx
	movl	%eax, %ecx
.L37:
	testl	%ecx, %ecx
	jne	.L15
	jmp	.L10
.L39:
	movl	%ecx, %edx
	xorl	%r9d, %r9d
	subl	$1, %edx
	jne	.L19
	addl	%edx, %edx
	jmp	.L10
.L12:
	subl	$1, %r9d
	jle	.L16
	movl	$1, %edx
	jmp	.L10
.L38:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.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	soma
	.type	soma, @function
soma:
.LFB23:
	.cfi_startproc
	endbr64
	xorl	%r8d, %r8d
	testl	%edi, %edi
	je	.L1
	.p2align 4,,10
	.p2align 3
.L3:
	movslq	%edi, %rax
	movl	%edi, %edx
	imulq	$1717986919, %rax, %rax
	sarl	$31, %edx
	sarq	$34, %rax
	subl	%edx, %eax
	leal	(%rax,%rax,4), %edx
	addl	%edx, %edx
	subl	%edx, %edi
	addl	%edi, %r8d
	movl	%eax, %edi
	testl	%eax, %eax
	jne	.L3
.L1:
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	soma, .-soma
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.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
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %ecx
	testb	$1, %cl
	je	.L8
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L9:
	movslq	%ecx, %rax
	movl	%ecx, %esi
	imulq	$1717986919, %rax, %rax
	sarl	$31, %esi
	sarq	$34, %rax
	subl	%esi, %eax
	leal	(%rax,%rax,4), %esi
	addl	%esi, %esi
	subl	%esi, %ecx
	addl	%ecx, %edx
	movl	%eax, %ecx
	testl	%eax, %eax
	jne	.L9
.L10:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L38
	xorl	%eax, %eax
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L8:
	.cfi_restore_state
	movl	%ecx, %eax
	movl	$2, %esi
	xorl	%r9d, %r9d
	cltd
	idivl	%esi
	movl	%eax, %edi
	movl	%eax, %esi
	testl	%eax, %eax
	je	.L39
	.p2align 4,,10
	.p2align 3
.L11:
	movslq	%esi, %rdx
	movl	%esi, %r8d
	imulq	$1717986919, %rdx, %rdx
	sarl	$31, %r8d
	sarq	$34, %rdx
	subl	%r8d, %edx
	leal	(%rdx,%rdx,4), %r8d
	addl	%r8d, %r8d
	subl	%r8d, %esi
	addl	%esi, %r9d
	movl	%edx, %esi
	testl	%edx, %edx
	jne	.L11
	movl	%ecx, %edx
	addl	%r9d, %r9d
	subl	$1, %edx
	je	.L12
.L19:
	xorl	%r10d, %r10d
	.p2align 4,,10
	.p2align 3
.L13:
	movslq	%edx, %rsi
	movl	%edx, %r8d
	imulq	$1717986919, %rsi, %rsi
	sarl	$31, %r8d
	sarq	$34, %rsi
	subl	%r8d, %esi
	leal	(%rsi,%rsi,4), %r8d
	addl	%r8d, %r8d
	subl	%r8d, %edx
	addl	%edx, %r10d
	movl	%esi, %edx
	testl	%esi, %esi
	jne	.L13
	addl	$1, %r10d
	cmpl	%r9d, %r10d
	jl	.L37
	testl	%eax, %eax
	je	.L16
	.p2align 4,,10
	.p2align 3
.L17:
	movslq	%edi, %rax
	movl	%edi, %ecx
	imulq	$1717986919, %rax, %rax
	sarl	$31, %ecx
	sarq	$34, %rax
	subl	%ecx, %eax
	leal	(%rax,%rax,4), %ecx
	addl	%ecx, %ecx
	subl	%ecx, %edi
	addl	%edi, %edx
	movl	%eax, %edi
	testl	%eax, %eax
	jne	.L17
.L16:
	addl	%edx, %edx
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L15:
	movslq	%ecx, %rax
	movl	%ecx, %esi
	imulq	$1717986919, %rax, %rax
	sarl	$31, %esi
	sarq	$34, %rax
	subl	%esi, %eax
	leal	(%rax,%rax,4), %esi
	addl	%esi, %esi
	subl	%esi, %ecx
	addl	%ecx, %edx
	movl	%eax, %ecx
.L37:
	testl	%ecx, %ecx
	jne	.L15
	jmp	.L10
.L39:
	movl	%ecx, %edx
	xorl	%r9d, %r9d
	subl	$1, %edx
	jne	.L19
	addl	%edx, %edx
	jmp	.L10
.L12:
	subl	$1, %r9d
	jle	.L16
	movl	$1, %edx
	jmp	.L10
.L38:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.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 <stdio.h>
int soma(int a){
	int som=0;
	while(a!=0){
		som+=a%10;
		a/=10;
	}
		return som;
}
int main(void){
	int n,resul;
	scanf("%d", &n);
	if(n%2){
		resul = soma(n);
	}
	if(!(n%2)){
		if(soma(n/2)*2<=soma(n-1)+1){
			resul = soma(n/2)*2;
		}
		else resul=soma(n);
	}
	printf("%d\n", resul);
	return 0;
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
int soma(int a){
	int som=0;
	while(a!=0){
		som+=a%10;
		a/=10;
	}
		return som;
}
int main(void){
	int n,resul;
	scanf("%d", &n);
	if(n%2){
		resul = soma(n);
	}
	if(!(n%2)){
		if(soma(n/2)*2<=soma(n-1)+1){
			resul = soma(n/2)*2;
		}
		else resul=soma(n);
	}
	printf("%d\n", resul);
	return 0;
}```

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:

22
 37
 36
 3
 5
 7
 26
 38
 58
 78

4
 10
 9
 3
 5
 7
 8
 11
 13
 15

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

```c
#include <stdio.h>
int soma(int a){
	int som=0;
	while(a!=0){
		som+=a%10;
		a/=10;
	}
		return som;
}
int main(void){
	int n,resul;
	scanf("%d", &n);
	if(n%2){
		resul = soma(n);
	}
	if(!(n%2)){
		if(soma(n/2)*2<=soma(n-1)+1){
			resul = soma(n/2)*2;
		}
		else resul=soma(n);
	}
	printf("%d\n", resul);
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	soma
	.type	soma, @function
soma:
.LFB23:
	.cfi_startproc
	endbr64
	xorl	%r8d, %r8d
	testl	%edi, %edi
	je	.L1
	.p2align 4,,10
	.p2align 3
.L3:
	movslq	%edi, %rax
	movl	%edi, %edx
	imulq	$1717986919, %rax, %rax
	sarl	$31, %edx
	sarq	$34, %rax
	subl	%edx, %eax
	leal	(%rax,%rax,4), %edx
	addl	%edx, %edx
	subl	%edx, %edi
	addl	%edi, %r8d
	movl	%eax, %edi
	testl	%eax, %eax
	jne	.L3
.L1:
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	soma, .-soma
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.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
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %ecx
	testb	$1, %cl
	je	.L8
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L9:
	movslq	%ecx, %rax
	movl	%ecx, %esi
	imulq	$1717986919, %rax, %rax
	sarl	$31, %esi
	sarq	$34, %rax
	subl	%esi, %eax
	leal	(%rax,%rax,4), %esi
	addl	%esi, %esi
	subl	%esi, %ecx
	addl	%ecx, %edx
	movl	%eax, %ecx
	testl	%eax, %eax
	jne	.L9
.L10:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L38
	xorl	%eax, %eax
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L8:
	.cfi_restore_state
	movl	%ecx, %eax
	movl	$2, %esi
	xorl	%r9d, %r9d
	cltd
	idivl	%esi
	movl	%eax, %edi
	movl	%eax, %esi
	testl	%eax, %eax
	je	.L39
	.p2align 4,,10
	.p2align 3
.L11:
	movslq	%esi, %rdx
	movl	%esi, %r8d
	imulq	$1717986919, %rdx, %rdx
	sarl	$31, %r8d
	sarq	$34, %rdx
	subl	%r8d, %edx
	leal	(%rdx,%rdx,4), %r8d
	addl	%r8d, %r8d
	subl	%r8d, %esi
	addl	%esi, %r9d
	movl	%edx, %esi
	testl	%edx, %edx
	jne	.L11
	movl	%ecx, %edx
	addl	%r9d, %r9d
	subl	$1, %edx
	je	.L12
.L19:
	xorl	%r10d, %r10d
	.p2align 4,,10
	.p2align 3
.L13:
	movslq	%edx, %rsi
	movl	%edx, %r8d
	imulq	$1717986919, %rsi, %rsi
	sarl	$31, %r8d
	sarq	$34, %rsi
	subl	%r8d, %esi
	leal	(%rsi,%rsi,4), %r8d
	addl	%r8d, %r8d
	subl	%r8d, %edx
	addl	%edx, %r10d
	movl	%esi, %edx
	testl	%esi, %esi
	jne	.L13
	addl	$1, %r10d
	cmpl	%r9d, %r10d
	jl	.L37
	testl	%eax, %eax
	je	.L16
	.p2align 4,,10
	.p2align 3
.L17:
	movslq	%edi, %rax
	movl	%edi, %ecx
	imulq	$1717986919, %rax, %rax
	sarl	$31, %ecx
	sarq	$34, %rax
	subl	%ecx, %eax
	leal	(%rax,%rax,4), %ecx
	addl	%ecx, %ecx
	subl	%ecx, %edi
	addl	%edi, %edx
	movl	%eax, %edi
	testl	%eax, %eax
	jne	.L17
.L16:
	addl	%edx, %edx
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L15:
	movslq	%ecx, %rax
	movl	%ecx, %esi
	imulq	$1717986919, %rax, %rax
	sarl	$31, %esi
	sarq	$34, %rax
	subl	%esi, %eax
	leal	(%rax,%rax,4), %esi
	addl	%esi, %esi
	subl	%esi, %ecx
	addl	%ecx, %edx
	movl	%eax, %ecx
.L37:
	testl	%ecx, %ecx
	jne	.L15
	jmp	.L10
.L39:
	movl	%ecx, %edx
	xorl	%r9d, %r9d
	subl	$1, %edx
	jne	.L19
	addl	%edx, %edx
	jmp	.L10
.L12:
	subl	$1, %r9d
	jle	.L16
	movl	$1, %edx
	jmp	.L10
.L38:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.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	soma
	.type	soma, @function
soma:
.LFB23:
	.cfi_startproc
	endbr64
	xorl	%r8d, %r8d
	testl	%edi, %edi
	je	.L1
	.p2align 4,,10
	.p2align 3
.L3:
	movslq	%edi, %rax
	movl	%edi, %edx
	imulq	$1717986919, %rax, %rax
	sarl	$31, %edx
	sarq	$34, %rax
	subl	%edx, %eax
	leal	(%rax,%rax,4), %edx
	addl	%edx, %edx
	subl	%edx, %edi
	addl	%edi, %r8d
	movl	%eax, %edi
	testl	%eax, %eax
	jne	.L3
.L1:
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	soma, .-soma
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.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
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %ecx
	testb	$1, %cl
	je	.L8
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L9:
	movslq	%ecx, %rax
	movl	%ecx, %esi
	imulq	$1717986919, %rax, %rax
	sarl	$31, %esi
	sarq	$34, %rax
	subl	%esi, %eax
	leal	(%rax,%rax,4), %esi
	addl	%esi, %esi
	subl	%esi, %ecx
	addl	%ecx, %edx
	movl	%eax, %ecx
	testl	%eax, %eax
	jne	.L9
.L10:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L38
	xorl	%eax, %eax
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L8:
	.cfi_restore_state
	movl	%ecx, %eax
	movl	$2, %esi
	xorl	%r9d, %r9d
	cltd
	idivl	%esi
	movl	%eax, %edi
	movl	%eax, %esi
	testl	%eax, %eax
	je	.L39
	.p2align 4,,10
	.p2align 3
.L11:
	movslq	%esi, %rdx
	movl	%esi, %r8d
	imulq	$1717986919, %rdx, %rdx
	sarl	$31, %r8d
	sarq	$34, %rdx
	subl	%r8d, %edx
	leal	(%rdx,%rdx,4), %r8d
	addl	%r8d, %r8d
	subl	%r8d, %esi
	addl	%esi, %r9d
	movl	%edx, %esi
	testl	%edx, %edx
	jne	.L11
	movl	%ecx, %edx
	addl	%r9d, %r9d
	subl	$1, %edx
	je	.L12
.L19:
	xorl	%r10d, %r10d
	.p2align 4,,10
	.p2align 3
.L13:
	movslq	%edx, %rsi
	movl	%edx, %r8d
	imulq	$1717986919, %rsi, %rsi
	sarl	$31, %r8d
	sarq	$34, %rsi
	subl	%r8d, %esi
	leal	(%rsi,%rsi,4), %r8d
	addl	%r8d, %r8d
	subl	%r8d, %edx
	addl	%edx, %r10d
	movl	%esi, %edx
	testl	%esi, %esi
	jne	.L13
	addl	$1, %r10d
	cmpl	%r9d, %r10d
	jl	.L37
	testl	%eax, %eax
	je	.L16
	.p2align 4,,10
	.p2align 3
.L17:
	movslq	%edi, %rax
	movl	%edi, %ecx
	imulq	$1717986919, %rax, %rax
	sarl	$31, %ecx
	sarq	$34, %rax
	subl	%ecx, %eax
	leal	(%rax,%rax,4), %ecx
	addl	%ecx, %ecx
	subl	%ecx, %edi
	addl	%edi, %edx
	movl	%eax, %edi
	testl	%eax, %eax
	jne	.L17
.L16:
	addl	%edx, %edx
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L15:
	movslq	%ecx, %rax
	movl	%ecx, %esi
	imulq	$1717986919, %rax, %rax
	sarl	$31, %esi
	sarq	$34, %rax
	subl	%esi, %eax
	leal	(%rax,%rax,4), %esi
	addl	%esi, %esi
	subl	%esi, %ecx
	addl	%ecx, %edx
	movl	%eax, %ecx
.L37:
	testl	%ecx, %ecx
	jne	.L15
	jmp	.L10
.L39:
	movl	%ecx, %edx
	xorl	%r9d, %r9d
	subl	$1, %edx
	jne	.L19
	addl	%edx, %edx
	jmp	.L10
.L12:
	subl	$1, %r9d
	jle	.L16
	movl	$1, %edx
	jmp	.L10
.L38:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.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:
```