	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function remote_rcmd
_remote_rcmd:                           ## @remote_rcmd
	.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, -48(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r13
	xorl	%eax, %eax
	callq	_get_remote_state
	movq	%rax, %r15
	movl	(%rax), %edi
	callq	_alloca
	movq	%rax, %r14
	movq	_remote_desc@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jne	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_error
LBB0_2:
	testq	%r13, %r13
	leaq	L_.str.1(%rip), %r12
	cmovneq	%r13, %r12
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	callq	_strcpy
	movq	%r14, %rdi
	callq	_strlen
	movq	%rax, %r13
	addq	%r14, %r13
	movq	%r14, %rdi
	callq	_strlen
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_strlen
                                        ## kill: def $eax killed $eax def $rax
	leal	(%rbx,%rax,2), %eax
	addl	$8, %eax
	cmpl	(%r15), %eax
	jle	LBB0_4
## %bb.3:
	leaq	L_.str.3(%rip), %rdi
	movq	%r12, %rsi
	xorl	%eax, %eax
	callq	_error
LBB0_4:
	movq	%r12, %rdi
	movq	%r13, %rsi
	xorl	%edx, %edx
	callq	_bin2hex
	movq	%r14, %rdi
	callq	_putpkt
	testq	%rax, %rax
	jns	LBB0_6
## %bb.5:
	leaq	L_.str.4(%rip), %rdi
	xorl	%eax, %eax
	callq	_error
LBB0_6:
	leaq	1(%r14), %r12
	leaq	L_.str.5(%rip), %r13
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movb	$0, (%r14)
	movl	(%r15), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_getpkt
	movzbl	(%r14), %eax
	testb	%al, %al
	jne	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	%r13, %rdi
	xorl	%eax, %eax
	callq	_error
	movzbl	(%r14), %eax
LBB0_9:                                 ##   in Loop: Header=BB0_7 Depth=1
	cmpb	$79, %al
	jne	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_7 Depth=1
	cmpb	$75, (%r12)
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	%r12, %rdi
	callq	_remote_console_output
	jmp	LBB0_7
LBB0_12:
	leaq	L_.str.6(%rip), %rsi
	movq	%r14, %rdi
	callq	_strcmp
	testq	%rax, %rax
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	je	LBB0_23
## %bb.13:
	movq	%r14, %rdi
	callq	_strlen
	cmpl	$3, %eax
	jne	LBB0_18
## %bb.14:
	movb	(%r14), %al
	cmpb	$69, %al
	jne	LBB0_19
## %bb.15:
	movsbl	(%r12), %edi
	callq	_isdigit
	testq	%rax, %rax
	je	LBB0_18
## %bb.16:
	movsbl	2(%r14), %edi
	callq	_isdigit
	testq	%rax, %rax
	je	LBB0_18
## %bb.17:
	leaq	L_.str.7(%rip), %rdi
	xorl	%eax, %eax
	callq	_error
LBB0_18:
	movb	(%r14), %al
LBB0_19:
	testb	%al, %al
	je	LBB0_23
## %bb.20:
	addq	$2, %r14
	.p2align	4, 0x90
LBB0_21:                                ## =>This Inner Loop Header: Depth=1
	cmpb	$0, -1(%r14)
	je	LBB0_23
## %bb.22:                              ##   in Loop: Header=BB0_21 Depth=1
	movsbl	%al, %edi
	callq	_fromhex
	movl	%eax, %ebx
	shll	$4, %ebx
	movsbl	-1(%r14), %edi
	callq	_fromhex
	addl	%ebx, %eax
	movsbl	%al, %edi
	movq	%r15, %rsi
	callq	_fputc_unfiltered
	movzbl	(%r14), %eax
	addq	$2, %r14
	testb	%al, %al
	jne	LBB0_21
LBB0_23:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_remote_desc,4,2                ## @remote_desc
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"remote rcmd is only available after target open"

L_.str.1:                               ## @.str.1
	.space	1

L_.str.2:                               ## @.str.2
	.asciz	"qRcmd,"

L_.str.3:                               ## @.str.3
	.asciz	"\"monitor\" command ``%s'' is too long\n"

L_.str.4:                               ## @.str.4
	.asciz	"Communication problem with target\n"

L_.str.5:                               ## @.str.5
	.asciz	"Target does not support this command\n"

L_.str.6:                               ## @.str.6
	.asciz	"OK"

L_.str.7:                               ## @.str.7
	.asciz	"Protocol error with Rcmd"

	.no_dead_strip	_remote_rcmd
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function remote_rcmd
_remote_rcmd:                           ; @remote_rcmd
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x1
	mov	x22, x0
	bl	_get_remote_state
	mov	x21, x0
	ldr	w0, [x0]
	bl	_alloca
	mov	x20, x0
Lloh0:
	adrp	x8, _remote_desc@GOTPAGE
Lloh1:
	ldr	x8, [x8, _remote_desc@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cbnz	w8, LBB0_2
; %bb.1:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_error
LBB0_2:
Lloh5:
	adrp	x8, l_.str.1@PAGE
Lloh6:
	add	x8, x8, l_.str.1@PAGEOFF
	cmp	x22, #0
	csel	x22, x8, x22, eq
Lloh7:
	adrp	x1, l_.str.2@PAGE
Lloh8:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x20
	bl	_strcpy
	mov	x0, x20
	bl	_strlen
	add	x23, x20, x0
	mov	x0, x20
	bl	_strlen
	mov	x24, x0
	mov	x0, x22
	bl	_strlen
	add	w8, w24, w0, lsl #1
	add	w8, w8, #8
	ldr	w9, [x21]
	cmp	w8, w9
	b.le	LBB0_4
; %bb.3:
	str	x22, [sp]
Lloh9:
	adrp	x0, l_.str.3@PAGE
Lloh10:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_error
LBB0_4:
	mov	x0, x22
	mov	x1, x23
	mov	w2, #0
	bl	_bin2hex
	mov	x0, x20
	bl	_putpkt
	tbz	x0, #63, LBB0_6
; %bb.5:
Lloh11:
	adrp	x0, l_.str.4@PAGE
Lloh12:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_error
LBB0_6:
	add	x22, x20, #1
Lloh13:
	adrp	x23, l_.str.5@PAGE
Lloh14:
	add	x23, x23, l_.str.5@PAGEOFF
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	strb	wzr, [x20]
	ldr	w1, [x21]
	mov	x0, x20
	mov	w2, #0
	bl	_getpkt
	ldrb	w8, [x20]
	cbnz	w8, LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x23
	bl	_error
	ldrb	w8, [x20]
LBB0_9:                                 ;   in Loop: Header=BB0_7 Depth=1
	cmp	w8, #79
	b.ne	LBB0_12
; %bb.10:                               ;   in Loop: Header=BB0_7 Depth=1
	ldrb	w8, [x22]
	cmp	w8, #75
	b.eq	LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x22
	bl	_remote_console_output
	b	LBB0_7
LBB0_12:
Lloh15:
	adrp	x1, l_.str.6@PAGE
Lloh16:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	x0, x20
	bl	_strcmp
	cbz	x0, LBB0_23
; %bb.13:
	mov	x0, x20
	bl	_strlen
	cmp	w0, #3
	b.ne	LBB0_18
; %bb.14:
	ldrb	w8, [x20]
	cmp	w8, #69
	b.ne	LBB0_19
; %bb.15:
	ldrsb	w0, [x22]
	bl	_isdigit
	cbz	x0, LBB0_18
; %bb.16:
	ldrsb	w0, [x20, #2]
	bl	_isdigit
	cbz	x0, LBB0_18
; %bb.17:
Lloh17:
	adrp	x0, l_.str.7@PAGE
Lloh18:
	add	x0, x0, l_.str.7@PAGEOFF
	bl	_error
LBB0_18:
	ldrb	w8, [x20]
LBB0_19:
	cbz	w8, LBB0_23
; %bb.20:
	add	x21, x20, #1
LBB0_21:                                ; =>This Inner Loop Header: Depth=1
	ldrb	w9, [x21]
	cbz	w9, LBB0_23
; %bb.22:                               ;   in Loop: Header=BB0_21 Depth=1
	sxtb	w0, w8
	bl	_fromhex
	mov	x20, x0
	ldrsb	w0, [x21]
	bl	_fromhex
	add	w8, w0, w20, lsl #4
	sxtb	w0, w8
	mov	x1, x19
	bl	_fputc_unfiltered
	ldrb	w8, [x21, #1]
	add	x21, x21, #2
	cbnz	w8, LBB0_21
LBB0_23:
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_remote_desc,4,2                ; @remote_desc
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"remote rcmd is only available after target open"

l_.str.1:                               ; @.str.1
	.space	1

l_.str.2:                               ; @.str.2
	.asciz	"qRcmd,"

l_.str.3:                               ; @.str.3
	.asciz	"\"monitor\" command ``%s'' is too long\n"

l_.str.4:                               ; @.str.4
	.asciz	"Communication problem with target\n"

l_.str.5:                               ; @.str.5
	.asciz	"Target does not support this command\n"

l_.str.6:                               ; @.str.6
	.asciz	"OK"

l_.str.7:                               ; @.str.7
	.asciz	"Protocol error with Rcmd"

	.no_dead_strip	_remote_rcmd
.subsections_via_symbols
