	.file	"extr_mkfwimage.c_write_part.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Failed opening file '%s'\n"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC1:
	.string	"Failed mmaping memory for file '%s'\n"
	.text
	.p2align 4
	.type	write_part, @function
write_part:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movsx	rax, DWORD PTR 8[rsi]
	mov	rbx, rsi
	lea	r14, 64[rdi+rax]
	mov	edi, DWORD PTR 32[rsi]
	mov	esi, DWORD PTR O_RDONLY[rip]
	call	open@PLT
	test	eax, eax
	js	.L7
	mov	esi, DWORD PTR 8[rbx]
	mov	ecx, DWORD PTR MAP_SHARED[rip]
	xor	r9d, r9d
	xor	edi, edi
	mov	edx, DWORD PTR PROT_READ[rip]
	mov	r8d, eax
	mov	r13d, eax
	call	mmap@PLT
	cmp	QWORD PTR MAP_FAILED[rip], rax
	mov	r12, rax
	je	.L8
	mov	edx, DWORD PTR 8[rbx]
	lea	rdi, 64[rbp]
	mov	rsi, rax
	call	memcpy@PLT
	mov	esi, DWORD PTR 8[rbx]
	mov	rdi, r12
	call	munmap@PLT
	mov	edx, DWORD PTR PART_NAME_LENGTH[rip]
	mov	rdi, QWORD PTR 0[rbp]
	xor	esi, esi
	call	memset@PLT
	mov	rdi, QWORD PTR 8[rbp]
	mov	edx, DWORD PTR MAGIC_LENGTH[rip]
	mov	rsi, QWORD PTR MAGIC_PART[rip]
	call	memcpy@PLT
	mov	edx, DWORD PTR PART_NAME_LENGTH[rip]
	mov	rsi, QWORD PTR [rbx]
	mov	rdi, QWORD PTR 0[rbp]
	call	memcpy@PLT
	mov	edi, DWORD PTR 28[rbx]
	call	htonl@PLT
	mov	edi, DWORD PTR 8[rbx]
	mov	QWORD PTR 56[rbp], rax
	call	htonl@PLT
	mov	edi, DWORD PTR 24[rbx]
	mov	QWORD PTR 48[rbp], rax
	call	htonl@PLT
	mov	edi, DWORD PTR 20[rbx]
	mov	QWORD PTR 40[rbp], rax
	call	htonl@PLT
	mov	edi, DWORD PTR 16[rbx]
	mov	QWORD PTR 32[rbp], rax
	call	htonl@PLT
	mov	edi, DWORD PTR 12[rbx]
	mov	QWORD PTR 24[rbp], rax
	call	htonl@PLT
	mov	edx, DWORD PTR 8[rbx]
	mov	rsi, rbp
	xor	edi, edi
	mov	QWORD PTR 16[rbp], rax
	add	edx, 64
	call	crc32@PLT
	mov	edi, eax
	call	htonl@PLT
	mov	QWORD PTR [r14], 0
	mov	QWORD PTR 8[r14], rax
	xor	eax, eax
.L1:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
.L7:
	.cfi_restore_state
	mov	esi, DWORD PTR 32[rbx]
	lea	rdi, .LC0[rip]
	call	ERROR@PLT
	mov	eax, -1
	jmp	.L1
.L8:
	mov	esi, DWORD PTR 32[rbx]
	lea	rdi, .LC1[rip]
	call	ERROR@PLT
	mov	edi, r13d
	call	close@PLT
	mov	eax, -2
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	write_part, .-write_part
	.comm	PROT_READ,4,4
	.comm	PART_NAME_LENGTH,4,4
	.comm	O_RDONLY,4,4
	.comm	MAP_SHARED,4,4
	.comm	MAP_FAILED,8,8
	.comm	MAGIC_PART,8,8
	.comm	MAGIC_LENGTH,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.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, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_mkfwimage.c_write_part.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Failed opening file '%s'\012\000"
	.align	2
.LC1:
	.ascii	"Failed mmaping memory for file '%s'\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	write_part, %function
write_part:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	ldr	r3, .L9
	ldr	r9, [r1, #4]
	mov	r5, r0
	mov	r4, r1
	ldr	r0, [r1, #28]
	sub	sp, sp, #8
	ldr	r1, [r3]
	bl	open
	add	r9, r9, #32
	subs	r8, r0, #0
	add	r10, r5, r9
	blt	.L7
	mov	r6, #0
	ldr	r3, .L9+4
	ldr	r2, .L9+8
	str	r8, [sp]
	str	r6, [sp, #4]
	ldr	r3, [r3]
	mov	r0, r6
	ldr	r2, [r2]
	ldr	r1, [r4, #4]
	bl	mmap
	ldr	r3, .L9+12
	mov	r7, r0
	ldr	r3, [r3]
	cmp	r3, r0
	beq	.L8
	mov	r1, r0
	ldr	r2, [r4, #4]
	ldr	r8, .L9+16
	add	r0, r5, #32
	bl	memcpy
	ldr	r1, [r4, #4]
	mov	r0, r7
	bl	munmap
	mov	r1, r6
	ldr	r2, [r8]
	ldr	r0, [r5]
	bl	memset
	ldr	r3, .L9+20
	ldr	r2, .L9+24
	ldr	r1, [r3]
	ldr	r2, [r2]
	ldr	r0, [r5, #4]
	bl	memcpy
	ldr	r2, [r8]
	ldr	r1, [r4]
	ldr	r0, [r5]
	bl	memcpy
	ldr	r0, [r4, #24]
	bl	htonl
	mov	r3, r0
	ldr	r0, [r4, #4]
	str	r3, [r5, #28]
	bl	htonl
	mov	r3, r0
	ldr	r0, [r4, #20]
	str	r3, [r5, #24]
	bl	htonl
	mov	r3, r0
	ldr	r0, [r4, #16]
	str	r3, [r5, #20]
	bl	htonl
	mov	r3, r0
	ldr	r0, [r4, #12]
	str	r3, [r5, #16]
	bl	htonl
	mov	r3, r0
	ldr	r0, [r4, #8]
	str	r3, [r5, #12]
	bl	htonl
	ldr	r2, [r4, #4]
	mov	r1, r5
	str	r0, [r5, #8]
	add	r2, r2, #32
	mov	r0, r6
	bl	crc32
	bl	htonl
	mov	r3, r0
	mov	r0, r6
	str	r3, [r10, #4]
	str	r6, [r5, r9]
.L1:
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L7:
	ldr	r1, [r4, #28]
	ldr	r0, .L9+28
	bl	ERROR
	mvn	r0, #0
	b	.L1
.L8:
	ldr	r1, [r4, #28]
	ldr	r0, .L9+32
	bl	ERROR
	mov	r0, r8
	bl	close
	mvn	r0, #1
	b	.L1
.L10:
	.align	2
.L9:
	.word	O_RDONLY
	.word	MAP_SHARED
	.word	PROT_READ
	.word	MAP_FAILED
	.word	PART_NAME_LENGTH
	.word	MAGIC_PART
	.word	MAGIC_LENGTH
	.word	.LC0
	.word	.LC1
	.size	write_part, .-write_part
	.comm	PROT_READ,4,4
	.comm	PART_NAME_LENGTH,4,4
	.comm	O_RDONLY,4,4
	.comm	MAP_SHARED,4,4
	.comm	MAP_FAILED,4,4
	.comm	MAGIC_PART,4,4
	.comm	MAGIC_LENGTH,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
