	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nv50_ram_gpio
_nv50_ram_gpio:                         ## @nv50_ram_gpio
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movl	%esi, %ebx
	movq	%rdi, %r14
	movq	(%rdi), %rax
	movq	(%rax), %rax
	movq	(%rax), %r13
	movq	_DCB_GPIO_UNUSED@GOTPCREL(%rip), %r12
	movl	(%r12), %ecx
	movq	%r13, %rdi
	xorl	%esi, %esi
	movl	%ebx, %edx
	callq	_nvkm_gpio_get
	cmpq	%r15, %rax
	je	LBB0_3
## %bb.1:
	movl	(%r12), %ecx
	leaq	-64(%rbp), %r8
	movq	%r13, %rdi
	xorl	%esi, %esi
	movl	%ebx, %edx
	callq	_nvkm_gpio_find
	testl	%eax, %eax
	jne	LBB0_3
## %bb.2:
	movl	-64(%rbp), %r12d
	movl	%r12d, %eax
	sarl	$3, %eax
	cltq
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	shll	$2, %r12d
	movl	(%r13,%rax,4), %esi
	movq	%r14, %rdi
	callq	_ram_rd32
	movl	$8, %edx
	movl	%r12d, %ecx
	shll	%cl, %edx
	movl	%r12d, %ebx
	andb	$28, %bl
	movslq	%edx, %rcx
	xorl	%edx, %edx
	testq	%r15, %r15
	sete	%dl
	testq	%rcx, %rax
	cmoveq	%r15, %rdx
	movq	-56(%rbp), %rcx
	xorl	%eax, %eax
	testq	%rdx, %rdx
	sete	%al
	testb	$1, 4(%rcx)
	cmovneq	%rdx, %rax
	movl	$3, %edx
	movl	%r12d, %ecx
	shll	%cl, %edx
	orq	$2, %rax
	movl	%ebx, %ecx
	shlq	%cl, %rax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	(%r13,%rcx,4), %esi
	movq	%r14, %rdi
	movq	%rax, %rcx
	callq	_ram_mask
	movq	%r14, %rdi
	movl	$20000, %esi                    ## imm = 0x4E20
	callq	_ram_nsec
LBB0_3:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DCB_GPIO_UNUSED,4,2            ## @DCB_GPIO_UNUSED
	.no_dead_strip	_nv50_ram_gpio
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nv50_ram_gpio
_nv50_ram_gpio:                         ; @nv50_ram_gpio
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x21, x2
	mov	x22, x1
	mov	x19, x0
	ldr	x8, [x0]
	ldr	x8, [x8]
	ldr	x20, [x8]
Lloh0:
	adrp	x23, _DCB_GPIO_UNUSED@GOTPAGE
Lloh1:
	ldr	x23, [x23, _DCB_GPIO_UNUSED@GOTPAGEOFF]
	ldr	w3, [x23]
	mov	x0, x20
	mov	w1, #0
	mov	x2, x22
	bl	_nvkm_gpio_get
	cmp	x0, x21
	b.eq	LBB0_3
; %bb.1:
	ldr	w3, [x23]
	mov	x4, sp
	mov	x0, x20
	mov	w1, #0
	mov	x2, x22
	bl	_nvkm_gpio_find
	cbnz	w0, LBB0_3
; %bb.2:
	ldr	w8, [sp]
	asr	w9, w8, #3
	lsl	w8, w8, #2
	and	x22, x8, #0x1c
	sbfiz	x23, x9, #2, #32
	ldr	w1, [x20, x23]
	mov	x0, x19
	bl	_ram_rd32
	mov	w8, #8
	lsl	w8, w8, w22
	sxtw	x8, w8
	cmp	x21, #0
	cset	w9, eq
	tst	x0, x8
	csel	x8, x21, x9, eq
	ldr	x9, [sp, #8]
	ldr	w9, [x9, #4]
	cmp	x8, #0
	cset	w10, eq
	tst	w9, #0x1
	csel	x8, x10, x8, eq
	mov	w9, #3
	lsl	w2, w9, w22
	orr	x8, x8, #0x2
	lsl	x3, x8, x22
	ldr	w1, [x20, x23]
	mov	x0, x19
	bl	_ram_mask
	mov	x0, x19
	mov	w1, #20000
	bl	_ram_nsec
LBB0_3:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_DCB_GPIO_UNUSED,4,2            ; @DCB_GPIO_UNUSED
	.no_dead_strip	_nv50_ram_gpio
.subsections_via_symbols
