	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hdpvr_set_audio                ## -- Begin function hdpvr_set_audio
	.p2align	4, 0x90
_hdpvr_set_audio:                       ## @hdpvr_set_audio
	.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, %r12d
	movq	%rdi, %rbx
	movq	_HDPVR_FLAG_AC3_CAP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rdi)
	je	LBB0_4
## %bb.1:
	movl	%edx, %r15d
	leaq	16(%rbx), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	8(%rbx), %rdi
	xorl	%r13d, %r13d
	xorl	%esi, %esi
	movl	$2, %edx
	callq	_memset
	movq	8(%rbx), %rax
	movl	%r12d, (%rax)
	movq	_V4L2_MPEG_AUDIO_ENCODING_AAC@GOTPCREL(%rip), %rdx
	movl	$0, %ecx
	cmpl	%r15d, (%rdx)
	je	LBB0_5
## %bb.2:
	movq	_V4L2_MPEG_AUDIO_ENCODING_AC3@GOTPCREL(%rip), %rdx
	movl	$1, %ecx
	cmpl	%r15d, (%rdx)
	jne	LBB0_3
LBB0_5:
	movl	%ecx, 4(%rax)
	movl	20(%rbx), %r15d
	movl	%r15d, %edi
	xorl	%esi, %esi
	callq	_usb_sndctrlpipe
	movq	_CTRL_AUDIO_INPUT_VALUE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r8d
	movq	_CTRL_DEFAULT_INDEX@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r9d
	subq	$8, %rsp
	movl	%r15d, %edi
	movl	%eax, %esi
	movl	$1, %edx
	movl	$56, %ecx
	pushq	$1000                           ## imm = 0x3E8
	pushq	$2
	pushq	8(%rbx)
	callq	_usb_control_msg
	addq	$32, %rsp
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_mutex_unlock
	cmpl	$2, %ebx
	cmovel	%r13d, %ebx
	jmp	LBB0_6
LBB0_4:
	movq	_CTRL_AUDIO_INPUT_VALUE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	%r12d, %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_hdpvr_config_call              ## TAILCALL
LBB0_3:
	movq	%r14, %rdi
	callq	_mutex_unlock
	addq	$24, %rbx
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	movl	%r15d, %edx
	callq	_v4l2_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_6:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HDPVR_FLAG_AC3_CAP,4,2         ## @HDPVR_FLAG_AC3_CAP
	.comm	_V4L2_MPEG_AUDIO_ENCODING_AAC,4,2 ## @V4L2_MPEG_AUDIO_ENCODING_AAC
	.comm	_V4L2_MPEG_AUDIO_ENCODING_AC3,4,2 ## @V4L2_MPEG_AUDIO_ENCODING_AC3
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"invalid audio codec %d\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_CTRL_AUDIO_INPUT_VALUE,4,2     ## @CTRL_AUDIO_INPUT_VALUE
	.comm	_CTRL_DEFAULT_INDEX,4,2         ## @CTRL_DEFAULT_INDEX
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hdpvr_set_audio                ; -- Begin function hdpvr_set_audio
	.p2align	2
_hdpvr_set_audio:                       ; @hdpvr_set_audio
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x22, x1
	mov	x20, x0
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _HDPVR_FLAG_AC3_CAP@GOTPAGE
Lloh1:
	ldr	x9, [x9, _HDPVR_FLAG_AC3_CAP@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.1:
	mov	x21, x2
	add	x19, x20, #16
	mov	x0, x19
	bl	_mutex_lock
	ldr	x0, [x20, #8]
	mov	w1, #0
	mov	w2, #2
	bl	_memset
	mov	w9, #0
	ldr	x8, [x20, #8]
	str	w22, [x8]
Lloh3:
	adrp	x10, _V4L2_MPEG_AUDIO_ENCODING_AAC@GOTPAGE
Lloh4:
	ldr	x10, [x10, _V4L2_MPEG_AUDIO_ENCODING_AAC@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	cmp	w10, w21
	b.eq	LBB0_4
; %bb.2:
Lloh6:
	adrp	x9, _V4L2_MPEG_AUDIO_ENCODING_AC3@GOTPAGE
Lloh7:
	ldr	x9, [x9, _V4L2_MPEG_AUDIO_ENCODING_AC3@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	cmp	w9, w21
	b.ne	LBB0_6
; %bb.3:
	mov	w9, #1
LBB0_4:
	str	w9, [x8, #4]
	ldr	w21, [x20, #20]
	mov	x0, x21
	mov	w1, #0
	bl	_usb_sndctrlpipe
	mov	x1, x0
Lloh9:
	adrp	x8, _CTRL_AUDIO_INPUT_VALUE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _CTRL_AUDIO_INPUT_VALUE@GOTPAGEOFF]
Lloh11:
	ldr	w4, [x8]
Lloh12:
	adrp	x8, _CTRL_DEFAULT_INDEX@GOTPAGE
Lloh13:
	ldr	x8, [x8, _CTRL_DEFAULT_INDEX@GOTPAGEOFF]
Lloh14:
	ldr	w5, [x8]
	ldr	x6, [x20, #8]
	mov	w8, #1000
	str	w8, [sp]
	mov	x0, x21
	mov	w2, #1
	mov	w3, #56
	mov	w7, #2
	bl	_usb_control_msg
	mov	x20, x0
	mov	x0, x19
	bl	_mutex_unlock
	cmp	w20, #2
	csel	w0, wzr, w20, eq
	b	LBB0_7
LBB0_5:
Lloh15:
	adrp	x8, _CTRL_AUDIO_INPUT_VALUE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _CTRL_AUDIO_INPUT_VALUE@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, x22
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	b	_hdpvr_config_call
LBB0_6:
	mov	x0, x19
	bl	_mutex_unlock
	add	x0, x20, #24
Lloh18:
	adrp	x1, l_.str@PAGE
Lloh19:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x21
	bl	_v4l2_err
Lloh20:
	adrp	x8, _EINVAL@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_HDPVR_FLAG_AC3_CAP,4,2         ; @HDPVR_FLAG_AC3_CAP
	.comm	_V4L2_MPEG_AUDIO_ENCODING_AAC,4,2 ; @V4L2_MPEG_AUDIO_ENCODING_AAC
	.comm	_V4L2_MPEG_AUDIO_ENCODING_AC3,4,2 ; @V4L2_MPEG_AUDIO_ENCODING_AC3
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invalid audio codec %d\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_CTRL_AUDIO_INPUT_VALUE,4,2     ; @CTRL_AUDIO_INPUT_VALUE
	.comm	_CTRL_DEFAULT_INDEX,4,2         ; @CTRL_DEFAULT_INDEX
.subsections_via_symbols
