	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ath6kl_wmi_startscan_cmd
_ath6kl_wmi_startscan_cmd:              ## @ath6kl_wmi_startscan_cmd
	.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
	movl	%ecx, %r14d
	movl	%edx, %r12d
	movl	%esi, %r15d
	movq	32(%rbp), %r13
	movl	24(%rbp), %ebx
	movl	16(%rbp), %ecx
	movq	_WMI_LONG_SCAN@GOTPCREL(%rip), %rax
	cmpl	%edx, (%rax)
	je	LBB0_4
## %bb.1:
	movq	_WMI_SHORT_SCAN@GOTPCREL(%rip), %rax
	cmpl	%r12d, (%rax)
	jne	LBB0_2
LBB0_4:
	movq	_WMI_MAX_CHANNELS@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jge	LBB0_5
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_3:
	xorl	%eax, %eax
	subl	(%rcx), %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movl	%r8d, -48(%rbp)                 ## 4-byte Spill
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	movl	%r9d, -56(%rbp)                 ## 4-byte Spill
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	testl	%ebx, %ebx
	leal	44(,%rbx,4), %eax
	movl	$48, %edi
	cmovnel	%eax, %edi
	callq	_ath6kl_wmi_get_new_buf
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	(%rax), %r15
	movl	%r12d, (%r15)
	movl	%r14d, %edi
	callq	_cpu_to_le32
	movq	%rax, 40(%r15)
	movl	-48(%rbp), %edi                 ## 4-byte Reload
	callq	_cpu_to_le32
	movq	%rax, 32(%r15)
	movl	-56(%rbp), %edi                 ## 4-byte Reload
	callq	_cpu_to_le32
	movq	%rax, 24(%r15)
	movl	-52(%rbp), %edi                 ## 4-byte Reload
	callq	_cpu_to_le32
	movq	%rax, 16(%r15)
	movl	%ebx, 4(%r15)
	testl	%ebx, %ebx
	jle	LBB0_10
## %bb.8:
	movl	%ebx, %r14d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13,%rbx,4), %edi
	callq	_cpu_to_le16
	movq	8(%r15), %rcx
	movl	%eax, (%rcx,%rbx,4)
	incq	%rbx
	cmpq	%rbx, %r14
	jne	LBB0_9
LBB0_10:
	movq	_WMI_START_SCAN_CMDID@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_NO_SYNC_WMIFLAG@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ath6kl_wmi_cmd_send            ## TAILCALL
LBB0_6:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	jmp	LBB0_3
	.cfi_endproc
                                        ## -- End function
	.comm	_WMI_LONG_SCAN,4,2              ## @WMI_LONG_SCAN
	.comm	_WMI_SHORT_SCAN,4,2             ## @WMI_SHORT_SCAN
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_WMI_MAX_CHANNELS,4,2           ## @WMI_MAX_CHANNELS
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_WMI_START_SCAN_CMDID,4,2       ## @WMI_START_SCAN_CMDID
	.comm	_NO_SYNC_WMIFLAG,4,2            ## @NO_SYNC_WMIFLAG
	.no_dead_strip	_ath6kl_wmi_startscan_cmd
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ath6kl_wmi_startscan_cmd
_ath6kl_wmi_startscan_cmd:              ; @ath6kl_wmi_startscan_cmd
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
Lloh0:
	adrp	x8, _WMI_LONG_SCAN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _WMI_LONG_SCAN@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _WMI_SHORT_SCAN@GOTPAGE
Lloh4:
	ldr	x9, [x9, _WMI_SHORT_SCAN@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, w2
	ccmp	w9, w2, #4, ne
	b.ne	LBB0_2
; %bb.1:
	mov	x21, x7
Lloh6:
	adrp	x8, _WMI_MAX_CHANNELS@GOTPAGE
Lloh7:
	ldr	x8, [x8, _WMI_MAX_CHANNELS@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	w8, w7
	b.ge	LBB0_4
LBB0_2:
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_3:
	ldr	w8, [x8]
	neg	w0, w8
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_4:
	mov	x23, x6
	mov	x24, x5
	mov	x25, x4
	mov	x26, x3
	mov	x27, x2
	mov	x19, x1
	mov	x20, x0
	ldr	x28, [x29, #16]
	lsl	w8, w21, #2
	add	w8, w8, #44
	mov	w9, #48
	cmp	w21, #0
	csel	w0, w9, w8, eq
	bl	_ath6kl_wmi_get_new_buf
	cbz	x0, LBB0_9
; %bb.5:
	str	x0, [sp, #8]                    ; 8-byte Folded Spill
	ldr	x22, [x0]
	str	w27, [x22]
	mov	x0, x26
	bl	_cpu_to_le32
	str	x0, [x22, #40]
	mov	x0, x25
	bl	_cpu_to_le32
	str	x0, [x22, #32]
	mov	x0, x24
	bl	_cpu_to_le32
	str	x0, [x22, #24]
	mov	x0, x23
	bl	_cpu_to_le32
	str	x0, [x22, #16]
	str	w21, [x22, #4]
	cmp	w21, #1
	b.lt	LBB0_8
; %bb.6:
	mov	x23, #0
	mov	w8, w21
	lsl	x21, x8, #2
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x28, x23]
	bl	_cpu_to_le16
	ldr	x8, [x22, #8]
	str	w0, [x8, x23]
	add	x23, x23, #4
	cmp	x21, x23
	b.ne	LBB0_7
LBB0_8:
Lloh11:
	adrp	x8, _WMI_START_SCAN_CMDID@GOTPAGE
Lloh12:
	ldr	x8, [x8, _WMI_START_SCAN_CMDID@GOTPAGEOFF]
Lloh13:
	ldr	w3, [x8]
Lloh14:
	adrp	x8, _NO_SYNC_WMIFLAG@GOTPAGE
Lloh15:
	ldr	x8, [x8, _NO_SYNC_WMIFLAG@GOTPAGEOFF]
Lloh16:
	ldr	w4, [x8]
	mov	x0, x20
	mov	x1, x19
	ldr	x2, [sp, #8]                    ; 8-byte Folded Reload
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_ath6kl_wmi_cmd_send
LBB0_9:
Lloh17:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_WMI_LONG_SCAN,4,2              ; @WMI_LONG_SCAN
	.comm	_WMI_SHORT_SCAN,4,2             ; @WMI_SHORT_SCAN
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_WMI_MAX_CHANNELS,4,2           ; @WMI_MAX_CHANNELS
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_WMI_START_SCAN_CMDID,4,2       ; @WMI_START_SCAN_CMDID
	.comm	_NO_SYNC_WMIFLAG,4,2            ; @NO_SYNC_WMIFLAG
	.no_dead_strip	_ath6kl_wmi_startscan_cmd
.subsections_via_symbols
