	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cdv_sb_read                    ## -- Begin function cdv_sb_read
	.p2align	4, 0x90
_cdv_sb_read:                           ## @cdv_sb_read
	.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, %r14
	movl	%esi, %r15d
	movq	_SB_PCKT@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	callq	_REG_READ
	movq	_SB_BUSY@GOTPCREL(%rip), %r12
	xorl	%edi, %edi
	andl	(%r12), %eax
	sete	%dil
	movl	$1000, %esi                     ## imm = 0x3E8
	callq	_wait_for
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
	jmp	LBB0_5
LBB0_2:
	movq	_SB_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r15d, %esi
	callq	_REG_WRITE
	movl	(%r13), %r15d
	movq	_SB_OPCODE_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_SB_OPCODE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_SET_FIELD
	movl	%eax, %ebx
	movq	_SB_DEST_DPLL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_SB_DEST@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_SET_FIELD
	orl	%eax, %ebx
	movq	_SB_BYTE_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$15, %edi
	callq	_SET_FIELD
	orl	%eax, %ebx
	movl	%r15d, %edi
	movl	%ebx, %esi
	callq	_REG_WRITE
	movl	(%r13), %edi
	callq	_REG_READ
	xorl	%edi, %edi
	andl	(%r12), %eax
	sete	%dil
	movl	$1000, %esi                     ## imm = 0x3E8
	callq	_wait_for
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rdi
	callq	_DRM_ERROR
	jmp	LBB0_5
LBB0_4:
	movq	_SB_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_REG_READ
	movl	%eax, (%r14)
	xorl	%ebx, %ebx
LBB0_5:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SB_PCKT,4,2                    ## @SB_PCKT
	.comm	_SB_BUSY,4,2                    ## @SB_BUSY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"timeout waiting for SB to idle before read\n"

	.comm	_SB_ADDR,4,2                    ## @SB_ADDR
	.comm	_SB_OPCODE_READ,4,2             ## @SB_OPCODE_READ
	.comm	_SB_OPCODE,4,2                  ## @SB_OPCODE
	.comm	_SB_DEST_DPLL,4,2               ## @SB_DEST_DPLL
	.comm	_SB_DEST,4,2                    ## @SB_DEST
	.comm	_SB_BYTE_ENABLE,4,2             ## @SB_BYTE_ENABLE
L_.str.1:                               ## @.str.1
	.asciz	"timeout waiting for SB to idle after read\n"

	.comm	_SB_DATA,4,2                    ## @SB_DATA
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cdv_sb_read                    ; -- Begin function cdv_sb_read
	.p2align	2
_cdv_sb_read:                           ; @cdv_sb_read
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x2
	mov	x21, x1
Lloh0:
	adrp	x22, _SB_PCKT@GOTPAGE
Lloh1:
	ldr	x22, [x22, _SB_PCKT@GOTPAGEOFF]
	ldr	w0, [x22]
	bl	_REG_READ
Lloh2:
	adrp	x23, _SB_BUSY@GOTPAGE
Lloh3:
	ldr	x23, [x23, _SB_BUSY@GOTPAGEOFF]
	ldr	w8, [x23]
	tst	w8, w0
	cset	w0, eq
	mov	w1, #1000
	bl	_wait_for
	cbz	w0, LBB0_2
; %bb.1:
	mov	x20, x0
Lloh4:
	adrp	x0, l_.str@PAGE
Lloh5:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_5
LBB0_2:
Lloh6:
	adrp	x8, _SB_ADDR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SB_ADDR@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	mov	x1, x21
	bl	_REG_WRITE
	ldr	w20, [x22]
Lloh9:
	adrp	x8, _SB_OPCODE_READ@GOTPAGE
Lloh10:
	ldr	x8, [x8, _SB_OPCODE_READ@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
Lloh12:
	adrp	x8, _SB_OPCODE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _SB_OPCODE@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	bl	_SET_FIELD
	mov	x21, x0
Lloh15:
	adrp	x8, _SB_DEST_DPLL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _SB_DEST_DPLL@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
Lloh18:
	adrp	x8, _SB_DEST@GOTPAGE
Lloh19:
	ldr	x8, [x8, _SB_DEST@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	bl	_SET_FIELD
	orr	w21, w0, w21
Lloh21:
	adrp	x8, _SB_BYTE_ENABLE@GOTPAGE
Lloh22:
	ldr	x8, [x8, _SB_BYTE_ENABLE@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	mov	w0, #15
	bl	_SET_FIELD
	orr	w1, w21, w0
	mov	x0, x20
	bl	_REG_WRITE
	ldr	w0, [x22]
	bl	_REG_READ
	ldr	w8, [x23]
	tst	w8, w0
	cset	w0, eq
	mov	w1, #1000
	bl	_wait_for
	mov	x20, x0
	cbz	w0, LBB0_4
; %bb.3:
Lloh24:
	adrp	x0, l_.str.1@PAGE
Lloh25:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_5
LBB0_4:
Lloh26:
	adrp	x8, _SB_DATA@GOTPAGE
Lloh27:
	ldr	x8, [x8, _SB_DATA@GOTPAGEOFF]
Lloh28:
	ldr	w0, [x8]
	bl	_REG_READ
	str	w0, [x19]
LBB0_5:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_SB_PCKT,4,2                    ; @SB_PCKT
	.comm	_SB_BUSY,4,2                    ; @SB_BUSY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"timeout waiting for SB to idle before read\n"

	.comm	_SB_ADDR,4,2                    ; @SB_ADDR
	.comm	_SB_OPCODE_READ,4,2             ; @SB_OPCODE_READ
	.comm	_SB_OPCODE,4,2                  ; @SB_OPCODE
	.comm	_SB_DEST_DPLL,4,2               ; @SB_DEST_DPLL
	.comm	_SB_DEST,4,2                    ; @SB_DEST
	.comm	_SB_BYTE_ENABLE,4,2             ; @SB_BYTE_ENABLE
l_.str.1:                               ; @.str.1
	.asciz	"timeout waiting for SB to idle after read\n"

	.comm	_SB_DATA,4,2                    ; @SB_DATA
.subsections_via_symbols
