	.file	"986092.c"
	.intel_syntax noprefix
	.text
	.globl	calculate
	.type	calculate, @function
calculate:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 4048
	mov	QWORD PTR -4040[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -4032[rbp], 0
	mov	DWORD PTR -4028[rbp], 0
	mov	DWORD PTR -4020[rbp], 1
	jmp	.L2
.L11:
	mov	rax, QWORD PTR -4040[rbp]
	movzx	eax, BYTE PTR [rax]
	movsx	eax, al
	sub	eax, 48
	cmp	eax, 9
	ja	.L3
	mov	DWORD PTR -4024[rbp], 0
	jmp	.L4
.L6:
	mov	edx, DWORD PTR -4024[rbp]
	mov	eax, edx
	sal	eax, 2
	add	eax, edx
	add	eax, eax
	mov	edx, eax
	mov	rax, QWORD PTR -4040[rbp]
	movzx	eax, BYTE PTR [rax]
	movsx	eax, al
	sub	eax, 48
	add	eax, edx
	mov	DWORD PTR -4024[rbp], eax
	add	QWORD PTR -4040[rbp], 1
.L4:
	mov	rax, QWORD PTR -4040[rbp]
	movzx	eax, BYTE PTR [rax]
	test	al, al
	je	.L5
	mov	rax, QWORD PTR -4040[rbp]
	movzx	eax, BYTE PTR [rax]
	movsx	eax, al
	sub	eax, 48
	cmp	eax, 9
	jbe	.L6
.L5:
	mov	eax, DWORD PTR -4020[rbp]
	imul	eax, DWORD PTR -4024[rbp]
	add	DWORD PTR -4032[rbp], eax
	jmp	.L2
.L3:
	mov	rax, QWORD PTR -4040[rbp]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 45
	jne	.L7
	mov	DWORD PTR -4020[rbp], -1
	jmp	.L8
.L7:
	mov	rax, QWORD PTR -4040[rbp]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 43
	jne	.L9
	mov	DWORD PTR -4020[rbp], 1
	jmp	.L8
.L9:
	mov	rax, QWORD PTR -4040[rbp]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 40
	jne	.L10
	mov	eax, DWORD PTR -4028[rbp]
	lea	edx, 1[rax]
	mov	DWORD PTR -4028[rbp], edx
	cdqe
	mov	edx, DWORD PTR -4032[rbp]
	mov	DWORD PTR -4016[rbp+rax*4], edx
	mov	DWORD PTR -4032[rbp], 0
	mov	eax, DWORD PTR -4028[rbp]
	lea	edx, 1[rax]
	mov	DWORD PTR -4028[rbp], edx
	cdqe
	mov	edx, DWORD PTR -4020[rbp]
	mov	DWORD PTR -4016[rbp+rax*4], edx
	mov	DWORD PTR -4020[rbp], 1
	jmp	.L8
.L10:
	mov	rax, QWORD PTR -4040[rbp]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 41
	jne	.L8
	sub	DWORD PTR -4028[rbp], 1
	mov	eax, DWORD PTR -4028[rbp]
	cdqe
	mov	eax, DWORD PTR -4016[rbp+rax*4]
	mov	DWORD PTR -4020[rbp], eax
	sub	DWORD PTR -4028[rbp], 1
	mov	eax, DWORD PTR -4028[rbp]
	cdqe
	mov	edx, DWORD PTR -4016[rbp+rax*4]
	mov	eax, DWORD PTR -4020[rbp]
	imul	eax, DWORD PTR -4032[rbp]
	add	eax, edx
	mov	DWORD PTR -4032[rbp], eax
.L8:
	add	QWORD PTR -4040[rbp], 1
.L2:
	mov	rax, QWORD PTR -4040[rbp]
	movzx	eax, BYTE PTR [rax]
	test	al, al
	jne	.L11
	mov	eax, DWORD PTR -4032[rbp]
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	calculate, .-calculate
	.ident	"GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.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:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 6
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"986092.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	calculate
	.syntax unified
	.arm
	.fpu softvfp
	.type	calculate, %function
calculate:
	@ args = 0, pretend = 0, frame = 4032
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #4032
	str	r0, [fp, #-4032]
	ldr	r3, .L14
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-4024]
	mov	r3, #0
	str	r3, [fp, #-4020]
	mov	r3, #1
	str	r3, [fp, #-4012]
	b	.L2
.L11:
	ldr	r3, [fp, #-4032]
	ldrb	r3, [r3]	@ zero_extendqisi2
	sub	r3, r3, #48
	cmp	r3, #9
	bhi	.L3
	mov	r3, #0
	str	r3, [fp, #-4016]
	b	.L4
.L6:
	ldr	r2, [fp, #-4016]
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #1
	mov	r2, r3
	ldr	r3, [fp, #-4032]
	ldrb	r3, [r3]	@ zero_extendqisi2
	sub	r3, r3, #48
	add	r3, r2, r3
	str	r3, [fp, #-4016]
	ldr	r3, [fp, #-4032]
	add	r3, r3, #1
	str	r3, [fp, #-4032]
.L4:
	ldr	r3, [fp, #-4032]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L5
	ldr	r3, [fp, #-4032]
	ldrb	r3, [r3]	@ zero_extendqisi2
	sub	r3, r3, #48
	cmp	r3, #9
	bls	.L6
.L5:
	ldr	r3, [fp, #-4012]
	ldr	r2, [fp, #-4016]
	mul	r3, r2, r3
	ldr	r2, [fp, #-4024]
	add	r3, r2, r3
	str	r3, [fp, #-4024]
	b	.L2
.L3:
	ldr	r3, [fp, #-4032]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #45
	bne	.L7
	mvn	r3, #0
	str	r3, [fp, #-4012]
	b	.L8
.L7:
	ldr	r3, [fp, #-4032]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #43
	bne	.L9
	mov	r3, #1
	str	r3, [fp, #-4012]
	b	.L8
.L9:
	ldr	r3, [fp, #-4032]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #40
	bne	.L10
	ldr	r3, [fp, #-4020]
	add	r2, r3, #1
	str	r2, [fp, #-4020]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r2, [fp, #-4024]
	str	r2, [r3, #-4004]
	mov	r3, #0
	str	r3, [fp, #-4024]
	ldr	r3, [fp, #-4020]
	add	r2, r3, #1
	str	r2, [fp, #-4020]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r2, [fp, #-4012]
	str	r2, [r3, #-4004]
	mov	r3, #1
	str	r3, [fp, #-4012]
	b	.L8
.L10:
	ldr	r3, [fp, #-4032]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #41
	bne	.L8
	ldr	r3, [fp, #-4020]
	sub	r3, r3, #1
	str	r3, [fp, #-4020]
	ldr	r3, [fp, #-4020]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-4004]
	str	r3, [fp, #-4012]
	ldr	r3, [fp, #-4020]
	sub	r3, r3, #1
	str	r3, [fp, #-4020]
	ldr	r3, [fp, #-4020]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r2, [r3, #-4004]
	ldr	r3, [fp, #-4012]
	ldr	r1, [fp, #-4024]
	mul	r3, r1, r3
	add	r3, r2, r3
	str	r3, [fp, #-4024]
.L8:
	ldr	r3, [fp, #-4032]
	add	r3, r3, #1
	str	r3, [fp, #-4032]
.L2:
	ldr	r3, [fp, #-4032]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L11
	ldr	r3, [fp, #-4024]
	ldr	r2, .L14
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L13
	bl	__stack_chk_fail
.L13:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L15:
	.align	2
.L14:
	.word	.LC0
	.size	calculate, .-calculate
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
