	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pulse_write_packet
_pulse_write_packet:                    ## @pulse_write_packet
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	8(%rdi), %rbx
	testq	%rsi, %rsi
	je	LBB0_20
## %bb.1:
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	(%rsi), %rax
	movq	_AV_NOPTS_VALUE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_3
## %bb.2:
	movq	%rax, (%rbx)
LBB0_3:
	movq	8(%r15), %rax
	testq	%rax, %rax
	jne	LBB0_8
## %bb.4:
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movq	(%r14), %rax
	movq	(%rax), %r14
	movq	8(%r14), %rax
	movl	8(%rax), %edi
	movl	12(%rax), %r12d
	movq	16(%r15), %r13
	callq	_av_get_bytes_per_sample
	movq	%rax, %rcx
	movq	8(%r14), %rax
	imulq	(%rax), %rcx
	movq	%r13, %rax
	orq	%rcx, %rax
	shrq	$32, %rax
	je	LBB0_5
## %bb.6:
	movq	%r13, %rax
	cqto
	idivq	%rcx
	jmp	LBB0_7
LBB0_20:
	movq	%rbx, %rdi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_pulse_flash_stream             ## TAILCALL
LBB0_5:
	movl	%r13d, %eax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $eax killed $eax def $rax
LBB0_7:
	movl	(%r14), %edx
	shlq	$32, %r12
	orq	$1, %r12
	movq	%rax, %rdi
	movq	%r12, %rsi
	callq	_av_rescale_q
	movq	-48(%rbp), %r14                 ## 8-byte Reload
LBB0_8:
	addq	%rax, (%rbx)
	movl	16(%rbx), %edi
	callq	_pa_threaded_mainloop_lock
	movl	20(%rbx), %edi
	callq	_pa_stream_get_state
	movl	%eax, %edi
	callq	_PA_STREAM_IS_GOOD
	testl	%eax, %eax
	je	LBB0_17
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movl	20(%rbx), %edi
	callq	_pa_stream_writable_size
	cmpq	8(%rbx), %rax
	jge	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	cmpq	$0, 24(%rbx)
	movl	16(%rbx), %edi
	jne	LBB0_21
## %bb.11:                              ##   in Loop: Header=BB0_9 Depth=1
	callq	_pa_threaded_mainloop_wait
	jmp	LBB0_9
LBB0_12:
	movl	20(%rbx), %edi
	movl	24(%r15), %esi
	movq	16(%r15), %rdx
	movq	_PA_SEEK_RELATIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_pa_stream_write
	testl	%eax, %eax
	js	LBB0_13
## %bb.14:
	movl	20(%rbx), %edi
	callq	_pa_stream_writable_size
	movq	%rax, -56(%rbp)
	cmpq	8(%rbx), %rax
	jl	LBB0_16
## %bb.15:
	movq	_AV_DEV_TO_APP_BUFFER_WRITABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-56(%rbp), %rdx
	movq	%r14, %rdi
	movl	$8, %ecx
	callq	_avdevice_dev_to_app_control_message
LBB0_16:
	movl	16(%rbx), %edi
	callq	_pa_threaded_mainloop_unlock
	xorl	%eax, %eax
	jmp	LBB0_19
LBB0_17:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_av_log
	jmp	LBB0_18
LBB0_21:
	callq	_pa_threaded_mainloop_unlock
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_13:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r14d
	movl	%eax, %edi
	callq	_pa_strerror
	leaq	L_.str.1(%rip), %rdx
	movq	%rbx, %rdi
	movl	%r14d, %esi
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_av_log
LBB0_18:
	movl	16(%rbx), %edi
	callq	_pa_threaded_mainloop_unlock
	movq	_AVERROR_EXTERNAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_19:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_NOPTS_VALUE,8,3             ## @AV_NOPTS_VALUE
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"PulseAudio stream is in invalid state.\n"

	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	_PA_SEEK_RELATIVE,4,2           ## @PA_SEEK_RELATIVE
L_.str.1:                               ## @.str.1
	.asciz	"pa_stream_write failed: %s\n"

	.comm	_AV_DEV_TO_APP_BUFFER_WRITABLE,4,2 ## @AV_DEV_TO_APP_BUFFER_WRITABLE
	.comm	_AVERROR_EXTERNAL,4,2           ## @AVERROR_EXTERNAL
	.no_dead_strip	_pulse_write_packet
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pulse_write_packet
_pulse_write_packet:                    ; @pulse_write_packet
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x19, [x0, #8]
	cbz	x1, LBB0_9
; %bb.1:
	mov	x21, x1
	mov	x20, x0
	ldr	x8, [x1]
Lloh0:
	adrp	x9, _AV_NOPTS_VALUE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _AV_NOPTS_VALUE@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_3
; %bb.2:
	str	x8, [x19]
LBB0_3:
	ldr	x0, [x21, #8]
	cbnz	x0, LBB0_5
; %bb.4:
	ldr	x8, [x20]
	ldr	x22, [x8]
	ldr	x8, [x22, #8]
	ldr	x23, [x21, #16]
	ldp	w0, w24, [x8, #8]
	bl	_av_get_bytes_per_sample
	ldr	x8, [x22, #8]
	ldr	x8, [x8]
	mul	x8, x8, x0
	sdiv	x0, x23, x8
	ldr	w2, [x22]
	mov	w1, #1
	bfi	x1, x24, #32, #32
	bl	_av_rescale_q
LBB0_5:
	ldr	x8, [x19]
	add	x8, x8, x0
	str	x8, [x19]
	ldr	w0, [x19, #16]
	bl	_pa_threaded_mainloop_lock
	ldr	w0, [x19, #20]
	bl	_pa_stream_get_state
	bl	_PA_STREAM_IS_GOOD
	cbz	w0, LBB0_14
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x19, #20]
	bl	_pa_stream_writable_size
	ldr	x8, [x19, #8]
	cmp	x0, x8
	b.ge	LBB0_10
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [x19, #24]
	ldr	w0, [x19, #16]
	cbnz	x8, LBB0_18
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	bl	_pa_threaded_mainloop_wait
	b	LBB0_6
LBB0_9:
	mov	x0, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	b	_pulse_flash_stream
LBB0_10:
	ldr	w0, [x19, #20]
	ldr	w1, [x21, #24]
	ldr	x2, [x21, #16]
Lloh3:
	adrp	x8, _PA_SEEK_RELATIVE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PA_SEEK_RELATIVE@GOTPAGEOFF]
Lloh5:
	ldr	w5, [x8]
	mov	x3, #0
	mov	w4, #0
	bl	_pa_stream_write
	tbnz	w0, #31, LBB0_15
; %bb.11:
	ldr	w0, [x19, #20]
	bl	_pa_stream_writable_size
	str	x0, [sp, #8]
	ldr	x8, [x19, #8]
	cmp	x0, x8
	b.lt	LBB0_13
; %bb.12:
Lloh6:
	adrp	x8, _AV_DEV_TO_APP_BUFFER_WRITABLE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _AV_DEV_TO_APP_BUFFER_WRITABLE@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	add	x2, sp, #8
	mov	x0, x20
	mov	w3, #8
	bl	_avdevice_dev_to_app_control_message
LBB0_13:
	ldr	w0, [x19, #16]
	bl	_pa_threaded_mainloop_unlock
	mov	w0, #0
	b	LBB0_17
LBB0_14:
Lloh9:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh10:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
Lloh12:
	adrp	x2, l_.str@PAGE
Lloh13:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	b	LBB0_16
LBB0_15:
Lloh14:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh15:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh16:
	ldr	w20, [x8]
	bl	_pa_strerror
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh17:
	adrp	x2, l_.str.1@PAGE
Lloh18:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x1, x20
LBB0_16:
	bl	_av_log
	ldr	w0, [x19, #16]
	bl	_pa_threaded_mainloop_unlock
Lloh19:
	adrp	x8, _AVERROR_EXTERNAL@GOTPAGE
Lloh20:
	ldr	x8, [x8, _AVERROR_EXTERNAL@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
LBB0_17:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_18:
	bl	_pa_threaded_mainloop_unlock
Lloh22:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh23:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
Lloh24:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	b	_AVERROR
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_NOPTS_VALUE,8,3             ; @AV_NOPTS_VALUE
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"PulseAudio stream is in invalid state.\n"

	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_PA_SEEK_RELATIVE,4,2           ; @PA_SEEK_RELATIVE
l_.str.1:                               ; @.str.1
	.asciz	"pa_stream_write failed: %s\n"

	.comm	_AV_DEV_TO_APP_BUFFER_WRITABLE,4,2 ; @AV_DEV_TO_APP_BUFFER_WRITABLE
	.comm	_AVERROR_EXTERNAL,4,2           ; @AVERROR_EXTERNAL
	.no_dead_strip	_pulse_write_packet
.subsections_via_symbols
