	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hdpvr_set_ctrl
_hdpvr_set_ctrl:                        ## @hdpvr_set_ctrl
	.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
	movl	(%rsi), %eax
	addl	$-128, %eax
	cmpl	$5, %eax
	ja	LBB0_16
## %bb.1:
	movq	%rsi, %rbx
	movq	%rdi, %r15
	xorl	%r14d, %r14d
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_14:
	movl	32(%r15), %eax
	movq	_HDPVR_CONSTANT@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_17
## %bb.15:
	movslq	4(%rbx), %rax
	imulq	$351843721, %rax, %rax          ## imm = 0x14F8B589
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$45, %rax
	addl	%ecx, %eax
	cltq
	cmpq	%rax, 16(%r15)
	jb	LBB0_12
LBB0_16:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_17
LBB0_4:
	movl	4(%rbx), %eax
	movq	_V4L2_MPEG_VIDEO_BITRATE_MODE_CBR@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_7
## %bb.5:
	movq	_HDPVR_CONSTANT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	cmpl	%edx, 32(%r15)
	je	LBB0_7
## %bb.6:
	movl	%edx, 32(%r15)
	movq	_CTRL_BITRATE_MODE_VALUE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_hdpvr_config_call
	movl	4(%rbx), %eax
LBB0_7:
	movq	_V4L2_MPEG_VIDEO_BITRATE_MODE_VBR@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_17
## %bb.8:
	movl	32(%r15), %eax
	movq	_HDPVR_CONSTANT@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_17
## %bb.9:
	movq	_HDPVR_VARIABLE_AVERAGE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%edx, 32(%r15)
	movq	_CTRL_BITRATE_MODE_VALUE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_hdpvr_config_call
	jmp	LBB0_17
LBB0_10:
	movslq	4(%rbx), %rax
	imulq	$351843721, %rax, %rax          ## imm = 0x14F8B589
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$45, %rax
	addl	%ecx, %eax
	cltq
	movq	%rax, 16(%r15)
	cmpq	%rax, 24(%r15)
	ja	LBB0_13
## %bb.11:
	incq	%rax
LBB0_12:
	movq	%rax, 24(%r15)
LBB0_13:
	movq	%r15, %rdi
	callq	_hdpvr_set_bitrate
	jmp	LBB0_17
LBB0_2:
	movq	_HDPVR_FLAG_AC3_CAP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r15)
	je	LBB0_17
## %bb.3:
	movl	4(%rbx), %edx
	movl	%edx, 8(%r15)
	movl	36(%r15), %esi
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_hdpvr_set_audio                ## TAILCALL
LBB0_17:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_17, LBB0_17-LJTI0_0
.set L0_0_set_14, LBB0_14-LJTI0_0
.set L0_0_set_4, LBB0_4-LJTI0_0
.set L0_0_set_10, LBB0_10-LJTI0_0
.set L0_0_set_2, LBB0_2-LJTI0_0
LJTI0_0:
	.long	L0_0_set_17
	.long	L0_0_set_14
	.long	L0_0_set_4
	.long	L0_0_set_10
	.long	L0_0_set_17
	.long	L0_0_set_2
	.end_data_region
                                        ## -- End function
	.comm	_HDPVR_FLAG_AC3_CAP,4,2         ## @HDPVR_FLAG_AC3_CAP
	.comm	_V4L2_MPEG_VIDEO_BITRATE_MODE_CBR,4,2 ## @V4L2_MPEG_VIDEO_BITRATE_MODE_CBR
	.comm	_HDPVR_CONSTANT,4,2             ## @HDPVR_CONSTANT
	.comm	_CTRL_BITRATE_MODE_VALUE,4,2    ## @CTRL_BITRATE_MODE_VALUE
	.comm	_V4L2_MPEG_VIDEO_BITRATE_MODE_VBR,4,2 ## @V4L2_MPEG_VIDEO_BITRATE_MODE_VBR
	.comm	_HDPVR_VARIABLE_AVERAGE,4,2     ## @HDPVR_VARIABLE_AVERAGE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_hdpvr_set_ctrl
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hdpvr_set_ctrl
_hdpvr_set_ctrl:                        ; @hdpvr_set_ctrl
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	ldr	w8, [x1]
	sub	w8, w8, #128
	cmp	w8, #5
	b.hi	LBB0_4
; %bb.1:
	mov	x20, x1
	mov	x19, x0
	mov	w0, #0
Lloh0:
	adrp	x9, lJTI0_0@PAGE
Lloh1:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_2
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_2:
	ldr	w8, [x19, #32]
Lloh2:
	adrp	x9, _HDPVR_CONSTANT@GOTPAGE
Lloh3:
	ldr	x9, [x9, _HDPVR_CONSTANT@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	cmp	w8, w9
	b.eq	LBB0_17
; %bb.3:
	ldrsw	x8, [x20, #4]
	mov	w9, #46473
	movk	w9, #5368, lsl #16
	mul	x8, x8, x9
	lsr	x9, x8, #32
	lsr	x8, x8, #63
	add	w8, w8, w9, asr #13
	sxtw	x8, w8
	ldr	x9, [x19, #16]
	cmp	x9, x8
	b.lo	LBB0_13
LBB0_4:
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_18
LBB0_5:
	ldr	w8, [x20, #4]
Lloh8:
	adrp	x9, _V4L2_MPEG_VIDEO_BITRATE_MODE_CBR@GOTPAGE
Lloh9:
	ldr	x9, [x9, _V4L2_MPEG_VIDEO_BITRATE_MODE_CBR@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
Lloh11:
	adrp	x21, _HDPVR_CONSTANT@GOTPAGE
Lloh12:
	ldr	x21, [x21, _HDPVR_CONSTANT@GOTPAGEOFF]
	cmp	w8, w9
	b.ne	LBB0_8
; %bb.6:
	ldr	w9, [x19, #32]
	ldr	w2, [x21]
	cmp	w9, w2
	b.eq	LBB0_8
; %bb.7:
	str	w2, [x19, #32]
Lloh13:
	adrp	x8, _CTRL_BITRATE_MODE_VALUE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _CTRL_BITRATE_MODE_VALUE@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_hdpvr_config_call
	ldr	w8, [x20, #4]
LBB0_8:
Lloh16:
	adrp	x9, _V4L2_MPEG_VIDEO_BITRATE_MODE_VBR@GOTPAGE
Lloh17:
	ldr	x9, [x9, _V4L2_MPEG_VIDEO_BITRATE_MODE_VBR@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_17
; %bb.9:
	ldr	w8, [x19, #32]
	ldr	w9, [x21]
	cmp	w8, w9
	b.ne	LBB0_17
; %bb.10:
Lloh19:
	adrp	x8, _HDPVR_VARIABLE_AVERAGE@GOTPAGE
Lloh20:
	ldr	x8, [x8, _HDPVR_VARIABLE_AVERAGE@GOTPAGEOFF]
Lloh21:
	ldr	w2, [x8]
	str	w2, [x19, #32]
Lloh22:
	adrp	x8, _CTRL_BITRATE_MODE_VALUE@GOTPAGE
Lloh23:
	ldr	x8, [x8, _CTRL_BITRATE_MODE_VALUE@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_hdpvr_config_call
	b	LBB0_17
LBB0_11:
	ldrsw	x8, [x20, #4]
	mov	w9, #46473
	movk	w9, #5368, lsl #16
	mul	x8, x8, x9
	lsr	x9, x8, #63
	asr	x8, x8, #45
	add	w8, w8, w9
	sxtw	x8, w8
	str	x8, [x19, #16]
	ldr	x9, [x19, #24]
	cmp	x9, x8
	b.hi	LBB0_14
; %bb.12:
	add	x8, x8, #1
LBB0_13:
	str	x8, [x19, #24]
LBB0_14:
	mov	x0, x19
	bl	_hdpvr_set_bitrate
	b	LBB0_17
LBB0_15:
	ldr	w8, [x19]
Lloh25:
	adrp	x9, _HDPVR_FLAG_AC3_CAP@GOTPAGE
Lloh26:
	ldr	x9, [x9, _HDPVR_FLAG_AC3_CAP@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_17
; %bb.16:
	ldr	w2, [x20, #4]
	str	w2, [x19, #8]
	ldr	w1, [x19, #36]
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_hdpvr_set_audio
LBB0_17:
	mov	w0, #0
LBB0_18:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_18-LBB0_2)>>2
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_5-LBB0_2)>>2
	.byte	(LBB0_11-LBB0_2)>>2
	.byte	(LBB0_18-LBB0_2)>>2
	.byte	(LBB0_15-LBB0_2)>>2
                                        ; -- End function
	.comm	_HDPVR_FLAG_AC3_CAP,4,2         ; @HDPVR_FLAG_AC3_CAP
	.comm	_V4L2_MPEG_VIDEO_BITRATE_MODE_CBR,4,2 ; @V4L2_MPEG_VIDEO_BITRATE_MODE_CBR
	.comm	_HDPVR_CONSTANT,4,2             ; @HDPVR_CONSTANT
	.comm	_CTRL_BITRATE_MODE_VALUE,4,2    ; @CTRL_BITRATE_MODE_VALUE
	.comm	_V4L2_MPEG_VIDEO_BITRATE_MODE_VBR,4,2 ; @V4L2_MPEG_VIDEO_BITRATE_MODE_VBR
	.comm	_HDPVR_VARIABLE_AVERAGE,4,2     ; @HDPVR_VARIABLE_AVERAGE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_hdpvr_set_ctrl
.subsections_via_symbols
