	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_qed_mcp_resc_unlock            ## -- Begin function qed_mcp_resc_unlock
	.p2align	4, 0x90
_qed_mcp_resc_unlock:                   ## @qed_mcp_resc_unlock
	.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, %r12
	movq	%rsi, %r15
	movq	%rdi, %r14
	cmpq	$0, 8(%rdx)
	jne	LBB0_1
## %bb.2:
	movq	_RESOURCE_OPCODE_RELEASE@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_RESOURCE_OPCODE_FORCE_RELEASE@GOTPCREL(%rip), %rax
LBB0_3:
	movl	(%rax), %ebx
	movq	_RESOURCE_CMD_REQ_RESC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r12), %edx
	xorl	%edi, %edi
	callq	_QED_MFW_SET_FIELD
	movq	_RESOURCE_CMD_REQ_OPCODE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edi, %edi
	movl	%ebx, %edx
	callq	_QED_MFW_SET_FIELD
	movq	_QED_MSG_SP@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movl	(%r12), %r9d
	leaq	L_.str(%rip), %rdx
	movq	%r14, %rdi
	xorl	%ecx, %ecx
	movl	%ebx, %r8d
	xorl	%eax, %eax
	callq	_DP_VERBOSE
	leaq	-48(%rbp), %rcx
	leaq	-44(%rbp), %r8
	movq	%r14, %rdi
	movq	%r15, %rsi
	xorl	%edx, %edx
	callq	_qed_mcp_resource_cmd
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_11
## %bb.4:
	movl	-44(%rbp), %edi
	movq	_RESOURCE_CMD_RSP_OPCODE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_QED_MFW_GET_FIELD
	movl	%eax, %r15d
	movl	(%r13), %esi
	movl	-44(%rbp), %ecx
	leaq	L_.str.1(%rip), %rdx
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	movl	%eax, %r8d
	xorl	%eax, %eax
	callq	_DP_VERBOSE
	cmpl	$128, %r15d
	je	LBB0_9
## %bb.5:
	cmpl	$130, %r15d
	je	LBB0_8
## %bb.6:
	cmpl	$129, %r15d
	jne	LBB0_10
## %bb.7:
	movl	(%r12), %edx
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	callq	_DP_INFO
LBB0_8:
	movl	$1, 4(%r12)
	xorl	%ebx, %ebx
	jmp	LBB0_11
LBB0_9:
	movl	$0, 4(%r12)
	jmp	LBB0_11
LBB0_10:
	movl	-44(%rbp), %edx
	leaq	L_.str.3(%rip), %rsi
	movq	%r14, %rdi
	movl	%r15d, %ecx
	callq	_DP_NOTICE
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_11:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RESOURCE_OPCODE_FORCE_RELEASE,4,2 ## @RESOURCE_OPCODE_FORCE_RELEASE
	.comm	_RESOURCE_OPCODE_RELEASE,4,2    ## @RESOURCE_OPCODE_RELEASE
	.comm	_RESOURCE_CMD_REQ_RESC,4,2      ## @RESOURCE_CMD_REQ_RESC
	.comm	_RESOURCE_CMD_REQ_OPCODE,4,2    ## @RESOURCE_CMD_REQ_OPCODE
	.comm	_QED_MSG_SP,4,2                 ## @QED_MSG_SP
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Resource unlock request: param 0x%08x [opcode %d, resource %d]\n"

	.comm	_RESOURCE_CMD_RSP_OPCODE,4,2    ## @RESOURCE_CMD_RSP_OPCODE
L_.str.1:                               ## @.str.1
	.asciz	"Resource unlock response: mcp_param 0x%08x [opcode %d]\n"

L_.str.2:                               ## @.str.2
	.asciz	"Resource unlock request for an already released resource [%d]\n"

L_.str.3:                               ## @.str.3
	.asciz	"Unexpected opcode in resource unlock response [mcp_param 0x%08x, opcode %d]\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_qed_mcp_resc_unlock            ; -- Begin function qed_mcp_resc_unlock
	.p2align	2
_qed_mcp_resc_unlock:                   ; @qed_mcp_resc_unlock
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x19, x2
	mov	x21, x1
	mov	x20, x0
	ldr	x8, [x2, #8]
Lloh0:
	adrp	x9, _RESOURCE_OPCODE_FORCE_RELEASE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _RESOURCE_OPCODE_FORCE_RELEASE@GOTPAGEOFF]
Lloh2:
	adrp	x10, _RESOURCE_OPCODE_RELEASE@GOTPAGE
Lloh3:
	ldr	x10, [x10, _RESOURCE_OPCODE_RELEASE@GOTPAGEOFF]
	cmp	x8, #0
	csel	x8, x10, x9, eq
	ldr	w22, [x8]
Lloh4:
	adrp	x8, _RESOURCE_CMD_REQ_RESC@GOTPAGE
Lloh5:
	ldr	x8, [x8, _RESOURCE_CMD_REQ_RESC@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	ldr	w2, [x2]
	mov	w0, #0
	bl	_QED_MFW_SET_FIELD
Lloh7:
	adrp	x8, _RESOURCE_CMD_REQ_OPCODE@GOTPAGE
Lloh8:
	ldr	x8, [x8, _RESOURCE_CMD_REQ_OPCODE@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	w0, #0
	mov	x2, x22
	bl	_QED_MFW_SET_FIELD
Lloh10:
	adrp	x23, _QED_MSG_SP@GOTPAGE
Lloh11:
	ldr	x23, [x23, _QED_MSG_SP@GOTPAGEOFF]
	ldr	w1, [x23]
	ldr	w8, [x19]
Lloh12:
	adrp	x2, l_.str@PAGE
Lloh13:
	add	x2, x2, l_.str@PAGEOFF
	str	x8, [sp]
	mov	x0, x20
	mov	w3, #0
	mov	x4, x22
	bl	_DP_VERBOSE
	add	x3, sp, #12
	add	x4, sp, #8
	mov	x0, x20
	mov	x1, x21
	mov	w2, #0
	bl	_qed_mcp_resource_cmd
	cbnz	w0, LBB0_8
; %bb.1:
	ldr	w0, [sp, #8]
Lloh14:
	adrp	x8, _RESOURCE_CMD_RSP_OPCODE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _RESOURCE_CMD_RSP_OPCODE@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	bl	_QED_MFW_GET_FIELD
	mov	x21, x0
	ldr	w1, [x23]
	ldr	w3, [sp, #8]
Lloh17:
	adrp	x2, l_.str.1@PAGE
Lloh18:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x20
	mov	x4, x21
	bl	_DP_VERBOSE
	cmp	w21, #128
	b.eq	LBB0_6
; %bb.2:
	cmp	w21, #130
	b.eq	LBB0_5
; %bb.3:
	cmp	w21, #129
	b.ne	LBB0_7
; %bb.4:
	ldr	w2, [x19]
Lloh19:
	adrp	x1, l_.str.2@PAGE
Lloh20:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x20
	bl	_DP_INFO
LBB0_5:
	mov	w0, #0
	mov	w8, #1
	str	w8, [x19, #4]
	b	LBB0_8
LBB0_6:
	mov	w0, #0
	str	wzr, [x19, #4]
	b	LBB0_8
LBB0_7:
	ldr	w2, [sp, #8]
Lloh21:
	adrp	x1, l_.str.3@PAGE
Lloh22:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x20
	mov	x3, x21
	bl	_DP_NOTICE
Lloh23:
	adrp	x8, _EINVAL@GOTPAGE
Lloh24:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	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
	add	sp, sp, #80
	ret
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_RESOURCE_OPCODE_FORCE_RELEASE,4,2 ; @RESOURCE_OPCODE_FORCE_RELEASE
	.comm	_RESOURCE_OPCODE_RELEASE,4,2    ; @RESOURCE_OPCODE_RELEASE
	.comm	_RESOURCE_CMD_REQ_RESC,4,2      ; @RESOURCE_CMD_REQ_RESC
	.comm	_RESOURCE_CMD_REQ_OPCODE,4,2    ; @RESOURCE_CMD_REQ_OPCODE
	.comm	_QED_MSG_SP,4,2                 ; @QED_MSG_SP
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Resource unlock request: param 0x%08x [opcode %d, resource %d]\n"

	.comm	_RESOURCE_CMD_RSP_OPCODE,4,2    ; @RESOURCE_CMD_RSP_OPCODE
l_.str.1:                               ; @.str.1
	.asciz	"Resource unlock response: mcp_param 0x%08x [opcode %d]\n"

l_.str.2:                               ; @.str.2
	.asciz	"Resource unlock request for an already released resource [%d]\n"

l_.str.3:                               ; @.str.3
	.asciz	"Unexpected opcode in resource unlock response [mcp_param 0x%08x, opcode %d]\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
.subsections_via_symbols
