	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function drain_dac
_drain_dac:                             ## @drain_dac
	.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
	movl	%esi, %ebx
	movq	%rdi, %r12
	movq	_wait@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_current@GOTPCREL(%rip), %r13
	movq	(%r13), %rsi
	callq	_DECLARE_WAITQUEUE
	xorl	%eax, %eax
	cmpq	$0, 24(%r12)
	jne	LBB0_9
## %bb.1:
	testl	%ebx, %ebx
	je	LBB0_3
## %bb.2:
	movq	_EBUSY@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_9
LBB0_3:
	leaq	20(%r12), %rdi
	movq	_wait@GOTPCREL(%rip), %rsi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_add_wait_queue
	movq	_R_SER_DMA_DSCR_COUNT_TX@GOTPCREL(%rip), %r15
	movq	_HZ@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %edi
	callq	_SS_CSR
	movl	%eax, %edi
	callq	___raw_readq
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	cmpq	$0, (%r12)
	jle	LBB0_8
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	(%r13), %rdi
	callq	_signal_pending
	testl	%eax, %eax
	jne	LBB0_4
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	_TASK_INTERRUPTIBLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_set_current_state
	movq	_FRAME_TX_US@GOTPCREL(%rip), %rax
	imull	(%rax), %ebx
	imull	(%r14), %ebx
	movslq	%ebx, %rax
	imulq	$1125899907, %rax, %rax         ## imm = 0x431BDE83
	movq	%rax, %rcx
	sarq	$50, %rcx
	shrq	$63, %rax
	leal	(%rcx,%rax), %edi
	incl	%edi
	callq	_schedule_timeout
	jmp	LBB0_4
LBB0_8:
	leaq	32(%r12), %rbx
	movq	%rbx, %rdi
	callq	_spin_lock_irqsave
	movq	_R_SER_DMA_CUR_DSCR_ADDR_TX@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_SS_CSR
	movl	%eax, %edi
	callq	___raw_readq
	movq	_M_DMA_CURDSCR_ADDR@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	subl	8(%r12), %eax
	sarl	$2, %eax
	movl	%eax, 16(%r12)
	movl	%eax, 12(%r12)
	movq	%rbx, %rdi
	callq	_spin_unlock_irqrestore
	movq	_wait@GOTPCREL(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_remove_wait_queue
	movq	_TASK_RUNNING@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	(%r13), %rcx
	movl	%eax, (%rcx)
	xorl	%eax, %eax
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_wait,4,2                       ## @wait
	.comm	_current,8,3                    ## @current
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_R_SER_DMA_DSCR_COUNT_TX,4,2    ## @R_SER_DMA_DSCR_COUNT_TX
	.comm	_TASK_INTERRUPTIBLE,4,2         ## @TASK_INTERRUPTIBLE
	.comm	_FRAME_TX_US,4,2                ## @FRAME_TX_US
	.comm	_HZ,4,2                         ## @HZ
	.comm	_R_SER_DMA_CUR_DSCR_ADDR_TX,4,2 ## @R_SER_DMA_CUR_DSCR_ADDR_TX
	.comm	_M_DMA_CURDSCR_ADDR,4,2         ## @M_DMA_CURDSCR_ADDR
	.comm	_TASK_RUNNING,4,2               ## @TASK_RUNNING
	.no_dead_strip	_drain_dac
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function drain_dac
_drain_dac:                             ; @drain_dac
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _wait@GOTPAGE
Lloh1:
	ldr	x8, [x8, _wait@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x22, _current@GOTPAGE
Lloh4:
	ldr	x22, [x22, _current@GOTPAGEOFF]
	ldr	x1, [x22]
	bl	_DECLARE_WAITQUEUE
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_2
; %bb.1:
	mov	w0, #0
	b	LBB0_10
LBB0_2:
	cbz	w20, LBB0_4
; %bb.3:
Lloh5:
	adrp	x8, _EBUSY@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_10
LBB0_4:
	add	x20, x19, #20
Lloh8:
	adrp	x1, _wait@GOTPAGE
Lloh9:
	ldr	x1, [x1, _wait@GOTPAGEOFF]
	mov	x0, x20
	bl	_add_wait_queue
Lloh10:
	adrp	x23, _R_SER_DMA_DSCR_COUNT_TX@GOTPAGE
Lloh11:
	ldr	x23, [x23, _R_SER_DMA_DSCR_COUNT_TX@GOTPAGEOFF]
Lloh12:
	adrp	x24, _TASK_INTERRUPTIBLE@GOTPAGE
Lloh13:
	ldr	x24, [x24, _TASK_INTERRUPTIBLE@GOTPAGEOFF]
Lloh14:
	adrp	x25, _FRAME_TX_US@GOTPAGE
Lloh15:
	ldr	x25, [x25, _FRAME_TX_US@GOTPAGEOFF]
	mov	w26, #56963
	movk	w26, #17179, lsl #16
Lloh16:
	adrp	x27, _HZ@GOTPAGE
Lloh17:
	ldr	x27, [x27, _HZ@GOTPAGEOFF]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x23]
	bl	_SS_CSR
	bl	___raw_readq
	mov	x21, x0
	cbnz	w0, LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x19]
	cmp	x8, #1
	b.lt	LBB0_9
LBB0_7:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	x0, [x22]
	bl	_signal_pending
	cbnz	w0, LBB0_5
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w0, [x24]
	bl	_set_current_state
	ldr	w8, [x25]
	mul	w8, w8, w21
	ldr	w9, [x27]
	mul	w8, w8, w9
	smull	x8, w8, w26
	lsr	x9, x8, #63
	asr	x8, x8, #50
	add	w8, w8, w9
	add	w0, w8, #1
	bl	_schedule_timeout
	b	LBB0_5
LBB0_9:
	add	x21, x19, #32
	mov	x0, x21
	bl	_spin_lock_irqsave
Lloh18:
	adrp	x8, _R_SER_DMA_CUR_DSCR_ADDR_TX@GOTPAGE
Lloh19:
	ldr	x8, [x8, _R_SER_DMA_CUR_DSCR_ADDR_TX@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
	bl	_SS_CSR
	bl	___raw_readq
Lloh21:
	adrp	x8, _M_DMA_CURDSCR_ADDR@GOTPAGE
Lloh22:
	ldr	x8, [x8, _M_DMA_CURDSCR_ADDR@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	and	w8, w8, w0
	ldr	w9, [x19, #8]
	sub	w8, w8, w9
	asr	w8, w8, #2
	stp	w8, w8, [x19, #12]
	mov	x0, x21
	bl	_spin_unlock_irqrestore
Lloh24:
	adrp	x1, _wait@GOTPAGE
Lloh25:
	ldr	x1, [x1, _wait@GOTPAGEOFF]
	mov	x0, x20
	bl	_remove_wait_queue
	mov	w0, #0
Lloh26:
	adrp	x8, _TASK_RUNNING@GOTPAGE
Lloh27:
	ldr	x8, [x8, _TASK_RUNNING@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	ldr	x9, [x22]
	str	w8, [x9]
LBB0_10:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_wait,4,2                       ; @wait
	.comm	_current,8,3                    ; @current
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_R_SER_DMA_DSCR_COUNT_TX,4,2    ; @R_SER_DMA_DSCR_COUNT_TX
	.comm	_TASK_INTERRUPTIBLE,4,2         ; @TASK_INTERRUPTIBLE
	.comm	_FRAME_TX_US,4,2                ; @FRAME_TX_US
	.comm	_HZ,4,2                         ; @HZ
	.comm	_R_SER_DMA_CUR_DSCR_ADDR_TX,4,2 ; @R_SER_DMA_CUR_DSCR_ADDR_TX
	.comm	_M_DMA_CURDSCR_ADDR,4,2         ; @M_DMA_CURDSCR_ADDR
	.comm	_TASK_RUNNING,4,2               ; @TASK_RUNNING
	.no_dead_strip	_drain_dac
.subsections_via_symbols
