	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function kempld_i2c_device_init
_kempld_i2c_device_init:                ## @kempld_i2c_device_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), %r14
	movq	_KEMPLD_I2C_CTRL@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	%r14, %rdi
	callq	_kempld_read8
	movq	_I2C_CTRL_EN@GOTPCREL(%rip), %r13
	movq	_I2C_CTRL_IEN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r15d
	orl	(%r13), %r15d
	notl	%r15d
	andl	%eax, %r15d
	movl	(%r12), %esi
	movq	%r14, %rdi
	movl	%r15d, %edx
	callq	_kempld_write8
	movq	_bus_frequency@GOTPCREL(%rip), %rcx
	movl	(%rcx), %eax
	movq	_KEMPLD_I2C_FREQ_MAX@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	cmpl	%edx, %eax
	jle	LBB0_2
## %bb.1:
	movl	%edx, (%rcx)
	movl	%edx, %eax
LBB0_2:
	movl	4(%r14), %ecx
	leal	(,%rax,4), %edx
	cmpl	$1, %ecx
	leal	(%rax,%rax,4), %esi
	cmovnel	%edx, %esi
	movl	(%r14), %eax
	cltd
	idivl	%esi
                                        ## kill: def $eax killed $eax def $rax
	leal	-1000(%rax), %edx
	addl	$-3000, %eax                    ## imm = 0xF448
	cmpl	$1, %ecx
	cmovel	%edx, %eax
	xorl	%ecx, %ecx
	testl	%eax, %eax
	cmovgl	%eax, %ecx
	imulq	$274877907, %rcx, %rbx          ## imm = 0x10624DD3
	shrq	$38, %rbx
	imull	$1000, %ebx, %eax               ## imm = 0x3E8
	subl	%eax, %ecx
	cmpl	$500, %ecx                      ## imm = 0x1F4
	sbbl	$-1, %ebx
	movq	_KEMPLD_I2C_PRELOW@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movzbl	%bl, %edx
	movq	%r14, %rdi
	callq	_kempld_write8
	movq	_KEMPLD_I2C_PREHIGH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	shrl	$8, %ebx
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_kempld_write8
	movq	_KEMPLD_CFG@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r14, %rdi
	callq	_kempld_read8
	movq	_i2c_gpio_mux@GOTPCREL(%rip), %rcx
	movq	_KEMPLD_CFG_GPIO_I2C_MUX@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movl	%edx, %esi
	orl	%eax, %esi
	notl	%edx
	andl	%eax, %edx
	cmpq	$0, (%rcx)
	cmovnel	%esi, %edx
	movl	(%rbx), %esi
	movq	%r14, %rdi
	callq	_kempld_write8
	movq	_KEMPLD_I2C_CMD@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	_I2C_CMD_IACK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_kempld_write8
	orl	(%r13), %r15d
	movl	(%r12), %esi
	movq	%r14, %rdi
	movl	%r15d, %edx
	callq	_kempld_write8
	movq	_KEMPLD_I2C_STAT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_kempld_read8
	movq	_I2C_STAT_BUSY@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_3
## %bb.4:
	movl	(%rbx), %esi
	movq	_I2C_CMD_STOP@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_kempld_write8                  ## TAILCALL
LBB0_3:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_KEMPLD_I2C_CTRL,4,2            ## @KEMPLD_I2C_CTRL
	.comm	_I2C_CTRL_EN,4,2                ## @I2C_CTRL_EN
	.comm	_I2C_CTRL_IEN,4,2               ## @I2C_CTRL_IEN
	.comm	_bus_frequency,4,2              ## @bus_frequency
	.comm	_KEMPLD_I2C_FREQ_MAX,4,2        ## @KEMPLD_I2C_FREQ_MAX
	.comm	_KEMPLD_I2C_PRELOW,4,2          ## @KEMPLD_I2C_PRELOW
	.comm	_KEMPLD_I2C_PREHIGH,4,2         ## @KEMPLD_I2C_PREHIGH
	.comm	_KEMPLD_CFG,4,2                 ## @KEMPLD_CFG
	.comm	_i2c_gpio_mux,8,3               ## @i2c_gpio_mux
	.comm	_KEMPLD_CFG_GPIO_I2C_MUX,4,2    ## @KEMPLD_CFG_GPIO_I2C_MUX
	.comm	_KEMPLD_I2C_CMD,4,2             ## @KEMPLD_I2C_CMD
	.comm	_I2C_CMD_IACK,4,2               ## @I2C_CMD_IACK
	.comm	_KEMPLD_I2C_STAT,4,2            ## @KEMPLD_I2C_STAT
	.comm	_I2C_STAT_BUSY,4,2              ## @I2C_STAT_BUSY
	.comm	_I2C_CMD_STOP,4,2               ## @I2C_CMD_STOP
	.no_dead_strip	_kempld_i2c_device_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function kempld_i2c_device_init
_kempld_i2c_device_init:                ; @kempld_i2c_device_init
	.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
	ldr	x19, [x0]
Lloh0:
	adrp	x21, _KEMPLD_I2C_CTRL@GOTPAGE
Lloh1:
	ldr	x21, [x21, _KEMPLD_I2C_CTRL@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_kempld_read8
Lloh2:
	adrp	x22, _I2C_CTRL_EN@GOTPAGE
Lloh3:
	ldr	x22, [x22, _I2C_CTRL_EN@GOTPAGEOFF]
	ldr	w8, [x22]
Lloh4:
	adrp	x9, _I2C_CTRL_IEN@GOTPAGE
Lloh5:
	ldr	x9, [x9, _I2C_CTRL_IEN@GOTPAGEOFF]
Lloh6:
	ldr	w9, [x9]
	orr	w8, w9, w8
	bic	w20, w0, w8
	ldr	w1, [x21]
	mov	x0, x19
	mov	x2, x20
	bl	_kempld_write8
Lloh7:
	adrp	x9, _bus_frequency@GOTPAGE
Lloh8:
	ldr	x9, [x9, _bus_frequency@GOTPAGEOFF]
	ldr	w8, [x9]
Lloh9:
	adrp	x10, _KEMPLD_I2C_FREQ_MAX@GOTPAGE
Lloh10:
	ldr	x10, [x10, _KEMPLD_I2C_FREQ_MAX@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
	cmp	w8, w10
	b.le	LBB0_2
; %bb.1:
	str	w10, [x9]
	mov	x8, x10
LBB0_2:
	ldp	w10, w9, [x19]
	lsl	w11, w8, #2
	add	w8, w11, w8
	cmp	w9, #1
	csel	w8, w8, w11, eq
	mov	w9, #-3000
	mov	w11, #-1000
	csel	w9, w11, w9, eq
	sdiv	w8, w10, w8
	add	w8, w8, w9
	cmp	w8, #0
	csel	w8, w8, wzr, gt
	mov	w9, #19923
	movk	w9, #4194, lsl #16
	umull	x9, w8, w9
	lsr	x9, x9, #38
	mov	w10, #1000
	msub	w8, w9, w10, w8
	cmp	w8, #499
	cinc	w23, w9, hi
Lloh12:
	adrp	x8, _KEMPLD_I2C_PRELOW@GOTPAGE
Lloh13:
	ldr	x8, [x8, _KEMPLD_I2C_PRELOW@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	and	w2, w23, #0xff
	mov	x0, x19
	bl	_kempld_write8
Lloh15:
	adrp	x8, _KEMPLD_I2C_PREHIGH@GOTPAGE
Lloh16:
	ldr	x8, [x8, _KEMPLD_I2C_PREHIGH@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	lsr	w2, w23, #8
	mov	x0, x19
	bl	_kempld_write8
Lloh18:
	adrp	x23, _KEMPLD_CFG@GOTPAGE
Lloh19:
	ldr	x23, [x23, _KEMPLD_CFG@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x19
	bl	_kempld_read8
Lloh20:
	adrp	x8, _i2c_gpio_mux@GOTPAGE
Lloh21:
	ldr	x8, [x8, _i2c_gpio_mux@GOTPAGEOFF]
Lloh22:
	ldr	x8, [x8]
Lloh23:
	adrp	x9, _KEMPLD_CFG_GPIO_I2C_MUX@GOTPAGE
Lloh24:
	ldr	x9, [x9, _KEMPLD_CFG_GPIO_I2C_MUX@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	orr	w10, w9, w0
	bic	w9, w0, w9
	cmp	x8, #0
	csel	w2, w9, w10, eq
	ldr	w1, [x23]
	mov	x0, x19
	bl	_kempld_write8
Lloh26:
	adrp	x23, _KEMPLD_I2C_CMD@GOTPAGE
Lloh27:
	ldr	x23, [x23, _KEMPLD_I2C_CMD@GOTPAGEOFF]
	ldr	w1, [x23]
Lloh28:
	adrp	x8, _I2C_CMD_IACK@GOTPAGE
Lloh29:
	ldr	x8, [x8, _I2C_CMD_IACK@GOTPAGEOFF]
Lloh30:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_kempld_write8
	ldr	w8, [x22]
	orr	w2, w8, w20
	ldr	w1, [x21]
	mov	x0, x19
	bl	_kempld_write8
Lloh31:
	adrp	x8, _KEMPLD_I2C_STAT@GOTPAGE
Lloh32:
	ldr	x8, [x8, _KEMPLD_I2C_STAT@GOTPAGEOFF]
Lloh33:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_kempld_read8
Lloh34:
	adrp	x8, _I2C_STAT_BUSY@GOTPAGE
Lloh35:
	ldr	x8, [x8, _I2C_STAT_BUSY@GOTPAGEOFF]
Lloh36:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_4
; %bb.3:
	ldr	w1, [x23]
Lloh37:
	adrp	x8, _I2C_CMD_STOP@GOTPAGE
Lloh38:
	ldr	x8, [x8, _I2C_CMD_STOP@GOTPAGEOFF]
Lloh39:
	ldr	w2, [x8]
	mov	x0, x19
	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
	b	_kempld_write8
LBB0_4:
	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 AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.cfi_endproc
                                        ; -- End function
	.comm	_KEMPLD_I2C_CTRL,4,2            ; @KEMPLD_I2C_CTRL
	.comm	_I2C_CTRL_EN,4,2                ; @I2C_CTRL_EN
	.comm	_I2C_CTRL_IEN,4,2               ; @I2C_CTRL_IEN
	.comm	_bus_frequency,4,2              ; @bus_frequency
	.comm	_KEMPLD_I2C_FREQ_MAX,4,2        ; @KEMPLD_I2C_FREQ_MAX
	.comm	_KEMPLD_I2C_PRELOW,4,2          ; @KEMPLD_I2C_PRELOW
	.comm	_KEMPLD_I2C_PREHIGH,4,2         ; @KEMPLD_I2C_PREHIGH
	.comm	_KEMPLD_CFG,4,2                 ; @KEMPLD_CFG
	.comm	_i2c_gpio_mux,8,3               ; @i2c_gpio_mux
	.comm	_KEMPLD_CFG_GPIO_I2C_MUX,4,2    ; @KEMPLD_CFG_GPIO_I2C_MUX
	.comm	_KEMPLD_I2C_CMD,4,2             ; @KEMPLD_I2C_CMD
	.comm	_I2C_CMD_IACK,4,2               ; @I2C_CMD_IACK
	.comm	_KEMPLD_I2C_STAT,4,2            ; @KEMPLD_I2C_STAT
	.comm	_I2C_STAT_BUSY,4,2              ; @I2C_STAT_BUSY
	.comm	_I2C_CMD_STOP,4,2               ; @I2C_CMD_STOP
	.no_dead_strip	_kempld_i2c_device_init
.subsections_via_symbols
