	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pcm_writei
_pcm_writei:                            ## @pcm_writei
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -24
	movq	_PCM_IN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rdi)
	jne	LBB0_1
## %bb.2:
	movq	_INT_MAX@GOTPCREL(%rip), %rax
	cmpl	%edx, (%rax)
	jae	LBB0_3
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_13:
	addq	$24, %rsp
	popq	%rbx
	popq	%rbp
	retq
LBB0_3:
	movq	%rdi, %rbx
	movq	%rsi, -16(%rbp)
	movl	%edx, -24(%rbp)
	movl	$0, -20(%rbp)
	cmpl	$0, 4(%rdi)
	je	LBB0_4
## %bb.8:
	movl	24(%rbx), %edi
	movq	_SNDRV_PCM_IOCTL_WRITEI_FRAMES@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-24(%rbp), %rdx
	callq	_ioctl
	testq	%rax, %rax
	je	LBB0_12
## %bb.9:
	movq	$0, 16(%rbx)
	movl	$0, 4(%rbx)
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_EPIPE@GOTPCREL(%rip), %rdx
	movl	$-1, %eax
	cmpl	(%rdx), %ecx
	jne	LBB0_13
## %bb.10:
	incl	8(%rbx)
	movq	_PCM_NORESTART@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_4
## %bb.11:
	negl	%ecx
	movl	%ecx, %eax
	jmp	LBB0_13
LBB0_4:
	movq	%rbx, %rdi
	callq	_pcm_prepare
	testl	%eax, %eax
	jne	LBB0_13
## %bb.5:
	movl	24(%rbx), %edi
	movq	_SNDRV_PCM_IOCTL_WRITEI_FRAMES@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-24(%rbp), %rdx
	callq	_ioctl
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	leaq	L_.str(%rip), %rdi
	callq	_RARCH_ERR
	movl	$-1, %eax
	jmp	LBB0_13
LBB0_12:
	movl	-20(%rbp), %eax
	jmp	LBB0_13
LBB0_7:
	movl	$1, 4(%rbx)
	xorl	%eax, %eax
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_PCM_IN,4,2                     ## @PCM_IN
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_INT_MAX,4,2                    ## @INT_MAX
	.comm	_SNDRV_PCM_IOCTL_WRITEI_FRAMES,4,2 ## @SNDRV_PCM_IOCTL_WRITEI_FRAMES
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"[TINYALSA]: Cannot write initial data.\n"

	.comm	_errno,4,2                      ## @errno
	.comm	_EPIPE,4,2                      ## @EPIPE
	.comm	_PCM_NORESTART,4,2              ## @PCM_NORESTART
	.comm	_TINYALSA_FRAMES_MAX,4,2        ## @TINYALSA_FRAMES_MAX
	.no_dead_strip	_pcm_writei
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pcm_writei
_pcm_writei:                            ; @pcm_writei
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _PCM_IN@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PCM_IN@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _INT_MAX@GOTPAGE
Lloh4:
	ldr	x8, [x8, _INT_MAX@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w8, w2
	b.hs	LBB0_5
LBB0_2:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
LBB0_3:
	neg	w0, w8
LBB0_4:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_5:
	mov	x19, x0
	str	x1, [sp, #8]
	stp	w2, wzr, [sp]
	ldr	w8, [x0, #4]
	cbz	w8, LBB0_9
; %bb.6:
	ldr	w0, [x19, #24]
Lloh9:
	adrp	x8, _SNDRV_PCM_IOCTL_WRITEI_FRAMES@GOTPAGE
Lloh10:
	ldr	x8, [x8, _SNDRV_PCM_IOCTL_WRITEI_FRAMES@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x2, sp
	bl	_ioctl
	cbz	x0, LBB0_12
; %bb.7:
	str	xzr, [x19, #16]
Lloh12:
	adrp	x8, _errno@GOTPAGE
Lloh13:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
	str	wzr, [x19, #4]
Lloh14:
	ldr	w8, [x8]
Lloh15:
	adrp	x9, _EPIPE@GOTPAGE
Lloh16:
	ldr	x9, [x9, _EPIPE@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_13
; %bb.8:
	ldr	w9, [x19, #8]
	add	w9, w9, #1
	str	w9, [x19, #8]
	ldr	w9, [x19]
Lloh18:
	adrp	x10, _PCM_NORESTART@GOTPAGE
Lloh19:
	ldr	x10, [x10, _PCM_NORESTART@GOTPAGEOFF]
Lloh20:
	ldr	w10, [x10]
	tst	w10, w9
	b.ne	LBB0_3
LBB0_9:
	mov	x0, x19
	bl	_pcm_prepare
	cbnz	w0, LBB0_4
; %bb.10:
	ldr	w0, [x19, #24]
Lloh21:
	adrp	x8, _SNDRV_PCM_IOCTL_WRITEI_FRAMES@GOTPAGE
Lloh22:
	ldr	x8, [x8, _SNDRV_PCM_IOCTL_WRITEI_FRAMES@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	mov	x2, sp
	bl	_ioctl
	cbz	x0, LBB0_14
; %bb.11:
Lloh24:
	adrp	x0, l_.str@PAGE
Lloh25:
	add	x0, x0, l_.str@PAGEOFF
	bl	_RARCH_ERR
	mov	w0, #-1
	b	LBB0_4
LBB0_12:
	ldr	w0, [sp, #4]
	b	LBB0_4
LBB0_13:
	mov	w0, #-1
	b	LBB0_4
LBB0_14:
	mov	w8, #1
	str	w8, [x19, #4]
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_PCM_IN,4,2                     ; @PCM_IN
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_INT_MAX,4,2                    ; @INT_MAX
	.comm	_SNDRV_PCM_IOCTL_WRITEI_FRAMES,4,2 ; @SNDRV_PCM_IOCTL_WRITEI_FRAMES
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"[TINYALSA]: Cannot write initial data.\n"

	.comm	_errno,4,2                      ; @errno
	.comm	_EPIPE,4,2                      ; @EPIPE
	.comm	_PCM_NORESTART,4,2              ; @PCM_NORESTART
	.comm	_TINYALSA_FRAMES_MAX,4,2        ; @TINYALSA_FRAMES_MAX
	.no_dead_strip	_pcm_writei
.subsections_via_symbols
