	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vbi_open
_vbi_open:                              ## @vbi_open
	.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	%rsi, %r14
	movq	%rdi, %r15
	movq	(%rsi), %r12
	movq	_PCI_BT_V1@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	callq	_saa7146_read
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_DEB_VBI
	movq	_RESOURCE_DMA3_BRS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_saa7146_res_get
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	andl	$-2031617, %ebx                 ## imm = 0xFFE0FFFF
	orl	$1900544, %ebx                  ## imm = 0x1D0000
	movl	(%r13), %esi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_saa7146_write
	movq	_MC2@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	_MASK_04@GOTPCREL(%rip), %rax
	movq	_MASK_20@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	%r15, %rdi
	callq	_saa7146_write
	leaq	24(%r12), %rdi
	xorl	%esi, %esi
	movl	$32, %edx
	callq	_memset
	movabsq	$1065178889408, %rax            ## imm = 0xF8019BFCC0
	movq	%rax, 24(%r12)
	movq	_vbi_pixel_to_capture@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 52(%r12)
	movq	_V4L2_PIX_FMT_GREY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 48(%r12)
	movq	32(%r12), %rax
	movl	$5, (%rax)
	movq	40(%r12), %rcx
	movl	$16, (%rcx)
	movl	$312, 4(%rax)                   ## imm = 0x138
	movl	$16, 4(%rcx)
	leaq	16(%r12), %rdi
	movq	16(%r15), %rdx
	leaq	12(%r15), %rcx
	movq	_V4L2_BUF_TYPE_VBI_CAPTURE@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_V4L2_FIELD_SEQ_TB@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	leaq	8(%r15), %rax
	subq	$8, %rsp
	movq	_vbi_qops@GOTPCREL(%rip), %rsi
	pushq	%rax
	pushq	%r14
	pushq	$4
	callq	_videobuf_queue_sg_init
	addq	$32, %rsp
	movq	%r12, %rdi
	callq	_init_timer
	movq	_vbi_read_timeout@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r12)
	movq	%r14, (%r12)
	movq	_SAA7146_USE_PORT_B_FOR_VBI@GOTPCREL(%rip), %rax
	movq	(%r15), %rcx
	movl	(%rcx), %ecx
	movq	_BRS_CTRL@GOTPCREL(%rip), %rdx
	movl	(%rdx), %esi
	testl	%ecx, (%rax)
	je	LBB0_4
## %bb.3:
	movq	_MASK_30@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_MASK_29@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	orl	$3670016, %edx                  ## imm = 0x380000
	movq	%r15, %rdi
	callq	_saa7146_write
	jmp	LBB0_6
LBB0_1:
	leaq	L_.str.1(%rip), %rdi
	callq	_DEB_S
	movq	_EBUSY@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_7
LBB0_4:
	movq	%r15, %rdi
	movl	$1, %edx
	callq	_saa7146_write
	movq	%r15, %rdi
	callq	_vbi_workaround
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	leaq	L_.str.2(%rip), %rdi
	callq	_DEB_VBI
LBB0_6:
	movl	(%rbx), %esi
	movq	_MASK_08@GOTPCREL(%rip), %rax
	movq	_MASK_24@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	%r15, %rdi
	callq	_saa7146_write
	xorl	%eax, %eax
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PCI_BT_V1,4,2                  ## @PCI_BT_V1
	.comm	_RESOURCE_DMA3_BRS,4,2          ## @RESOURCE_DMA3_BRS
	.section	__TEXT,__cstring,cstring_literals
L_.str.1:                               ## @.str.1
	.asciz	"cannot get vbi RESOURCE_DMA3_BRS resource\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_MC2,4,2                        ## @MC2
	.comm	_MASK_04,4,2                    ## @MASK_04
	.comm	_MASK_20,4,2                    ## @MASK_20
	.comm	_vbi_pixel_to_capture,4,2       ## @vbi_pixel_to_capture
	.comm	_V4L2_PIX_FMT_GREY,4,2          ## @V4L2_PIX_FMT_GREY
	.comm	_vbi_qops,4,2                   ## @vbi_qops
	.comm	_V4L2_BUF_TYPE_VBI_CAPTURE,4,2  ## @V4L2_BUF_TYPE_VBI_CAPTURE
	.comm	_V4L2_FIELD_SEQ_TB,4,2          ## @V4L2_FIELD_SEQ_TB
	.comm	_vbi_read_timeout,4,2           ## @vbi_read_timeout
	.comm	_SAA7146_USE_PORT_B_FOR_VBI,4,2 ## @SAA7146_USE_PORT_B_FOR_VBI
	.comm	_BRS_CTRL,4,2                   ## @BRS_CTRL
	.comm	_MASK_30,4,2                    ## @MASK_30
	.comm	_MASK_29,4,2                    ## @MASK_29
L_.str.2:                               ## @.str.2
	.asciz	"vbi workaround failed!\n"

	.comm	_MASK_08,4,2                    ## @MASK_08
	.comm	_MASK_24,4,2                    ## @MASK_24
	.no_dead_strip	_vbi_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function vbi_open
lCPI0_0:
	.long	27000000                        ; 0x19bfcc0
	.long	248                             ; 0xf8
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_vbi_open:                              ; @vbi_open
	.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	x20, x1
	mov	x19, x0
	ldr	x21, [x1]
Lloh0:
	adrp	x23, _PCI_BT_V1@GOTPAGE
Lloh1:
	ldr	x23, [x23, _PCI_BT_V1@GOTPAGEOFF]
	ldr	w1, [x23]
	bl	_saa7146_read
	mov	x22, x0
	mov	x0, x21
	bl	_DEB_VBI
Lloh2:
	adrp	x8, _RESOURCE_DMA3_BRS@GOTPAGE
Lloh3:
	ldr	x8, [x8, _RESOURCE_DMA3_BRS@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_saa7146_res_get
	cbz	w0, LBB0_3
; %bb.1:
	mov	w8, #29
	bfi	w22, w8, #16, #5
	ldr	w1, [x23]
	mov	x0, x19
	mov	x2, x22
	bl	_saa7146_write
Lloh5:
	adrp	x22, _MC2@GOTPAGE
Lloh6:
	ldr	x22, [x22, _MC2@GOTPAGEOFF]
Lloh7:
	adrp	x8, _MASK_04@GOTPAGE
Lloh8:
	ldr	x8, [x8, _MASK_04@GOTPAGEOFF]
	ldr	w1, [x22]
Lloh9:
	ldr	w8, [x8]
Lloh10:
	adrp	x9, _MASK_20@GOTPAGE
Lloh11:
	ldr	x9, [x9, _MASK_20@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	x0, x19
	bl	_saa7146_write
	add	x0, x21, #24
	mov	w1, #0
	mov	w2, #32
	bl	_memset
Lloh13:
	adrp	x8, lCPI0_0@PAGE
Lloh14:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	str	d0, [x21, #24]
Lloh15:
	adrp	x8, _vbi_pixel_to_capture@GOTPAGE
Lloh16:
	ldr	x8, [x8, _vbi_pixel_to_capture@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
Lloh18:
	adrp	x9, _V4L2_PIX_FMT_GREY@GOTPAGE
Lloh19:
	ldr	x9, [x9, _V4L2_PIX_FMT_GREY@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	stp	w9, w8, [x21, #48]
	mov	w8, #5
	ldp	x9, x10, [x21, #32]
	str	w8, [x9]
	mov	w8, #16
	str	w8, [x10]
	mov	w11, #312
	str	w11, [x9, #4]
	str	w8, [x10, #4]
	add	x0, x21, #16
	ldr	x2, [x19, #16]
Lloh21:
	adrp	x8, _V4L2_BUF_TYPE_VBI_CAPTURE@GOTPAGE
Lloh22:
	ldr	x8, [x8, _V4L2_BUF_TYPE_VBI_CAPTURE@GOTPAGEOFF]
	add	x3, x19, #12
Lloh23:
	ldr	w4, [x8]
Lloh24:
	adrp	x8, _V4L2_FIELD_SEQ_TB@GOTPAGE
Lloh25:
	ldr	x8, [x8, _V4L2_FIELD_SEQ_TB@GOTPAGEOFF]
Lloh26:
	ldr	w5, [x8]
	add	x8, x19, #8
	str	x8, [sp]
Lloh27:
	adrp	x1, _vbi_qops@GOTPAGE
Lloh28:
	ldr	x1, [x1, _vbi_qops@GOTPAGEOFF]
	mov	w6, #4
	mov	x7, x20
	bl	_videobuf_queue_sg_init
	mov	x0, x21
	bl	_init_timer
Lloh29:
	adrp	x8, _vbi_read_timeout@GOTPAGE
Lloh30:
	ldr	x8, [x8, _vbi_read_timeout@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
	str	w8, [x21, #8]
	str	x20, [x21]
Lloh32:
	adrp	x8, _SAA7146_USE_PORT_B_FOR_VBI@GOTPAGE
Lloh33:
	ldr	x8, [x8, _SAA7146_USE_PORT_B_FOR_VBI@GOTPAGEOFF]
Lloh34:
	ldr	w8, [x8]
	ldr	x9, [x19]
	ldr	w9, [x9]
Lloh35:
	adrp	x10, _BRS_CTRL@GOTPAGE
Lloh36:
	ldr	x10, [x10, _BRS_CTRL@GOTPAGEOFF]
Lloh37:
	ldr	w1, [x10]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.2:
Lloh38:
	adrp	x8, _MASK_30@GOTPAGE
Lloh39:
	ldr	x8, [x8, _MASK_30@GOTPAGEOFF]
Lloh40:
	ldr	w8, [x8]
Lloh41:
	adrp	x9, _MASK_29@GOTPAGE
Lloh42:
	ldr	x9, [x9, _MASK_29@GOTPAGEOFF]
Lloh43:
	ldr	w9, [x9]
	orr	w8, w8, w9
	orr	w2, w8, #0x380000
	mov	x0, x19
	bl	_saa7146_write
	b	LBB0_6
LBB0_3:
Lloh44:
	adrp	x0, l_.str.1@PAGE
Lloh45:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DEB_S
Lloh46:
	adrp	x8, _EBUSY@GOTPAGE
Lloh47:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh48:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_7
LBB0_4:
	mov	x0, x19
	mov	w2, #1
	bl	_saa7146_write
	mov	x0, x19
	bl	_vbi_workaround
	cbz	w0, LBB0_6
; %bb.5:
Lloh49:
	adrp	x0, l_.str.2@PAGE
Lloh50:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DEB_VBI
LBB0_6:
Lloh51:
	adrp	x8, _MASK_08@GOTPAGE
Lloh52:
	ldr	x8, [x8, _MASK_08@GOTPAGEOFF]
	ldr	w1, [x22]
Lloh53:
	ldr	w8, [x8]
Lloh54:
	adrp	x9, _MASK_24@GOTPAGE
Lloh55:
	ldr	x9, [x9, _MASK_24@GOTPAGEOFF]
Lloh56:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	x0, x19
	bl	_saa7146_write
	mov	w0, #0
LBB0_7:
	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 AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdrp	Lloh13, Lloh15
	.loh AdrpLdr	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpAdd	Lloh44, Lloh45
	.loh AdrpAdd	Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh54, Lloh55, Lloh56
	.loh AdrpLdrGotLdr	Lloh51, Lloh52, Lloh53
	.cfi_endproc
                                        ; -- End function
	.comm	_PCI_BT_V1,4,2                  ; @PCI_BT_V1
	.comm	_RESOURCE_DMA3_BRS,4,2          ; @RESOURCE_DMA3_BRS
	.section	__TEXT,__cstring,cstring_literals
l_.str.1:                               ; @.str.1
	.asciz	"cannot get vbi RESOURCE_DMA3_BRS resource\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_MC2,4,2                        ; @MC2
	.comm	_MASK_04,4,2                    ; @MASK_04
	.comm	_MASK_20,4,2                    ; @MASK_20
	.comm	_vbi_pixel_to_capture,4,2       ; @vbi_pixel_to_capture
	.comm	_V4L2_PIX_FMT_GREY,4,2          ; @V4L2_PIX_FMT_GREY
	.comm	_vbi_qops,4,2                   ; @vbi_qops
	.comm	_V4L2_BUF_TYPE_VBI_CAPTURE,4,2  ; @V4L2_BUF_TYPE_VBI_CAPTURE
	.comm	_V4L2_FIELD_SEQ_TB,4,2          ; @V4L2_FIELD_SEQ_TB
	.comm	_vbi_read_timeout,4,2           ; @vbi_read_timeout
	.comm	_SAA7146_USE_PORT_B_FOR_VBI,4,2 ; @SAA7146_USE_PORT_B_FOR_VBI
	.comm	_BRS_CTRL,4,2                   ; @BRS_CTRL
	.comm	_MASK_30,4,2                    ; @MASK_30
	.comm	_MASK_29,4,2                    ; @MASK_29
l_.str.2:                               ; @.str.2
	.asciz	"vbi workaround failed!\n"

	.comm	_MASK_08,4,2                    ; @MASK_08
	.comm	_MASK_24,4,2                    ; @MASK_24
	.no_dead_strip	_vbi_open
.subsections_via_symbols
