	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sds_open
_sds_open:                              ## @sds_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %rbx
	testq	%rdi, %rdi
	jne	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_error
LBB0_2:
	movl	%r14d, %edi
	callq	_target_preopen
	movq	_sds_ops@GOTPCREL(%rip), %rdi
	callq	_unpush_target
	movq	%rbx, %rdi
	callq	_serial_open
	movq	_sds_desc@GOTPCREL(%rip), %r15
	movl	%eax, (%r15)
	testl	%eax, %eax
	jne	LBB0_4
## %bb.3:
	movq	%rbx, %rdi
	callq	_perror_with_name
LBB0_4:
	movq	_baud_rate@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	cmpl	$-1, %esi
	je	LBB0_7
## %bb.5:
	movl	(%r15), %edi
	callq	_serial_setbaudrate
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movl	(%r15), %edi
	callq	_serial_close
	movq	%rbx, %rdi
	callq	_perror_with_name
LBB0_7:
	movl	(%r15), %edi
	callq	_serial_raw
	movl	(%r15), %edi
	callq	_serial_flush_input
	testl	%r14d, %r14d
	je	LBB0_9
## %bb.8:
	leaq	L_.str.1(%rip), %rdi
	callq	_puts_filtered
	movq	%rbx, %rdi
	callq	_puts_filtered
	leaq	L_.str.2(%rip), %rdi
	callq	_puts_filtered
LBB0_9:
	movq	_sds_ops@GOTPCREL(%rip), %rdi
	callq	_push_target
	movq	_just_started@GOTPCREL(%rip), %rax
	movl	$1, (%rax)
	movq	_sds_start_remote@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_RETURN_MASK_ALL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	L_.str.3(%rip), %rdx
	xorl	%esi, %esi
	callq	_catch_errors
	testl	%eax, %eax
	je	LBB0_11
## %bb.10:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_pop_target                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"To open a remote debug connection, you need to specify what serial\ndevice is attached to the remote system (e.g. /dev/ttya)."

	.comm	_sds_ops,4,2                    ## @sds_ops
	.comm	_sds_desc,4,2                   ## @sds_desc
	.comm	_baud_rate,4,2                  ## @baud_rate
L_.str.1:                               ## @.str.1
	.asciz	"Remote debugging using "

L_.str.2:                               ## @.str.2
	.asciz	"\n"

	.comm	_just_started,4,2               ## @just_started
	.comm	_sds_start_remote,4,2           ## @sds_start_remote
L_.str.3:                               ## @.str.3
	.asciz	"Couldn't establish connection to remote target\n"

	.comm	_RETURN_MASK_ALL,4,2            ## @RETURN_MASK_ALL
	.no_dead_strip	_sds_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sds_open
_sds_open:                              ; @sds_open
	.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	x20, x1
	mov	x19, x0
	cbnz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_error
LBB0_2:
	mov	x0, x20
	bl	_target_preopen
Lloh2:
	adrp	x0, _sds_ops@GOTPAGE
Lloh3:
	ldr	x0, [x0, _sds_ops@GOTPAGEOFF]
	bl	_unpush_target
	mov	x0, x19
	bl	_serial_open
Lloh4:
	adrp	x21, _sds_desc@GOTPAGE
Lloh5:
	ldr	x21, [x21, _sds_desc@GOTPAGEOFF]
	str	w0, [x21]
	cbnz	w0, LBB0_4
; %bb.3:
	mov	x0, x19
	bl	_perror_with_name
LBB0_4:
Lloh6:
	adrp	x8, _baud_rate@GOTPAGE
Lloh7:
	ldr	x8, [x8, _baud_rate@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	cmn	w1, #1
	b.eq	LBB0_7
; %bb.5:
	ldr	w0, [x21]
	bl	_serial_setbaudrate
	cbz	x0, LBB0_7
; %bb.6:
	ldr	w0, [x21]
	bl	_serial_close
	mov	x0, x19
	bl	_perror_with_name
LBB0_7:
	ldr	w0, [x21]
	bl	_serial_raw
	ldr	w0, [x21]
	bl	_serial_flush_input
	cbz	w20, LBB0_9
; %bb.8:
Lloh9:
	adrp	x0, l_.str.1@PAGE
Lloh10:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_puts_filtered
	mov	x0, x19
	bl	_puts_filtered
Lloh11:
	adrp	x0, l_.str.2@PAGE
Lloh12:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_puts_filtered
LBB0_9:
Lloh13:
	adrp	x0, _sds_ops@GOTPAGE
Lloh14:
	ldr	x0, [x0, _sds_ops@GOTPAGEOFF]
	bl	_push_target
Lloh15:
	adrp	x8, _just_started@GOTPAGE
Lloh16:
	ldr	x8, [x8, _just_started@GOTPAGEOFF]
	mov	w9, #1
Lloh17:
	str	w9, [x8]
Lloh18:
	adrp	x8, _sds_start_remote@GOTPAGE
Lloh19:
	ldr	x8, [x8, _sds_start_remote@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
Lloh21:
	adrp	x8, _RETURN_MASK_ALL@GOTPAGE
Lloh22:
	ldr	x8, [x8, _RETURN_MASK_ALL@GOTPAGEOFF]
Lloh23:
	ldr	w3, [x8]
Lloh24:
	adrp	x2, l_.str.3@PAGE
Lloh25:
	add	x2, x2, l_.str.3@PAGEOFF
	mov	x1, #0
	bl	_catch_errors
	cbz	w0, LBB0_11
; %bb.10:
	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
LBB0_11:
	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
	b	_pop_target
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotStr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"To open a remote debug connection, you need to specify what serial\ndevice is attached to the remote system (e.g. /dev/ttya)."

	.comm	_sds_ops,4,2                    ; @sds_ops
	.comm	_sds_desc,4,2                   ; @sds_desc
	.comm	_baud_rate,4,2                  ; @baud_rate
l_.str.1:                               ; @.str.1
	.asciz	"Remote debugging using "

l_.str.2:                               ; @.str.2
	.asciz	"\n"

	.comm	_just_started,4,2               ; @just_started
	.comm	_sds_start_remote,4,2           ; @sds_start_remote
l_.str.3:                               ; @.str.3
	.asciz	"Couldn't establish connection to remote target\n"

	.comm	_RETURN_MASK_ALL,4,2            ; @RETURN_MASK_ALL
	.no_dead_strip	_sds_open
.subsections_via_symbols
