	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function etnaviv_bind
_etnaviv_bind:                          ## @etnaviv_bind
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	_etnaviv_drm_driver@GOTPCREL(%rip), %rdi
	movq	%r15, %rsi
	callq	_drm_dev_alloc
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_1
## %bb.13:
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PTR_ERR                        ## TAILCALL
LBB0_1:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$32, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	movq	%rax, %r14
	movq	%rax, 8(%rbx)
	addq	$24, %rax
	movq	%rax, (%r15)
	movq	_SZ_2G@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_dma_set_max_seg_size
	leaq	20(%r14), %rdi
	callq	_mutex_init
	movq	%r14, %rdi
	addq	$16, %rdi
	callq	_INIT_LIST_HEAD
	movq	$0, 8(%r14)
	movq	(%rbx), %rdi
	callq	_etnaviv_cmdbuf_suballoc_new
	movq	%rax, (%r14)
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	(%rbx), %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
	movq	(%r14), %rdi
	callq	_PTR_ERR
	movl	%eax, %r12d
	jmp	LBB0_10
LBB0_2:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_11
LBB0_5:
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_dev_set_drvdata
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_component_bind_all
	testl	%eax, %eax
	js	LBB0_6
## %bb.7:
	movq	%rbx, %rdi
	callq	_load_gpu
	xorl	%r12d, %r12d
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_drm_dev_register
	testl	%eax, %eax
	je	LBB0_12
## %bb.8:
	movl	%eax, %r13d
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_component_unbind_all
	movl	%r13d, %r12d
	jmp	LBB0_9
LBB0_6:
	movl	%eax, %r12d
LBB0_9:
	movq	(%r14), %rdi
	callq	_etnaviv_cmdbuf_suballoc_destroy
LBB0_10:
	movq	%r14, %rdi
	callq	_kfree
LBB0_11:
	movq	%rbx, %rdi
	callq	_drm_dev_put
LBB0_12:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_etnaviv_drm_driver,4,2         ## @etnaviv_drm_driver
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to allocate private data\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_SZ_2G,4,2                      ## @SZ_2G
L_.str.1:                               ## @.str.1
	.asciz	"Failed to create cmdbuf suballocator\n"

	.no_dead_strip	_etnaviv_bind
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function etnaviv_bind
_etnaviv_bind:                          ; @etnaviv_bind
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x21, x0
Lloh0:
	adrp	x0, _etnaviv_drm_driver@GOTPAGE
Lloh1:
	ldr	x0, [x0, _etnaviv_drm_driver@GOTPAGEOFF]
	mov	x1, x21
	bl	_drm_dev_alloc
	mov	x19, x0
	bl	_IS_ERR
	cbz	x0, LBB0_2
; %bb.1:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_PTR_ERR
LBB0_2:
Lloh2:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	w0, #32
	bl	_kzalloc
	cbz	x0, LBB0_5
; %bb.3:
	mov	x20, x0
	str	x0, [x19, #8]
	add	x8, x0, #24
	str	x8, [x21]
Lloh5:
	adrp	x8, _SZ_2G@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SZ_2G@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_dma_set_max_seg_size
	add	x0, x20, #20
	bl	_mutex_init
	add	x0, x20, #16
	bl	_INIT_LIST_HEAD
	str	xzr, [x20, #8]
	ldr	x0, [x19]
	bl	_etnaviv_cmdbuf_suballoc_new
	str	x0, [x20]
	bl	_IS_ERR
	cbz	x0, LBB0_6
; %bb.4:
	ldr	x0, [x19]
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
	ldr	x0, [x20]
	bl	_PTR_ERR
	mov	x22, x0
	b	LBB0_11
LBB0_5:
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_dev_err
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_12
LBB0_6:
	mov	x0, x21
	mov	x1, x19
	bl	_dev_set_drvdata
	mov	x0, x21
	mov	x1, x19
	bl	_component_bind_all
	tbnz	w0, #31, LBB0_9
; %bb.7:
	mov	x0, x19
	bl	_load_gpu
	mov	x0, x19
	mov	w1, #0
	bl	_drm_dev_register
	mov	x22, x0
	cbz	w0, LBB0_13
; %bb.8:
	mov	x0, x21
	mov	x1, x19
	bl	_component_unbind_all
	b	LBB0_10
LBB0_9:
	mov	x22, x0
LBB0_10:
	ldr	x0, [x20]
	bl	_etnaviv_cmdbuf_suballoc_destroy
LBB0_11:
	mov	x0, x20
	bl	_kfree
LBB0_12:
	mov	x0, x19
	bl	_drm_dev_put
LBB0_13:
	mov	x0, x22
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_etnaviv_drm_driver,4,2         ; @etnaviv_drm_driver
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to allocate private data\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_SZ_2G,4,2                      ; @SZ_2G
l_.str.1:                               ; @.str.1
	.asciz	"Failed to create cmdbuf suballocator\n"

	.no_dead_strip	_etnaviv_bind
.subsections_via_symbols
