	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_serial_update_buffers          ## -- Begin function serial_update_buffers
	.p2align	4, 0x90
_serial_update_buffers:                 ## @serial_update_buffers
	.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
	xorl	%eax, %eax
	callq	_cli
	xorl	%eax, %eax
	callq	_serial_output
	xorl	%eax, %eax
	callq	_serial_low
	movl	$1, %r14d
	movl	$1, %edi
	callq	__delay_us
	xorl	%eax, %eax
	callq	_serial_input
	xorl	%eax, %eax
	callq	_serial_high
	movq	_SERIAL_DELAY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	__delay_us
	xorl	%eax, %eax
	callq	_serial_read_pin
	testq	%rax, %rax
	jne	LBB0_8
## %bb.1:
	xorl	%r13d, %r13d
	xorl	%eax, %eax
	callq	_sync_recv
	movq	_SERIAL_SLAVE_BUFFER_LENGTH@GOTPCREL(%rip), %r15
	cmpl	$0, (%r15)
	jle	LBB0_4
## %bb.2:
	movq	_serial_slave_buffer@GOTPCREL(%rip), %r12
	xorl	%ebx, %ebx
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	xorl	%eax, %eax
	callq	_serial_read_byte
	movq	(%r12), %rcx
	movq	%rax, (%rcx,%rbx,8)
	xorl	%eax, %eax
	callq	_sync_recv
	movq	(%r12), %rax
	addq	(%rax,%rbx,8), %r13
	incq	%rbx
	movslq	(%r15), %rax
	cmpq	%rax, %rbx
	jl	LBB0_3
LBB0_4:
	xorl	%eax, %eax
	callq	_serial_read_byte
	movq	%rax, %r15
	xorl	%eax, %eax
	callq	_sync_recv
	cmpq	%r15, %r13
	jne	LBB0_8
## %bb.5:
	movq	_SERIAL_MASTER_BUFFER_LENGTH@GOTPCREL(%rip), %r15
	xorl	%r14d, %r14d
	cmpl	$0, (%r15)
	jle	LBB0_6
## %bb.9:
	movq	_serial_master_buffer@GOTPCREL(%rip), %r12
	movq	(%r12), %rax
	xorl	%ebx, %ebx
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	(%rax,%rbx,8), %rdi
	callq	_serial_write_byte
	xorl	%eax, %eax
	callq	_sync_recv
	movq	(%r12), %rax
	addq	(%rax,%rbx,8), %r13
	incq	%rbx
	movslq	(%r15), %rcx
	cmpq	%rcx, %rbx
	jl	LBB0_10
	jmp	LBB0_7
LBB0_6:
	xorl	%r13d, %r13d
LBB0_7:
	movq	%r13, %rdi
	callq	_serial_write_byte
	xorl	%eax, %eax
	callq	_sync_recv
	xorl	%eax, %eax
	callq	_serial_output
	xorl	%eax, %eax
	callq	_serial_high
LBB0_8:
	xorl	%eax, %eax
	callq	_sei
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SERIAL_DELAY,4,2               ## @SERIAL_DELAY
	.comm	_SERIAL_SLAVE_BUFFER_LENGTH,4,2 ## @SERIAL_SLAVE_BUFFER_LENGTH
	.comm	_serial_slave_buffer,8,3        ## @serial_slave_buffer
	.comm	_SERIAL_MASTER_BUFFER_LENGTH,4,2 ## @SERIAL_MASTER_BUFFER_LENGTH
	.comm	_serial_master_buffer,8,3       ## @serial_master_buffer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_serial_update_buffers          ; -- Begin function serial_update_buffers
	.p2align	2
_serial_update_buffers:                 ; @serial_update_buffers
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	bl	_cli
	bl	_serial_output
	bl	_serial_low
	mov	w19, #1
	mov	w0, #1
	bl	__delay_us
	bl	_serial_input
	bl	_serial_high
Lloh0:
	adrp	x8, _SERIAL_DELAY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SERIAL_DELAY@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	__delay_us
	bl	_serial_read_pin
	cbnz	x0, LBB0_12
; %bb.1:
	bl	_sync_recv
Lloh3:
	adrp	x19, _SERIAL_SLAVE_BUFFER_LENGTH@GOTPAGE
Lloh4:
	ldr	x19, [x19, _SERIAL_SLAVE_BUFFER_LENGTH@GOTPAGEOFF]
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.2:
	mov	x21, #0
	mov	x20, #0
Lloh5:
	adrp	x22, _serial_slave_buffer@GOTPAGE
Lloh6:
	ldr	x22, [x22, _serial_slave_buffer@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	bl	_serial_read_byte
	ldr	x8, [x22]
	lsl	x23, x21, #3
	str	x0, [x8, x23]
	bl	_sync_recv
	ldr	x8, [x22]
	ldr	x8, [x8, x23]
	add	x20, x8, x20
	add	x21, x21, #1
	ldrsw	x8, [x19]
	cmp	x21, x8
	b.lt	LBB0_3
	b	LBB0_5
LBB0_4:
	mov	x20, #0
LBB0_5:
	bl	_serial_read_byte
	mov	x19, x0
	bl	_sync_recv
	cmp	x20, x19
	b.ne	LBB0_9
; %bb.6:
Lloh7:
	adrp	x20, _SERIAL_MASTER_BUFFER_LENGTH@GOTPAGE
Lloh8:
	ldr	x20, [x20, _SERIAL_MASTER_BUFFER_LENGTH@GOTPAGEOFF]
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_10
; %bb.7:
	mov	x21, #0
	mov	x19, #0
Lloh9:
	adrp	x22, _serial_master_buffer@GOTPAGE
Lloh10:
	ldr	x22, [x22, _serial_master_buffer@GOTPAGEOFF]
	ldr	x8, [x22]
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	lsl	x23, x21, #3
	ldr	x0, [x8, x23]
	bl	_serial_write_byte
	bl	_sync_recv
	ldr	x8, [x22]
	ldr	x9, [x8, x23]
	add	x19, x9, x19
	add	x21, x21, #1
	ldrsw	x9, [x20]
	cmp	x21, x9
	b.lt	LBB0_8
	b	LBB0_11
LBB0_9:
	mov	w19, #1
	b	LBB0_12
LBB0_10:
	mov	x19, #0
LBB0_11:
	mov	x0, x19
	bl	_serial_write_byte
	bl	_sync_recv
	bl	_serial_output
	bl	_serial_high
	mov	w19, #0
LBB0_12:
	bl	_sei
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_SERIAL_DELAY,4,2               ; @SERIAL_DELAY
	.comm	_SERIAL_SLAVE_BUFFER_LENGTH,4,2 ; @SERIAL_SLAVE_BUFFER_LENGTH
	.comm	_serial_slave_buffer,8,3        ; @serial_slave_buffer
	.comm	_SERIAL_MASTER_BUFFER_LENGTH,4,2 ; @SERIAL_MASTER_BUFFER_LENGTH
	.comm	_serial_master_buffer,8,3       ; @serial_master_buffer
.subsections_via_symbols
