	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_i2c_transaction                ## -- Begin function i2c_transaction
	.p2align	4, 0x90
_i2c_transaction:                       ## @i2c_transaction
	.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
	movl	%edx, %r12d
	movl	%esi, %r14d
	movl	%edi, %ebx
	addl	%edi, %ebx
	movq	_I2C_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	orl	%ebx, %edi
	movl	$10, %esi
	callq	_i2c_start
	movl	$1, %r15d
	movl	$1, %edi
	movl	$10, %esi
	callq	_i2c_write
	movq	_I2C_READ@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movl	%ebx, %edi
	movl	$5, %esi
	callq	_i2c_start
	movl	$10, %edi
	callq	_i2c_read_ack
	cmpl	$85, %eax
	jne	LBB0_4
## %bb.1:
	movq	_MATRIX_ROWS@GOTPCREL(%rip), %r13
	movslq	(%r13), %rax
	cmpq	$1, %rax
	jle	LBB0_2
## %bb.5:
	movq	_matrix@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	xorl	%ebx, %ebx
	movq	_MATRIX_COLS_SCANNED@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	andl	%r14d, (%rcx,%rbx,4)
	movl	$10, %edi
	callq	_i2c_read_ack
	movl	(%r15), %ecx
	addl	%r12d, %ecx
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %eax
	movq	_matrix@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	orl	%eax, (%rcx,%rbx,4)
	incq	%rbx
	movslq	(%r13), %rax
	decq	%rax
	cmpq	%rax, %rbx
	jl	LBB0_6
	jmp	LBB0_3
LBB0_2:
	decq	%rax
	movq	_matrix@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
LBB0_3:
	andl	%r14d, (%rcx,%rax,4)
	movl	$10, %edi
	callq	_i2c_read_nack
	movq	_MATRIX_COLS_SCANNED@GOTPCREL(%rip), %rcx
	addl	(%rcx), %r12d
	movl	%r12d, %ecx
	shll	%cl, %eax
	movq	_matrix@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movslq	(%r13), %rdx
	orl	%eax, -4(%rcx,%rdx,4)
	xorl	%r15d, %r15d
LBB0_4:
	xorl	%eax, %eax
	callq	_i2c_stop
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_I2C_WRITE,4,2                  ## @I2C_WRITE
	.comm	_I2C_READ,4,2                   ## @I2C_READ
	.comm	_MATRIX_ROWS,4,2                ## @MATRIX_ROWS
	.comm	_matrix,8,3                     ## @matrix
	.comm	_MATRIX_COLS_SCANNED,4,2        ## @MATRIX_COLS_SCANNED
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_i2c_transaction                ; -- Begin function i2c_transaction
	.p2align	2
_i2c_transaction:                       ; @i2c_transaction
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x2
	mov	x20, x1
	lsl	w22, w0, #1
Lloh0:
	adrp	x8, _I2C_WRITE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _I2C_WRITE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	orr	w0, w8, w22
	mov	w1, #10
	bl	_i2c_start
	mov	w21, #1
	mov	w0, #1
	mov	w1, #10
	bl	_i2c_write
Lloh3:
	adrp	x8, _I2C_READ@GOTPAGE
Lloh4:
	ldr	x8, [x8, _I2C_READ@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	orr	w0, w8, w22
	mov	w1, #5
	bl	_i2c_start
	mov	w0, #10
	bl	_i2c_read_ack
	cmp	w0, #85
	b.ne	LBB0_6
; %bb.1:
Lloh6:
	adrp	x22, _MATRIX_ROWS@GOTPAGE
Lloh7:
	ldr	x22, [x22, _MATRIX_ROWS@GOTPAGEOFF]
	ldrsw	x8, [x22]
Lloh8:
	adrp	x23, _matrix@GOTPAGE
Lloh9:
	ldr	x23, [x23, _matrix@GOTPAGEOFF]
Lloh10:
	adrp	x24, _MATRIX_COLS_SCANNED@GOTPAGE
Lloh11:
	ldr	x24, [x24, _MATRIX_COLS_SCANNED@GOTPAGEOFF]
	cmp	w8, #1
	b.le	LBB0_4
; %bb.2:
	mov	x21, #0
	ldr	x8, [x23]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	lsl	x25, x21, #2
	ldr	w9, [x8, x25]
	and	w9, w9, w20
	str	w9, [x8, x25]
	mov	w0, #10
	bl	_i2c_read_ack
	ldr	w8, [x24]
	add	w8, w8, w19
	lsl	w9, w0, w8
	ldr	x8, [x23]
	ldr	w10, [x8, x25]
	orr	w9, w10, w9
	str	w9, [x8, x25]
	add	x21, x21, #1
	ldrsw	x9, [x22]
	sub	x9, x9, #1
	cmp	x21, x9
	b.lt	LBB0_3
	b	LBB0_5
LBB0_4:
	sub	x9, x8, #1
	ldr	x8, [x23]
LBB0_5:
	lsl	x9, x9, #2
	ldr	w10, [x8, x9]
	and	w10, w10, w20
	str	w10, [x8, x9]
	mov	w0, #10
	bl	_i2c_read_nack
	mov	w21, #0
	ldr	w8, [x24]
	add	w8, w8, w19
	lsl	w8, w0, w8
	ldr	x9, [x23]
	ldrsw	x10, [x22]
	add	x9, x9, x10, lsl #2
	ldur	w10, [x9, #-4]
	orr	w8, w10, w8
	stur	w8, [x9, #-4]
LBB0_6:
	bl	_i2c_stop
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_I2C_WRITE,4,2                  ; @I2C_WRITE
	.comm	_I2C_READ,4,2                   ; @I2C_READ
	.comm	_MATRIX_ROWS,4,2                ; @MATRIX_ROWS
	.comm	_matrix,8,3                     ; @matrix
	.comm	_MATRIX_COLS_SCANNED,4,2        ; @MATRIX_COLS_SCANNED
.subsections_via_symbols
