	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function etnaviv_gpu_bind
_etnaviv_gpu_bind:                      ## @etnaviv_gpu_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	%rdx, %r14
	movq	%rdi, %rbx
	movq	(%rdx), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	callq	_dev_get_drvdata
	movq	%rax, %r15
	movq	_CONFIG_DRM_ETNAVIV_THERMAL@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	callq	_IS_ENABLED
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movl	(%rbx), %r12d
	movq	%rbx, %rdi
	callq	_dev_name
	movq	_cooling_ops@GOTPCREL(%rip), %rcx
	movl	%r12d, %edi
	movq	%rax, %rsi
	movq	%r15, %rdx
	callq	_thermal_of_cooling_device_register
	movl	%eax, (%r15)
	movl	%eax, %edi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_2
## %bb.12:
	movl	(%r15), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PTR_ERR                        ## TAILCALL
LBB0_2:
	movq	%rbx, %rdi
	callq	_dev_name
	xorl	%ebx, %ebx
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	_alloc_ordered_workqueue
	movl	%eax, 4(%r15)
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:
	movq	%r15, %rdi
	callq	_etnaviv_sched_init
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_5
LBB0_8:
	movl	4(%r15), %edi
	callq	_destroy_workqueue
	jmp	LBB0_9
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_9:
	movl	(%r13), %edi
	callq	_IS_ENABLED
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:
	movl	(%r15), %edi
	callq	_thermal_cooling_device_unregister
	jmp	LBB0_11
LBB0_5:
	movq	%r15, %rdi
	callq	_etnaviv_gpu_clk_enable
	testl	%eax, %eax
	js	LBB0_7
## %bb.6:
	movq	%r14, 32(%r15)
	movl	$1, %edi
	callq	_dma_fence_context_alloc
	movl	%eax, 28(%r15)
	leaq	24(%r15), %rdi
	callq	_idr_init
	leaq	20(%r15), %rdi
	callq	_spin_lock_init
	leaq	16(%r15), %rdi
	movq	_sync_point_worker@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_INIT_WORK
	movq	%r15, %rdi
	addq	$12, %rdi
	callq	_init_waitqueue_head
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movq	8(%rsi), %rax
	movslq	(%rsi), %rcx
	leal	1(%rcx), %edx
	movl	%edx, (%rsi)
	movq	%r15, (%rax,%rcx,8)
	movl	8(%r15), %edi
	callq	_pm_runtime_mark_last_busy
	movl	8(%r15), %edi
	callq	_pm_runtime_put_autosuspend
	xorl	%ebx, %ebx
LBB0_11:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_etnaviv_sched_fini
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_CONFIG_DRM_ETNAVIV_THERMAL,4,2 ## @CONFIG_DRM_ETNAVIV_THERMAL
	.comm	_cooling_ops,4,2                ## @cooling_ops
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_sync_point_worker,4,2          ## @sync_point_worker
	.no_dead_strip	_etnaviv_gpu_bind
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function etnaviv_gpu_bind
_etnaviv_gpu_bind:                      ; @etnaviv_gpu_bind
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x20, x2
	mov	x21, x0
	ldr	x23, [x2]
	bl	_dev_get_drvdata
	mov	x19, x0
Lloh0:
	adrp	x24, _CONFIG_DRM_ETNAVIV_THERMAL@GOTPAGE
Lloh1:
	ldr	x24, [x24, _CONFIG_DRM_ETNAVIV_THERMAL@GOTPAGEOFF]
	ldr	w0, [x24]
	bl	_IS_ENABLED
	cbz	x0, LBB0_3
; %bb.1:
	ldr	w22, [x21]
	mov	x0, x21
	bl	_dev_name
	mov	x1, x0
Lloh2:
	adrp	x3, _cooling_ops@GOTPAGE
Lloh3:
	ldr	x3, [x3, _cooling_ops@GOTPAGEOFF]
	mov	x0, x22
	mov	x2, x19
	bl	_thermal_of_cooling_device_register
	str	w0, [x19]
	bl	_IS_ERR
	cbz	x0, LBB0_3
; %bb.2:
	ldr	w0, [x19]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_PTR_ERR
LBB0_3:
	mov	x0, x21
	bl	_dev_name
	mov	w1, #0
	bl	_alloc_ordered_workqueue
	str	w0, [x19, #4]
	cbz	w0, LBB0_6
; %bb.4:
	mov	x0, x19
	bl	_etnaviv_sched_init
	mov	x21, x0
	cbz	w0, LBB0_9
LBB0_5:
	ldr	w0, [x19, #4]
	bl	_destroy_workqueue
	b	LBB0_7
LBB0_6:
Lloh4:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_7:
	ldr	w0, [x24]
	bl	_IS_ENABLED
	cbz	x0, LBB0_11
; %bb.8:
	ldr	w0, [x19]
	bl	_thermal_cooling_device_unregister
	b	LBB0_11
LBB0_9:
	mov	x0, x19
	bl	_etnaviv_gpu_clk_enable
	tbnz	w0, #31, LBB0_12
; %bb.10:
	str	x20, [x19, #32]
	mov	w0, #1
	bl	_dma_fence_context_alloc
	str	w0, [x19, #28]
	add	x0, x19, #24
	bl	_idr_init
	add	x0, x19, #20
	bl	_spin_lock_init
	add	x0, x19, #16
Lloh7:
	adrp	x8, _sync_point_worker@GOTPAGE
Lloh8:
	ldr	x8, [x8, _sync_point_worker@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	bl	_INIT_WORK
	add	x0, x19, #12
	bl	_init_waitqueue_head
	ldr	x8, [x23, #8]
	ldrsw	x9, [x23]
	add	w10, w9, #1
	str	w10, [x23]
	str	x19, [x8, x9, lsl #3]
	ldr	w0, [x19, #8]
	bl	_pm_runtime_mark_last_busy
	ldr	w0, [x19, #8]
	bl	_pm_runtime_put_autosuspend
	mov	w21, #0
LBB0_11:
	mov	x0, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_12:
	mov	x21, x0
	mov	x0, x19
	bl	_etnaviv_sched_fini
	b	LBB0_5
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_CONFIG_DRM_ETNAVIV_THERMAL,4,2 ; @CONFIG_DRM_ETNAVIV_THERMAL
	.comm	_cooling_ops,4,2                ; @cooling_ops
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_sync_point_worker,4,2          ; @sync_point_worker
	.no_dead_strip	_etnaviv_gpu_bind
.subsections_via_symbols
