	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mei_hdcp_initiate_session
_mei_hdcp_initiate_session:             ## @mei_hdcp_initiate_session
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	xorps	%xmm0, %xmm0
	movups	%xmm0, -88(%rbp)
	movups	%xmm0, -104(%rbp)
	movq	$0, -72(%rbp)
	movaps	%xmm0, -64(%rbp)
	movq	$0, -48(%rbp)
	testq	%rdi, %rdi
	je	LBB0_7
## %bb.1:
	movq	%rsi, %rbx
	testq	%rsi, %rsi
	je	LBB0_7
## %bb.2:
	movq	%rdx, %r14
	testq	%rdx, %rdx
	je	LBB0_7
## %bb.3:
	movq	%rdi, %r15
	callq	_to_mei_cl_device
	movq	%rax, %r12
	movq	_HDCP_API_VERSION@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -76(%rbp)
	movq	_WIRED_INITIATE_HDCP2_SESSION@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -80(%rbp)
	movq	_ME_HDCP_STATUS_SUCCESS@GOTPCREL(%rip), %r13
	movq	(%r13), %rax
	movq	%rax, -88(%rbp)
	movq	_WIRED_CMD_BUF_LEN_INITIATE_HDCP2_SESSION_IN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -96(%rbp)
	movl	8(%rbx), %eax
	movl	%eax, -104(%rbp)
	movl	4(%rbx), %edi
	callq	_mei_get_ddi_index
	movl	%eax, -108(%rbp)
	movl	(%rbx), %eax
	movl	%eax, -112(%rbp)
	leaq	-112(%rbp), %rsi
	movq	%r12, %rdi
	movl	$48, %edx
	callq	_mei_cldev_send
	testq	%rax, %rax
	js	LBB0_8
## %bb.4:
	leaq	-64(%rbp), %rsi
	movq	%r12, %rdi
	movl	$24, %edx
	callq	_mei_cldev_recv
	testq	%rax, %rax
	js	LBB0_9
## %bb.5:
	movq	-56(%rbp), %rcx
	cmpq	(%r13), %rcx
	jne	LBB0_11
## %bb.6:
	movq	_HDCP_2_2_AKE_INIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r14)
	movl	-60(%rbp), %eax
	movl	%eax, 4(%r14)
	movl	(%r14), %edi
	movl	-64(%rbp), %esi
	movq	_HDCP_2_2_RTX_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_memcpy
	xorl	%ebx, %ebx
	jmp	LBB0_13
LBB0_7:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
LBB0_12:
	subl	(%rax), %ebx
	jmp	LBB0_13
LBB0_8:
	movq	%rax, %rbx
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_10
LBB0_9:
	movq	%rax, %rbx
	leaq	L_.str.1(%rip), %rsi
LBB0_10:
	movq	%r15, %rdi
	movq	%rbx, %rdx
	xorl	%eax, %eax
	callq	_dev_dbg
LBB0_13:
	movl	%ebx, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movq	_WIRED_INITIATE_HDCP2_SESSION@GOTPCREL(%rip), %rax
	movslq	(%rax), %rdx
	leaq	L_.str.2(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_dev_dbg
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_HDCP_API_VERSION,4,2           ## @HDCP_API_VERSION
	.comm	_WIRED_INITIATE_HDCP2_SESSION,4,2 ## @WIRED_INITIATE_HDCP2_SESSION
	.comm	_ME_HDCP_STATUS_SUCCESS,8,3     ## @ME_HDCP_STATUS_SUCCESS
	.comm	_WIRED_CMD_BUF_LEN_INITIATE_HDCP2_SESSION_IN,4,2 ## @WIRED_CMD_BUF_LEN_INITIATE_HDCP2_SESSION_IN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"mei_cldev_send failed. %zd\n"

L_.str.1:                               ## @.str.1
	.asciz	"mei_cldev_recv failed. %zd\n"

L_.str.2:                               ## @.str.2
	.asciz	"ME cmd 0x%08X Failed. Status: 0x%X\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_HDCP_2_2_AKE_INIT,4,2          ## @HDCP_2_2_AKE_INIT
	.comm	_HDCP_2_2_RTX_LEN,4,2           ## @HDCP_2_2_RTX_LEN
	.no_dead_strip	_mei_hdcp_initiate_session
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mei_hdcp_initiate_session
_mei_hdcp_initiate_session:             ; @mei_hdcp_initiate_session
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	str	xzr, [sp, #72]
	movi.2d	v0, #0000000000000000
	stur	q0, [sp, #56]
	stur	q0, [sp, #40]
	stp	xzr, xzr, [sp, #8]
	str	xzr, [sp, #24]
	cbz	x0, LBB0_7
; %bb.1:
	mov	x21, x1
	cbz	x1, LBB0_7
; %bb.2:
	mov	x20, x2
	cbz	x2, LBB0_7
; %bb.3:
	mov	x19, x0
	bl	_to_mei_cl_device
	mov	x22, x0
Lloh0:
	adrp	x8, _HDCP_API_VERSION@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HDCP_API_VERSION@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x23, _WIRED_INITIATE_HDCP2_SESSION@GOTPAGE
Lloh4:
	ldr	x23, [x23, _WIRED_INITIATE_HDCP2_SESSION@GOTPAGEOFF]
	ldr	w9, [x23]
	stp	w9, w8, [sp, #64]
Lloh5:
	adrp	x24, _ME_HDCP_STATUS_SUCCESS@GOTPAGE
Lloh6:
	ldr	x24, [x24, _ME_HDCP_STATUS_SUCCESS@GOTPAGEOFF]
	ldr	x8, [x24]
Lloh7:
	adrp	x9, _WIRED_CMD_BUF_LEN_INITIATE_HDCP2_SESSION_IN@GOTPAGE
Lloh8:
	ldr	x9, [x9, _WIRED_CMD_BUF_LEN_INITIATE_HDCP2_SESSION_IN@GOTPAGEOFF]
	str	x8, [sp, #56]
Lloh9:
	ldr	w8, [x9]
	ldp	w0, w9, [x21, #4]
	str	w8, [sp, #48]
	str	w9, [sp, #40]
	bl	_mei_get_ddi_index
	ldr	w8, [x21]
	stp	w8, w0, [sp, #32]
	add	x1, sp, #32
	mov	x0, x22
	mov	w2, #48
	bl	_mei_cldev_send
	tbnz	x0, #63, LBB0_9
; %bb.4:
	add	x1, sp, #8
	mov	x0, x22
	mov	w2, #24
	bl	_mei_cldev_recv
	tbnz	x0, #63, LBB0_10
; %bb.5:
	ldr	x8, [sp, #16]
	ldr	x9, [x24]
	cmp	x8, x9
	b.ne	LBB0_12
; %bb.6:
Lloh10:
	adrp	x8, _HDCP_2_2_AKE_INIT@GOTPAGE
Lloh11:
	ldr	x8, [x8, _HDCP_2_2_AKE_INIT@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	ldp	w1, w9, [sp, #8]
	stp	w9, w8, [x20, #4]
	ldr	w0, [x20]
Lloh13:
	adrp	x8, _HDCP_2_2_RTX_LEN@GOTPAGE
Lloh14:
	ldr	x8, [x8, _HDCP_2_2_RTX_LEN@GOTPAGEOFF]
Lloh15:
	ldr	w2, [x8]
	bl	_memcpy
	mov	w21, #0
	b	LBB0_11
LBB0_7:
Lloh16:
	adrp	x8, _EINVAL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_11
LBB0_9:
	mov	x21, x0
Lloh18:
	adrp	x1, l_.str@PAGE
Lloh19:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x21
	bl	_dev_dbg
	b	LBB0_11
LBB0_10:
	mov	x21, x0
Lloh20:
	adrp	x1, l_.str.1@PAGE
Lloh21:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x2, x21
	bl	_dev_dbg
                                        ; kill: def $w21 killed $w21 killed $x21 def $x21
LBB0_11:
	mov	x0, x21
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_12:
	ldrsw	x2, [x23]
	str	x8, [sp]
Lloh22:
	adrp	x1, l_.str.2@PAGE
Lloh23:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_dev_dbg
Lloh24:
	adrp	x8, _EIO@GOTPAGE
Lloh25:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_HDCP_API_VERSION,4,2           ; @HDCP_API_VERSION
	.comm	_WIRED_INITIATE_HDCP2_SESSION,4,2 ; @WIRED_INITIATE_HDCP2_SESSION
	.comm	_ME_HDCP_STATUS_SUCCESS,8,3     ; @ME_HDCP_STATUS_SUCCESS
	.comm	_WIRED_CMD_BUF_LEN_INITIATE_HDCP2_SESSION_IN,4,2 ; @WIRED_CMD_BUF_LEN_INITIATE_HDCP2_SESSION_IN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"mei_cldev_send failed. %zd\n"

l_.str.1:                               ; @.str.1
	.asciz	"mei_cldev_recv failed. %zd\n"

l_.str.2:                               ; @.str.2
	.asciz	"ME cmd 0x%08X Failed. Status: 0x%X\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_HDCP_2_2_AKE_INIT,4,2          ; @HDCP_2_2_AKE_INIT
	.comm	_HDCP_2_2_RTX_LEN,4,2           ; @HDCP_2_2_RTX_LEN
	.no_dead_strip	_mei_hdcp_initiate_session
.subsections_via_symbols
