	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wmt_i2c_reset_hardware
_wmt_i2c_reset_hardware:                ## @wmt_i2c_reset_hardware
	.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, %rbx
	movl	16(%rdi), %edi
	callq	_clk_prepare_enable
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %r14d
	movl	20(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_8
LBB0_2:
	movl	16(%rbx), %edi
	movl	$20000000, %esi                 ## imm = 0x1312D00
	callq	_clk_set_rate
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %r14d
	movl	20(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
	movl	16(%rbx), %edi
	callq	_clk_disable_unprepare
	jmp	LBB0_8
LBB0_4:
	movq	_REG_CR@GOTPCREL(%rip), %r15
	movq	(%r15), %rsi
	addq	8(%rbx), %rsi
	xorl	%r14d, %r14d
	xorl	%edi, %edi
	callq	_writew
	movq	_MCR_APB_166M@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_REG_MCR@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%rbx), %rsi
	callq	_writew
	movq	_ISR_WRITE_ALL@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	movq	_REG_ISR@GOTPCREL(%rip), %r13
	movq	(%r13), %rsi
	addq	8(%rbx), %rsi
	callq	_writew
	movq	_IMR_ENABLE_ALL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_REG_IMR@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%rbx), %rsi
	callq	_writew
	movq	_CR_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%r15), %rsi
	addq	8(%rbx), %rsi
	callq	_writew
	movq	_REG_CSR@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	8(%rbx), %rdi
	callq	_readw
	movl	(%r12), %edi
	movq	(%r13), %rsi
	addq	8(%rbx), %rsi
	callq	_writew
	movq	(%rbx), %r15
	movq	_I2C_MODE_STANDARD@GOTPCREL(%rip), %rax
	movq	(%rax), %r12
	movl	$128, %edi
	callq	_SCL_TIMEOUT
	movl	%eax, %edi
	cmpq	%r12, %r15
	jne	LBB0_6
## %bb.5:
	movq	_TR_STD@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_6:
	movq	_TR_HS@GOTPCREL(%rip), %rax
LBB0_7:
	orl	(%rax), %edi
	movq	_REG_TR@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%rbx), %rsi
	callq	_writew
LBB0_8:
	movl	%r14d, %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	"failed to enable clock\n"

L_.str.1:                               ## @.str.1
	.asciz	"failed to set clock = 20Mhz\n"

	.comm	_REG_CR,8,3                     ## @REG_CR
	.comm	_MCR_APB_166M,4,2               ## @MCR_APB_166M
	.comm	_REG_MCR,8,3                    ## @REG_MCR
	.comm	_ISR_WRITE_ALL,4,2              ## @ISR_WRITE_ALL
	.comm	_REG_ISR,8,3                    ## @REG_ISR
	.comm	_IMR_ENABLE_ALL,4,2             ## @IMR_ENABLE_ALL
	.comm	_REG_IMR,8,3                    ## @REG_IMR
	.comm	_CR_ENABLE,4,2                  ## @CR_ENABLE
	.comm	_REG_CSR,8,3                    ## @REG_CSR
	.comm	_I2C_MODE_STANDARD,8,3          ## @I2C_MODE_STANDARD
	.comm	_TR_STD,4,2                     ## @TR_STD
	.comm	_REG_TR,8,3                     ## @REG_TR
	.comm	_TR_HS,4,2                      ## @TR_HS
	.no_dead_strip	_wmt_i2c_reset_hardware
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wmt_i2c_reset_hardware
_wmt_i2c_reset_hardware:                ; @wmt_i2c_reset_hardware
	.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	x19, x0
	ldr	w0, [x0, #16]
	bl	_clk_prepare_enable
	cbz	w0, LBB0_2
; %bb.1:
	mov	x20, x0
	ldr	w0, [x19, #20]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	b	LBB0_8
LBB0_2:
	ldr	w0, [x19, #16]
	mov	w1, #11520
	movk	w1, #305, lsl #16
	bl	_clk_set_rate
	cbz	w0, LBB0_4
; %bb.3:
	mov	x20, x0
	ldr	w0, [x19, #20]
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
	ldr	w0, [x19, #16]
	bl	_clk_disable_unprepare
	b	LBB0_8
LBB0_4:
	ldr	x8, [x19, #8]
Lloh4:
	adrp	x20, _REG_CR@GOTPAGE
Lloh5:
	ldr	x20, [x20, _REG_CR@GOTPAGEOFF]
	ldr	x9, [x20]
	add	x1, x9, x8
	bl	_writew
Lloh6:
	adrp	x8, _MCR_APB_166M@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MCR_APB_166M@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	ldr	x8, [x19, #8]
Lloh9:
	adrp	x9, _REG_MCR@GOTPAGE
Lloh10:
	ldr	x9, [x9, _REG_MCR@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writew
Lloh12:
	adrp	x21, _ISR_WRITE_ALL@GOTPAGE
Lloh13:
	ldr	x21, [x21, _ISR_WRITE_ALL@GOTPAGEOFF]
	ldr	w0, [x21]
	ldr	x8, [x19, #8]
Lloh14:
	adrp	x22, _REG_ISR@GOTPAGE
Lloh15:
	ldr	x22, [x22, _REG_ISR@GOTPAGEOFF]
	ldr	x9, [x22]
	add	x1, x9, x8
	bl	_writew
Lloh16:
	adrp	x8, _IMR_ENABLE_ALL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _IMR_ENABLE_ALL@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
	ldr	x8, [x19, #8]
Lloh19:
	adrp	x9, _REG_IMR@GOTPAGE
Lloh20:
	ldr	x9, [x9, _REG_IMR@GOTPAGEOFF]
Lloh21:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writew
Lloh22:
	adrp	x8, _CR_ENABLE@GOTPAGE
Lloh23:
	ldr	x8, [x8, _CR_ENABLE@GOTPAGEOFF]
Lloh24:
	ldr	w0, [x8]
	ldr	x8, [x19, #8]
	ldr	x9, [x20]
	add	x1, x9, x8
	bl	_writew
	ldr	x8, [x19, #8]
Lloh25:
	adrp	x9, _REG_CSR@GOTPAGE
Lloh26:
	ldr	x9, [x9, _REG_CSR@GOTPAGEOFF]
Lloh27:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readw
	ldr	w0, [x21]
	ldr	x8, [x19, #8]
	ldr	x9, [x22]
	add	x1, x9, x8
	bl	_writew
	ldr	x20, [x19]
Lloh28:
	adrp	x8, _I2C_MODE_STANDARD@GOTPAGE
Lloh29:
	ldr	x8, [x8, _I2C_MODE_STANDARD@GOTPAGEOFF]
Lloh30:
	ldr	x21, [x8]
	mov	w0, #128
	bl	_SCL_TIMEOUT
	cmp	x20, x21
	b.ne	LBB0_6
; %bb.5:
Lloh31:
	adrp	x8, _TR_STD@GOTPAGE
Lloh32:
	ldr	x8, [x8, _TR_STD@GOTPAGEOFF]
	b	LBB0_7
LBB0_6:
Lloh33:
	adrp	x8, _TR_HS@GOTPAGE
Lloh34:
	ldr	x8, [x8, _TR_HS@GOTPAGEOFF]
LBB0_7:
	ldr	w8, [x8]
	orr	w0, w8, w0
	ldr	x8, [x19, #8]
Lloh35:
	adrp	x9, _REG_TR@GOTPAGE
Lloh36:
	ldr	x9, [x9, _REG_TR@GOTPAGEOFF]
Lloh37:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writew
	mov	w20, #0
LBB0_8:
	mov	x0, x20
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.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 AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to enable clock\n"

l_.str.1:                               ; @.str.1
	.asciz	"failed to set clock = 20Mhz\n"

	.comm	_REG_CR,8,3                     ; @REG_CR
	.comm	_MCR_APB_166M,4,2               ; @MCR_APB_166M
	.comm	_REG_MCR,8,3                    ; @REG_MCR
	.comm	_ISR_WRITE_ALL,4,2              ; @ISR_WRITE_ALL
	.comm	_REG_ISR,8,3                    ; @REG_ISR
	.comm	_IMR_ENABLE_ALL,4,2             ; @IMR_ENABLE_ALL
	.comm	_REG_IMR,8,3                    ; @REG_IMR
	.comm	_CR_ENABLE,4,2                  ; @CR_ENABLE
	.comm	_REG_CSR,8,3                    ; @REG_CSR
	.comm	_I2C_MODE_STANDARD,8,3          ; @I2C_MODE_STANDARD
	.comm	_TR_STD,4,2                     ; @TR_STD
	.comm	_REG_TR,8,3                     ; @REG_TR
	.comm	_TR_HS,4,2                      ; @TR_HS
	.no_dead_strip	_wmt_i2c_reset_hardware
.subsections_via_symbols
