	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wpan_phy_alloc                 ## -- Begin function wpan_phy_alloc
	.p2align	4, 0x90
_wpan_phy_alloc:                        ## @wpan_phy_alloc
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	addl	$24, %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_kzalloc
	movq	%rax, %rbx
	movq	_wpan_phy_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_lock
	movq	_wpan_phy_idx@GOTPCREL(%rip), %r14
	movslq	(%r14), %rdi
	leal	1(%rdi), %eax
	movl	%eax, (%r14)
	movq	%rdi, 8(%rbx)
	callq	_wpan_phy_idx_valid
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	decl	(%r14)
	movq	_wpan_phy_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	movq	%rbx, %rdi
	callq	_kfree
	xorl	%ebx, %ebx
	jmp	LBB0_3
LBB0_2:
	movq	_wpan_phy_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	movq	%rbx, %rdi
	addq	$16, %rdi
	callq	_mutex_init
	movq	%rbx, %rdi
	callq	_device_initialize
	movq	8(%rbx), %rdx
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_dev_set_name
	movq	_wpan_phy_class@GOTPCREL(%rip), %rax
	movq	%rax, (%rbx)
LBB0_3:
	movq	%rbx, %rax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_wpan_phy_mutex,4,2             ## @wpan_phy_mutex
	.comm	_wpan_phy_idx,4,2               ## @wpan_phy_idx
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"wpan-phy%d"

	.comm	_wpan_phy_class,4,2             ## @wpan_phy_class
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wpan_phy_alloc                 ; -- Begin function wpan_phy_alloc
	.p2align	2
_wpan_phy_alloc:                        ; @wpan_phy_alloc
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	add	w0, w0, #24
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_kzalloc
	mov	x19, x0
Lloh3:
	adrp	x0, _wpan_phy_mutex@GOTPAGE
Lloh4:
	ldr	x0, [x0, _wpan_phy_mutex@GOTPAGEOFF]
	bl	_mutex_lock
Lloh5:
	adrp	x20, _wpan_phy_idx@GOTPAGE
Lloh6:
	ldr	x20, [x20, _wpan_phy_idx@GOTPAGEOFF]
	ldrsw	x0, [x20]
	add	w8, w0, #1
	str	w8, [x20]
	str	x0, [x19, #8]
	bl	_wpan_phy_idx_valid
	cmp	w0, #0
	cset	w0, eq
	bl	_unlikely
	cbz	x0, LBB0_2
; %bb.1:
	ldr	w8, [x20]
	sub	w8, w8, #1
	str	w8, [x20]
Lloh7:
	adrp	x0, _wpan_phy_mutex@GOTPAGE
Lloh8:
	ldr	x0, [x0, _wpan_phy_mutex@GOTPAGEOFF]
	bl	_mutex_unlock
	mov	x0, x19
	bl	_kfree
	mov	x19, #0
	b	LBB0_3
LBB0_2:
Lloh9:
	adrp	x0, _wpan_phy_mutex@GOTPAGE
Lloh10:
	ldr	x0, [x0, _wpan_phy_mutex@GOTPAGEOFF]
	bl	_mutex_unlock
	add	x0, x19, #16
	bl	_mutex_init
	mov	x0, x19
	bl	_device_initialize
	ldr	x2, [x19, #8]
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_set_name
Lloh13:
	adrp	x8, _wpan_phy_class@GOTPAGE
Lloh14:
	ldr	x8, [x8, _wpan_phy_class@GOTPAGEOFF]
	str	x8, [x19]
LBB0_3:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_wpan_phy_mutex,4,2             ; @wpan_phy_mutex
	.comm	_wpan_phy_idx,4,2               ; @wpan_phy_idx
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"wpan-phy%d"

	.comm	_wpan_phy_class,4,2             ; @wpan_phy_class
.subsections_via_symbols
