	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hexium_attach
_hexium_attach:                         ## @hexium_attach
	.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	%rdi, %r14
	leaq	L_.str(%rip), %rdi
	callq	_DEB_EE
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$24, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rax, %rbx
	movq	%rax, (%r14)
	movq	_MASK_08@GOTPCREL(%rip), %rax
	movq	_MASK_24@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	_MC1@GOTPCREL(%rip), %rax
	movq	_MASK_10@GOTPCREL(%rip), %r12
	orl	(%r12), %edx
	movl	(%rax), %esi
	movq	_MASK_26@GOTPCREL(%rip), %r13
	orl	(%r13), %edx
	movq	%r14, %rdi
	callq	_saa7146_write
	movl	(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	$4, %edx
	callq	_strscpy
	movq	_SAA7146_I2C_BUS_BIT_RATE_480@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_saa7146_i2c_adapter_prepare
	movq	%rbx, %rdi
	callq	_i2c_add_adapter
	testq	%rax, %rax
	js	LBB0_4
## %bb.5:
	movq	_SAA7146_GPIO_OUTHI@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movl	$2, %esi
	callq	_saa7146_setgpio
	movq	_DD1_INIT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	$117442304, %edx                ## imm = 0x7000700
	callq	_saa7146_write
	movq	_DD1_STREAM_B@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%r15d, %r15d
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_saa7146_write
	movq	_MC2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MASK_09@GOTPCREL(%rip), %rax
	movq	_MASK_25@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	orl	(%r12), %edx
	orl	(%r13), %edx
	movq	%r14, %rdi
	callq	_saa7146_write
	movq	$0, 8(%rbx)
	movq	%r14, %rdi
	callq	_hexium_init_done
	movq	_hexium_pal@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_hexium_set_standard
	movq	_V4L2_STD_PAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%rbx)
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_hexium_set_input
	movq	$0, 8(%rbx)
	movq	_vv_data@GOTPCREL(%rip), %r12
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_saa7146_vv_init
	movq	_vidioc_enum_input@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r12)
	movq	_vidioc_g_input@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%r12)
	movq	_vidioc_s_input@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r12)
	movq	%rbx, %rdi
	addq	$4, %rdi
	movq	_VFL_TYPE_GRABBER@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	L_.str.1(%rip), %rdx
	movq	%r14, %rsi
	callq	_saa7146_register_device
	testl	%eax, %eax
	js	LBB0_6
## %bb.7:
	movq	_hexium_num@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	leaq	L_.str.4(%rip), %rdi
	callq	_pr_info
	incl	(%rbx)
	jmp	LBB0_8
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_4:
	leaq	L_.str.2(%rip), %rdi
	callq	_DEB_S
	movq	%rbx, %rdi
	callq	_kfree
	movq	_EFAULT@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_8
LBB0_6:
	movl	%eax, %r12d
	leaq	L_.str.3(%rip), %rdi
	callq	_pr_err
	movq	%r14, %rdi
	callq	_saa7146_vv_release
	movq	%rbx, %rdi
	callq	_i2c_del_adapter
	movq	%rbx, %rdi
	callq	_kfree
	movl	%r12d, %r15d
LBB0_8:
	movl	%r15d, %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	"\n"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_MC1,4,2                        ## @MC1
	.comm	_MASK_08,4,2                    ## @MASK_08
	.comm	_MASK_24,4,2                    ## @MASK_24
	.comm	_MASK_10,4,2                    ## @MASK_10
	.comm	_MASK_26,4,2                    ## @MASK_26
L_.str.1:                               ## @.str.1
	.asciz	"hexium gemini"

	.comm	_SAA7146_I2C_BUS_BIT_RATE_480,4,2 ## @SAA7146_I2C_BUS_BIT_RATE_480
L_.str.2:                               ## @.str.2
	.asciz	"cannot register i2c-device. skipping.\n"

	.comm	_EFAULT,4,2                     ## @EFAULT
	.comm	_SAA7146_GPIO_OUTHI,4,2         ## @SAA7146_GPIO_OUTHI
	.comm	_DD1_INIT,4,2                   ## @DD1_INIT
	.comm	_DD1_STREAM_B,4,2               ## @DD1_STREAM_B
	.comm	_MC2,4,2                        ## @MC2
	.comm	_MASK_09,4,2                    ## @MASK_09
	.comm	_MASK_25,4,2                    ## @MASK_25
	.comm	_hexium_pal,4,2                 ## @hexium_pal
	.comm	_V4L2_STD_PAL,4,2               ## @V4L2_STD_PAL
	.comm	_vv_data,12,2                   ## @vv_data
	.comm	_vidioc_enum_input,4,2          ## @vidioc_enum_input
	.comm	_vidioc_g_input,4,2             ## @vidioc_g_input
	.comm	_vidioc_s_input,4,2             ## @vidioc_s_input
	.comm	_VFL_TYPE_GRABBER,4,2           ## @VFL_TYPE_GRABBER
L_.str.3:                               ## @.str.3
	.asciz	"cannot register capture v4l2 device. skipping.\n"

L_.str.4:                               ## @.str.4
	.asciz	"found 'hexium gemini' frame grabber-%d\n"

	.comm	_hexium_num,4,2                 ## @hexium_num
	.no_dead_strip	_hexium_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hexium_attach
_hexium_attach:                         ; @hexium_attach
	.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	x20, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DEB_EE
Lloh2:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	w0, #24
	bl	_kzalloc
	cbz	x0, LBB0_4
; %bb.1:
	mov	x19, x0
	str	x0, [x20]
Lloh5:
	adrp	x8, _MC1@GOTPAGE
Lloh6:
	ldr	x8, [x8, _MC1@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
Lloh8:
	adrp	x8, _MASK_08@GOTPAGE
Lloh9:
	ldr	x8, [x8, _MASK_08@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
Lloh11:
	adrp	x9, _MASK_24@GOTPAGE
Lloh12:
	ldr	x9, [x9, _MASK_24@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh14:
	adrp	x21, _MASK_10@GOTPAGE
Lloh15:
	ldr	x21, [x21, _MASK_10@GOTPAGEOFF]
	ldr	w9, [x21]
	orr	w8, w8, w9
Lloh16:
	adrp	x22, _MASK_26@GOTPAGE
Lloh17:
	ldr	x22, [x22, _MASK_26@GOTPAGEOFF]
	ldr	w9, [x22]
	orr	w2, w8, w9
	mov	x0, x20
	bl	_saa7146_write
	ldr	w0, [x19]
Lloh18:
	adrp	x1, l_.str.1@PAGE
Lloh19:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w2, #4
	bl	_strscpy
Lloh20:
	adrp	x8, _SAA7146_I2C_BUS_BIT_RATE_480@GOTPAGE
Lloh21:
	ldr	x8, [x8, _SAA7146_I2C_BUS_BIT_RATE_480@GOTPAGEOFF]
Lloh22:
	ldr	w2, [x8]
	mov	x0, x20
	mov	x1, x19
	bl	_saa7146_i2c_adapter_prepare
	mov	x0, x19
	bl	_i2c_add_adapter
	tbnz	x0, #63, LBB0_5
; %bb.2:
Lloh23:
	adrp	x8, _SAA7146_GPIO_OUTHI@GOTPAGE
Lloh24:
	ldr	x8, [x8, _SAA7146_GPIO_OUTHI@GOTPAGEOFF]
Lloh25:
	ldr	w2, [x8]
	mov	x0, x20
	mov	w1, #2
	bl	_saa7146_setgpio
Lloh26:
	adrp	x8, _DD1_INIT@GOTPAGE
Lloh27:
	ldr	x8, [x8, _DD1_INIT@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #117442304
	bl	_saa7146_write
Lloh29:
	adrp	x8, _DD1_STREAM_B@GOTPAGE
Lloh30:
	ldr	x8, [x8, _DD1_STREAM_B@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #0
	bl	_saa7146_write
Lloh32:
	adrp	x8, _MC2@GOTPAGE
Lloh33:
	ldr	x8, [x8, _MC2@GOTPAGEOFF]
Lloh34:
	ldr	w1, [x8]
Lloh35:
	adrp	x8, _MASK_09@GOTPAGE
Lloh36:
	ldr	x8, [x8, _MASK_09@GOTPAGEOFF]
Lloh37:
	ldr	w8, [x8]
Lloh38:
	adrp	x9, _MASK_25@GOTPAGE
Lloh39:
	ldr	x9, [x9, _MASK_25@GOTPAGEOFF]
Lloh40:
	ldr	w9, [x9]
	orr	w8, w9, w8
	ldr	w9, [x21]
	orr	w8, w8, w9
	ldr	w9, [x22]
	orr	w2, w8, w9
	mov	x0, x20
	bl	_saa7146_write
	str	xzr, [x19, #8]
	mov	x0, x20
	bl	_hexium_init_done
Lloh41:
	adrp	x8, _hexium_pal@GOTPAGE
Lloh42:
	ldr	x8, [x8, _hexium_pal@GOTPAGEOFF]
Lloh43:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_hexium_set_standard
Lloh44:
	adrp	x8, _V4L2_STD_PAL@GOTPAGE
Lloh45:
	ldr	x8, [x8, _V4L2_STD_PAL@GOTPAGEOFF]
Lloh46:
	ldr	w8, [x8]
	str	w8, [x19, #16]
	mov	x0, x19
	mov	w1, #0
	bl	_hexium_set_input
	str	xzr, [x19, #8]
Lloh47:
	adrp	x21, _vv_data@GOTPAGE
Lloh48:
	ldr	x21, [x21, _vv_data@GOTPAGEOFF]
	mov	x0, x20
	mov	x1, x21
	bl	_saa7146_vv_init
Lloh49:
	adrp	x8, _vidioc_enum_input@GOTPAGE
Lloh50:
	ldr	x8, [x8, _vidioc_enum_input@GOTPAGEOFF]
Lloh51:
	ldr	w8, [x8]
	str	w8, [x21, #8]
Lloh52:
	adrp	x8, _vidioc_g_input@GOTPAGE
Lloh53:
	ldr	x8, [x8, _vidioc_g_input@GOTPAGEOFF]
Lloh54:
	ldr	w8, [x8]
Lloh55:
	adrp	x9, _vidioc_s_input@GOTPAGE
Lloh56:
	ldr	x9, [x9, _vidioc_s_input@GOTPAGEOFF]
Lloh57:
	ldr	w9, [x9]
	stp	w9, w8, [x21]
	add	x0, x19, #4
Lloh58:
	adrp	x8, _VFL_TYPE_GRABBER@GOTPAGE
Lloh59:
	ldr	x8, [x8, _VFL_TYPE_GRABBER@GOTPAGEOFF]
Lloh60:
	ldr	w3, [x8]
Lloh61:
	adrp	x2, l_.str.1@PAGE
Lloh62:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x1, x20
	bl	_saa7146_register_device
	tbnz	w0, #31, LBB0_7
; %bb.3:
Lloh63:
	adrp	x19, _hexium_num@GOTPAGE
Lloh64:
	ldr	x19, [x19, _hexium_num@GOTPAGEOFF]
	ldr	w1, [x19]
Lloh65:
	adrp	x0, l_.str.4@PAGE
Lloh66:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_pr_info
	mov	w21, #0
	ldr	w8, [x19]
	add	w8, w8, #1
	str	w8, [x19]
	b	LBB0_8
LBB0_4:
Lloh67:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh68:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:
Lloh69:
	adrp	x0, l_.str.2@PAGE
Lloh70:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DEB_S
	mov	x0, x19
	bl	_kfree
Lloh71:
	adrp	x8, _EFAULT@GOTPAGE
Lloh72:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_8
LBB0_7:
	mov	x21, x0
Lloh73:
	adrp	x0, l_.str.3@PAGE
Lloh74:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_pr_err
	mov	x0, x20
	bl	_saa7146_vv_release
	mov	x0, x19
	bl	_i2c_del_adapter
	mov	x0, x19
	bl	_kfree
LBB0_8:
	mov	x0, 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
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh61, Lloh62
	.loh AdrpLdrGotLdr	Lloh58, Lloh59, Lloh60
	.loh AdrpLdrGotLdr	Lloh55, Lloh56, Lloh57
	.loh AdrpLdrGotLdr	Lloh52, Lloh53, Lloh54
	.loh AdrpLdrGotLdr	Lloh49, Lloh50, Lloh51
	.loh AdrpLdrGot	Lloh47, Lloh48
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh65, Lloh66
	.loh AdrpLdrGot	Lloh63, Lloh64
	.loh AdrpLdrGot	Lloh67, Lloh68
	.loh AdrpLdrGot	Lloh71, Lloh72
	.loh AdrpAdd	Lloh69, Lloh70
	.loh AdrpAdd	Lloh73, Lloh74
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"\n"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_MC1,4,2                        ; @MC1
	.comm	_MASK_08,4,2                    ; @MASK_08
	.comm	_MASK_24,4,2                    ; @MASK_24
	.comm	_MASK_10,4,2                    ; @MASK_10
	.comm	_MASK_26,4,2                    ; @MASK_26
l_.str.1:                               ; @.str.1
	.asciz	"hexium gemini"

	.comm	_SAA7146_I2C_BUS_BIT_RATE_480,4,2 ; @SAA7146_I2C_BUS_BIT_RATE_480
l_.str.2:                               ; @.str.2
	.asciz	"cannot register i2c-device. skipping.\n"

	.comm	_EFAULT,4,2                     ; @EFAULT
	.comm	_SAA7146_GPIO_OUTHI,4,2         ; @SAA7146_GPIO_OUTHI
	.comm	_DD1_INIT,4,2                   ; @DD1_INIT
	.comm	_DD1_STREAM_B,4,2               ; @DD1_STREAM_B
	.comm	_MC2,4,2                        ; @MC2
	.comm	_MASK_09,4,2                    ; @MASK_09
	.comm	_MASK_25,4,2                    ; @MASK_25
	.comm	_hexium_pal,4,2                 ; @hexium_pal
	.comm	_V4L2_STD_PAL,4,2               ; @V4L2_STD_PAL
	.comm	_vv_data,12,2                   ; @vv_data
	.comm	_vidioc_enum_input,4,2          ; @vidioc_enum_input
	.comm	_vidioc_g_input,4,2             ; @vidioc_g_input
	.comm	_vidioc_s_input,4,2             ; @vidioc_s_input
	.comm	_VFL_TYPE_GRABBER,4,2           ; @VFL_TYPE_GRABBER
l_.str.3:                               ; @.str.3
	.asciz	"cannot register capture v4l2 device. skipping.\n"

l_.str.4:                               ; @.str.4
	.asciz	"found 'hexium gemini' frame grabber-%d\n"

	.comm	_hexium_num,4,2                 ; @hexium_num
	.no_dead_strip	_hexium_attach
.subsections_via_symbols
