	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ocd_write_bytes                ## -- Begin function ocd_write_bytes
	.p2align	4, 0x90
_ocd_write_bytes:                       ## @ocd_write_bytes
	.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	$296, %rsp                      ## imm = 0x128
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_write_mem_command@GOTPCREL(%rip), %rax
	movb	(%rax), %al
	movb	%al, -320(%rbp)
	movw	$1, -315(%rbp)
	movl	%edx, %r14d
	movl	%edx, -324(%rbp)                ## 4-byte Spill
	testl	%edx, %edx
	jle	LBB0_9
## %bb.1:
	movq	%rsi, %r15
	movl	%edi, %ebx
	movl	-324(%rbp), %r14d               ## 4-byte Reload
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	leaq	L_.str.1(%rip), %rdi
	callq	_ocd_error
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	addl	%r12d, %ebx
	movslq	%r12d, %rax
	addq	%rax, %r15
	subl	%r12d, %r14d
	jle	LBB0_9
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r14d, %edi
	movl	$248, %esi
	callq	_min
	movl	%eax, %r12d
	movl	%ebx, %eax
	shrl	$24, %eax
	movb	%al, -319(%rbp)
	movl	%ebx, %eax
	shrl	$16, %eax
	movb	%al, -318(%rbp)
	movb	%bh, -317(%rbp)
	movb	%bl, -316(%rbp)
	movb	%r12b, -313(%rbp)
	leaq	-312(%rbp), %rdi
	movq	%r15, %rsi
	movl	%r12d, %edx
	callq	_memcpy
	leal	8(%r12), %esi
	leaq	-320(%rbp), %rdi
	callq	_ocd_put_packet
	movq	_OCD_WRITE_MEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_remote_timeout@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-328(%rbp), %rsi
	callq	_ocd_get_packet
	movq	%rax, %r13
	cmpl	$2, -328(%rbp)
	jg	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	leaq	L_.str(%rip), %rdi
	callq	_error
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	movzbl	2(%r13), %esi
	testl	%esi, %esi
	je	LBB0_8
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpb	$17, %sil
	jne	LBB0_7
## %bb.6:
	movl	3(%r13), %eax
	bswapl	%eax
	movq	_EIO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	_errno@GOTPCREL(%rip), %rdx
	movl	%ecx, (%rdx)
	addl	%r14d, %ebx
	subl	%eax, %ebx
	movl	%ebx, %r14d
LBB0_9:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_11
## %bb.10:
	movl	-324(%rbp), %eax                ## 4-byte Reload
	subl	%r14d, %eax
	addq	$296, %rsp                      ## imm = 0x128
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_write_mem_command,1,0          ## @write_mem_command
	.comm	_OCD_WRITE_MEM,4,2              ## @OCD_WRITE_MEM
	.comm	_remote_timeout,4,2             ## @remote_timeout
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Truncated response packet from OCD device"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_errno,4,2                      ## @errno
L_.str.1:                               ## @.str.1
	.asciz	"ocd_write_bytes:"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ocd_write_bytes                ; -- Begin function ocd_write_bytes
	.p2align	2
_ocd_write_bytes:                       ; @ocd_write_bytes
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #400
	.cfi_def_cfa_offset 400
	stp	x28, x27, [sp, #304]            ; 16-byte Folded Spill
	stp	x26, x25, [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 w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-96]
Lloh3:
	adrp	x8, _write_mem_command@GOTPAGE
Lloh4:
	ldr	x8, [x8, _write_mem_command@GOTPAGEOFF]
	ldrb	w8, [x8]
	strb	w8, [sp, #22]
	mov	w8, #1
	sturh	w8, [sp, #27]
	mov	x22, x2
	str	w2, [sp, #12]                   ; 4-byte Folded Spill
	cmp	w2, #1
	b.lt	LBB0_9
; %bb.1:
	mov	x21, x1
	mov	x20, x0
	add	x8, sp, #22
Lloh5:
	adrp	x28, _OCD_WRITE_MEM@GOTPAGE
Lloh6:
	ldr	x28, [x28, _OCD_WRITE_MEM@GOTPAGEOFF]
Lloh7:
	adrp	x19, _remote_timeout@GOTPAGE
Lloh8:
	ldr	x19, [x19, _remote_timeout@GOTPAGEOFF]
	add	x23, x8, #8
Lloh9:
	adrp	x24, l_.str@PAGE
Lloh10:
	add	x24, x24, l_.str@PAGEOFF
	ldr	w22, [sp, #12]                  ; 4-byte Folded Reload
Lloh11:
	adrp	x25, l_.str.1@PAGE
Lloh12:
	add	x25, x25, l_.str.1@PAGEOFF
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x25
	bl	_ocd_error
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	w20, w26, w20
	add	x21, x21, w26, sxtw
	sub	w22, w22, w26
	cmp	w22, #0
	b.le	LBB0_9
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	mov	w1, #248
	bl	_min
	mov	x26, x0
	lsr	w8, w20, #24
	strb	w8, [sp, #23]
	lsr	w8, w20, #16
	strb	w8, [sp, #24]
	lsr	w8, w20, #8
	strb	w8, [sp, #25]
	strb	w20, [sp, #26]
	strb	w0, [sp, #29]
	mov	x0, x23
	mov	x1, x21
	mov	x2, x26
	bl	_memcpy
	add	w1, w26, #8
	add	x0, sp, #22
	bl	_ocd_put_packet
	ldr	w0, [x28]
	ldr	w2, [x19]
	add	x1, sp, #16
	bl	_ocd_get_packet
	mov	x27, x0
	ldr	w8, [sp, #16]
	cmp	w8, #2
	b.gt	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x24
	bl	_error
LBB0_6:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldrb	w1, [x27, #2]
	cbz	w1, LBB0_3
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	w1, #17
	b.ne	LBB0_2
; %bb.8:
	ldur	w8, [x27, #3]
	rev	w8, w8
Lloh13:
	adrp	x9, _EIO@GOTPAGE
Lloh14:
	ldr	x9, [x9, _EIO@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
Lloh16:
	adrp	x10, _errno@GOTPAGE
Lloh17:
	ldr	x10, [x10, _errno@GOTPAGEOFF]
Lloh18:
	str	w9, [x10]
	add	w9, w20, w22
	sub	w22, w9, w8
LBB0_9:
	ldur	x8, [x29, #-96]
Lloh19:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh20:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh21:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_11
; %bb.10:
	ldr	w8, [sp, #12]                   ; 4-byte Folded Reload
	sub	w0, w8, w22
	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	x26, x25, [sp, #320]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #304]            ; 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	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotStr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_write_mem_command,1,0          ; @write_mem_command
	.comm	_OCD_WRITE_MEM,4,2              ; @OCD_WRITE_MEM
	.comm	_remote_timeout,4,2             ; @remote_timeout
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Truncated response packet from OCD device"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_errno,4,2                      ; @errno
l_.str.1:                               ; @.str.1
	.asciz	"ocd_write_bytes:"

.subsections_via_symbols
