	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pvr2_dvb_frontend_init
_pvr2_dvb_frontend_init:                ## @pvr2_dvb_frontend_init
	.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), %rax
	movq	(%rax), %rax
	movq	(%rax), %r15
	testq	%r15, %r15
	je	LBB0_3
## %bb.1:
	movq	%rdi, %r14
	movq	_PVR2_CVAL_INPUT_DTV@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	$1, %esi
	shll	%cl, %esi
	callq	_pvr2_channel_limit_inputs
	testl	%eax, %eax
	je	LBB0_4
## %bb.2:
	movl	%eax, %ebx
	movq	_PVR2_TRACE_ERROR_LEGS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_pvr2_trace
	jmp	LBB0_10
LBB0_3:
	movq	_PVR2_TRACE_ERROR_LEGS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_pvr2_trace
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_10
LBB0_4:
	movq	(%r15), %rax
	testq	%rax, %rax
	je	LBB0_7
## %bb.5:
	movq	%r14, %rdi
	callq	*%rax
	testq	%rax, %rax
	je	LBB0_11
LBB0_6:
	movq	_PVR2_TRACE_ERROR_LEGS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.4(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_pvr2_trace
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_10
LBB0_7:
	movq	_PVR2_TRACE_ERROR_LEGS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_pvr2_trace
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_8:
	subl	(%rax), %ebx
LBB0_9:
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_pvr2_channel_limit_inputs
LBB0_10:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movq	8(%r14), %rsi
	testq	%rsi, %rsi
	je	LBB0_6
## %bb.12:
	leaq	16(%r14), %rdi
	callq	_dvb_register_frontend
	testq	%rax, %rax
	je	LBB0_14
## %bb.13:
	movq	_PVR2_TRACE_ERROR_LEGS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.3(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_pvr2_trace
	movq	8(%r14), %rdi
	callq	_dvb_frontend_detach
	movq	$0, 8(%r14)
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_14:
	movq	8(%r15), %rax
	testq	%rax, %rax
	je	LBB0_16
## %bb.15:
	movq	%r14, %rdi
	callq	*%rax
LBB0_16:
	movq	8(%r14), %rdi
	movq	8(%rdi), %rcx
	testq	%rcx, %rcx
	je	LBB0_18
## %bb.17:
	callq	*%rcx
	movq	8(%r14), %rdi
LBB0_18:
	movq	_pvr2_dvb_bus_ctrl@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rdi)
	xorl	%ebx, %ebx
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_PVR2_TRACE_ERROR_LEGS,4,2      ## @PVR2_TRACE_ERROR_LEGS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"fe_props not defined!"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PVR2_CVAL_INPUT_DTV,4,2        ## @PVR2_CVAL_INPUT_DTV
L_.str.1:                               ## @.str.1
	.asciz	"failed to grab control of dtv input (code=%d)"

L_.str.2:                               ## @.str.2
	.asciz	"frontend_attach not defined!"

L_.str.3:                               ## @.str.3
	.asciz	"frontend registration failed!"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_pvr2_dvb_bus_ctrl,4,2          ## @pvr2_dvb_bus_ctrl
L_.str.4:                               ## @.str.4
	.asciz	"no frontend was attached!"

	.no_dead_strip	_pvr2_dvb_frontend_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pvr2_dvb_frontend_init
_pvr2_dvb_frontend_init:                ; @pvr2_dvb_frontend_init
	.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
	ldr	x8, [x0]
	ldr	x8, [x8]
	ldr	x21, [x8]
	cbz	x21, LBB0_3
; %bb.1:
	mov	x19, x0
Lloh0:
	adrp	x8, _PVR2_CVAL_INPUT_DTV@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PVR2_CVAL_INPUT_DTV@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	mov	w9, #1
	lsl	w1, w9, w8
	bl	_pvr2_channel_limit_inputs
	cbz	w0, LBB0_4
; %bb.2:
	mov	x20, x0
Lloh3:
	adrp	x8, _PVR2_TRACE_ERROR_LEGS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PVR2_TRACE_ERROR_LEGS@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	str	x20, [sp]
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_pvr2_trace
	b	LBB0_11
LBB0_3:
Lloh8:
	adrp	x8, _PVR2_TRACE_ERROR_LEGS@GOTPAGE
Lloh9:
	ldr	x8, [x8, _PVR2_TRACE_ERROR_LEGS@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	bl	_pvr2_trace
Lloh13:
	adrp	x8, _EINVAL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_7
LBB0_4:
	ldr	x8, [x21]
	cbz	x8, LBB0_8
; %bb.5:
	mov	x0, x19
	blr	x8
	cbz	x0, LBB0_12
LBB0_6:
Lloh15:
	adrp	x8, _PVR2_TRACE_ERROR_LEGS@GOTPAGE
Lloh16:
	ldr	x8, [x8, _PVR2_TRACE_ERROR_LEGS@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
Lloh18:
	adrp	x1, l_.str.4@PAGE
Lloh19:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_pvr2_trace
Lloh20:
	adrp	x8, _ENODEV@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
LBB0_7:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_11
LBB0_8:
Lloh22:
	adrp	x8, _PVR2_TRACE_ERROR_LEGS@GOTPAGE
Lloh23:
	ldr	x8, [x8, _PVR2_TRACE_ERROR_LEGS@GOTPAGEOFF]
Lloh24:
	ldr	w0, [x8]
Lloh25:
	adrp	x1, l_.str.2@PAGE
Lloh26:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_pvr2_trace
Lloh27:
	adrp	x8, _EINVAL@GOTPAGE
Lloh28:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_10:
	mov	x0, x19
	mov	w1, #0
	bl	_pvr2_channel_limit_inputs
LBB0_11:
	mov	x0, x20
	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
LBB0_12:
	ldr	x1, [x19, #8]
	cbz	x1, LBB0_6
; %bb.13:
	add	x0, x19, #16
	bl	_dvb_register_frontend
	cbz	x0, LBB0_15
; %bb.14:
Lloh29:
	adrp	x8, _PVR2_TRACE_ERROR_LEGS@GOTPAGE
Lloh30:
	ldr	x8, [x8, _PVR2_TRACE_ERROR_LEGS@GOTPAGEOFF]
Lloh31:
	ldr	w0, [x8]
Lloh32:
	adrp	x1, l_.str.3@PAGE
Lloh33:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_pvr2_trace
	ldr	x0, [x19, #8]
	bl	_dvb_frontend_detach
	str	xzr, [x19, #8]
Lloh34:
	adrp	x8, _ENODEV@GOTPAGE
Lloh35:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_9
LBB0_15:
	ldr	x8, [x21, #8]
	cbz	x8, LBB0_17
; %bb.16:
	mov	x0, x19
	blr	x8
LBB0_17:
	ldr	x0, [x19, #8]
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_19
; %bb.18:
	blr	x8
	ldr	x0, [x19, #8]
LBB0_19:
	mov	w20, #0
Lloh36:
	adrp	x8, _pvr2_dvb_bus_ctrl@GOTPAGE
Lloh37:
	ldr	x8, [x8, _pvr2_dvb_bus_ctrl@GOTPAGEOFF]
Lloh38:
	ldr	w8, [x8]
	str	w8, [x0]
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.comm	_PVR2_TRACE_ERROR_LEGS,4,2      ; @PVR2_TRACE_ERROR_LEGS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"fe_props not defined!"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PVR2_CVAL_INPUT_DTV,4,2        ; @PVR2_CVAL_INPUT_DTV
l_.str.1:                               ; @.str.1
	.asciz	"failed to grab control of dtv input (code=%d)"

l_.str.2:                               ; @.str.2
	.asciz	"frontend_attach not defined!"

l_.str.3:                               ; @.str.3
	.asciz	"frontend registration failed!"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_pvr2_dvb_bus_ctrl,4,2          ; @pvr2_dvb_bus_ctrl
l_.str.4:                               ; @.str.4
	.asciz	"no frontend was attached!"

	.no_dead_strip	_pvr2_dvb_frontend_init
.subsections_via_symbols
