	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nouveau_gem_ioctl_new          ## -- Begin function nouveau_gem_ioctl_new
	.p2align	4, 0x90
_nouveau_gem_ioctl_new:                 ## @nouveau_gem_ioctl_new
	.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, %r14
	movq	%rsi, %r15
	movq	%rdi, %r13
	callq	_nouveau_drm
	movq	%rax, %rbx
	movq	%r14, %rdi
	callq	_nouveau_cli
	movq	%rax, %r12
	movl	12(%rbx), %edi
	callq	_nouveau_fb
	movq	$0, -48(%rbp)
	movq	(%rbx), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 8(%rbx)
	movl	4(%r15), %esi
	movq	%rax, %rdi
	callq	*(%rax)
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movl	16(%r15), %esi
	movl	20(%r15), %edx
	movl	12(%r15), %ecx
	movl	4(%r15), %r9d
	movl	8(%r15), %r8d
	leaq	-48(%rbp), %rax
	movq	%rax, (%rsp)
	movq	%r13, %rdi
	callq	_nouveau_gem_new
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_8
## %bb.3:
	movq	-48(%rbp), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movq	%r15, %rdx
	callq	_drm_gem_handle_create
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_7
## %bb.4:
	movq	-48(%rbp), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movq	%r15, %rdx
	callq	_nouveau_gem_info
	testl	%eax, %eax
	je	LBB0_5
## %bb.6:
	movl	%eax, %ebx
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_drm_gem_handle_delete
	jmp	LBB0_7
LBB0_1:
	movl	4(%r15), %edx
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	callq	_NV_ERROR
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_8
LBB0_5:
	xorl	%ebx, %ebx
LBB0_7:
	movq	-48(%rbp), %rax
	movl	(%rax), %edi
	callq	_drm_gem_object_unreference_unlocked
LBB0_8:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"bad page flags: 0x%08x\n"

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

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nouveau_gem_ioctl_new          ; -- Begin function nouveau_gem_ioctl_new
	.p2align	2
_nouveau_gem_ioctl_new:                 ; @nouveau_gem_ioctl_new
	.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	x19, x2
	mov	x20, x1
	mov	x21, x0
	bl	_nouveau_drm
	mov	x23, x0
	mov	x0, x19
	bl	_nouveau_cli
	mov	x22, x0
	ldr	w0, [x23, #12]
	bl	_nouveau_fb
	str	xzr, [sp, #8]
	ldr	x8, [x23]
	ldr	w8, [x8]
	str	w8, [x23, #8]
	ldr	x8, [x0]
	ldr	w1, [x20, #4]
	blr	x8
	cbz	w0, LBB0_6
; %bb.1:
	ldp	w1, w2, [x20, #16]
	ldp	w4, w3, [x20, #8]
	ldr	w5, [x20, #4]
	add	x6, sp, #8
	mov	x0, x21
	bl	_nouveau_gem_new
	mov	x21, x0
	cbnz	w0, LBB0_7
; %bb.2:
	ldr	x8, [sp, #8]
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x20
	bl	_drm_gem_handle_create
	mov	x21, x0
	cbnz	w0, LBB0_5
; %bb.3:
	ldr	x8, [sp, #8]
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x20
	bl	_nouveau_gem_info
	mov	x21, x0
	cbz	w0, LBB0_5
; %bb.4:
	ldr	w1, [x20]
	mov	x0, x19
	bl	_drm_gem_handle_delete
LBB0_5:
	ldr	x8, [sp, #8]
	ldr	w0, [x8]
	bl	_drm_gem_object_unreference_unlocked
	b	LBB0_7
LBB0_6:
	ldr	w2, [x20, #4]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	bl	_NV_ERROR
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_7:
	mov	x0, x21
	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 AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"bad page flags: 0x%08x\n"

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