	.file	"extr_mkmylofw.c_write_out_blocks.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	write_out_blocks
	.type	write_out_blocks, @function
write_out_blocks:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rsi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rdi
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 56
	.cfi_def_cfa_offset 112
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 40[rsp], rax
	xor	eax, eax
	cmp	QWORD PTR fw_num_partitions[rip], 0
	jg	.L2
	mov	r14, rsp
.L6:
	mov	edx, DWORD PTR fw_num_blocks[rip]
	xor	r15d, r15d
	test	edx, edx
	jg	.L3
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L22:
	add	r15, 1
	cmp	DWORD PTR fw_num_blocks[rip], r15d
	jle	.L4
.L3:
	mov	rbx, r15
	mov	esi, 4
	sal	rbx, 4
	add	rbx, QWORD PTR fw_blocks[rip]
	mov	edi, DWORD PTR [rbx]
	mov	edx, DWORD PTR 4[rbx]
	test	DWORD PTR BLOCK_FLAG_HAVEHDR[rip], edx
	lea	eax, 4[rdi]
	cmovne	edi, eax
	call	ALIGN@PLT
	mov	edi, DWORD PTR FW_DESC_TYPE_USED[rip]
	mov	ebp, eax
	call	HOST_TO_LE32@PLT
	mov	edi, DWORD PTR 8[rbx]
	mov	QWORD PTR 24[rsp], rax
	call	HOST_TO_LE32@PLT
	mov	edi, ebp
	mov	QWORD PTR 16[rsp], rax
	call	HOST_TO_LE32@PLT
	mov	edi, DWORD PTR 12[rbx]
	mov	QWORD PTR 8[rsp], rax
	call	HOST_TO_LE32@PLT
	mov	rdx, r13
	mov	rsi, r14
	mov	rdi, r12
	mov	QWORD PTR [rsp], rax
	call	write_out_desc@PLT
	test	rax, rax
	je	.L22
.L5:
	mov	eax, -1
.L1:
	mov	rcx, QWORD PTR 40[rsp]
	xor	rcx, QWORD PTR fs:40
	jne	.L23
	add	rsp, 56
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	xor	esi, esi
	mov	edx, 32
	mov	rdi, r14
	call	memset@PLT
	mov	rdx, r13
	mov	rsi, r14
	mov	rdi, r12
	call	write_out_desc@PLT
	test	rax, rax
	jne	.L5
	mov	rsi, r13
	mov	rdi, r12
	call	write_out_partitions@PLT
	test	rax, rax
	jne	.L5
	mov	eax, DWORD PTR fw_num_blocks[rip]
	xor	ebx, ebx
	test	eax, eax
	jg	.L8
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L24:
	add	rbx, 1
	cmp	DWORD PTR fw_num_blocks[rip], ebx
	jle	.L10
.L8:
	mov	rsi, rbx
	mov	rdx, r13
	mov	rdi, r12
	sal	rsi, 4
	add	rsi, QWORD PTR fw_blocks[rip]
	call	write_out_file@PLT
	test	rax, rax
	je	.L24
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L2:
	mov	edi, DWORD PTR FW_DESC_TYPE_USED[rip]
	mov	r14, rsp
	call	HOST_TO_LE32@PLT
	mov	QWORD PTR 24[rsp], rax
	mov	rax, QWORD PTR board[rip]
	mov	edi, DWORD PTR [rax]
	call	HOST_TO_LE32@PLT
	mov	edi, DWORD PTR MYLO_MAX_PARTITIONS[rip]
	imul	edi, DWORD PTR PART_NAME_LEN[rip]
	mov	QWORD PTR 16[rsp], rax
	add	edi, 4
	call	HOST_TO_LE32@PLT
	mov	QWORD PTR 8[rsp], rax
	mov	rax, QWORD PTR board[rip]
	mov	edi, DWORD PTR 4[rax]
	call	HOST_TO_LE32@PLT
	mov	rdx, r13
	mov	rsi, r14
	mov	rdi, r12
	mov	QWORD PTR [rsp], rax
	call	write_out_desc@PLT
	test	rax, rax
	je	.L6
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L10:
	xor	eax, eax
	jmp	.L1
.L23:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	write_out_blocks, .-write_out_blocks
	.comm	fw_num_partitions,8,8
	.comm	fw_num_blocks,4,4
	.comm	fw_blocks,8,8
	.comm	board,8,8
	.comm	PART_NAME_LEN,4,4
	.comm	MYLO_MAX_PARTITIONS,4,4
	.comm	FW_DESC_TYPE_USED,4,4
	.comm	BLOCK_FLAG_HAVEHDR,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_mkmylofw.c_write_out_blocks.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	write_out_blocks
	.syntax unified
	.arm
	.fpu softvfp
	.type	write_out_blocks, %function
write_out_blocks:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r3, .L24
	sub	sp, sp, #36
	ldr	r3, [r3]
	mov	r6, r0
	cmp	r3, #0
	ldr	r3, .L24+4
	mov	r7, r1
	ldr	r3, [r3]
	str	r3, [sp, #28]
	mov	r3,#0
	bgt	.L2
	add	r10, sp, #12
.L6:
	ldr	r8, .L24+8
	ldr	r3, [r8]
	cmp	r3, #0
	ble	.L4
	ldr	r3, .L24+12
	mov	r4, #0
	ldr	r9, .L24+16
	ldr	fp, .L24+20
	str	r3, [sp, #4]
	b	.L3
.L21:
	ldr	r2, [r8]
	add	r4, r4, #1
	cmp	r2, r4
	ble	.L4
.L3:
	ldr	r2, [r9]
	ldr	r1, [fp]
	add	r5, r2, r4, lsl #4
	ldr	ip, [r5, #4]
	ldr	r0, [r2, r4, lsl #4]
	tst	ip, r1
	addne	r0, r0, #4
	mov	r1, #4
	bl	ALIGN
	mov	r2, r0
	ldr	r3, [sp, #4]
	str	r2, [sp]
	ldr	r0, [r3]
	bl	HOST_TO_LE32
	mov	r1, r0
	ldr	r0, [r5, #8]
	str	r1, [sp, #24]
	bl	HOST_TO_LE32
	mov	r1, r0
	ldr	r2, [sp]
	str	r1, [sp, #20]
	mov	r0, r2
	bl	HOST_TO_LE32
	mov	r2, r0
	ldr	r0, [r5, #12]
	str	r2, [sp, #16]
	bl	HOST_TO_LE32
	mov	ip, r0
	mov	r2, r7
	mov	r1, r10
	mov	r0, r6
	str	ip, [sp, #12]
	bl	write_out_desc
	cmp	r0, #0
	beq	.L21
.L5:
	mvn	r5, #0
.L1:
	ldr	r3, .L24+4
	ldr	r2, [r3]
	ldr	r3, [sp, #28]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L22
	mov	r0, r5
	add	sp, sp, #36
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L4:
	mov	r3, #0
	mov	r1, r10
	mov	r2, r7
	mov	r0, r6
	str	r3, [sp, #12]
	str	r3, [r10, #4]
	str	r3, [r10, #8]
	str	r3, [r10, #12]
	bl	write_out_desc
	cmp	r0, #0
	bne	.L5
	mov	r1, r7
	mov	r0, r6
	bl	write_out_partitions
	subs	r5, r0, #0
	bne	.L5
	ldr	r3, [r8]
	cmp	r3, #0
	ble	.L1
	mov	r4, r5
	ldr	r9, .L24+16
	b	.L8
.L23:
	ldr	r3, [r8]
	add	r4, r4, #1
	cmp	r3, r4
	ble	.L1
.L8:
	ldr	r1, [r9]
	mov	r2, r7
	mov	r0, r6
	add	r1, r1, r4, lsl #4
	bl	write_out_file
	cmp	r0, #0
	beq	.L23
	b	.L5
.L2:
	ldr	r3, .L24+12
	ldr	r4, .L24+24
	ldr	r0, [r3]
	bl	HOST_TO_LE32
	ldr	r3, [r4]
	str	r0, [sp, #24]
	ldr	r0, [r3]
	bl	HOST_TO_LE32
	ldr	r3, .L24+28
	ldr	r2, .L24+32
	ldr	r3, [r3]
	ldr	r2, [r2]
	str	r0, [sp, #20]
	mul	r0, r2, r3
	add	r0, r0, #4
	bl	HOST_TO_LE32
	ldr	r3, [r4]
	str	r0, [sp, #16]
	ldr	r0, [r3, #4]
	bl	HOST_TO_LE32
	mov	r3, r0
	add	r10, sp, #12
	mov	r1, r10
	mov	r2, r7
	mov	r0, r6
	str	r3, [sp, #12]
	bl	write_out_desc
	cmp	r0, #0
	beq	.L6
	b	.L5
.L22:
	bl	__stack_chk_fail
.L25:
	.align	2
.L24:
	.word	fw_num_partitions
	.word	.LC0
	.word	fw_num_blocks
	.word	FW_DESC_TYPE_USED
	.word	fw_blocks
	.word	BLOCK_FLAG_HAVEHDR
	.word	board
	.word	MYLO_MAX_PARTITIONS
	.word	PART_NAME_LEN
	.size	write_out_blocks, .-write_out_blocks
	.comm	fw_num_partitions,4,4
	.comm	fw_num_blocks,4,4
	.comm	fw_blocks,4,4
	.comm	board,4,4
	.comm	PART_NAME_LEN,4,4
	.comm	MYLO_MAX_PARTITIONS,4,4
	.comm	FW_DESC_TYPE_USED,4,4
	.comm	BLOCK_FLAG_HAVEHDR,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
