	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function st2000_open
_st2000_open:                           ## @st2000_open
	.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
	subq	$112, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	movl	%esi, %edi
	callq	_target_preopen
	movq	_dev_name@GOTPCREL(%rip), %r12
	movq	(%r12), %rdx
	leaq	L_.str(%rip), %rsi
	movq	_baudrate@GOTPCREL(%rip), %r14
	leaq	-144(%rbp), %r8
	movq	%rbx, %rdi
	movq	%r14, %rcx
	callq	_sscanf
	cmpl	$2, %eax
	je	LBB0_2
## %bb.1:
	leaq	L_.str.1(%rip), %rdi
	callq	_error
LBB0_2:
	xorl	%edi, %edi
	callq	_st2000_close
	movq	(%r12), %rdi
	callq	_serial_open
	movq	_st2000_desc@GOTPCREL(%rip), %rbx
	movl	%eax, (%rbx)
	testl	%eax, %eax
	jne	LBB0_4
## %bb.3:
	movq	(%r12), %rdi
	callq	_perror_with_name
	movl	(%rbx), %eax
LBB0_4:
	movl	(%r14), %esi
	movl	%eax, %edi
	callq	_serial_setbaudrate
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movq	(%r12), %rdi
	callq	_serial_close
	movq	(%r12), %rdi
	callq	_perror_with_name
LBB0_6:
	movl	(%rbx), %edi
	callq	_serial_raw
	movq	_st2000_ops@GOTPCREL(%rip), %rdi
	callq	_push_target
	leaq	L_.str.2(%rip), %rdi
	callq	_printf_stdebug
	movl	$1, %edi
	callq	_expect_prompt
	testl	%r15d, %r15d
	je	LBB0_8
## %bb.7:
	movq	_target_shortname@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	(%r12), %rdx
	leaq	L_.str.3(%rip), %rdi
	callq	_printf
LBB0_8:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_10
## %bb.9:
	addq	$112, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	" %s %d %s"

	.comm	_dev_name,8,3                   ## @dev_name
	.comm	_baudrate,4,2                   ## @baudrate
L_.str.1:                               ## @.str.1
	.asciz	"Bad arguments.  Usage: target st2000 <device> <speed>\nor target st2000 <host> <port>\n"

	.comm	_st2000_desc,4,2                ## @st2000_desc
	.comm	_st2000_ops,4,2                 ## @st2000_ops
L_.str.2:                               ## @.str.2
	.asciz	"\003"

L_.str.3:                               ## @.str.3
	.asciz	"Remote %s connected to %s\n"

	.comm	_target_shortname,8,3           ## @target_shortname
	.comm	_LOG_FILE,8,3                   ## @LOG_FILE
	.comm	_log_file,8,3                   ## @log_file
	.no_dead_strip	_st2000_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function st2000_open
_st2000_open:                           ; @st2000_open
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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, x1
	mov	x21, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
	mov	x0, x1
	bl	_target_preopen
Lloh3:
	adrp	x22, _dev_name@GOTPAGE
Lloh4:
	ldr	x22, [x22, _dev_name@GOTPAGEOFF]
	ldr	x2, [x22]
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
Lloh7:
	adrp	x20, _baudrate@GOTPAGE
Lloh8:
	ldr	x20, [x20, _baudrate@GOTPAGEOFF]
	add	x4, sp, #4
	mov	x0, x21
	mov	x3, x20
	bl	_sscanf
	cmp	w0, #2
	b.eq	LBB0_2
; %bb.1:
Lloh9:
	adrp	x0, l_.str.1@PAGE
Lloh10:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_error
LBB0_2:
	mov	w0, #0
	bl	_st2000_close
	ldr	x0, [x22]
	bl	_serial_open
Lloh11:
	adrp	x21, _st2000_desc@GOTPAGE
Lloh12:
	ldr	x21, [x21, _st2000_desc@GOTPAGEOFF]
	str	w0, [x21]
	cbnz	w0, LBB0_4
; %bb.3:
	ldr	x0, [x22]
	bl	_perror_with_name
	ldr	w0, [x21]
LBB0_4:
	ldr	w1, [x20]
	bl	_serial_setbaudrate
	cbz	x0, LBB0_6
; %bb.5:
	ldr	x0, [x22]
	bl	_serial_close
	ldr	x0, [x22]
	bl	_perror_with_name
LBB0_6:
	ldr	w0, [x21]
	bl	_serial_raw
Lloh13:
	adrp	x0, _st2000_ops@GOTPAGE
Lloh14:
	ldr	x0, [x0, _st2000_ops@GOTPAGEOFF]
	bl	_push_target
Lloh15:
	adrp	x0, l_.str.2@PAGE
Lloh16:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_printf_stdebug
	mov	w0, #1
	bl	_expect_prompt
	cbz	w19, LBB0_8
; %bb.7:
Lloh17:
	adrp	x8, _target_shortname@GOTPAGE
Lloh18:
	ldr	x8, [x8, _target_shortname@GOTPAGEOFF]
Lloh19:
	ldr	x1, [x8]
	ldr	x2, [x22]
Lloh20:
	adrp	x0, l_.str.3@PAGE
Lloh21:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_printf
LBB0_8:
	ldur	x8, [x29, #-40]
Lloh22:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh23:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh24:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_10
; %bb.9:
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
LBB0_10:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	" %s %d %s"

	.comm	_dev_name,8,3                   ; @dev_name
	.comm	_baudrate,4,2                   ; @baudrate
l_.str.1:                               ; @.str.1
	.asciz	"Bad arguments.  Usage: target st2000 <device> <speed>\nor target st2000 <host> <port>\n"

	.comm	_st2000_desc,4,2                ; @st2000_desc
	.comm	_st2000_ops,4,2                 ; @st2000_ops
l_.str.2:                               ; @.str.2
	.asciz	"\003"

l_.str.3:                               ; @.str.3
	.asciz	"Remote %s connected to %s\n"

	.comm	_target_shortname,8,3           ; @target_shortname
	.comm	_LOG_FILE,8,3                   ; @LOG_FILE
	.comm	_log_file,8,3                   ; @log_file
	.no_dead_strip	_st2000_open
.subsections_via_symbols
