	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function _dpu_vbif_wait_for_xin_halt
__dpu_vbif_wait_for_xin_halt:           ## @_dpu_vbif_wait_for_xin_halt
	.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, %rbx
	testq	%rdi, %rdi
	je	LBB0_3
## %bb.1:
	cmpq	$0, 16(%rbx)
	je	LBB0_3
## %bb.2:
	cmpq	$0, 8(%rbx)
	je	LBB0_3
## %bb.4:
	movl	%esi, %r14d
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_ktime_get
	movq	16(%rbx), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	callq	_ktime_add_us
	movl	%eax, %r12d
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	*8(%rbx)
	testl	%eax, %eax
	jne	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	xorl	%eax, %eax
	callq	_ktime_get
	movl	%eax, %edi
	movl	%r12d, %esi
	callq	_ktime_compare_safe
	testq	%rax, %rax
	jg	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	$501, %edi                      ## imm = 0x1F5
	movl	$1000, %esi                     ## imm = 0x3E8
	callq	_usleep_range
	jmp	LBB0_5
LBB0_3:
	xorl	%esi, %esi
	testq	%rbx, %rbx
	setne	%sil
	leaq	L_.str(%rip), %rdi
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_DPU_ERROR
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	jmp	LBB0_11
LBB0_9:
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	*8(%rbx)
	testl	%eax, %eax
	je	LBB0_10
LBB0_8:
	movq	(%rbx), %rsi
	movq	_VBIF_0@GOTPCREL(%rip), %rax
	subq	(%rax), %rsi
	leaq	L_.str.2(%rip), %rdi
	movl	%r14d, %edx
	callq	_DPU_DEBUG
LBB0_11:
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	movl	(%rbx), %esi
	movq	_VBIF_0@GOTPCREL(%rip), %rax
	subl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdi
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_DPU_ERROR
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"invalid arguments vbif %d\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
L_.str.1:                               ## @.str.1
	.asciz	"VBIF %d client %d not halting. TIMEDOUT.\n"

	.comm	_VBIF_0,8,3                     ## @VBIF_0
L_.str.2:                               ## @.str.2
	.asciz	"VBIF %d client %d is halted\n"

	.no_dead_strip	__dpu_vbif_wait_for_xin_halt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function _dpu_vbif_wait_for_xin_halt
__dpu_vbif_wait_for_xin_halt:           ; @_dpu_vbif_wait_for_xin_halt
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x20, x0
	cbz	x0, LBB0_7
; %bb.1:
	ldr	x8, [x20, #16]
	cbz	x8, LBB0_7
; %bb.2:
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_7
; %bb.3:
	mov	x19, x1
	bl	_ktime_get
	ldr	x8, [x20, #16]
	ldr	w1, [x8]
	bl	_ktime_add_us
	mov	x21, x0
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #8]
	mov	x0, x20
	mov	x1, x19
	blr	x8
	cbnz	w0, LBB0_9
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	bl	_ktime_get
	mov	x1, x21
	bl	_ktime_compare_safe
	cmp	x0, #0
	b.gt	LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w0, #501
	mov	w1, #1000
	bl	_usleep_range
	b	LBB0_4
LBB0_7:
	cmp	x20, #0
	cset	w1, ne
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DPU_ERROR
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_10
LBB0_8:
	ldr	x8, [x20, #8]
	mov	x0, x20
	mov	x1, x19
	blr	x8
	cbz	w0, LBB0_11
LBB0_9:
	ldr	x8, [x20]
Lloh5:
	adrp	x9, _VBIF_0@GOTPAGE
Lloh6:
	ldr	x9, [x9, _VBIF_0@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	sub	x1, x8, x9
Lloh8:
	adrp	x0, l_.str.2@PAGE
Lloh9:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x2, x19
	bl	_DPU_DEBUG
	mov	w21, #0
LBB0_10:
	mov	x0, x21
	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
	add	sp, sp, #64
	ret
LBB0_11:
Lloh10:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w21, w8
	ldr	w8, [x20]
Lloh13:
	adrp	x9, _VBIF_0@GOTPAGE
Lloh14:
	ldr	x9, [x9, _VBIF_0@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	sub	w1, w8, w9
	str	x19, [sp]
Lloh16:
	adrp	x0, l_.str.1@PAGE
Lloh17:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DPU_ERROR
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invalid arguments vbif %d\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
l_.str.1:                               ; @.str.1
	.asciz	"VBIF %d client %d not halting. TIMEDOUT.\n"

	.comm	_VBIF_0,8,3                     ; @VBIF_0
l_.str.2:                               ; @.str.2
	.asciz	"VBIF %d client %d is halted\n"

	.no_dead_strip	__dpu_vbif_wait_for_xin_halt
.subsections_via_symbols
