	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function goya_sw_init
_goya_sw_init:                          ## @goya_sw_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	%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	_GFP_KERNEL@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movl	$40, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r14
	movq	_DRAM_PHYS_BASE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%r14)
	movq	_GOYA_PLL_FREQ_LOW@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 24(%r14)
	movq	%rax, 16(%r14)
	movq	%rax, 8(%r14)
	movq	%r14, 40(%r15)
	movl	28(%r15), %edi
	callq	_dev_name
	movq	32(%r15), %rsi
	movq	_GOYA_DMA_POOL_BLK_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%eax, %edi
	movl	$8, %ecx
	xorl	%r8d, %r8d
	callq	_dma_pool_create
	movl	%eax, (%r15)
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:
	movq	16(%r15), %rax
	movq	_HL_CPU_ACCESSIBLE_MEM_SIZE@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	leaq	4(%r15), %rbx
	movq	___GFP_ZERO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%r13), %ecx
	movq	%r15, %rdi
	movq	%rbx, %rdx
	callq	*8(%rax)
	movq	%rax, 8(%r15)
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movl	28(%r15), %edi
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdx
	callq	_dev_dbg
	movl	$32, %edi
	callq	_ilog2
	movl	%eax, %edi
	movl	$-1, %esi
	callq	_gen_pool_create
	movl	%eax, 24(%r15)
	testl	%eax, %eax
	je	LBB0_7
## %bb.8:
	movq	8(%r15), %rsi
	movl	(%r12), %edx
	movl	%eax, %edi
	movl	$-1, %ecx
	callq	_gen_pool_add
	testl	%eax, %eax
	je	LBB0_14
## %bb.9:
	movl	28(%r15), %edi
	leaq	L_.str.3(%rip), %rsi
	callq	_dev_err
	movq	_EFAULT@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	24(%r15), %edi
	callq	_gen_pool_destroy
	jmp	LBB0_10
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_13
LBB0_3:
	movl	28(%r15), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_12
LBB0_5:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_11
LBB0_7:
	movl	28(%r15), %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_dev_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_10:
	movq	16(%r15), %rax
	movl	(%r12), %esi
	movq	8(%r15), %rdx
	movl	4(%r15), %ecx
	movq	%r15, %rdi
	callq	*(%rax)
LBB0_11:
	movl	(%r15), %edi
	callq	_dma_pool_destroy
LBB0_12:
	negl	%ebx
	movq	%r14, %rdi
	callq	_kfree
LBB0_13:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	movq	%r14, %rdi
	callq	_spin_lock_init
	xorl	%ebx, %ebx
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_DRAM_PHYS_BASE,4,2             ## @DRAM_PHYS_BASE
	.comm	_GOYA_PLL_FREQ_LOW,8,3          ## @GOYA_PLL_FREQ_LOW
	.comm	_GOYA_DMA_POOL_BLK_SIZE,4,2     ## @GOYA_DMA_POOL_BLK_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to create DMA pool\n"

	.comm	_HL_CPU_ACCESSIBLE_MEM_SIZE,4,2 ## @HL_CPU_ACCESSIBLE_MEM_SIZE
	.comm	___GFP_ZERO,4,2                 ## @__GFP_ZERO
L_.str.1:                               ## @.str.1
	.asciz	"cpu accessible memory at bus address %pad\n"

L_.str.2:                               ## @.str.2
	.asciz	"Failed to create CPU accessible DMA pool\n"

L_.str.3:                               ## @.str.3
	.asciz	"Failed to add memory to CPU accessible DMA pool\n"

	.comm	_EFAULT,4,2                     ## @EFAULT
	.no_dead_strip	_goya_sw_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function goya_sw_init
_goya_sw_init:                          ; @goya_sw_init
	.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, x0
Lloh0:
	adrp	x23, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x23, [x23, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	w0, #40
	bl	_kzalloc
	cbz	x0, LBB0_6
; %bb.1:
	mov	x19, x0
Lloh2:
	adrp	x8, _DRAM_PHYS_BASE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _DRAM_PHYS_BASE@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	str	w8, [x0, #32]
Lloh5:
	adrp	x8, _GOYA_PLL_FREQ_LOW@GOTPAGE
Lloh6:
	ldr	x8, [x8, _GOYA_PLL_FREQ_LOW@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	stp	x8, x8, [x0, #16]
	str	x8, [x0, #8]
	str	x0, [x20, #40]
	ldr	w0, [x20, #28]
	bl	_dev_name
	ldr	x1, [x20, #32]
Lloh8:
	adrp	x8, _GOYA_DMA_POOL_BLK_SIZE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _GOYA_DMA_POOL_BLK_SIZE@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	mov	w3, #8
	mov	w4, #0
	bl	_dma_pool_create
	str	w0, [x20]
	cbz	w0, LBB0_7
; %bb.2:
	ldr	x8, [x20, #16]
	ldr	x8, [x8, #8]
Lloh11:
	adrp	x22, _HL_CPU_ACCESSIBLE_MEM_SIZE@GOTPAGE
Lloh12:
	ldr	x22, [x22, _HL_CPU_ACCESSIBLE_MEM_SIZE@GOTPAGEOFF]
	ldr	w1, [x22]
	add	x21, x20, #4
	ldr	w9, [x23]
Lloh13:
	adrp	x10, ___GFP_ZERO@GOTPAGE
Lloh14:
	ldr	x10, [x10, ___GFP_ZERO@GOTPAGEOFF]
Lloh15:
	ldr	w10, [x10]
	orr	w3, w10, w9
	mov	x0, x20
	mov	x2, x21
	blr	x8
	str	x0, [x20, #8]
	cbz	x0, LBB0_8
; %bb.3:
	ldr	w0, [x20, #28]
Lloh16:
	adrp	x1, l_.str.1@PAGE
Lloh17:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x21
	bl	_dev_dbg
	mov	w0, #32
	bl	_ilog2
	mov	w1, #-1
	bl	_gen_pool_create
	str	w0, [x20, #24]
	cbz	w0, LBB0_9
; %bb.4:
	ldr	x1, [x20, #8]
	ldr	w2, [x22]
	mov	w3, #-1
	bl	_gen_pool_add
	cbz	w0, LBB0_14
; %bb.5:
	ldr	w0, [x20, #28]
Lloh18:
	adrp	x1, l_.str.3@PAGE
Lloh19:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_err
Lloh20:
	adrp	x8, _EFAULT@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
Lloh22:
	ldr	w21, [x8]
	ldr	w0, [x20, #24]
	bl	_gen_pool_destroy
	b	LBB0_10
LBB0_6:
Lloh23:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_13
LBB0_7:
	ldr	w0, [x20, #28]
Lloh26:
	adrp	x1, l_.str@PAGE
Lloh27:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh28:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh29:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh30:
	ldr	w21, [x8]
	b	LBB0_12
LBB0_8:
Lloh31:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh32:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh33:
	ldr	w21, [x8]
	b	LBB0_11
LBB0_9:
	ldr	w0, [x20, #28]
Lloh34:
	adrp	x1, l_.str.2@PAGE
Lloh35:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_err
Lloh36:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh37:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh38:
	ldr	w21, [x8]
LBB0_10:
	ldp	x2, x8, [x20, #8]
	ldr	x8, [x8]
	ldr	w1, [x22]
	ldr	w3, [x20, #4]
	mov	x0, x20
	blr	x8
LBB0_11:
	ldr	w0, [x20]
	bl	_dma_pool_destroy
LBB0_12:
	neg	w20, w21
	mov	x0, x19
	bl	_kfree
LBB0_13:
	mov	x0, x20
	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_14:
	mov	x0, x19
	bl	_spin_lock_init
	mov	w20, #0
	b	LBB0_13
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpAdd	Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_DRAM_PHYS_BASE,4,2             ; @DRAM_PHYS_BASE
	.comm	_GOYA_PLL_FREQ_LOW,8,3          ; @GOYA_PLL_FREQ_LOW
	.comm	_GOYA_DMA_POOL_BLK_SIZE,4,2     ; @GOYA_DMA_POOL_BLK_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to create DMA pool\n"

	.comm	_HL_CPU_ACCESSIBLE_MEM_SIZE,4,2 ; @HL_CPU_ACCESSIBLE_MEM_SIZE
	.comm	___GFP_ZERO,4,2                 ; @__GFP_ZERO
l_.str.1:                               ; @.str.1
	.asciz	"cpu accessible memory at bus address %pad\n"

l_.str.2:                               ; @.str.2
	.asciz	"Failed to create CPU accessible DMA pool\n"

l_.str.3:                               ; @.str.3
	.asciz	"Failed to add memory to CPU accessible DMA pool\n"

	.comm	_EFAULT,4,2                     ; @EFAULT
	.no_dead_strip	_goya_sw_init
.subsections_via_symbols
