	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ishtp_hbm_start_wait           ## -- Begin function ishtp_hbm_start_wait
	.p2align	4, 0x90
_ishtp_hbm_start_wait:                  ## @ishtp_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	(%rdi), %edx
	movq	_ISHTP_HBM_START@GOTPCREL(%rip), %r12
	xorl	%r14d, %r14d
	cmpl	(%r12), %edx
	jg	LBB0_4
## %bb.1:
	movq	%rdi, %rbx
	movl	4(%rdi), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_dbg
	movl	(%rbx), %eax
	movl	8(%rbx), %edi
	movq	_ISHTP_HBM_STARTED@GOTPCREL(%rip), %rcx
	xorl	%esi, %esi
	cmpl	(%rcx), %eax
	setge	%sil
	movq	_ISHTP_INTEROP_TIMEOUT@GOTPCREL(%rip), %rax
	movq	_HZ@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	imull	(%rax), %edx
	callq	_wait_event_interruptible_timeout
	movl	%eax, %r15d
	movl	(%rbx), %edx
	movl	4(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_dbg
	testl	%r15d, %r15d
	jg	LBB0_4
## %bb.2:
	movl	(%rbx), %eax
	cmpl	(%r12), %eax
	jg	LBB0_4
## %bb.3:
	movq	_ISHTP_HBM_IDLE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%ecx, (%rbx)
	movl	4(%rbx), %edi
	leaq	L_.str.2(%rip), %rsi
	movl	%r15d, %edx
	callq	_dev_err
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_4:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ISHTP_HBM_START,4,2            ## @ISHTP_HBM_START
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Going to wait for ishtp start. hbm_state=%08X\n"

	.comm	_ISHTP_HBM_STARTED,4,2          ## @ISHTP_HBM_STARTED
	.comm	_ISHTP_INTEROP_TIMEOUT,4,2      ## @ISHTP_INTEROP_TIMEOUT
	.comm	_HZ,4,2                         ## @HZ
L_.str.1:                               ## @.str.1
	.asciz	"Woke up from waiting for ishtp start. hbm_state=%08X\n"

	.comm	_ISHTP_HBM_IDLE,4,2             ## @ISHTP_HBM_IDLE
L_.str.2:                               ## @.str.2
	.asciz	"waiting for ishtp start failed. ret=%d hbm_state=%08X\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	_ishtp_hbm_start_wait           ; -- Begin function ishtp_hbm_start_wait
	.p2align	2
_ishtp_hbm_start_wait:                  ; @ishtp_hbm_start_wait
	.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
	ldr	w2, [x0]
Lloh0:
	adrp	x21, _ISHTP_HBM_START@GOTPAGE
Lloh1:
	ldr	x21, [x21, _ISHTP_HBM_START@GOTPAGEOFF]
	ldr	w8, [x21]
	cmp	w2, w8
	b.gt	LBB0_3
; %bb.1:
	mov	x19, x0
	ldr	w0, [x0, #4]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
	ldr	w0, [x19, #8]
	ldr	w8, [x19]
Lloh4:
	adrp	x9, _ISHTP_HBM_STARTED@GOTPAGE
Lloh5:
	ldr	x9, [x9, _ISHTP_HBM_STARTED@GOTPAGEOFF]
Lloh6:
	ldr	w9, [x9]
	cmp	w8, w9
Lloh7:
	adrp	x8, _ISHTP_INTEROP_TIMEOUT@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ISHTP_INTEROP_TIMEOUT@GOTPAGEOFF]
	cset	w1, ge
Lloh9:
	ldr	w8, [x8]
Lloh10:
	adrp	x9, _HZ@GOTPAGE
Lloh11:
	ldr	x9, [x9, _HZ@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	mul	w2, w9, w8
	bl	_wait_event_interruptible_timeout
	mov	x20, x0
	ldp	w2, w0, [x19]
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_dbg
	cmp	w20, #0
	b.gt	LBB0_3
; %bb.2:
	ldr	w8, [x19]
	ldr	w9, [x21]
	cmp	w8, w9
	b.le	LBB0_5
LBB0_3:
	mov	w0, #0
LBB0_4:
	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
LBB0_5:
Lloh15:
	adrp	x8, _ISHTP_HBM_IDLE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ISHTP_HBM_IDLE@GOTPAGEOFF]
Lloh17:
	ldr	w3, [x8]
	str	w3, [x19]
	ldr	w0, [x19, #4]
Lloh18:
	adrp	x1, l_.str.2@PAGE
Lloh19:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x2, x20
	bl	_dev_err
Lloh20:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_ISHTP_HBM_START,4,2            ; @ISHTP_HBM_START
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Going to wait for ishtp start. hbm_state=%08X\n"

	.comm	_ISHTP_HBM_STARTED,4,2          ; @ISHTP_HBM_STARTED
	.comm	_ISHTP_INTEROP_TIMEOUT,4,2      ; @ISHTP_INTEROP_TIMEOUT
	.comm	_HZ,4,2                         ; @HZ
l_.str.1:                               ; @.str.1
	.asciz	"Woke up from waiting for ishtp start. hbm_state=%08X\n"

	.comm	_ISHTP_HBM_IDLE,4,2             ; @ISHTP_HBM_IDLE
l_.str.2:                               ; @.str.2
	.asciz	"waiting for ishtp start failed. ret=%d hbm_state=%08X\n"

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