	.file	"148125.c"
	.intel_syntax noprefix
	.text
	.type	shuffle, @function
shuffle:
.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 -40[rbp], rdi
	mov	QWORD PTR -48[rbp], rsi
	mov	DWORD PTR -8[rbp], 512
	mov	DWORD PTR -20[rbp], 0
	jmp	.L2
.L7:
	mov	DWORD PTR -12[rbp], 0
	jmp	.L3
.L6:
	mov	DWORD PTR -16[rbp], 0
	jmp	.L4
.L5:
	mov	rax, QWORD PTR -40[rbp]
	lea	rdx, 1[rax]
	mov	QWORD PTR -40[rbp], rdx
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	mov	DWORD PTR -4[rbp], eax
	mov	eax, DWORD PTR -12[rbp]
	imul	eax, DWORD PTR -8[rbp]
	mov	edx, eax
	mov	eax, DWORD PTR -20[rbp]
	add	eax, eax
	add	edx, eax
	mov	eax, DWORD PTR -16[rbp]
	add	eax, edx
	movsx	rdx, eax
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	edx, DWORD PTR -4[rbp]
	mov	BYTE PTR [rax], dl
	add	DWORD PTR -16[rbp], 1
.L4:
	cmp	DWORD PTR -16[rbp], 1
	jle	.L5
	add	DWORD PTR -12[rbp], 1
.L3:
	cmp	DWORD PTR -12[rbp], 31
	jle	.L6
	add	DWORD PTR -20[rbp], 1
.L2:
	cmp	DWORD PTR -20[rbp], 255
	jle	.L7
	nop
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	shuffle, .-shuffle
	.section	.rodata
	.align 8
.LC0:
	.string	"Usage: fixdat input.dat output.bin\n"
.LC1:
	.string	"rb"
	.align 8
.LC2:
	.string	"read error: got %d bytes expected %d\n"
.LC3:
	.string	"wb"
	.align 8
.LC4:
	.string	"write error: sent %d bytes expected %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, 48
	mov	DWORD PTR -36[rbp], edi
	mov	QWORD PTR -48[rbp], rsi
	mov	DWORD PTR -32[rbp], 16384
	mov	eax, DWORD PTR -32[rbp]
	cdqe
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -24[rbp], rax
	mov	eax, DWORD PTR -32[rbp]
	cdqe
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -16[rbp], rax
	cmp	DWORD PTR -36[rbp], 3
	je	.L9
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 35
	mov	esi, 1
	lea	rdi, .LC0[rip]
	call	fwrite@PLT
	mov	eax, 2
	jmp	.L10
.L9:
	mov	rax, QWORD PTR -48[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	jne	.L11
	mov	rax, QWORD PTR -48[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	perror@PLT
	mov	eax, 1
	jmp	.L10
.L11:
	mov	eax, DWORD PTR -32[rbp]
	movsx	rdx, eax
	mov	rcx, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	esi, 1
	mov	rdi, rax
	call	fread@PLT
	mov	DWORD PTR -28[rbp], eax
	mov	eax, DWORD PTR -28[rbp]
	cmp	eax, DWORD PTR -32[rbp]
	je	.L12
	mov	rax, QWORD PTR stderr[rip]
	mov	ecx, DWORD PTR -32[rbp]
	mov	edx, DWORD PTR -28[rbp]
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, 1
	jmp	.L10
.L12:
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	edx, 64
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	rdx, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	shuffle
	mov	rax, QWORD PTR -48[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	jne	.L13
	mov	rax, QWORD PTR -48[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	perror@PLT
	mov	eax, 1
	jmp	.L10
.L13:
	mov	eax, DWORD PTR -32[rbp]
	movsx	rdx, eax
	mov	rcx, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR -16[rbp]
	mov	esi, 1
	mov	rdi, rax
	call	fwrite@PLT
	mov	DWORD PTR -28[rbp], eax
	mov	eax, DWORD PTR -28[rbp]
	cmp	eax, DWORD PTR -32[rbp]
	je	.L14
	mov	rax, QWORD PTR stderr[rip]
	mov	ecx, DWORD PTR -32[rbp]
	mov	edx, DWORD PTR -28[rbp]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, 1
	jmp	.L10
.L14:
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	eax, 0
.L10:
	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	"148125.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	shuffle, %function
shuffle:
	@ 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, #-32]
	str	r1, [fp, #-36]
	mov	r3, #512
	str	r3, [fp, #-12]
	mov	r3, #0
	str	r3, [fp, #-24]
	b	.L2
.L7:
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L3
.L6:
	mov	r3, #0
	str	r3, [fp, #-20]
	b	.L4
.L5:
	ldr	r3, [fp, #-32]
	add	r2, r3, #1
	str	r2, [fp, #-32]
	ldrb	r3, [r3]	@ zero_extendqisi2
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-16]
	ldr	r2, [fp, #-12]
	mul	r2, r3, r2
	ldr	r3, [fp, #-24]
	lsl	r3, r3, #1
	add	r2, r2, r3
	ldr	r3, [fp, #-20]
	add	r3, r2, r3
	mov	r2, r3
	ldr	r3, [fp, #-36]
	add	r3, r3, r2
	ldr	r2, [fp, #-8]
	and	r2, r2, #255
	strb	r2, [r3]
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
.L4:
	ldr	r3, [fp, #-20]
	cmp	r3, #1
	ble	.L5
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L3:
	ldr	r3, [fp, #-16]
	cmp	r3, #31
	ble	.L6
	ldr	r3, [fp, #-24]
	add	r3, r3, #1
	str	r3, [fp, #-24]
.L2:
	ldr	r3, [fp, #-24]
	cmp	r3, #255
	ble	.L7
	nop
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	shuffle, .-shuffle
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Usage: fixdat input.dat output.bin\012\000"
	.align	2
.LC1:
	.ascii	"rb\000"
	.align	2
.LC2:
	.ascii	"read error: got %d bytes expected %d\012\000"
	.align	2
.LC3:
	.ascii	"wb\000"
	.align	2
.LC4:
	.ascii	"write error: sent %d bytes expected %d\012\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	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	str	r0, [fp, #-32]
	str	r1, [fp, #-36]
	mov	r3, #16384
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-24]
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-24]
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-32]
	cmp	r3, #3
	beq	.L9
	ldr	r3, .L15
	ldr	r3, [r3]
	mov	r2, #35
	mov	r1, #1
	ldr	r0, .L15+4
	bl	fwrite
	mov	r3, #2
	b	.L10
.L9:
	ldr	r3, [fp, #-36]
	add	r3, r3, #4
	ldr	r3, [r3]
	ldr	r1, .L15+8
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bne	.L11
	ldr	r3, [fp, #-36]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r0, r3
	bl	perror
	mov	r3, #1
	b	.L10
.L11:
	ldr	r2, [fp, #-24]
	ldr	r3, [fp, #-12]
	mov	r1, #1
	ldr	r0, [fp, #-20]
	bl	fread
	mov	r3, r0
	str	r3, [fp, #-8]
	ldr	r2, [fp, #-8]
	ldr	r3, [fp, #-24]
	cmp	r2, r3
	beq	.L12
	ldr	r3, .L15
	ldr	r0, [r3]
	ldr	r3, [fp, #-24]
	ldr	r2, [fp, #-8]
	ldr	r1, .L15+12
	bl	fprintf
	mov	r3, #1
	b	.L10
.L12:
	ldr	r0, [fp, #-12]
	bl	fclose
	mov	r2, #64
	mov	r1, #0
	ldr	r0, [fp, #-20]
	bl	memset
	ldr	r1, [fp, #-16]
	ldr	r0, [fp, #-20]
	bl	shuffle
	ldr	r3, [fp, #-36]
	add	r3, r3, #8
	ldr	r3, [r3]
	ldr	r1, .L15+16
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bne	.L13
	ldr	r3, [fp, #-36]
	add	r3, r3, #8
	ldr	r3, [r3]
	mov	r0, r3
	bl	perror
	mov	r3, #1
	b	.L10
.L13:
	ldr	r2, [fp, #-24]
	ldr	r3, [fp, #-12]
	mov	r1, #1
	ldr	r0, [fp, #-16]
	bl	fwrite
	mov	r3, r0
	str	r3, [fp, #-8]
	ldr	r2, [fp, #-8]
	ldr	r3, [fp, #-24]
	cmp	r2, r3
	beq	.L14
	ldr	r3, .L15
	ldr	r0, [r3]
	ldr	r3, [fp, #-24]
	ldr	r2, [fp, #-8]
	ldr	r1, .L15+20
	bl	fprintf
	mov	r3, #1
	b	.L10
.L14:
	ldr	r0, [fp, #-12]
	bl	fclose
	mov	r3, #0
.L10:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L16:
	.align	2
.L15:
	.word	stderr
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
