	.file	"661436.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
	.align 8
.LC0:
	.string	"haveRead != wantedRead: %d != %d\n"
.LC1:
	.string	"This broke"
	.align 8
.LC2:
	.string	"haveWrite != haveRead: %d != %d\n"
	.text
	.globl	writeFile
	.type	writeFile, @function
writeFile:
.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, 1088
	mov	QWORD PTR -1064[rbp], rdi
	mov	DWORD PTR -1068[rbp], esi
	mov	QWORD PTR -1080[rbp], rdx
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	eax, DWORD PTR -1068[rbp]
	mov	DWORD PTR -1056[rbp], eax
	jmp	.L2
.L8:
	cmp	DWORD PTR -1056[rbp], 1023
	jbe	.L3
	mov	DWORD PTR -1052[rbp], 1024
	jmp	.L4
.L3:
	mov	eax, DWORD PTR -1056[rbp]
	mov	DWORD PTR -1052[rbp], eax
.L4:
	mov	edx, DWORD PTR -1052[rbp]
	mov	rcx, QWORD PTR -1064[rbp]
	lea	rax, -1040[rbp]
	mov	esi, 1
	mov	rdi, rax
	call	fread@PLT
	mov	DWORD PTR -1048[rbp], eax
	mov	eax, DWORD PTR -1048[rbp]
	cmp	eax, DWORD PTR -1052[rbp]
	je	.L5
	mov	edx, DWORD PTR -1052[rbp]
	mov	eax, DWORD PTR -1048[rbp]
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, .LC1[rip]
	call	perror@PLT
	mov	eax, 0
	jmp	.L9
.L5:
	mov	edx, DWORD PTR -1048[rbp]
	mov	rcx, QWORD PTR -1080[rbp]
	lea	rax, -1040[rbp]
	mov	esi, 1
	mov	rdi, rax
	call	fwrite@PLT
	mov	DWORD PTR -1044[rbp], eax
	mov	eax, DWORD PTR -1044[rbp]
	cmp	eax, DWORD PTR -1048[rbp]
	je	.L7
	mov	edx, DWORD PTR -1048[rbp]
	mov	eax, DWORD PTR -1044[rbp]
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
	jmp	.L9
.L7:
	mov	eax, DWORD PTR -1048[rbp]
	sub	DWORD PTR -1056[rbp], eax
.L2:
	cmp	DWORD PTR -1056[rbp], 0
	jne	.L8
	mov	eax, 1
.L9:
	mov	rsi, QWORD PTR -8[rbp]
	sub	rsi, QWORD PTR fs:40
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	writeFile, .-writeFile
	.section	.rodata
	.align 8
.LC3:
	.string	"Not enough args!\nUse: %s PAK-file\n"
.LC4:
	.string	"rb"
.LC5:
	.string	"Couldnt open file %s\n"
.LC6:
	.string	"Number of files: %u\n"
.LC7:
	.string	"namelen > 32!"
.LC8:
	.string	"Current file: %s - Size %08x\n"
.LC9:
	.string	"wb"
.LC10:
	.string	"Couldnt open output %s\n"
.LC11:
	.string	"Done."
	.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, 112
	mov	DWORD PTR -100[rbp], edi
	mov	QWORD PTR -112[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	cmp	DWORD PTR -100[rbp], 1
	jg	.L12
	mov	rax, QWORD PTR -112[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 1
	jmp	.L22
.L12:
	mov	rax, QWORD PTR -112[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -64[rbp], rax
	cmp	QWORD PTR -64[rbp], 0
	jne	.L14
	mov	rax, QWORD PTR -112[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 1
	jmp	.L22
.L14:
	mov	rdx, QWORD PTR -64[rbp]
	lea	rax, -80[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	esi, 4
	mov	rdi, rax
	call	fread@PLT
	mov	eax, DWORD PTR -80[rbp]
	mov	esi, eax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -72[rbp], 0
	jmp	.L15
.L21:
	mov	rax, QWORD PTR -64[rbp]
	mov	rdi, rax
	call	ftell@PLT
	mov	DWORD PTR -68[rbp], eax
	mov	DWORD PTR -76[rbp], 0
	jmp	.L16
.L17:
	add	DWORD PTR -76[rbp], 1
.L16:
	mov	rax, QWORD PTR -64[rbp]
	mov	rdi, rax
	call	fgetc@PLT
	test	eax, eax
	jne	.L17
	add	DWORD PTR -76[rbp], 1
	mov	ecx, DWORD PTR -68[rbp]
	mov	rax, QWORD PTR -64[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	rdi, rax
	call	fseek@PLT
	mov	edx, DWORD PTR -68[rbp]
	mov	eax, DWORD PTR -76[rbp]
	add	eax, edx
	and	eax, 3
	test	eax, eax
	je	.L18
	mov	edx, DWORD PTR -68[rbp]
	mov	eax, DWORD PTR -76[rbp]
	add	eax, edx
	and	eax, 3
	mov	edx, eax
	mov	eax, DWORD PTR -76[rbp]
	sub	eax, edx
	add	eax, 4
	mov	DWORD PTR -76[rbp], eax
.L18:
	cmp	DWORD PTR -76[rbp], 32
	jbe	.L19
	lea	rdi, .LC7[rip]
	call	puts@PLT
	mov	eax, 1
	jmp	.L22
.L19:
	mov	esi, DWORD PTR -76[rbp]
	mov	rdx, QWORD PTR -64[rbp]
	lea	rax, -48[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	rdi, rax
	call	fread@PLT
	mov	rdx, QWORD PTR -64[rbp]
	lea	rax, -84[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	esi, 4
	mov	rdi, rax
	call	fread@PLT
	mov	edx, DWORD PTR -84[rbp]
	lea	rax, -48[rbp]
	mov	rsi, rax
	lea	rdi, .LC8[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -48[rbp]
	lea	rsi, .LC9[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -56[rbp], rax
	cmp	QWORD PTR -56[rbp], 0
	jne	.L20
	lea	rax, -48[rbp]
	mov	rsi, rax
	lea	rdi, .LC10[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 1
	jmp	.L22
.L20:
	mov	eax, DWORD PTR -84[rbp]
	mov	ecx, eax
	mov	rdx, QWORD PTR -56[rbp]
	mov	rax, QWORD PTR -64[rbp]
	mov	esi, ecx
	mov	rdi, rax
	call	writeFile
	mov	rax, QWORD PTR -56[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	rax, QWORD PTR -64[rbp]
	mov	edx, 1
	mov	esi, 1
	mov	rdi, rax
	call	fseek@PLT
	add	DWORD PTR -72[rbp], 1
.L15:
	mov	eax, DWORD PTR -80[rbp]
	cmp	DWORD PTR -72[rbp], eax
	jb	.L21
	lea	rdi, .LC11[rip]
	call	puts@PLT
	mov	rax, QWORD PTR -64[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	eax, 0
.L22:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	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	"661436.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"haveRead != wantedRead: %d != %d\012\000"
	.align	2
.LC1:
	.ascii	"This broke\000"
	.align	2
.LC2:
	.ascii	"haveWrite != haveRead: %d != %d\012\000"
	.align	2
.LC3:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	writeFile
	.syntax unified
	.arm
	.fpu softvfp
	.type	writeFile, %function
writeFile:
	@ args = 0, pretend = 0, frame = 1064
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #1056
	sub	sp, sp, #8
	str	r0, [fp, #-1056]
	str	r1, [fp, #-1060]
	str	r2, [fp, #-1064]
	ldr	r3, .L11
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-1060]
	str	r3, [fp, #-1048]
	b	.L2
.L8:
	ldr	r3, [fp, #-1048]
	cmp	r3, #1024
	bcc	.L3
	mov	r3, #1024
	str	r3, [fp, #-1044]
	b	.L4
.L3:
	ldr	r3, [fp, #-1048]
	str	r3, [fp, #-1044]
.L4:
	sub	r0, fp, #1024
	sub	r0, r0, #4
	sub	r0, r0, #4
	ldr	r3, [fp, #-1056]
	ldr	r2, [fp, #-1044]
	mov	r1, #1
	bl	fread
	str	r0, [fp, #-1040]
	ldr	r2, [fp, #-1040]
	ldr	r3, [fp, #-1044]
	cmp	r2, r3
	beq	.L5
	ldr	r2, [fp, #-1044]
	ldr	r1, [fp, #-1040]
	ldr	r0, .L11+4
	bl	printf
	ldr	r0, .L11+8
	bl	perror
	mov	r3, #0
	b	.L9
.L5:
	sub	r0, fp, #1024
	sub	r0, r0, #4
	sub	r0, r0, #4
	ldr	r3, [fp, #-1064]
	ldr	r2, [fp, #-1040]
	mov	r1, #1
	bl	fwrite
	str	r0, [fp, #-1036]
	ldr	r2, [fp, #-1036]
	ldr	r3, [fp, #-1040]
	cmp	r2, r3
	beq	.L7
	ldr	r2, [fp, #-1040]
	ldr	r1, [fp, #-1036]
	ldr	r0, .L11+12
	bl	printf
	mov	r3, #0
	b	.L9
.L7:
	ldr	r2, [fp, #-1048]
	ldr	r3, [fp, #-1040]
	sub	r3, r2, r3
	str	r3, [fp, #-1048]
.L2:
	ldr	r3, [fp, #-1048]
	cmp	r3, #0
	bne	.L8
	mov	r3, #1
.L9:
	ldr	r2, .L11
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L10
	bl	__stack_chk_fail
.L10:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L12:
	.align	2
.L11:
	.word	.LC3
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.size	writeFile, .-writeFile
	.section	.rodata
	.align	2
.LC4:
	.ascii	"Not enough args!\012Use: %s PAK-file\012\000"
	.align	2
.LC5:
	.ascii	"rb\000"
	.align	2
.LC6:
	.ascii	"Couldnt open file %s\012\000"
	.align	2
.LC7:
	.ascii	"Number of files: %u\012\000"
	.align	2
.LC8:
	.ascii	"namelen > 32!\000"
	.align	2
.LC9:
	.ascii	"Current file: %s - Size %08x\012\000"
	.align	2
.LC10:
	.ascii	"wb\000"
	.align	2
.LC11:
	.ascii	"Couldnt open output %s\012\000"
	.align	2
.LC12:
	.ascii	"Done.\000"
	.align	2
.LC13:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 72
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #72
	str	r0, [fp, #-72]
	str	r1, [fp, #-76]
	ldr	r3, .L26
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-72]
	cmp	r3, #1
	bgt	.L14
	ldr	r3, [fp, #-76]
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L26+4
	bl	printf
	mov	r3, #1
	b	.L24
.L14:
	ldr	r3, [fp, #-76]
	add	r3, r3, #4
	ldr	r3, [r3]
	ldr	r1, .L26+8
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-52]
	ldr	r3, [fp, #-52]
	cmp	r3, #0
	bne	.L16
	ldr	r3, [fp, #-76]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L26+12
	bl	printf
	mov	r3, #1
	b	.L24
.L16:
	sub	r0, fp, #64
	ldr	r3, [fp, #-52]
	mov	r2, #1
	mov	r1, #4
	bl	fread
	ldr	r3, [fp, #-64]
	mov	r1, r3
	ldr	r0, .L26+16
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-56]
	b	.L17
.L23:
	ldr	r0, [fp, #-52]
	bl	ftell
	mov	r3, r0
	str	r3, [fp, #-48]
	mov	r3, #0
	str	r3, [fp, #-60]
	b	.L18
.L19:
	ldr	r3, [fp, #-60]
	add	r3, r3, #1
	str	r3, [fp, #-60]
.L18:
	ldr	r0, [fp, #-52]
	bl	fgetc
	mov	r3, r0
	cmp	r3, #0
	bne	.L19
	ldr	r3, [fp, #-60]
	add	r3, r3, #1
	str	r3, [fp, #-60]
	ldr	r3, [fp, #-48]
	mov	r2, #0
	mov	r1, r3
	ldr	r0, [fp, #-52]
	bl	fseek
	ldr	r2, [fp, #-48]
	ldr	r3, [fp, #-60]
	add	r3, r2, r3
	and	r3, r3, #3
	cmp	r3, #0
	beq	.L20
	ldr	r2, [fp, #-48]
	ldr	r3, [fp, #-60]
	add	r3, r2, r3
	and	r3, r3, #3
	ldr	r2, [fp, #-60]
	sub	r3, r2, r3
	add	r3, r3, #4
	str	r3, [fp, #-60]
.L20:
	ldr	r3, [fp, #-60]
	cmp	r3, #32
	bls	.L21
	ldr	r0, .L26+20
	bl	puts
	mov	r3, #1
	b	.L24
.L21:
	sub	r0, fp, #40
	ldr	r3, [fp, #-52]
	mov	r2, #1
	ldr	r1, [fp, #-60]
	bl	fread
	sub	r0, fp, #68
	ldr	r3, [fp, #-52]
	mov	r2, #1
	mov	r1, #4
	bl	fread
	ldr	r2, [fp, #-68]
	sub	r3, fp, #40
	mov	r1, r3
	ldr	r0, .L26+24
	bl	printf
	sub	r3, fp, #40
	ldr	r1, .L26+28
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-44]
	ldr	r3, [fp, #-44]
	cmp	r3, #0
	bne	.L22
	sub	r3, fp, #40
	mov	r1, r3
	ldr	r0, .L26+32
	bl	printf
	mov	r3, #1
	b	.L24
.L22:
	ldr	r3, [fp, #-68]
	ldr	r2, [fp, #-44]
	mov	r1, r3
	ldr	r0, [fp, #-52]
	bl	writeFile
	ldr	r0, [fp, #-44]
	bl	fclose
	mov	r2, #1
	mov	r1, #1
	ldr	r0, [fp, #-52]
	bl	fseek
	ldr	r3, [fp, #-56]
	add	r3, r3, #1
	str	r3, [fp, #-56]
.L17:
	ldr	r3, [fp, #-64]
	ldr	r2, [fp, #-56]
	cmp	r2, r3
	bcc	.L23
	ldr	r0, .L26+36
	bl	puts
	ldr	r0, [fp, #-52]
	bl	fclose
	mov	r3, #0
.L24:
	ldr	r2, .L26
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L25
	bl	__stack_chk_fail
.L25:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L27:
	.align	2
.L26:
	.word	.LC13
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
