	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function i2c_reset
_i2c_reset:                             ## @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	%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
	leaq	L_.str(%rip), %rsi
	movl	$2, %edi
	callq	_i2c_dbg
	movq	%r15, %rdi
	callq	_i2c_get_status
	movl	%eax, %r12d
	movl	%eax, %edi
	callq	_i2c_is_error
	movl	$1, %ecx
	testl	%eax, %eax
	je	LBB0_10
## %bb.1:
	movq	%r15, %rdi
	movl	%r12d, %esi
	callq	_i2c_set_status
	movq	_I2C_WAIT_RETRY@GOTPCREL(%rip), %r13
	movl	(%r13), %eax
	movl	$0, %ebx
	testl	%eax, %eax
	jle	LBB0_6
## %bb.2:
	xorl	%ebx, %ebx
	movq	_I2C_WAIT_DELAY@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	callq	_i2c_get_status
	movl	%eax, %r12d
	movl	%eax, %edi
	callq	_i2c_is_error
	testl	%eax, %eax
	je	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	(%r14), %edi
	callq	_udelay
	incl	%ebx
	movl	(%r13), %eax
	cmpl	%eax, %ebx
	jl	LBB0_3
LBB0_6:
	cmpl	%ebx, %eax
	jne	LBB0_8
LBB0_7:
	xorl	%ecx, %ecx
	jmp	LBB0_10
LBB0_4:
	movl	(%r13), %eax
	cmpl	%ebx, %eax
	je	LBB0_7
LBB0_8:
	movl	%r12d, %edi
	callq	_i2c_is_idle
	testl	%eax, %eax
	movl	$0, %ecx
	je	LBB0_10
## %bb.9:
	movq	_NOP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_i2c_set_attr
	movl	$1, %ecx
LBB0_10:
	movl	%ecx, %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	"i2c reset\n"

	.comm	_I2C_WAIT_RETRY,4,2             ## @I2C_WAIT_RETRY
	.comm	_I2C_WAIT_DELAY,4,2             ## @I2C_WAIT_DELAY
	.comm	_NOP,4,2                        ## @NOP
	.no_dead_strip	_i2c_reset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function i2c_reset
_i2c_reset:                             ; @i2c_reset
	.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
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #2
	bl	_i2c_dbg
	mov	x0, x19
	bl	_i2c_get_status
	mov	x20, x0
	bl	_i2c_is_error
	cbz	w0, LBB0_11
; %bb.1:
	mov	x0, x19
	mov	x1, x20
	bl	_i2c_set_status
Lloh2:
	adrp	x22, _I2C_WAIT_RETRY@GOTPAGE
Lloh3:
	ldr	x22, [x22, _I2C_WAIT_RETRY@GOTPAGEOFF]
	ldr	w8, [x22]
	cmp	w8, #1
	b.lt	LBB0_5
; %bb.2:
	mov	w21, #0
Lloh4:
	adrp	x23, _I2C_WAIT_DELAY@GOTPAGE
Lloh5:
	ldr	x23, [x23, _I2C_WAIT_DELAY@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_i2c_get_status
	mov	x20, x0
	bl	_i2c_is_error
	cbz	w0, LBB0_8
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x23]
	bl	_udelay
	add	w21, w21, #1
	ldr	w8, [x22]
	cmp	w21, w8
	b.lt	LBB0_3
	b	LBB0_6
LBB0_5:
	mov	w21, #0
LBB0_6:
	cmp	w8, w21
	b.ne	LBB0_9
LBB0_7:
	mov	w0, #0
	b	LBB0_12
LBB0_8:
	ldr	w8, [x22]
	cmp	w8, w21
	b.eq	LBB0_7
LBB0_9:
	mov	x0, x20
	bl	_i2c_is_idle
	cbz	w0, LBB0_12
; %bb.10:
Lloh6:
	adrp	x8, _NOP@GOTPAGE
Lloh7:
	ldr	x8, [x8, _NOP@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_i2c_set_attr
LBB0_11:
	mov	w0, #1
LBB0_12:
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"i2c reset\n"

	.comm	_I2C_WAIT_RETRY,4,2             ; @I2C_WAIT_RETRY
	.comm	_I2C_WAIT_DELAY,4,2             ; @I2C_WAIT_DELAY
	.comm	_NOP,4,2                        ; @NOP
	.no_dead_strip	_i2c_reset
.subsections_via_symbols
