	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function calc_mem
_calc_mem:                              ## @calc_mem
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movq	%rsi, %r14
	movq	%rdi, %r12
	callq	_nouveau_dev
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_nouveau_bios
	movq	%rax, %r13
	movq	%rbx, %rdi
	movl	$1253408, %esi                  ## imm = 0x132020
	callq	_nv_rd32
	testb	$1, %al
	jne	LBB0_2
## %bb.1:
	movq	%rbx, %rdi
	movl	$1274656, %esi                  ## imm = 0x137320
	movl	$259, %edx                      ## imm = 0x103
	callq	_nv_wr32
	movq	%rbx, %rdi
	movl	$1274672, %esi                  ## imm = 0x137330
	movl	$-2128607738, %edx              ## imm = 0x81200606
	callq	_nv_wr32
	movq	%rbx, %rdi
	movl	$1253408, %esi                  ## imm = 0x132020
	movl	$65536, %edx                    ## imm = 0x10000
	movl	$65536, %ecx                    ## imm = 0x10000
	callq	_nv_wait
	movq	%rbx, %rdi
	movl	$1253412, %esi                  ## imm = 0x132024
	movl	$70927, %edx                    ## imm = 0x1150F
	callq	_nv_wr32
	movq	%rbx, %rdi
	movl	$1253408, %esi                  ## imm = 0x132020
	movl	$1, %edx
	movl	$1, %ecx
	callq	_nv_mask
	movq	%rbx, %rdi
	movl	$1274768, %esi                  ## imm = 0x137390
	movl	$131072, %edx                   ## imm = 0x20000
	movl	$131072, %ecx                   ## imm = 0x20000
	callq	_nv_wait
	movq	%rbx, %rdi
	movl	$1253408, %esi                  ## imm = 0x132020
	movl	$4, %edx
	movl	$4, %ecx
	callq	_nv_mask
LBB0_2:
	leaq	-64(%rbp), %rdx
	movq	%r13, %rdi
	movl	$1253376, %esi                  ## imm = 0x132000
	callq	_nvbios_pll_parse
	testl	%eax, %eax
	je	LBB0_3
LBB0_6:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_7:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	%r12, %rdi
	movl	$1253408, %esi                  ## imm = 0x132020
	callq	_read_pll
	movq	%rax, -64(%rbp)
	testq	%rax, %rax
	je	LBB0_6
## %bb.4:
	leaq	-44(%rbp), %rax
	movq	%rax, (%rsp)
	xorl	%ebx, %ebx
	leaq	-64(%rbp), %rsi
	leaq	-52(%rbp), %rcx
	leaq	-48(%rbp), %r9
	movq	%r12, %rdi
	movl	%r15d, %edx
	xorl	%r8d, %r8d
	callq	_nva3_calc_pll
	testl	%eax, %eax
	jle	LBB0_6
## %bb.5:
	movl	-44(%rbp), %eax
	shll	$16, %eax
	movl	-52(%rbp), %ecx
	shll	$8, %ecx
	orl	%eax, %ecx
	orl	-48(%rbp), %ecx
	movl	%ecx, (%r14)
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_calc_mem
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function calc_mem
_calc_mem:                              ; @calc_mem
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	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
	mov	x20, x2
	mov	x19, x1
	mov	x21, x0
	mov	w24, #8224
	movk	w24, #19, lsl #16
	bl	_nouveau_dev
	mov	x23, x0
	bl	_nouveau_bios
	mov	x22, x0
	mov	x0, x23
	mov	w1, #8224
	movk	w1, #19, lsl #16
	bl	_nv_rd32
	tbnz	w0, #0, LBB0_2
; %bb.1:
	mov	w25, #29472
	movk	w25, #19, lsl #16
	mov	x0, x23
	mov	w1, #29472
	movk	w1, #19, lsl #16
	mov	w2, #259
	bl	_nv_wr32
	orr	w1, w25, #0x10
	mov	x0, x23
	mov	w2, #1542
	movk	w2, #33056, lsl #16
	bl	_nv_wr32
	mov	x0, x23
	mov	w1, #8224
	movk	w1, #19, lsl #16
	mov	w2, #65536
	mov	w3, #65536
	bl	_nv_wait
	add	w1, w24, #4
	mov	x0, x23
	mov	w2, #5391
	movk	w2, #1, lsl #16
	bl	_nv_wr32
	mov	x0, x23
	mov	w1, #8224
	movk	w1, #19, lsl #16
	mov	w2, #1
	mov	w3, #1
	bl	_nv_mask
	add	w1, w25, #112
	mov	x0, x23
	mov	w2, #131072
	mov	w3, #131072
	bl	_nv_wait
	mov	x0, x23
	mov	w1, #8224
	movk	w1, #19, lsl #16
	mov	w2, #4
	mov	w3, #4
	bl	_nv_mask
LBB0_2:
	sub	w1, w24, #32
	add	x2, sp, #24
	mov	x0, x22
	bl	_nvbios_pll_parse
	cbz	w0, LBB0_5
LBB0_3:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_4:
	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
	add	sp, sp, #112
	ret
LBB0_5:
	mov	x0, x21
	mov	w1, #8224
	movk	w1, #19, lsl #16
	bl	_read_pll
	str	x0, [sp, #24]
	cbz	x0, LBB0_3
; %bb.6:
	add	x1, sp, #24
	add	x3, sp, #20
	add	x5, sp, #16
	add	x6, sp, #12
	mov	x0, x21
	mov	x2, x20
	mov	x4, #0
	bl	_nva3_calc_pll
	cmp	w0, #1
	b.lt	LBB0_3
; %bb.7:
	mov	w0, #0
	ldr	w8, [sp, #12]
	ldr	w9, [sp, #20]
	lsl	w9, w9, #8
	orr	w8, w9, w8, lsl #16
	ldr	w9, [sp, #16]
	orr	w8, w8, w9
	str	w8, [x19]
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_calc_mem
.subsections_via_symbols
