	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ocd_write_bdm_registers        ## -- Begin function ocd_write_bdm_registers
	.p2align	4, 0x90
_ocd_write_bdm_registers:               ## @ocd_write_bdm_registers
	.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
	movl	%edx, %r14d
	movq	%rsi, %r15
	movl	%edi, %r13d
	leal	4(%r14), %r12d
	movl	%r12d, %edi
	callq	_alloca
	movq	%rax, %rbx
	movq	_OCD_WRITE_REGS@GOTPCREL(%rip), %rax
	movb	(%rax), %al
	movb	%al, (%rbx)
	movl	%r13d, %eax
	movb	%ah, 1(%rbx)
	movb	%al, 2(%rbx)
	movb	%r14b, 3(%rbx)
	leaq	4(%rbx), %rdi
	movq	%r15, %rsi
	movl	%r14d, %edx
	callq	_memcpy
	movq	%rbx, %rdi
	movl	%r12d, %esi
	callq	_ocd_put_packet
	movq	_OCD_WRITE_REGS@GOTPCREL(%rip), %rax
	movzbl	(%rax), %edi
	movq	_remote_timeout@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-44(%rbp), %rsi
	callq	_ocd_get_packet
	movq	%rax, %rbx
	cmpl	$2, -44(%rbp)
	jg	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_error
LBB0_2:
	movzbl	2(%rbx), %esi
	testl	%esi, %esi
	je	LBB0_4
## %bb.3:
	leaq	L_.str.1(%rip), %rdi
	callq	_ocd_error
LBB0_4:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_OCD_WRITE_REGS,1,0             ## @OCD_WRITE_REGS
	.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_write_bdm_registers:"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ocd_write_bdm_registers        ; -- Begin function ocd_write_bdm_registers
	.p2align	2
_ocd_write_bdm_registers:               ; @ocd_write_bdm_registers
	.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, x2
	mov	x20, x1
	mov	x21, x0
	add	w22, w2, #4
	mov	x0, x22
	bl	_alloca
	mov	x23, x0
Lloh0:
	adrp	x24, _OCD_WRITE_REGS@GOTPAGE
Lloh1:
	ldr	x24, [x24, _OCD_WRITE_REGS@GOTPAGEOFF]
	ldrb	w8, [x24]
	strb	w8, [x0]
	lsr	w8, w21, #8
	strb	w8, [x0, #1]
	strb	w21, [x0, #2]
	strb	w19, [x0, #3]
	add	x0, x0, #4
	mov	x1, x20
	mov	x2, x19
	bl	_memcpy
	mov	x0, x23
	mov	x1, x22
	bl	_ocd_put_packet
	ldrb	w0, [x24]
Lloh2:
	adrp	x8, _remote_timeout@GOTPAGE
Lloh3:
	ldr	x8, [x8, _remote_timeout@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	add	x1, sp, #12
	bl	_ocd_get_packet
	mov	x19, x0
	ldr	w8, [sp, #12]
	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	w1, [x19, #2]
	cbz	w1, LBB0_4
; %bb.3:
Lloh7:
	adrp	x0, l_.str.1@PAGE
Lloh8:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_ocd_error
LBB0_4:
	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	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_OCD_WRITE_REGS,1,0             ; @OCD_WRITE_REGS
	.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_write_bdm_registers:"

.subsections_via_symbols
