	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nvkm_sddr2_calc                ## -- Begin function nvkm_sddr2_calc
	.p2align	4, 0x90
_nvkm_sddr2_calc:                       ## @nvkm_sddr2_calc
	.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
	movq	%rdi, %r15
	movq	8(%rdi), %rax
	movl	(%rax), %ecx
	cmpl	$16, %ecx
	je	LBB0_6
## %bb.1:
	cmpl	$32, %ecx
	jne	LBB0_4
## %bb.2:
	movq	16(%rax), %rax
	movl	4(%rax), %esi
	andl	$31, %esi
	movzwl	10(%rax), %r14d
	andl	$127, %r14d
	movl	$1, %r12d
	jmp	LBB0_3
LBB0_6:
	movl	4(%rax), %esi
	xorl	%r12d, %r12d
	cmpl	$0, 28(%rax)
	movl	8(%rax), %r14d
	setne	%r12b
	cmpl	$255, 24(%rax)
	jne	LBB0_7
LBB0_3:
	movq	(%r15), %rax
	movl	4(%rax), %r13d
	movl	%r13d, %eax
	shrl	$2, %eax
	andl	$1, %eax
	shrl	$5, %r13d
	andl	$2, %r13d
	orl	%eax, %r13d
	jmp	LBB0_8
LBB0_4:
	movq	_ENOSYS@GOTPCREL(%rip), %rcx
	jmp	LBB0_5
LBB0_7:
	movl	12(%rax), %r13d
	andl	$3, %r13d
LBB0_8:
	movq	_ramddr2_cl@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_ramxlat
	movl	%eax, %ebx
	movq	_ramddr2_wr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r14d, %esi
	callq	_ramxlat
	testl	%ebx, %ebx
	js	LBB0_10
## %bb.9:
	testl	%eax, %eax
	js	LBB0_10
## %bb.11:
	movq	(%r15), %rcx
	movl	$-3953, %edx                    ## imm = 0xF08F
	andl	(%rcx), %edx
	andl	$7, %eax
	shll	$9, %eax
	shll	$4, %ebx
	andl	$112, %ebx
	orl	%eax, %ebx
	orl	%edx, %ebx
	movl	%ebx, (%rcx)
	movl	4(%rcx), %eax
	andl	$-70, %eax
	movl	%r13d, %edx
	andl	$1, %edx
	shll	$5, %r13d
	andl	$-64, %r13d
	leal	(%r12,%rdx,4), %edx
	orl	%r13d, %edx
	orl	%eax, %edx
	movl	%edx, 4(%rcx)
	xorl	%eax, %eax
	jmp	LBB0_12
LBB0_10:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_5:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_12:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOSYS,4,2                     ## @ENOSYS
	.comm	_ramddr2_cl,4,2                 ## @ramddr2_cl
	.comm	_ramddr2_wr,4,2                 ## @ramddr2_wr
	.comm	_EINVAL,4,2                     ## @EINVAL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nvkm_sddr2_calc                ; -- Begin function nvkm_sddr2_calc
	.p2align	2
_nvkm_sddr2_calc:                       ; @nvkm_sddr2_calc
	.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
	mov	x19, x0
	ldr	x8, [x0, #8]
	ldr	w9, [x8]
	cmp	w9, #16
	b.eq	LBB0_3
; %bb.1:
	cmp	w9, #32
	b.ne	LBB0_5
; %bb.2:
	ldr	x8, [x8, #16]
	ldr	w9, [x8, #4]
	and	w1, w9, #0x1f
	ldrh	w8, [x8, #10]
	and	w20, w8, #0x7f
	mov	w22, #1
	b	LBB0_4
LBB0_3:
	ldp	w1, w20, [x8, #4]
	ldp	w10, w9, [x8, #24]
	cmp	w9, #0
	cset	w22, ne
	cmp	w10, #255
	b.ne	LBB0_6
LBB0_4:
	ldr	x8, [x19]
	ldr	w8, [x8, #4]
	lsr	w9, w8, #5
	and	w23, w9, #0x2
	bfxil	w23, w8, #2, #1
	b	LBB0_7
LBB0_5:
Lloh0:
	adrp	x8, _ENOSYS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOSYS@GOTPAGEOFF]
	b	LBB0_11
LBB0_6:
	ldr	w8, [x8, #12]
	and	w23, w8, #0x3
LBB0_7:
Lloh2:
	adrp	x8, _ramddr2_cl@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ramddr2_cl@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	bl	_ramxlat
	mov	x21, x0
Lloh5:
	adrp	x8, _ramddr2_wr@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ramddr2_wr@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	mov	x1, x20
	bl	_ramxlat
	tbnz	w21, #31, LBB0_10
; %bb.8:
	mov	x8, x0
	tbnz	w0, #31, LBB0_10
; %bb.9:
	mov	w0, #0
	ldr	x9, [x19]
	mov	w10, #-3953
	ldp	w11, w12, [x9]
	and	w10, w11, w10
	ubfiz	w11, w21, #4, #3
	bfi	w11, w8, #9, #3
	orr	w8, w11, w10
	mov	w10, #-70
	and	w10, w12, w10
	lsr	w11, w23, #1
	bfi	w22, w23, #2, #1
	bfi	w22, w11, #6, #1
	orr	w10, w22, w10
	stp	w8, w10, [x9]
	b	LBB0_12
LBB0_10:
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_11:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_12:
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOSYS,4,2                     ; @ENOSYS
	.comm	_ramddr2_cl,4,2                 ; @ramddr2_cl
	.comm	_ramddr2_wr,4,2                 ; @ramddr2_wr
	.comm	_EINVAL,4,2                     ; @EINVAL
.subsections_via_symbols
