	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ocd_read_bdm_registers         ## -- Begin function ocd_read_bdm_registers
	.p2align	4, 0x90
_ocd_read_bdm_registers:                ## @ocd_read_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	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movl	%esi, %eax
	movl	%edi, %ecx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movq	%rdx, -32(%rbp)
	movq	_OCD_READ_REGS@GOTPCREL(%rip), %rbx
	movb	(%rbx), %dl
	movb	%dl, -42(%rbp)
	movb	%ch, -41(%rbp)
	movb	%cl, -40(%rbp)
	movb	%ah, -39(%rbp)
	movb	%al, -38(%rbp)
	leaq	-42(%rbp), %rdi
	movl	$5, %esi
	callq	_ocd_put_packet
	movzbl	(%rbx), %edi
	movq	_remote_timeout@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-48(%rbp), %rsi
	callq	_ocd_get_packet
	movq	%rax, %r15
	movzbl	2(%rax), %esi
	testl	%esi, %esi
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_ocd_error
LBB0_2:
	movzbl	3(%r15), %eax
	testl	%eax, %eax
	movl	$256, %ebx                      ## imm = 0x100
	cmovnel	%eax, %ebx
	movl	-48(%rbp), %eax
	addl	$-4, %eax
	cmpl	%eax, %ebx
	jg	LBB0_4
## %bb.3:
	movl	%ebx, %eax
	andl	$3, %eax
	je	LBB0_5
LBB0_4:
	leaq	L_.str.1(%rip), %rdi
	movl	%ebx, %esi
	callq	_error
LBB0_5:
	movl	%ebx, (%r14)
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-32(%rbp), %rax
	jne	LBB0_7
## %bb.6:
	addq	$4, %r15
	movq	%r15, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_OCD_READ_REGS,1,0              ## @OCD_READ_REGS
	.comm	_remote_timeout,4,2             ## @remote_timeout
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"read_bdm_registers:"

L_.str.1:                               ## @.str.1
	.asciz	"Register block size bad:  %d"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ocd_read_bdm_registers         ; -- Begin function ocd_read_bdm_registers
	.p2align	2
_ocd_read_bdm_registers:                ; @ocd_read_bdm_registers
	.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
	mov	x19, x2
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
Lloh3:
	adrp	x20, _OCD_READ_REGS@GOTPAGE
Lloh4:
	ldr	x20, [x20, _OCD_READ_REGS@GOTPAGEOFF]
	ldrb	w8, [x20]
	strb	w8, [sp, #14]
	lsr	w8, w0, #8
	strb	w8, [sp, #15]
	strb	w0, [sp, #16]
	lsr	w8, w1, #8
	strb	w8, [sp, #17]
	strb	w1, [sp, #18]
	add	x0, sp, #14
	mov	w1, #5
	bl	_ocd_put_packet
	ldrb	w0, [x20]
Lloh5:
	adrp	x8, _remote_timeout@GOTPAGE
Lloh6:
	ldr	x8, [x8, _remote_timeout@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	add	x1, sp, #8
	bl	_ocd_get_packet
	mov	x20, x0
	ldrb	w1, [x0, #2]
	cbz	w1, LBB0_2
; %bb.1:
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	bl	_ocd_error
LBB0_2:
	ldrb	w8, [x20, #3]
	mov	w9, #256
	cmp	w8, #0
	csel	w21, w9, w8, eq
	ldr	w8, [sp, #8]
	sub	w8, w8, #4
	and	w9, w21, #0x3
	cmp	w21, w8
	ccmp	w9, #0, #0, le
	b.eq	LBB0_4
; %bb.3:
Lloh10:
	adrp	x0, l_.str.1@PAGE
Lloh11:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x21
	bl	_error
LBB0_4:
	str	w21, [x19]
	ldr	x8, [sp, #24]
Lloh12:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh13:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_6
; %bb.5:
	add	x0, x20, #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
	add	sp, sp, #80
	ret
LBB0_6:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_OCD_READ_REGS,1,0              ; @OCD_READ_REGS
	.comm	_remote_timeout,4,2             ; @remote_timeout
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"read_bdm_registers:"

l_.str.1:                               ; @.str.1
	.asciz	"Register block size bad:  %d"

.subsections_via_symbols
