	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pvr2_enum_input
_pvr2_enum_input:                       ## @pvr2_enum_input
	.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	%r12
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movq	(%rdi), %r12
	movq	16(%r12), %rax
	movq	(%rax), %rdi
	movq	_PVR2_CID_INPUT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_pvr2_hdw_get_ctrl_by_id
	movq	%rax, %r14
	leaq	-64(%rbp), %rdi
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	movl	$24, %edx
	callq	_memset
	movq	(%r15), %rax
	movq	%rax, -64(%rbp)
	cmpq	(%r12), %rax
	jae	LBB0_3
## %bb.1:
	movq	8(%r12), %rcx
	movl	(%rcx,%rax,4), %esi
	leal	-128(%rsi), %eax
	cmpl	$5, %eax
	jae	LBB0_4
## %bb.2:
	cltq
	leaq	l_switch.table.pvr2_enum_input(%rip), %rcx
	movq	(%rcx,%rax,8), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)
	movl	$0, -36(%rbp)
	movq	-56(%rbp), %rdx
	leaq	-36(%rbp), %r8
	movq	%r14, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	movl	$7, %ecx
	callq	_pvr2_ctrl_get_valname
	movq	-56(%rbp), %rax
	movl	-36(%rbp), %ecx
	movq	$0, (%rax,%rcx,8)
	movq	-48(%rbp), %rax
	movq	%rax, 16(%r15)
	movups	-64(%rbp), %xmm0
	movups	%xmm0, (%r15)
	xorl	%ebx, %ebx
	jmp	LBB0_6
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_4:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
LBB0_5:
	subl	(%rax), %ebx
LBB0_6:
	movl	%ebx, %eax
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PVR2_CID_INPUT,4,2             ## @PVR2_CID_INPUT
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_V4L2_INPUT_TYPE_TUNER,4,2      ## @V4L2_INPUT_TYPE_TUNER
	.comm	_V4L2_INPUT_TYPE_CAMERA,4,2     ## @V4L2_INPUT_TYPE_CAMERA
	.no_dead_strip	_pvr2_enum_input
	.section	__DATA,__const
	.p2align	3                               ## @switch.table.pvr2_enum_input
l_switch.table.pvr2_enum_input:
	.quad	_V4L2_INPUT_TYPE_TUNER
	.quad	_V4L2_INPUT_TYPE_CAMERA
	.quad	_V4L2_INPUT_TYPE_TUNER
	.quad	_V4L2_INPUT_TYPE_TUNER
	.quad	_V4L2_INPUT_TYPE_CAMERA

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pvr2_enum_input
_pvr2_enum_input:                       ; @pvr2_enum_input
	.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, x2
	ldr	x21, [x0]
	ldr	x8, [x21, #16]
	ldr	x0, [x8]
Lloh0:
	adrp	x8, _PVR2_CID_INPUT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PVR2_CID_INPUT@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_pvr2_hdw_get_ctrl_by_id
	mov	x20, x0
	add	x0, sp, #8
	mov	w1, #0
	mov	w2, #24
	bl	_memset
	ldr	x8, [x19]
	str	x8, [sp, #8]
	ldr	x9, [x21]
	cmp	x8, x9
	b.hs	LBB0_3
; %bb.1:
	ldr	x9, [x21, #8]
	ldr	w1, [x9, x8, lsl #2]
	sub	w8, w1, #128
	cmp	w8, #5
	b.hs	LBB0_3
; %bb.2:
Lloh3:
	adrp	x9, l_switch.table.pvr2_enum_input@PAGE
Lloh4:
	add	x9, x9, l_switch.table.pvr2_enum_input@PAGEOFF
	ldr	x8, [x9, w8, sxtw #3]
	ldr	w8, [x8]
	str	w8, [sp, #24]
	str	wzr, [sp, #4]
	ldr	x2, [sp, #16]
	add	x4, sp, #4
	mov	x0, x20
	mov	w3, #7
	bl	_pvr2_ctrl_get_valname
	mov	w0, #0
	ldr	x8, [sp, #16]
	ldr	w9, [sp, #4]
	str	xzr, [x8, x9, lsl #3]
	ldur	q0, [sp, #8]
	str	q0, [x19]
	ldr	x8, [sp, #24]
	str	x8, [x19, #16]
	b	LBB0_4
LBB0_3:
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_4:
	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	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_PVR2_CID_INPUT,4,2             ; @PVR2_CID_INPUT
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_V4L2_INPUT_TYPE_TUNER,4,2      ; @V4L2_INPUT_TYPE_TUNER
	.comm	_V4L2_INPUT_TYPE_CAMERA,4,2     ; @V4L2_INPUT_TYPE_CAMERA
	.no_dead_strip	_pvr2_enum_input
	.section	__DATA,__const
	.p2align	3                               ; @switch.table.pvr2_enum_input
l_switch.table.pvr2_enum_input:
	.quad	_V4L2_INPUT_TYPE_TUNER
	.quad	_V4L2_INPUT_TYPE_CAMERA
	.quad	_V4L2_INPUT_TYPE_TUNER
	.quad	_V4L2_INPUT_TYPE_TUNER
	.quad	_V4L2_INPUT_TYPE_CAMERA

.subsections_via_symbols
