	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_write_out_blocks               ## -- Begin function write_out_blocks
	.p2align	4, 0x90
_write_out_blocks:                      ## @write_out_blocks
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r12
	movq	_fw_num_partitions@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	jle	LBB0_2
## %bb.1:
	movq	_FW_DESC_TYPE_USED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_HOST_TO_LE32
	movq	%rax, -56(%rbp)
	movq	_board@GOTPCREL(%rip), %r14
	movq	(%r14), %rax
	movl	(%rax), %edi
	callq	_HOST_TO_LE32
	movq	%rax, -64(%rbp)
	movq	_MYLO_MAX_PARTITIONS@GOTPCREL(%rip), %rax
	movq	_PART_NAME_LEN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	imull	(%rax), %edi
	addl	$4, %edi
	callq	_HOST_TO_LE32
	movq	%rax, -72(%rbp)
	movq	(%r14), %rax
	movl	4(%rax), %edi
	callq	_HOST_TO_LE32
	movq	%rax, -80(%rbp)
	leaq	-80(%rbp), %rsi
	movq	%r12, %rdi
	movq	%rbx, %rdx
	callq	_write_out_desc
	movq	%rax, %rcx
	movl	$-1, %eax
	testq	%rcx, %rcx
	jne	LBB0_14
LBB0_2:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	_fw_num_blocks@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_6
## %bb.3:
	movl	$12, %r13d
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	_fw_blocks@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
	movl	-12(%r14,%r13), %eax
	movq	_BLOCK_FLAG_HAVEHDR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	-8(%r14,%r13), %ecx
	leal	4(%rax), %edi
	testl	%ecx, %ecx
	cmovel	%eax, %edi
	movl	$4, %esi
	callq	_ALIGN
	movl	%eax, %ebx
	movq	_FW_DESC_TYPE_USED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_HOST_TO_LE32
	movq	%rax, -56(%rbp)
	movl	-4(%r14,%r13), %edi
	callq	_HOST_TO_LE32
	movq	%rax, -64(%rbp)
	movl	%ebx, %edi
	callq	_HOST_TO_LE32
	movq	%rax, -72(%rbp)
	movl	(%r14,%r13), %edi
	callq	_HOST_TO_LE32
	movq	%rax, -80(%rbp)
	movq	%r12, %rdi
	leaq	-80(%rbp), %rsi
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	callq	_write_out_desc
	testq	%rax, %rax
	jne	LBB0_13
## %bb.4:                               ##   in Loop: Header=BB0_5 Depth=1
	incq	%r15
	movq	_fw_num_blocks@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	addq	$16, %r13
	cmpq	%rax, %r15
	jl	LBB0_5
LBB0_6:
	leaq	-80(%rbp), %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$32, %edx
	callq	_memset
	movq	%r12, %r13
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdx
	callq	_write_out_desc
	testq	%rax, %rax
	jne	LBB0_13
## %bb.7:
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	_write_out_partitions
	testq	%rax, %rax
	je	LBB0_8
LBB0_13:
	movl	$-1, %eax
LBB0_14:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	_fw_num_blocks@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_9
## %bb.10:
	xorl	%r15d, %r15d
	movq	_fw_blocks@GOTPCREL(%rip), %r14
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rsi
	addq	%r15, %rsi
	movq	%r13, %rdi
	movq	%r12, %rdx
	callq	_write_out_file
	testq	%rax, %rax
	jne	LBB0_13
## %bb.11:                              ##   in Loop: Header=BB0_12 Depth=1
	incq	%rbx
	movq	_fw_num_blocks@GOTPCREL(%rip), %rax
	movslq	(%rax), %rcx
	addq	$16, %r15
	xorl	%eax, %eax
	cmpq	%rcx, %rbx
	jl	LBB0_12
	jmp	LBB0_14
LBB0_9:
	xorl	%eax, %eax
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_fw_num_partitions,8,3          ## @fw_num_partitions
	.comm	_FW_DESC_TYPE_USED,4,2          ## @FW_DESC_TYPE_USED
	.comm	_board,8,3                      ## @board
	.comm	_MYLO_MAX_PARTITIONS,4,2        ## @MYLO_MAX_PARTITIONS
	.comm	_PART_NAME_LEN,4,2              ## @PART_NAME_LEN
	.comm	_fw_num_blocks,4,2              ## @fw_num_blocks
	.comm	_fw_blocks,8,3                  ## @fw_blocks
	.comm	_BLOCK_FLAG_HAVEHDR,4,2         ## @BLOCK_FLAG_HAVEHDR
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_write_out_blocks               ; -- Begin function write_out_blocks
	.p2align	2
_write_out_blocks:                      ; @write_out_blocks
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _fw_num_partitions@GOTPAGE
Lloh1:
	ldr	x8, [x8, _fw_num_partitions@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x23, _FW_DESC_TYPE_USED@GOTPAGE
Lloh4:
	ldr	x23, [x23, _FW_DESC_TYPE_USED@GOTPAGEOFF]
	cmp	x8, #1
	b.lt	LBB0_2
; %bb.1:
	ldr	w0, [x23]
	bl	_HOST_TO_LE32
	str	x0, [sp, #24]
Lloh5:
	adrp	x21, _board@GOTPAGE
Lloh6:
	ldr	x21, [x21, _board@GOTPAGEOFF]
	ldr	x8, [x21]
	ldr	w0, [x8]
	bl	_HOST_TO_LE32
	str	x0, [sp, #16]
Lloh7:
	adrp	x8, _MYLO_MAX_PARTITIONS@GOTPAGE
Lloh8:
	ldr	x8, [x8, _MYLO_MAX_PARTITIONS@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
Lloh10:
	adrp	x9, _PART_NAME_LEN@GOTPAGE
Lloh11:
	ldr	x9, [x9, _PART_NAME_LEN@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	orr	w10, wzr, #0x4
	madd	w0, w9, w8, w10
	bl	_HOST_TO_LE32
	str	x0, [sp, #8]
	ldr	x8, [x21]
	ldr	w0, [x8, #4]
	bl	_HOST_TO_LE32
	str	x0, [sp]
	mov	x1, sp
	mov	x0, x20
	mov	x2, x19
	bl	_write_out_desc
	cbnz	x0, LBB0_8
LBB0_2:
Lloh13:
	adrp	x22, _fw_num_blocks@GOTPAGE
Lloh14:
	ldr	x22, [x22, _fw_num_blocks@GOTPAGEOFF]
	ldr	w8, [x22]
	cmp	w8, #1
	b.lt	LBB0_6
; %bb.3:
	mov	x24, #0
	mov	x25, #0
Lloh15:
	adrp	x26, _fw_blocks@GOTPAGE
Lloh16:
	ldr	x26, [x26, _fw_blocks@GOTPAGEOFF]
Lloh17:
	adrp	x27, _BLOCK_FLAG_HAVEHDR@GOTPAGE
Lloh18:
	ldr	x27, [x27, _BLOCK_FLAG_HAVEHDR@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x26]
	add	x28, x8, x24
	ldp	w8, w9, [x28]
	ldr	w10, [x27]
	add	w11, w8, #4
	tst	w10, w9
	csel	w0, w8, w11, eq
	mov	w1, #4
	bl	_ALIGN
	mov	x21, x0
	ldr	w0, [x23]
	bl	_HOST_TO_LE32
	str	x0, [sp, #24]
	ldr	w0, [x28, #8]
	bl	_HOST_TO_LE32
	str	x0, [sp, #16]
	mov	x0, x21
	bl	_HOST_TO_LE32
	str	x0, [sp, #8]
	ldr	w0, [x28, #12]
	bl	_HOST_TO_LE32
	str	x0, [sp]
	mov	x1, sp
	mov	x0, x20
	mov	x2, x19
	bl	_write_out_desc
	cbnz	x0, LBB0_8
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x25, x25, #1
	ldrsw	x8, [x22]
	add	x24, x24, #16
	cmp	x25, x8
	b.lt	LBB0_4
LBB0_6:
	mov	x0, sp
	mov	w1, #0
	mov	w2, #32
	bl	_memset
	mov	x1, sp
	mov	x0, x20
	mov	x2, x19
	bl	_write_out_desc
	cbnz	x0, LBB0_8
; %bb.7:
	mov	x0, x20
	mov	x1, x19
	bl	_write_out_partitions
	cbz	x0, LBB0_10
LBB0_8:
	mov	w0, #-1
LBB0_9:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_10:
	ldr	w8, [x22]
	cmp	w8, #1
	b.lt	LBB0_14
; %bb.11:
	mov	x21, #0
	mov	x23, #0
Lloh19:
	adrp	x24, _fw_blocks@GOTPAGE
Lloh20:
	ldr	x24, [x24, _fw_blocks@GOTPAGEOFF]
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x24]
	add	x1, x8, x21
	mov	x0, x20
	mov	x2, x19
	bl	_write_out_file
	cbnz	x0, LBB0_8
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	add	x23, x23, #1
	ldrsw	x8, [x22]
	add	x21, x21, #16
	cmp	x23, x8
	b.lt	LBB0_12
	b	LBB0_9
LBB0_14:
	mov	w0, #0
	b	LBB0_9
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_fw_num_partitions,8,3          ; @fw_num_partitions
	.comm	_FW_DESC_TYPE_USED,4,2          ; @FW_DESC_TYPE_USED
	.comm	_board,8,3                      ; @board
	.comm	_MYLO_MAX_PARTITIONS,4,2        ; @MYLO_MAX_PARTITIONS
	.comm	_PART_NAME_LEN,4,2              ; @PART_NAME_LEN
	.comm	_fw_num_blocks,4,2              ; @fw_num_blocks
	.comm	_fw_blocks,8,3                  ; @fw_blocks
	.comm	_BLOCK_FLAG_HAVEHDR,4,2         ; @BLOCK_FLAG_HAVEHDR
.subsections_via_symbols
