	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mei_hbm_start_wait             ## -- Begin function mei_hbm_start_wait
	.p2align	4, 0x90
_mei_hbm_start_wait:                    ## @mei_hbm_start_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
	movq	(%rdi), %rax
	movq	_MEI_HBM_STARTING@GOTPCREL(%rip), %r13
	xorl	%r14d, %r14d
	cmpq	(%r13), %rax
	jg	LBB0_4
## %bb.1:
	movq	%rdi, %rbx
	leaq	12(%rdi), %r15
	movq	%r15, %rdi
	callq	_mutex_unlock
	movq	(%rbx), %rax
	xorl	%r12d, %r12d
	cmpq	(%r13), %rax
	movl	16(%rbx), %r13d
	setne	%r12b
	movq	_MEI_HBM_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_mei_secs_to_jiffies
	movl	%r13d, %edi
	movl	%r12d, %esi
	movl	%eax, %edx
	callq	_wait_event_timeout
	movl	%eax, %r12d
	movq	%r15, %rdi
	callq	_mutex_lock
	testl	%r12d, %r12d
	jne	LBB0_4
## %bb.2:
	movq	(%rbx), %rax
	movq	_MEI_HBM_STARTING@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jg	LBB0_4
## %bb.3:
	movq	_MEI_HBM_IDLE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%rbx)
	movl	8(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_ETIME@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_4:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MEI_HBM_STARTING,8,3           ## @MEI_HBM_STARTING
	.comm	_MEI_HBM_TIMEOUT,4,2            ## @MEI_HBM_TIMEOUT
	.comm	_MEI_HBM_IDLE,8,3               ## @MEI_HBM_IDLE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"waiting for mei start failed\n"

	.comm	_ETIME,4,2                      ## @ETIME
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mei_hbm_start_wait             ; -- Begin function mei_hbm_start_wait
	.p2align	2
_mei_hbm_start_wait:                    ; @mei_hbm_start_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
	ldr	x8, [x0]
Lloh0:
	adrp	x23, _MEI_HBM_STARTING@GOTPAGE
Lloh1:
	ldr	x23, [x23, _MEI_HBM_STARTING@GOTPAGEOFF]
	ldr	x9, [x23]
	cmp	x8, x9
	b.gt	LBB0_3
; %bb.1:
	mov	x19, x0
	add	x20, x0, #12
	mov	x0, x20
	bl	_mutex_unlock
	ldr	w21, [x19, #16]
	ldr	x8, [x19]
	ldr	x9, [x23]
	cmp	x8, x9
	cset	w22, ne
Lloh2:
	adrp	x8, _MEI_HBM_TIMEOUT@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MEI_HBM_TIMEOUT@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	bl	_mei_secs_to_jiffies
	mov	x2, x0
	mov	x0, x21
	mov	x1, x22
	bl	_wait_event_timeout
	mov	x21, x0
	mov	x0, x20
	bl	_mutex_lock
	cbnz	w21, LBB0_3
; %bb.2:
	ldr	x8, [x19]
	ldr	x9, [x23]
	cmp	x8, x9
	b.le	LBB0_5
LBB0_3:
	mov	w0, #0
LBB0_4:
	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_5:
Lloh5:
	adrp	x8, _MEI_HBM_IDLE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _MEI_HBM_IDLE@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	str	x8, [x19]
	ldr	w0, [x19, #8]
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh10:
	adrp	x8, _ETIME@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ETIME@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_MEI_HBM_STARTING,8,3           ; @MEI_HBM_STARTING
	.comm	_MEI_HBM_TIMEOUT,4,2            ; @MEI_HBM_TIMEOUT
	.comm	_MEI_HBM_IDLE,8,3               ; @MEI_HBM_IDLE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"waiting for mei start failed\n"

	.comm	_ETIME,4,2                      ; @ETIME
.subsections_via_symbols
