	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cbus_transfer
_cbus_transfer:                         ## @cbus_transfer
	.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	%r8d, -44(%rbp)                 ## 4-byte Spill
	movl	%ecx, %r13d
	movl	%edx, %r15d
	movl	%esi, %r12d
	movq	%rdi, %rbx
	callq	_spin_lock_irqsave
	movl	8(%rbx), %edi
	xorl	%r14d, %r14d
	xorl	%esi, %esi
	callq	_gpiod_set_value
	movl	16(%rbx), %edi
	movl	$1, %esi
	callq	_gpiod_direction_output
	movq	_CBUS_ADDR_BITS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_cbus_send_data
	movq	_I2C_SMBUS_READ@GOTPCREL(%rip), %rax
	xorl	%esi, %esi
	cmpb	%r12b, (%rax)
	sete	%sil
	movq	%rbx, %rdi
	callq	_cbus_send_bit
	movq	_CBUS_REG_BITS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movl	%r13d, %esi
	callq	_cbus_send_data
	movq	_I2C_SMBUS_WRITE@GOTPCREL(%rip), %rax
	cmpb	%r12b, (%rax)
	jne	LBB0_3
## %bb.1:
	movq	%rbx, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	$16, %edx
	callq	_cbus_send_data
LBB0_2:
	movl	8(%rbx), %edi
	movl	$1, %esi
	callq	_gpiod_set_value
	movl	4(%rbx), %edi
	movl	$1, %esi
	callq	_gpiod_set_value
	movl	4(%rbx), %edi
	xorl	%esi, %esi
	callq	_gpiod_set_value
	jmp	LBB0_8
LBB0_3:
	movl	16(%rbx), %edi
	callq	_gpiod_direction_input
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	%eax, %r14d
	movl	12(%rbx), %edi
	leaq	L_.str(%rip), %rsi
LBB0_7:
	callq	_dev_dbg
LBB0_8:
	movq	%rbx, %rdi
	callq	_spin_unlock_irqrestore
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movl	4(%rbx), %edi
	movl	$1, %esi
	callq	_gpiod_set_value
	movq	%rbx, %rdi
	callq	_cbus_receive_word
	movl	%eax, %r14d
	testl	%eax, %eax
	jns	LBB0_2
## %bb.6:
	movl	12(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_CBUS_ADDR_BITS,4,2             ## @CBUS_ADDR_BITS
	.comm	_I2C_SMBUS_READ,1,0             ## @I2C_SMBUS_READ
	.comm	_CBUS_REG_BITS,4,2              ## @CBUS_REG_BITS
	.comm	_I2C_SMBUS_WRITE,1,0            ## @I2C_SMBUS_WRITE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed setting direction\n"

L_.str.1:                               ## @.str.1
	.asciz	"failed receiving data\n"

	.no_dead_strip	_cbus_transfer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cbus_transfer
_cbus_transfer:                         ; @cbus_transfer
	.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	x20, x4
	mov	x21, x3
	mov	x22, x2
	mov	x19, x0
	and	w23, w1, #0xff
	bl	_spin_lock_irqsave
	ldr	w0, [x19, #8]
	mov	w1, #0
	bl	_gpiod_set_value
	ldr	w0, [x19, #16]
	mov	w1, #1
	bl	_gpiod_direction_output
Lloh0:
	adrp	x8, _CBUS_ADDR_BITS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CBUS_ADDR_BITS@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x22
	bl	_cbus_send_data
Lloh3:
	adrp	x8, _I2C_SMBUS_READ@GOTPAGE
Lloh4:
	ldr	x8, [x8, _I2C_SMBUS_READ@GOTPAGEOFF]
	ldrb	w8, [x8]
	cmp	w8, w23
	cset	w1, eq
	mov	x0, x19
	bl	_cbus_send_bit
Lloh5:
	adrp	x8, _CBUS_REG_BITS@GOTPAGE
Lloh6:
	ldr	x8, [x8, _CBUS_REG_BITS@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x21
	bl	_cbus_send_data
Lloh8:
	adrp	x8, _I2C_SMBUS_WRITE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _I2C_SMBUS_WRITE@GOTPAGEOFF]
	ldrb	w8, [x8]
	cmp	w8, w23
	b.ne	LBB0_3
; %bb.1:
	mov	x0, x19
	mov	x1, x20
	mov	w2, #16
	bl	_cbus_send_data
	mov	w20, #0
LBB0_2:
	ldr	w0, [x19, #8]
	mov	w1, #1
	bl	_gpiod_set_value
	ldr	w0, [x19, #4]
	mov	w1, #1
	bl	_gpiod_set_value
	ldr	w0, [x19, #4]
	mov	w1, #0
	bl	_gpiod_set_value
	b	LBB0_6
LBB0_3:
	ldr	w0, [x19, #16]
	bl	_gpiod_direction_input
	cbz	w0, LBB0_7
; %bb.4:
	mov	x20, x0
	ldr	w0, [x19, #12]
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
LBB0_5:
	bl	_dev_dbg
LBB0_6:
	mov	x0, x19
	bl	_spin_unlock_irqrestore
	mov	x0, x20
	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
LBB0_7:
	ldr	w0, [x19, #4]
	mov	w1, #1
	bl	_gpiod_set_value
	mov	x0, x19
	bl	_cbus_receive_word
	mov	x20, x0
	tbz	w0, #31, LBB0_2
; %bb.8:
	ldr	w0, [x19, #12]
Lloh12:
	adrp	x1, l_.str.1@PAGE
Lloh13:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_5
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_CBUS_ADDR_BITS,4,2             ; @CBUS_ADDR_BITS
	.comm	_I2C_SMBUS_READ,1,0             ; @I2C_SMBUS_READ
	.comm	_CBUS_REG_BITS,4,2              ; @CBUS_REG_BITS
	.comm	_I2C_SMBUS_WRITE,1,0            ; @I2C_SMBUS_WRITE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed setting direction\n"

l_.str.1:                               ; @.str.1
	.asciz	"failed receiving data\n"

	.no_dead_strip	_cbus_transfer
.subsections_via_symbols
