	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function wl1251_cmd_scan
LCPI0_0:
	.space	16
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_wl1251_cmd_scan
	.p2align	4, 0x90
_wl1251_cmd_scan:                       ## @wl1251_cmd_scan
	.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	%r9d, %r12d
	movl	%r8d, %r15d
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	%rdx, %r13
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	movq	%rdi, %rbx
	movq	_DEBUG_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r8d, %edx
	callq	_wl1251_debug
	movq	_SCAN_MAX_NUM_OF_CHANNELS@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	cmpl	%r15d, (%rax)
	setb	%dil
	callq	_WARN_ON
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$72, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r14
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
	movq	_CFG_RX_ALL_GOOD@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_cpu_to_le32
	movq	%rax, 56(%r14)
	movq	_CFG_RX_PRSP_EN@GOTPCREL(%rip), %rax
	movq	_CFG_RX_MGMT_EN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	orl	(%rax), %edi
	movq	_CFG_RX_BCN_EN@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	callq	_cpu_to_le32
	movq	%rax, 48(%r14)
	movl	$0, 44(%r14)
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movl	4(%rbx), %edi
	callq	_is_zero_ether_addr
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	_WL1251_SCAN_OPT_PRIORITY_HIGH@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_cpu_to_le16
	orl	%eax, 44(%r14)
LBB0_4:
	movl	%r15d, 8(%r14)
	movl	%r12d, 12(%r14)
	movl	$2, %edi
	callq	_cpu_to_le16
	movl	%eax, 40(%r14)
	movq	$0, 32(%r14)
	testl	%r15d, %r15d
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	je	LBB0_7
## %bb.5:
	movl	%r15d, %r15d
	movl	$24, %ebx
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	_WL1251_SCAN_MIN_DURATION@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_cpu_to_le32
	movq	64(%r14), %rcx
	movq	%rax, 16(%rcx,%rbx)
	movq	_WL1251_SCAN_MAX_DURATION@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_cpu_to_le32
	movq	64(%r14), %rcx
	movq	%rax, 8(%rcx,%rbx)
	leaq	(%rcx,%rbx), %rdi
	addq	$4, %rdi
	movl	$255, %esi
	movl	$4, %edx
	callq	_memset
	movq	64(%r14), %rdi
	addq	%rbx, %rdi
	movl	$255, %esi
	movl	$2, %edx
	callq	_memset
	movq	64(%r14), %rax
	xorps	%xmm0, %xmm0
	movups	%xmm0, -16(%rax,%rbx)
	movq	(%r13,%r12,8), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -24(%rax,%rbx)
	incq	%r12
	addq	$48, %rbx
	cmpq	%r12, %r15
	jne	LBB0_6
LBB0_7:
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movq	%rdx, 16(%r14)
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	testq	%rsi, %rsi
	je	LBB0_9
## %bb.8:
	movl	24(%r14), %edi
	callq	_memcpy
LBB0_9:
	movq	_CMD_SCAN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movq	%r14, %rdx
	movl	$72, %ecx
	callq	_wl1251_cmd_send
	movl	%eax, %r15d
	testl	%eax, %eax
	js	LBB0_10
## %bb.11:
	movl	(%rbx), %esi
	movq	%rbx, %rdi
	movq	%r14, %rdx
	movl	$72, %ecx
	callq	_wl1251_mem_read
	movl	(%r14), %esi
	movq	_CMD_STATUS_SUCCESS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %esi
	je	LBB0_13
## %bb.12:
	leaq	L_.str.2(%rip), %rdi
	callq	_wl1251_error
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_13
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_14
LBB0_10:
	leaq	L_.str.1(%rip), %rdi
	movl	%r15d, %esi
	callq	_wl1251_error
LBB0_13:
	movq	%r14, %rdi
	callq	_kfree
LBB0_14:
	movl	%r15d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DEBUG_CMD,4,2                  ## @DEBUG_CMD
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"cmd scan channels %d"

	.comm	_SCAN_MAX_NUM_OF_CHANNELS,4,2   ## @SCAN_MAX_NUM_OF_CHANNELS
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_CFG_RX_ALL_GOOD,4,2            ## @CFG_RX_ALL_GOOD
	.comm	_CFG_RX_PRSP_EN,4,2             ## @CFG_RX_PRSP_EN
	.comm	_CFG_RX_MGMT_EN,4,2             ## @CFG_RX_MGMT_EN
	.comm	_CFG_RX_BCN_EN,4,2              ## @CFG_RX_BCN_EN
	.comm	_WL1251_SCAN_OPT_PRIORITY_HIGH,4,2 ## @WL1251_SCAN_OPT_PRIORITY_HIGH
	.comm	_WL1251_SCAN_MIN_DURATION,4,2   ## @WL1251_SCAN_MIN_DURATION
	.comm	_WL1251_SCAN_MAX_DURATION,4,2   ## @WL1251_SCAN_MAX_DURATION
	.comm	_CMD_SCAN,4,2                   ## @CMD_SCAN
L_.str.1:                               ## @.str.1
	.asciz	"cmd scan failed: %d"

	.comm	_CMD_STATUS_SUCCESS,4,2         ## @CMD_STATUS_SUCCESS
L_.str.2:                               ## @.str.2
	.asciz	"cmd scan status wasn't success: %d"

	.comm	_EIO,4,2                        ## @EIO
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wl1251_cmd_scan                ; -- Begin function wl1251_cmd_scan
	.p2align	2
_wl1251_cmd_scan:                       ; @wl1251_cmd_scan
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x25, x5
	mov	x24, x4
	mov	x23, x3
	mov	x21, x2
	mov	x22, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _DEBUG_CMD@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DEBUG_CMD@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x4
	bl	_wl1251_debug
Lloh5:
	adrp	x8, _SCAN_MAX_NUM_OF_CHANNELS@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SCAN_MAX_NUM_OF_CHANNELS@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	cmp	w8, w24
	cset	w0, lo
	bl	_WARN_ON
Lloh8:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	w0, #72
	bl	_kzalloc
	cbz	x0, LBB0_11
; %bb.1:
	mov	x19, x0
Lloh11:
	adrp	x8, _CFG_RX_ALL_GOOD@GOTPAGE
Lloh12:
	ldr	x8, [x8, _CFG_RX_ALL_GOOD@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	bl	_cpu_to_le32
	str	x0, [x19, #56]
Lloh14:
	adrp	x8, _CFG_RX_PRSP_EN@GOTPAGE
Lloh15:
	ldr	x8, [x8, _CFG_RX_PRSP_EN@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
Lloh17:
	adrp	x9, _CFG_RX_MGMT_EN@GOTPAGE
Lloh18:
	ldr	x9, [x9, _CFG_RX_MGMT_EN@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh20:
	adrp	x9, _CFG_RX_BCN_EN@GOTPAGE
Lloh21:
	ldr	x9, [x9, _CFG_RX_BCN_EN@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	orr	w0, w8, w9
	bl	_cpu_to_le32
	str	x0, [x19, #48]
	str	wzr, [x19, #44]
	ldr	w0, [x20, #4]
	bl	_is_zero_ether_addr
	cbz	x0, LBB0_3
; %bb.2:
Lloh23:
	adrp	x8, _WL1251_SCAN_OPT_PRIORITY_HIGH@GOTPAGE
Lloh24:
	ldr	x8, [x8, _WL1251_SCAN_OPT_PRIORITY_HIGH@GOTPAGEOFF]
Lloh25:
	ldr	w0, [x8]
	bl	_cpu_to_le16
	ldr	w8, [x19, #44]
	orr	w8, w8, w0
	str	w8, [x19, #44]
LBB0_3:
	stp	w24, w25, [x19, #8]
	mov	w0, #2
	bl	_cpu_to_le16
	str	w0, [x19, #40]
	str	xzr, [x19, #32]
	cbz	w24, LBB0_6
; %bb.4:
	mov	x25, #0
	mov	w8, #48
	umull	x24, w24, w8
Lloh26:
	adrp	x26, _WL1251_SCAN_MIN_DURATION@GOTPAGE
Lloh27:
	ldr	x26, [x26, _WL1251_SCAN_MIN_DURATION@GOTPAGEOFF]
Lloh28:
	adrp	x27, _WL1251_SCAN_MAX_DURATION@GOTPAGE
Lloh29:
	ldr	x27, [x27, _WL1251_SCAN_MAX_DURATION@GOTPAGEOFF]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x26]
	bl	_cpu_to_le32
	ldr	x8, [x19, #64]
	add	x8, x8, x25
	str	x0, [x8, #40]
	ldr	w0, [x27]
	bl	_cpu_to_le32
	ldr	x8, [x19, #64]
	add	x8, x8, x25
	str	x0, [x8, #32]
	add	x0, x8, #28
	mov	w1, #255
	mov	w2, #4
	bl	_memset
	ldr	x8, [x19, #64]
	add	x8, x8, x25
	add	x0, x8, #24
	mov	w1, #255
	mov	w2, #2
	bl	_memset
	ldr	x8, [x19, #64]
	add	x8, x8, x25
	stp	xzr, xzr, [x8, #8]
	ldr	x9, [x23], #8
	ldr	w9, [x9]
	str	w9, [x8]
	add	x25, x25, #48
	cmp	x24, x25
	b.ne	LBB0_5
LBB0_6:
	str	x21, [x19, #16]
	cbz	x22, LBB0_8
; %bb.7:
	ldr	w0, [x19, #24]
	mov	x1, x22
	mov	x2, x21
	bl	_memcpy
LBB0_8:
Lloh30:
	adrp	x8, _CMD_SCAN@GOTPAGE
Lloh31:
	ldr	x8, [x8, _CMD_SCAN@GOTPAGEOFF]
Lloh32:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, x19
	mov	w3, #72
	bl	_wl1251_cmd_send
	mov	x21, x0
	tbnz	w0, #31, LBB0_12
; %bb.9:
	ldr	w1, [x20]
	mov	x0, x20
	mov	x2, x19
	mov	w3, #72
	bl	_wl1251_mem_read
	ldr	w1, [x19]
Lloh33:
	adrp	x8, _CMD_STATUS_SUCCESS@GOTPAGE
Lloh34:
	ldr	x8, [x8, _CMD_STATUS_SUCCESS@GOTPAGEOFF]
Lloh35:
	ldr	w8, [x8]
	cmp	w1, w8
	b.eq	LBB0_13
; %bb.10:
Lloh36:
	adrp	x0, l_.str.2@PAGE
Lloh37:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_wl1251_error
Lloh38:
	adrp	x8, _EIO@GOTPAGE
Lloh39:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh40:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_13
LBB0_11:
Lloh41:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh42:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh43:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_14
LBB0_12:
Lloh44:
	adrp	x0, l_.str.1@PAGE
Lloh45:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x21
	bl	_wl1251_error
LBB0_13:
	mov	x0, x19
	bl	_kfree
LBB0_14:
	mov	x0, x21
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpAdd	Lloh44, Lloh45
	.cfi_endproc
                                        ; -- End function
	.comm	_DEBUG_CMD,4,2                  ; @DEBUG_CMD
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cmd scan channels %d"

	.comm	_SCAN_MAX_NUM_OF_CHANNELS,4,2   ; @SCAN_MAX_NUM_OF_CHANNELS
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_CFG_RX_ALL_GOOD,4,2            ; @CFG_RX_ALL_GOOD
	.comm	_CFG_RX_PRSP_EN,4,2             ; @CFG_RX_PRSP_EN
	.comm	_CFG_RX_MGMT_EN,4,2             ; @CFG_RX_MGMT_EN
	.comm	_CFG_RX_BCN_EN,4,2              ; @CFG_RX_BCN_EN
	.comm	_WL1251_SCAN_OPT_PRIORITY_HIGH,4,2 ; @WL1251_SCAN_OPT_PRIORITY_HIGH
	.comm	_WL1251_SCAN_MIN_DURATION,4,2   ; @WL1251_SCAN_MIN_DURATION
	.comm	_WL1251_SCAN_MAX_DURATION,4,2   ; @WL1251_SCAN_MAX_DURATION
	.comm	_CMD_SCAN,4,2                   ; @CMD_SCAN
l_.str.1:                               ; @.str.1
	.asciz	"cmd scan failed: %d"

	.comm	_CMD_STATUS_SUCCESS,4,2         ; @CMD_STATUS_SUCCESS
l_.str.2:                               ; @.str.2
	.asciz	"cmd scan status wasn't success: %d"

	.comm	_EIO,4,2                        ; @EIO
.subsections_via_symbols
