	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wl12xx_allocate_link           ## -- Begin function wl12xx_allocate_link
	.p2align	4, 0x90
_wl12xx_allocate_link:                  ## @wl12xx_allocate_link
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movl	36(%rdi), %edi
	movq	(%rbx), %rsi
	callq	_find_first_zero_bit
	cmpq	(%rbx), %rax
	jae	LBB0_1
## %bb.2:
	movq	%rax, %r12
	movq	%rbx, %rdi
	movq	%rax, %rsi
	callq	_wlcore_get_new_session_id
	movq	40(%rbx), %rcx
	movl	%eax, (%rcx,%r12,4)
	leaq	32(%rbx), %r13
	movq	%r13, %rdi
	callq	_spin_lock_irqsave
	movl	36(%rbx), %esi
	movq	%r12, %rdi
	callq	___set_bit
	movl	12(%r15), %esi
	movq	%r12, %rdi
	callq	___set_bit
	movq	%r13, %rdi
	callq	_spin_unlock_irqrestore
	movq	24(%rbx), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movl	(%rax,%r12,4), %ecx
	movq	16(%rbx), %rax
	leaq	(%r12,%r12,2), %rdx
	movl	%ecx, 16(%rax,%rdx,8)
	jmp	LBB0_5
LBB0_1:
	movq	_EBUSY@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_8
LBB0_3:
	movq	16(%rbx), %rax
LBB0_5:
	leaq	(%r12,%r12,2), %rcx
	movq	%r15, 8(%rax,%rcx,8)
	movq	(%r15), %rdx
	movq	_BSS_TYPE_AP_BSS@GOTPCREL(%rip), %rsi
	cmpq	(%rsi), %rdx
	je	LBB0_7
## %bb.6:
	movl	8(%r15), %edx
	movl	%edx, (%rax,%rcx,8)
LBB0_7:
	movq	%r12, (%r14)
	incl	8(%rbx)
	xorl	%eax, %eax
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_BSS_TYPE_AP_BSS,8,3            ## @BSS_TYPE_AP_BSS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wl12xx_allocate_link           ; -- Begin function wl12xx_allocate_link
	.p2align	2
_wl12xx_allocate_link:                  ; @wl12xx_allocate_link
	.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	x20, x2
	mov	x21, x1
	mov	x19, x0
	ldr	w0, [x0, #36]
	ldr	x1, [x19]
	bl	_find_first_zero_bit
	ldr	x8, [x19]
	cmp	x0, x8
	b.hs	LBB0_3
; %bb.1:
	mov	x22, x0
	mov	x0, x19
	mov	x1, x22
	bl	_wlcore_get_new_session_id
	ldr	x8, [x19, #40]
	str	w0, [x8, x22, lsl #2]
	add	x23, x19, #32
	mov	x0, x23
	bl	_spin_lock_irqsave
	ldr	w1, [x19, #36]
	mov	x0, x22
	bl	___set_bit
	ldr	w1, [x21, #12]
	mov	x0, x22
	bl	___set_bit
	mov	x0, x23
	bl	_spin_unlock_irqrestore
	ldr	x8, [x19, #24]
	ldr	x8, [x8]
	cbz	x8, LBB0_4
; %bb.2:
	ldr	w9, [x8, x22, lsl #2]
	ldr	x8, [x19, #16]
	mov	w10, #24
	madd	x10, x22, x10, x8
	str	w9, [x10, #16]
	b	LBB0_5
LBB0_3:
Lloh0:
	adrp	x8, _EBUSY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_8
LBB0_4:
	ldr	x8, [x19, #16]
LBB0_5:
	mov	w9, #24
	madd	x9, x22, x9, x8
	str	x21, [x9, #8]
	ldr	x9, [x21]
Lloh3:
	adrp	x10, _BSS_TYPE_AP_BSS@GOTPAGE
Lloh4:
	ldr	x10, [x10, _BSS_TYPE_AP_BSS@GOTPAGEOFF]
Lloh5:
	ldr	x10, [x10]
	cmp	x9, x10
	b.eq	LBB0_7
; %bb.6:
	ldr	w9, [x21, #8]
	mov	w10, #24
	mul	x10, x22, x10
	str	w9, [x8, x10]
LBB0_7:
	mov	w0, #0
	str	x22, [x20]
	ldr	w8, [x19, #8]
	add	w8, w8, #1
	str	w8, [x19, #8]
LBB0_8:
	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	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_BSS_TYPE_AP_BSS,8,3            ; @BSS_TYPE_AP_BSS
.subsections_via_symbols
