	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bttv_switch_overlay
_bttv_switch_overlay:                   ## @bttv_switch_overlay
	.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
	movq	%rdx, %r15
	movq	%rsi, %r14
	movq	%rdi, %r12
	leaq	L_.str(%rip), %rdi
	movq	%rdx, %rsi
	xorl	%eax, %eax
	callq	_dprintk
	testq	%r15, %r15
	je	LBB0_2
## %bb.1:
	movq	_VIDEOBUF_DONE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r15)
LBB0_2:
	leaq	4(%r12), %rbx
	movq	%rbx, %rdi
	callq	_spin_lock_irqsave
	movq	8(%r12), %r13
	movq	%r15, 8(%r12)
	orb	$1, (%r12)
	movq	%r12, %rdi
	movl	$3, %esi
	callq	_bttv_set_dma
	movq	%rbx, %rdi
	callq	_spin_unlock_irqrestore
	testq	%r13, %r13
	je	LBB0_4
## %bb.3:
	movl	(%r13), %edx
	leaq	L_.str.1(%rip), %rdi
	movq	%r13, %rsi
	xorl	%eax, %eax
	callq	_dprintk
	movq	%r14, %rdi
	movq	%r12, %rsi
	movq	%r13, %rdx
	callq	_bttv_dma_free
	movq	%r13, %rdi
	callq	_kfree
LBB0_4:
	testq	%r15, %r15
	jne	LBB0_6
## %bb.5:
	movq	_RESOURCE_OVERLAY@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_free_btres_lock
LBB0_6:
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_dprintk
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"switch_overlay: enter [new=%p]\n"

	.comm	_VIDEOBUF_DONE,4,2              ## @VIDEOBUF_DONE
L_.str.1:                               ## @.str.1
	.asciz	"switch_overlay: old=%p state is %d\n"

	.comm	_RESOURCE_OVERLAY,4,2           ## @RESOURCE_OVERLAY
L_.str.2:                               ## @.str.2
	.asciz	"switch_overlay: done\n"

	.no_dead_strip	_bttv_switch_overlay
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bttv_switch_overlay
_bttv_switch_overlay:                   ; @bttv_switch_overlay
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x21, x2
	mov	x19, x1
	mov	x20, x0
	str	x2, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_dprintk
	cbz	x21, LBB0_2
; %bb.1:
Lloh2:
	adrp	x8, _VIDEOBUF_DONE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _VIDEOBUF_DONE@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	str	w8, [x21]
LBB0_2:
	add	x23, x20, #4
	mov	x0, x23
	bl	_spin_lock_irqsave
	ldr	x22, [x20, #8]
	str	x21, [x20, #8]
	ldr	w8, [x20]
	orr	w8, w8, #0x1
	str	w8, [x20]
	mov	x0, x20
	mov	w1, #3
	bl	_bttv_set_dma
	mov	x0, x23
	bl	_spin_unlock_irqrestore
	cbz	x22, LBB0_4
; %bb.3:
	ldr	w8, [x22]
	stp	x22, x8, [sp]
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_dprintk
	mov	x0, x19
	mov	x1, x20
	mov	x2, x22
	bl	_bttv_dma_free
	mov	x0, x22
	bl	_kfree
LBB0_4:
	cbnz	x21, LBB0_6
; %bb.5:
Lloh7:
	adrp	x8, _RESOURCE_OVERLAY@GOTPAGE
Lloh8:
	ldr	x8, [x8, _RESOURCE_OVERLAY@GOTPAGEOFF]
Lloh9:
	ldr	w2, [x8]
	mov	x0, x20
	mov	x1, x19
	bl	_free_btres_lock
LBB0_6:
Lloh10:
	adrp	x0, l_.str.2@PAGE
Lloh11:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_dprintk
	mov	w0, #0
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"switch_overlay: enter [new=%p]\n"

	.comm	_VIDEOBUF_DONE,4,2              ; @VIDEOBUF_DONE
l_.str.1:                               ; @.str.1
	.asciz	"switch_overlay: old=%p state is %d\n"

	.comm	_RESOURCE_OVERLAY,4,2           ; @RESOURCE_OVERLAY
l_.str.2:                               ; @.str.2
	.asciz	"switch_overlay: done\n"

	.no_dead_strip	_bttv_switch_overlay
.subsections_via_symbols
