	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function build_fw
_build_fw:                              ## @build_fw
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_EXIT_FAILURE@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	_kernel_info@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	_rootfs_info@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	leal	(%r15,%r13), %ebx
	addl	$48, %ebx
	movl	%ebx, %edi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r12
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	movq	%rax, %rdi
	xorl	%esi, %esi
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movl	%ebx, %edx
	callq	_memset
	movq	%r12, %r13
	addq	$48, %r13
	movq	_kernel_info@GOTPCREL(%rip), %rbx
	movq	%rbx, %rdi
	movq	%r13, %rsi
	callq	_read_to_buf
	movl	%eax, %r14d
	testl	%eax, %eax
	je	LBB0_3
LBB0_10:
	movq	%r12, %rdi
	callq	_free
	jmp	LBB0_11
LBB0_1:
	leaq	L_.str(%rip), %rdi
	callq	_ERR
LBB0_11:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	_combined@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	je	LBB0_4
LBB0_5:
	addl	-56(%rbp), %r15d                ## 4-byte Folded Reload
	movq	%r13, %rdi
	movl	%r15d, %esi
	callq	_get_csum
	movl	%eax, %edi
	callq	_htonl
	movq	%rax, 40(%r12)
	movl	%r15d, %edi
	callq	_htonl
	movq	%rax, 32(%r12)
	movq	_combined@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jne	LBB0_6
## %bb.7:
	movq	%rbx, %rax
	jmp	LBB0_8
LBB0_6:
	movq	_kernel_size@GOTPCREL(%rip), %rax
LBB0_8:
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	movl	(%rax), %edi
	callq	_htonl
	movq	%rax, 24(%r12)
	movl	$48, (%r12)
	movl	16(%r12), %edi
	movq	_model@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$4, %edx
	callq	_strncpy
	movl	12(%r12), %edi
	movq	_signature@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$4, %edx
	callq	_strncpy
	movl	8(%r12), %edi
	movq	_version@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$4, %edx
	callq	_strncpy
	movl	4(%r12), %edi
	movq	_region@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$4, %edx
	callq	_strncpy
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_write_fw
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_10
## %bb.9:
	movq	_EXIT_SUCCESS@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	jmp	LBB0_10
LBB0_4:
	movq	_kernel_info@GOTPCREL(%rip), %rax
	movslq	(%rax), %rsi
	addq	%r13, %rsi
	movq	_rootfs_info@GOTPCREL(%rip), %rdi
	callq	_read_to_buf
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_10
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.comm	_EXIT_FAILURE,4,2               ## @EXIT_FAILURE
	.comm	_kernel_info,4,2                ## @kernel_info
	.comm	_rootfs_info,4,2                ## @rootfs_info
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"no memory for buffer\n"

	.comm	_combined,4,2                   ## @combined
	.comm	_kernel_size,4,2                ## @kernel_size
	.comm	_model,4,2                      ## @model
	.comm	_signature,4,2                  ## @signature
	.comm	_version,4,2                    ## @version
	.comm	_region,4,2                     ## @region
	.comm	_EXIT_SUCCESS,4,2               ## @EXIT_SUCCESS
	.no_dead_strip	_build_fw
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function build_fw
_build_fw:                              ; @build_fw
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
Lloh0:
	adrp	x8, _EXIT_FAILURE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EXIT_FAILURE@GOTPAGEOFF]
Lloh2:
	ldr	w23, [x8]
Lloh3:
	adrp	x8, _kernel_info@GOTPAGE
Lloh4:
	ldr	x8, [x8, _kernel_info@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _rootfs_info@GOTPAGE
Lloh7:
	ldr	x9, [x9, _rootfs_info@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	add	w21, w9, w8
	add	w20, w21, #48
	mov	x0, x20
	bl	_malloc
	cbz	x0, LBB0_4
; %bb.1:
	mov	x19, x0
	mov	w1, #0
	mov	x2, x20
	bl	_memset
	add	x24, x19, #48
Lloh9:
	adrp	x22, _kernel_info@GOTPAGE
Lloh10:
	ldr	x22, [x22, _kernel_info@GOTPAGEOFF]
	mov	x0, x22
	mov	x1, x24
	bl	_read_to_buf
	mov	x23, x0
	cbnz	w0, LBB0_6
; %bb.2:
Lloh11:
	adrp	x25, _combined@GOTPAGE
Lloh12:
	ldr	x25, [x25, _combined@GOTPAGEOFF]
	ldr	w8, [x25]
	cbz	w8, LBB0_5
LBB0_3:
	mov	x0, x24
	mov	x1, x21
	bl	_get_csum
	bl	_htonl
	str	x0, [x19, #40]
	mov	x0, x21
	bl	_htonl
	str	x0, [x19, #32]
	ldr	w8, [x25]
Lloh13:
	adrp	x9, _kernel_size@GOTPAGE
Lloh14:
	ldr	x9, [x9, _kernel_size@GOTPAGEOFF]
	cmp	w8, #0
	csel	x8, x22, x9, eq
	ldr	w0, [x8]
	bl	_htonl
	str	x0, [x19, #24]
	mov	w8, #48
	str	w8, [x19]
	ldr	w0, [x19, #16]
Lloh15:
	adrp	x8, _model@GOTPAGE
Lloh16:
	ldr	x8, [x8, _model@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	w2, #4
	bl	_strncpy
	ldr	w0, [x19, #12]
Lloh18:
	adrp	x8, _signature@GOTPAGE
Lloh19:
	ldr	x8, [x8, _signature@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	mov	w2, #4
	bl	_strncpy
	ldr	w0, [x19, #8]
Lloh21:
	adrp	x8, _version@GOTPAGE
Lloh22:
	ldr	x8, [x8, _version@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	mov	w2, #4
	bl	_strncpy
	ldr	w0, [x19, #4]
Lloh24:
	adrp	x8, _region@GOTPAGE
Lloh25:
	ldr	x8, [x8, _region@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
	mov	w2, #4
	bl	_strncpy
	mov	x0, x19
	mov	x1, x20
	bl	_write_fw
Lloh27:
	adrp	x8, _EXIT_SUCCESS@GOTPAGE
Lloh28:
	ldr	x8, [x8, _EXIT_SUCCESS@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	cmp	w0, #0
	csel	w23, w8, w0, eq
	b	LBB0_6
LBB0_4:
Lloh30:
	adrp	x0, l_.str@PAGE
Lloh31:
	add	x0, x0, l_.str@PAGEOFF
	bl	_ERR
	b	LBB0_7
LBB0_5:
	ldrsw	x8, [x22]
	add	x1, x24, x8
Lloh32:
	adrp	x0, _rootfs_info@GOTPAGE
Lloh33:
	ldr	x0, [x0, _rootfs_info@GOTPAGEOFF]
	bl	_read_to_buf
	mov	x23, x0
	cbz	w0, LBB0_3
LBB0_6:
	mov	x0, x19
	bl	_free
LBB0_7:
	mov	x0, x23
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_EXIT_FAILURE,4,2               ; @EXIT_FAILURE
	.comm	_kernel_info,4,2                ; @kernel_info
	.comm	_rootfs_info,4,2                ; @rootfs_info
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"no memory for buffer\n"

	.comm	_combined,4,2                   ; @combined
	.comm	_kernel_size,4,2                ; @kernel_size
	.comm	_model,4,2                      ; @model
	.comm	_signature,4,2                  ; @signature
	.comm	_version,4,2                    ; @version
	.comm	_region,4,2                     ; @region
	.comm	_EXIT_SUCCESS,4,2               ; @EXIT_SUCCESS
	.no_dead_strip	_build_fw
.subsections_via_symbols
