	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ocd_do_command
_ocd_do_command:                        ## @ocd_do_command
	.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	$360, %rsp                      ## imm = 0x168
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	movq	%rsi, -392(%rbp)                ## 8-byte Spill
	movl	%edi, %r15d
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movb	%r15b, -160(%rbp)
	leaq	-160(%rbp), %rdi
	movl	$1, %esi
	callq	_ocd_put_packet
	movzbl	-160(%rbp), %edi
	movq	_remote_timeout@GOTPCREL(%rip), %r13
	movl	(%r13), %edx
	movq	%rbx, %rsi
	callq	_ocd_get_packet
	movq	%rax, %r12
	cmpl	$2, (%rbx)
	jg	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_error
LBB0_2:
	movzbl	1(%r12), %r14d
	movzbl	2(%r12), %ebx
	testl	%ebx, %ebx
	je	LBB0_4
## %bb.3:
	leaq	L_.str.1(%rip), %rsi
	leaq	-272(%rbp), %r13
	movq	%r13, %rdi
	movl	%r15d, %edx
	callq	_sprintf
	movq	%r13, %rdi
	movq	_remote_timeout@GOTPCREL(%rip), %r13
	movl	%ebx, %esi
	callq	_ocd_error
LBB0_4:
	movq	_OCD_FLAG_PWF@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_6
## %bb.5:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_8
LBB0_6:
	movq	_OCD_FLAG_CABLE_DISC@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_9
## %bb.7:
	leaq	L_.str.3(%rip), %rdi
LBB0_8:
	callq	_error
LBB0_9:
	movq	-392(%rbp), %rax                ## 8-byte Reload
	movl	%r14d, (%rax)
	movq	_OCD_LOG_FILE@GOTPCREL(%rip), %r15
	movb	(%r15), %al
	movb	%al, -384(%rbp)
	movb	$3, -383(%rbp)
	leaq	-384(%rbp), %r14
	movq	%r14, %rdi
	movl	$2, %esi
	callq	_ocd_put_packet
	movzbl	-384(%rbp), %edi
	movl	(%r13), %edx
	leaq	-396(%rbp), %rbx
	movq	%rbx, %rsi
	callq	_ocd_get_packet
	movb	(%r15), %al
	movb	%al, -384(%rbp)
	movb	$2, -383(%rbp)
	movq	%r14, %rdi
	movl	$2, %esi
	callq	_ocd_put_packet
	movzbl	-384(%rbp), %edi
	movl	(%r13), %edx
	movq	%rbx, %rsi
	callq	_ocd_get_packet
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_11
## %bb.10:
	addq	$3, %r12
	movq	%r12, %rax
	addq	$360, %rsp                      ## imm = 0x168
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.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_do_command (0x%x):"

	.comm	_OCD_FLAG_PWF,4,2               ## @OCD_FLAG_PWF
L_.str.2:                               ## @.str.2
	.asciz	"OCD device can't detect VCC at BDM interface."

	.comm	_OCD_FLAG_CABLE_DISC,4,2        ## @OCD_FLAG_CABLE_DISC
L_.str.3:                               ## @.str.3
	.asciz	"BDM cable appears to be disconnected."

	.comm	_OCD_LOG_FILE,1,0               ## @OCD_LOG_FILE
	.no_dead_strip	_ocd_do_command
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ocd_do_command
_ocd_do_command:                        ; @ocd_do_command
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #400
	.cfi_def_cfa_offset 400
	stp	x28, x27, [sp, #320]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #336]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #352]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #368]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #384]            ; 16-byte Folded Spill
	add	x29, sp, #384
	.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 w27, -72
	.cfi_offset w28, -80
	mov	x22, x2
	mov	x20, 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, #-72]
	sturb	w0, [x29, #-172]
	sub	x0, x29, #172
	mov	w1, #1
	bl	_ocd_put_packet
	ldurb	w0, [x29, #-172]
Lloh3:
	adrp	x23, _remote_timeout@GOTPAGE
Lloh4:
	ldr	x23, [x23, _remote_timeout@GOTPAGEOFF]
	ldr	w2, [x23]
	mov	x1, x22
	bl	_ocd_get_packet
	mov	x19, x0
	ldr	w8, [x22]
	cmp	w8, #2
	b.gt	LBB0_2
; %bb.1:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_error
LBB0_2:
	ldrb	w24, [x19, #1]
	ldrb	w22, [x19, #2]
	cbz	w22, LBB0_4
; %bb.3:
Lloh7:
	adrp	x1, l_.str.1@PAGE
Lloh8:
	add	x1, x1, l_.str.1@PAGEOFF
	add	x0, sp, #112
	mov	x2, x21
	bl	_sprintf
	add	x0, sp, #112
	mov	x1, x22
	bl	_ocd_error
LBB0_4:
Lloh9:
	adrp	x8, _OCD_FLAG_PWF@GOTPAGE
Lloh10:
	ldr	x8, [x8, _OCD_FLAG_PWF@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	tst	w8, w24
	b.eq	LBB0_6
; %bb.5:
Lloh12:
	adrp	x0, l_.str.2@PAGE
Lloh13:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_8
LBB0_6:
Lloh14:
	adrp	x8, _OCD_FLAG_CABLE_DISC@GOTPAGE
Lloh15:
	ldr	x8, [x8, _OCD_FLAG_CABLE_DISC@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	tst	w8, w24
	b.eq	LBB0_9
; %bb.7:
Lloh17:
	adrp	x0, l_.str.3@PAGE
Lloh18:
	add	x0, x0, l_.str.3@PAGEOFF
LBB0_8:
	bl	_error
LBB0_9:
	str	w24, [x20]
Lloh19:
	adrp	x20, _OCD_LOG_FILE@GOTPAGE
Lloh20:
	ldr	x20, [x20, _OCD_LOG_FILE@GOTPAGEOFF]
	ldrb	w8, [x20]
	strb	w8, [sp, #12]
	mov	w8, #3
	strb	w8, [sp, #13]
	mov	w21, #2
	add	x0, sp, #12
	mov	w1, #2
	bl	_ocd_put_packet
	ldrb	w0, [sp, #12]
	ldr	w2, [x23]
	add	x1, sp, #8
	bl	_ocd_get_packet
	ldrb	w8, [x20]
	strb	w8, [sp, #12]
	strb	w21, [sp, #13]
	add	x0, sp, #12
	mov	w1, #2
	bl	_ocd_put_packet
	ldrb	w0, [sp, #12]
	ldr	w2, [x23]
	add	x1, sp, #8
	bl	_ocd_get_packet
	ldur	x8, [x29, #-72]
Lloh21:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh22:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_11
; %bb.10:
	add	x0, x19, #3
	ldp	x29, x30, [sp, #384]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #368]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #352]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #336]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #320]            ; 16-byte Folded Reload
	add	sp, sp, #400
	ret
LBB0_11:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.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_do_command (0x%x):"

	.comm	_OCD_FLAG_PWF,4,2               ; @OCD_FLAG_PWF
l_.str.2:                               ; @.str.2
	.asciz	"OCD device can't detect VCC at BDM interface."

	.comm	_OCD_FLAG_CABLE_DISC,4,2        ; @OCD_FLAG_CABLE_DISC
l_.str.3:                               ; @.str.3
	.asciz	"BDM cable appears to be disconnected."

	.comm	_OCD_LOG_FILE,1,0               ; @OCD_LOG_FILE
	.no_dead_strip	_ocd_do_command
.subsections_via_symbols
