	.file	"1009174.c"
	.intel_syntax noprefix
	.text
	.type	shannon_entropy, @function
shannon_entropy:
.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, 1088
	mov	QWORD PTR -1080[rbp], rdi
	mov	QWORD PTR -1088[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	pxor	xmm0, xmm0
	movsd	QWORD PTR -1056[rbp], xmm0
	lea	rax, -1040[rbp]
	mov	edx, 1024
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	DWORD PTR -1060[rbp], 0
	jmp	.L2
.L3:
	mov	edx, DWORD PTR -1060[rbp]
	mov	rax, QWORD PTR -1080[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	movsx	rdx, eax
	mov	edx, DWORD PTR -1040[rbp+rdx*4]
	add	edx, 1
	cdqe
	mov	DWORD PTR -1040[rbp+rax*4], edx
	add	DWORD PTR -1060[rbp], 1
.L2:
	mov	eax, DWORD PTR -1060[rbp]
	cmp	QWORD PTR -1088[rbp], rax
	ja	.L3
	mov	DWORD PTR -1060[rbp], 0
	jmp	.L4
.L8:
	mov	eax, DWORD PTR -1060[rbp]
	mov	eax, DWORD PTR -1040[rbp+rax*4]
	test	eax, eax
	je	.L5
	mov	eax, DWORD PTR -1060[rbp]
	mov	eax, DWORD PTR -1040[rbp+rax*4]
	pxor	xmm1, xmm1
	cvtsi2sd	xmm1, eax
	mov	rax, QWORD PTR -1088[rbp]
	test	rax, rax
	js	.L6
	pxor	xmm0, xmm0
	cvtsi2sd	xmm0, rax
	jmp	.L7
.L6:
	mov	rdx, rax
	shr	rdx
	and	eax, 1
	or	rdx, rax
	pxor	xmm0, xmm0
	cvtsi2sd	xmm0, rdx
	addsd	xmm0, xmm0
.L7:
	divsd	xmm1, xmm0
	movsd	QWORD PTR -1048[rbp], xmm1
	mov	rax, QWORD PTR -1048[rbp]
	movq	xmm0, rax
	call	log2@PLT
	movq	rax, xmm0
	movq	xmm1, rax
	mulsd	xmm1, QWORD PTR -1048[rbp]
	movsd	xmm0, QWORD PTR -1056[rbp]
	subsd	xmm0, xmm1
	movsd	QWORD PTR -1056[rbp], xmm0
.L5:
	add	DWORD PTR -1060[rbp], 1
.L4:
	cmp	DWORD PTR -1060[rbp], 255
	jbe	.L8
	movsd	xmm0, QWORD PTR -1056[rbp]
	movq	rax, xmm0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	movq	xmm0, rax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	shannon_entropy, .-shannon_entropy
	.section	.rodata
.LC2:
	.string	"bad"
.LC3:
	.string	"good"
	.align 8
.LC4:
	.string	"Shannon entropy of \"%s\" is %f (%s)\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 48
	mov	DWORD PTR -36[rbp], edi
	mov	QWORD PTR -48[rbp], rsi
	mov	DWORD PTR -20[rbp], 1
	jmp	.L12
.L16:
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR -16[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	shannon_entropy
	movq	rax, xmm0
	mov	QWORD PTR -8[rbp], rax
	movsd	xmm0, QWORD PTR .LC1[rip]
	comisd	xmm0, QWORD PTR -8[rbp]
	jbe	.L19
	lea	rax, .LC2[rip]
	jmp	.L15
.L19:
	lea	rax, .LC3[rip]
.L15:
	mov	rsi, QWORD PTR -8[rbp]
	mov	rcx, QWORD PTR -16[rbp]
	mov	rdx, rax
	movq	xmm0, rsi
	mov	rsi, rcx
	lea	rdi, .LC4[rip]
	mov	eax, 1
	call	printf@PLT
	add	DWORD PTR -20[rbp], 1
.L12:
	mov	eax, DWORD PTR -20[rbp]
	cmp	eax, DWORD PTR -36[rbp]
	jl	.L16
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC1:
	.long	0
	.long	1074528256
	.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	"1009174.c"
	.text
	.global	__aeabi_i2d
	.global	__aeabi_ui2d
	.global	__aeabi_ddiv
	.global	__aeabi_dmul
	.global	__aeabi_dsub
	.section	.rodata
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	shannon_entropy, %function
shannon_entropy:
	@ args = 0, pretend = 0, frame = 1064
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, fp, lr}
	add	fp, sp, #12
	sub	sp, sp, #1056
	sub	sp, sp, #8
	str	r0, [fp, #-1072]
	str	r1, [fp, #-1076]
	ldr	r3, .L9
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r2, #0
	mov	r3, #0
	str	r2, [fp, #-1060]
	str	r3, [fp, #-1056]
	sub	r3, fp, #1024
	sub	r3, r3, #12
	sub	r3, r3, #4
	mov	r2, #1024
	mov	r1, #0
	mov	r0, r3
	bl	memset
	mov	r3, #0
	str	r3, [fp, #-1064]
	b	.L2
.L3:
	ldr	r2, [fp, #-1072]
	ldr	r3, [fp, #-1064]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r2, r3
	lsl	r3, r2, #2
	sub	r1, fp, #12
	add	r3, r1, r3
	ldr	r3, [r3, #-1028]
	add	r1, r3, #1
	lsl	r3, r2, #2
	sub	r2, fp, #12
	add	r3, r2, r3
	str	r1, [r3, #-1028]
	ldr	r3, [fp, #-1064]
	add	r3, r3, #1
	str	r3, [fp, #-1064]
.L2:
	ldr	r2, [fp, #-1064]
	ldr	r3, [fp, #-1076]
	cmp	r2, r3
	bcc	.L3
	mov	r3, #0
	str	r3, [fp, #-1064]
	b	.L4
.L6:
	ldr	r3, [fp, #-1064]
	lsl	r3, r3, #2
	sub	r2, fp, #12
	add	r3, r2, r3
	ldr	r3, [r3, #-1028]
	cmp	r3, #0
	beq	.L5
	ldr	r3, [fp, #-1064]
	lsl	r3, r3, #2
	sub	r2, fp, #12
	add	r3, r2, r3
	ldr	r3, [r3, #-1028]
	mov	r0, r3
	bl	__aeabi_i2d
	mov	r4, r0
	mov	r5, r1
	ldr	r0, [fp, #-1076]
	bl	__aeabi_ui2d
	mov	r2, r0
	mov	r3, r1
	mov	r0, r4
	mov	r1, r5
	bl	__aeabi_ddiv
	mov	r2, r0
	mov	r3, r1
	str	r2, [fp, #-1052]
	str	r3, [fp, #-1048]
	ldr	r0, [fp, #-1052]
	ldr	r1, [fp, #-1048]
	bl	log2
	ldr	r2, [fp, #-1052]
	ldr	r3, [fp, #-1048]
	bl	__aeabi_dmul
	mov	r2, r0
	mov	r3, r1
	ldr	r0, [fp, #-1060]
	ldr	r1, [fp, #-1056]
	bl	__aeabi_dsub
	mov	r2, r0
	mov	r3, r1
	str	r2, [fp, #-1060]
	str	r3, [fp, #-1056]
.L5:
	ldr	r3, [fp, #-1064]
	add	r3, r3, #1
	str	r3, [fp, #-1064]
.L4:
	ldr	r3, [fp, #-1064]
	cmp	r3, #255
	bls	.L6
	ldr	r2, [fp, #-1060]
	ldr	r3, [fp, #-1056]
	ldr	r1, .L9
	ldr	r0, [r1]
	ldr	r1, [fp, #-16]
	eors	r0, r1, r0
	mov	r1, #0
	beq	.L8
	bl	__stack_chk_fail
.L8:
	mov	r0, r2
	mov	r1, r3
	sub	sp, fp, #12
	@ sp needed
	pop	{r4, r5, fp, pc}
.L10:
	.align	2
.L9:
	.word	.LC0
	.size	shannon_entropy, .-shannon_entropy
	.global	__aeabi_dcmplt
	.section	.rodata
	.align	2
.LC1:
	.ascii	"bad\000"
	.align	2
.LC2:
	.ascii	"good\000"
	.align	2
.LC3:
	.ascii	"Shannon entropy of \"%s\" is %f (%s)\012\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	mov	r3, #1
	str	r3, [fp, #-20]
	b	.L12
.L16:
	ldr	r3, [fp, #-20]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-28]
	add	r3, r2, r3
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	ldr	r0, [fp, #-16]
	bl	strlen
	mov	r3, r0
	mov	r1, r3
	ldr	r0, [fp, #-16]
	bl	shannon_entropy
	str	r0, [fp, #-12]
	str	r1, [fp, #-8]
	mov	r2, #0
	ldr	r3, .L20
	sub	r1, fp, #12
	ldmia	r1, {r0-r1}
	bl	__aeabi_dcmplt
	mov	r3, r0
	cmp	r3, #0
	beq	.L19
	ldr	r3, .L20+4
	b	.L15
.L19:
	ldr	r3, .L20+8
.L15:
	str	r3, [sp]
	sub	r3, fp, #12
	ldmia	r3, {r2-r3}
	ldr	r1, [fp, #-16]
	ldr	r0, .L20+12
	bl	printf
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
.L12:
	ldr	r2, [fp, #-20]
	ldr	r3, [fp, #-24]
	cmp	r2, r3
	blt	.L16
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L21:
	.align	2
.L20:
	.word	1074528256
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
