	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ath6kl_fetch_testmode_file
_ath6kl_fetch_testmode_file:            ## @ath6kl_fetch_testmode_file
	.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	%rbx
	subq	$120, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movl	(%rdi), %edx
	xorl	%r14d, %r14d
	testl	%edx, %edx
	je	LBB0_9
## %bb.1:
	movq	%rdi, %rbx
	movq	_ATH6KL_DBG_BOOT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_ath6kl_dbg
	cmpl	$2, (%rbx)
	jne	LBB0_5
## %bb.2:
	movq	16(%rbx), %r8
	testq	%r8, %r8
	jne	LBB0_7
## %bb.3:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_4
LBB0_5:
	movq	32(%rbx), %r8
	testq	%r8, %r8
	je	LBB0_6
LBB0_7:
	movq	24(%rbx), %rcx
	leaq	L_.str.2(%rip), %rdx
	leaq	-144(%rbp), %r15
	movq	%r15, %rdi
	movl	$100, %esi
	callq	_snprintf
	movq	_TESTMODE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	12(%rbx), %rsi
	callq	_set_bit
	leaq	8(%rbx), %rdx
	leaq	4(%rbx), %rcx
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_ath6kl_get_fw
	testl	%eax, %eax
	je	LBB0_9
## %bb.8:
	movl	%eax, %r15d
	movl	(%rbx), %esi
	leaq	L_.str.4(%rip), %rdi
	leaq	-144(%rbp), %rdx
	movl	%eax, %ecx
	callq	_ath6kl_err
	movl	%r15d, %r14d
	jmp	LBB0_9
LBB0_6:
	leaq	L_.str.3(%rip), %rdi
LBB0_4:
	callq	_ath6kl_warn
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_9:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-32(%rbp), %rax
	jne	LBB0_11
## %bb.10:
	movl	%r14d, %eax
	addq	$120, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_ATH6KL_DBG_BOOT,4,2            ## @ATH6KL_DBG_BOOT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"testmode %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"testmode 2 not supported\n"

	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
L_.str.2:                               ## @.str.2
	.asciz	"%s/%s"

L_.str.3:                               ## @.str.3
	.asciz	"testmode 1 not supported\n"

	.comm	_TESTMODE,4,2                   ## @TESTMODE
L_.str.4:                               ## @.str.4
	.asciz	"Failed to get testmode %d firmware file %s: %d\n"

	.no_dead_strip	_ath6kl_fetch_testmode_file
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ath6kl_fetch_testmode_file
_ath6kl_fetch_testmode_file:            ; @ath6kl_fetch_testmode_file
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-24]
	ldr	w2, [x0]
	cbz	w2, LBB0_4
; %bb.1:
	mov	x19, x0
Lloh3:
	adrp	x8, _ATH6KL_DBG_BOOT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ATH6KL_DBG_BOOT@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_ath6kl_dbg
	ldr	w8, [x19]
	cmp	w8, #2
	b.ne	LBB0_5
; %bb.2:
	ldr	x4, [x19, #16]
	cbnz	x4, LBB0_6
; %bb.3:
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_9
LBB0_4:
	mov	w20, #0
	b	LBB0_10
LBB0_5:
	ldr	x4, [x19, #32]
	cbz	x4, LBB0_8
LBB0_6:
	ldr	x3, [x19, #24]
Lloh10:
	adrp	x2, l_.str.2@PAGE
Lloh11:
	add	x2, x2, l_.str.2@PAGEOFF
	add	x0, sp, #4
	mov	w1, #100
	bl	_snprintf
Lloh12:
	adrp	x8, _TESTMODE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _TESTMODE@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	add	x1, x19, #12
	bl	_set_bit
	add	x2, x19, #8
	add	x3, x19, #4
	add	x1, sp, #4
	mov	x0, x19
	bl	_ath6kl_get_fw
	mov	x20, x0
	cbz	w0, LBB0_10
; %bb.7:
	ldr	w1, [x19]
Lloh15:
	adrp	x0, l_.str.4@PAGE
Lloh16:
	add	x0, x0, l_.str.4@PAGEOFF
	add	x2, sp, #4
	mov	x3, x20
	bl	_ath6kl_err
	b	LBB0_10
LBB0_8:
Lloh17:
	adrp	x0, l_.str.3@PAGE
Lloh18:
	add	x0, x0, l_.str.3@PAGEOFF
LBB0_9:
	bl	_ath6kl_warn
Lloh19:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh20:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_10:
	ldur	x8, [x29, #-24]
Lloh22:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh23:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh24:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_12
; %bb.11:
	mov	x0, x20
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_12:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_ATH6KL_DBG_BOOT,4,2            ; @ATH6KL_DBG_BOOT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"testmode %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"testmode 2 not supported\n"

	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
l_.str.2:                               ; @.str.2
	.asciz	"%s/%s"

l_.str.3:                               ; @.str.3
	.asciz	"testmode 1 not supported\n"

	.comm	_TESTMODE,4,2                   ; @TESTMODE
l_.str.4:                               ; @.str.4
	.asciz	"Failed to get testmode %d firmware file %s: %d\n"

	.no_dead_strip	_ath6kl_fetch_testmode_file
.subsections_via_symbols
