	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gmbus_wait_idle
_gmbus_wait_idle:                       ## @gmbus_wait_idle
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	_wait@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	callq	_DEFINE_WAIT
	movq	%r15, %rdi
	callq	_HAS_GMBUS_IRQ
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_GMBUS_IDLE_EN@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
LBB0_2:
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_add_wait_queue
	movq	_GMBUS4@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	movq	%rbx, %rsi
	callq	_I915_WRITE_FW
	leaq	4(%r15), %rdi
	movq	_GMBUS2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_GMBUS_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%ecx, %ecx
	movl	$10, %r8d
	callq	_intel_wait_for_register_fw
	movl	%eax, %ebx
	movl	(%r12), %edi
	xorl	%esi, %esi
	callq	_I915_WRITE_FW
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_remove_wait_queue
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_wait,4,2                       ## @wait
	.comm	_GMBUS_IDLE_EN,8,3              ## @GMBUS_IDLE_EN
	.comm	_GMBUS4,4,2                     ## @GMBUS4
	.comm	_GMBUS2,4,2                     ## @GMBUS2
	.comm	_GMBUS_ACTIVE,4,2               ## @GMBUS_ACTIVE
	.no_dead_strip	_gmbus_wait_idle
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gmbus_wait_idle
_gmbus_wait_idle:                       ; @gmbus_wait_idle
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x0
Lloh0:
	adrp	x20, _wait@GOTPAGE
Lloh1:
	ldr	x20, [x20, _wait@GOTPAGEOFF]
	ldr	w0, [x20]
	bl	_DEFINE_WAIT
	mov	x0, x19
	bl	_HAS_GMBUS_IRQ
Lloh2:
	adrp	x8, _GMBUS_IDLE_EN@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GMBUS_IDLE_EN@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	cmp	x0, #0
	csel	x21, xzr, x8, eq
	mov	x0, x19
	mov	x1, x20
	bl	_add_wait_queue
Lloh5:
	adrp	x22, _GMBUS4@GOTPAGE
Lloh6:
	ldr	x22, [x22, _GMBUS4@GOTPAGEOFF]
	ldr	w0, [x22]
	mov	x1, x21
	bl	_I915_WRITE_FW
	add	x0, x19, #4
Lloh7:
	adrp	x8, _GMBUS2@GOTPAGE
Lloh8:
	ldr	x8, [x8, _GMBUS2@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
Lloh10:
	adrp	x8, _GMBUS_ACTIVE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _GMBUS_ACTIVE@GOTPAGEOFF]
Lloh12:
	ldr	w2, [x8]
	mov	w3, #0
	mov	w4, #10
	bl	_intel_wait_for_register_fw
	mov	x21, x0
	ldr	w0, [x22]
	mov	x1, #0
	bl	_I915_WRITE_FW
	mov	x0, x19
	mov	x1, x20
	bl	_remove_wait_queue
	mov	x0, x21
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_wait,4,2                       ; @wait
	.comm	_GMBUS_IDLE_EN,8,3              ; @GMBUS_IDLE_EN
	.comm	_GMBUS4,4,2                     ; @GMBUS4
	.comm	_GMBUS2,4,2                     ; @GMBUS2
	.comm	_GMBUS_ACTIVE,4,2               ; @GMBUS_ACTIVE
	.no_dead_strip	_gmbus_wait_idle
.subsections_via_symbols
