	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function c4iw_allocate_pd
_c4iw_allocate_pd:                      ## @c4iw_allocate_pd
	.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	%rsi, %r15
	movq	%rdi, %rbx
	callq	_to_c4iw_pd
	movq	%rax, %r14
	movq	(%rbx), %rbx
	leaq	L_.str(%rip), %rdi
	xorl	%r13d, %r13d
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_pr_debug
	leaq	24(%rbx), %rdi
	callq	_c4iw_get_resource
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movl	%eax, %r12d
	movl	%eax, 4(%r14)
	movq	%rbx, 8(%r14)
	testq	%r15, %r15
	je	LBB0_5
## %bb.3:
	movl	%r12d, -48(%rbp)
	leaq	-48(%rbp), %rsi
	movq	%r15, %rdi
	movl	$4, %edx
	callq	_ib_copy_to_udata
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_c4iw_deallocate_pd
	movq	_EFAULT@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_8
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r13d
	jmp	LBB0_8
LBB0_5:
	movq	%rbx, %rdi
	callq	_mutex_lock
	movq	8(%rbx), %rcx
	leaq	1(%rcx), %rax
	movq	%rax, 8(%rbx)
	cmpq	16(%rbx), %rcx
	jl	LBB0_7
## %bb.6:
	movq	%rax, 16(%rbx)
LBB0_7:
	movq	%rbx, %rdi
	callq	_mutex_unlock
	leaq	L_.str.1(%rip), %rdi
	xorl	%r13d, %r13d
	movl	%r12d, %esi
	movq	%r14, %rdx
	xorl	%eax, %eax
	callq	_pr_debug
LBB0_8:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ibdev %p\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_EFAULT,4,2                     ## @EFAULT
L_.str.1:                               ## @.str.1
	.asciz	"pdid 0x%0x ptr 0x%p\n"

	.no_dead_strip	_c4iw_allocate_pd
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function c4iw_allocate_pd
_c4iw_allocate_pd:                      ; @c4iw_allocate_pd
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x22, x1
	mov	x20, x0
	bl	_to_c4iw_pd
	mov	x19, x0
	ldr	x20, [x20]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	bl	_pr_debug
	add	x0, x20, #24
	bl	_c4iw_get_resource
	cbz	w0, LBB0_4
; %bb.1:
	mov	x21, x0
	str	w0, [x19, #4]
	str	x20, [x19, #8]
	cbz	x22, LBB0_6
; %bb.2:
	str	w21, [sp, #8]
	add	x1, sp, #8
	mov	x0, x22
	mov	w2, #4
	bl	_ib_copy_to_udata
	cbz	x0, LBB0_6
; %bb.3:
	mov	x0, x19
	mov	x1, x22
	bl	_c4iw_deallocate_pd
Lloh2:
	adrp	x8, _EFAULT@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:
Lloh4:
	adrp	x8, _EINVAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_5:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_9
LBB0_6:
	mov	x0, x20
	bl	_mutex_lock
	ldp	x9, x10, [x20, #8]
	add	x8, x9, #1
	str	x8, [x20, #8]
	cmp	x9, x10
	b.lt	LBB0_8
; %bb.7:
	str	x8, [x20, #16]
LBB0_8:
	mov	x0, x20
	bl	_mutex_unlock
	str	x19, [sp]
Lloh6:
	adrp	x0, l_.str.1@PAGE
Lloh7:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x21
	bl	_pr_debug
	mov	w0, #0
LBB0_9:
	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
	add	sp, sp, #64
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ibdev %p\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_EFAULT,4,2                     ; @EFAULT
l_.str.1:                               ; @.str.1
	.asciz	"pdid 0x%0x ptr 0x%p\n"

	.no_dead_strip	_c4iw_allocate_pd
.subsections_via_symbols
