	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_init_cx18_i2c                  ## -- Begin function init_cx18_i2c
	.p2align	4, 0x90
_init_cx18_i2c:                         ## @init_cx18_i2c
	.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, %r12
	leaq	L_.str(%rip), %rdi
	callq	_CX18_DEBUG_I2C
	leaq	32(%r12), %r14
	movq	40(%r12), %rax
	movq	_cx18_i2c_algo_template@GOTPCREL(%rip), %r15
	movq	(%r15), %rcx
	movq	%rcx, (%rax)
	movq	16(%r12), %rax
	movq	%r12, 8(%rax)
	movl	$0, (%rax)
	movq	40(%r12), %rcx
	movq	%rax, (%rcx)
	movq	8(%r12), %rax
	movq	_cx18_i2c_adap_template@GOTPCREL(%rip), %r13
	movups	(%r13), %xmm0
	movups	%xmm0, (%rax)
	movq	16(%r13), %rcx
	movq	%rcx, 16(%rax)
	movq	8(%r12), %rax
	movq	40(%r12), %rcx
	movq	%rcx, 16(%rax)
	movq	8(%rax), %rbx
	movq	%rbx, %rdi
	callq	_strlen
	addq	%rax, %rbx
	movl	(%r12), %edx
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	xorl	%ecx, %ecx
	callq	_sprintf
	movq	8(%r12), %rdi
	movq	%r14, %rsi
	callq	_i2c_set_adapdata
	movq	8(%r12), %rax
	movq	24(%r12), %rcx
	movq	%rcx, (%rax)
	movq	40(%r12), %rax
	movq	(%r15), %rcx
	movq	%rcx, 8(%rax)
	movq	16(%r12), %rax
	leaq	16(%rax), %rcx
	movq	%r12, 24(%rax)
	movl	$1, 16(%rax)
	movq	40(%r12), %rax
	movq	%rcx, 8(%rax)
	movq	8(%r12), %rax
	movups	(%r13), %xmm0
	movups	%xmm0, 24(%rax)
	movq	16(%r13), %rcx
	movq	%rcx, 40(%rax)
	movq	8(%r12), %rax
	movq	40(%r12), %rcx
	addq	$8, %rcx
	movq	%rcx, 40(%rax)
	movq	32(%rax), %rbx
	movq	%rbx, %rdi
	callq	_strlen
	addq	%rax, %rbx
	movl	(%r12), %edx
	movq	%rbx, %rdi
	leaq	L_.str.1(%rip), %rsi
	movl	$1, %ecx
	callq	_sprintf
	movq	8(%r12), %rdi
	addq	$24, %rdi
	movq	%r14, %rsi
	callq	_i2c_set_adapdata
	movq	8(%r12), %rax
	movq	24(%r12), %rcx
	movq	%rcx, 24(%rax)
	movq	_CX18_REG_I2C_2_WR@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r12, %rdi
	callq	_cx18_read_reg
	cmpl	$245807, %eax                   ## imm = 0x3C02F
	je	LBB0_2
## %bb.1:
	movq	%r12, %rdi
	movl	$268435456, %esi                ## imm = 0x10000000
	movl	$13045764, %edx                 ## imm = 0xC71004
	xorl	%ecx, %ecx
	movl	$268439552, %r8d                ## imm = 0x10001000
	callq	_cx18_write_reg_expect
	movq	%r12, %rdi
	movl	$268439552, %esi                ## imm = 0x10001000
	movl	$13045796, %edx                 ## imm = 0xC71024
	movl	$4096, %ecx                     ## imm = 0x1000
	movl	$268439552, %r8d                ## imm = 0x10001000
	callq	_cx18_write_reg_expect
LBB0_2:
	movq	%r12, %rdi
	movl	$12582912, %esi                 ## imm = 0xC00000
	movl	$13041692, %edx                 ## imm = 0xC7001C
	xorl	%ecx, %ecx
	movl	$12583104, %r8d                 ## imm = 0xC000C0
	callq	_cx18_write_reg_expect
	movl	$10, %edi
	callq	_mdelay
	movq	%r12, %rdi
	movl	$12583104, %esi                 ## imm = 0xC000C0
	movl	$13041692, %edx                 ## imm = 0xC7001C
	movl	$192, %ecx
	movl	$12583104, %r8d                 ## imm = 0xC000C0
	callq	_cx18_write_reg_expect
	movl	$10, %edi
	callq	_mdelay
	movq	%r12, %rdi
	movl	$12582912, %esi                 ## imm = 0xC00000
	movl	$13041692, %edx                 ## imm = 0xC7001C
	xorl	%ecx, %ecx
	movl	$12583104, %r8d                 ## imm = 0xC000C0
	callq	_cx18_write_reg_expect
	movl	$10, %edi
	callq	_mdelay
	movq	%r12, %rdi
	movl	$12582912, %esi                 ## imm = 0xC00000
	movl	$13054152, %edx                 ## imm = 0xC730C8
	callq	_cx18_write_reg
	movq	_HW2_I2C1_INT@GOTPCREL(%rip), %rax
	movq	_HW2_I2C2_INT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movq	_HW2_INT_CLR_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%esi, %ecx
	notl	%ecx
	movq	%r12, %rdi
	movl	%esi, %r8d
	callq	_cx18_write_reg_expect
	movq	_CX18_REG_I2C_1_WR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	movl	$138251, %esi                   ## imm = 0x21C0B
	callq	_cx18_write_reg
	movq	16(%r12), %rdi
	movl	$1, %esi
	callq	_cx18_setscl
	movq	16(%r12), %rdi
	movl	$1, %esi
	callq	_cx18_setsda
	movl	(%rbx), %edx
	movq	%r12, %rdi
	movl	$138251, %esi                   ## imm = 0x21C0B
	callq	_cx18_write_reg
	movq	16(%r12), %rdi
	addq	$16, %rdi
	movl	$1, %esi
	callq	_cx18_setscl
	movq	16(%r12), %rdi
	addq	$16, %rdi
	movl	$1, %esi
	callq	_cx18_setsda
	movq	_CX18_HW_GPIO_RESET_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_core@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_reset@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_CX18_GPIO_RESET_I2C@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%r12, %rdi
	callq	_cx18_call_hw
	movq	8(%r12), %rdi
	callq	_i2c_bit_add_bus
	testl	%eax, %eax
	jne	LBB0_5
## %bb.3:
	movq	8(%r12), %rdi
	addq	$24, %rdi
	callq	_i2c_bit_add_bus
	movl	%eax, %r14d
	movl	$0, %eax
	testl	%r14d, %r14d
	je	LBB0_5
## %bb.4:
	movq	8(%r12), %rdi
	callq	_i2c_del_adapter
	movl	%r14d, %eax
LBB0_5:
	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	"i2c init\n"

	.comm	_cx18_i2c_algo_template,8,3     ## @cx18_i2c_algo_template
	.comm	_cx18_i2c_adap_template,24,3    ## @cx18_i2c_adap_template
L_.str.1:                               ## @.str.1
	.asciz	" #%d-%d"

	.comm	_CX18_REG_I2C_2_WR,4,2          ## @CX18_REG_I2C_2_WR
	.comm	_HW2_I2C1_INT,4,2               ## @HW2_I2C1_INT
	.comm	_HW2_I2C2_INT,4,2               ## @HW2_I2C2_INT
	.comm	_HW2_INT_CLR_STATUS,4,2         ## @HW2_INT_CLR_STATUS
	.comm	_CX18_REG_I2C_1_WR,4,2          ## @CX18_REG_I2C_1_WR
	.comm	_CX18_HW_GPIO_RESET_CTRL,4,2    ## @CX18_HW_GPIO_RESET_CTRL
	.comm	_core,4,2                       ## @core
	.comm	_reset,4,2                      ## @reset
	.comm	_CX18_GPIO_RESET_I2C,8,3        ## @CX18_GPIO_RESET_I2C
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_init_cx18_i2c                  ; -- Begin function init_cx18_i2c
	.p2align	2
_init_cx18_i2c:                         ; @init_cx18_i2c
	.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	x19, x0
	mov	w23, #28
	movk	w23, #199, lsl #16
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_CX18_DEBUG_I2C
	add	x20, x19, #32
	ldr	x8, [x19, #40]
Lloh2:
	adrp	x22, _cx18_i2c_algo_template@GOTPAGE
Lloh3:
	ldr	x22, [x22, _cx18_i2c_algo_template@GOTPAGEOFF]
	ldr	x9, [x22]
	str	x9, [x8]
	ldp	x9, x8, [x19, #8]
	str	x19, [x8, #8]
	str	wzr, [x8]
	ldr	x10, [x19, #40]
	str	x8, [x10]
Lloh4:
	adrp	x24, _cx18_i2c_adap_template@GOTPAGE
Lloh5:
	ldr	x24, [x24, _cx18_i2c_adap_template@GOTPAGEOFF]
	ldr	q0, [x24]
	ldr	x8, [x24, #16]
	str	x8, [x9, #16]
	str	q0, [x9]
	ldr	x8, [x19, #40]
	ldr	x9, [x19, #8]
	str	x8, [x9, #16]
	ldr	x21, [x9, #8]
	mov	x0, x21
	bl	_strlen
	add	x0, x0, x21
	ldr	w2, [x19]
Lloh6:
	adrp	x21, l_.str.1@PAGE
Lloh7:
	add	x21, x21, l_.str.1@PAGEOFF
	mov	x1, x21
	mov	w3, #0
	bl	_sprintf
	ldr	x0, [x19, #8]
	mov	x1, x20
	bl	_i2c_set_adapdata
	ldr	x8, [x19, #24]
	ldr	x9, [x19, #8]
	str	x8, [x9]
	ldr	x8, [x19, #40]
	ldr	x9, [x22]
	str	x9, [x8, #8]
	mov	w8, #1
	ldp	x10, x9, [x19, #8]
	str	w8, [x9, #16]!
	str	x19, [x9, #8]
	ldr	x8, [x19, #40]
	str	x9, [x8, #8]
	ldr	x8, [x24, #16]
	str	x8, [x10, #40]
	ldr	q0, [x24]
	stur	q0, [x10, #24]
	ldr	x8, [x19, #40]
	add	x8, x8, #8
	ldr	x9, [x19, #8]
	str	x8, [x9, #40]
	ldr	x22, [x9, #32]
	mov	x0, x22
	bl	_strlen
	add	x0, x0, x22
	ldr	w2, [x19]
	mov	x1, x21
	mov	w3, #1
	bl	_sprintf
	ldr	x8, [x19, #8]
	add	x0, x8, #24
	mov	x1, x20
	bl	_i2c_set_adapdata
	ldr	x8, [x19, #24]
	ldr	x9, [x19, #8]
	str	x8, [x9, #24]
Lloh8:
	adrp	x20, _CX18_REG_I2C_2_WR@GOTPAGE
Lloh9:
	ldr	x20, [x20, _CX18_REG_I2C_2_WR@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	x0, x19
	bl	_cx18_read_reg
	sub	w8, w0, #60, lsl #12            ; =245760
	cmp	w8, #47
	b.eq	LBB0_2
; %bb.1:
	add	w2, w23, #4072
	mov	x0, x19
	mov	w1, #268435456
	mov	w3, #0
	mov	w4, #268439552
	bl	_cx18_write_reg_expect
	mov	x0, x19
	mov	w1, #268439552
	mov	w2, #4132
	movk	w2, #199, lsl #16
	mov	w3, #4096
	mov	w4, #268439552
	bl	_cx18_write_reg_expect
LBB0_2:
	mov	x0, x19
	mov	w1, #12582912
	mov	w2, #28
	movk	w2, #199, lsl #16
	mov	w3, #0
	mov	w4, #12583104
	bl	_cx18_write_reg_expect
	mov	w0, #10
	bl	_mdelay
	mov	x0, x19
	mov	w1, #12583104
	mov	w2, #28
	movk	w2, #199, lsl #16
	mov	w3, #192
	mov	w4, #12583104
	bl	_cx18_write_reg_expect
	mov	w0, #10
	bl	_mdelay
	mov	x0, x19
	mov	w1, #12582912
	mov	w2, #28
	movk	w2, #199, lsl #16
	mov	w3, #0
	mov	w4, #12583104
	bl	_cx18_write_reg_expect
	mov	w0, #10
	bl	_mdelay
	mov	x0, x19
	mov	w1, #12582912
	mov	w2, #12488
	movk	w2, #199, lsl #16
	bl	_cx18_write_reg
Lloh10:
	adrp	x8, _HW2_I2C1_INT@GOTPAGE
Lloh11:
	ldr	x8, [x8, _HW2_I2C1_INT@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
Lloh13:
	adrp	x9, _HW2_I2C2_INT@GOTPAGE
Lloh14:
	ldr	x9, [x9, _HW2_I2C2_INT@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	orr	w1, w9, w8
Lloh16:
	adrp	x8, _HW2_INT_CLR_STATUS@GOTPAGE
Lloh17:
	ldr	x8, [x8, _HW2_INT_CLR_STATUS@GOTPAGEOFF]
Lloh18:
	ldr	w2, [x8]
	mvn	w3, w1
	mov	x0, x19
	mov	x4, x1
	bl	_cx18_write_reg_expect
Lloh19:
	adrp	x8, _CX18_REG_I2C_1_WR@GOTPAGE
Lloh20:
	ldr	x8, [x8, _CX18_REG_I2C_1_WR@GOTPAGEOFF]
Lloh21:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w1, #7179
	movk	w1, #2, lsl #16
	bl	_cx18_write_reg
	ldr	x0, [x19, #16]
	mov	w1, #1
	bl	_cx18_setscl
	ldr	x0, [x19, #16]
	mov	w1, #1
	bl	_cx18_setsda
	ldr	w2, [x20]
	mov	x0, x19
	mov	w1, #7179
	movk	w1, #2, lsl #16
	bl	_cx18_write_reg
	ldr	x8, [x19, #16]
	add	x0, x8, #16
	mov	w1, #1
	bl	_cx18_setscl
	ldr	x8, [x19, #16]
	add	x0, x8, #16
	mov	w1, #1
	bl	_cx18_setsda
Lloh22:
	adrp	x8, _CX18_HW_GPIO_RESET_CTRL@GOTPAGE
Lloh23:
	ldr	x8, [x8, _CX18_HW_GPIO_RESET_CTRL@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
Lloh25:
	adrp	x8, _core@GOTPAGE
Lloh26:
	ldr	x8, [x8, _core@GOTPAGEOFF]
Lloh27:
	ldr	w2, [x8]
Lloh28:
	adrp	x8, _reset@GOTPAGE
Lloh29:
	ldr	x8, [x8, _reset@GOTPAGEOFF]
Lloh30:
	ldr	w3, [x8]
Lloh31:
	adrp	x8, _CX18_GPIO_RESET_I2C@GOTPAGE
Lloh32:
	ldr	x8, [x8, _CX18_GPIO_RESET_I2C@GOTPAGEOFF]
Lloh33:
	ldr	w4, [x8]
	mov	x0, x19
	bl	_cx18_call_hw
	ldr	x0, [x19, #8]
	bl	_i2c_bit_add_bus
	mov	x20, x0
	cbnz	w0, LBB0_5
; %bb.3:
	ldr	x8, [x19, #8]
	add	x0, x8, #24
	bl	_i2c_bit_add_bus
	mov	x20, x0
	cbz	w0, LBB0_5
; %bb.4:
	ldr	x0, [x19, #8]
	bl	_i2c_del_adapter
LBB0_5:
	mov	x0, x20
	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 AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"i2c init\n"

	.comm	_cx18_i2c_algo_template,8,3     ; @cx18_i2c_algo_template
	.comm	_cx18_i2c_adap_template,24,3    ; @cx18_i2c_adap_template
l_.str.1:                               ; @.str.1
	.asciz	" #%d-%d"

	.comm	_CX18_REG_I2C_2_WR,4,2          ; @CX18_REG_I2C_2_WR
	.comm	_HW2_I2C1_INT,4,2               ; @HW2_I2C1_INT
	.comm	_HW2_I2C2_INT,4,2               ; @HW2_I2C2_INT
	.comm	_HW2_INT_CLR_STATUS,4,2         ; @HW2_INT_CLR_STATUS
	.comm	_CX18_REG_I2C_1_WR,4,2          ; @CX18_REG_I2C_1_WR
	.comm	_CX18_HW_GPIO_RESET_CTRL,4,2    ; @CX18_HW_GPIO_RESET_CTRL
	.comm	_core,4,2                       ; @core
	.comm	_reset,4,2                      ; @reset
	.comm	_CX18_GPIO_RESET_I2C,8,3        ; @CX18_GPIO_RESET_I2C
.subsections_via_symbols
