	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nv50_head_create               ## -- Begin function nv50_head_create
	.p2align	4, 0x90
_nv50_head_create:                      ## @nv50_head_create
	.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	%esi, %r13d
	movq	%rdi, %r12
	callq	_nouveau_drm
	movq	%rax, %r15
	movq	%r12, %rdi
	callq	_nv50_disp
	movq	%rax, %rbx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$24, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r14
	movq	8(%rbx), %rax
	movq	(%rax), %rax
	movq	(%rax), %rax
	movq	%rax, 8(%r14)
	movl	%r13d, 16(%r14)
	movq	(%rbx), %rax
	movq	(%rax), %rax
	movq	_GV100_DISP@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jge	LBB0_4
## %bb.3:
	leaq	-48(%rbp), %rdx
	movq	%r15, %rdi
	movl	%r13d, %esi
	callq	_nv50_base_new
	movl	16(%r14), %esi
	leaq	-64(%rbp), %rdx
	movq	%r15, %rdi
	callq	_nv50_ovly_new
	jmp	LBB0_5
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_14
LBB0_4:
	movq	_DRM_PLANE_TYPE_PRIMARY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	addl	%r13d, %r13d
	leaq	-48(%rbp), %rcx
	movq	%r15, %rdi
	movl	%r13d, %edx
	callq	_nv50_wndw_new
	movq	_DRM_PLANE_TYPE_OVERLAY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	16(%r14), %eax
	leal	(%rax,%rax), %edx
	incl	%edx
	leaq	-64(%rbp), %rcx
	movq	%r15, %rdi
	callq	_nv50_wndw_new
LBB0_5:
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_7
## %bb.6:
	movl	16(%r14), %esi
	leaq	-56(%rbp), %rdx
	movq	%r15, %rdi
	callq	_nv50_curs_new
	movl	%eax, %r13d
	testl	%eax, %eax
	je	LBB0_8
LBB0_7:
	movq	%r14, %rdi
	callq	_kfree
LBB0_14:
	movl	%r13d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	%r14, %rsi
	addq	$20, %rsi
	movq	-48(%rbp), %rdx
	movq	-56(%rbp), %rcx
	movl	16(%r14), %eax
	movl	%eax, (%rsp)
	movq	_nv50_head_func@GOTPCREL(%rip), %r8
	leaq	L_.str(%rip), %r9
	movq	%r12, %rdi
	movq	%rsi, %r12
	callq	_drm_crtc_init_with_planes
	movq	_nv50_head_help@GOTPCREL(%rip), %rsi
	movq	%r12, %rdi
	callq	_drm_crtc_helper_add
	movq	%r12, %rdi
	movl	$256, %esi                      ## imm = 0x100
	callq	_drm_mode_crtc_set_gamma_size
	movq	(%rbx), %rax
	movq	(%rax), %rax
	movq	_GF110_DISP@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jge	LBB0_9
## %bb.10:
	movq	%r12, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	jmp	LBB0_11
LBB0_9:
	movq	%r12, %rdi
	movl	$256, %esi                      ## imm = 0x100
	movl	$1, %edx
LBB0_11:
	movl	$256, %ecx                      ## imm = 0x100
	callq	_drm_crtc_enable_color_mgmt
	movq	8(%r14), %rax
	xorl	%r13d, %r13d
	cmpq	$0, (%rax)
	je	LBB0_14
## %bb.12:
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	callq	_nv50_lut_init
	testl	%eax, %eax
	je	LBB0_14
## %bb.13:
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_nv50_head_destroy
	movl	%ebx, %r13d
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_GV100_DISP,8,3                 ## @GV100_DISP
	.comm	_DRM_PLANE_TYPE_PRIMARY,4,2     ## @DRM_PLANE_TYPE_PRIMARY
	.comm	_DRM_PLANE_TYPE_OVERLAY,4,2     ## @DRM_PLANE_TYPE_OVERLAY
	.comm	_nv50_head_func,4,2             ## @nv50_head_func
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"head-%d"

	.comm	_nv50_head_help,4,2             ## @nv50_head_help
	.comm	_GF110_DISP,8,3                 ## @GF110_DISP
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nv50_head_create               ; -- Begin function nv50_head_create
	.p2align	2
_nv50_head_create:                      ; @nv50_head_create
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x23, x1
	mov	x22, x0
	bl	_nouveau_drm
	mov	x19, x0
	mov	x0, x22
	bl	_nv50_disp
	mov	x20, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #24
	bl	_kzalloc
	cbz	x0, LBB0_3
; %bb.1:
	mov	x21, x0
	ldr	x8, [x20, #8]
	ldr	x8, [x8]
	ldr	x8, [x8]
	str	x8, [x0, #8]
	str	w23, [x0, #16]
	ldr	x8, [x20]
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _GV100_DISP@GOTPAGE
Lloh4:
	ldr	x9, [x9, _GV100_DISP@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ge	LBB0_4
; %bb.2:
	add	x2, sp, #24
	mov	x0, x19
	mov	x1, x23
	bl	_nv50_base_new
	ldr	w1, [x21, #16]
	add	x2, sp, #16
	mov	x0, x19
	bl	_nv50_ovly_new
	mov	x24, x0
	cbnz	w0, LBB0_6
	b	LBB0_5
LBB0_3:
Lloh6:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_7
LBB0_4:
Lloh9:
	adrp	x8, _DRM_PLANE_TYPE_PRIMARY@GOTPAGE
Lloh10:
	ldr	x8, [x8, _DRM_PLANE_TYPE_PRIMARY@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	lsl	w2, w23, #1
	add	x3, sp, #24
	mov	x0, x19
	bl	_nv50_wndw_new
Lloh12:
	adrp	x8, _DRM_PLANE_TYPE_OVERLAY@GOTPAGE
Lloh13:
	ldr	x8, [x8, _DRM_PLANE_TYPE_OVERLAY@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	ldr	w8, [x21, #16]
	mov	w2, #1
	bfi	w2, w8, #1, #31
	add	x3, sp, #16
	mov	x0, x19
	bl	_nv50_wndw_new
	mov	x24, x0
	cbnz	w0, LBB0_6
LBB0_5:
	ldr	w1, [x21, #16]
	add	x2, sp, #8
	mov	x0, x19
	bl	_nv50_curs_new
	mov	x24, x0
	cbz	w0, LBB0_8
LBB0_6:
	mov	x0, x21
	bl	_kfree
LBB0_7:
	mov	x0, x24
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_8:
	add	x23, x21, #20
	ldr	x2, [sp, #24]
	ldr	x3, [sp, #8]
	ldr	w6, [x21, #16]
Lloh15:
	adrp	x4, _nv50_head_func@GOTPAGE
Lloh16:
	ldr	x4, [x4, _nv50_head_func@GOTPAGEOFF]
Lloh17:
	adrp	x5, l_.str@PAGE
Lloh18:
	add	x5, x5, l_.str@PAGEOFF
	mov	x0, x22
	mov	x1, x23
	bl	_drm_crtc_init_with_planes
Lloh19:
	adrp	x1, _nv50_head_help@GOTPAGE
Lloh20:
	ldr	x1, [x1, _nv50_head_help@GOTPAGEOFF]
	mov	x0, x23
	bl	_drm_crtc_helper_add
	mov	x0, x23
	mov	w1, #256
	bl	_drm_mode_crtc_set_gamma_size
	ldr	x8, [x20]
	ldr	x8, [x8]
Lloh21:
	adrp	x9, _GF110_DISP@GOTPAGE
Lloh22:
	ldr	x9, [x9, _GF110_DISP@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
	mov	x0, x23
	cmp	x8, x9
	b.ge	LBB0_10
; %bb.9:
	mov	w1, #0
	mov	w2, #0
	b	LBB0_11
LBB0_10:
	mov	w1, #256
	mov	w2, #1
LBB0_11:
	mov	w3, #256
	bl	_drm_crtc_enable_color_mgmt
	ldr	x8, [x21, #8]
	ldr	x8, [x8]
	cbz	x8, LBB0_14
; %bb.12:
	mov	x0, x20
	mov	x1, x19
	mov	x2, x21
	bl	_nv50_lut_init
	mov	x24, x0
	cbz	w0, LBB0_7
; %bb.13:
	mov	x0, x23
	bl	_nv50_head_destroy
	b	LBB0_7
LBB0_14:
	mov	w24, #0
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_GV100_DISP,8,3                 ; @GV100_DISP
	.comm	_DRM_PLANE_TYPE_PRIMARY,4,2     ; @DRM_PLANE_TYPE_PRIMARY
	.comm	_DRM_PLANE_TYPE_OVERLAY,4,2     ; @DRM_PLANE_TYPE_OVERLAY
	.comm	_nv50_head_func,4,2             ; @nv50_head_func
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"head-%d"

	.comm	_nv50_head_help,4,2             ; @nv50_head_help
	.comm	_GF110_DISP,8,3                 ; @GF110_DISP
.subsections_via_symbols
