	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function intel_hdcp_load_keys
_intel_hdcp_load_keys:                  ## @intel_hdcp_load_keys
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_HDCP_KEY_STATUS@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	callq	_I915_READ
	movl	%eax, -36(%rbp)
	movq	_HDCP_KEY_LOAD_DONE@GOTPCREL(%rip), %r12
	testl	%eax, (%r12)
	je	LBB0_2
## %bb.1:
	movq	_HDCP_KEY_LOAD_STATUS@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	testl	%eax, (%rcx)
	jne	LBB0_13
LBB0_2:
	movq	%r14, %rdi
	callq	_IS_HASWELL
	testq	%rax, %rax
	jne	LBB0_4
## %bb.3:
	movq	%r14, %rdi
	callq	_IS_BROADWELL
	testq	%rax, %rax
	je	LBB0_6
LBB0_4:
	movl	(%r15), %edi
	callq	_I915_READ
	testl	%eax, (%r12)
	je	LBB0_5
LBB0_6:
	movq	%r14, %rdi
	callq	_IS_GEN9_BC
	testq	%rax, %rax
	je	LBB0_9
## %bb.7:
	movq	_SKL_PCODE_LOAD_HDCP_KEYS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	$1, %edx
	callq	_sandybridge_pcode_write
	testl	%eax, %eax
	je	LBB0_10
## %bb.8:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_DRM_ERROR
	jmp	LBB0_13
LBB0_9:
	movq	_HDCP_KEY_CONF@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_HDCP_KEY_LOAD_TRIGGER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_I915_WRITE
LBB0_10:
	movl	(%r15), %esi
	movl	(%r12), %ecx
	leaq	-36(%rbp), %rax
	movq	%rax, (%rsp)
	movq	%r14, %rdi
	movl	%ecx, %edx
	movl	$10, %r8d
	movl	$1, %r9d
	callq	___intel_wait_for_register
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_13
## %bb.11:
	movq	_HDCP_KEY_LOAD_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, -36(%rbp)
	je	LBB0_5
## %bb.12:
	movq	_HDCP_KEY_CONF@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_HDCP_AKSV_SEND_TRIGGER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_I915_WRITE
	xorl	%ebx, %ebx
	jmp	LBB0_13
LBB0_5:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_13:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HDCP_KEY_STATUS,4,2            ## @HDCP_KEY_STATUS
	.comm	_HDCP_KEY_LOAD_DONE,4,2         ## @HDCP_KEY_LOAD_DONE
	.comm	_HDCP_KEY_LOAD_STATUS,4,2       ## @HDCP_KEY_LOAD_STATUS
	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_SKL_PCODE_LOAD_HDCP_KEYS,4,2   ## @SKL_PCODE_LOAD_HDCP_KEYS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to initiate HDCP key load (%d)\n"

	.comm	_HDCP_KEY_CONF,4,2              ## @HDCP_KEY_CONF
	.comm	_HDCP_KEY_LOAD_TRIGGER,4,2      ## @HDCP_KEY_LOAD_TRIGGER
	.comm	_HDCP_AKSV_SEND_TRIGGER,4,2     ## @HDCP_AKSV_SEND_TRIGGER
	.no_dead_strip	_intel_hdcp_load_keys
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function intel_hdcp_load_keys
_intel_hdcp_load_keys:                  ; @intel_hdcp_load_keys
	.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	x19, x0
Lloh0:
	adrp	x21, _HDCP_KEY_STATUS@GOTPAGE
Lloh1:
	ldr	x21, [x21, _HDCP_KEY_STATUS@GOTPAGEOFF]
	ldr	w0, [x21]
	bl	_I915_READ
	str	w0, [sp, #12]
Lloh2:
	adrp	x22, _HDCP_KEY_LOAD_DONE@GOTPAGE
Lloh3:
	ldr	x22, [x22, _HDCP_KEY_LOAD_DONE@GOTPAGEOFF]
	ldr	w8, [x22]
	tst	w8, w0
	b.eq	LBB0_3
; %bb.1:
Lloh4:
	adrp	x8, _HDCP_KEY_LOAD_STATUS@GOTPAGE
Lloh5:
	ldr	x8, [x8, _HDCP_KEY_LOAD_STATUS@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_3
LBB0_2:
	mov	w20, #0
	b	LBB0_14
LBB0_3:
	mov	x0, x19
	bl	_IS_HASWELL
	cbnz	x0, LBB0_5
; %bb.4:
	mov	x0, x19
	bl	_IS_BROADWELL
	cbz	x0, LBB0_6
LBB0_5:
	ldr	w0, [x21]
	bl	_I915_READ
	ldr	w8, [x22]
	tst	w8, w0
	b.eq	LBB0_13
LBB0_6:
	mov	x0, x19
	bl	_IS_GEN9_BC
	cbz	x0, LBB0_9
; %bb.7:
Lloh7:
	adrp	x8, _SKL_PCODE_LOAD_HDCP_KEYS@GOTPAGE
Lloh8:
	ldr	x8, [x8, _SKL_PCODE_LOAD_HDCP_KEYS@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #1
	bl	_sandybridge_pcode_write
	cbz	w0, LBB0_10
; %bb.8:
	mov	x20, x0
Lloh10:
	adrp	x0, l_.str@PAGE
Lloh11:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	bl	_DRM_ERROR
	b	LBB0_14
LBB0_9:
Lloh12:
	adrp	x8, _HDCP_KEY_CONF@GOTPAGE
Lloh13:
	ldr	x8, [x8, _HDCP_KEY_CONF@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
Lloh15:
	adrp	x8, _HDCP_KEY_LOAD_TRIGGER@GOTPAGE
Lloh16:
	ldr	x8, [x8, _HDCP_KEY_LOAD_TRIGGER@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	bl	_I915_WRITE
LBB0_10:
	ldr	w1, [x21]
	ldr	w2, [x22]
	add	x6, sp, #12
	mov	x0, x19
	mov	x3, x2
	mov	w4, #10
	mov	w5, #1
	bl	___intel_wait_for_register
	mov	x20, x0
	cbnz	w0, LBB0_14
; %bb.11:
	ldr	w8, [sp, #12]
Lloh18:
	adrp	x9, _HDCP_KEY_LOAD_STATUS@GOTPAGE
Lloh19:
	ldr	x9, [x9, _HDCP_KEY_LOAD_STATUS@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_13
; %bb.12:
Lloh21:
	adrp	x8, _HDCP_KEY_CONF@GOTPAGE
Lloh22:
	ldr	x8, [x8, _HDCP_KEY_CONF@GOTPAGEOFF]
Lloh23:
	ldr	w0, [x8]
Lloh24:
	adrp	x8, _HDCP_AKSV_SEND_TRIGGER@GOTPAGE
Lloh25:
	ldr	x8, [x8, _HDCP_AKSV_SEND_TRIGGER@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
	bl	_I915_WRITE
	b	LBB0_2
LBB0_13:
Lloh27:
	adrp	x8, _ENXIO@GOTPAGE
Lloh28:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_14:
	mov	x0, x20
	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 AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_HDCP_KEY_STATUS,4,2            ; @HDCP_KEY_STATUS
	.comm	_HDCP_KEY_LOAD_DONE,4,2         ; @HDCP_KEY_LOAD_DONE
	.comm	_HDCP_KEY_LOAD_STATUS,4,2       ; @HDCP_KEY_LOAD_STATUS
	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_SKL_PCODE_LOAD_HDCP_KEYS,4,2   ; @SKL_PCODE_LOAD_HDCP_KEYS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to initiate HDCP key load (%d)\n"

	.comm	_HDCP_KEY_CONF,4,2              ; @HDCP_KEY_CONF
	.comm	_HDCP_KEY_LOAD_TRIGGER,4,2      ; @HDCP_KEY_LOAD_TRIGGER
	.comm	_HDCP_AKSV_SEND_TRIGGER,4,2     ; @HDCP_AKSV_SEND_TRIGGER
	.no_dead_strip	_intel_hdcp_load_keys
.subsections_via_symbols
