	.file	"extr_remote.c_remote_rcmd.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	""
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC1:
	.string	"remote rcmd is only available after target open"
	.section	.rodata.str1.1
.LC2:
	.string	"qRcmd,"
	.section	.rodata.str1.8
	.align 8
.LC3:
	.string	"\"monitor\" command ``%s'' is too long\n"
	.align 8
.LC4:
	.string	"Communication problem with target\n"
	.align 8
.LC5:
	.string	"Target does not support this command\n"
	.section	.rodata.str1.1
.LC6:
	.string	"OK"
.LC7:
	.string	"Protocol error with Rcmd"
	.text
	.p2align 4
	.type	remote_rcmd, @function
remote_rcmd:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r15
	push	r14
	push	r13
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	mov	r13, rsi
	push	r12
	.cfi_offset 12, -48
	mov	r12, rdi
	push	rbx
	sub	rsp, 40
	.cfi_offset 3, -56
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	call	get_remote_state@PLT
	mov	edi, DWORD PTR [rax]
	mov	r14, rax
	call	alloca@PLT
	mov	rbx, rax
	mov	eax, DWORD PTR remote_desc[rip]
	test	eax, eax
	je	.L27
.L2:
	test	r12, r12
	lea	rax, .LC0[rip]
	lea	rsi, .LC2[rip]
	mov	rdi, rbx
	cmove	r12, rax
	call	strcpy@PLT
	xor	esi, esi
	mov	rdi, rbx
	call	strchr@PLT
	mov	rdi, rbx
	mov	r15, rax
	call	strlen@PLT
	mov	rdi, r12
	mov	DWORD PTR -68[rbp], eax
	call	strlen@PLT
	mov	edx, DWORD PTR -68[rbp]
	lea	eax, 7[rdx+rax*2]
	cmp	eax, DWORD PTR [r14]
	jge	.L28
.L4:
	xor	edx, edx
	mov	rdi, r12
	mov	rsi, r15
	call	bin2hex@PLT
	mov	rdi, rbx
	call	putpkt@PLT
	test	rax, rax
	js	.L29
.L5:
	lea	r12, 1[rbx]
.L8:
	mov	BYTE PTR [rbx], 0
	mov	esi, DWORD PTR [r14]
	xor	edx, edx
	mov	rdi, rbx
	call	getpkt@PLT
	movzx	eax, BYTE PTR [rbx]
	test	al, al
	je	.L30
.L6:
	cmp	al, 79
	jne	.L7
	cmp	BYTE PTR 1[rbx], 75
	jne	.L31
.L7:
	lea	rsi, .LC6[rip]
	mov	rdi, rbx
	call	strcmp@PLT
	test	rax, rax
	jne	.L32
.L1:
	mov	rax, QWORD PTR -56[rbp]
	xor	rax, QWORD PTR fs:40
	jne	.L33
	lea	rsp, -40[rbp]
	pop	rbx
	pop	r12
	pop	r13
	pop	r14
	pop	r15
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L30:
	.cfi_restore_state
	lea	rdi, .LC5[rip]
	call	error@PLT
	movzx	eax, BYTE PTR [rbx]
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L31:
	mov	rdi, r12
	call	remote_console_output@PLT
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L32:
	mov	rdi, rbx
	call	strlen@PLT
	movsx	edi, BYTE PTR [rbx]
	cmp	eax, 3
	jne	.L24
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L34:
	cmp	BYTE PTR 1[rbx], 0
	je	.L1
	call	fromhex@PLT
	movsx	edi, BYTE PTR 1[rbx]
	add	rbx, 2
	mov	r12d, eax
	call	fromhex@PLT
	sal	r12d, 4
	mov	rsi, r13
	add	r12d, eax
	movsx	edi, r12b
	call	fputc_unfiltered@PLT
.L25:
	movsx	edi, BYTE PTR [rbx]
.L24:
	test	dil, dil
	jne	.L34
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L28:
	mov	rsi, r12
	lea	rdi, .LC3[rip]
	xor	eax, eax
	call	error@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L27:
	lea	rdi, .LC1[rip]
	xor	eax, eax
	call	error@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L29:
	lea	rdi, .LC4[rip]
	xor	eax, eax
	call	error@PLT
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L10:
	cmp	dil, 69
	jne	.L24
	movsx	edi, BYTE PTR 1[rbx]
	call	isdigit@PLT
	test	rax, rax
	je	.L25
	movsx	edi, BYTE PTR 2[rbx]
	call	isdigit@PLT
	test	rax, rax
	je	.L25
	lea	rdi, .LC7[rip]
	xor	eax, eax
	call	error@PLT
	jmp	.L25
.L33:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	remote_rcmd, .-remote_rcmd
	.comm	remote_desc,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_remote.c_remote_rcmd.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"\000"
	.align	2
.LC1:
	.ascii	"remote rcmd is only available after target open\000"
	.align	2
.LC2:
	.ascii	"qRcmd,\000"
	.align	2
.LC3:
	.ascii	"\"monitor\" command ``%s'' is too long\012\000"
	.align	2
.LC4:
	.ascii	"Communication problem with target\012\000"
	.align	2
.LC5:
	.ascii	"Target does not support this command\012\000"
	.align	2
.LC6:
	.ascii	"Protocol error with Rcmd\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC7:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	remote_rcmd, %function
remote_rcmd:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	add	fp, sp, #32
	sub	sp, sp, #12
	ldr	r3, .L42
	mov	r5, r0
	ldr	r3, [r3]
	str	r3, [fp, #-40]
	mov	r3,#0
	mov	r6, r1
	bl	get_remote_state
	ldr	r2, .L42+4
	ldr	r3, [r0]
	ldr	r2, [r2]
	add	r3, r3, #7
	bic	r3, r3, #7
	sub	sp, sp, r3
	cmp	r2, #0
	mov	r8, r0
	mov	r4, sp
	beq	.L36
.L2:
	ldr	r3, .L42+8
	ldr	r2, .L42+12
	ldm	r3, {r0, r1}
	lsr	r3, r1, #16
	strh	r1, [r4, #4]	@ movhi
	mov	r1, #0
	str	r0, [r4]
	cmp	r5, r1
	mov	r0, r4
	moveq	r5, r2
	strb	r3, [r4, #6]
	bl	strchr
	mov	r9, r0
	mov	r0, r4
	bl	strlen
	mov	r7, r0
	mov	r0, r5
	bl	strlen
	ldr	r3, [r8]
	add	r7, r7, r0, lsl #1
	add	r7, r7, #7
	cmp	r7, r3
	bge	.L37
.L4:
	mov	r1, r9
	mov	r2, #0
	mov	r0, r5
	bl	bin2hex
	mov	r0, r4
	bl	putpkt
	cmp	r0, #0
	blt	.L38
.L5:
	mov	r7, #0
	ldr	r9, .L42+16
	add	r10, r4, #1
.L9:
	strb	r7, [r4]
	mov	r2, #0
	mov	r0, r4
	ldr	r1, [r8]
	bl	getpkt
	ldrb	r5, [r4]	@ zero_extendqisi2
	cmp	r5, #0
	beq	.L39
.L6:
	cmp	r5, #79
	bne	.L7
	ldrb	r3, [r4, #1]	@ zero_extendqisi2
	cmp	r3, #75
	bne	.L40
	ldrb	r3, [r4]	@ zero_extendqisi2
	cmp	r3, #79
	bne	.L16
	ldrb	r3, [r4, #2]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L16
.L1:
	ldr	r3, .L42
	ldr	r2, [r3]
	ldr	r3, [fp, #-40]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L41
	sub	sp, fp, #32
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L17:
	mov	r0, r5
	bl	fromhex
	mov	r5, r0
	ldrb	r0, [r4, #1]	@ zero_extendqisi2
	bl	fromhex
	add	r0, r0, r5, lsl #4
	mov	r1, r6
	and	r0, r0, #255
	bl	fputc_unfiltered
	ldrb	r5, [r4, #2]!	@ zero_extendqisi2
	cmp	r5, #0
	beq	.L1
.L16:
	ldrb	r3, [r4, #1]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L17
	b	.L1
.L39:
	mov	r0, r9
	bl	error
	ldrb	r5, [r4]	@ zero_extendqisi2
	b	.L6
.L40:
	mov	r0, r10
	bl	remote_console_output
	b	.L9
.L37:
	mov	r1, r5
	ldr	r0, .L42+20
	bl	error
	b	.L4
.L36:
	ldr	r0, .L42+24
	bl	error
	b	.L2
.L38:
	ldr	r0, .L42+28
	bl	error
	b	.L5
.L7:
	ldrb	r3, [r4]	@ zero_extendqisi2
	cmp	r3, #79
	bne	.L11
	ldrb	r3, [r4, #1]	@ zero_extendqisi2
	cmp	r3, #75
	bne	.L11
	ldrb	r3, [r4, #2]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L1
.L11:
	mov	r0, r4
	bl	strlen
	cmp	r5, #69
	cmpeq	r0, #3
	bne	.L12
	ldrb	r0, [r4, #1]	@ zero_extendqisi2
	bl	isdigit
	cmp	r0, #0
	bne	.L13
.L34:
	ldrb	r5, [r4]	@ zero_extendqisi2
.L12:
	cmp	r5, #0
	beq	.L1
	b	.L16
.L13:
	ldrb	r0, [r4, #2]	@ zero_extendqisi2
	bl	isdigit
	cmp	r0, #0
	beq	.L34
	ldr	r0, .L42+32
	bl	error
	b	.L34
.L41:
	bl	__stack_chk_fail
.L43:
	.align	2
.L42:
	.word	.LC7
	.word	remote_desc
	.word	.LC2
	.word	.LC0
	.word	.LC5
	.word	.LC3
	.word	.LC1
	.word	.LC4
	.word	.LC6
	.size	remote_rcmd, .-remote_rcmd
	.comm	remote_desc,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
