	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vprbrd_i2c_xfer
_vprbrd_i2c_xfer:                       ## @vprbrd_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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	8(%rdi), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	8(%rax), %r12
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_dbg
	movl	%r15d, %eax
	testl	%r15d, %r15d
	jle	LBB0_7
## %bb.1:
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	xorl	%r13d, %r13d
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rbx), %r8d
	movl	4(%rbx), %r9d
	movq	_I2C_M_RD@GOTPCREL(%rip), %r14
	movl	(%r14), %eax
	andl	%r8d, %eax
	leaq	L_.str.2(%rip), %rcx
	leaq	L_.str.3(%rip), %rax
	cmoveq	%rax, %rcx
	movl	8(%rbx), %eax
	movl	%eax, (%rsp)
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	leaq	L_.str.1(%rip), %rsi
	movl	%r13d, %edx
	xorl	%eax, %eax
	callq	_dev_dbg
	movq	%r15, %rdi
	callq	_mutex_lock
	movl	(%r14), %eax
	testl	%eax, (%rbx)
	je	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_VPRBRD_I2C_CMD_ADDR@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 32(%r12)
	movq	$0, (%r12)
	movl	8(%rbx), %eax
	movl	%eax, 24(%r12)
	movl	$1, 8(%r12)
	movl	4(%rbx), %edi
	callq	_cpu_to_le16
	movq	%rax, 16(%r12)
	movl	4(%r15), %edi
	movq	%r12, %rsi
	callq	_vprbrd_i2c_addr
	movq	%r15, %r14
	movl	%eax, %r15d
	sarl	$31, %r15d
	andl	%eax, %r15d
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_vprbrd_i2c_read
	testl	%eax, %eax
	cmovsl	%eax, %r15d
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_vprbrd_i2c_write
	movq	_VPRBRD_I2C_CMD_ADDR@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 32(%r12)
	movq	$0, (%r12)
	movl	8(%rbx), %eax
	movl	%eax, 24(%r12)
	movl	$0, 8(%r12)
	movl	4(%rbx), %edi
	callq	_cpu_to_le16
	movq	%rax, 16(%r12)
	movl	4(%r15), %edi
	movq	%r12, %rsi
	callq	_vprbrd_i2c_addr
	movq	%r15, %r14
	movl	%eax, %r15d
	sarl	$31, %r15d
	andl	%eax, %r15d
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rsi
	movl	%r15d, %edx
	callq	_vprbrd_i2c_status
	testl	%eax, %eax
	cmovsl	%eax, %r15d
	testl	%r15d, %r15d
	js	LBB0_9
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r14, %rdi
	callq	_mutex_unlock
	incq	%r13
	addq	$12, %rbx
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	cmpq	%r13, %rax
	movq	%r14, %r15
	jne	LBB0_2
LBB0_7:
	movl	%eax, %r15d
	jmp	LBB0_8
LBB0_9:
	movq	%r14, %rdi
	callq	_mutex_unlock
LBB0_8:
	movl	%r15d, %eax
	addq	$40, %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	"master xfer %d messages:\n"

L_.str.1:                               ## @.str.1
	.asciz	"  %d: %s (flags %d) %d bytes to 0x%02x\n"

	.comm	_I2C_M_RD,4,2                   ## @I2C_M_RD
L_.str.2:                               ## @.str.2
	.asciz	"read"

L_.str.3:                               ## @.str.3
	.asciz	"write"

	.comm	_VPRBRD_I2C_CMD_ADDR,8,3        ## @VPRBRD_I2C_CMD_ADDR
	.no_dead_strip	_vprbrd_i2c_xfer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vprbrd_i2c_xfer
_vprbrd_i2c_xfer:                       ; @vprbrd_i2c_xfer
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	mov	x24, x2
	mov	x21, x1
	mov	x22, x0
	ldr	x20, [x0, #8]
	ldr	x23, [x20, #8]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
	mov	w19, w24
	cmp	w24, #0
	b.le	LBB0_8
; %bb.1:
	mov	x24, #0
Lloh2:
	adrp	x27, _I2C_M_RD@GOTPAGE
Lloh3:
	ldr	x27, [x27, _I2C_M_RD@GOTPAGEOFF]
Lloh4:
	adrp	x28, _VPRBRD_I2C_CMD_ADDR@GOTPAGE
Lloh5:
	ldr	x28, [x28, _VPRBRD_I2C_CMD_ADDR@GOTPAGEOFF]
Lloh6:
	adrp	x25, l_.str.1@PAGE
Lloh7:
	add	x25, x25, l_.str.1@PAGEOFF
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x27]
	ldp	w9, w10, [x21]
	tst	w8, w9
Lloh8:
	adrp	x8, l_.str.2@PAGE
Lloh9:
	add	x8, x8, l_.str.2@PAGEOFF
Lloh10:
	adrp	x11, l_.str.3@PAGE
Lloh11:
	add	x11, x11, l_.str.3@PAGEOFF
	csel	x8, x11, x8, eq
	ldr	w11, [x21, #8]
	stp	x10, x11, [sp, #16]
	stp	x8, x9, [sp]
	mov	x0, x22
	mov	x1, x25
	mov	x2, x24
	bl	_dev_dbg
	mov	x0, x20
	bl	_mutex_lock
	ldr	w8, [x21]
	ldr	w9, [x27]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x8, [x28]
	str	x8, [x23, #32]
	str	xzr, [x23]
	ldp	w0, w8, [x21, #4]
	str	w8, [x23, #24]
	mov	w8, #1
	str	w8, [x23, #8]
	bl	_cpu_to_le16
	str	x0, [x23, #16]
	ldr	w0, [x20, #4]
	mov	x1, x23
	bl	_vprbrd_i2c_addr
	cmp	w0, #0
	csel	w26, w0, wzr, lt
	mov	x0, x20
	mov	x1, x21
	bl	_vprbrd_i2c_read
	cmp	w0, #0
	csel	w26, w0, w26, lt
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x20
	mov	x1, x21
	bl	_vprbrd_i2c_write
	ldr	x8, [x28]
	str	x8, [x23, #32]
	str	xzr, [x23]
	ldp	w0, w8, [x21, #4]
	str	w8, [x23, #24]
	str	wzr, [x23, #8]
	bl	_cpu_to_le16
	str	x0, [x23, #16]
	ldr	w0, [x20, #4]
	mov	x1, x23
	bl	_vprbrd_i2c_addr
	cmp	w0, #0
	csel	w26, w0, wzr, lt
LBB0_5:                                 ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x22
	mov	x1, x23
	mov	x2, x26
	bl	_vprbrd_i2c_status
	cmp	w0, #0
	csel	w8, w0, w26, lt
	tbnz	w8, #31, LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x20
	bl	_mutex_unlock
	add	x24, x24, #1
	add	x21, x21, #12
	cmp	x19, x24
	b.ne	LBB0_2
	b	LBB0_8
LBB0_7:
	mov	x19, x8
	mov	x0, x20
	bl	_mutex_unlock
LBB0_8:
	mov	x0, x19
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"master xfer %d messages:\n"

l_.str.1:                               ; @.str.1
	.asciz	"  %d: %s (flags %d) %d bytes to 0x%02x\n"

	.comm	_I2C_M_RD,4,2                   ; @I2C_M_RD
l_.str.2:                               ; @.str.2
	.asciz	"read"

l_.str.3:                               ; @.str.3
	.asciz	"write"

	.comm	_VPRBRD_I2C_CMD_ADDR,8,3        ; @VPRBRD_I2C_CMD_ADDR
	.no_dead_strip	_vprbrd_i2c_xfer
.subsections_via_symbols
