	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function budget_av_detach
_budget_av_detach:                      ## @budget_av_detach
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	(%rdi), %r14
	leaq	L_.str(%rip), %rsi
	movl	$2, %edi
	movq	%rbx, %rdx
	callq	_dprintk
	cmpl	$1, (%r14)
	jne	LBB0_2
## %bb.1:
	movq	_SAA7146_GPIO_OUTLO@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_saa7146_setgpio
	movl	$200, %edi
	callq	_msleep
	leaq	24(%r14), %rdi
	movq	%rbx, %rsi
	callq	_saa7146_unregister_device
	movq	%rbx, %rdi
	callq	_saa7146_vv_release
LBB0_2:
	leaq	8(%r14), %rbx
	cmpq	$0, 16(%r14)
	je	LBB0_4
## %bb.3:
	movq	%r14, %rdi
	callq	_ciintf_deinit
LBB0_4:
	movq	(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_6
## %bb.5:
	callq	_dvb_unregister_frontend
	movq	(%rbx), %rdi
	callq	_dvb_frontend_detach
LBB0_6:
	movq	%rbx, %rdi
	callq	_ttpci_budget_deinit
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_kfree
	movl	%ebx, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"dev: %p\n"

	.comm	_SAA7146_GPIO_OUTLO,4,2         ## @SAA7146_GPIO_OUTLO
	.no_dead_strip	_budget_av_detach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function budget_av_detach
_budget_av_detach:                      ; @budget_av_detach
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x0
	ldr	x19, [x0]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #2
	mov	x2, x20
	bl	_dprintk
	ldr	w8, [x19]
	cmp	w8, #1
	b.ne	LBB0_2
; %bb.1:
Lloh2:
	adrp	x8, _SAA7146_GPIO_OUTLO@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SAA7146_GPIO_OUTLO@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	mov	x0, x20
	mov	w1, #0
	bl	_saa7146_setgpio
	mov	w0, #200
	bl	_msleep
	add	x0, x19, #24
	mov	x1, x20
	bl	_saa7146_unregister_device
	mov	x0, x20
	bl	_saa7146_vv_release
LBB0_2:
	add	x20, x19, #8
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_4
; %bb.3:
	mov	x0, x19
	bl	_ciintf_deinit
LBB0_4:
	ldr	x0, [x20]
	cbz	x0, LBB0_6
; %bb.5:
	bl	_dvb_unregister_frontend
	ldr	x0, [x20]
	bl	_dvb_frontend_detach
LBB0_6:
	mov	x0, x20
	bl	_ttpci_budget_deinit
	mov	x20, x0
	mov	x0, x19
	bl	_kfree
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"dev: %p\n"

	.comm	_SAA7146_GPIO_OUTLO,4,2         ; @SAA7146_GPIO_OUTLO
	.no_dead_strip	_budget_av_detach
.subsections_via_symbols
