	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sandybridge_pcode_read         ## -- Begin function sandybridge_pcode_read
	.p2align	4, 0x90
_sandybridge_pcode_read:                ## @sandybridge_pcode_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, %r12d
	callq	_mutex_is_locked
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_WARN_ON
	movq	_GEN6_PCODE_MAILBOX@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	callq	_I915_READ
	movq	_GEN6_PCODE_READY@GOTPCREL(%rip), %r13
	testl	%eax, (%r13)
	je	LBB0_3
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_DEBUG_DRIVER
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_3:
	movq	_GEN6_PCODE_DATA@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	movl	(%r14), %esi
	callq	_I915_WRITE
	movl	(%rbx), %edi
	movl	(%r13), %esi
	orl	%r12d, %esi
	callq	_I915_WRITE
	movl	(%rbx), %edi
	callq	_I915_READ
	xorl	%edi, %edi
	andl	(%r13), %eax
	sete	%dil
	movl	$500, %esi                      ## imm = 0x1F4
	callq	_wait_for
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	leaq	L_.str.1(%rip), %rdi
	movl	%r12d, %esi
	callq	_DRM_ERROR
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_6:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movl	(%r15), %edi
	callq	_I915_READ
	movl	%eax, (%r14)
	movl	(%r15), %edi
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	callq	_I915_WRITE
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_GEN6_PCODE_MAILBOX,4,2         ## @GEN6_PCODE_MAILBOX
	.comm	_GEN6_PCODE_READY,4,2           ## @GEN6_PCODE_READY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"warning: pcode (read) mailbox access failed\n"

	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	_GEN6_PCODE_DATA,4,2            ## @GEN6_PCODE_DATA
L_.str.1:                               ## @.str.1
	.asciz	"timeout waiting for pcode read (%d) to finish\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sandybridge_pcode_read         ; -- Begin function sandybridge_pcode_read
	.p2align	2
_sandybridge_pcode_read:                ; @sandybridge_pcode_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	x20, x1
	bl	_mutex_is_locked
	cmp	w0, #0
	cset	w0, eq
	bl	_WARN_ON
Lloh0:
	adrp	x22, _GEN6_PCODE_MAILBOX@GOTPAGE
Lloh1:
	ldr	x22, [x22, _GEN6_PCODE_MAILBOX@GOTPAGEOFF]
	ldr	w0, [x22]
	bl	_I915_READ
Lloh2:
	adrp	x23, _GEN6_PCODE_READY@GOTPAGE
Lloh3:
	ldr	x23, [x23, _GEN6_PCODE_READY@GOTPAGEOFF]
	ldr	w8, [x23]
	tst	w8, w0
	b.eq	LBB0_2
; %bb.1:
Lloh4:
	adrp	x0, l_.str@PAGE
Lloh5:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_DEBUG_DRIVER
Lloh6:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:
Lloh8:
	adrp	x21, _GEN6_PCODE_DATA@GOTPAGE
Lloh9:
	ldr	x21, [x21, _GEN6_PCODE_DATA@GOTPAGEOFF]
	ldr	w0, [x21]
	ldr	w1, [x19]
	bl	_I915_WRITE
	ldr	w0, [x22]
	ldr	w8, [x23]
	orr	w1, w8, w20
	bl	_I915_WRITE
	ldr	w0, [x22]
	bl	_I915_READ
	ldr	w8, [x23]
	tst	w8, w0
	cset	w0, eq
	mov	w1, #500
	bl	_wait_for
	cbz	x0, LBB0_6
; %bb.3:
Lloh10:
	adrp	x0, l_.str.1@PAGE
Lloh11:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x20
	bl	_DRM_ERROR
Lloh12:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	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
LBB0_6:
	ldr	w0, [x21]
	bl	_I915_READ
	str	w0, [x19]
	ldr	w0, [x21]
	mov	w1, #0
	bl	_I915_WRITE
	mov	w0, #0
	b	LBB0_5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_GEN6_PCODE_MAILBOX,4,2         ; @GEN6_PCODE_MAILBOX
	.comm	_GEN6_PCODE_READY,4,2           ; @GEN6_PCODE_READY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"warning: pcode (read) mailbox access failed\n"

	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_GEN6_PCODE_DATA,4,2            ; @GEN6_PCODE_DATA
l_.str.1:                               ; @.str.1
	.asciz	"timeout waiting for pcode read (%d) to finish\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
.subsections_via_symbols
