	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wl12xx_cmd_role_start_ap       ## -- Begin function wl12xx_cmd_role_start_ap
	.p2align	4, 0x90
_wl12xx_cmd_role_start_ap:              ## @wl12xx_cmd_role_start_ap
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	%rsi, %rdi
	callq	_wl12xx_wlvif_to_vif
	movq	%rax, %r13
	movq	_DEBUG_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%r14), %edx
	leaq	L_.str(%rip), %rsi
	callq	_wl1271_debug
	movq	%r13, %rdi
	callq	_ieee80211_vif_is_mesh
	testl	%eax, %eax
	jne	LBB0_4
## %bb.1:
	cmpq	$0, 40(%r14)
	jne	LBB0_4
## %bb.2:
	cmpl	$0, 12(%r13)
	je	LBB0_3
LBB0_4:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$128, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_5
## %bb.7:
	movq	%rax, %r15
	leaq	16(%r14), %rdx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	callq	_wl12xx_allocate_link
	testl	%eax, %eax
	js	LBB0_8
## %bb.9:
	leaq	24(%r14), %rdx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	callq	_wl12xx_allocate_link
	testl	%eax, %eax
	js	LBB0_10
## %bb.11:
	movl	68(%r14), %eax
	movq	16(%rbx), %rcx
	movq	24(%r14), %rdx
	movl	%eax, (%rcx,%rdx,4)
	movl	(%r14), %eax
	movl	%eax, (%r15)
	movl	8(%rbx), %edi
	callq	_cpu_to_le16
	movq	%rax, 112(%r15)
	movq	_WL1271_AP_BSS_INDEX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 104(%r15)
	movq	16(%r14), %rax
	movq	%rax, 16(%r15)
	movq	24(%r14), %rcx
	movq	%rcx, 24(%r15)
	movq	(%rbx), %rdx
	movl	(%rdx,%rax,4), %eax
	movl	%eax, 100(%r15)
	movl	(%rdx,%rcx,4), %eax
	movl	%eax, 96(%r15)
	movl	4(%r14), %edi
	callq	_cpu_to_le32
	movq	%rax, 88(%r15)
	movl	64(%r14), %edi
	callq	_cpu_to_le16
	movq	%rax, 80(%r15)
	movl	16(%r13), %eax
	movl	%eax, 76(%r15)
	movq	_WL1271_AP_DEF_BEACON_EXP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 72(%r15)
	movl	$1, 32(%r15)
	movl	60(%r14), %eax
	movl	%eax, 68(%r15)
	movl	56(%r14), %eax
	movl	%eax, 124(%r15)
	movl	52(%r14), %edi
	callq	_wlcore_get_native_channel_type
	movl	%eax, 120(%r15)
	cmpl	$0, 12(%r13)
	je	LBB0_12
## %bb.13:
	movq	_WL12XX_SSID_TYPE_HIDDEN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 64(%r15)
	movq	(%r13), %rdx
	movq	%rdx, 56(%r15)
	movl	48(%r15), %edi
	movl	8(%r13), %esi
	jmp	LBB0_14
LBB0_5:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_6:
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_22
LBB0_8:
	movl	%eax, %r12d
	jmp	LBB0_21
LBB0_10:
	movl	%eax, %r12d
	jmp	LBB0_20
LBB0_12:
	movq	_WL12XX_SSID_TYPE_PUBLIC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 64(%r15)
	movq	40(%r14), %rdx
	movq	%rdx, 56(%r15)
	movl	48(%r15), %edi
	movl	48(%r14), %esi
LBB0_14:
	callq	_memcpy
	movq	_CONF_TX_ENABLED_RATES@GOTPCREL(%rip), %rax
	movq	_CONF_TX_MCS_RATES@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r12d
	orl	(%rax), %r12d
	movq	%rbx, %r13
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_wlcore_hw_ap_get_mimo_wide_rate_mask
	orl	%eax, %r12d
	movq	_CONF_TX_CCK_RATES@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%ebx, %ebx
	cmpq	$1, 32(%r14)
	sbbl	%ebx, %ebx
	notl	%eax
	orl	%eax, %ebx
	andl	%r12d, %ebx
	movq	_DEBUG_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
	movl	%ebx, %edx
	callq	_wl1271_debug
	movl	%ebx, %edi
	callq	_cpu_to_le32
	movq	%rax, 40(%r15)
	movl	8(%r14), %esi
	movq	_WLCORE_BAND_2_4GHZ@GOTPCREL(%rip), %rbx
	cmpl	$129, %esi
	je	LBB0_18
## %bb.15:
	cmpl	$128, %esi
	jne	LBB0_17
## %bb.16:
	movq	_WLCORE_BAND_5GHZ@GOTPCREL(%rip), %rbx
	jmp	LBB0_18
LBB0_17:
	leaq	L_.str.3(%rip), %rdi
	callq	_wl1271_warning
LBB0_18:
	movq	(%rbx), %rax
	movq	%rax, 8(%r15)
	movq	_CMD_ROLE_START@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rbx
	movq	%r13, %rdi
	movq	%r15, %rdx
	movl	$128, %ecx
	xorl	%r8d, %r8d
	callq	_wl1271_cmd_send
	movl	%eax, %r12d
	testl	%eax, %eax
	jns	LBB0_21
## %bb.19:
	leaq	L_.str.4(%rip), %rdi
	callq	_wl1271_error
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	callq	_wl12xx_free_link
LBB0_20:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	callq	_wl12xx_free_link
LBB0_21:
	movq	%r15, %rdi
	callq	_kfree
LBB0_22:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	leaq	L_.str.1(%rip), %rdi
	callq	_wl1271_error
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_DEBUG_CMD,4,2                  ## @DEBUG_CMD
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"cmd role start ap %d"

L_.str.1:                               ## @.str.1
	.asciz	"got a null SSID from beacon/bss"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_WL1271_AP_BSS_INDEX,4,2        ## @WL1271_AP_BSS_INDEX
	.comm	_WL1271_AP_DEF_BEACON_EXP,4,2   ## @WL1271_AP_DEF_BEACON_EXP
	.comm	_WL12XX_SSID_TYPE_PUBLIC,4,2    ## @WL12XX_SSID_TYPE_PUBLIC
	.comm	_WL12XX_SSID_TYPE_HIDDEN,4,2    ## @WL12XX_SSID_TYPE_HIDDEN
	.comm	_CONF_TX_ENABLED_RATES,4,2      ## @CONF_TX_ENABLED_RATES
	.comm	_CONF_TX_MCS_RATES,4,2          ## @CONF_TX_MCS_RATES
	.comm	_CONF_TX_CCK_RATES,4,2          ## @CONF_TX_CCK_RATES
L_.str.2:                               ## @.str.2
	.asciz	"cmd role start ap with supported_rates 0x%08x"

	.comm	_WLCORE_BAND_2_4GHZ,8,3         ## @WLCORE_BAND_2_4GHZ
	.comm	_WLCORE_BAND_5GHZ,8,3           ## @WLCORE_BAND_5GHZ
L_.str.3:                               ## @.str.3
	.asciz	"ap start - unknown band: %d"

	.comm	_CMD_ROLE_START,4,2             ## @CMD_ROLE_START
L_.str.4:                               ## @.str.4
	.asciz	"failed to initiate cmd role start ap"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wl12xx_cmd_role_start_ap       ; -- Begin function wl12xx_cmd_role_start_ap
	.p2align	2
_wl12xx_cmd_role_start_ap:              ; @wl12xx_cmd_role_start_ap
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x1
	mov	x20, x0
	mov	x0, x1
	bl	_wl12xx_wlvif_to_vif
	mov	x24, x0
Lloh0:
	adrp	x26, _DEBUG_CMD@GOTPAGE
Lloh1:
	ldr	x26, [x26, _DEBUG_CMD@GOTPAGEOFF]
	ldr	w0, [x26]
	ldr	w2, [x19]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	bl	_wl1271_debug
	mov	x0, x24
	bl	_ieee80211_vif_is_mesh
	cbnz	w0, LBB0_3
; %bb.1:
	ldr	x8, [x19, #40]
	cbnz	x8, LBB0_3
; %bb.2:
	ldr	w8, [x24, #12]
	cbz	w8, LBB0_23
LBB0_3:
Lloh4:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	mov	w0, #128
	bl	_kzalloc
	cbz	x0, LBB0_8
; %bb.4:
	mov	x21, x0
	add	x22, x19, #16
	mov	x0, x20
	mov	x1, x19
	mov	x2, x22
	bl	_wl12xx_allocate_link
	tbnz	w0, #31, LBB0_10
; %bb.5:
	add	x23, x19, #24
	mov	x0, x20
	mov	x1, x19
	mov	x2, x23
	bl	_wl12xx_allocate_link
	tbnz	w0, #31, LBB0_11
; %bb.6:
	ldr	w8, [x19, #68]
	ldr	x9, [x20, #16]
	ldr	x10, [x19, #24]
	str	w8, [x9, x10, lsl #2]
	ldr	w8, [x19]
	str	w8, [x21]
	ldr	w0, [x20, #8]
	bl	_cpu_to_le16
	str	x0, [x21, #112]
Lloh7:
	adrp	x8, _WL1271_AP_BSS_INDEX@GOTPAGE
Lloh8:
	ldr	x8, [x8, _WL1271_AP_BSS_INDEX@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	str	w8, [x21, #104]
	ldp	x8, x9, [x19, #16]
	ldr	x10, [x20]
	ldr	w11, [x10, x8, lsl #2]
	stp	x8, x9, [x21, #16]
	str	w11, [x21, #100]
	ldr	w8, [x10, x9, lsl #2]
	str	w8, [x21, #96]
	ldr	w0, [x19, #4]
	bl	_cpu_to_le32
	str	x0, [x21, #88]
	ldr	w0, [x19, #64]
	bl	_cpu_to_le16
	str	x0, [x21, #80]
	ldr	w8, [x24, #16]
	str	w8, [x21, #76]
Lloh10:
	adrp	x8, _WL1271_AP_DEF_BEACON_EXP@GOTPAGE
Lloh11:
	ldr	x8, [x8, _WL1271_AP_DEF_BEACON_EXP@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	mov	w9, #1
	str	w9, [x21, #32]
	ldr	w9, [x19, #60]
	stp	w9, w8, [x21, #68]
	ldp	w0, w8, [x19, #52]
	str	w8, [x21, #124]
	bl	_wlcore_get_native_channel_type
	str	w0, [x21, #120]
	ldr	w8, [x24, #12]
	cbz	w8, LBB0_12
; %bb.7:
Lloh13:
	adrp	x8, _WL12XX_SSID_TYPE_HIDDEN@GOTPAGE
Lloh14:
	ldr	x8, [x8, _WL12XX_SSID_TYPE_HIDDEN@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	str	w8, [x21, #64]
	ldr	x2, [x24]
	str	x2, [x21, #56]
	ldr	w0, [x21, #48]
	ldr	w1, [x24, #8]
	b	LBB0_13
LBB0_8:
Lloh16:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
	neg	w25, w8
	b	LBB0_22
LBB0_10:
	mov	x25, x0
	b	LBB0_21
LBB0_11:
	mov	x25, x0
	b	LBB0_20
LBB0_12:
Lloh18:
	adrp	x8, _WL12XX_SSID_TYPE_PUBLIC@GOTPAGE
Lloh19:
	ldr	x8, [x8, _WL12XX_SSID_TYPE_PUBLIC@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	str	w8, [x21, #64]
	ldr	x2, [x19, #40]
	str	x2, [x21, #56]
	ldr	w0, [x21, #48]
	ldr	w1, [x19, #48]
LBB0_13:
	bl	_memcpy
Lloh21:
	adrp	x8, _CONF_TX_ENABLED_RATES@GOTPAGE
Lloh22:
	ldr	x8, [x8, _CONF_TX_ENABLED_RATES@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
Lloh24:
	adrp	x9, _CONF_TX_MCS_RATES@GOTPAGE
Lloh25:
	ldr	x9, [x9, _CONF_TX_MCS_RATES@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	orr	w24, w9, w8
	mov	x0, x20
	mov	x1, x19
	bl	_wlcore_hw_ap_get_mimo_wide_rate_mask
	orr	w8, w24, w0
	ldr	x9, [x19, #32]
Lloh27:
	adrp	x10, _CONF_TX_CCK_RATES@GOTPAGE
Lloh28:
	ldr	x10, [x10, _CONF_TX_CCK_RATES@GOTPAGEOFF]
Lloh29:
	ldr	w10, [x10]
	cmp	x9, #0
	mov	w9, #-1
	csinv	w9, w9, w10, eq
	and	w24, w9, w8
	ldr	w0, [x26]
Lloh30:
	adrp	x1, l_.str.2@PAGE
Lloh31:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x2, x24
	bl	_wl1271_debug
	mov	x0, x24
	bl	_cpu_to_le32
	str	x0, [x21, #40]
	ldr	w1, [x19, #8]
	cmp	w1, #129
	b.eq	LBB0_17
; %bb.14:
	cmp	w1, #128
	b.ne	LBB0_16
; %bb.15:
Lloh32:
	adrp	x8, _WLCORE_BAND_5GHZ@GOTPAGE
Lloh33:
	ldr	x8, [x8, _WLCORE_BAND_5GHZ@GOTPAGEOFF]
	b	LBB0_18
LBB0_16:
Lloh34:
	adrp	x0, l_.str.3@PAGE
Lloh35:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_wl1271_warning
LBB0_17:
Lloh36:
	adrp	x8, _WLCORE_BAND_2_4GHZ@GOTPAGE
Lloh37:
	ldr	x8, [x8, _WLCORE_BAND_2_4GHZ@GOTPAGEOFF]
LBB0_18:
	ldr	x8, [x8]
	str	x8, [x21, #8]
Lloh38:
	adrp	x8, _CMD_ROLE_START@GOTPAGE
Lloh39:
	ldr	x8, [x8, _CMD_ROLE_START@GOTPAGEOFF]
Lloh40:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, x21
	mov	w3, #128
	mov	w4, #0
	bl	_wl1271_cmd_send
	mov	x25, x0
	tbz	w0, #31, LBB0_21
; %bb.19:
Lloh41:
	adrp	x0, l_.str.4@PAGE
Lloh42:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_wl1271_error
	mov	x0, x20
	mov	x1, x19
	mov	x2, x23
	bl	_wl12xx_free_link
LBB0_20:
	mov	x0, x20
	mov	x1, x19
	mov	x2, x22
	bl	_wl12xx_free_link
LBB0_21:
	mov	x0, x21
	bl	_kfree
LBB0_22:
	mov	x0, x25
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_23:
Lloh43:
	adrp	x0, l_.str.1@PAGE
Lloh44:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_wl1271_error
Lloh45:
	adrp	x8, _EINVAL@GOTPAGE
Lloh46:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_9
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpAdd	Lloh41, Lloh42
	.loh AdrpLdrGot	Lloh45, Lloh46
	.loh AdrpAdd	Lloh43, Lloh44
	.cfi_endproc
                                        ; -- End function
	.comm	_DEBUG_CMD,4,2                  ; @DEBUG_CMD
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cmd role start ap %d"

l_.str.1:                               ; @.str.1
	.asciz	"got a null SSID from beacon/bss"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_WL1271_AP_BSS_INDEX,4,2        ; @WL1271_AP_BSS_INDEX
	.comm	_WL1271_AP_DEF_BEACON_EXP,4,2   ; @WL1271_AP_DEF_BEACON_EXP
	.comm	_WL12XX_SSID_TYPE_PUBLIC,4,2    ; @WL12XX_SSID_TYPE_PUBLIC
	.comm	_WL12XX_SSID_TYPE_HIDDEN,4,2    ; @WL12XX_SSID_TYPE_HIDDEN
	.comm	_CONF_TX_ENABLED_RATES,4,2      ; @CONF_TX_ENABLED_RATES
	.comm	_CONF_TX_MCS_RATES,4,2          ; @CONF_TX_MCS_RATES
	.comm	_CONF_TX_CCK_RATES,4,2          ; @CONF_TX_CCK_RATES
l_.str.2:                               ; @.str.2
	.asciz	"cmd role start ap with supported_rates 0x%08x"

	.comm	_WLCORE_BAND_2_4GHZ,8,3         ; @WLCORE_BAND_2_4GHZ
	.comm	_WLCORE_BAND_5GHZ,8,3           ; @WLCORE_BAND_5GHZ
l_.str.3:                               ; @.str.3
	.asciz	"ap start - unknown band: %d"

	.comm	_CMD_ROLE_START,4,2             ; @CMD_ROLE_START
l_.str.4:                               ; @.str.4
	.asciz	"failed to initiate cmd role start ap"

.subsections_via_symbols
