	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function taos_smbus_xfer
_taos_smbus_xfer:                       ## @taos_smbus_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	%r9d, %r15d
	movl	%r8d, -44(%rbp)                 ## 4-byte Spill
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	movq	%rsi, %rbx
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	8(%rdi), %r13
	movq	%r13, %rdi
	callq	_serio_get_drvdata
	movq	%rax, %r12
	movq	(%rax), %r14
	cmpq	%rbx, 8(%rax)
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movq	%rbx, %rdx
	xorl	%eax, %eax
	callq	_sprintf
	cltq
	addq	%rax, %r14
LBB0_2:
	movq	16(%rbp), %rcx
	cmpl	$128, %r15d
	je	LBB0_7
## %bb.3:
	cmpl	$129, %r15d
	jne	LBB0_10
## %bb.4:
	movq	_I2C_SMBUS_WRITE@GOTPCREL(%rip), %rax
	movl	-48(%rbp), %r15d                ## 4-byte Reload
	cmpb	%r15b, (%rax)
	jne	LBB0_11
## %bb.5:
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_6
LBB0_7:
	movq	_I2C_SMBUS_WRITE@GOTPCREL(%rip), %rax
	movl	-48(%rbp), %r15d                ## 4-byte Reload
	cmpb	%r15b, (%rax)
	jne	LBB0_9
## %bb.8:
	movl	(%rcx), %ecx
	leaq	L_.str.3(%rip), %rsi
	movq	%r14, %rdi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	xorl	%eax, %eax
	callq	_sprintf
	jmp	LBB0_12
LBB0_10:
	leaq	L_.str.5(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r15d, %edx
	callq	_dev_warn
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rax
	jmp	LBB0_19
LBB0_11:
	movw	$36, (%r14)
	jmp	LBB0_12
LBB0_9:
	leaq	L_.str.4(%rip), %rsi
LBB0_6:
	movq	%r14, %rdi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	xorl	%eax, %eax
	callq	_sprintf
LBB0_12:
	movq	(%r12), %rdx
	leaq	L_.str.6(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_dev_dbg
	movq	(%r12), %rbx
	movb	(%rbx), %al
	testb	%al, %al
	je	LBB0_15
## %bb.13:
	incq	%rbx
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movsbl	%al, %esi
	movq	%r13, %rdi
	callq	_serio_write
	movzbl	(%rbx), %eax
	incq	%rbx
	testb	%al, %al
	jne	LBB0_14
LBB0_15:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 8(%r12)
	movl	$0, 16(%r12)
	movq	_TAOS_STATE_RECV@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 24(%r12)
	movq	_I2C_SMBUS_WRITE@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	cmpb	%r15b, (%rcx)
	sete	%al
	leal	(%rax,%rax), %esi
	addl	$60, %esi
	movq	%r13, %rdi
	callq	_serio_write
	movq	_wq@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	24(%r12), %rax
	movq	_TAOS_STATE_IDLE@GOTPCREL(%rip), %r13
	xorl	%ebx, %ebx
	cmpq	(%r13), %rax
	sete	%bl
	movl	$150, %edi
	callq	_msecs_to_jiffies
	movl	%r14d, %edi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_wait_event_interruptible_timeout
	movq	24(%r12), %rax
	movl	16(%r12), %edx
	cmpq	(%r13), %rax
	jne	LBB0_17
## %bb.16:
	cmpl	$5, %edx
	jne	LBB0_17
## %bb.20:
	movq	(%r12), %rdx
	leaq	L_.str.8(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_dev_dbg
	movq	(%r12), %r14
	leaq	1(%r14), %rbx
	movb	$0, 4(%r14)
	leaq	L_.str.9(%rip), %rsi
	movq	%rbx, %rdi
	callq	_strcmp
	testl	%eax, %eax
	je	LBB0_21
## %bb.22:
	movq	_I2C_SMBUS_WRITE@GOTPCREL(%rip), %rax
	cmpb	%r15b, (%rax)
	jne	LBB0_25
## %bb.23:
	leaq	L_.str.10(%rip), %rsi
	movq	%rbx, %rdi
	callq	_strcmp
	testl	%eax, %eax
	jne	LBB0_18
## %bb.24:
	xorl	%ebx, %ebx
	jmp	LBB0_27
LBB0_17:
	leaq	L_.str.7(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_dev_err
LBB0_18:
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_19
LBB0_21:
	movq	_ENODEV@GOTPCREL(%rip), %rax
LBB0_19:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_27:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_25:
	cmpb	$120, (%rbx)
	jne	LBB0_18
## %bb.26:
	addq	$2, %r14
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	$16, %edx
	callq	_simple_strtol
	movq	16(%rbp), %rcx
	movl	%eax, (%rcx)
	jmp	LBB0_27
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"@%02X"

	.comm	_I2C_SMBUS_WRITE,1,0            ## @I2C_SMBUS_WRITE
L_.str.1:                               ## @.str.1
	.asciz	"$#%02X"

L_.str.3:                               ## @.str.3
	.asciz	"$%02X#%02X"

L_.str.4:                               ## @.str.4
	.asciz	"$%02X"

L_.str.5:                               ## @.str.5
	.asciz	"Unsupported transaction %d\n"

	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
L_.str.6:                               ## @.str.6
	.asciz	"Command buffer: %s\n"

	.comm	_TAOS_STATE_RECV,8,3            ## @TAOS_STATE_RECV
	.comm	_wq,4,2                         ## @wq
	.comm	_TAOS_STATE_IDLE,8,3            ## @TAOS_STATE_IDLE
L_.str.7:                               ## @.str.7
	.asciz	"Transaction timeout (pos=%d)\n"

	.comm	_EIO,4,2                        ## @EIO
L_.str.8:                               ## @.str.8
	.asciz	"Answer buffer: %s\n"

L_.str.9:                               ## @.str.9
	.asciz	"NAK"

	.comm	_ENODEV,4,2                     ## @ENODEV
L_.str.10:                              ## @.str.10
	.asciz	"ACK"

	.no_dead_strip	_taos_smbus_xfer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function taos_smbus_xfer
_taos_smbus_xfer:                       ; @taos_smbus_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
	mov	x19, x6
	mov	x26, x5
	mov	x25, x4
	mov	x27, x3
	mov	x23, x1
	mov	x20, x0
	ldr	x22, [x0, #8]
	mov	x0, x22
	bl	_serio_get_drvdata
	mov	x21, x0
	ldp	x24, x8, [x0]
	cmp	x8, x23
	b.eq	LBB0_2
; %bb.1:
	str	x23, [sp]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x24
	bl	_sprintf
	add	x24, x24, w0, sxtw
LBB0_2:
	and	w27, w27, #0xff
Lloh2:
	adrp	x28, _I2C_SMBUS_WRITE@GOTPAGE
Lloh3:
	ldr	x28, [x28, _I2C_SMBUS_WRITE@GOTPAGEOFF]
	cmp	w26, #128
	b.eq	LBB0_6
; %bb.3:
	cmp	w26, #129
	b.ne	LBB0_8
; %bb.4:
	ldrb	w8, [x28]
	cmp	w8, w27
	b.ne	LBB0_9
; %bb.5:
	str	x25, [sp]
Lloh4:
	adrp	x1, l_.str.1@PAGE
Lloh5:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_11
LBB0_6:
	ldrb	w8, [x28]
	cmp	w8, w27
	b.ne	LBB0_10
; %bb.7:
	ldr	w8, [x19]
                                        ; kill: def $w25 killed $w25 killed $x25 def $x25
	stp	x25, x8, [sp]
Lloh6:
	adrp	x1, l_.str.3@PAGE
Lloh7:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_11
LBB0_8:
Lloh8:
	adrp	x1, l_.str.5@PAGE
Lloh9:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x20
	mov	x2, x26
	bl	_dev_warn
Lloh10:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
	b	LBB0_22
LBB0_9:
	mov	w8, #36
	strh	w8, [x24]
	b	LBB0_12
LBB0_10:
                                        ; kill: def $w25 killed $w25 killed $x25 def $x25
	str	x25, [sp]
Lloh12:
	adrp	x1, l_.str.4@PAGE
Lloh13:
	add	x1, x1, l_.str.4@PAGEOFF
LBB0_11:
	mov	x0, x24
	bl	_sprintf
LBB0_12:
	ldr	x2, [x21]
Lloh14:
	adrp	x1, l_.str.6@PAGE
Lloh15:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	x0, x20
	bl	_dev_dbg
	ldr	x9, [x21]
	ldrb	w8, [x9]
	cbz	w8, LBB0_15
; %bb.13:
	add	x24, x9, #1
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	sxtb	w1, w8
	mov	x0, x22
	bl	_serio_write
	ldrb	w8, [x24], #1
	cbnz	w8, LBB0_14
LBB0_15:
	str	x23, [x21, #8]
	str	wzr, [x21, #16]
Lloh16:
	adrp	x8, _TAOS_STATE_RECV@GOTPAGE
Lloh17:
	ldr	x8, [x8, _TAOS_STATE_RECV@GOTPAGEOFF]
Lloh18:
	ldr	x8, [x8]
	str	x8, [x21, #24]
	ldrb	w8, [x28]
	mov	w9, #60
	mov	w10, #62
	cmp	w8, w27
	csel	w1, w10, w9, eq
	mov	x0, x22
	bl	_serio_write
Lloh19:
	adrp	x8, _wq@GOTPAGE
Lloh20:
	ldr	x8, [x8, _wq@GOTPAGEOFF]
Lloh21:
	ldr	w22, [x8]
	ldr	x8, [x21, #24]
Lloh22:
	adrp	x24, _TAOS_STATE_IDLE@GOTPAGE
Lloh23:
	ldr	x24, [x24, _TAOS_STATE_IDLE@GOTPAGEOFF]
	ldr	x9, [x24]
	cmp	x8, x9
	cset	w23, eq
	mov	w0, #150
	bl	_msecs_to_jiffies
	mov	x2, x0
	mov	x0, x22
	mov	x1, x23
	bl	_wait_event_interruptible_timeout
	ldr	x8, [x21, #24]
	ldr	x9, [x24]
	ldr	w2, [x21, #16]
	cmp	x8, x9
	ccmp	w2, #5, #0, eq
	b.eq	LBB0_18
; %bb.16:
Lloh24:
	adrp	x1, l_.str.7@PAGE
Lloh25:
	add	x1, x1, l_.str.7@PAGEOFF
	mov	x0, x20
	bl	_dev_err
LBB0_17:
Lloh26:
	adrp	x8, _EIO@GOTPAGE
Lloh27:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_22
LBB0_18:
	ldr	x2, [x21]
Lloh28:
	adrp	x1, l_.str.8@PAGE
Lloh29:
	add	x1, x1, l_.str.8@PAGEOFF
	mov	x0, x20
	bl	_dev_dbg
	ldr	x21, [x21]
	add	x20, x21, #1
	strb	wzr, [x21, #4]
Lloh30:
	adrp	x1, l_.str.9@PAGE
Lloh31:
	add	x1, x1, l_.str.9@PAGEOFF
	mov	x0, x20
	bl	_strcmp
	cbz	w0, LBB0_21
; %bb.19:
	ldrb	w8, [x28]
	cmp	w8, w27
	b.ne	LBB0_24
; %bb.20:
Lloh32:
	adrp	x1, l_.str.10@PAGE
Lloh33:
	add	x1, x1, l_.str.10@PAGEOFF
	mov	x0, x20
	bl	_strcmp
	cbnz	w0, LBB0_17
	b	LBB0_23
LBB0_21:
Lloh34:
	adrp	x8, _ENODEV@GOTPAGE
Lloh35:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
LBB0_22:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_23:
	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_24:
	ldrb	w8, [x20]
	cmp	w8, #120
	b.ne	LBB0_17
; %bb.25:
	add	x0, x21, #2
	mov	x1, #0
	mov	w2, #16
	bl	_simple_strtol
	mov	x8, x0
	mov	w0, #0
	str	w8, [x19]
	b	LBB0_23
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"@%02X"

	.comm	_I2C_SMBUS_WRITE,1,0            ; @I2C_SMBUS_WRITE
l_.str.1:                               ; @.str.1
	.asciz	"$#%02X"

l_.str.3:                               ; @.str.3
	.asciz	"$%02X#%02X"

l_.str.4:                               ; @.str.4
	.asciz	"$%02X"

l_.str.5:                               ; @.str.5
	.asciz	"Unsupported transaction %d\n"

	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
l_.str.6:                               ; @.str.6
	.asciz	"Command buffer: %s\n"

	.comm	_TAOS_STATE_RECV,8,3            ; @TAOS_STATE_RECV
	.comm	_wq,4,2                         ; @wq
	.comm	_TAOS_STATE_IDLE,8,3            ; @TAOS_STATE_IDLE
l_.str.7:                               ; @.str.7
	.asciz	"Transaction timeout (pos=%d)\n"

	.comm	_EIO,4,2                        ; @EIO
l_.str.8:                               ; @.str.8
	.asciz	"Answer buffer: %s\n"

l_.str.9:                               ; @.str.9
	.asciz	"NAK"

	.comm	_ENODEV,4,2                     ; @ENODEV
l_.str.10:                              ; @.str.10
	.asciz	"ACK"

	.no_dead_strip	_taos_smbus_xfer
.subsections_via_symbols
