	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_t4_l2t_alloc_switching         ## -- Begin function t4_l2t_alloc_switching
	.p2align	4, 0x90
_t4_l2t_alloc_switching:                ## @t4_l2t_alloc_switching
	.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	%rcx, %rbx
	movl	%edx, %r13d
	movl	%esi, %r15d
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	(%rdi), %r14
	movq	%r14, %rdi
	callq	_write_lock_bh
	movq	%r14, %rdi
	movl	%r15d, %esi
	movl	%r13d, %edx
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rcx
	callq	_find_or_alloc_l2e
	movq	%rax, %r12
	testq	%rax, %rax
	je	LBB0_6
## %bb.1:
	movq	%rax, %rbx
	movq	%r12, %rdi
	callq	_spin_lock
	addq	$4, %rbx
	movq	%rbx, %rdi
	callq	_atomic_read
	testl	%eax, %eax
	je	LBB0_2
## %bb.4:
	movq	%rbx, %rdi
	callq	_atomic_inc
	movq	%r12, %rbx
	jmp	LBB0_5
LBB0_2:
	movq	_L2T_STATE_SWITCHING@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%r12)
	movl	%r15d, 16(%r12)
	movl	%r13d, 12(%r12)
	movl	8(%r12), %edi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_ether_addr_copy
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_atomic_set
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rsi
	xorl	%edx, %edx
	callq	_write_l2e
	movq	%r12, %rbx
	testl	%eax, %eax
	jns	LBB0_5
## %bb.3:
	movq	%r12, %rdi
	callq	__t4_l2e_free
	xorl	%ebx, %ebx
LBB0_5:
	movq	%r12, %rdi
	callq	_spin_unlock
	movq	%rbx, %r12
LBB0_6:
	movq	%r14, %rdi
	callq	_write_unlock_bh
	movq	%r12, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_L2T_STATE_SWITCHING,4,2        ## @L2T_STATE_SWITCHING
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_t4_l2t_alloc_switching         ; -- Begin function t4_l2t_alloc_switching
	.p2align	2
_t4_l2t_alloc_switching:                ; @t4_l2t_alloc_switching
	.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	x22, x3
	mov	x23, x2
	mov	x24, x1
	mov	x21, x0
	ldr	x19, [x0]
	mov	x0, x19
	bl	_write_lock_bh
	mov	x0, x19
	mov	x1, x24
	mov	x2, x23
	mov	x3, x22
	bl	_find_or_alloc_l2e
	mov	x20, x0
	cbz	x0, LBB0_6
; %bb.1:
	mov	x0, x20
	bl	_spin_lock
	add	x25, x20, #4
	mov	x0, x25
	bl	_atomic_read
	cbz	w0, LBB0_3
; %bb.2:
	mov	x0, x25
	bl	_atomic_inc
	mov	x21, x20
	b	LBB0_5
LBB0_3:
Lloh0:
	adrp	x8, _L2T_STATE_SWITCHING@GOTPAGE
Lloh1:
	ldr	x8, [x8, _L2T_STATE_SWITCHING@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	stp	w24, w8, [x20, #16]
	str	w23, [x20, #12]
	ldr	w0, [x20, #8]
	mov	x1, x22
	bl	_ether_addr_copy
	mov	x0, x25
	mov	w1, #1
	bl	_atomic_set
	mov	x0, x21
	mov	x1, x20
	mov	w2, #0
	bl	_write_l2e
	mov	x21, x20
	tbz	w0, #31, LBB0_5
; %bb.4:
	mov	x0, x20
	bl	__t4_l2e_free
	mov	x21, #0
LBB0_5:
	mov	x0, x20
	bl	_spin_unlock
	mov	x20, x21
LBB0_6:
	mov	x0, x19
	bl	_write_unlock_bh
	mov	x0, x20
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_L2T_STATE_SWITCHING,4,2        ; @L2T_STATE_SWITCHING
.subsections_via_symbols
