	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function i2c_davinci_init
_i2c_davinci_init:                      ## @i2c_davinci_init
	.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, %r15
	movq	(%rdi), %rax
	movq	(%rax), %r13
	movl	8(%rdi), %edi
	callq	_clk_get_rate
	movl	%eax, %r14d
	movq	_DAVINCI_I2C_MDR_REG@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_davinci_i2c_read_reg
	movl	%eax, %ebx
	movq	_DAVINCI_I2C_MDR_IRS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	xorl	%edx, %edx
	callq	_MOD_REG_BIT
	movl	(%r12), %esi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_davinci_i2c_write_reg
	movslq	%r14d, %rax
	imulq	$1286742751, %rax, %rcx         ## imm = 0x4CB222DF
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$53, %rcx
	addl	%edx, %ecx
                                        ## kill: def $eax killed $eax killed $rax
	cltd
	idivl	%ecx
	xorl	%edx, %edx
	cmpl	$12000001, %eax                 ## imm = 0xB71B01
	setl	%dl
	subl	%edx, %ecx
	testq	%r13, %r13
	jne	LBB0_2
## %bb.1:
	movq	_davinci_i2c_platform_data_default@GOTPCREL(%rip), %r13
LBB0_2:
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
	leal	1(%rcx), %esi
	movl	%r14d, %eax
	cltd
	idivl	%esi
	imull	$1000, (%r13), %esi             ## imm = 0x3E8
	cltd
	idivl	%esi
	cmpl	$2, %ecx
	leal	-14(%rcx,%rcx), %edx
	movl	$-10, %r12d
	cmovll	%edx, %r12d
	addl	%eax, %r12d
	movl	%r12d, %ebx
	sarl	%ebx
	movl	%r12d, %r13d
	subl	%ebx, %r13d
	movq	_DAVINCI_I2C_PSC_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%ecx, %edx
	callq	_davinci_i2c_write_reg
	movq	_DAVINCI_I2C_CLKH_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_davinci_i2c_write_reg
	movq	_DAVINCI_I2C_CLKL_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%r13d, %edx
	callq	_davinci_i2c_write_reg
	movq	_DAVINCI_I2C_OAR_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	$8, %edx
	callq	_davinci_i2c_write_reg
	movq	(%r15), %rdi
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edx
	movl	%r12d, %ecx
	xorl	%eax, %eax
	callq	_dev_dbg
	movq	(%r15), %rbx
	movq	_DAVINCI_I2C_PSC_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_davinci_i2c_read_reg
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_dbg
	movq	(%r15), %rbx
	movq	_DAVINCI_I2C_CLKL_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_davinci_i2c_read_reg
	leaq	L_.str.2(%rip), %rsi
	movq	%rbx, %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_dbg
	movq	(%r15), %rbx
	movq	_DAVINCI_I2C_CLKH_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_davinci_i2c_read_reg
	leaq	L_.str.3(%rip), %rsi
	movq	%rbx, %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_dbg
	movq	(%r15), %rdi
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edx
	movl	4(%rax), %ecx
	leaq	L_.str.4(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_dbg
	movq	_DAVINCI_I2C_MDR_REG@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	%r15, %rdi
	callq	_davinci_i2c_read_reg
	movl	%eax, %ebx
	movq	_DAVINCI_I2C_MDR_IRS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	movl	$1, %edx
	callq	_MOD_REG_BIT
	movl	(%r14), %esi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_davinci_i2c_write_reg
	movq	_DAVINCI_I2C_IMR_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_I2C_DAVINCI_INTR_ALL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	callq	_davinci_i2c_write_reg
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_davinci_i2c_platform_data_default,8,2 ## @davinci_i2c_platform_data_default
	.comm	_DAVINCI_I2C_MDR_REG,4,2        ## @DAVINCI_I2C_MDR_REG
	.comm	_DAVINCI_I2C_MDR_IRS,4,2        ## @DAVINCI_I2C_MDR_IRS
	.comm	_DAVINCI_I2C_PSC_REG,4,2        ## @DAVINCI_I2C_PSC_REG
	.comm	_DAVINCI_I2C_CLKH_REG,4,2       ## @DAVINCI_I2C_CLKH_REG
	.comm	_DAVINCI_I2C_CLKL_REG,4,2       ## @DAVINCI_I2C_CLKL_REG
	.comm	_DAVINCI_I2C_OAR_REG,4,2        ## @DAVINCI_I2C_OAR_REG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"input_clock = %d, CLK = %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"PSC  = %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"CLKL = %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"CLKH = %d\n"

L_.str.4:                               ## @.str.4
	.asciz	"bus_freq = %dkHz, bus_delay = %d\n"

	.comm	_DAVINCI_I2C_IMR_REG,4,2        ## @DAVINCI_I2C_IMR_REG
	.comm	_I2C_DAVINCI_INTR_ALL,4,2       ## @I2C_DAVINCI_INTR_ALL
	.no_dead_strip	_i2c_davinci_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function i2c_davinci_init
_i2c_davinci_init:                      ; @i2c_davinci_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
	ldr	x8, [x0]
	ldr	x22, [x8]
	ldr	w0, [x0, #8]
	bl	_clk_get_rate
	mov	x20, x0
Lloh0:
	adrp	x23, _DAVINCI_I2C_MDR_REG@GOTPAGE
Lloh1:
	ldr	x23, [x23, _DAVINCI_I2C_MDR_REG@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x19
	bl	_davinci_i2c_read_reg
	mov	x21, x0
Lloh2:
	adrp	x24, _DAVINCI_I2C_MDR_IRS@GOTPAGE
Lloh3:
	ldr	x24, [x24, _DAVINCI_I2C_MDR_IRS@GOTPAGEOFF]
	ldr	w1, [x24]
	mov	w2, #0
	bl	_MOD_REG_BIT
	ldr	w1, [x23]
	mov	x0, x19
	mov	x2, x21
	bl	_davinci_i2c_write_reg
	mov	w8, #8927
	movk	w8, #19634, lsl #16
	smull	x8, w20, w8
	lsr	x9, x8, #63
	asr	x8, x8, #53
	add	w8, w8, w9
	sdiv	w9, w20, w8
	mov	w10, #6913
	movk	w10, #183, lsl #16
	cmp	w9, w10
	cset	w9, lt
	sub	w2, w8, w9
Lloh4:
	adrp	x8, _davinci_i2c_platform_data_default@GOTPAGE
Lloh5:
	ldr	x8, [x8, _davinci_i2c_platform_data_default@GOTPAGEOFF]
	cmp	x22, #0
	csel	x25, x8, x22, eq
	add	w8, w2, #1
	sdiv	w8, w20, w8
	ldr	w9, [x25]
	mov	w10, #1000
	mul	w9, w9, w10
	sdiv	w8, w8, w9
	lsl	w9, w2, #1
	sub	w9, w9, #14
	mov	w10, #-10
	cmp	w2, #1
	csel	w9, w10, w9, gt
	add	w27, w9, w8
	asr	w21, w27, #1
	sub	w22, w27, w21
Lloh6:
	adrp	x28, _DAVINCI_I2C_PSC_REG@GOTPAGE
Lloh7:
	ldr	x28, [x28, _DAVINCI_I2C_PSC_REG@GOTPAGEOFF]
	ldr	w1, [x28]
	mov	x0, x19
	bl	_davinci_i2c_write_reg
Lloh8:
	adrp	x26, _DAVINCI_I2C_CLKH_REG@GOTPAGE
Lloh9:
	ldr	x26, [x26, _DAVINCI_I2C_CLKH_REG@GOTPAGEOFF]
	ldr	w1, [x26]
	mov	x0, x19
	mov	x2, x21
	bl	_davinci_i2c_write_reg
Lloh10:
	adrp	x21, _DAVINCI_I2C_CLKL_REG@GOTPAGE
Lloh11:
	ldr	x21, [x21, _DAVINCI_I2C_CLKL_REG@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x19
	mov	x2, x22
	bl	_davinci_i2c_write_reg
Lloh12:
	adrp	x8, _DAVINCI_I2C_OAR_REG@GOTPAGE
Lloh13:
	ldr	x8, [x8, _DAVINCI_I2C_OAR_REG@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #8
	bl	_davinci_i2c_write_reg
	ldr	x0, [x19]
	str	x27, [sp]
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	bl	_dev_dbg
	ldr	x20, [x19]
	ldr	w1, [x28]
	mov	x0, x19
	bl	_davinci_i2c_read_reg
	mov	x2, x0
Lloh17:
	adrp	x1, l_.str.1@PAGE
Lloh18:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_dev_dbg
	ldr	x20, [x19]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_davinci_i2c_read_reg
	mov	x2, x0
Lloh19:
	adrp	x1, l_.str.2@PAGE
Lloh20:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x20
	bl	_dev_dbg
	ldr	x20, [x19]
	ldr	w1, [x26]
	mov	x0, x19
	bl	_davinci_i2c_read_reg
	mov	x2, x0
Lloh21:
	adrp	x1, l_.str.3@PAGE
Lloh22:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x20
	bl	_dev_dbg
	ldr	x0, [x19]
	ldp	w2, w8, [x25]
	str	x8, [sp]
Lloh23:
	adrp	x1, l_.str.4@PAGE
Lloh24:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_dev_dbg
	ldr	w1, [x23]
	mov	x0, x19
	bl	_davinci_i2c_read_reg
	mov	x20, x0
	ldr	w1, [x24]
	mov	w2, #1
	bl	_MOD_REG_BIT
	ldr	w1, [x23]
	mov	x0, x19
	mov	x2, x20
	bl	_davinci_i2c_write_reg
Lloh25:
	adrp	x8, _DAVINCI_I2C_IMR_REG@GOTPAGE
Lloh26:
	ldr	x8, [x8, _DAVINCI_I2C_IMR_REG@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
Lloh28:
	adrp	x8, _I2C_DAVINCI_INTR_ALL@GOTPAGE
Lloh29:
	ldr	x8, [x8, _I2C_DAVINCI_INTR_ALL@GOTPAGEOFF]
Lloh30:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_davinci_i2c_write_reg
	mov	w0, #0
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_davinci_i2c_platform_data_default,8,2 ; @davinci_i2c_platform_data_default
	.comm	_DAVINCI_I2C_MDR_REG,4,2        ; @DAVINCI_I2C_MDR_REG
	.comm	_DAVINCI_I2C_MDR_IRS,4,2        ; @DAVINCI_I2C_MDR_IRS
	.comm	_DAVINCI_I2C_PSC_REG,4,2        ; @DAVINCI_I2C_PSC_REG
	.comm	_DAVINCI_I2C_CLKH_REG,4,2       ; @DAVINCI_I2C_CLKH_REG
	.comm	_DAVINCI_I2C_CLKL_REG,4,2       ; @DAVINCI_I2C_CLKL_REG
	.comm	_DAVINCI_I2C_OAR_REG,4,2        ; @DAVINCI_I2C_OAR_REG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"input_clock = %d, CLK = %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"PSC  = %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"CLKL = %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"CLKH = %d\n"

l_.str.4:                               ; @.str.4
	.asciz	"bus_freq = %dkHz, bus_delay = %d\n"

	.comm	_DAVINCI_I2C_IMR_REG,4,2        ; @DAVINCI_I2C_IMR_REG
	.comm	_I2C_DAVINCI_INTR_ALL,4,2       ; @I2C_DAVINCI_INTR_ALL
	.no_dead_strip	_i2c_davinci_init
.subsections_via_symbols
