	.file	"137338.c"
	.intel_syntax noprefix
	.text
	.globl	calculate_hash
	.type	calculate_hash, @function
calculate_hash:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -24[rbp], rdi
	mov	DWORD PTR -8[rbp], 0
	mov	DWORD PTR -4[rbp], 1
	jmp	.L2
.L3:
	mov	rax, QWORD PTR -24[rbp]
	movzx	eax, BYTE PTR [rax]
	movsx	eax, al
	imul	eax, DWORD PTR -4[rbp]
	add	DWORD PTR -8[rbp], eax
	add	DWORD PTR -4[rbp], 1
	add	QWORD PTR -24[rbp], 1
.L2:
	mov	rax, QWORD PTR -24[rbp]
	movzx	eax, BYTE PTR [rax]
	test	al, al
	jne	.L3
	mov	eax, DWORD PTR -8[rbp]
	movsx	rdx, eax
	imul	rdx, rdx, 917789339
	shr	rdx, 32
	sar	edx, 7
	mov	ecx, eax
	sar	ecx, 31
	sub	edx, ecx
	imul	ecx, edx, 599
	sub	eax, ecx
	mov	edx, eax
	mov	eax, edx
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	calculate_hash, .-calculate_hash
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 4096
	or	QWORD PTR [rsp], 0
	sub	rsp, 864
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rax, -4948[rbp]
	mov	rsi, rax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	mov	DWORD PTR -4944[rbp], 0
	jmp	.L6
.L7:
	mov	eax, DWORD PTR -4944[rbp]
	cdqe
	mov	QWORD PTR -4912[rbp+rax*8], 0
	add	DWORD PTR -4944[rbp], 1
.L6:
	cmp	DWORD PTR -4944[rbp], 598
	jle	.L7
	mov	DWORD PTR -4940[rbp], 0
	jmp	.L8
.L9:
	lea	rax, -112[rbp]
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	lea	rax, -112[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	DWORD PTR -4928[rbp], eax
	lea	rax, -112[rbp]
	mov	rdi, rax
	call	calculate_hash
	mov	DWORD PTR -4924[rbp], eax
	mov	eax, DWORD PTR -4928[rbp]
	add	eax, 1
	cdqe
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -4920[rbp], rax
	lea	rdx, -112[rbp]
	mov	rax, QWORD PTR -4920[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	strcpy@PLT
	mov	eax, DWORD PTR -4924[rbp]
	cdqe
	mov	rdx, QWORD PTR -4920[rbp]
	mov	QWORD PTR -4912[rbp+rax*8], rdx
	add	DWORD PTR -4940[rbp], 1
.L8:
	mov	eax, DWORD PTR -4948[rbp]
	cmp	DWORD PTR -4940[rbp], eax
	jl	.L9
	mov	DWORD PTR -4936[rbp], 0
	mov	DWORD PTR -4932[rbp], 0
	jmp	.L10
.L12:
	mov	eax, DWORD PTR -4932[rbp]
	cdqe
	mov	rax, QWORD PTR -4912[rbp+rax*8]
	test	rax, rax
	je	.L11
	add	DWORD PTR -4936[rbp], 1
.L11:
	add	DWORD PTR -4932[rbp], 1
.L10:
	cmp	DWORD PTR -4932[rbp], 598
	jle	.L12
	mov	eax, DWORD PTR -4936[rbp]
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	main, .-main
	.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	"137338.c"
	.text
	.align	2
	.global	calculate_hash
	.syntax unified
	.arm
	.fpu softvfp
	.type	calculate_hash, %function
calculate_hash:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #20
	str	r0, [fp, #-16]
	mov	r3, #0
	str	r3, [fp, #-12]
	mov	r3, #1
	str	r3, [fp, #-8]
	b	.L2
.L3:
	ldr	r3, [fp, #-16]
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r2, r3
	ldr	r3, [fp, #-8]
	mul	r3, r2, r3
	ldr	r2, [fp, #-12]
	add	r3, r2, r3
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L2:
	ldr	r3, [fp, #-16]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L3
	ldr	r0, [fp, #-12]
	ldr	r3, .L5
	smull	r2, r3, r0, r3
	asr	r2, r3, #7
	asr	r3, r0, #31
	sub	r1, r2, r3
	mov	r2, r1
	lsl	r2, r2, #2
	add	r2, r2, r1
	lsl	r3, r2, #4
	sub	r3, r3, r2
	lsl	r3, r3, #3
	sub	r3, r3, r1
	sub	r1, r0, r3
	mov	r3, r1
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
.L6:
	.align	2
.L5:
	.word	917789339
	.size	calculate_hash, .-calculate_hash
	.section	.rodata
	.align	2
.LC0:
	.ascii	"%d\000"
	.align	2
.LC1:
	.ascii	"%s\000"
	.align	2
.LC2:
	.ascii	"%d\012\000"
	.align	2
.LC3:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 2536
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #2528
	sub	sp, sp, #8
	ldr	r3, .L16
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r3, fp, #2528
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r1, r3
	ldr	r0, .L16+4
	bl	__isoc99_scanf
	mov	r3, #0
	str	r3, [fp, #-2532]
	b	.L8
.L9:
	ldr	r3, [fp, #-2532]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	mov	r2, #0
	str	r2, [r3, #-2500]
	ldr	r3, [fp, #-2532]
	add	r3, r3, #1
	str	r3, [fp, #-2532]
.L8:
	ldr	r3, [fp, #-2532]
	ldr	r2, .L16+8
	cmp	r3, r2
	ble	.L9
	mov	r3, #0
	str	r3, [fp, #-2528]
	b	.L10
.L11:
	sub	r3, fp, #108
	mov	r1, r3
	ldr	r0, .L16+12
	bl	__isoc99_scanf
	sub	r3, fp, #108
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	str	r3, [fp, #-2516]
	sub	r3, fp, #108
	mov	r0, r3
	bl	calculate_hash
	str	r0, [fp, #-2512]
	ldr	r3, [fp, #-2516]
	add	r3, r3, #1
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-2508]
	sub	r3, fp, #108
	mov	r1, r3
	ldr	r0, [fp, #-2508]
	bl	strcpy
	ldr	r3, [fp, #-2512]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r2, [fp, #-2508]
	str	r2, [r3, #-2500]
	ldr	r3, [fp, #-2528]
	add	r3, r3, #1
	str	r3, [fp, #-2528]
.L10:
	ldr	r3, [fp, #-2536]
	ldr	r2, [fp, #-2528]
	cmp	r2, r3
	blt	.L11
	mov	r3, #0
	str	r3, [fp, #-2524]
	mov	r3, #0
	str	r3, [fp, #-2520]
	b	.L12
.L14:
	ldr	r3, [fp, #-2520]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-2500]
	cmp	r3, #0
	beq	.L13
	ldr	r3, [fp, #-2524]
	add	r3, r3, #1
	str	r3, [fp, #-2524]
.L13:
	ldr	r3, [fp, #-2520]
	add	r3, r3, #1
	str	r3, [fp, #-2520]
.L12:
	ldr	r3, [fp, #-2520]
	ldr	r2, .L16+8
	cmp	r3, r2
	ble	.L14
	ldr	r1, [fp, #-2524]
	ldr	r0, .L16+16
	bl	printf
	nop
	ldr	r3, .L16
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L15
	bl	__stack_chk_fail
.L15:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L17:
	.align	2
.L16:
	.word	.LC3
	.word	.LC0
	.word	598
	.word	.LC1
	.word	.LC2
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
