	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_i2c_reset
_mtk_i2c_reset:                         ## @mtk_i2c_reset
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movl	20(%rdi), %edi
	callq	_device_reset
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	16(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
LBB0_2:
	movl	(%rbx), %edi
	shll	$16, %edi
	movq	_SM0CTL0_CLK_DIV_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %edi
	movq	_SM0CTL0_EN@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	movq	_SM0CTL0_SCL_STRETCH@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	movq	_REG_SM0CTL0_REG@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%rbx), %rsi
	callq	_iowrite32
	movq	_REG_SM0CFG2_REG@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%rbx), %rsi
	xorl	%edi, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_iowrite32                      ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"I2C reset failed!\n"

	.comm	_SM0CTL0_CLK_DIV_MASK,4,2       ## @SM0CTL0_CLK_DIV_MASK
	.comm	_SM0CTL0_EN,4,2                 ## @SM0CTL0_EN
	.comm	_SM0CTL0_SCL_STRETCH,4,2        ## @SM0CTL0_SCL_STRETCH
	.comm	_REG_SM0CTL0_REG,8,3            ## @REG_SM0CTL0_REG
	.comm	_REG_SM0CFG2_REG,8,3            ## @REG_SM0CFG2_REG
	.no_dead_strip	_mtk_i2c_reset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_i2c_reset
_mtk_i2c_reset:                         ; @mtk_i2c_reset
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	w0, [x0, #20]
	bl	_device_reset
	cbz	w0, LBB0_2
; %bb.1:
	ldr	w0, [x19, #16]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
LBB0_2:
	ldr	w8, [x19]
Lloh2:
	adrp	x9, _SM0CTL0_CLK_DIV_MASK@GOTPAGE
Lloh3:
	ldr	x9, [x9, _SM0CTL0_CLK_DIV_MASK@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
Lloh5:
	adrp	x10, _SM0CTL0_EN@GOTPAGE
Lloh6:
	ldr	x10, [x10, _SM0CTL0_EN@GOTPAGEOFF]
	and	w8, w9, w8, lsl #16
Lloh7:
	ldr	w9, [x10]
	orr	w8, w8, w9
Lloh8:
	adrp	x9, _SM0CTL0_SCL_STRETCH@GOTPAGE
Lloh9:
	ldr	x9, [x9, _SM0CTL0_SCL_STRETCH@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	orr	w0, w8, w9
	ldr	x8, [x19, #8]
Lloh11:
	adrp	x9, _REG_SM0CTL0_REG@GOTPAGE
Lloh12:
	ldr	x9, [x9, _REG_SM0CTL0_REG@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_iowrite32
	ldr	x8, [x19, #8]
Lloh14:
	adrp	x9, _REG_SM0CFG2_REG@GOTPAGE
Lloh15:
	ldr	x9, [x9, _REG_SM0CFG2_REG@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	w0, #0
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_iowrite32
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"I2C reset failed!\n"

	.comm	_SM0CTL0_CLK_DIV_MASK,4,2       ; @SM0CTL0_CLK_DIV_MASK
	.comm	_SM0CTL0_EN,4,2                 ; @SM0CTL0_EN
	.comm	_SM0CTL0_SCL_STRETCH,4,2        ; @SM0CTL0_SCL_STRETCH
	.comm	_REG_SM0CTL0_REG,8,3            ; @REG_SM0CTL0_REG
	.comm	_REG_SM0CFG2_REG,8,3            ; @REG_SM0CFG2_REG
	.no_dead_strip	_mtk_i2c_reset
.subsections_via_symbols
