	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fw_handle_file_header
_fw_handle_file_header:                 ## @fw_handle_file_header
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	cmpq	$16, %rdx
	jne	LBB0_1
## %bb.2:
	movq	%rsi, %r15
	movl	8(%rsi), %ecx
	movl	12(%rsi), %edx
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_wil_dbg_fw
	movq	_DUMP_PREFIX_OFFSET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	(%r15), %r8
	movl	$1, (%rsp)
	leaq	L_.str.2(%rip), %rdi
	movl	$16, %edx
	movl	$1, %ecx
	movl	$8, %r9d
	callq	_wil_hex_dump_fw
	movq	(%r15), %rdi
	movq	_WIL_FW_VERSION_PREFIX@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_WIL_FW_VERSION_PREFIX_LEN@GOTPCREL(%rip), %r12
	movq	(%r12), %rdx
	callq	_memcmp
	xorl	%ebx, %ebx
	testl	%eax, %eax
	jne	LBB0_4
## %bb.3:
	movl	(%r14), %r14d
	movq	(%r12), %rax
	movq	(%r15), %r15
	addq	%rax, %r15
	movl	$8, %edi
	subq	%rax, %rdi
	movl	$3, %esi
	callq	_min
	movl	%r14d, %edi
	movq	%r15, %rsi
	movl	%eax, %edx
	callq	_memcpy
	jmp	LBB0_4
LBB0_1:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_wil_err_fw
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_4:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"file header length incorrect: %zu\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"new file, ver. %d, %i bytes\n"

L_.str.2:                               ## @.str.2
	.space	1

	.comm	_DUMP_PREFIX_OFFSET,4,2         ## @DUMP_PREFIX_OFFSET
	.comm	_WIL_FW_VERSION_PREFIX,4,2      ## @WIL_FW_VERSION_PREFIX
	.comm	_WIL_FW_VERSION_PREFIX_LEN,8,3  ## @WIL_FW_VERSION_PREFIX_LEN
	.no_dead_strip	_fw_handle_file_header
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fw_handle_file_header
_fw_handle_file_header:                 ; @fw_handle_file_header
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x0
	cmp	x2, #16
	b.ne	LBB0_4
; %bb.1:
	mov	x20, x1
	ldp	w3, w2, [x1, #8]
Lloh0:
	adrp	x1, l_.str.1@PAGE
Lloh1:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_wil_dbg_fw
Lloh2:
	adrp	x8, _DUMP_PREFIX_OFFSET@GOTPAGE
Lloh3:
	ldr	x8, [x8, _DUMP_PREFIX_OFFSET@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	ldr	x4, [x20]
Lloh5:
	adrp	x0, l_.str.2@PAGE
Lloh6:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	w2, #16
	mov	w3, #1
	mov	w5, #8
	mov	w6, #1
	bl	_wil_hex_dump_fw
	ldr	x0, [x20]
Lloh7:
	adrp	x8, _WIL_FW_VERSION_PREFIX@GOTPAGE
Lloh8:
	ldr	x8, [x8, _WIL_FW_VERSION_PREFIX@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
Lloh10:
	adrp	x21, _WIL_FW_VERSION_PREFIX_LEN@GOTPAGE
Lloh11:
	ldr	x21, [x21, _WIL_FW_VERSION_PREFIX_LEN@GOTPAGEOFF]
	ldr	x2, [x21]
	bl	_memcmp
	cbnz	w0, LBB0_3
; %bb.2:
	ldr	w19, [x19]
	ldr	x8, [x20]
	ldr	x9, [x21]
	add	x20, x9, x8
	mov	w8, #8
	sub	x0, x8, x9
	mov	w1, #3
	bl	_min
	mov	x2, x0
	mov	x0, x19
	mov	x1, x20
	bl	_memcpy
LBB0_3:
	mov	w0, #0
	b	LBB0_5
LBB0_4:
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_wil_err_fw
Lloh14:
	adrp	x8, _EINVAL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"file header length incorrect: %zu\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"new file, ver. %d, %i bytes\n"

l_.str.2:                               ; @.str.2
	.space	1

	.comm	_DUMP_PREFIX_OFFSET,4,2         ; @DUMP_PREFIX_OFFSET
	.comm	_WIL_FW_VERSION_PREFIX,4,2      ; @WIL_FW_VERSION_PREFIX
	.comm	_WIL_FW_VERSION_PREFIX_LEN,8,3  ; @WIL_FW_VERSION_PREFIX_LEN
	.no_dead_strip	_fw_handle_file_header
.subsections_via_symbols
