	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bcm2835_i2c_xfer
_bcm2835_i2c_xfer:                      ## @bcm2835_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r14d
	movq	%rsi, %rbx
	movq	%rdi, %r15
	callq	_i2c_get_adapdata
	movq	%rax, %r12
	cmpl	$2, %r14d
	jl	LBB0_5
## %bb.1:
	leal	-1(%r14), %eax
	movq	_I2C_M_RD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	testl	%ecx, (%rbx,%rdx,4)
	jne	LBB0_4
## %bb.2:                               ##   in Loop: Header=BB0_3 Depth=1
	incq	%rdx
	cmpq	%rdx, %rax
	jne	LBB0_3
LBB0_5:
	movq	%rbx, 16(%r12)
	movl	%r14d, (%r12)
	movq	%r12, %rbx
	addq	$12, %rbx
	movq	%rbx, %rdi
	callq	_reinit_completion
	movq	%r12, %rdi
	callq	_bcm2835_i2c_start_transfer
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_wait_for_completion_timeout
	movq	%rax, %rbx
	movq	%r12, %rdi
	callq	_bcm2835_i2c_finish_transfer
	testq	%rbx, %rbx
	je	LBB0_6
## %bb.7:
	movl	4(%r12), %edx
	testl	%edx, %edx
	je	LBB0_12
## %bb.8:
	movl	8(%r12), %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_dev_dbg
	movq	_BCM2835_I2C_S_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 4(%r12)
	je	LBB0_10
## %bb.9:
	movq	_EREMOTEIO@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_6:
	movq	_BCM2835_I2C_C@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_BCM2835_I2C_C_CLEAR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_bcm2835_i2c_writel
	movl	8(%r12), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_4:
	movl	8(%r12), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_warn_once
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_10:
	movq	_EIO@GOTPCREL(%rip), %rax
LBB0_11:
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_12:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_I2C_M_RD,4,2                   ## @I2C_M_RD
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"only one read message supported, has to be last\n"

	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.comm	_BCM2835_I2C_C,4,2              ## @BCM2835_I2C_C
	.comm	_BCM2835_I2C_C_CLEAR,4,2        ## @BCM2835_I2C_C_CLEAR
L_.str.1:                               ## @.str.1
	.asciz	"i2c transfer timed out\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
L_.str.2:                               ## @.str.2
	.asciz	"i2c transfer failed: %x\n"

	.comm	_BCM2835_I2C_S_ERR,4,2          ## @BCM2835_I2C_S_ERR
	.comm	_EREMOTEIO,4,2                  ## @EREMOTEIO
	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_bcm2835_i2c_xfer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bcm2835_i2c_xfer
_bcm2835_i2c_xfer:                      ; @bcm2835_i2c_xfer
	.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, x2
	mov	x22, x1
	mov	x21, x0
	bl	_i2c_get_adapdata
	mov	x20, x0
	cmp	w19, #2
	b.lt	LBB0_4
; %bb.1:
	sub	w8, w19, #1
Lloh0:
	adrp	x9, _I2C_M_RD@GOTPAGE
Lloh1:
	ldr	x9, [x9, _I2C_M_RD@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	mov	x10, x22
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w11, [x10]
	tst	w9, w11
	b.ne	LBB0_9
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x10, x10, #4
	subs	x8, x8, #1
	b.ne	LBB0_2
LBB0_4:
	str	x22, [x20, #16]
	str	w19, [x20]
	add	x22, x20, #12
	mov	x0, x22
	bl	_reinit_completion
	mov	x0, x20
	bl	_bcm2835_i2c_start_transfer
	ldr	w1, [x21]
	mov	x0, x22
	bl	_wait_for_completion_timeout
	mov	x21, x0
	mov	x0, x20
	bl	_bcm2835_i2c_finish_transfer
	cbz	x21, LBB0_8
; %bb.5:
	ldr	w2, [x20, #4]
	cbz	w2, LBB0_12
; %bb.6:
	ldr	w0, [x20, #8]
Lloh3:
	adrp	x1, l_.str.2@PAGE
Lloh4:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_dbg
	ldr	w8, [x20, #4]
Lloh5:
	adrp	x9, _BCM2835_I2C_S_ERR@GOTPAGE
Lloh6:
	ldr	x9, [x9, _BCM2835_I2C_S_ERR@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_10
; %bb.7:
Lloh8:
	adrp	x8, _EREMOTEIO@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EREMOTEIO@GOTPAGEOFF]
	b	LBB0_11
LBB0_8:
Lloh10:
	adrp	x8, _BCM2835_I2C_C@GOTPAGE
Lloh11:
	ldr	x8, [x8, _BCM2835_I2C_C@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
Lloh13:
	adrp	x8, _BCM2835_I2C_C_CLEAR@GOTPAGE
Lloh14:
	ldr	x8, [x8, _BCM2835_I2C_C_CLEAR@GOTPAGEOFF]
Lloh15:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_bcm2835_i2c_writel
	ldr	w0, [x20, #8]
Lloh16:
	adrp	x1, l_.str.1@PAGE
Lloh17:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
Lloh18:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
	b	LBB0_11
LBB0_9:
	ldr	w0, [x20, #8]
Lloh20:
	adrp	x1, l_.str@PAGE
Lloh21:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_warn_once
Lloh22:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh23:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
	b	LBB0_11
LBB0_10:
Lloh24:
	adrp	x8, _EIO@GOTPAGE
Lloh25:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_11:
	ldr	w8, [x8]
	neg	w19, w8
LBB0_12:
	mov	x0, x19
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_I2C_M_RD,4,2                   ; @I2C_M_RD
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"only one read message supported, has to be last\n"

	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.comm	_BCM2835_I2C_C,4,2              ; @BCM2835_I2C_C
	.comm	_BCM2835_I2C_C_CLEAR,4,2        ; @BCM2835_I2C_C_CLEAR
l_.str.1:                               ; @.str.1
	.asciz	"i2c transfer timed out\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
l_.str.2:                               ; @.str.2
	.asciz	"i2c transfer failed: %x\n"

	.comm	_BCM2835_I2C_S_ERR,4,2          ; @BCM2835_I2C_S_ERR
	.comm	_EREMOTEIO,4,2                  ; @EREMOTEIO
	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_bcm2835_i2c_xfer
.subsections_via_symbols
