	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bttv_s_fmt_vbi_cap             ## -- Begin function bttv_s_fmt_vbi_cap
	.p2align	4, 0x90
_bttv_s_fmt_vbi_cap:                    ## @bttv_s_fmt_vbi_cap
	.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, %r13
	movq	32(%rsi), %rbx
	leaq	8(%rbx), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	_RESOURCE_VBI@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r13)
	je	LBB0_2
## %bb.1:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_4
LBB0_2:
	movq	_bttv_tvnorms@GOTPCREL(%rip), %rax
	movq	(%rbx), %r12
	shlq	$3, %r12
	addq	(%rax), %r12
	movl	12(%rbx), %edx
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_try_fmt
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_4
## %bb.3:
	movq	(%r15), %rax
	movl	(%rax), %edi
	movl	4(%rax), %esi
	movq	(%r12), %rax
	subl	4(%rax), %esi
	addl	(%rax), %esi
	callq	_max
                                        ## kill: def $eax killed $eax def $rax
	addl	%eax, %eax
	addl	$2, %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	leaq	4(%r13), %rbx
	movq	%rbx, %rdi
	callq	_mutex_lock
	movq	(%r15), %rax
	movq	%rax, 24(%r13)
	movq	%r12, 16(%r13)
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 8(%r13)
	movq	%rbx, %rdi
	callq	_mutex_unlock
	xorl	%ebx, %ebx
LBB0_4:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_RESOURCE_VBI,4,2               ## @RESOURCE_VBI
	.comm	_bttv_tvnorms,8,3               ## @bttv_tvnorms
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bttv_s_fmt_vbi_cap             ; -- Begin function bttv_s_fmt_vbi_cap
	.p2align	2
_bttv_s_fmt_vbi_cap:                    ; @bttv_s_fmt_vbi_cap
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x21, x2
	mov	x20, x1
	ldr	x23, [x1, #32]
	add	x19, x23, #8
	mov	x0, x19
	bl	_mutex_lock
	ldr	w8, [x20]
Lloh0:
	adrp	x9, _RESOURCE_VBI@GOTPAGE
Lloh1:
	ldr	x9, [x9, _RESOURCE_VBI@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _EBUSY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_4
LBB0_2:
Lloh6:
	adrp	x8, _bttv_tvnorms@GOTPAGE
Lloh7:
	ldr	x8, [x8, _bttv_tvnorms@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	ldr	x9, [x23]
	add	x22, x8, x9, lsl #3
	ldr	w2, [x23, #12]
	mov	x0, x21
	mov	x1, x22
	bl	_try_fmt
	mov	x23, x0
	cbnz	w0, LBB0_4
; %bb.3:
	ldr	x8, [x21]
	ldr	x9, [x22]
	ldp	w9, w10, [x9]
	ldp	w0, w11, [x8]
	sub	w8, w11, w10
	add	w1, w8, w9
	bl	_max
	lsl	w8, w0, #1
	add	w24, w8, #2
	add	x23, x20, #4
	mov	x0, x23
	bl	_mutex_lock
	ldr	x8, [x21]
	stp	x22, x8, [x20, #16]
	str	w24, [x20, #8]
	mov	x0, x23
	bl	_mutex_unlock
	mov	w23, #0
LBB0_4:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x23
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_RESOURCE_VBI,4,2               ; @RESOURCE_VBI
	.comm	_bttv_tvnorms,8,3               ; @bttv_tvnorms
.subsections_via_symbols
