	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gmbus_wait
_gmbus_wait:                            ## @gmbus_wait
	.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, %ebx
	movl	%esi, %r12d
	movq	%rdi, %r14
	movq	_wait@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	callq	_DEFINE_WAIT
	movq	%r14, %rdi
	callq	_HAS_GMBUS_IRQ
	testl	%eax, %eax
	cmovel	%eax, %ebx
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_add_wait_queue
	movq	_GMBUS4@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%ebx, %esi
	callq	_I915_WRITE_FW
	movq	_GMBUS_SATOER@GOTPCREL(%rip), %rax
	orl	(%rax), %r12d
	movq	_GMBUS2@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	callq	_I915_READ_FW
	movl	%eax, %r15d
	movl	%eax, %edi
	andl	%r12d, %edi
	movl	$2, %esi
	callq	_wait_for_us
	xorl	%ebx, %ebx
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movl	(%r13), %edi
	callq	_I915_READ_FW
	movl	%eax, %r15d
	andl	%eax, %r12d
	movl	%r12d, %edi
	movl	$50, %esi
	callq	_wait_for
	movl	%eax, %r12d
	jmp	LBB0_3
LBB0_1:
	xorl	%r12d, %r12d
LBB0_3:
	movq	_GMBUS4@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	callq	_I915_WRITE_FW
	movq	_wait@GOTPCREL(%rip), %rsi
	movq	%r14, %rdi
	callq	_remove_wait_queue
	movq	_ENXIO@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	movq	_GMBUS_SATOER@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	cmovel	%r12d, %ebx
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_wait,4,2                       ## @wait
	.comm	_GMBUS4,4,2                     ## @GMBUS4
	.comm	_GMBUS_SATOER,4,2               ## @GMBUS_SATOER
	.comm	_GMBUS2,4,2                     ## @GMBUS2
	.comm	_ENXIO,4,2                      ## @ENXIO
	.no_dead_strip	_gmbus_wait
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gmbus_wait
_gmbus_wait:                            ; @gmbus_wait
	.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	x20, x2
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x22, _wait@GOTPAGE
Lloh1:
	ldr	x22, [x22, _wait@GOTPAGEOFF]
	ldr	w0, [x22]
	bl	_DEFINE_WAIT
	mov	x0, x19
	bl	_HAS_GMBUS_IRQ
	cmp	w0, #0
	csel	w20, wzr, w20, eq
	mov	x0, x19
	mov	x1, x22
	bl	_add_wait_queue
Lloh2:
	adrp	x23, _GMBUS4@GOTPAGE
Lloh3:
	ldr	x23, [x23, _GMBUS4@GOTPAGEOFF]
	ldr	w0, [x23]
	mov	x1, x20
	bl	_I915_WRITE_FW
Lloh4:
	adrp	x22, _GMBUS_SATOER@GOTPAGE
Lloh5:
	ldr	x22, [x22, _GMBUS_SATOER@GOTPAGEOFF]
	ldr	w8, [x22]
	orr	w21, w8, w21
Lloh6:
	adrp	x24, _GMBUS2@GOTPAGE
Lloh7:
	ldr	x24, [x24, _GMBUS2@GOTPAGEOFF]
	ldr	w0, [x24]
	bl	_I915_READ_FW
	mov	x20, x0
	and	w0, w0, w21
	mov	w1, #2
	bl	_wait_for_us
	cbz	w0, LBB0_2
; %bb.1:
	ldr	w0, [x24]
	bl	_I915_READ_FW
	mov	x20, x0
	and	w0, w0, w21
	mov	w1, #50
	bl	_wait_for
	mov	x21, x0
	b	LBB0_3
LBB0_2:
	mov	w21, #0
LBB0_3:
	ldr	w0, [x23]
	mov	w1, #0
	bl	_I915_WRITE_FW
Lloh8:
	adrp	x1, _wait@GOTPAGE
Lloh9:
	ldr	x1, [x1, _wait@GOTPAGEOFF]
	mov	x0, x19
	bl	_remove_wait_queue
	ldr	w8, [x22]
Lloh10:
	adrp	x9, _ENXIO@GOTPAGE
Lloh11:
	ldr	x9, [x9, _ENXIO@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	tst	w8, w20
	csneg	w0, w21, w9, eq
	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	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_wait,4,2                       ; @wait
	.comm	_GMBUS4,4,2                     ; @GMBUS4
	.comm	_GMBUS_SATOER,4,2               ; @GMBUS_SATOER
	.comm	_GMBUS2,4,2                     ; @GMBUS2
	.comm	_ENXIO,4,2                      ; @ENXIO
	.no_dead_strip	_gmbus_wait
.subsections_via_symbols
