	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wl1251_cmd_join                ## -- Begin function wl1251_cmd_join
	.p2align	4, 0x90
_wl1251_cmd_join:                       ## @wl1251_cmd_join
	.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
	movq	%r8, %r15
	movl	%ecx, %r13d
	movq	%rdx, %rbx
	movq	%rsi, %r14
	movq	%rdi, -80(%rbp)                 ## 8-byte Spill
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$48, %edi
	callq	_kzalloc
	movq	%rax, %r12
	testq	%rax, %rax
	je	LBB0_11
## %bb.1:
	movq	_DEBUG_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_BSS_TYPE_IBSS@GOTPCREL(%rip), %rax
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	cmpq	%r14, (%rax)
	leaq	L_.str.1(%rip), %rax
	leaq	L_.str.2(%rip), %rdx
	cmoveq	%rax, %rdx
	leaq	L_.str(%rip), %rsi
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rcx
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
	movl	%r13d, %r8d
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movq	%r15, %r9
	callq	_wl1251_debug
	movq	_ETH_ALEN@GOTPCREL(%rip), %rax
	movl	(%rax), %r10d
	testl	%r10d, %r10d
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	jle	LBB0_9
## %bb.2:
	movq	(%rdi), %rcx
	cmpl	$4, %r10d
	jae	LBB0_13
LBB0_3:
	xorl	%r9d, %r9d
LBB0_4:
	movq	%r9, %rsi
	notq	%rsi
	testb	$1, %r10b
	je	LBB0_6
## %bb.5:
	movl	%r9d, %edx
	notl	%edx
	addl	%r10d, %edx
	movslq	%edx, %rdx
	movq	(%rcx,%rdx,8), %rdx
	movq	%rdx, 44(%r12,%r9,8)
	orq	$1, %r9
LBB0_6:
	addq	%r10, %rsi
	je	LBB0_9
## %bb.7:
	movl	%r10d, %edx
	subq	%r9, %r10
	movl	%r9d, %esi
	notl	%esi
	addl	%edx, %esi
	leaq	(%r12,%r9,8), %rdx
	addq	$52, %rdx
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movslq	%esi, %rsi
	movq	(%rcx,%rsi,8), %rbx
	movq	%rbx, -8(%rdx,%rax,8)
	leal	-1(%rsi), %ebx
	movslq	%ebx, %rbx
	movq	(%rcx,%rbx,8), %rbx
	movq	%rbx, (%rdx,%rax,8)
	addq	$2, %rax
	addl	$-2, %esi
	cmpq	%rax, %r10
	jne	LBB0_8
LBB0_9:
	movl	12(%rdi), %eax
	movl	%eax, 40(%r12)
	movl	8(%rdi), %eax
	movl	%eax, 36(%r12)
	movq	_RATE_MASK_1MBPS@GOTPCREL(%rip), %rax
	movq	_RATE_MASK_2MBPS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_RATE_MASK_5_5MBPS@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movq	_RATE_MASK_11MBPS@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movl	%ecx, (%r12)
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 32(%r12)
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 24(%r12)
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 16(%r12)
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 8(%r12)
	movq	_JOIN_CMD_CTRL_TX_FLUSH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%r12)
	movq	_CMD_START_JOIN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdx
	movl	$48, %ecx
	callq	_wl1251_cmd_send
	movl	%eax, %ebx
	testl	%eax, %eax
	jns	LBB0_12
## %bb.10:
	leaq	L_.str.3(%rip), %rdi
	callq	_wl1251_error
	jmp	LBB0_12
LBB0_11:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_12:
	movq	%r12, %rdi
	callq	_kfree
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	leaq	-1(%r10), %rsi
	leal	-1(%r10), %ebx
	movl	%ebx, %eax
	subl	%esi, %eax
	xorl	%r9d, %r9d
	cmpl	%ebx, %eax
	jg	LBB0_4
## %bb.14:
	shrq	$32, %rsi
	jne	LBB0_4
## %bb.15:
	leaq	44(%r12), %rsi
	leal	-1(%r10), %edx
	movslq	%edx, %rdx
	leaq	(%rcx,%rdx,8), %rax
	addq	$8, %rax
	cmpq	%rax, %rsi
	jae	LBB0_18
## %bb.16:
	leaq	(%r12,%r10,8), %rsi
	addq	$44, %rsi
	incq	%rdx
	subq	%r10, %rdx
	leaq	(%rcx,%rdx,8), %rdx
	cmpq	%rdx, %rsi
	ja	LBB0_3
LBB0_18:
	movl	%r10d, %r9d
	andl	$-4, %r9d
	leaq	-4(%r9), %rsi
	movq	%rsi, %r8
	shrq	$2, %r8
	incq	%r8
	testq	%rsi, %rsi
	je	LBB0_24
## %bb.19:
	movq	%r8, %rax
	andq	$-2, %rax
	leal	-5(%r10), %ebx
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_20:                                ## =>This Inner Loop Header: Depth=1
	leal	4(%rbx), %edx
	movslq	%edx, %rdx
	movdqu	-24(%rcx,%rdx,8), %xmm0
	movdqu	-8(%rcx,%rdx,8), %xmm1
	pshufd	$78, %xmm1, %xmm1               ## xmm1 = xmm1[2,3,0,1]
	pshufd	$78, %xmm0, %xmm0               ## xmm0 = xmm0[2,3,0,1]
	movdqu	%xmm1, 44(%r12,%rsi,8)
	movdqu	%xmm0, 60(%r12,%rsi,8)
	movslq	%ebx, %rbx
	movdqu	-24(%rcx,%rbx,8), %xmm0
	movdqu	-8(%rcx,%rbx,8), %xmm1
	pshufd	$78, %xmm1, %xmm1               ## xmm1 = xmm1[2,3,0,1]
	pshufd	$78, %xmm0, %xmm0               ## xmm0 = xmm0[2,3,0,1]
	movdqu	%xmm1, 76(%r12,%rsi,8)
	movdqu	%xmm0, 92(%r12,%rsi,8)
	addq	$8, %rsi
	addl	$-8, %ebx
	addq	$-2, %rax
	jne	LBB0_20
## %bb.21:
	testb	$1, %r8b
	je	LBB0_23
LBB0_22:
	movl	%esi, %edx
	notl	%edx
	addl	%r10d, %edx
	movslq	%edx, %rdx
	movdqu	-24(%rcx,%rdx,8), %xmm0
	movdqu	-8(%rcx,%rdx,8), %xmm1
	pshufd	$78, %xmm1, %xmm1               ## xmm1 = xmm1[2,3,0,1]
	pshufd	$78, %xmm0, %xmm0               ## xmm0 = xmm0[2,3,0,1]
	movdqu	%xmm1, 44(%r12,%rsi,8)
	movdqu	%xmm0, 60(%r12,%rsi,8)
LBB0_23:
	cmpq	%r10, %r9
	jne	LBB0_4
	jmp	LBB0_9
LBB0_24:
	xorl	%esi, %esi
	testb	$1, %r8b
	jne	LBB0_22
	jmp	LBB0_23
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_DEBUG_CMD,4,2                  ## @DEBUG_CMD
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"cmd join%s ch %d %d/%d"

	.comm	_BSS_TYPE_IBSS,8,3              ## @BSS_TYPE_IBSS
L_.str.1:                               ## @.str.1
	.asciz	" ibss"

L_.str.2:                               ## @.str.2
	.space	1

	.comm	_ETH_ALEN,4,2                   ## @ETH_ALEN
	.comm	_RATE_MASK_1MBPS,4,2            ## @RATE_MASK_1MBPS
	.comm	_RATE_MASK_2MBPS,4,2            ## @RATE_MASK_2MBPS
	.comm	_RATE_MASK_5_5MBPS,4,2          ## @RATE_MASK_5_5MBPS
	.comm	_RATE_MASK_11MBPS,4,2           ## @RATE_MASK_11MBPS
	.comm	_JOIN_CMD_CTRL_TX_FLUSH,4,2     ## @JOIN_CMD_CTRL_TX_FLUSH
	.comm	_CMD_START_JOIN,4,2             ## @CMD_START_JOIN
L_.str.3:                               ## @.str.3
	.asciz	"failed to initiate cmd join"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wl1251_cmd_join                ; -- Begin function wl1251_cmd_join
	.p2align	2
_wl1251_cmd_join:                       ; @wl1251_cmd_join
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x23, x4
	mov	x24, x3
	mov	x21, x2
	mov	x22, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #48
	bl	_kzalloc
	mov	x19, x0
	cbz	x0, LBB0_8
; %bb.1:
Lloh3:
	adrp	x8, _DEBUG_CMD@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DEBUG_CMD@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
Lloh6:
	adrp	x8, _BSS_TYPE_IBSS@GOTPAGE
Lloh7:
	ldr	x8, [x8, _BSS_TYPE_IBSS@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
Lloh9:
	adrp	x9, l_.str.2@PAGE
Lloh10:
	add	x9, x9, l_.str.2@PAGEOFF
Lloh11:
	adrp	x10, l_.str.1@PAGE
Lloh12:
	add	x10, x10, l_.str.1@PAGEOFF
	cmp	x8, x22
	csel	x2, x10, x9, eq
Lloh13:
	adrp	x1, l_.str@PAGE
Lloh14:
	add	x1, x1, l_.str@PAGEOFF
	mov	x3, x21
	mov	x4, x24
	mov	x5, x23
	bl	_wl1251_debug
Lloh15:
	adrp	x8, _ETH_ALEN@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ETH_ALEN@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x8]
	cmp	w9, #1
	b.lt	LBB0_12
; %bb.2:
	ldr	x8, [x20]
	cmp	w9, #8
	b.lo	LBB0_9
; %bb.3:
	sub	x10, x9, #1
	sub	w11, w9, #1
	sub	w12, w11, w10
	cmp	w12, w11
	lsr	x11, x10, #32
	ccmp	x11, #0, #0, le
	b.ne	LBB0_9
; %bb.4:
	add	x11, x19, #44
	add	x12, x19, x9, lsl #3
	add	x12, x12, #44
	sub	w13, w9, #1
	sxtw	x13, w13
	add	x13, x13, #1
	sub	x14, x13, x9
	add	x14, x8, x14, lsl #3
	add	x13, x8, x13, lsl #3
	cmp	x11, x13
	ccmp	x12, x14, #0, lo
	b.hi	LBB0_9
; %bb.5:
	and	x11, x9, #0xfffffff8
	add	x12, x19, #92
	mov	x13, x11
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	add	x14, x8, w10, sxtw #3
	ldur	q0, [x14, #-8]
	ext.16b	v0, v0, v0, #8
	ldur	q1, [x14, #-24]
	ext.16b	v1, v1, v1, #8
	ldur	q2, [x14, #-40]
	ext.16b	v2, v2, v2, #8
	ldur	q3, [x14, #-56]
	ext.16b	v3, v3, v3, #8
	stp	q0, q1, [x12, #-48]
	stp	q2, q3, [x12, #-16]
	add	x12, x12, #64
	sub	w10, w10, #8
	sub	x13, x13, #8
	cbnz	x13, LBB0_6
; %bb.7:
	cmp	x11, x9
	b.ne	LBB0_10
	b	LBB0_12
LBB0_8:
Lloh18:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_14
LBB0_9:
	mov	x11, #0
LBB0_10:
	mvn	w10, w11
	add	w10, w10, w9
	add	x12, x19, x11, lsl #3
	add	x12, x12, #44
	sub	x9, x9, x11
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	x11, [x8, w10, sxtw #3]
	str	x11, [x12], #8
	sub	w10, w10, #1
	subs	x9, x9, #1
	b.ne	LBB0_11
LBB0_12:
	ldr	d0, [x20, #8]
	stur	d0, [x19, #36]
Lloh21:
	adrp	x8, _RATE_MASK_1MBPS@GOTPAGE
Lloh22:
	ldr	x8, [x8, _RATE_MASK_1MBPS@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
Lloh24:
	adrp	x9, _RATE_MASK_2MBPS@GOTPAGE
Lloh25:
	ldr	x9, [x9, _RATE_MASK_2MBPS@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh27:
	adrp	x9, _RATE_MASK_5_5MBPS@GOTPAGE
Lloh28:
	ldr	x9, [x9, _RATE_MASK_5_5MBPS@GOTPAGEOFF]
Lloh29:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh30:
	adrp	x9, _RATE_MASK_11MBPS@GOTPAGE
Lloh31:
	ldr	x9, [x9, _RATE_MASK_11MBPS@GOTPAGEOFF]
Lloh32:
	ldr	w9, [x9]
	orr	w8, w8, w9
	str	w8, [x19]
	str	w24, [x19, #32]
	str	x23, [x19, #24]
Lloh33:
	adrp	x8, _JOIN_CMD_CTRL_TX_FLUSH@GOTPAGE
Lloh34:
	ldr	x8, [x8, _JOIN_CMD_CTRL_TX_FLUSH@GOTPAGEOFF]
	stp	x21, x22, [x19, #8]
Lloh35:
	ldr	w8, [x8]
	str	w8, [x19, #4]
Lloh36:
	adrp	x8, _CMD_START_JOIN@GOTPAGE
Lloh37:
	ldr	x8, [x8, _CMD_START_JOIN@GOTPAGEOFF]
Lloh38:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, x19
	mov	w3, #48
	bl	_wl1251_cmd_send
	mov	x20, x0
	tbz	w0, #31, LBB0_14
; %bb.13:
Lloh39:
	adrp	x0, l_.str.3@PAGE
Lloh40:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_wl1251_error
LBB0_14:
	mov	x0, x19
	bl	_kfree
	mov	x0, x20
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh39, Lloh40
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_DEBUG_CMD,4,2                  ; @DEBUG_CMD
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cmd join%s ch %d %d/%d"

	.comm	_BSS_TYPE_IBSS,8,3              ; @BSS_TYPE_IBSS
l_.str.1:                               ; @.str.1
	.asciz	" ibss"

l_.str.2:                               ; @.str.2
	.space	1

	.comm	_ETH_ALEN,4,2                   ; @ETH_ALEN
	.comm	_RATE_MASK_1MBPS,4,2            ; @RATE_MASK_1MBPS
	.comm	_RATE_MASK_2MBPS,4,2            ; @RATE_MASK_2MBPS
	.comm	_RATE_MASK_5_5MBPS,4,2          ; @RATE_MASK_5_5MBPS
	.comm	_RATE_MASK_11MBPS,4,2           ; @RATE_MASK_11MBPS
	.comm	_JOIN_CMD_CTRL_TX_FLUSH,4,2     ; @JOIN_CMD_CTRL_TX_FLUSH
	.comm	_CMD_START_JOIN,4,2             ; @CMD_START_JOIN
l_.str.3:                               ; @.str.3
	.asciz	"failed to initiate cmd join"

.subsections_via_symbols
