	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ath6kl_bmi_get_target_info     ## -- Begin function ath6kl_bmi_get_target_info
	.p2align	4, 0x90
_ath6kl_bmi_get_target_info:            ## @ath6kl_bmi_get_target_info
	.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	%rsi, %r14
	movq	_BMI_GET_TARGET_INFO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%esi, -36(%rbp)
	cmpq	$0, 8(%rdi)
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_ath6kl_err
	movq	_EACCES@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_18
LBB0_2:
	movq	%rdi, %r15
	leaq	-36(%rbp), %rsi
	movl	$4, %edx
	callq	_ath6kl_hif_bmi_write
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_9
LBB0_4:
	movq	(%r15), %rax
	movq	_ATH6KL_HIF_TYPE_USB@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.5:
	movq	%r15, %rdi
	movq	%r14, %rsi
	movl	$12, %edx
	jmp	LBB0_7
LBB0_6:
	leaq	4(%r14), %rsi
	movq	%r15, %rdi
	movl	$4, %edx
LBB0_7:
	callq	_ath6kl_hif_bmi_read
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_10
## %bb.8:
	leaq	L_.str.2(%rip), %rdi
LBB0_9:
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_ath6kl_err
LBB0_18:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movl	4(%r14), %edi
	callq	_le32_to_cpu
	movq	_TARGET_VERSION_SENTINAL@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_17
## %bb.11:
	leaq	8(%r14), %r12
	movq	%r15, %rdi
	movq	%r12, %rsi
	movl	$4, %edx
	callq	_ath6kl_hif_bmi_read
	testl	%eax, %eax
	je	LBB0_13
## %bb.12:
	movl	%eax, %ebx
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_9
LBB0_13:
	movl	(%r12), %edi
	callq	_le32_to_cpu
	cmpl	$12, %eax
	jne	LBB0_14
## %bb.15:
	leaq	16(%r14), %rsi
	movq	%r15, %rdi
	movl	$8, %edx
	callq	_ath6kl_hif_bmi_read
	testl	%eax, %eax
	je	LBB0_17
## %bb.16:
	movl	%eax, %ebx
	movl	(%r12), %esi
	leaq	L_.str.4(%rip), %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_ath6kl_err
	jmp	LBB0_18
LBB0_17:
	movq	_ATH6KL_DBG_BMI@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%r14), %ecx
	movl	4(%r14), %edx
	leaq	L_.str.5(%rip), %rsi
	callq	_ath6kl_dbg
	xorl	%ebx, %ebx
	jmp	LBB0_18
LBB0_14:
	movl	$1, %edi
	callq	_WARN_ON
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_BMI_GET_TARGET_INFO,4,2        ## @BMI_GET_TARGET_INFO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"bmi done sent already, cmd %d disallowed\n"

	.comm	_EACCES,4,2                     ## @EACCES
L_.str.1:                               ## @.str.1
	.asciz	"Unable to send get target info: %d\n"

	.comm	_ATH6KL_HIF_TYPE_USB,8,3        ## @ATH6KL_HIF_TYPE_USB
L_.str.2:                               ## @.str.2
	.asciz	"Unable to recv target info: %d\n"

	.comm	_TARGET_VERSION_SENTINAL,4,2    ## @TARGET_VERSION_SENTINAL
L_.str.3:                               ## @.str.3
	.asciz	"unable to read target info byte count: %d\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.4:                               ## @.str.4
	.asciz	"Unable to read target info (%d bytes): %d\n"

	.comm	_ATH6KL_DBG_BMI,4,2             ## @ATH6KL_DBG_BMI
L_.str.5:                               ## @.str.5
	.asciz	"target info (ver: 0x%x type: 0x%x)\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ath6kl_bmi_get_target_info     ; -- Begin function ath6kl_bmi_get_target_info
	.p2align	2
_ath6kl_bmi_get_target_info:            ; @ath6kl_bmi_get_target_info
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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, x1
Lloh0:
	adrp	x8, _BMI_GET_TARGET_INFO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BMI_GET_TARGET_INFO@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	str	w1, [sp, #12]
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_3
; %bb.1:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_ath6kl_err
Lloh5:
	adrp	x8, _EACCES@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EACCES@GOTPAGEOFF]
LBB0_2:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_12
LBB0_3:
	mov	x20, x0
	add	x1, sp, #12
	mov	w2, #4
	bl	_ath6kl_hif_bmi_write
	cbz	w0, LBB0_5
; %bb.4:
	mov	x21, x0
Lloh7:
	adrp	x0, l_.str.1@PAGE
Lloh8:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_10
LBB0_5:
	ldr	x8, [x20]
Lloh9:
	adrp	x9, _ATH6KL_HIF_TYPE_USB@GOTPAGE
Lloh10:
	ldr	x9, [x9, _ATH6KL_HIF_TYPE_USB@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.6:
	mov	x0, x20
	mov	x1, x19
	mov	w2, #12
	b	LBB0_8
LBB0_7:
	add	x1, x19, #4
	mov	x0, x20
	mov	w2, #4
LBB0_8:
	bl	_ath6kl_hif_bmi_read
	mov	x21, x0
	cbz	w0, LBB0_13
; %bb.9:
Lloh12:
	adrp	x0, l_.str.2@PAGE
Lloh13:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_10:
	mov	x1, x21
LBB0_11:
	bl	_ath6kl_err
LBB0_12:
	mov	x0, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_13:
	ldr	w0, [x19, #4]
	bl	_le32_to_cpu
Lloh14:
	adrp	x8, _TARGET_VERSION_SENTINAL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _TARGET_VERSION_SENTINAL@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_19
; %bb.14:
	add	x22, x19, #8
	mov	x0, x20
	mov	x1, x22
	mov	w2, #4
	bl	_ath6kl_hif_bmi_read
	cbz	w0, LBB0_16
; %bb.15:
	mov	x21, x0
Lloh17:
	adrp	x0, l_.str.3@PAGE
Lloh18:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_10
LBB0_16:
	ldr	w0, [x22]
	bl	_le32_to_cpu
	cmp	w0, #12
	b.ne	LBB0_20
; %bb.17:
	add	x1, x19, #16
	mov	x0, x20
	mov	w2, #8
	bl	_ath6kl_hif_bmi_read
	cbz	w0, LBB0_19
; %bb.18:
	mov	x21, x0
	ldr	w1, [x22]
	str	x21, [sp]
Lloh19:
	adrp	x0, l_.str.4@PAGE
Lloh20:
	add	x0, x0, l_.str.4@PAGEOFF
	b	LBB0_11
LBB0_19:
Lloh21:
	adrp	x8, _ATH6KL_DBG_BMI@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ATH6KL_DBG_BMI@GOTPAGEOFF]
Lloh23:
	ldr	w0, [x8]
	ldp	w3, w2, [x19]
Lloh24:
	adrp	x1, l_.str.5@PAGE
Lloh25:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_ath6kl_dbg
	mov	w21, #0
	b	LBB0_12
LBB0_20:
	mov	w0, #1
	bl	_WARN_ON
Lloh26:
	adrp	x8, _EINVAL@GOTPAGE
Lloh27:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_BMI_GET_TARGET_INFO,4,2        ; @BMI_GET_TARGET_INFO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"bmi done sent already, cmd %d disallowed\n"

	.comm	_EACCES,4,2                     ; @EACCES
l_.str.1:                               ; @.str.1
	.asciz	"Unable to send get target info: %d\n"

	.comm	_ATH6KL_HIF_TYPE_USB,8,3        ; @ATH6KL_HIF_TYPE_USB
l_.str.2:                               ; @.str.2
	.asciz	"Unable to recv target info: %d\n"

	.comm	_TARGET_VERSION_SENTINAL,4,2    ; @TARGET_VERSION_SENTINAL
l_.str.3:                               ; @.str.3
	.asciz	"unable to read target info byte count: %d\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.4:                               ; @.str.4
	.asciz	"Unable to read target info (%d bytes): %d\n"

	.comm	_ATH6KL_DBG_BMI,4,2             ; @ATH6KL_DBG_BMI
l_.str.5:                               ; @.str.5
	.asciz	"target info (ver: 0x%x type: 0x%x)\n"

.subsections_via_symbols
