	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cdv_sb_write                   ## -- Begin function cdv_sb_write
	.p2align	4, 0x90
_cdv_sb_write:                          ## @cdv_sb_write
	.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
	movl	%edx, %r12d
	movl	%esi, %r15d
	movq	%rdi, %r14
	leaq	-44(%rbp), %rdx
	callq	_cdv_sb_read
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	movl	-44(%rbp), %edx
	leaq	L_.str(%rip), %rdi
	movl	%r15d, %esi
	callq	_DRM_DEBUG_KMS
LBB0_2:
	leaq	L_.str.1(%rip), %rdi
	movl	%r15d, %esi
	movl	%r12d, %edx
	callq	_DRM_DEBUG_KMS
	movq	_SB_PCKT@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	callq	_REG_READ
	movq	_SB_BUSY@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	andl	(%rcx), %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.2(%rip), %rdi
	callq	_DRM_ERROR
	jmp	LBB0_8
LBB0_4:
	movq	_SB_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r15d, %esi
	callq	_REG_WRITE
	movq	_SB_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r12d, %esi
	callq	_REG_WRITE
	movl	(%r13), %r12d
	movq	_SB_OPCODE_WRITE@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	%r12d, %edi
	movl	%ebx, %esi
	callq	_REG_WRITE
	movl	(%r13), %edi
	callq	_REG_READ
	xorl	%edi, %edi
	movq	_SB_BUSY@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	sete	%dil
	movl	$1000, %esi                     ## imm = 0x3E8
	callq	_wait_for
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	movl	%eax, %ebx
	leaq	L_.str.3(%rip), %rdi
	callq	_DRM_ERROR
	jmp	LBB0_8
LBB0_6:
	leaq	-44(%rbp), %rdx
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_cdv_sb_read
	xorl	%ebx, %ebx
	testq	%rax, %rax
	jne	LBB0_8
## %bb.7:
	movl	-44(%rbp), %edx
	leaq	L_.str.4(%rip), %rdi
	movl	%r15d, %esi
	callq	_DRM_DEBUG_KMS
LBB0_8:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"0x%08x: 0x%08x (before)\n"

L_.str.1:                               ## @.str.1
	.asciz	"0x%08x: 0x%08x\n"

	.comm	_SB_PCKT,4,2                    ## @SB_PCKT
	.comm	_SB_BUSY,4,2                    ## @SB_BUSY
L_.str.2:                               ## @.str.2
	.asciz	"timeout waiting for SB to idle before write\n"

	.comm	_SB_ADDR,4,2                    ## @SB_ADDR
	.comm	_SB_DATA,4,2                    ## @SB_DATA
	.comm	_SB_OPCODE_WRITE,4,2            ## @SB_OPCODE_WRITE
	.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.3:                               ## @.str.3
	.asciz	"timeout waiting for SB to idle after write\n"

L_.str.4:                               ## @.str.4
	.asciz	"0x%08x: 0x%08x (after)\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cdv_sb_write                   ; -- Begin function cdv_sb_write
	.p2align	2
_cdv_sb_write:                          ; @cdv_sb_write
	.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	x21, x2
	mov	x19, x1
	mov	x20, x0
	add	x2, sp, #12
	bl	_cdv_sb_read
	cbnz	x0, LBB0_2
; %bb.1:
	ldr	w2, [sp, #12]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	bl	_DRM_DEBUG_KMS
LBB0_2:
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x19
	mov	x2, x21
	bl	_DRM_DEBUG_KMS
Lloh4:
	adrp	x23, _SB_PCKT@GOTPAGE
Lloh5:
	ldr	x23, [x23, _SB_PCKT@GOTPAGEOFF]
	ldr	w0, [x23]
	bl	_REG_READ
Lloh6:
	adrp	x24, _SB_BUSY@GOTPAGE
Lloh7:
	ldr	x24, [x24, _SB_BUSY@GOTPAGEOFF]
	ldr	w8, [x24]
	tst	w8, w0
	cset	w0, eq
	mov	w1, #1000
	bl	_wait_for
	cbz	w0, LBB0_4
; %bb.3:
	mov	x22, x0
Lloh8:
	adrp	x0, l_.str.2@PAGE
Lloh9:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_9
LBB0_4:
Lloh10:
	adrp	x8, _SB_ADDR@GOTPAGE
Lloh11:
	ldr	x8, [x8, _SB_ADDR@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
	mov	x1, x19
	bl	_REG_WRITE
Lloh13:
	adrp	x8, _SB_DATA@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SB_DATA@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
	mov	x1, x21
	bl	_REG_WRITE
	ldr	w21, [x23]
Lloh16:
	adrp	x8, _SB_OPCODE_WRITE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _SB_OPCODE_WRITE@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
Lloh19:
	adrp	x8, _SB_OPCODE@GOTPAGE
Lloh20:
	ldr	x8, [x8, _SB_OPCODE@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	bl	_SET_FIELD
	mov	x22, x0
Lloh22:
	adrp	x8, _SB_DEST_DPLL@GOTPAGE
Lloh23:
	ldr	x8, [x8, _SB_DEST_DPLL@GOTPAGEOFF]
Lloh24:
	ldr	w0, [x8]
Lloh25:
	adrp	x8, _SB_DEST@GOTPAGE
Lloh26:
	ldr	x8, [x8, _SB_DEST@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
	bl	_SET_FIELD
	orr	w22, w0, w22
Lloh28:
	adrp	x8, _SB_BYTE_ENABLE@GOTPAGE
Lloh29:
	ldr	x8, [x8, _SB_BYTE_ENABLE@GOTPAGEOFF]
Lloh30:
	ldr	w1, [x8]
	mov	w0, #15
	bl	_SET_FIELD
	orr	w1, w22, w0
	mov	x0, x21
	bl	_REG_WRITE
	ldr	w0, [x23]
	bl	_REG_READ
	ldr	w8, [x24]
	tst	w8, w0
	cset	w0, eq
	mov	w1, #1000
	bl	_wait_for
	cbz	w0, LBB0_6
; %bb.5:
	mov	x22, x0
Lloh31:
	adrp	x0, l_.str.3@PAGE
Lloh32:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_9
LBB0_6:
	add	x2, sp, #12
	mov	x0, x20
	mov	x1, x19
	bl	_cdv_sb_read
	cbnz	x0, LBB0_8
; %bb.7:
	ldr	w2, [sp, #12]
Lloh33:
	adrp	x0, l_.str.4@PAGE
Lloh34:
	add	x0, x0, l_.str.4@PAGEOFF
	mov	x1, x19
	bl	_DRM_DEBUG_KMS
LBB0_8:
	mov	w22, #0
LBB0_9:
	mov	x0, x22
	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	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpAdd	Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"0x%08x: 0x%08x (before)\n"

l_.str.1:                               ; @.str.1
	.asciz	"0x%08x: 0x%08x\n"

	.comm	_SB_PCKT,4,2                    ; @SB_PCKT
	.comm	_SB_BUSY,4,2                    ; @SB_BUSY
l_.str.2:                               ; @.str.2
	.asciz	"timeout waiting for SB to idle before write\n"

	.comm	_SB_ADDR,4,2                    ; @SB_ADDR
	.comm	_SB_DATA,4,2                    ; @SB_DATA
	.comm	_SB_OPCODE_WRITE,4,2            ; @SB_OPCODE_WRITE
	.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.3:                               ; @.str.3
	.asciz	"timeout waiting for SB to idle after write\n"

l_.str.4:                               ; @.str.4
	.asciz	"0x%08x: 0x%08x (after)\n"

.subsections_via_symbols
