	.file	"899707.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
	.align 8
.LC0:
	.string	"keysize: estimate key length(s) using Hamming Distance\n"
.LC1:
	.string	"Usage: keysize <filename>\n"
.LC2:
	.string	"Could not stat \"%s\": %s\n"
.LC3:
	.string	"r"
	.align 8
.LC4:
	.string	"Could not fopen(%s) for read: %s\n"
	.align 8
.LC5:
	.string	"Wanted to read %lu bytes of ciphertext, read only %lu bytes\n"
	.align 8
.LC6:
	.string	"Read all %lu bytes of cipher text from \"%s\"\n"
.LC8:
	.string	"%d\t%.0f\t%d\t%.4f\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 240
	mov	DWORD PTR -228[rbp], edi
	mov	QWORD PTR -240[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	rax, QWORD PTR -240[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	QWORD PTR -200[rbp], rax
	cmp	DWORD PTR -228[rbp], 1
	jg	.L2
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 55
	mov	esi, 1
	lea	rdi, .LC0[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 26
	mov	esi, 1
	lea	rdi, .LC1[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L2:
	lea	rdx, -160[rbp]
	mov	rax, QWORD PTR -200[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	stat@PLT
	cmp	eax, -1
	jne	.L3
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rcx, rax
	mov	rax, QWORD PTR stderr[rip]
	mov	rdx, QWORD PTR -200[rbp]
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 2
	call	exit@PLT
.L3:
	mov	rax, QWORD PTR -112[rbp]
	mov	QWORD PTR -192[rbp], rax
	mov	rax, QWORD PTR -200[rbp]
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -184[rbp], rax
	cmp	QWORD PTR -184[rbp], 0
	jne	.L4
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rcx, rax
	mov	rax, QWORD PTR stderr[rip]
	mov	rdx, QWORD PTR -200[rbp]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 3
	call	exit@PLT
.L4:
	mov	rax, QWORD PTR -192[rbp]
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -176[rbp], rax
	mov	rcx, QWORD PTR -184[rbp]
	mov	rdx, QWORD PTR -192[rbp]
	mov	rax, QWORD PTR -176[rbp]
	mov	esi, 1
	mov	rdi, rax
	call	fread@PLT
	mov	QWORD PTR -168[rbp], rax
	mov	rax, QWORD PTR -168[rbp]
	cmp	rax, QWORD PTR -192[rbp]
	je	.L5
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, QWORD PTR -192[rbp]
	mov	rdx, QWORD PTR -168[rbp]
	lea	rsi, .LC5[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 4
	call	exit@PLT
.L5:
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, QWORD PTR -200[rbp]
	mov	rdx, QWORD PTR -192[rbp]
	lea	rsi, .LC6[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	rax, QWORD PTR -184[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	DWORD PTR -224[rbp], 2
	jmp	.L6
.L9:
	pxor	xmm0, xmm0
	movsd	QWORD PTR -208[rbp], xmm0
	mov	DWORD PTR -220[rbp], 0
	mov	rax, QWORD PTR -192[rbp]
	mov	edx, DWORD PTR -224[rbp]
	sub	eax, edx
	mov	DWORD PTR -212[rbp], eax
	mov	eax, DWORD PTR -224[rbp]
	mov	DWORD PTR -216[rbp], eax
	jmp	.L7
.L8:
	mov	eax, DWORD PTR -216[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -176[rbp]
	lea	rcx, [rdx+rax]
	mov	edx, DWORD PTR -224[rbp]
	mov	rax, QWORD PTR -176[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	hamming_dist
	pxor	xmm0, xmm0
	cvtsi2sd	xmm0, eax
	movsd	xmm1, QWORD PTR -208[rbp]
	addsd	xmm0, xmm1
	movsd	QWORD PTR -208[rbp], xmm0
	mov	eax, DWORD PTR -224[rbp]
	add	DWORD PTR -216[rbp], eax
	add	DWORD PTR -220[rbp], 1
.L7:
	mov	eax, DWORD PTR -216[rbp]
	cmp	eax, DWORD PTR -212[rbp]
	jl	.L8
	mov	eax, DWORD PTR -224[rbp]
	imul	eax, DWORD PTR -220[rbp]
	pxor	xmm1, xmm1
	cvtsi2sd	xmm1, eax
	movsd	xmm0, QWORD PTR -208[rbp]
	divsd	xmm0, xmm1
	mov	eax, DWORD PTR -224[rbp]
	imul	eax, DWORD PTR -220[rbp]
	mov	edx, eax
	mov	rcx, QWORD PTR -208[rbp]
	mov	eax, DWORD PTR -224[rbp]
	movapd	xmm1, xmm0
	movq	xmm0, rcx
	mov	esi, eax
	lea	rdi, .LC8[rip]
	mov	eax, 2
	call	printf@PLT
	add	DWORD PTR -224[rbp], 1
.L6:
	cmp	DWORD PTR -224[rbp], 29
	jle	.L9
	mov	eax, 0
	mov	rsi, QWORD PTR -8[rbp]
	sub	rsi, QWORD PTR fs:40
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.globl	hamming_dist
	.type	hamming_dist, @function
hamming_dist:
.LFB7:
	.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	QWORD PTR -32[rbp], rsi
	mov	DWORD PTR -36[rbp], edx
	mov	DWORD PTR -8[rbp], 0
	mov	DWORD PTR -4[rbp], 0
	jmp	.L13
.L16:
	mov	eax, DWORD PTR -4[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	movzx	edx, BYTE PTR [rax]
	mov	eax, DWORD PTR -4[rbp]
	movsx	rcx, eax
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rcx
	movzx	eax, BYTE PTR [rax]
	xor	eax, edx
	mov	BYTE PTR -9[rbp], al
	jmp	.L14
.L15:
	add	DWORD PTR -8[rbp], 1
	movzx	eax, BYTE PTR -9[rbp]
	sub	eax, 1
	and	BYTE PTR -9[rbp], al
.L14:
	cmp	BYTE PTR -9[rbp], 0
	jne	.L15
	add	DWORD PTR -4[rbp], 1
.L13:
	mov	eax, DWORD PTR -4[rbp]
	cmp	eax, DWORD PTR -36[rbp]
	jl	.L16
	mov	eax, DWORD PTR -8[rbp]
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	hamming_dist, .-hamming_dist
	.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	"899707.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"keysize: estimate key length(s) using Hamming Dista"
	.ascii	"nce\012\000"
	.align	2
.LC1:
	.ascii	"Usage: keysize <filename>\012\000"
	.align	2
.LC2:
	.ascii	"Could not stat \"%s\": %s\012\000"
	.align	2
.LC3:
	.ascii	"r\000"
	.align	2
.LC4:
	.ascii	"Could not fopen(%s) for read: %s\012\000"
	.align	2
.LC5:
	.ascii	"Wanted to read %lu bytes of ciphertext, read only %"
	.ascii	"lu bytes\012\000"
	.align	2
.LC6:
	.ascii	"Read all %lu bytes of cipher text from \"%s\"\012\000"
	.global	__aeabi_i2d
	.global	__aeabi_dadd
	.global	__aeabi_ddiv
	.align	2
.LC7:
	.ascii	"%d\011%.0f\011%d\011%.4f\012\000"
	.align	2
.LC8:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 152
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #172
	str	r0, [fp, #-160]
	str	r1, [fp, #-164]
	ldr	r3, .L12
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	ldr	r3, [fp, #-164]
	ldr	r3, [r3, #4]
	str	r3, [fp, #-140]
	ldr	r3, [fp, #-160]
	cmp	r3, #1
	bgt	.L2
	ldr	r3, .L12+4
	ldr	r3, [r3]
	mov	r2, #55
	mov	r1, #1
	ldr	r0, .L12+8
	bl	fwrite
	ldr	r3, .L12+4
	ldr	r3, [r3]
	mov	r2, #26
	mov	r1, #1
	ldr	r0, .L12+12
	bl	fwrite
	mov	r0, #1
	bl	exit
.L2:
	sub	r3, fp, #108
	mov	r1, r3
	ldr	r0, [fp, #-140]
	bl	stat
	mov	r3, r0
	cmn	r3, #1
	bne	.L3
	ldr	r3, .L12+4
	ldr	r4, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	ldr	r2, [fp, #-140]
	ldr	r1, .L12+16
	mov	r0, r4
	bl	fprintf
	mov	r0, #2
	bl	exit
.L3:
	ldr	r3, [fp, #-64]
	str	r3, [fp, #-136]
	ldr	r1, .L12+20
	ldr	r0, [fp, #-140]
	bl	fopen
	str	r0, [fp, #-132]
	ldr	r3, [fp, #-132]
	cmp	r3, #0
	bne	.L4
	ldr	r3, .L12+4
	ldr	r4, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	ldr	r2, [fp, #-140]
	ldr	r1, .L12+24
	mov	r0, r4
	bl	fprintf
	mov	r0, #3
	bl	exit
.L4:
	ldr	r0, [fp, #-136]
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-128]
	ldr	r3, [fp, #-132]
	ldr	r2, [fp, #-136]
	mov	r1, #1
	ldr	r0, [fp, #-128]
	bl	fread
	str	r0, [fp, #-124]
	ldr	r2, [fp, #-124]
	ldr	r3, [fp, #-136]
	cmp	r2, r3
	beq	.L5
	ldr	r3, .L12+4
	ldr	r0, [r3]
	ldr	r3, [fp, #-136]
	ldr	r2, [fp, #-124]
	ldr	r1, .L12+28
	bl	fprintf
	mov	r0, #4
	bl	exit
.L5:
	ldr	r3, .L12+4
	ldr	r0, [r3]
	ldr	r3, [fp, #-140]
	ldr	r2, [fp, #-136]
	ldr	r1, .L12+32
	bl	fprintf
	ldr	r0, [fp, #-132]
	bl	fclose
	mov	r3, #2
	str	r3, [fp, #-152]
	b	.L6
.L9:
	mov	r2, #0
	mov	r3, #0
	str	r2, [fp, #-116]
	str	r3, [fp, #-112]
	mov	r3, #0
	str	r3, [fp, #-148]
	ldr	r3, [fp, #-152]
	ldr	r2, [fp, #-136]
	sub	r3, r2, r3
	str	r3, [fp, #-120]
	ldr	r3, [fp, #-152]
	str	r3, [fp, #-144]
	b	.L7
.L8:
	ldr	r3, [fp, #-144]
	ldr	r2, [fp, #-128]
	add	r3, r2, r3
	ldr	r2, [fp, #-152]
	mov	r1, r3
	ldr	r0, [fp, #-128]
	bl	hamming_dist
	mov	r3, r0
	mov	r0, r3
	bl	__aeabi_i2d
	mov	r2, r0
	mov	r3, r1
	sub	r1, fp, #116
	ldmia	r1, {r0-r1}
	bl	__aeabi_dadd
	mov	r2, r0
	mov	r3, r1
	str	r2, [fp, #-116]
	str	r3, [fp, #-112]
	ldr	r2, [fp, #-144]
	ldr	r3, [fp, #-152]
	add	r3, r2, r3
	str	r3, [fp, #-144]
	ldr	r3, [fp, #-148]
	add	r3, r3, #1
	str	r3, [fp, #-148]
.L7:
	ldr	r2, [fp, #-144]
	ldr	r3, [fp, #-120]
	cmp	r2, r3
	blt	.L8
	ldr	r3, [fp, #-152]
	ldr	r2, [fp, #-148]
	mul	r4, r2, r3
	ldr	r3, [fp, #-152]
	ldr	r2, [fp, #-148]
	mul	r3, r2, r3
	mov	r0, r3
	bl	__aeabi_i2d
	mov	r2, r0
	mov	r3, r1
	sub	r1, fp, #116
	ldmia	r1, {r0-r1}
	bl	__aeabi_ddiv
	mov	r2, r0
	mov	r3, r1
	str	r2, [sp, #8]
	str	r3, [sp, #12]
	str	r4, [sp]
	sub	r3, fp, #116
	ldmia	r3, {r2-r3}
	ldr	r1, [fp, #-152]
	ldr	r0, .L12+36
	bl	printf
	ldr	r3, [fp, #-152]
	add	r3, r3, #1
	str	r3, [fp, #-152]
.L6:
	ldr	r3, [fp, #-152]
	cmp	r3, #29
	ble	.L9
	mov	r3, #0
	ldr	r2, .L12
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L11
	bl	__stack_chk_fail
.L11:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L13:
	.align	2
.L12:
	.word	.LC8
	.word	stderr
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.size	main, .-main
	.align	2
	.global	hamming_dist
	.syntax unified
	.arm
	.fpu softvfp
	.type	hamming_dist, %function
hamming_dist:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #36
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	str	r2, [fp, #-32]
	mov	r3, #0
	str	r3, [fp, #-12]
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L15
.L18:
	ldr	r3, [fp, #-8]
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	ldrb	r2, [r3]	@ zero_extendqisi2
	ldr	r3, [fp, #-8]
	ldr	r1, [fp, #-28]
	add	r3, r1, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	eor	r3, r3, r2
	strb	r3, [fp, #-13]
	b	.L16
.L17:
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
	ldrb	r3, [fp, #-13]
	sub	r3, r3, #1
	and	r3, r3, #255
	lsl	r3, r3, #24
	asr	r2, r3, #24
	ldrsb	r3, [fp, #-13]
	and	r3, r3, r2
	lsl	r3, r3, #24
	asr	r3, r3, #24
	strb	r3, [fp, #-13]
.L16:
	ldrb	r3, [fp, #-13]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L17
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L15:
	ldr	r2, [fp, #-8]
	ldr	r3, [fp, #-32]
	cmp	r2, r3
	blt	.L18
	ldr	r3, [fp, #-12]
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	hamming_dist, .-hamming_dist
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
