	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function azx_position_ok
_azx_position_ok:                       ## @azx_position_ok
	.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	%rsi, %r15
	movq	%rdi, %r14
	movq	_WALLCLK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_azx_readl
	movl	%eax, %ebx
	subl	(%r15), %ebx
	movl	4(%r15), %eax
	addl	%eax, %eax
	cltq
	imulq	$1431655766, %rax, %rax         ## imm = 0x55555556
	movq	%rax, %rcx
	shrq	$63, %rcx
	shrq	$32, %rax
	addl	%ecx, %eax
	movl	$-1, %r12d
	cmpl	%eax, %ebx
	jl	LBB0_6
## %bb.1:
	movq	%r14, %rdi
	movq	%r15, %rsi
	movl	$1, %edx
	callq	_azx_get_position
	movl	%eax, %r13d
	xorl	%edi, %edi
	cmpl	$0, 8(%r15)
	sete	%dil
	leaq	L_.str(%rip), %rsi
	callq	_WARN_ONCE
	testq	%rax, %rax
	jne	LBB0_6
## %bb.2:
	movl	4(%r15), %eax
	leal	(%rax,%rax,4), %ecx
	leal	(%rax,%rax,4), %eax
	addl	$3, %eax
	testl	%ecx, %ecx
	cmovnsl	%ecx, %eax
	sarl	$2, %eax
	cmpl	%eax, %ebx
	jge	LBB0_5
## %bb.3:
	movl	8(%r15), %ecx
	xorl	%r12d, %r12d
	movl	%r13d, %eax
	xorl	%edx, %edx
	divl	%ecx
	shrl	%ecx
	cmpl	%ecx, %edx
	jbe	LBB0_5
## %bb.4:
	movq	_bdl_pos_adj@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%r14), %rcx
	cmpq	$1, (%rax,%rcx,8)
	sbbl	%r12d, %r12d
	jmp	LBB0_6
LBB0_5:
	addl	%ebx, (%r15)
	movl	$1, %r12d
LBB0_6:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WALLCLK,4,2                    ## @WALLCLK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"hda-intel: zero azx_dev->period_bytes"

	.comm	_bdl_pos_adj,8,3                ## @bdl_pos_adj
	.no_dead_strip	_azx_position_ok
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function azx_position_ok
_azx_position_ok:                       ; @azx_position_ok
	.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, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _WALLCLK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _WALLCLK@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_azx_readl
	ldp	w8, w9, [x19]
	sub	w22, w0, w8
	lsl	w8, w9, #1
	mov	w9, #21846
	movk	w9, #21845, lsl #16
	smull	x8, w8, w9
	lsr	x9, x8, #63
	lsr	x8, x8, #32
	add	w8, w8, w9
	cmp	w22, w8
	b.lt	LBB0_2
; %bb.1:
	mov	x0, x20
	mov	x1, x19
	mov	w2, #1
	bl	_azx_get_position
	mov	x21, x0
	ldr	w8, [x19, #8]
	cmp	w8, #0
	cset	w0, eq
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_WARN_ONCE
	cbz	x0, LBB0_4
LBB0_2:
	mov	w0, #-1
LBB0_3:
	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_4:
	ldr	w8, [x19, #4]
	add	w8, w8, w8, lsl #2
	add	w9, w8, #3
	cmp	w8, #0
	csel	w8, w9, w8, lt
	cmp	w22, w8, asr #2
	b.ge	LBB0_7
; %bb.5:
	ldr	w8, [x19, #8]
	udiv	w9, w21, w8
	msub	w9, w9, w8, w21
	cmp	w9, w8, lsr #1
	b.ls	LBB0_7
; %bb.6:
Lloh5:
	adrp	x8, _bdl_pos_adj@GOTPAGE
Lloh6:
	ldr	x8, [x8, _bdl_pos_adj@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	ldr	x9, [x20]
	ldr	x8, [x8, x9, lsl #3]
	cmp	x8, #0
	csetm	w0, eq
	b	LBB0_3
LBB0_7:
	ldr	w8, [x19]
	add	w8, w8, w22
	str	w8, [x19]
	mov	w0, #1
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_WALLCLK,4,2                    ; @WALLCLK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"hda-intel: zero azx_dev->period_bytes"

	.comm	_bdl_pos_adj,8,3                ; @bdl_pos_adj
	.no_dead_strip	_azx_position_ok
.subsections_via_symbols
