	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_snd_usb_caiaq_set_audio_params ## -- Begin function snd_usb_caiaq_set_audio_params
	.p2align	4, 0x90
_snd_usb_caiaq_set_audio_params:        ## @snd_usb_caiaq_set_audio_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
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	cmpl	$88199, %esi                    ## imm = 0x15887
	jle	LBB0_5
## %bb.1:
	cmpl	$88200, %esi                    ## imm = 0x15888
	je	LBB0_8
## %bb.2:
	cmpl	$96000, %esi                    ## imm = 0x17700
	je	LBB0_9
## %bb.3:
	cmpl	$192000, %esi                   ## imm = 0x2EE00
	jne	LBB0_14
## %bb.4:
	movq	_SAMPLERATE_192000@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_5:
	cmpl	$44100, %esi                    ## imm = 0xAC44
	je	LBB0_10
## %bb.6:
	cmpl	$48000, %esi                    ## imm = 0xBB80
	jne	LBB0_14
## %bb.7:
	movq	_SAMPLERATE_48000@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_8:
	movq	_SAMPLERATE_88200@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_9:
	movq	_SAMPLERATE_96000@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_10:
	movq	_SAMPLERATE_44100@GOTPCREL(%rip), %rax
LBB0_11:
	movb	(%rax), %al
	movb	%al, -29(%rbp)
	cmpl	$16, %edx
	je	LBB0_17
## %bb.12:
	cmpl	$24, %edx
	jne	LBB0_14
## %bb.13:
	movq	_DEPTH_24@GOTPCREL(%rip), %rax
	jmp	LBB0_18
LBB0_14:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_15:
	xorl	%ebx, %ebx
LBB0_16:
	subl	(%rax), %ebx
	jmp	LBB0_25
LBB0_17:
	movq	_DEPTH_16@GOTPCREL(%rip), %rax
LBB0_18:
	movb	(%rax), %al
	movb	%al, -28(%rbp)
	movb	%cl, -27(%rbp)
	movb	%ch, -26(%rbp)
	movb	$1, -25(%rbp)
	leaq	L_.str(%rip), %rdi
	movl	%ecx, %r15d
	xorl	%eax, %eax
	callq	_debug
	movl	$-1, (%r14)
	movq	_EP1_CMD_AUDIO_PARAMS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-29(%rbp), %rdx
	movq	%r14, %rdi
	movl	$5, %ecx
	callq	_snd_usb_caiaq_send_command
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_25
## %bb.19:
	movl	(%r14), %esi
	movl	8(%r14), %edi
	notl	%esi
	shrl	$31, %esi
	movq	_HZ@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_wait_event_timeout
	testl	%eax, %eax
	je	LBB0_22
## %bb.20:
	cmpl	$1, (%r14)
	jne	LBB0_23
## %bb.21:
	movl	%r15d, 4(%r14)
	jmp	LBB0_24
LBB0_22:
	movq	_EPIPE@GOTPCREL(%rip), %rax
	jmp	LBB0_15
LBB0_23:
	leaq	L_.str.1(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_debug
	cmpl	$1, (%r14)
	jne	LBB0_26
LBB0_24:
	xorl	%ebx, %ebx
LBB0_25:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_26:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_SAMPLERATE_44100,1,0           ## @SAMPLERATE_44100
	.comm	_SAMPLERATE_48000,1,0           ## @SAMPLERATE_48000
	.comm	_SAMPLERATE_88200,1,0           ## @SAMPLERATE_88200
	.comm	_SAMPLERATE_96000,1,0           ## @SAMPLERATE_96000
	.comm	_SAMPLERATE_192000,1,0          ## @SAMPLERATE_192000
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_DEPTH_16,1,0                   ## @DEPTH_16
	.comm	_DEPTH_24,1,0                   ## @DEPTH_24
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"setting audio params: %d Hz, %d bits, %d bpp\n"

	.comm	_EP1_CMD_AUDIO_PARAMS,4,2       ## @EP1_CMD_AUDIO_PARAMS
	.comm	_HZ,4,2                         ## @HZ
	.comm	_EPIPE,4,2                      ## @EPIPE
L_.str.1:                               ## @.str.1
	.asciz	"unable to set the device's audio params\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_snd_usb_caiaq_set_audio_params ; -- Begin function snd_usb_caiaq_set_audio_params
	.p2align	2
_snd_usb_caiaq_set_audio_params:        ; @snd_usb_caiaq_set_audio_params
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x3
                                        ; kill: def $w2 killed $w2 def $x2
                                        ; kill: def $w1 killed $w1 def $x1
	mov	x19, x0
	mov	w8, #22663
	movk	w8, #1, lsl #16
	cmp	w1, w8
	b.le	LBB0_5
; %bb.1:
	mov	w8, #22664
	movk	w8, #1, lsl #16
	cmp	w1, w8
	b.eq	LBB0_8
; %bb.2:
	mov	w8, #30464
	movk	w8, #1, lsl #16
	cmp	w1, w8
	b.eq	LBB0_9
; %bb.3:
	mov	w8, #60928
	movk	w8, #2, lsl #16
	cmp	w1, w8
	b.ne	LBB0_22
; %bb.4:
Lloh0:
	adrp	x8, _SAMPLERATE_192000@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SAMPLERATE_192000@GOTPAGEOFF]
	b	LBB0_11
LBB0_5:
	mov	w8, #44100
	cmp	w1, w8
	b.eq	LBB0_10
; %bb.6:
	mov	w8, #48000
	cmp	w1, w8
	b.ne	LBB0_22
; %bb.7:
Lloh2:
	adrp	x8, _SAMPLERATE_48000@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SAMPLERATE_48000@GOTPAGEOFF]
	b	LBB0_11
LBB0_8:
Lloh4:
	adrp	x8, _SAMPLERATE_88200@GOTPAGE
Lloh5:
	ldr	x8, [x8, _SAMPLERATE_88200@GOTPAGEOFF]
	b	LBB0_11
LBB0_9:
Lloh6:
	adrp	x8, _SAMPLERATE_96000@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SAMPLERATE_96000@GOTPAGEOFF]
	b	LBB0_11
LBB0_10:
Lloh8:
	adrp	x8, _SAMPLERATE_44100@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SAMPLERATE_44100@GOTPAGEOFF]
LBB0_11:
	ldrb	w8, [x8]
	sturb	w8, [x29, #-21]
	cmp	w2, #16
	b.eq	LBB0_14
; %bb.12:
	cmp	w2, #24
	b.ne	LBB0_22
; %bb.13:
Lloh10:
	adrp	x8, _DEPTH_24@GOTPAGE
Lloh11:
	ldr	x8, [x8, _DEPTH_24@GOTPAGEOFF]
	b	LBB0_15
LBB0_14:
Lloh12:
	adrp	x8, _DEPTH_16@GOTPAGE
Lloh13:
	ldr	x8, [x8, _DEPTH_16@GOTPAGEOFF]
LBB0_15:
	ldrb	w8, [x8]
	sturb	w8, [x29, #-20]
	sturb	w20, [x29, #-19]
	lsr	w8, w20, #8
	sturb	w8, [x29, #-18]
	mov	w8, #1
	sturb	w8, [x29, #-17]
	stp	x2, x20, [sp, #8]
	str	x1, [sp]
Lloh14:
	adrp	x0, l_.str@PAGE
Lloh15:
	add	x0, x0, l_.str@PAGEOFF
	bl	_debug
	mov	w8, #-1
	str	w8, [x19]
Lloh16:
	adrp	x8, _EP1_CMD_AUDIO_PARAMS@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EP1_CMD_AUDIO_PARAMS@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	sub	x2, x29, #21
	mov	x0, x19
	mov	w3, #5
	bl	_snd_usb_caiaq_send_command
	cbnz	w0, LBB0_24
; %bb.16:
	ldr	w0, [x19, #8]
	ldr	w8, [x19]
	mvn	w8, w8
	lsr	w1, w8, #31
Lloh19:
	adrp	x8, _HZ@GOTPAGE
Lloh20:
	ldr	x8, [x8, _HZ@GOTPAGEOFF]
Lloh21:
	ldr	w2, [x8]
	bl	_wait_event_timeout
	cbz	w0, LBB0_19
; %bb.17:
	ldr	w8, [x19]
	cmp	w8, #1
	b.ne	LBB0_20
; %bb.18:
	str	w20, [x19, #4]
	b	LBB0_21
LBB0_19:
Lloh22:
	adrp	x8, _EPIPE@GOTPAGE
Lloh23:
	ldr	x8, [x8, _EPIPE@GOTPAGEOFF]
	b	LBB0_23
LBB0_20:
Lloh24:
	adrp	x0, l_.str.1@PAGE
Lloh25:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_debug
	ldr	w8, [x19]
	cmp	w8, #1
	b.ne	LBB0_22
LBB0_21:
	mov	w0, #0
	b	LBB0_24
LBB0_22:
Lloh26:
	adrp	x8, _EINVAL@GOTPAGE
Lloh27:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_23:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_24:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_SAMPLERATE_44100,1,0           ; @SAMPLERATE_44100
	.comm	_SAMPLERATE_48000,1,0           ; @SAMPLERATE_48000
	.comm	_SAMPLERATE_88200,1,0           ; @SAMPLERATE_88200
	.comm	_SAMPLERATE_96000,1,0           ; @SAMPLERATE_96000
	.comm	_SAMPLERATE_192000,1,0          ; @SAMPLERATE_192000
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_DEPTH_16,1,0                   ; @DEPTH_16
	.comm	_DEPTH_24,1,0                   ; @DEPTH_24
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"setting audio params: %d Hz, %d bits, %d bpp\n"

	.comm	_EP1_CMD_AUDIO_PARAMS,4,2       ; @EP1_CMD_AUDIO_PARAMS
	.comm	_HZ,4,2                         ; @HZ
	.comm	_EPIPE,4,2                      ; @EPIPE
l_.str.1:                               ; @.str.1
	.asciz	"unable to set the device's audio params\n"

.subsections_via_symbols
