	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function set_sdram_scrub_rate
_set_sdram_scrub_rate:                  ## @set_sdram_scrub_rate
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %rbx
	movq	8(%rbx), %rax
	movq	16(%rax), %r14
	testq	%r14, %r14
	je	LBB0_1
## %bb.3:
	movq	%rsi, %r15
	movq	_MC_SCRUB_CONTROL@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	leaq	-48(%rbp), %rdx
	movq	%r14, %rdi
	callq	_pci_read_config_dword
	testq	%r15, %r15
	je	LBB0_4
## %bb.5:
	imulq	$64000000, (%rbx), %rbx         ## imm = 0x3D09000
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_do_div
	testq	%rbx, %rbx
	je	LBB0_10
## %bb.6:
	movq	_SCRUBINTERVAL_MASK@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	cmpq	%rdx, %rbx
	jbe	LBB0_7
LBB0_10:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_1:
	movq	_ENODEV@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_9
LBB0_4:
	movq	_STARTSCRUB@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	notq	%rax
	andq	-48(%rbp), %rax
	movq	%rax, -48(%rbp)
	movl	(%r12), %esi
	movq	_SCRUBINTERVAL_MASK@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	notq	%rdx
	andq	%rax, %rdx
	movq	%r14, %rdi
	callq	_write_and_test
	movq	_MC_SSRCONTROL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-40(%rbp), %rdx
	movq	%r14, %rdi
	callq	_pci_read_config_dword
	movq	_SSR_MODE_MASK@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	notq	%rdx
	andq	-40(%rbp), %rdx
	movq	_SSR_MODE_DISABLE@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_7:
	andq	%rbx, %rdx
	movq	%rdx, -48(%rbp)
	movl	(%r12), %esi
	movq	_STARTSCRUB@GOTPCREL(%rip), %rax
	orq	(%rax), %rdx
	movq	%r14, %rdi
	callq	_pci_write_config_dword
	movq	_MC_SSRCONTROL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-40(%rbp), %rdx
	movq	%r14, %rdi
	callq	_pci_read_config_dword
	movq	_SSR_MODE_MASK@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	notq	%rdx
	andq	-40(%rbp), %rdx
	movq	_SSR_MODE_ENABLE@GOTPCREL(%rip), %rax
LBB0_8:
	orq	(%rax), %rdx
	movq	%rdx, -40(%rbp)
	movq	_MC_SSRCONTROL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_pci_write_config_dword
LBB0_9:
	movl	%r15d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_MC_SCRUB_CONTROL,4,2           ## @MC_SCRUB_CONTROL
	.comm	_STARTSCRUB,8,3                 ## @STARTSCRUB
	.comm	_SCRUBINTERVAL_MASK,8,3         ## @SCRUBINTERVAL_MASK
	.comm	_MC_SSRCONTROL,4,2              ## @MC_SSRCONTROL
	.comm	_SSR_MODE_MASK,8,3              ## @SSR_MODE_MASK
	.comm	_SSR_MODE_DISABLE,8,3           ## @SSR_MODE_DISABLE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_SSR_MODE_ENABLE,8,3            ## @SSR_MODE_ENABLE
	.no_dead_strip	_set_sdram_scrub_rate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function set_sdram_scrub_rate
_set_sdram_scrub_rate:                  ; @set_sdram_scrub_rate
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	ldr	x21, [x0]
	ldr	x8, [x21, #8]
	ldr	x20, [x8, #16]
	cbz	x20, LBB0_5
; %bb.1:
	mov	x19, x1
Lloh0:
	adrp	x22, _MC_SCRUB_CONTROL@GOTPAGE
Lloh1:
	ldr	x22, [x22, _MC_SCRUB_CONTROL@GOTPAGEOFF]
	ldr	w1, [x22]
	add	x2, sp, #8
	mov	x0, x20
	bl	_pci_read_config_dword
	cbz	x19, LBB0_7
; %bb.2:
	ldr	x8, [x21]
	mov	w9, #36864
	movk	w9, #976, lsl #16
	mul	x21, x8, x9
	mov	x0, x21
	mov	x1, x19
	bl	_do_div
	cbz	x21, LBB0_4
; %bb.3:
Lloh2:
	adrp	x8, _SCRUBINTERVAL_MASK@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SCRUBINTERVAL_MASK@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	cmp	x21, x8
	b.ls	LBB0_8
LBB0_4:
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:
Lloh7:
	adrp	x8, _ENODEV@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w19, w8
	b	LBB0_10
LBB0_7:
Lloh9:
	adrp	x8, _STARTSCRUB@GOTPAGE
Lloh10:
	ldr	x8, [x8, _STARTSCRUB@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	ldr	x9, [sp, #8]
	bic	x8, x9, x8
	str	x8, [sp, #8]
	ldr	w1, [x22]
Lloh12:
	adrp	x9, _SCRUBINTERVAL_MASK@GOTPAGE
Lloh13:
	ldr	x9, [x9, _SCRUBINTERVAL_MASK@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	bic	x2, x8, x9
	mov	x0, x20
	bl	_write_and_test
Lloh15:
	adrp	x8, _MC_SSRCONTROL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _MC_SSRCONTROL@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	x2, sp
	mov	x0, x20
	bl	_pci_read_config_dword
Lloh18:
	adrp	x8, _SSR_MODE_MASK@GOTPAGE
Lloh19:
	ldr	x8, [x8, _SSR_MODE_MASK@GOTPAGEOFF]
Lloh20:
	ldr	x8, [x8]
	ldr	x9, [sp]
	bic	x8, x9, x8
Lloh21:
	adrp	x9, _SSR_MODE_DISABLE@GOTPAGE
Lloh22:
	ldr	x9, [x9, _SSR_MODE_DISABLE@GOTPAGEOFF]
	b	LBB0_9
LBB0_8:
	and	x8, x8, x21
	str	x8, [sp, #8]
	ldr	w1, [x22]
Lloh23:
	adrp	x9, _STARTSCRUB@GOTPAGE
Lloh24:
	ldr	x9, [x9, _STARTSCRUB@GOTPAGEOFF]
Lloh25:
	ldr	x9, [x9]
	orr	x2, x9, x8
	mov	x0, x20
	bl	_pci_write_config_dword
Lloh26:
	adrp	x8, _MC_SSRCONTROL@GOTPAGE
Lloh27:
	ldr	x8, [x8, _MC_SSRCONTROL@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
	mov	x2, sp
	mov	x0, x20
	bl	_pci_read_config_dword
Lloh29:
	adrp	x8, _SSR_MODE_MASK@GOTPAGE
Lloh30:
	ldr	x8, [x8, _SSR_MODE_MASK@GOTPAGEOFF]
Lloh31:
	ldr	x8, [x8]
	ldr	x9, [sp]
	bic	x8, x9, x8
Lloh32:
	adrp	x9, _SSR_MODE_ENABLE@GOTPAGE
Lloh33:
	ldr	x9, [x9, _SSR_MODE_ENABLE@GOTPAGEOFF]
LBB0_9:
	ldr	x9, [x9]
	orr	x2, x9, x8
	str	x2, [sp]
Lloh34:
	adrp	x8, _MC_SSRCONTROL@GOTPAGE
Lloh35:
	ldr	x8, [x8, _MC_SSRCONTROL@GOTPAGEOFF]
Lloh36:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_pci_write_config_dword
LBB0_10:
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_MC_SCRUB_CONTROL,4,2           ; @MC_SCRUB_CONTROL
	.comm	_STARTSCRUB,8,3                 ; @STARTSCRUB
	.comm	_SCRUBINTERVAL_MASK,8,3         ; @SCRUBINTERVAL_MASK
	.comm	_MC_SSRCONTROL,4,2              ; @MC_SSRCONTROL
	.comm	_SSR_MODE_MASK,8,3              ; @SSR_MODE_MASK
	.comm	_SSR_MODE_DISABLE,8,3           ; @SSR_MODE_DISABLE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_SSR_MODE_ENABLE,8,3            ; @SSR_MODE_ENABLE
	.no_dead_strip	_set_sdram_scrub_rate
.subsections_via_symbols
