	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nvkm_ioctl_rd
_nvkm_ioctl_rd:                         ## @nvkm_ioctl_rd
	.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	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movq	%rsi, %r14
	movq	%rdx, -48(%rbp)
	movl	%ecx, -36(%rbp)
	movq	_ENOSYS@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movl	%ecx, %edx
	xorl	%eax, %eax
	callq	_nvif_ioctl
	movq	(%r15), %rcx
	movq	8(%r15), %r8
	leaq	-48(%rbp), %rsi
	leaq	-36(%rbp), %rdx
	movl	%ebx, %edi
	xorl	%r9d, %r9d
	pushq	$0
	pushq	$0
	callq	_nvif_unpack
	addq	$16, %rsp
	testl	%eax, %eax
	jne	LBB0_9
## %bb.1:
	movl	12(%r15), %edx
	movl	(%r15), %ecx
	movl	8(%r15), %r8d
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_nvif_ioctl
	movl	(%r15), %eax
	cmpl	$4, %eax
	je	LBB0_7
## %bb.2:
	cmpl	$2, %eax
	je	LBB0_6
## %bb.3:
	cmpl	$1, %eax
	jne	LBB0_8
## %bb.4:
	movl	8(%r15), %esi
	leaq	-32(%rbp), %rdx
	movq	%r14, %rdi
	callq	_nvkm_object_rd08
	jmp	LBB0_5
LBB0_7:
	movl	8(%r15), %esi
	leaq	-32(%rbp), %rdx
	movq	%r14, %rdi
	callq	_nvkm_object_rd32
	jmp	LBB0_5
LBB0_6:
	movl	8(%r15), %esi
	leaq	-32(%rbp), %rdx
	movq	%r14, %rdi
	callq	_nvkm_object_rd16
LBB0_5:
	movl	-32(%rbp), %ecx
	movl	%ecx, 4(%r15)
	jmp	LBB0_9
LBB0_8:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_9:
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOSYS,4,2                     ## @ENOSYS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"rd size %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"rd vers %d size %d addr %016llx\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_nvkm_ioctl_rd
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nvkm_ioctl_rd
_nvkm_ioctl_rd:                         ; @nvkm_ioctl_rd
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x19, x2
	mov	x20, x1
	str	x2, [sp, #24]
	str	w3, [sp, #20]
Lloh0:
	adrp	x8, _ENOSYS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOSYS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w21, w8
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	mov	x2, x3
	bl	_nvif_ioctl
	ldp	x3, x4, [x19]
	add	x1, sp, #24
	add	x2, sp, #20
	mov	x0, x21
	mov	w5, #0
	mov	w6, #0
	mov	w7, #0
	bl	_nvif_unpack
	cbnz	w0, LBB0_9
; %bb.1:
	ldr	w8, [x19]
	ldp	w9, w2, [x19, #8]
	stp	x8, x9, [sp]
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_nvif_ioctl
	ldr	w8, [x19]
	cmp	w8, #4
	b.eq	LBB0_5
; %bb.2:
	cmp	w8, #2
	b.eq	LBB0_6
; %bb.3:
	cmp	w8, #1
	b.ne	LBB0_8
; %bb.4:
	ldr	w1, [x19, #8]
	add	x2, sp, #16
	mov	x0, x20
	bl	_nvkm_object_rd08
	b	LBB0_7
LBB0_5:
	ldr	w1, [x19, #8]
	add	x2, sp, #16
	mov	x0, x20
	bl	_nvkm_object_rd32
	b	LBB0_7
LBB0_6:
	ldr	w1, [x19, #8]
	add	x2, sp, #16
	mov	x0, x20
	bl	_nvkm_object_rd16
LBB0_7:
	ldr	w8, [sp, #16]
	str	w8, [x19, #4]
	b	LBB0_9
LBB0_8:
Lloh7:
	adrp	x8, _EINVAL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	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
	add	sp, sp, #80
	ret
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOSYS,4,2                     ; @ENOSYS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"rd size %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"rd vers %d size %d addr %016llx\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_nvkm_ioctl_rd
.subsections_via_symbols
