	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_go7007_register_encoder        ## -- Begin function go7007_register_encoder
	.p2align	4, 0x90
_go7007_register_encoder:               ## @go7007_register_encoder
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movq	%rdi, %r12
	movl	64(%rdi), %edi
	movl	68(%r12), %edx
	leaq	L_.str(%rip), %rsi
	callq	_dev_info
	movq	_go7007_remove@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leaq	52(%r12), %r14
	movl	%eax, 52(%r12)
	movl	64(%r12), %edi
	movq	%r14, %rsi
	callq	_v4l2_device_register
	testl	%eax, %eax
	js	LBB0_22
## %bb.1:
	leaq	60(%r12), %r13
	movq	%r13, %rdi
	callq	_mutex_lock
	movq	%r12, %rdi
	callq	_go7007_init_encoder
	movl	%eax, %ebx
	movq	%r13, %rdi
	callq	_mutex_unlock
	testl	%ebx, %ebx
	js	LBB0_23
## %bb.2:
	movq	%r12, %rdi
	callq	_go7007_v4l2_ctrl_init
	testl	%eax, %eax
	js	LBB0_22
## %bb.3:
	cmpl	$0, (%r12)
	je	LBB0_15
LBB0_4:
	movq	8(%r12), %rax
	movq	_GO7007_BOARDID_ADS_USBAV_709@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.5:
	movq	%r12, %rdi
	movl	$15490, %esi                    ## imm = 0x3C82
	movl	$9, %edx
	callq	_go7007_write_addr
	movl	$50, %edi
	callq	_msleep
	movq	%r12, %rdi
	movl	$15490, %esi                    ## imm = 0x3C82
	movl	$13, %edx
	callq	_go7007_write_addr
LBB0_6:
	testl	%r15d, %r15d
	je	LBB0_9
## %bb.7:
	leaq	56(%r12), %r13
	movl	%r15d, %r15d
	shlq	$2, %r15
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	32(%r12), %rax
	movq	8(%rax), %rsi
	addq	%rbx, %rsi
	movq	%r13, %rdi
	callq	_init_i2c_module
	addq	$4, %rbx
	cmpq	%rbx, %r15
	jne	LBB0_8
LBB0_9:
	movq	16(%r12), %rax
	testq	%rax, %rax
	js	LBB0_11
## %bb.10:
	movq	%rax, -56(%rbp)
	movq	_T_ANALOG_TV@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)
	movq	_ADDR_UNSET@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)
	movq	_tuner@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_s_type_addr@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-56(%rbp), %r8
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_v4l2_device_call_all
LBB0_11:
	movq	8(%r12), %rax
	movq	_GO7007_BOARDID_ADLINK_MPG24@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_18
## %bb.12:
	movl	48(%r12), %edi
	movq	_video@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_s_routing@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	40(%r12), %r9
	incq	%r9
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_v4l2_subdev_call
	jmp	LBB0_18
LBB0_15:
	movq	32(%r12), %rax
	movq	_GO7007_BOARD_USE_ONBOARD_I2C@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_18
## %bb.16:
	movq	%r12, %rdi
	callq	_go7007_i2c_init
	testl	%eax, %eax
	js	LBB0_22
## %bb.17:
	movl	$1, (%r12)
	jmp	LBB0_4
LBB0_18:
	movq	%r12, %rdi
	callq	_go7007_v4l2_init
	testl	%eax, %eax
	js	LBB0_22
## %bb.19:
	movq	32(%r12), %rax
	movq	_GO7007_BOARD_HAS_AUDIO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	xorl	%ebx, %ebx
	testl	%ecx, (%rax)
	je	LBB0_23
## %bb.20:
	movl	$1, 24(%r12)
	movq	%r12, %rdi
	callq	_go7007_snd_init
	jmp	LBB0_23
LBB0_22:
	movl	%eax, %ebx
LBB0_23:
	movl	%ebx, %eax
	addq	$24, %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	"go7007: registering new %s\n"

	.comm	_go7007_remove,4,2              ## @go7007_remove
	.comm	_GO7007_BOARD_USE_ONBOARD_I2C,4,2 ## @GO7007_BOARD_USE_ONBOARD_I2C
	.comm	_GO7007_BOARDID_ADS_USBAV_709,8,3 ## @GO7007_BOARDID_ADS_USBAV_709
	.comm	_T_ANALOG_TV,4,2                ## @T_ANALOG_TV
	.comm	_ADDR_UNSET,4,2                 ## @ADDR_UNSET
	.comm	_tuner,4,2                      ## @tuner
	.comm	_s_type_addr,4,2                ## @s_type_addr
	.comm	_GO7007_BOARDID_ADLINK_MPG24,8,3 ## @GO7007_BOARDID_ADLINK_MPG24
	.comm	_video,4,2                      ## @video
	.comm	_s_routing,4,2                  ## @s_routing
	.comm	_GO7007_BOARD_HAS_AUDIO,4,2     ## @GO7007_BOARD_HAS_AUDIO
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_go7007_register_encoder        ; -- Begin function go7007_register_encoder
	.p2align	2
_go7007_register_encoder:               ; @go7007_register_encoder
	.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, x1
	mov	x19, x0
	ldr	w0, [x0, #64]
	ldr	w2, [x19, #68]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_info
Lloh2:
	adrp	x8, _go7007_remove@GOTPAGE
Lloh3:
	ldr	x8, [x8, _go7007_remove@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	mov	x20, x19
	str	w8, [x20, #52]!
	ldr	w0, [x19, #64]
	mov	x1, x20
	bl	_v4l2_device_register
	tbnz	w0, #31, LBB0_20
; %bb.1:
	add	x23, x19, #60
	mov	x0, x23
	bl	_mutex_lock
	mov	x0, x19
	bl	_go7007_init_encoder
	mov	x22, x0
	mov	x0, x23
	bl	_mutex_unlock
	tbnz	w22, #31, LBB0_21
; %bb.2:
	mov	x0, x19
	bl	_go7007_v4l2_ctrl_init
	tbnz	w0, #31, LBB0_20
; %bb.3:
	ldr	w8, [x19]
	cbz	w8, LBB0_13
LBB0_4:
	ldr	x8, [x19, #8]
Lloh5:
	adrp	x9, _GO7007_BOARDID_ADS_USBAV_709@GOTPAGE
Lloh6:
	ldr	x9, [x9, _GO7007_BOARDID_ADS_USBAV_709@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.5:
	mov	x0, x19
	mov	w1, #15490
	mov	w2, #9
	bl	_go7007_write_addr
	mov	w0, #50
	bl	_msleep
	mov	x0, x19
	mov	w1, #15490
	mov	w2, #13
	bl	_go7007_write_addr
LBB0_6:
	cbz	w21, LBB0_9
; %bb.7:
	mov	x23, #0
	add	x22, x19, #56
	mov	w8, w21
	lsl	x21, x8, #2
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #32]
	ldr	x8, [x8, #8]
	add	x1, x8, x23
	mov	x0, x22
	bl	_init_i2c_module
	add	x23, x23, #4
	cmp	x21, x23
	b.ne	LBB0_8
LBB0_9:
	ldr	x8, [x19, #16]
	tbnz	x8, #63, LBB0_11
; %bb.10:
	str	x8, [sp]
Lloh8:
	adrp	x8, _T_ANALOG_TV@GOTPAGE
Lloh9:
	ldr	x8, [x8, _T_ANALOG_TV@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
Lloh11:
	adrp	x9, _ADDR_UNSET@GOTPAGE
Lloh12:
	ldr	x9, [x9, _ADDR_UNSET@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	stp	w8, w9, [sp, #8]
Lloh14:
	adrp	x8, _tuner@GOTPAGE
Lloh15:
	ldr	x8, [x8, _tuner@GOTPAGEOFF]
Lloh16:
	ldr	w2, [x8]
Lloh17:
	adrp	x8, _s_type_addr@GOTPAGE
Lloh18:
	ldr	x8, [x8, _s_type_addr@GOTPAGEOFF]
Lloh19:
	ldr	w3, [x8]
	mov	x4, sp
	mov	x0, x20
	mov	w1, #0
	bl	_v4l2_device_call_all
LBB0_11:
	ldr	x8, [x19, #8]
Lloh20:
	adrp	x9, _GO7007_BOARDID_ADLINK_MPG24@GOTPAGE
Lloh21:
	ldr	x9, [x9, _GO7007_BOARDID_ADLINK_MPG24@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_16
; %bb.12:
	ldr	w0, [x19, #48]
Lloh23:
	adrp	x8, _video@GOTPAGE
Lloh24:
	ldr	x8, [x8, _video@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
Lloh26:
	adrp	x8, _s_routing@GOTPAGE
Lloh27:
	ldr	x8, [x8, _s_routing@GOTPAGEOFF]
Lloh28:
	ldr	w2, [x8]
	ldr	x8, [x19, #40]
	add	x5, x8, #1
	mov	w3, #0
	mov	w4, #0
	bl	_v4l2_subdev_call
	b	LBB0_16
LBB0_13:
	ldr	x8, [x19, #32]
	ldr	w8, [x8]
Lloh29:
	adrp	x9, _GO7007_BOARD_USE_ONBOARD_I2C@GOTPAGE
Lloh30:
	ldr	x9, [x9, _GO7007_BOARD_USE_ONBOARD_I2C@GOTPAGEOFF]
Lloh31:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_16
; %bb.14:
	mov	x0, x19
	bl	_go7007_i2c_init
	tbnz	w0, #31, LBB0_20
; %bb.15:
	mov	w8, #1
	str	w8, [x19]
	b	LBB0_4
LBB0_16:
	mov	x0, x19
	bl	_go7007_v4l2_init
	tbnz	w0, #31, LBB0_20
; %bb.17:
	ldr	x8, [x19, #32]
	ldr	w8, [x8]
Lloh32:
	adrp	x9, _GO7007_BOARD_HAS_AUDIO@GOTPAGE
Lloh33:
	ldr	x9, [x9, _GO7007_BOARD_HAS_AUDIO@GOTPAGEOFF]
Lloh34:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_19
; %bb.18:
	mov	w8, #1
	str	w8, [x19, #24]
	mov	x0, x19
	bl	_go7007_snd_init
LBB0_19:
	mov	w22, #0
	b	LBB0_21
LBB0_20:
	mov	x22, x0
LBB0_21:
	mov	x0, x22
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"go7007: registering new %s\n"

	.comm	_go7007_remove,4,2              ; @go7007_remove
	.comm	_GO7007_BOARD_USE_ONBOARD_I2C,4,2 ; @GO7007_BOARD_USE_ONBOARD_I2C
	.comm	_GO7007_BOARDID_ADS_USBAV_709,8,3 ; @GO7007_BOARDID_ADS_USBAV_709
	.comm	_T_ANALOG_TV,4,2                ; @T_ANALOG_TV
	.comm	_ADDR_UNSET,4,2                 ; @ADDR_UNSET
	.comm	_tuner,4,2                      ; @tuner
	.comm	_s_type_addr,4,2                ; @s_type_addr
	.comm	_GO7007_BOARDID_ADLINK_MPG24,8,3 ; @GO7007_BOARDID_ADLINK_MPG24
	.comm	_video,4,2                      ; @video
	.comm	_s_routing,4,2                  ; @s_routing
	.comm	_GO7007_BOARD_HAS_AUDIO,4,2     ; @GO7007_BOARD_HAS_AUDIO
.subsections_via_symbols
