	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	___intel_wakeref_get_first      ## -- Begin function __intel_wakeref_get_first
	.p2align	4, 0x90
___intel_wakeref_get_first:             ## @__intel_wakeref_get_first
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	leaq	4(%rdi), %r14
	movq	_SINGLE_DEPTH_NESTING@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_mutex_lock_nested
	movq	%rbx, %rdi
	callq	_atomic_read
	testq	%rax, %rax
	je	LBB0_1
LBB0_3:
	movq	%rbx, %rdi
	callq	_atomic_inc
	movq	%r14, %rdi
	callq	_mutex_unlock
	movq	%rbx, %rdi
	callq	_atomic_read
	xorl	%edi, %edi
	testq	%rax, %rax
	setle	%dil
	callq	_INTEL_WAKEREF_BUG_ON
	xorl	%r15d, %r15d
	jmp	LBB0_4
LBB0_1:
	movq	%rbx, %rdi
	callq	_rpm_get
	movq	8(%rbx), %rax
	movq	%rbx, %rdi
	callq	*(%rax)
	movl	%eax, %r15d
	movl	%eax, %edi
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_2
## %bb.5:
	movq	%rbx, %rdi
	callq	_rpm_put
	movq	%r14, %rdi
	callq	_mutex_unlock
LBB0_4:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	xorl	%eax, %eax
	callq	_smp_mb__before_atomic
	jmp	LBB0_3
	.cfi_endproc
                                        ## -- End function
	.comm	_SINGLE_DEPTH_NESTING,4,2       ## @SINGLE_DEPTH_NESTING
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	___intel_wakeref_get_first      ; -- Begin function __intel_wakeref_get_first
	.p2align	2
___intel_wakeref_get_first:             ; @__intel_wakeref_get_first
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x19, x0
	add	x20, x0, #4
Lloh0:
	adrp	x8, _SINGLE_DEPTH_NESTING@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SINGLE_DEPTH_NESTING@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_mutex_lock_nested
	mov	x0, x19
	bl	_atomic_read
	cbz	x0, LBB0_2
LBB0_1:
	mov	x0, x19
	bl	_atomic_inc
	mov	x0, x20
	bl	_mutex_unlock
	mov	x0, x19
	bl	_atomic_read
	cmp	x0, #1
	cset	w0, lt
	bl	_INTEL_WAKEREF_BUG_ON
	mov	w21, #0
	b	LBB0_4
LBB0_2:
	mov	x0, x19
	bl	_rpm_get
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	mov	x0, x19
	blr	x8
	mov	x21, x0
	bl	_unlikely
	cbz	x0, LBB0_5
; %bb.3:
	mov	x0, x19
	bl	_rpm_put
	mov	x0, x20
	bl	_mutex_unlock
LBB0_4:
	mov	x0, x21
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_5:
	bl	_smp_mb__before_atomic
	b	LBB0_1
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_SINGLE_DEPTH_NESTING,4,2       ; @SINGLE_DEPTH_NESTING
.subsections_via_symbols
