	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function write_sram
_write_sram:                            ## @write_sram
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	_idt77252_sram_write_errors@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	jne	LBB0_6
## %bb.1:
	movq	(%r14), %rcx
	movslq	(%rcx), %rdx
	movslq	8(%r14), %rax
	leaq	(%rax,%rdx), %rsi
	addq	$-2, %rsi
	cmpq	%rbx, %rsi
	jae	LBB0_3
## %bb.2:
	addq	%rax, %rdx
	movslq	%edx, %rdx
	cmpq	%rbx, %rdx
	ja	LBB0_5
LBB0_3:
	movslq	4(%rcx), %rcx
	leaq	(%rcx,%rax), %rdx
	addq	$-2, %rdx
	cmpq	%rbx, %rdx
	jae	LBB0_6
## %bb.4:
	addq	%rax, %rcx
	movslq	%ecx, %rax
	cmpq	%rbx, %rax
	jbe	LBB0_6
LBB0_5:
	movl	16(%r14), %esi
	leaq	L_.str(%rip), %rdi
	movq	%rbx, %rdx
	movq	%r15, %rcx
	callq	_printk
LBB0_6:
	leaq	12(%r14), %r12
	movq	%r12, %rdi
	callq	_spin_lock_irqsave
	movq	_SAR_REG_DR0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_writel
	movq	_SAR_CMD_WRITE_SRAM@GOTPCREL(%rip), %rax
	shlq	$2, %rbx
	orq	(%rax), %rbx
	movq	_SAR_REG_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_writel
	movq	%r14, %rdi
	callq	_waitfor_idle
	movq	%r12, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_spin_unlock_irqrestore         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_idt77252_sram_write_errors,8,3 ## @idt77252_sram_write_errors
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: ERROR: TST JMP section at %08lx written: %08x\n"

	.comm	_SAR_REG_DR0,4,2                ## @SAR_REG_DR0
	.comm	_SAR_CMD_WRITE_SRAM,8,3         ## @SAR_CMD_WRITE_SRAM
	.comm	_SAR_REG_CMD,4,2                ## @SAR_REG_CMD
	.no_dead_strip	_write_sram
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function write_sram
_write_sram:                            ; @write_sram
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x21, x2
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _idt77252_sram_write_errors@GOTPAGE
Lloh1:
	ldr	x8, [x8, _idt77252_sram_write_errors@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cbnz	x8, LBB0_4
; %bb.1:
	ldr	x8, [x19]
	ldrsw	x10, [x8]
	ldrsw	x9, [x19, #8]
	add	x10, x9, x10
	sub	x11, x10, #2
	sxtw	x10, w10
	cmp	x11, x20
	ccmp	x10, x20, #0, lo
	b.hi	LBB0_3
; %bb.2:
	ldrsw	x8, [x8, #4]
	add	x8, x8, x9
	sub	x9, x8, #2
	sxtw	x8, w8
	cmp	x9, x20
	ccmp	x8, x20, #0, lo
	b.ls	LBB0_4
LBB0_3:
	ldr	w1, [x19, #16]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	mov	x2, x20
	mov	x3, x21
	bl	_printk
LBB0_4:
	add	x22, x19, #12
	mov	x0, x22
	bl	_spin_lock_irqsave
Lloh5:
	adrp	x8, _SAR_REG_DR0@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SAR_REG_DR0@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_writel
Lloh8:
	adrp	x8, _SAR_CMD_WRITE_SRAM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SAR_CMD_WRITE_SRAM@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	orr	x0, x8, x20, lsl #2
Lloh11:
	adrp	x8, _SAR_REG_CMD@GOTPAGE
Lloh12:
	ldr	x8, [x8, _SAR_REG_CMD@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	bl	_writel
	mov	x0, x19
	bl	_waitfor_idle
	mov	x0, x22
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_spin_unlock_irqrestore
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_idt77252_sram_write_errors,8,3 ; @idt77252_sram_write_errors
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: ERROR: TST JMP section at %08lx written: %08x\n"

	.comm	_SAR_REG_DR0,4,2                ; @SAR_REG_DR0
	.comm	_SAR_CMD_WRITE_SRAM,8,3         ; @SAR_CMD_WRITE_SRAM
	.comm	_SAR_REG_CMD,4,2                ; @SAR_REG_CMD
	.no_dead_strip	_write_sram
.subsections_via_symbols
