	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function taos_connect
_taos_connect:                          ## @taos_connect
	.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
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$64, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r15
	movq	_TAOS_STATE_INIT@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r15)
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_serio_set_drvdata
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_serio_open
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_6
## %bb.3:
	movq	_THIS_MODULE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 56(%r15)
	movq	_taos_algorithm@GOTPCREL(%rip), %rax
	movq	%rax, 48(%r15)
	movq	%r14, 40(%r15)
	movq	%r14, 24(%r15)
	movq	_TAOS_CMD_RESET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_serio_write
	movq	_wq@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	(%r15), %rax
	movq	_TAOS_STATE_IDLE@GOTPCREL(%rip), %r13
	xorl	%ebx, %ebx
	cmpq	(%r13), %rax
	sete	%bl
	movl	$2000, %edi                     ## imm = 0x7D0
	callq	_msecs_to_jiffies
	movl	%r12d, %edi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_wait_event_interruptible_timeout
	movq	(%r15), %rdx
	cmpq	(%r13), %rdx
	jne	LBB0_4
## %bb.7:
	movl	12(%r15), %edi
	callq	_taos_adapter_name
	testq	%rax, %rax
	je	LBB0_8
## %bb.9:
	movq	%r15, %rcx
	addq	$24, %rcx
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	movl	32(%r15), %edi
	movq	%rax, %rsi
	movl	$4, %edx
	callq	_strlcpy
	movq	_TAOS_STATE_EOFF@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r15)
	movq	_TAOS_CMD_ECHO_OFF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_serio_write
	movq	_wq@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	(%r15), %rax
	xorl	%ebx, %ebx
	cmpq	(%r13), %rax
	sete	%bl
	movl	$250, %edi
	callq	_msecs_to_jiffies
	movl	%r12d, %edi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_wait_event_interruptible_timeout
	movq	(%r15), %rdx
	cmpq	(%r13), %rdx
	jne	LBB0_10
## %bb.11:
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdi
	callq	_i2c_add_adapter
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_5
## %bb.12:
	leaq	L_.str.3(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_dbg
	movq	%r12, %rdi
	callq	_taos_instantiate_device
	movl	%eax, 8(%r15)
	jmp	LBB0_13
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_13
LBB0_4:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movl	16(%r15), %ecx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_dbg
	jmp	LBB0_5
LBB0_8:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_5
LBB0_10:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	leaq	L_.str.2(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_dev_err
LBB0_5:
	movq	%r14, %rdi
	callq	_serio_close
LBB0_6:
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_serio_set_drvdata
	movq	%r15, %rdi
	callq	_kfree
LBB0_13:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_TAOS_STATE_INIT,8,3            ## @TAOS_STATE_INIT
	.comm	_THIS_MODULE,4,2                ## @THIS_MODULE
	.comm	_taos_algorithm,4,2             ## @taos_algorithm
	.comm	_TAOS_CMD_RESET,4,2             ## @TAOS_CMD_RESET
	.comm	_wq,4,2                         ## @wq
	.comm	_TAOS_STATE_IDLE,8,3            ## @TAOS_STATE_IDLE
	.comm	_ENODEV,4,2                     ## @ENODEV
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"TAOS EVM reset failed (state=%d, pos=%d)\n"

L_.str.1:                               ## @.str.1
	.asciz	"TAOS EVM identification failed\n"

	.comm	_TAOS_STATE_EOFF,8,3            ## @TAOS_STATE_EOFF
	.comm	_TAOS_CMD_ECHO_OFF,4,2          ## @TAOS_CMD_ECHO_OFF
L_.str.2:                               ## @.str.2
	.asciz	"Echo off failed (state=%d)\n"

L_.str.3:                               ## @.str.3
	.asciz	"Connected to TAOS EVM\n"

	.no_dead_strip	_taos_connect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function taos_connect
_taos_connect:                          ; @taos_connect
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x21, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #64
	bl	_kzalloc
	cbz	x0, LBB0_7
; %bb.1:
	mov	x19, x0
Lloh3:
	adrp	x8, _TAOS_STATE_INIT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _TAOS_STATE_INIT@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	str	x8, [x0]
	mov	x0, x20
	mov	x1, x19
	bl	_serio_set_drvdata
	mov	x0, x20
	mov	x1, x21
	bl	_serio_open
	mov	x22, x0
	cbnz	w0, LBB0_13
; %bb.2:
	mov	x21, x19
	str	x20, [x21, #24]!
Lloh6:
	adrp	x8, _THIS_MODULE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _THIS_MODULE@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x9, _taos_algorithm@GOTPAGE
Lloh10:
	ldr	x9, [x9, _taos_algorithm@GOTPAGEOFF]
	str	w8, [x19, #56]
	stp	x20, x9, [x19, #40]
Lloh11:
	adrp	x8, _TAOS_CMD_RESET@GOTPAGE
Lloh12:
	ldr	x8, [x8, _TAOS_CMD_RESET@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_serio_write
Lloh14:
	adrp	x25, _wq@GOTPAGE
Lloh15:
	ldr	x25, [x25, _wq@GOTPAGEOFF]
	ldr	w22, [x25]
	ldr	x8, [x19]
Lloh16:
	adrp	x24, _TAOS_STATE_IDLE@GOTPAGE
Lloh17:
	ldr	x24, [x24, _TAOS_STATE_IDLE@GOTPAGEOFF]
	ldr	x9, [x24]
	cmp	x8, x9
	cset	w23, eq
	mov	w0, #2000
	bl	_msecs_to_jiffies
	mov	x2, x0
	mov	x0, x22
	mov	x1, x23
	bl	_wait_event_interruptible_timeout
	ldr	x8, [x19]
	ldr	x9, [x24]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.3:
	ldr	w0, [x19, #12]
	bl	_taos_adapter_name
	cbz	x0, LBB0_9
; %bb.4:
	mov	x1, x0
	ldr	w0, [x19, #32]
	mov	w2, #4
	bl	_strlcpy
Lloh18:
	adrp	x8, _TAOS_STATE_EOFF@GOTPAGE
Lloh19:
	ldr	x8, [x8, _TAOS_STATE_EOFF@GOTPAGEOFF]
Lloh20:
	ldr	x8, [x8]
	str	x8, [x19]
Lloh21:
	adrp	x8, _TAOS_CMD_ECHO_OFF@GOTPAGE
Lloh22:
	ldr	x8, [x8, _TAOS_CMD_ECHO_OFF@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_serio_write
	ldr	w22, [x25]
	ldr	x8, [x19]
	ldr	x9, [x24]
	cmp	x8, x9
	cset	w23, eq
	mov	w0, #250
	bl	_msecs_to_jiffies
	mov	x2, x0
	mov	x0, x22
	mov	x1, x23
	bl	_wait_event_interruptible_timeout
	ldr	x8, [x19]
	ldr	x9, [x24]
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.5:
	mov	x0, x21
	bl	_i2c_add_adapter
	mov	x22, x0
	cbnz	w0, LBB0_12
; %bb.6:
Lloh24:
	adrp	x1, l_.str.3@PAGE
Lloh25:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x20
	bl	_dev_dbg
	mov	x0, x21
	bl	_taos_instantiate_device
	str	w0, [x19, #8]
	b	LBB0_14
LBB0_7:
Lloh26:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh27:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_14
LBB0_8:
Lloh29:
	adrp	x9, _ENODEV@GOTPAGE
Lloh30:
	ldr	x9, [x9, _ENODEV@GOTPAGEOFF]
Lloh31:
	ldr	w9, [x9]
	neg	w22, w9
	ldr	w9, [x19, #16]
	stp	x8, x9, [sp]
Lloh32:
	adrp	x1, l_.str@PAGE
Lloh33:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_dev_dbg
	b	LBB0_12
LBB0_9:
Lloh34:
	adrp	x8, _ENODEV@GOTPAGE
Lloh35:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh36:
	ldr	w8, [x8]
	neg	w22, w8
Lloh37:
	adrp	x1, l_.str.1@PAGE
Lloh38:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	b	LBB0_11
LBB0_10:
Lloh39:
	adrp	x9, _ENODEV@GOTPAGE
Lloh40:
	ldr	x9, [x9, _ENODEV@GOTPAGEOFF]
Lloh41:
	ldr	w9, [x9]
	neg	w22, w9
	str	x8, [sp]
Lloh42:
	adrp	x1, l_.str.2@PAGE
Lloh43:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x21
LBB0_11:
	bl	_dev_err
LBB0_12:
	mov	x0, x20
	bl	_serio_close
LBB0_13:
	mov	x0, x20
	mov	x1, #0
	bl	_serio_set_drvdata
	mov	x0, x19
	bl	_kfree
LBB0_14:
	mov	x0, x22
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_TAOS_STATE_INIT,8,3            ; @TAOS_STATE_INIT
	.comm	_THIS_MODULE,4,2                ; @THIS_MODULE
	.comm	_taos_algorithm,4,2             ; @taos_algorithm
	.comm	_TAOS_CMD_RESET,4,2             ; @TAOS_CMD_RESET
	.comm	_wq,4,2                         ; @wq
	.comm	_TAOS_STATE_IDLE,8,3            ; @TAOS_STATE_IDLE
	.comm	_ENODEV,4,2                     ; @ENODEV
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"TAOS EVM reset failed (state=%d, pos=%d)\n"

l_.str.1:                               ; @.str.1
	.asciz	"TAOS EVM identification failed\n"

	.comm	_TAOS_STATE_EOFF,8,3            ; @TAOS_STATE_EOFF
	.comm	_TAOS_CMD_ECHO_OFF,4,2          ; @TAOS_CMD_ECHO_OFF
l_.str.2:                               ; @.str.2
	.asciz	"Echo off failed (state=%d)\n"

l_.str.3:                               ; @.str.3
	.asciz	"Connected to TAOS EVM\n"

	.no_dead_strip	_taos_connect
.subsections_via_symbols
