	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dynamic_macro_save_eeprom      ## -- Begin function dynamic_macro_save_eeprom
	.p2align	4, 0x90
_dynamic_macro_save_eeprom:             ## @dynamic_macro_save_eeprom
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	xorl	%eax, %eax
	callq	_dynamic_macro_header_correct
	testl	%eax, %eax
	jne	LBB0_2
## %bb.1:
	movq	_DYNAMIC_MACRO_EEPROM_MAGIC_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_DYNAMIC_MACRO_EEPROM_MAGIC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_eeprom_write_word
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_dprintf
LBB0_2:
	movq	_dynamic_macros@GOTPCREL(%rip), %rax
	leaq	(,%r14,4), %rbx
	addq	(%rax), %rbx
	movq	%r14, %rdi
	callq	_dynamic_macro_eeprom_macro_addr
	movq	%rbx, %rdi
	movl	%eax, %esi
	movl	$4, %edx
	callq	_eeprom_update_block
	leaq	L_.str.1(%rip), %rdi
	movq	%r14, %rsi
	xorl	%eax, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_dprintf                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_DYNAMIC_MACRO_EEPROM_MAGIC_ADDR,4,2 ## @DYNAMIC_MACRO_EEPROM_MAGIC_ADDR
	.comm	_DYNAMIC_MACRO_EEPROM_MAGIC,4,2 ## @DYNAMIC_MACRO_EEPROM_MAGIC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"dynamic macro: writing magic eeprom header\n"

	.comm	_dynamic_macros,8,3             ## @dynamic_macros
L_.str.1:                               ## @.str.1
	.asciz	"dynamic macro: slot %d saved to eeprom\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dynamic_macro_save_eeprom      ; -- Begin function dynamic_macro_save_eeprom
	.p2align	2
_dynamic_macro_save_eeprom:             ; @dynamic_macro_save_eeprom
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	bl	_dynamic_macro_header_correct
	cbnz	w0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _DYNAMIC_MACRO_EEPROM_MAGIC_ADDR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DYNAMIC_MACRO_EEPROM_MAGIC_ADDR@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x8, _DYNAMIC_MACRO_EEPROM_MAGIC@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DYNAMIC_MACRO_EEPROM_MAGIC@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_eeprom_write_word
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_dprintf
LBB0_2:
Lloh8:
	adrp	x8, _dynamic_macros@GOTPAGE
Lloh9:
	ldr	x8, [x8, _dynamic_macros@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	add	x20, x8, x19, lsl #2
	mov	x0, x19
	bl	_dynamic_macro_eeprom_macro_addr
	mov	x1, x0
	mov	x0, x20
	mov	w2, #4
	bl	_eeprom_update_block
	str	x19, [sp]
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_dprintf
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_DYNAMIC_MACRO_EEPROM_MAGIC_ADDR,4,2 ; @DYNAMIC_MACRO_EEPROM_MAGIC_ADDR
	.comm	_DYNAMIC_MACRO_EEPROM_MAGIC,4,2 ; @DYNAMIC_MACRO_EEPROM_MAGIC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"dynamic macro: writing magic eeprom header\n"

	.comm	_dynamic_macros,8,3             ; @dynamic_macros
l_.str.1:                               ; @.str.1
	.asciz	"dynamic macro: slot %d saved to eeprom\n"

.subsections_via_symbols
