	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function device_early_init
_device_early_init:                     ## @device_early_init
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	movl	(%rdi), %edx
	cmpl	$128, %edx
	jne	LBB0_17
## %bb.1:
	movq	%r14, %rdi
	callq	_goya_set_asic_funcs
	movl	80(%r14), %edi
	leaq	L_.str(%rip), %rsi
	movl	$4, %edx
	callq	_strlcpy
	movq	8(%r14), %rax
	movq	%r14, %rdi
	callq	*(%rax)
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_16
## %bb.2:
	movq	%r14, %rdi
	callq	_hl_asid_init
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_14
## %bb.3:
	movq	_WQ_UNBOUND@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	leaq	L_.str.2(%rip), %rdi
	xorl	%edx, %edx
	callq	_alloc_workqueue
	movq	%rax, 16(%r14)
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movl	(%rbx), %esi
	leaq	L_.str.4(%rip), %rdi
	xorl	%edx, %edx
	callq	_alloc_workqueue
	movq	%rax, 24(%r14)
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movl	$4, %edi
	callq	_kzalloc
	movl	%eax, 32(%r14)
	testl	%eax, %eax
	je	LBB0_8
## %bb.9:
	movq	_HL_IDLE_BUSY_TS_ARR_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	___GFP_ZERO@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	orl	(%rbx), %edx
	movl	$4, %esi
	callq	_kmalloc_array
	movl	%eax, 72(%r14)
	testl	%eax, %eax
	je	LBB0_10
## %bb.18:
	leaq	68(%r14), %rdi
	callq	_hl_cb_mgr_init
	leaq	64(%r14), %rdi
	callq	_mutex_init
	leaq	60(%r14), %rdi
	callq	_mutex_init
	leaq	56(%r14), %rdi
	callq	_mutex_init
	leaq	52(%r14), %rdi
	callq	_INIT_LIST_HEAD
	leaq	48(%r14), %rdi
	callq	_spin_lock_init
	leaq	44(%r14), %rdi
	callq	_INIT_LIST_HEAD
	leaq	40(%r14), %rdi
	callq	_mutex_init
	addq	$36, %r14
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_atomic_set
	jmp	LBB0_16
LBB0_17:
	movl	76(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_16:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_4:
	movl	76(%r14), %edi
	leaq	L_.str.3(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_13
LBB0_6:
	movl	76(%r14), %edi
	leaq	L_.str.5(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_12
LBB0_8:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_11
LBB0_10:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	32(%r14), %edi
	callq	_kfree
LBB0_11:
	movq	24(%r14), %rdi
	callq	_destroy_workqueue
LBB0_12:
	movq	16(%r14), %rdi
	callq	_destroy_workqueue
LBB0_13:
	negl	%ebx
	movq	%r14, %rdi
	callq	_hl_asid_fini
LBB0_14:
	movq	8(%r14), %rax
	movq	8(%rax), %rcx
	testq	%rcx, %rcx
	je	LBB0_16
## %bb.15:
	movq	%r14, %rdi
	callq	*%rcx
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"GOYA"

L_.str.1:                               ## @.str.1
	.asciz	"Unrecognized ASIC type %d\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.2:                               ## @.str.2
	.asciz	"hl-free-jobs"

	.comm	_WQ_UNBOUND,4,2                 ## @WQ_UNBOUND
L_.str.3:                               ## @.str.3
	.asciz	"Failed to allocate CQ workqueue\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.4:                               ## @.str.4
	.asciz	"hl-events"

L_.str.5:                               ## @.str.5
	.asciz	"Failed to allocate EQ workqueue\n"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_HL_IDLE_BUSY_TS_ARR_SIZE,4,2   ## @HL_IDLE_BUSY_TS_ARR_SIZE
	.comm	___GFP_ZERO,4,2                 ## @__GFP_ZERO
	.no_dead_strip	_device_early_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function device_early_init
_device_early_init:                     ; @device_early_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x0
	ldr	w8, [x0]
	cmp	w8, #128
	b.ne	LBB0_8
; %bb.1:
	mov	x0, x19
	bl	_goya_set_asic_funcs
	ldr	w0, [x19, #80]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w2, #4
	bl	_strlcpy
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	mov	x0, x19
	blr	x8
	mov	x20, x0
	cbnz	w0, LBB0_9
; %bb.2:
	mov	x0, x19
	bl	_hl_asid_init
	mov	x20, x0
	cbnz	w0, LBB0_17
; %bb.3:
Lloh2:
	adrp	x20, _WQ_UNBOUND@GOTPAGE
Lloh3:
	ldr	x20, [x20, _WQ_UNBOUND@GOTPAGEOFF]
	ldr	w1, [x20]
Lloh4:
	adrp	x0, l_.str.2@PAGE
Lloh5:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	w2, #0
	bl	_alloc_workqueue
	str	x0, [x19, #16]
	cbz	x0, LBB0_10
; %bb.4:
	ldr	w1, [x20]
Lloh6:
	adrp	x0, l_.str.4@PAGE
Lloh7:
	add	x0, x0, l_.str.4@PAGEOFF
	mov	w2, #0
	bl	_alloc_workqueue
	str	x0, [x19, #24]
	cbz	x0, LBB0_11
; %bb.5:
Lloh8:
	adrp	x20, _GFP_KERNEL@GOTPAGE
Lloh9:
	ldr	x20, [x20, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	w0, #4
	bl	_kzalloc
	str	w0, [x19, #32]
	cbz	w0, LBB0_12
; %bb.6:
Lloh10:
	adrp	x8, _HL_IDLE_BUSY_TS_ARR_SIZE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _HL_IDLE_BUSY_TS_ARR_SIZE@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
	ldr	w8, [x20]
Lloh13:
	adrp	x9, ___GFP_ZERO@GOTPAGE
Lloh14:
	ldr	x9, [x9, ___GFP_ZERO@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	w1, #4
	bl	_kmalloc_array
	str	w0, [x19, #72]
	cbz	w0, LBB0_13
; %bb.7:
	add	x0, x19, #68
	bl	_hl_cb_mgr_init
	add	x0, x19, #64
	bl	_mutex_init
	add	x0, x19, #60
	bl	_mutex_init
	add	x0, x19, #56
	bl	_mutex_init
	add	x0, x19, #52
	bl	_INIT_LIST_HEAD
	add	x0, x19, #48
	bl	_spin_lock_init
	add	x0, x19, #44
	bl	_INIT_LIST_HEAD
	add	x0, x19, #40
	bl	_mutex_init
	add	x0, x19, #36
	mov	w1, #0
	bl	_atomic_set
	mov	w20, #0
	b	LBB0_9
LBB0_8:
	ldr	w0, [x19, #76]
	str	x8, [sp]
Lloh16:
	adrp	x1, l_.str.1@PAGE
Lloh17:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
Lloh18:
	adrp	x8, _EINVAL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_9:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_10:
	ldr	w0, [x19, #76]
Lloh21:
	adrp	x1, l_.str.3@PAGE
Lloh22:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_err
Lloh23:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh25:
	ldr	w20, [x8]
	b	LBB0_16
LBB0_11:
	ldr	w0, [x19, #76]
Lloh26:
	adrp	x1, l_.str.5@PAGE
Lloh27:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_dev_err
Lloh28:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh29:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh30:
	ldr	w20, [x8]
	b	LBB0_15
LBB0_12:
Lloh31:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh32:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh33:
	ldr	w20, [x8]
	b	LBB0_14
LBB0_13:
Lloh34:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh35:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh36:
	ldr	w20, [x8]
	ldr	w0, [x19, #32]
	bl	_kfree
LBB0_14:
	ldr	x0, [x19, #24]
	bl	_destroy_workqueue
LBB0_15:
	ldr	x0, [x19, #16]
	bl	_destroy_workqueue
LBB0_16:
	neg	w20, w20
	mov	x0, x19
	bl	_hl_asid_fini
LBB0_17:
	ldr	x8, [x19, #8]
	ldr	x8, [x8, #8]
	cbz	x8, LBB0_9
; %bb.18:
	mov	x0, x19
	blr	x8
	b	LBB0_9
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"GOYA"

l_.str.1:                               ; @.str.1
	.asciz	"Unrecognized ASIC type %d\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.2:                               ; @.str.2
	.asciz	"hl-free-jobs"

	.comm	_WQ_UNBOUND,4,2                 ; @WQ_UNBOUND
l_.str.3:                               ; @.str.3
	.asciz	"Failed to allocate CQ workqueue\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.4:                               ; @.str.4
	.asciz	"hl-events"

l_.str.5:                               ; @.str.5
	.asciz	"Failed to allocate EQ workqueue\n"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_HL_IDLE_BUSY_TS_ARR_SIZE,4,2   ; @HL_IDLE_BUSY_TS_ARR_SIZE
	.comm	___GFP_ZERO,4,2                 ; @__GFP_ZERO
	.no_dead_strip	_device_early_init
.subsections_via_symbols
