	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __em_i2c_xfer
___em_i2c_xfer:                         ## @__em_i2c_xfer
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movq	%rsi, %r12
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	callq	_i2c_get_adapdata
	movq	_I2C_M_RD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r15d
	andl	(%r12), %r15d
	movq	%rax, %r13
	movq	_I2C_BIT_ACKE0@GOTPCREL(%rip), %rcx
	movq	_I2C_BIT_WTIM0@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	orl	(%rcx), %edx
	movq	_I2C_OFS_IICC0@GOTPCREL(%rip), %rbx
	movl	(%rbx), %ecx
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_em_clear_set_bit
	movq	_I2C_BIT_STT0@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	(%rbx), %ecx
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_em_clear_set_bit
	movq	%r12, %rdi
	callq	_i2c_8bit_addr_from_msg
	movq	_I2C_OFS_IIC0@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	addq	(%r13), %rsi
	movl	%eax, %edi
	callq	_writeb
	movq	%r13, %rdi
	callq	_em_i2c_wait_for_event
	movl	%eax, %r14d
	testl	%eax, %eax
	js	LBB0_16
## %bb.1:
	movq	_I2C_BIT_ACKD0@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_2
## %bb.3:
	testl	%r15d, %r15d
	je	LBB0_5
## %bb.4:
	movq	_I2C_BIT_WTIM0@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	_I2C_BIT_ACKE0@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_I2C_OFS_IICC0@GOTPCREL(%rip), %r14
	movl	(%r14), %ecx
	movq	%r13, %rdi
	callq	_em_clear_set_bit
	movl	(%rbx), %esi
	movq	_I2C_BIT_WREL0@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	(%r14), %ecx
	movq	%r13, %rdi
	callq	_em_clear_set_bit
	movq	%r13, %rdi
	callq	_em_i2c_wait_for_event
	movl	%eax, %r14d
	testl	%eax, %eax
	js	LBB0_16
LBB0_5:
	cmpl	$0, 4(%r12)
	jle	LBB0_6
## %bb.7:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	testl	%r15d, %r15d
	je	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movq	_I2C_OFS_IIC0@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r13), %rdi
	callq	_readb
	movq	8(%r12), %rcx
	movl	%eax, (%rcx,%rbx,4)
	movq	_I2C_BIT_WREL0@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_I2C_OFS_IICC0@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_em_clear_set_bit
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_8 Depth=1
	movq	_I2C_BIT_ACKD0@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_2
## %bb.11:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	8(%r12), %rax
	movl	(%rax,%rbx,4), %edi
	movq	_I2C_OFS_IIC0@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r13), %rsi
	callq	_writeb
LBB0_12:                                ##   in Loop: Header=BB0_8 Depth=1
	movq	%r13, %rdi
	callq	_em_i2c_wait_for_event
	movl	%eax, %r14d
	testl	%eax, %eax
	js	LBB0_16
## %bb.13:                              ##   in Loop: Header=BB0_8 Depth=1
	incq	%rbx
	movslq	4(%r12), %rax
	cmpq	%rax, %rbx
	jl	LBB0_8
	jmp	LBB0_14
LBB0_16:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_em_i2c_reset
	jmp	LBB0_17
LBB0_2:
	movq	%r13, %rdi
	callq	_em_i2c_stop
LBB0_17:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	testl	%r14d, %r14d
	cmovsl	%r14d, %ebx
LBB0_18:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	xorl	%ebx, %ebx
LBB0_14:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	testl	%eax, %eax
	je	LBB0_18
## %bb.15:
	movq	%r13, %rdi
	callq	_em_i2c_stop
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_I2C_M_RD,4,2                   ## @I2C_M_RD
	.comm	_I2C_BIT_ACKE0,4,2              ## @I2C_BIT_ACKE0
	.comm	_I2C_BIT_WTIM0,4,2              ## @I2C_BIT_WTIM0
	.comm	_I2C_OFS_IICC0,4,2              ## @I2C_OFS_IICC0
	.comm	_I2C_BIT_STT0,4,2               ## @I2C_BIT_STT0
	.comm	_I2C_OFS_IIC0,8,3               ## @I2C_OFS_IIC0
	.comm	_I2C_BIT_ACKD0,4,2              ## @I2C_BIT_ACKD0
	.comm	_I2C_BIT_WREL0,4,2              ## @I2C_BIT_WREL0
	.comm	_ENXIO,4,2                      ## @ENXIO
	.no_dead_strip	___em_i2c_xfer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __em_i2c_xfer
___em_i2c_xfer:                         ; @__em_i2c_xfer
	.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
	str	w2, [sp, #12]                   ; 4-byte Folded Spill
	mov	x22, x1
	mov	x21, x0
	bl	_i2c_get_adapdata
	mov	x19, x0
Lloh0:
	adrp	x8, _I2C_M_RD@GOTPAGE
Lloh1:
	ldr	x8, [x8, _I2C_M_RD@GOTPAGEOFF]
	ldr	w20, [x22]
Lloh2:
	ldr	w28, [x8]
Lloh3:
	adrp	x27, _I2C_BIT_ACKE0@GOTPAGE
Lloh4:
	ldr	x27, [x27, _I2C_BIT_ACKE0@GOTPAGEOFF]
Lloh5:
	adrp	x24, _I2C_BIT_WTIM0@GOTPAGE
Lloh6:
	ldr	x24, [x24, _I2C_BIT_WTIM0@GOTPAGEOFF]
	ldr	w8, [x27]
	ldr	w9, [x24]
	orr	w2, w9, w8
Lloh7:
	adrp	x25, _I2C_OFS_IICC0@GOTPAGE
Lloh8:
	ldr	x25, [x25, _I2C_OFS_IICC0@GOTPAGEOFF]
	ldr	w3, [x25]
	mov	w1, #0
	bl	_em_clear_set_bit
Lloh9:
	adrp	x8, _I2C_BIT_STT0@GOTPAGE
Lloh10:
	ldr	x8, [x8, _I2C_BIT_STT0@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	ldr	w3, [x25]
	mov	x0, x19
	mov	w1, #0
	bl	_em_clear_set_bit
	mov	x0, x22
	bl	_i2c_8bit_addr_from_msg
	ldr	x8, [x19]
Lloh12:
	adrp	x26, _I2C_OFS_IIC0@GOTPAGE
Lloh13:
	ldr	x26, [x26, _I2C_OFS_IIC0@GOTPAGEOFF]
	ldr	x9, [x26]
	add	x1, x9, x8
	bl	_writeb
	mov	x0, x19
	bl	_em_i2c_wait_for_event
	mov	x23, x0
	tbnz	w0, #31, LBB0_12
; %bb.1:
Lloh14:
	adrp	x8, _I2C_BIT_ACKD0@GOTPAGE
Lloh15:
	ldr	x8, [x8, _I2C_BIT_ACKD0@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	tst	w8, w23
	b.eq	LBB0_13
; %bb.2:
Lloh17:
	adrp	x8, _I2C_BIT_WREL0@GOTPAGE
Lloh18:
	ldr	x8, [x8, _I2C_BIT_WREL0@GOTPAGEOFF]
	and	w20, w28, w20
	mov	x28, x8
	cbz	w20, LBB0_4
; %bb.3:
	ldr	w1, [x24]
	ldr	w2, [x27]
	ldr	w3, [x25]
	mov	x0, x19
	bl	_em_clear_set_bit
	ldr	w1, [x24]
	ldr	w2, [x28]
	ldr	w3, [x25]
	mov	x0, x19
	bl	_em_clear_set_bit
	mov	x0, x19
	bl	_em_i2c_wait_for_event
	mov	x23, x0
	tbnz	w0, #31, LBB0_12
LBB0_4:
	ldr	w8, [x22, #4]
	cmp	w8, #1
	b.lt	LBB0_16
; %bb.5:
	mov	x24, #0
Lloh19:
	adrp	x27, _I2C_BIT_ACKD0@GOTPAGE
Lloh20:
	ldr	x27, [x27, _I2C_BIT_ACKD0@GOTPAGEOFF]
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	cbz	w20, LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [x19]
	ldr	x9, [x26]
	add	x0, x9, x8
	bl	_readb
	ldr	x8, [x22, #8]
	str	w0, [x8, x24, lsl #2]
	ldr	w2, [x28]
	ldr	w3, [x25]
	mov	x0, x19
	mov	w1, #0
	bl	_em_clear_set_bit
	b	LBB0_10
LBB0_8:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	w8, [x27]
	tst	w8, w23
	b.eq	LBB0_13
; %bb.9:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [x22, #8]
	ldr	w0, [x8, x24, lsl #2]
	ldr	x8, [x19]
	ldr	x9, [x26]
	add	x1, x9, x8
	bl	_writeb
LBB0_10:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x19
	bl	_em_i2c_wait_for_event
	mov	x23, x0
	tbnz	w0, #31, LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_6 Depth=1
	add	x24, x24, #1
	ldrsw	x8, [x22, #4]
	cmp	x24, x8
	b.lt	LBB0_6
	b	LBB0_17
LBB0_12:
	mov	x0, x21
	bl	_em_i2c_reset
	b	LBB0_14
LBB0_13:
	mov	x0, x19
	bl	_em_i2c_stop
LBB0_14:
Lloh21:
	adrp	x8, _ENXIO@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	cmp	w23, #0
	csneg	w24, w23, w8, lt
LBB0_15:
	mov	x0, x24
	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
LBB0_16:
	mov	w24, #0
LBB0_17:
	ldr	w8, [sp, #12]                   ; 4-byte Folded Reload
	cbz	w8, LBB0_15
; %bb.18:
	mov	x0, x19
	bl	_em_i2c_stop
	b	LBB0_15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_I2C_M_RD,4,2                   ; @I2C_M_RD
	.comm	_I2C_BIT_ACKE0,4,2              ; @I2C_BIT_ACKE0
	.comm	_I2C_BIT_WTIM0,4,2              ; @I2C_BIT_WTIM0
	.comm	_I2C_OFS_IICC0,4,2              ; @I2C_OFS_IICC0
	.comm	_I2C_BIT_STT0,4,2               ; @I2C_BIT_STT0
	.comm	_I2C_OFS_IIC0,8,3               ; @I2C_OFS_IIC0
	.comm	_I2C_BIT_ACKD0,4,2              ; @I2C_BIT_ACKD0
	.comm	_I2C_BIT_WREL0,4,2              ; @I2C_BIT_WREL0
	.comm	_ENXIO,4,2                      ; @ENXIO
	.no_dead_strip	___em_i2c_xfer
.subsections_via_symbols
