	.file	"554578.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"r"
.LC1:
	.string	"p059_cipher.txt"
.LC2:
	.string	"file open failed"
.LC3:
	.string	"%d,"
.LC4:
	.string	"read_file: malloc() fail"
	.text
	.globl	read_file
	.type	read_file, @function
read_file:
.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, 48
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rsi, .LC0[rip]
	lea	rdi, .LC1[rip]
	call	fopen@PLT
	mov	QWORD PTR -24[rbp], rax
	cmp	QWORD PTR -24[rbp], 0
	jne	.L2
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 16
	mov	esi, 1
	lea	rdi, .LC2[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L2:
	mov	QWORD PTR -40[rbp], 0
	jmp	.L3
.L4:
	add	QWORD PTR -40[rbp], 1
.L3:
	lea	rdx, -44[rbp]
	mov	rax, QWORD PTR -24[rbp]
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	mov	eax, 0
	call	__isoc99_fscanf@PLT
	cmp	eax, -1
	jne	.L4
	mov	rax, QWORD PTR -40[rbp]
	add	rax, 1
	sal	rax, 2
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -16[rbp], rax
	cmp	QWORD PTR -16[rbp], 0
	jne	.L5
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 24
	mov	esi, 1
	lea	rdi, .LC4[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L5:
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	rewind@PLT
	mov	QWORD PTR -32[rbp], 0
	jmp	.L6
.L7:
	mov	rax, QWORD PTR -32[rbp]
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -16[rbp]
	add	rdx, rax
	mov	rax, QWORD PTR -24[rbp]
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	mov	eax, 0
	call	__isoc99_fscanf@PLT
	add	QWORD PTR -32[rbp], 1
.L6:
	mov	rax, QWORD PTR -32[rbp]
	cmp	rax, QWORD PTR -40[rbp]
	jb	.L7
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	rax, QWORD PTR -40[rbp]
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -16[rbp]
	add	rax, rdx
	mov	DWORD PTR [rax], -1
	mov	rax, QWORD PTR -16[rbp]
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	read_file, .-read_file
	.section	.rodata
.LC5:
	.string	"calc_freqs: calloc() fail"
	.text
	.globl	calc_freqs
	.type	calc_freqs, @function
calc_freqs:
.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, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	esi, 4
	mov	edi, 256
	call	calloc@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	jne	.L11
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 25
	mov	esi, 1
	lea	rdi, .LC5[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L11:
	mov	QWORD PTR -16[rbp], 0
	jmp	.L12
.L13:
	mov	rax, QWORD PTR -16[rbp]
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rdx
	mov	edx, DWORD PTR [rax]
	add	edx, 1
	mov	DWORD PTR [rax], edx
	add	QWORD PTR -16[rbp], 1
.L12:
	mov	rax, QWORD PTR -16[rbp]
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	cmp	eax, -1
	jne	.L13
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 1020
	mov	DWORD PTR [rax], -1
	mov	rax, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	calc_freqs, .-calc_freqs
	.globl	find_highest
	.type	find_highest, @function
find_highest:
.LFB8:
	.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 -12[rbp], 0
	mov	QWORD PTR -8[rbp], 0
	jmp	.L16
.L18:
	mov	rax, QWORD PTR -8[rbp]
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	cmp	DWORD PTR -12[rbp], eax
	jge	.L17
	mov	rax, QWORD PTR -8[rbp]
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -12[rbp], eax
	mov	rax, QWORD PTR -8[rbp]
	mov	DWORD PTR -16[rbp], eax
.L17:
	add	QWORD PTR -8[rbp], 1
.L16:
	mov	rax, QWORD PTR -8[rbp]
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	cmp	eax, -1
	jne	.L18
	mov	eax, DWORD PTR -16[rbp]
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	find_highest, .-find_highest
	.section	.rodata
.LC6:
	.string	"try_keys: FAIL\n"
	.text
	.globl	try_keys
	.type	try_keys, @function
try_keys:
.LFB9:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	DWORD PTR -20[rbp], edi
	mov	DWORD PTR -4[rbp], 97
	jmp	.L21
.L24:
	mov	eax, DWORD PTR -20[rbp]
	xor	eax, DWORD PTR -4[rbp]
	cmp	eax, 32
	jne	.L22
	mov	eax, DWORD PTR -4[rbp]
	jmp	.L23
.L22:
	add	DWORD PTR -4[rbp], 1
.L21:
	cmp	DWORD PTR -4[rbp], 122
	jle	.L24
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 15
	mov	esi, 1
	lea	rdi, .LC6[rip]
	call	fwrite@PLT
	mov	eax, 0
.L23:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	try_keys, .-try_keys
	.section	.rodata
	.align 8
.LC7:
	.string	"print_decrypted: malloc() fail"
	.align 8
.LC8:
	.string	"print_decrypted: realloc() fail"
	.text
	.globl	print_decrypted
	.type	print_decrypted, @function
print_decrypted:
.LFB10:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 64
	mov	QWORD PTR -40[rbp], rdi
	mov	QWORD PTR -48[rbp], rsi
	mov	QWORD PTR -56[rbp], rdx
	mov	QWORD PTR -16[rbp], 5
	mov	rax, QWORD PTR -16[rbp]
	sal	rax, 2
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	jne	.L26
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 30
	mov	esi, 1
	lea	rdi, .LC7[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L26:
	mov	QWORD PTR -24[rbp], 0
	jmp	.L27
.L32:
	mov	rax, QWORD PTR -16[rbp]
	sub	rax, 1
	cmp	QWORD PTR -24[rbp], rax
	jb	.L28
	add	QWORD PTR -16[rbp], 5
	mov	rax, QWORD PTR -16[rbp]
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -8[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	realloc@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	jne	.L28
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 31
	mov	esi, 1
	lea	rdi, .LC8[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L28:
	mov	rax, QWORD PTR -24[rbp]
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -40[rbp]
	add	rax, rdx
	mov	ecx, DWORD PTR [rax]
	mov	rax, QWORD PTR -24[rbp]
	mov	edx, 0
	div	QWORD PTR -56[rbp]
	mov	rax, rdx
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	edx, DWORD PTR [rax]
	mov	rax, QWORD PTR -24[rbp]
	lea	rsi, 0[0+rax*4]
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rsi
	xor	edx, ecx
	mov	DWORD PTR [rax], edx
	mov	rax, QWORD PTR -24[rbp]
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	cmp	eax, 31
	jle	.L29
	mov	rax, QWORD PTR -24[rbp]
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	cmp	eax, 126
	jle	.L30
.L29:
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	eax, 0
	jmp	.L31
.L30:
	add	QWORD PTR -24[rbp], 1
.L27:
	mov	rax, QWORD PTR -24[rbp]
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -40[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	cmp	eax, -1
	jne	.L32
	mov	rax, QWORD PTR -24[rbp]
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rdx
	mov	DWORD PTR [rax], -1
	mov	QWORD PTR -24[rbp], 0
	jmp	.L33
.L34:
	mov	rax, QWORD PTR -24[rbp]
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	putchar@PLT
	add	QWORD PTR -24[rbp], 1
.L33:
	mov	rax, QWORD PTR -24[rbp]
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	cmp	eax, -1
	jne	.L34
	mov	edi, 10
	call	putchar@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	eax, 1
.L31:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	print_decrypted, .-print_decrypted
	.section	.rodata
.LC9:
	.string	"usage: %s key_size\n"
.LC10:
	.string	"main: malloc() fail"
	.align 8
.LC11:
	.string	"enter permutations of the given letters"
.LC12:
	.string	" %c"
	.text
	.globl	main
	.type	main, @function
main:
.LFB11:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	rbx
	sub	rsp, 72
	.cfi_offset 3, -24
	mov	DWORD PTR -68[rbp], edi
	mov	QWORD PTR -80[rbp], rsi
	cmp	DWORD PTR -68[rbp], 2
	je	.L36
	mov	rax, QWORD PTR -80[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 1
	jmp	.L37
.L36:
	mov	rax, QWORD PTR -80[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	edx, 0
	mov	esi, 0
	mov	rdi, rax
	call	strtoul@PLT
	mov	QWORD PTR -56[rbp], rax
	call	read_file
	mov	QWORD PTR -48[rbp], rax
	mov	rax, QWORD PTR -48[rbp]
	mov	rdi, rax
	call	calc_freqs
	mov	QWORD PTR -40[rbp], rax
	mov	rax, QWORD PTR -56[rbp]
	sal	rax, 2
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -32[rbp], rax
	mov	rax, QWORD PTR -56[rbp]
	sal	rax, 2
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -24[rbp], rax
	cmp	QWORD PTR -24[rbp], 0
	jne	.L38
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 19
	mov	esi, 1
	lea	rdi, .LC10[rip]
	call	fwrite@PLT
	mov	eax, 1
	jmp	.L37
.L38:
	mov	QWORD PTR -64[rbp], 0
	jmp	.L39
.L40:
	mov	rax, QWORD PTR -64[rbp]
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -32[rbp]
	lea	rbx, [rdx+rax]
	mov	rax, QWORD PTR -40[rbp]
	mov	rdi, rax
	call	find_highest
	mov	DWORD PTR [rbx], eax
	mov	rax, QWORD PTR -64[rbp]
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -40[rbp]
	add	rax, rdx
	mov	DWORD PTR [rax], 0
	add	QWORD PTR -64[rbp], 1
.L39:
	mov	rax, QWORD PTR -64[rbp]
	cmp	rax, QWORD PTR -56[rbp]
	jb	.L40
	mov	rax, QWORD PTR -40[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	QWORD PTR -64[rbp], 0
	jmp	.L41
.L42:
	mov	rax, QWORD PTR -64[rbp]
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	mov	rdx, QWORD PTR -64[rbp]
	lea	rcx, 0[0+rdx*4]
	mov	rdx, QWORD PTR -24[rbp]
	lea	rbx, [rcx+rdx]
	mov	edi, eax
	call	try_keys
	mov	DWORD PTR [rbx], eax
	add	QWORD PTR -64[rbp], 1
.L41:
	mov	rax, QWORD PTR -64[rbp]
	cmp	rax, QWORD PTR -56[rbp]
	jb	.L42
	mov	QWORD PTR -64[rbp], 0
	jmp	.L43
.L44:
	mov	rax, QWORD PTR -64[rbp]
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	putchar@PLT
	add	QWORD PTR -64[rbp], 1
.L43:
	mov	rax, QWORD PTR -64[rbp]
	cmp	rax, QWORD PTR -56[rbp]
	jb	.L44
	mov	edi, 10
	call	putchar@PLT
	lea	rdi, .LC11[rip]
	call	puts@PLT
.L47:
	mov	QWORD PTR -64[rbp], 0
	jmp	.L45
.L46:
	mov	rax, QWORD PTR -64[rbp]
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	rsi, rax
	lea	rdi, .LC12[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	add	QWORD PTR -64[rbp], 1
.L45:
	mov	rax, QWORD PTR -64[rbp]
	cmp	rax, QWORD PTR -56[rbp]
	jb	.L46
	mov	rdx, QWORD PTR -56[rbp]
	mov	rcx, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR -48[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	print_decrypted
	test	eax, eax
	je	.L47
	mov	rax, QWORD PTR -32[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -48[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	eax, 0
.L37:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.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	"554578.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"r\000"
	.align	2
.LC1:
	.ascii	"p059_cipher.txt\000"
	.align	2
.LC2:
	.ascii	"file open failed\000"
	.align	2
.LC3:
	.ascii	"%d,\000"
	.align	2
.LC4:
	.ascii	"read_file: malloc() fail\000"
	.align	2
.LC5:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	read_file
	.syntax unified
	.arm
	.fpu softvfp
	.type	read_file, %function
read_file:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	ldr	r3, .L10
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r1, .L10+4
	ldr	r0, .L10+8
	bl	fopen
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bne	.L2
	ldr	r3, .L10+12
	ldr	r3, [r3]
	mov	r2, #16
	mov	r1, #1
	ldr	r0, .L10+16
	bl	fwrite
	mov	r0, #1
	bl	exit
.L2:
	mov	r3, #0
	str	r3, [fp, #-24]
	b	.L3
.L4:
	ldr	r3, [fp, #-24]
	add	r3, r3, #1
	str	r3, [fp, #-24]
.L3:
	sub	r3, fp, #28
	mov	r2, r3
	ldr	r1, .L10+20
	ldr	r0, [fp, #-16]
	bl	__isoc99_fscanf
	mov	r3, r0
	cmn	r3, #1
	bne	.L4
	ldr	r3, [fp, #-24]
	add	r3, r3, #1
	lsl	r3, r3, #2
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bne	.L5
	ldr	r3, .L10+12
	ldr	r3, [r3]
	mov	r2, #24
	mov	r1, #1
	ldr	r0, .L10+24
	bl	fwrite
	mov	r0, #1
	bl	exit
.L5:
	ldr	r0, [fp, #-16]
	bl	rewind
	mov	r3, #0
	str	r3, [fp, #-20]
	b	.L6
.L7:
	ldr	r3, [fp, #-20]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-12]
	add	r3, r2, r3
	mov	r2, r3
	ldr	r1, .L10+20
	ldr	r0, [fp, #-16]
	bl	__isoc99_fscanf
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
.L6:
	ldr	r2, [fp, #-20]
	ldr	r3, [fp, #-24]
	cmp	r2, r3
	bcc	.L7
	ldr	r0, [fp, #-16]
	bl	fclose
	ldr	r3, [fp, #-24]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-12]
	add	r3, r2, r3
	mvn	r2, #0
	str	r2, [r3]
	ldr	r3, [fp, #-12]
	ldr	r2, .L10
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L9
	bl	__stack_chk_fail
.L9:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L11:
	.align	2
.L10:
	.word	.LC5
	.word	.LC0
	.word	.LC1
	.word	stderr
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.size	read_file, .-read_file
	.section	.rodata
	.align	2
.LC6:
	.ascii	"calc_freqs: calloc() fail\000"
	.text
	.align	2
	.global	calc_freqs
	.syntax unified
	.arm
	.fpu softvfp
	.type	calc_freqs, %function
calc_freqs:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	mov	r1, #4
	mov	r0, #256
	bl	calloc
	mov	r3, r0
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L13
	ldr	r3, .L17
	ldr	r3, [r3]
	mov	r2, #25
	mov	r1, #1
	ldr	r0, .L17+4
	bl	fwrite
	mov	r0, #1
	bl	exit
.L13:
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L14
.L15:
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldr	r3, [r3]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-8]
	add	r3, r2, r3
	ldr	r2, [r3]
	add	r2, r2, #1
	str	r2, [r3]
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L14:
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldr	r3, [r3]
	cmn	r3, #1
	bne	.L15
	ldr	r3, [fp, #-8]
	add	r3, r3, #1020
	mvn	r2, #0
	str	r2, [r3]
	ldr	r3, [fp, #-8]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L18:
	.align	2
.L17:
	.word	stderr
	.word	.LC6
	.size	calc_freqs, .-calc_freqs
	.align	2
	.global	find_highest
	.syntax unified
	.arm
	.fpu softvfp
	.type	find_highest, %function
find_highest:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #28
	str	r0, [fp, #-24]
	mov	r3, #0
	str	r3, [fp, #-12]
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L20
.L22:
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r2, [fp, #-12]
	cmp	r2, r3
	bge	.L21
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	ldr	r3, [r3]
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-8]
	str	r3, [fp, #-16]
.L21:
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L20:
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	ldr	r3, [r3]
	cmn	r3, #1
	bne	.L22
	ldr	r3, [fp, #-16]
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	find_highest, .-find_highest
	.section	.rodata
	.align	2
.LC7:
	.ascii	"try_keys: FAIL\012\000"
	.text
	.align	2
	.global	try_keys
	.syntax unified
	.arm
	.fpu softvfp
	.type	try_keys, %function
try_keys:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	mov	r3, #97
	str	r3, [fp, #-8]
	b	.L25
.L28:
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-8]
	eor	r3, r3, r2
	cmp	r3, #32
	bne	.L26
	ldr	r3, [fp, #-8]
	b	.L27
.L26:
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L25:
	ldr	r3, [fp, #-8]
	cmp	r3, #122
	ble	.L28
	ldr	r3, .L29
	ldr	r3, [r3]
	mov	r2, #15
	mov	r1, #1
	ldr	r0, .L29+4
	bl	fwrite
	mov	r3, #0
.L27:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L30:
	.align	2
.L29:
	.word	stderr
	.word	.LC7
	.size	try_keys, .-try_keys
	.section	.rodata
	.align	2
.LC8:
	.ascii	"print_decrypted: malloc() fail\000"
	.align	2
.LC9:
	.ascii	"print_decrypted: realloc() fail\000"
	.global	__aeabi_uidivmod
	.text
	.align	2
	.global	print_decrypted
	.syntax unified
	.arm
	.fpu softvfp
	.type	print_decrypted, %function
print_decrypted:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #36
	str	r0, [fp, #-32]
	str	r1, [fp, #-36]
	str	r2, [fp, #-40]
	mov	r3, #5
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-20]
	lsl	r3, r3, #2
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bne	.L32
	ldr	r3, .L41
	ldr	r3, [r3]
	mov	r2, #30
	mov	r1, #1
	ldr	r0, .L41+4
	bl	fwrite
	mov	r0, #1
	bl	exit
.L32:
	mov	r3, #0
	str	r3, [fp, #-24]
	b	.L33
.L38:
	ldr	r3, [fp, #-20]
	sub	r3, r3, #1
	ldr	r2, [fp, #-24]
	cmp	r2, r3
	bcc	.L34
	ldr	r3, [fp, #-20]
	add	r3, r3, #5
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-20]
	lsl	r3, r3, #2
	mov	r1, r3
	ldr	r0, [fp, #-16]
	bl	realloc
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bne	.L34
	ldr	r3, .L41
	ldr	r3, [r3]
	mov	r2, #31
	mov	r1, #1
	ldr	r0, .L41+8
	bl	fwrite
	mov	r0, #1
	bl	exit
.L34:
	ldr	r3, [fp, #-24]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-32]
	add	r3, r2, r3
	ldr	r4, [r3]
	ldr	r3, [fp, #-24]
	ldr	r1, [fp, #-40]
	mov	r0, r3
	bl	__aeabi_uidivmod
	mov	r3, r1
	lsl	r3, r3, #2
	ldr	r2, [fp, #-36]
	add	r3, r2, r3
	ldr	r2, [r3]
	ldr	r3, [fp, #-24]
	lsl	r3, r3, #2
	ldr	r1, [fp, #-16]
	add	r3, r1, r3
	eor	r2, r2, r4
	str	r2, [r3]
	ldr	r3, [fp, #-24]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldr	r3, [r3]
	cmp	r3, #31
	ble	.L35
	ldr	r3, [fp, #-24]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldr	r3, [r3]
	cmp	r3, #126
	ble	.L36
.L35:
	ldr	r0, [fp, #-16]
	bl	free
	mov	r3, #0
	b	.L37
.L36:
	ldr	r3, [fp, #-24]
	add	r3, r3, #1
	str	r3, [fp, #-24]
.L33:
	ldr	r3, [fp, #-24]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-32]
	add	r3, r2, r3
	ldr	r3, [r3]
	cmn	r3, #1
	bne	.L38
	ldr	r3, [fp, #-24]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	mvn	r2, #0
	str	r2, [r3]
	mov	r3, #0
	str	r3, [fp, #-24]
	b	.L39
.L40:
	ldr	r3, [fp, #-24]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r0, r3
	bl	putchar
	ldr	r3, [fp, #-24]
	add	r3, r3, #1
	str	r3, [fp, #-24]
.L39:
	ldr	r3, [fp, #-24]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldr	r3, [r3]
	cmn	r3, #1
	bne	.L40
	mov	r0, #10
	bl	putchar
	ldr	r0, [fp, #-16]
	bl	free
	mov	r3, #1
.L37:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L42:
	.align	2
.L41:
	.word	stderr
	.word	.LC8
	.word	.LC9
	.size	print_decrypted, .-print_decrypted
	.section	.rodata
	.align	2
.LC10:
	.ascii	"usage: %s key_size\012\000"
	.align	2
.LC11:
	.ascii	"main: malloc() fail\000"
	.align	2
.LC12:
	.ascii	"enter permutations of the given letters\000"
	.align	2
.LC13:
	.ascii	" %c\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #36
	str	r0, [fp, #-40]
	str	r1, [fp, #-44]
	ldr	r3, [fp, #-40]
	cmp	r3, #2
	beq	.L44
	ldr	r3, [fp, #-44]
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L56
	bl	printf
	mov	r3, #1
	b	.L45
.L44:
	ldr	r3, [fp, #-44]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r2, #0
	mov	r1, #0
	mov	r0, r3
	bl	strtoul
	str	r0, [fp, #-32]
	bl	read_file
	str	r0, [fp, #-28]
	ldr	r0, [fp, #-28]
	bl	calc_freqs
	str	r0, [fp, #-24]
	ldr	r3, [fp, #-32]
	lsl	r3, r3, #2
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-32]
	lsl	r3, r3, #2
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bne	.L46
	ldr	r3, .L56+4
	ldr	r3, [r3]
	mov	r2, #19
	mov	r1, #1
	ldr	r0, .L56+8
	bl	fwrite
	mov	r3, #1
	b	.L45
.L46:
	mov	r3, #0
	str	r3, [fp, #-36]
	b	.L47
.L48:
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r4, r2, r3
	ldr	r0, [fp, #-24]
	bl	find_highest
	mov	r3, r0
	str	r3, [r4]
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r3, [r3]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	mov	r2, #0
	str	r2, [r3]
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	str	r3, [fp, #-36]
.L47:
	ldr	r2, [fp, #-36]
	ldr	r3, [fp, #-32]
	cmp	r2, r3
	bcc	.L48
	ldr	r0, [fp, #-24]
	bl	free
	mov	r3, #0
	str	r3, [fp, #-36]
	b	.L49
.L50:
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r4, r2, r3
	mov	r0, r1
	bl	try_keys
	mov	r3, r0
	str	r3, [r4]
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	str	r3, [fp, #-36]
.L49:
	ldr	r2, [fp, #-36]
	ldr	r3, [fp, #-32]
	cmp	r2, r3
	bcc	.L50
	mov	r3, #0
	str	r3, [fp, #-36]
	b	.L51
.L52:
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r0, r3
	bl	putchar
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	str	r3, [fp, #-36]
.L51:
	ldr	r2, [fp, #-36]
	ldr	r3, [fp, #-32]
	cmp	r2, r3
	bcc	.L52
	mov	r0, #10
	bl	putchar
	ldr	r0, .L56+12
	bl	puts
.L55:
	mov	r3, #0
	str	r3, [fp, #-36]
	b	.L53
.L54:
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	mov	r1, r3
	ldr	r0, .L56+16
	bl	__isoc99_scanf
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	str	r3, [fp, #-36]
.L53:
	ldr	r2, [fp, #-36]
	ldr	r3, [fp, #-32]
	cmp	r2, r3
	bcc	.L54
	ldr	r2, [fp, #-32]
	ldr	r1, [fp, #-16]
	ldr	r0, [fp, #-28]
	bl	print_decrypted
	mov	r3, r0
	cmp	r3, #0
	beq	.L55
	ldr	r0, [fp, #-20]
	bl	free
	ldr	r0, [fp, #-28]
	bl	free
	ldr	r0, [fp, #-16]
	bl	free
	mov	r3, #0
.L45:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L57:
	.align	2
.L56:
	.word	.LC10
	.word	stderr
	.word	.LC11
	.word	.LC12
	.word	.LC13
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
