	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function restore_section_callback
_restore_section_callback:              ## @restore_section_callback
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r12
	movq	%rsi, %r15
	movq	%rdi, %r13
	callq	_bfd_section_vma
	movq	%rax, %rbx
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_bfd_section_size
	movq	%rax, %r14
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_bfd_get_section_flags
	movq	_SEC_LOAD@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_14
## %bb.1:
	leaq	(%r14,%rbx), %rsi
	movq	(%r12), %rdx
	cmpq	%rdx, %rsi
	jle	LBB0_15
## %bb.2:
	movq	8(%r12), %rax
	testq	%rax, %rax
	jle	LBB0_4
## %bb.3:
	cmpq	%rax, %rbx
	jl	LBB0_4
LBB0_15:
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_bfd_section_name
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_printf_filtered                ## TAILCALL
LBB0_14:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	%r12, -88(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	xorl	%ecx, %ecx
	subq	%rbx, %rdx
	cmovleq	%rcx, %rdx
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	subq	%rdx, %r14
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movq	%rax, %rbx
	subq	%rsi, %rbx
	cmovgeq	%rcx, %rbx
	testq	%rax, %rax
	cmovleq	%rcx, %rbx
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	callq	_xmalloc
	movq	%rax, %r12
	movq	_xfree@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r12, %rsi
	callq	_make_cleanup
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	movq	%r13, %rdi
	movq	%r15, %rsi
	movq	%r12, -80(%rbp)                 ## 8-byte Spill
	movq	%r12, %rdx
	xorl	%ecx, %ecx
	movq	-56(%rbp), %r8                  ## 8-byte Reload
	callq	_bfd_get_section_contents
	testl	%eax, %eax
	jne	LBB0_6
## %bb.5:
	movq	%r13, %rdi
	callq	_bfd_get_filename
	movl	%eax, %r12d
	xorl	%eax, %eax
	callq	_bfd_get_error
	movl	%eax, %edi
	callq	_bfd_errmsg
	leaq	L_.str.1(%rip), %rdi
	movl	%r12d, %esi
	movq	%rax, %rdx
	callq	_error
LBB0_6:
	addq	%r14, %rbx
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_bfd_section_name
	leaq	L_.str.2(%rip), %rdi
	movl	%eax, %esi
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	movq	%rdx, %r14
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_printf_filtered
	movq	-88(%rbp), %r12                 ## 8-byte Reload
	movq	16(%r12), %rdi
	testq	%rdi, %rdi
	jne	LBB0_9
## %bb.7:
	cmpq	$0, (%r12)
	jne	LBB0_9
## %bb.8:
	cmpq	$0, 8(%r12)
	je	LBB0_10
LBB0_9:
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	addq	%r13, %r14
	addq	%r14, %rdi
	movq	%r12, %r15
	callq	_paddr_nz
	movl	%eax, %r12d
	leaq	(%rbx,%r14), %rdi
	addq	16(%r15), %rdi
	callq	_paddr_nz
	leaq	L_.str.3(%rip), %rdi
	movl	%r12d, %esi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_printf_filtered
	movq	%r13, %rax
LBB0_11:
	addq	16(%r15), %r14
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
	addq	%rax, %rsi
	movq	%r14, %rdi
	movq	%rbx, %rdx
	callq	_target_write_memory
	testl	%eax, %eax
	je	LBB0_13
## %bb.12:
	movl	%eax, %edi
	callq	_safe_strerror
	leaq	L_.str.5(%rip), %rdi
	movl	%eax, %esi
	callq	_warning
LBB0_13:
	movq	-96(%rbp), %rdi                 ## 8-byte Reload
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_do_cleanups                    ## TAILCALL
LBB0_10:
	leaq	L_.str.4(%rip), %rdi
	movq	%r12, %r15
	callq	_puts_filtered
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	addq	%rax, %r14
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_SEC_LOAD,4,2                   ## @SEC_LOAD
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"skipping section %s...\n"

	.comm	_xfree,4,2                      ## @xfree
L_.str.1:                               ## @.str.1
	.asciz	"Failed to read bfd file %s: '%s'."

L_.str.2:                               ## @.str.2
	.asciz	"Restoring section %s (0x%lx to 0x%lx)"

L_.str.3:                               ## @.str.3
	.asciz	" into memory (0x%s to 0x%s)\n"

L_.str.4:                               ## @.str.4
	.asciz	"\n"

L_.str.5:                               ## @.str.5
	.asciz	"restore: memory write failed (%s)."

	.no_dead_strip	_restore_section_callback
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function restore_section_callback
_restore_section_callback:              ; @restore_section_callback
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	mov	x19, x2
	mov	x24, x1
	mov	x25, x0
	bl	_bfd_section_vma
	mov	x21, x0
	mov	x0, x25
	mov	x1, x24
	bl	_bfd_section_size
	mov	x26, x0
	mov	x0, x25
	mov	x1, x24
	bl	_bfd_get_section_flags
Lloh0:
	adrp	x8, _SEC_LOAD@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SEC_LOAD@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_5
; %bb.1:
	ldr	x8, [x19]
	add	x28, x26, x21
	cmp	x28, x8
	b.le	LBB0_4
; %bb.2:
	ldr	x9, [x19, #8]
	cmp	x9, #1
	b.lt	LBB0_6
; %bb.3:
	cmp	x21, x9
	b.lt	LBB0_6
LBB0_4:
	mov	x0, x25
	mov	x1, x24
	bl	_bfd_section_name
	mov	x1, x0
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_printf_filtered
LBB0_5:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_6:
	subs	x8, x8, x21
	csel	x27, x8, xzr, gt
	subs	x8, x9, x28
	ccmp	x9, #0, #4, lt
	csel	x8, x8, xzr, gt
	sub	x9, x26, x27
	add	x22, x8, x9
	mov	x0, x26
	bl	_xmalloc
	mov	x23, x0
Lloh5:
	adrp	x8, _xfree@GOTPAGE
Lloh6:
	ldr	x8, [x8, _xfree@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	mov	x1, x23
	bl	_make_cleanup
	mov	x20, x0
	mov	x0, x25
	mov	x1, x24
	mov	x2, x23
	mov	w3, #0
	mov	x4, x26
	bl	_bfd_get_section_contents
	cbnz	w0, LBB0_8
; %bb.7:
	mov	x0, x25
	bl	_bfd_get_filename
	mov	x26, x0
	bl	_bfd_get_error
	bl	_bfd_errmsg
	mov	x2, x0
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x26
	bl	_error
LBB0_8:
	mov	x0, x25
	mov	x1, x24
	bl	_bfd_section_name
	mov	x1, x0
	stp	x21, x28, [sp]
Lloh10:
	adrp	x0, l_.str.2@PAGE
Lloh11:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_printf_filtered
	ldr	x8, [x19, #16]
	cbnz	x8, LBB0_11
; %bb.9:
	ldr	x9, [x19]
	cbnz	x9, LBB0_11
; %bb.10:
	ldr	x9, [x19, #8]
	cbz	x9, LBB0_15
LBB0_11:
	add	x24, x27, x21
	add	x0, x8, x24
	bl	_paddr_nz
	mov	x21, x0
	ldr	x8, [x19, #16]
	add	x9, x22, x24
	add	x0, x9, x8
	bl	_paddr_nz
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh12:
	adrp	x0, l_.str.3@PAGE
Lloh13:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x1, x21
	bl	_printf_filtered
LBB0_12:
	ldr	x8, [x19, #16]
	add	x0, x24, x8
	add	x1, x23, x27
	mov	x2, x22
	bl	_target_write_memory
	cbz	w0, LBB0_14
; %bb.13:
	bl	_safe_strerror
	mov	x1, x0
Lloh14:
	adrp	x0, l_.str.5@PAGE
Lloh15:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_warning
LBB0_14:
	mov	x0, x20
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_do_cleanups
LBB0_15:
Lloh16:
	adrp	x0, l_.str.4@PAGE
Lloh17:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_puts_filtered
	add	x24, x27, x21
	b	LBB0_12
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_SEC_LOAD,4,2                   ; @SEC_LOAD
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"skipping section %s...\n"

	.comm	_xfree,4,2                      ; @xfree
l_.str.1:                               ; @.str.1
	.asciz	"Failed to read bfd file %s: '%s'."

l_.str.2:                               ; @.str.2
	.asciz	"Restoring section %s (0x%lx to 0x%lx)"

l_.str.3:                               ; @.str.3
	.asciz	" into memory (0x%s to 0x%s)\n"

l_.str.4:                               ; @.str.4
	.asciz	"\n"

l_.str.5:                               ; @.str.5
	.asciz	"restore: memory write failed (%s)."

	.no_dead_strip	_restore_section_callback
.subsections_via_symbols
