	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bttv_overlay
_bttv_overlay:                          ## @bttv_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	16(%rsi), %r14
	testl	%edx, %edx
	je	LBB0_8
## %bb.1:
	xorl	%edi, %edi
	cmpl	$0, 16(%r14)
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_4
## %bb.2:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_3
LBB0_8:
	movq	_RESOURCE_OVERLAY@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_check_alloc_btres_lock
	testl	%eax, %eax
	je	LBB0_11
## %bb.9:
	xorl	%r15d, %r15d
	jmp	LBB0_13
LBB0_4:
	xorl	%edi, %edi
	cmpl	$0, 8(%rbx)
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_10
## %bb.5:
	movl	12(%r14), %esi
	leaq	L_.str(%rip), %rdi
	callq	_dprintk
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	je	LBB0_10
## %bb.6:
	negl	%eax
	jmp	LBB0_7
LBB0_10:
	movq	_RESOURCE_OVERLAY@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_check_alloc_btres_lock
	testl	%eax, %eax
	je	LBB0_11
## %bb.12:
	movl	8(%r14), %eax
	leaq	4(%rbx), %r12
	movl	%eax, 4(%rbx)
	movl	$4, %edi
	callq	_videobuf_sg_alloc
	movq	%rax, %r15
	movq	(%r14), %rax
	xorl	%ecx, %ecx
	cmpl	$0, 12(%rbx)
	setne	%cl
	movl	(%rax,%rcx,4), %eax
	movl	%eax, (%r15)
	movl	(%rbx), %edx
	movq	%r14, %rdi
	movq	%r12, %rsi
	movq	%r15, %rcx
	callq	_bttv_overlay_risc
LBB0_13:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movq	%r15, %rdx
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_bttv_switch_overlay            ## TAILCALL
LBB0_11:
	movq	_EBUSY@GOTPCREL(%rip), %rcx
LBB0_3:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_7:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%d: overlay: !setup_ok\n"

	.comm	_RESOURCE_OVERLAY,4,2           ## @RESOURCE_OVERLAY
	.comm	_EBUSY,4,2                      ## @EBUSY
	.no_dead_strip	_bttv_overlay
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bttv_overlay
_bttv_overlay:                          ; @bttv_overlay
	.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
	mov	x19, x1
	ldr	x20, [x1, #16]
	cbz	w2, LBB0_3
; %bb.1:
	ldr	w8, [x20, #16]
	cmp	w8, #0
	cset	w0, eq
	bl	_unlikely
	cbz	x0, LBB0_5
; %bb.2:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_11
LBB0_3:
Lloh2:
	adrp	x8, _RESOURCE_OVERLAY@GOTPAGE
Lloh3:
	ldr	x8, [x8, _RESOURCE_OVERLAY@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	mov	x0, x20
	mov	x1, x19
	bl	_check_alloc_btres_lock
	cbz	w0, LBB0_10
; %bb.4:
	mov	x21, #0
	b	LBB0_9
LBB0_5:
	ldr	w8, [x19, #8]
	cmp	w8, #0
	cset	w0, eq
	bl	_unlikely
	cbz	x0, LBB0_7
; %bb.6:
	ldr	w1, [x20, #12]
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_dprintk
Lloh7:
	adrp	x8, _EINVAL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	cbnz	w8, LBB0_12
LBB0_7:
Lloh10:
	adrp	x8, _RESOURCE_OVERLAY@GOTPAGE
Lloh11:
	ldr	x8, [x8, _RESOURCE_OVERLAY@GOTPAGEOFF]
Lloh12:
	ldr	w2, [x8]
	mov	x0, x20
	mov	x1, x19
	bl	_check_alloc_btres_lock
	cbz	w0, LBB0_10
; %bb.8:
	ldr	w8, [x20, #8]
	mov	x22, x19
	str	w8, [x22, #4]!
	mov	w0, #4
	bl	_videobuf_sg_alloc
	mov	x21, x0
	ldr	x8, [x20]
	ldr	w9, [x19, #12]
	cmp	w9, #0
	cset	w9, ne
	ldr	w8, [x8, w9, uxtw #2]
	str	w8, [x0]
	ldr	w2, [x19]
	mov	x0, x20
	mov	x1, x22
	mov	x3, x21
	bl	_bttv_overlay_risc
LBB0_9:
	mov	x0, x20
	mov	x1, x19
	mov	x2, x21
	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	_bttv_switch_overlay
LBB0_10:
Lloh13:
	adrp	x8, _EBUSY@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
LBB0_11:
	ldr	w8, [x8]
LBB0_12:
	neg	w0, w8
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%d: overlay: !setup_ok\n"

	.comm	_RESOURCE_OVERLAY,4,2           ; @RESOURCE_OVERLAY
	.comm	_EBUSY,4,2                      ; @EBUSY
	.no_dead_strip	_bttv_overlay
.subsections_via_symbols
