	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_audio_set_params               ## -- Begin function audio_set_params
	.p2align	4, 0x90
_audio_set_params:                      ## @audio_set_params
	.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	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	callq	_assert
	movq	%r14, %rdi
	callq	_assert
	movl	(%rbx), %r15d
	testl	%r15d, %r15d
	js	LBB0_1
## %bb.2:
	cmpl	$0, 4(%rbx)
	je	LBB0_5
## %bb.3:
	movq	_SNDCTL_DSP_RESET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r15d, %edi
	xorl	%edx, %edx
	callq	_ioctl
	cmpl	$-1, %eax
	jne	LBB0_6
## %bb.4:
	movl	(%rbx), %esi
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_18
LBB0_1:
	movl	32(%rbx), %esi
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_DPRINTF
	jmp	LBB0_19
LBB0_5:
	movl	$1, 4(%rbx)
LBB0_6:
	movl	8(%r14), %eax
	movl	%eax, -36(%rbp)
	movq	_SNDCTL_DSP_SETFMT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-36(%rbp), %rdx
	movl	%r15d, %edi
	callq	_ioctl
	cmpl	$-1, %eax
	je	LBB0_7
## %bb.8:
	movl	-36(%rbp), %esi
	movl	8(%r14), %edx
	cmpl	%edx, %esi
	jne	LBB0_9
## %bb.10:
	movl	12(%r14), %eax
	movl	%eax, -32(%rbp)
	movq	_SNDCTL_DSP_CHANNELS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-32(%rbp), %rdx
	movl	%r15d, %edi
	callq	_ioctl
	cmpl	$-1, %eax
	je	LBB0_11
## %bb.12:
	movl	-32(%rbp), %esi
	movl	12(%r14), %edx
	cmpl	%edx, %esi
	jne	LBB0_13
## %bb.14:
	movl	16(%r14), %eax
	movl	%eax, -28(%rbp)
	movq	_SNDCTL_DSP_SPEED@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-28(%rbp), %rdx
	movl	%r15d, %edi
	callq	_ioctl
	cmpl	$-1, %eax
	je	LBB0_15
## %bb.16:
	movl	-28(%rbp), %esi
	movl	16(%r14), %edx
	xorl	%eax, %eax
	cmpl	%edx, %esi
	je	LBB0_20
## %bb.17:
	leaq	L_.str.7(%rip), %rdi
	jmp	LBB0_18
LBB0_7:
	movl	8(%r14), %esi
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_18
LBB0_9:
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_18
LBB0_11:
	movl	12(%r14), %esi
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str.4(%rip), %rdi
	jmp	LBB0_18
LBB0_13:
	leaq	L_.str.5(%rip), %rdi
	jmp	LBB0_18
LBB0_15:
	movl	16(%r14), %esi
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str.6(%rip), %rdi
LBB0_18:
	xorl	%eax, %eax
	callq	_DPRINTF
LBB0_19:
	movl	$-1, %eax
LBB0_20:
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Incorrect audio device descriptor for %s\n"

	.comm	_SNDCTL_DSP_RESET,4,2           ## @SNDCTL_DSP_RESET
L_.str.1:                               ## @.str.1
	.asciz	"Failed to reset fd: %d, errno: %d\n"

	.comm	_errno,4,2                      ## @errno
	.comm	_SNDCTL_DSP_SETFMT,4,2          ## @SNDCTL_DSP_SETFMT
L_.str.2:                               ## @.str.2
	.asciz	"Fail to set fmt: 0x%x errno: %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"Mismatch format: 0x%x params->format: 0x%x\n"

	.comm	_SNDCTL_DSP_CHANNELS,4,2        ## @SNDCTL_DSP_CHANNELS
L_.str.4:                               ## @.str.4
	.asciz	"Fail to set channels: %d errno: %d\n"

L_.str.5:                               ## @.str.5
	.asciz	"Mismatch channels: %d params->channels: %d\n"

	.comm	_SNDCTL_DSP_SPEED,4,2           ## @SNDCTL_DSP_SPEED
L_.str.6:                               ## @.str.6
	.asciz	"Fail to set speed: %d errno: %d\n"

L_.str.7:                               ## @.str.7
	.asciz	"Mismatch rate: %d params->rate: %d\n"

	.comm	_SNDCTL_DSP_GETISPACE,4,2       ## @SNDCTL_DSP_GETISPACE
	.comm	_SNDCTL_DSP_GETOSPACE,4,2       ## @SNDCTL_DSP_GETOSPACE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_audio_set_params               ; -- Begin function audio_set_params
	.p2align	2
_audio_set_params:                      ; @audio_set_params
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x19, x1
	mov	x21, x0
	bl	_assert
	mov	x0, x19
	bl	_assert
	ldr	w20, [x21]
	tbnz	w20, #31, LBB0_4
; %bb.1:
	ldr	w8, [x21, #4]
	cbz	w8, LBB0_5
; %bb.2:
Lloh0:
	adrp	x8, _SNDCTL_DSP_RESET@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SNDCTL_DSP_RESET@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, #0
	bl	_ioctl
	cmn	w0, #1
	b.ne	LBB0_6
; %bb.3:
	ldr	w1, [x21]
Lloh3:
	adrp	x8, _errno@GOTPAGE
Lloh4:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	x8, [sp]
Lloh6:
	adrp	x0, l_.str.1@PAGE
Lloh7:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_19
LBB0_4:
	ldr	w1, [x21, #32]
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_19
LBB0_5:
	mov	w8, #1
	str	w8, [x21, #4]
LBB0_6:
	ldr	w8, [x19, #8]
	str	w8, [sp, #28]
Lloh10:
	adrp	x8, _SNDCTL_DSP_SETFMT@GOTPAGE
Lloh11:
	ldr	x8, [x8, _SNDCTL_DSP_SETFMT@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	add	x2, sp, #28
	mov	x0, x20
	bl	_ioctl
	cmn	w0, #1
	b.eq	LBB0_13
; %bb.7:
	ldr	w1, [sp, #28]
	ldr	w8, [x19, #8]
	cmp	w1, w8
	b.ne	LBB0_14
; %bb.8:
	ldr	w8, [x19, #12]
	str	w8, [sp, #24]
Lloh13:
	adrp	x8, _SNDCTL_DSP_CHANNELS@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SNDCTL_DSP_CHANNELS@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	add	x2, sp, #24
	mov	x0, x20
	bl	_ioctl
	cmn	w0, #1
	b.eq	LBB0_15
; %bb.9:
	ldr	w1, [sp, #24]
	ldr	w8, [x19, #12]
	cmp	w1, w8
	b.ne	LBB0_16
; %bb.10:
	ldr	w8, [x19, #16]
	str	w8, [sp, #20]
Lloh16:
	adrp	x8, _SNDCTL_DSP_SPEED@GOTPAGE
Lloh17:
	ldr	x8, [x8, _SNDCTL_DSP_SPEED@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	add	x2, sp, #20
	mov	x0, x20
	bl	_ioctl
	cmn	w0, #1
	b.eq	LBB0_17
; %bb.11:
	ldr	w1, [sp, #20]
	ldr	w8, [x19, #16]
	cmp	w1, w8
	b.ne	LBB0_18
; %bb.12:
	mov	w0, #0
	b	LBB0_20
LBB0_13:
	ldr	w1, [x19, #8]
Lloh19:
	adrp	x8, _errno@GOTPAGE
Lloh20:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	str	x8, [sp]
Lloh22:
	adrp	x0, l_.str.2@PAGE
Lloh23:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_19
LBB0_14:
	str	x8, [sp]
Lloh24:
	adrp	x0, l_.str.3@PAGE
Lloh25:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_19
LBB0_15:
	ldr	w1, [x19, #12]
Lloh26:
	adrp	x8, _errno@GOTPAGE
Lloh27:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	str	x8, [sp]
Lloh29:
	adrp	x0, l_.str.4@PAGE
Lloh30:
	add	x0, x0, l_.str.4@PAGEOFF
	b	LBB0_19
LBB0_16:
	str	x8, [sp]
Lloh31:
	adrp	x0, l_.str.5@PAGE
Lloh32:
	add	x0, x0, l_.str.5@PAGEOFF
	b	LBB0_19
LBB0_17:
	ldr	w1, [x19, #16]
Lloh33:
	adrp	x8, _errno@GOTPAGE
Lloh34:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh35:
	ldr	w8, [x8]
	str	x8, [sp]
Lloh36:
	adrp	x0, l_.str.6@PAGE
Lloh37:
	add	x0, x0, l_.str.6@PAGEOFF
	b	LBB0_19
LBB0_18:
	str	x8, [sp]
Lloh38:
	adrp	x0, l_.str.7@PAGE
Lloh39:
	add	x0, x0, l_.str.7@PAGEOFF
LBB0_19:
	bl	_DPRINTF
	mov	w0, #-1
LBB0_20:
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpAdd	Lloh38, Lloh39
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Incorrect audio device descriptor for %s\n"

	.comm	_SNDCTL_DSP_RESET,4,2           ; @SNDCTL_DSP_RESET
l_.str.1:                               ; @.str.1
	.asciz	"Failed to reset fd: %d, errno: %d\n"

	.comm	_errno,4,2                      ; @errno
	.comm	_SNDCTL_DSP_SETFMT,4,2          ; @SNDCTL_DSP_SETFMT
l_.str.2:                               ; @.str.2
	.asciz	"Fail to set fmt: 0x%x errno: %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"Mismatch format: 0x%x params->format: 0x%x\n"

	.comm	_SNDCTL_DSP_CHANNELS,4,2        ; @SNDCTL_DSP_CHANNELS
l_.str.4:                               ; @.str.4
	.asciz	"Fail to set channels: %d errno: %d\n"

l_.str.5:                               ; @.str.5
	.asciz	"Mismatch channels: %d params->channels: %d\n"

	.comm	_SNDCTL_DSP_SPEED,4,2           ; @SNDCTL_DSP_SPEED
l_.str.6:                               ; @.str.6
	.asciz	"Fail to set speed: %d errno: %d\n"

l_.str.7:                               ; @.str.7
	.asciz	"Mismatch rate: %d params->rate: %d\n"

	.comm	_SNDCTL_DSP_GETISPACE,4,2       ; @SNDCTL_DSP_GETISPACE
	.comm	_SNDCTL_DSP_GETOSPACE,4,2       ; @SNDCTL_DSP_GETOSPACE
.subsections_via_symbols
