	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ocd_start_remote
_ocd_start_remote:                      ## @ocd_start_remote
	.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	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	movb	(%rdi), %bl
	movq	_immediate_quit@GOTPCREL(%rip), %r12
	incl	(%r12)
	movq	_ocd_desc@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_serial_send_break
	movq	_OCD_INIT@GOTPCREL(%rip), %rax
	movb	(%rax), %al
	movb	%al, -50(%rbp)
	movw	$20480, -49(%rbp)               ## imm = 0x5000
	movb	%bl, -47(%rbp)
	leaq	-50(%rbp), %rdi
	movl	$4, %esi
	callq	_ocd_put_packet
	movzbl	-50(%rbp), %edi
	movq	_remote_timeout@GOTPCREL(%rip), %r15
	movl	(%r15), %edx
	leaq	-56(%rbp), %rsi
	callq	_ocd_get_packet
	movq	%rax, %rbx
	cmpl	$1, -56(%rbp)
	jg	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_error
LBB0_2:
	movzbl	1(%rbx), %eax
	movl	%eax, -60(%rbp)
	movzbl	2(%rbx), %esi
	testl	%esi, %esi
	je	LBB0_4
## %bb.3:
	leaq	L_.str.1(%rip), %rdi
	callq	_ocd_error
LBB0_4:
	movq	_OCD_AYT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	-60(%rbp), %rbx
	leaq	-56(%rbp), %r14
	movq	%rbx, %rsi
	movq	%r14, %rdx
	callq	_ocd_do_command
	movq	_OCD_GET_VERSION@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	movq	%r14, %rdx
	callq	_ocd_do_command
	movzbl	(%rax), %esi
	movzbl	1(%rax), %edx
	movzbl	3(%rax), %ecx
	leaq	L_.str.2(%rip), %rdi
	callq	_printf_unfiltered
	movq	_OCD_FLAG_BDM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, -60(%rbp)
	jne	LBB0_6
## %bb.5:
	xorl	%eax, %eax
	callq	_ocd_stop
LBB0_6:
	movq	_OCD_SET_CTL_FLAGS@GOTPCREL(%rip), %rax
	movb	(%rax), %al
	movb	%al, -50(%rbp)
	movw	$256, -49(%rbp)                 ## imm = 0x100
	leaq	-50(%rbp), %rdi
	movl	$3, %esi
	callq	_ocd_put_packet
	movzbl	-50(%rbp), %edi
	movl	(%r15), %edx
	leaq	-56(%rbp), %rsi
	callq	_ocd_get_packet
	movq	%rax, %rbx
	cmpl	$1, -56(%rbp)
	jg	LBB0_8
## %bb.7:
	leaq	L_.str(%rip), %rdi
	callq	_error
LBB0_8:
	movzbl	1(%rbx), %eax
	movl	%eax, -60(%rbp)
	movzbl	2(%rbx), %esi
	testl	%esi, %esi
	je	LBB0_10
## %bb.9:
	leaq	L_.str.3(%rip), %rdi
	callq	_ocd_error
LBB0_10:
	decl	(%r12)
	xorl	%eax, %eax
	callq	_flush_cached_frames
	xorl	%eax, %eax
	callq	_registers_changed
	xorl	%eax, %eax
	callq	_read_pc
	movq	_stop_pc@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	xorl	%eax, %eax
	callq	_get_selected_frame
	movl	%eax, %edi
	movl	$-1, %esi
	movl	$1, %edx
	callq	_print_stack_frame
	movq	_OCD_LOG_FILE@GOTPCREL(%rip), %r12
	movb	(%r12), %al
	movb	%al, -50(%rbp)
	movb	$3, -49(%rbp)
	leaq	-50(%rbp), %r14
	movq	%r14, %rdi
	movl	$2, %esi
	callq	_ocd_put_packet
	movzbl	-50(%rbp), %edi
	movl	(%r15), %edx
	leaq	-56(%rbp), %rbx
	movq	%rbx, %rsi
	callq	_ocd_get_packet
	movb	(%r12), %al
	movb	%al, -50(%rbp)
	movb	$2, -49(%rbp)
	movq	%r14, %rdi
	movl	$2, %esi
	callq	_ocd_put_packet
	movzbl	-50(%rbp), %edi
	movl	(%r15), %edx
	movq	%rbx, %rsi
	callq	_ocd_get_packet
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_12
## %bb.11:
	movl	$1, %eax
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_immediate_quit,4,2             ## @immediate_quit
	.comm	_ocd_desc,4,2                   ## @ocd_desc
	.comm	_OCD_INIT,1,0                   ## @OCD_INIT
	.comm	_remote_timeout,4,2             ## @remote_timeout
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Truncated response packet from OCD device"

L_.str.1:                               ## @.str.1
	.asciz	"OCD_INIT:"

	.comm	_OCD_AYT,4,2                    ## @OCD_AYT
	.comm	_OCD_GET_VERSION,4,2            ## @OCD_GET_VERSION
L_.str.2:                               ## @.str.2
	.asciz	"[Wiggler version %x.%x, capability 0x%x]\n"

	.comm	_OCD_FLAG_BDM,4,2               ## @OCD_FLAG_BDM
	.comm	_OCD_SET_CTL_FLAGS,1,0          ## @OCD_SET_CTL_FLAGS
L_.str.3:                               ## @.str.3
	.asciz	"OCD_SET_CTL_FLAGS:"

	.comm	_stop_pc,4,2                    ## @stop_pc
	.comm	_OCD_LOG_FILE,1,0               ## @OCD_LOG_FILE
	.no_dead_strip	_ocd_start_remote
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ocd_start_remote
_ocd_start_remote:                      ; @ocd_start_remote
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	ldr	w19, [x0]
Lloh3:
	adrp	x21, _immediate_quit@GOTPAGE
Lloh4:
	ldr	x21, [x21, _immediate_quit@GOTPAGEOFF]
	ldr	w8, [x21]
	add	w8, w8, #1
	str	w8, [x21]
Lloh5:
	adrp	x8, _ocd_desc@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ocd_desc@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	bl	_serial_send_break
Lloh8:
	adrp	x8, _OCD_INIT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _OCD_INIT@GOTPAGEOFF]
	ldrb	w8, [x8]
	strb	w8, [sp, #14]
	mov	w8, #20480
	sturh	w8, [sp, #15]
	strb	w19, [sp, #17]
	add	x0, sp, #14
	mov	w1, #4
	bl	_ocd_put_packet
	ldrb	w0, [sp, #14]
Lloh10:
	adrp	x20, _remote_timeout@GOTPAGE
Lloh11:
	ldr	x20, [x20, _remote_timeout@GOTPAGEOFF]
	ldr	w2, [x20]
	add	x1, sp, #8
	bl	_ocd_get_packet
	mov	x19, x0
	ldr	w8, [sp, #8]
	cmp	w8, #1
	b.gt	LBB0_2
; %bb.1:
Lloh12:
	adrp	x0, l_.str@PAGE
Lloh13:
	add	x0, x0, l_.str@PAGEOFF
	bl	_error
LBB0_2:
	ldrb	w8, [x19, #1]
	str	w8, [sp, #4]
	ldrb	w1, [x19, #2]
	cbz	w1, LBB0_4
; %bb.3:
Lloh14:
	adrp	x0, l_.str.1@PAGE
Lloh15:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_ocd_error
LBB0_4:
Lloh16:
	adrp	x8, _OCD_AYT@GOTPAGE
Lloh17:
	ldr	x8, [x8, _OCD_AYT@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
	add	x1, sp, #4
	add	x2, sp, #8
	bl	_ocd_do_command
Lloh19:
	adrp	x8, _OCD_GET_VERSION@GOTPAGE
Lloh20:
	ldr	x8, [x8, _OCD_GET_VERSION@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
	add	x1, sp, #4
	add	x2, sp, #8
	bl	_ocd_do_command
	ldrb	w1, [x0]
	ldrb	w2, [x0, #1]
	ldrb	w3, [x0, #3]
Lloh22:
	adrp	x0, l_.str.2@PAGE
Lloh23:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_printf_unfiltered
	ldr	w8, [sp, #4]
Lloh24:
	adrp	x9, _OCD_FLAG_BDM@GOTPAGE
Lloh25:
	ldr	x9, [x9, _OCD_FLAG_BDM@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_6
; %bb.5:
	bl	_ocd_stop
LBB0_6:
Lloh27:
	adrp	x8, _OCD_SET_CTL_FLAGS@GOTPAGE
Lloh28:
	ldr	x8, [x8, _OCD_SET_CTL_FLAGS@GOTPAGEOFF]
	ldrb	w8, [x8]
	strb	w8, [sp, #14]
	mov	w8, #256
	sturh	w8, [sp, #15]
	add	x0, sp, #14
	mov	w1, #3
	bl	_ocd_put_packet
	ldrb	w0, [sp, #14]
	ldr	w2, [x20]
	add	x1, sp, #8
	bl	_ocd_get_packet
	mov	x19, x0
	ldr	w8, [sp, #8]
	cmp	w8, #1
	b.gt	LBB0_8
; %bb.7:
Lloh29:
	adrp	x0, l_.str@PAGE
Lloh30:
	add	x0, x0, l_.str@PAGEOFF
	bl	_error
LBB0_8:
	ldrb	w8, [x19, #1]
	str	w8, [sp, #4]
	ldrb	w1, [x19, #2]
	cbz	w1, LBB0_10
; %bb.9:
Lloh31:
	adrp	x0, l_.str.3@PAGE
Lloh32:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_ocd_error
LBB0_10:
	ldr	w8, [x21]
	sub	w8, w8, #1
	str	w8, [x21]
	bl	_flush_cached_frames
	bl	_registers_changed
	bl	_read_pc
Lloh33:
	adrp	x8, _stop_pc@GOTPAGE
Lloh34:
	ldr	x8, [x8, _stop_pc@GOTPAGEOFF]
Lloh35:
	str	w0, [x8]
	bl	_get_selected_frame
	mov	w1, #-1
	mov	w2, #1
	bl	_print_stack_frame
Lloh36:
	adrp	x19, _OCD_LOG_FILE@GOTPAGE
Lloh37:
	ldr	x19, [x19, _OCD_LOG_FILE@GOTPAGEOFF]
	ldrb	w8, [x19]
	strb	w8, [sp, #14]
	mov	w8, #3
	strb	w8, [sp, #15]
	mov	w21, #2
	add	x0, sp, #14
	mov	w1, #2
	bl	_ocd_put_packet
	ldrb	w0, [sp, #14]
	ldr	w2, [x20]
	add	x1, sp, #8
	bl	_ocd_get_packet
	ldrb	w8, [x19]
	strb	w8, [sp, #14]
	strb	w21, [sp, #15]
	add	x0, sp, #14
	mov	w1, #2
	bl	_ocd_put_packet
	ldrb	w0, [sp, #14]
	ldr	w2, [x20]
	add	x1, sp, #8
	bl	_ocd_get_packet
	ldr	x8, [sp, #24]
Lloh38:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh39:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh40:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_12
; %bb.11:
	mov	w0, #1
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_12:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGot	Lloh36, Lloh37
	.loh AdrpLdrGotStr	Lloh33, Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.comm	_immediate_quit,4,2             ; @immediate_quit
	.comm	_ocd_desc,4,2                   ; @ocd_desc
	.comm	_OCD_INIT,1,0                   ; @OCD_INIT
	.comm	_remote_timeout,4,2             ; @remote_timeout
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Truncated response packet from OCD device"

l_.str.1:                               ; @.str.1
	.asciz	"OCD_INIT:"

	.comm	_OCD_AYT,4,2                    ; @OCD_AYT
	.comm	_OCD_GET_VERSION,4,2            ; @OCD_GET_VERSION
l_.str.2:                               ; @.str.2
	.asciz	"[Wiggler version %x.%x, capability 0x%x]\n"

	.comm	_OCD_FLAG_BDM,4,2               ; @OCD_FLAG_BDM
	.comm	_OCD_SET_CTL_FLAGS,1,0          ; @OCD_SET_CTL_FLAGS
l_.str.3:                               ; @.str.3
	.asciz	"OCD_SET_CTL_FLAGS:"

	.comm	_stop_pc,4,2                    ; @stop_pc
	.comm	_OCD_LOG_FILE,1,0               ; @OCD_LOG_FILE
	.no_dead_strip	_ocd_start_remote
.subsections_via_symbols
