	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function intel_sbi_rw
_intel_sbi_rw:                          ## @intel_sbi_rw
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, -52(%rbp)                 ## 4-byte Spill
	movq	%rcx, %r15
	movl	%edx, %r13d
	movq	%rsi, %r12
	leaq	4(%rdi), %r14
	callq	_lockdep_assert_held
	movq	_SBI_CTL_STAT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SBI_BUSY@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%ecx, %ecx
	movl	$100, %r8d
	callq	_intel_wait_for_register_fw
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movq	_EBUSY@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_12
LBB0_2:
	movl	%r13d, -48(%rbp)                ## 4-byte Spill
	movq	_SBI_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movl	%r12d, %edx
	shll	$16, %edx
	movq	%r14, %rdi
	callq	_intel_uncore_write_fw
	movq	_SBI_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	-52(%rbp), %r12d                ## 4-byte Reload
	testl	%r12d, %r12d
	jne	LBB0_4
## %bb.3:
	movl	(%r15), %ebx
LBB0_4:
	movq	%r14, %r13
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_intel_uncore_write_fw
	movq	_SBI_ICLK@GOTPCREL(%rip), %rax
	movq	_SBI_CTL_DEST_ICLK@GOTPCREL(%rip), %rcx
	movq	_SBI_CTL_DEST_MPHY@GOTPCREL(%rip), %rdx
	movq	_SBI_CTL_OP_CRRD@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	movq	_SBI_CTL_OP_IORD@GOTPCREL(%rip), %rdi
	movl	(%rdi), %ebx
	orl	(%rcx), %esi
	orl	(%rdx), %ebx
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	cmpl	%ecx, (%rax)
	cmovel	%esi, %ebx
	movl	%ebx, -44(%rbp)
	testl	%r12d, %r12d
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	jne	LBB0_6
## %bb.5:
	movl	$8, %edi
	callq	_BIT
	orl	%eax, %ebx
	movl	%ebx, -44(%rbp)
LBB0_6:
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movq	_SBI_CTL_STAT@GOTPCREL(%rip), %rax
	movq	_SBI_BUSY@GOTPCREL(%rip), %r14
	movl	(%rax), %esi
	orl	(%r14), %ebx
	movq	%r13, %rdi
	movl	%ebx, %edx
	movq	%rax, %rbx
	callq	_intel_uncore_write_fw
	movl	(%rbx), %esi
	movl	(%r14), %edx
	leaq	-44(%rbp), %rax
	movq	%rax, (%rsp)
	xorl	%ebx, %ebx
	movq	%r13, %rdi
	xorl	%ecx, %ecx
	movl	$100, %r8d
	movl	$100, %r9d
	callq	___intel_wait_for_register_fw
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_12
LBB0_8:
	movq	_SBI_RESPONSE_FAIL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, -44(%rbp)
	je	LBB0_10
## %bb.9:
	leaq	L_.str.2(%rip), %rdi
	xorl	%ebx, %ebx
	movq	%r15, %rsi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movq	_ENXIO@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_12
LBB0_10:
	xorl	%ebx, %ebx
	testl	%r12d, %r12d
	je	LBB0_12
## %bb.11:
	movq	_SBI_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_intel_uncore_read_fw
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
LBB0_12:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SBI_CTL_STAT,4,2               ## @SBI_CTL_STAT
	.comm	_SBI_BUSY,4,2                   ## @SBI_BUSY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"timeout waiting for SBI to become ready\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_SBI_ADDR,4,2                   ## @SBI_ADDR
	.comm	_SBI_DATA,4,2                   ## @SBI_DATA
	.comm	_SBI_ICLK,4,2                   ## @SBI_ICLK
	.comm	_SBI_CTL_DEST_ICLK,4,2          ## @SBI_CTL_DEST_ICLK
	.comm	_SBI_CTL_OP_CRRD,4,2            ## @SBI_CTL_OP_CRRD
	.comm	_SBI_CTL_DEST_MPHY,4,2          ## @SBI_CTL_DEST_MPHY
	.comm	_SBI_CTL_OP_IORD,4,2            ## @SBI_CTL_OP_IORD
L_.str.1:                               ## @.str.1
	.asciz	"timeout waiting for SBI to complete read\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_SBI_RESPONSE_FAIL,4,2          ## @SBI_RESPONSE_FAIL
L_.str.2:                               ## @.str.2
	.asciz	"error during SBI read of reg %x\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
	.no_dead_strip	_intel_sbi_rw
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function intel_sbi_rw
_intel_sbi_rw:                          ; @intel_sbi_rw
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x4
	mov	x19, x3
	mov	x23, x2
	mov	x22, x1
	add	x21, x0, #4
	bl	_lockdep_assert_held
Lloh0:
	adrp	x24, _SBI_CTL_STAT@GOTPAGE
Lloh1:
	ldr	x24, [x24, _SBI_CTL_STAT@GOTPAGEOFF]
	ldr	w1, [x24]
Lloh2:
	adrp	x25, _SBI_BUSY@GOTPAGE
Lloh3:
	ldr	x25, [x25, _SBI_BUSY@GOTPAGEOFF]
	ldr	w2, [x25]
	mov	x0, x21
	mov	w3, #0
	mov	w4, #100
	bl	_intel_wait_for_register_fw
	cbz	x0, LBB0_2
; %bb.1:
Lloh4:
	adrp	x0, l_.str@PAGE
Lloh5:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
Lloh6:
	adrp	x8, _EBUSY@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_11
LBB0_2:
Lloh8:
	adrp	x8, _SBI_ADDR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SBI_ADDR@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	lsl	w2, w22, #16
	mov	x0, x21
	bl	_intel_uncore_write_fw
Lloh11:
	adrp	x26, _SBI_DATA@GOTPAGE
Lloh12:
	ldr	x26, [x26, _SBI_DATA@GOTPAGEOFF]
	ldr	w1, [x26]
	cbz	w20, LBB0_4
; %bb.3:
	mov	w2, #0
	b	LBB0_5
LBB0_4:
	ldr	w2, [x19]
LBB0_5:
	mov	x0, x21
	bl	_intel_uncore_write_fw
Lloh13:
	adrp	x8, _SBI_ICLK@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SBI_ICLK@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
Lloh16:
	adrp	x9, _SBI_CTL_DEST_ICLK@GOTPAGE
Lloh17:
	ldr	x9, [x9, _SBI_CTL_DEST_ICLK@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
Lloh19:
	adrp	x10, _SBI_CTL_DEST_MPHY@GOTPAGE
Lloh20:
	ldr	x10, [x10, _SBI_CTL_DEST_MPHY@GOTPAGEOFF]
Lloh21:
	ldr	w10, [x10]
Lloh22:
	adrp	x11, _SBI_CTL_OP_CRRD@GOTPAGE
Lloh23:
	ldr	x11, [x11, _SBI_CTL_OP_CRRD@GOTPAGEOFF]
Lloh24:
	ldr	w11, [x11]
Lloh25:
	adrp	x12, _SBI_CTL_OP_IORD@GOTPAGE
Lloh26:
	ldr	x12, [x12, _SBI_CTL_OP_IORD@GOTPAGEOFF]
Lloh27:
	ldr	w12, [x12]
	orr	w9, w11, w9
	orr	w10, w12, w10
	cmp	w8, w23
	csel	w23, w9, w10, eq
	str	w23, [sp, #12]
	cbnz	w20, LBB0_7
; %bb.6:
	mov	w0, #8
	bl	_BIT
	orr	w23, w23, w0
	str	w23, [sp, #12]
LBB0_7:
	ldr	w1, [x24]
	ldr	w8, [x25]
	orr	w2, w8, w23
	mov	x0, x21
	bl	_intel_uncore_write_fw
	ldr	w1, [x24]
	ldr	w2, [x25]
	add	x6, sp, #12
	mov	x0, x21
	mov	w3, #0
	mov	w4, #100
	mov	w5, #100
	bl	___intel_wait_for_register_fw
	cbz	x0, LBB0_9
; %bb.8:
Lloh28:
	adrp	x0, l_.str.1@PAGE
Lloh29:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_ERROR
Lloh30:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh31:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
	b	LBB0_11
LBB0_9:
	ldr	w8, [sp, #12]
Lloh32:
	adrp	x9, _SBI_RESPONSE_FAIL@GOTPAGE
Lloh33:
	ldr	x9, [x9, _SBI_RESPONSE_FAIL@GOTPAGEOFF]
Lloh34:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_13
; %bb.10:
	str	x22, [sp]
Lloh35:
	adrp	x0, l_.str.2@PAGE
Lloh36:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DRM_ERROR
Lloh37:
	adrp	x8, _ENXIO@GOTPAGE
Lloh38:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
LBB0_11:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_12:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_13:
	cbz	w20, LBB0_15
; %bb.14:
	ldr	w1, [x26]
	mov	x0, x21
	bl	_intel_uncore_read_fw
	mov	x8, x0
	mov	w0, #0
	str	w8, [x19]
	b	LBB0_12
LBB0_15:
	mov	w0, #0
	b	LBB0_12
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.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 AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh37, Lloh38
	.loh AdrpAdd	Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.comm	_SBI_CTL_STAT,4,2               ; @SBI_CTL_STAT
	.comm	_SBI_BUSY,4,2                   ; @SBI_BUSY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"timeout waiting for SBI to become ready\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_SBI_ADDR,4,2                   ; @SBI_ADDR
	.comm	_SBI_DATA,4,2                   ; @SBI_DATA
	.comm	_SBI_ICLK,4,2                   ; @SBI_ICLK
	.comm	_SBI_CTL_DEST_ICLK,4,2          ; @SBI_CTL_DEST_ICLK
	.comm	_SBI_CTL_OP_CRRD,4,2            ; @SBI_CTL_OP_CRRD
	.comm	_SBI_CTL_DEST_MPHY,4,2          ; @SBI_CTL_DEST_MPHY
	.comm	_SBI_CTL_OP_IORD,4,2            ; @SBI_CTL_OP_IORD
l_.str.1:                               ; @.str.1
	.asciz	"timeout waiting for SBI to complete read\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_SBI_RESPONSE_FAIL,4,2          ; @SBI_RESPONSE_FAIL
l_.str.2:                               ; @.str.2
	.asciz	"error during SBI read of reg %x\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
	.no_dead_strip	_intel_sbi_rw
.subsections_via_symbols
