	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_venus_firmware_init            ## -- Begin function venus_firmware_init
	.p2align	4, 0x90
_venus_firmware_init:                   ## @venus_firmware_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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movq	24(%rdi), %rax
	movq	(%rax), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_of_get_child_by_name
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r14
	leaq	-64(%rbp), %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$24, %edx
	callq	_memset
	movq	%r14, %rax
	addq	$4, %rax
	movq	%rax, -48(%rbp)
	movq	24(%r12), %rax
	movq	%rax, -56(%rbp)
	movl	(%r14), %eax
	movl	%eax, -60(%rbp)
	movl	$32, %edi
	callq	_DMA_BIT_MASK
	movl	%eax, -64(%rbp)
	movq	%rbx, %rdi
	callq	_platform_device_register_full
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	%r14, %rdi
	callq	_of_node_put
	movq	%r15, %rdi
	callq	_PTR_ERR
	movl	%eax, %ebx
	jmp	LBB0_11
LBB0_1:
	movl	$1, (%r12)
	xorl	%ebx, %ebx
	jmp	LBB0_11
LBB0_4:
	movq	%r14, (%r15)
	movq	%r15, %rdi
	movq	%r14, %rsi
	movl	$1, %edx
	callq	_of_dma_configure
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	movl	%eax, %ebx
	movq	24(%r12), %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
LBB0_10:
	movq	%r15, %rdi
	callq	_platform_device_unregister
	movq	%r14, %rdi
	callq	_of_node_put
LBB0_11:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	%r15, 16(%r12)
	movq	_platform_bus_type@GOTPCREL(%rip), %rdi
	callq	_iommu_domain_alloc
	movq	16(%r12), %rsi
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:
	movq	%rax, %r13
	movq	%rax, %rdi
	callq	_iommu_attach_device
	testl	%eax, %eax
	je	LBB0_12
## %bb.9:
	movl	%eax, %ebx
	movq	16(%r12), %rdi
	leaq	L_.str.3(%rip), %rsi
	callq	_dev_err
	movq	%r13, %rdi
	callq	_iommu_domain_free
	jmp	LBB0_10
LBB0_7:
	leaq	L_.str.2(%rip), %rax
	movq	%rsi, %rdi
	movq	%rax, %rsi
	callq	_dev_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_10
LBB0_12:
	movq	%r13, 8(%r12)
	movq	%r14, %rdi
	callq	_of_node_put
	xorl	%ebx, %ebx
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"video-firmware"

L_.str.1:                               ## @.str.1
	.asciz	"dma configure fail\n"

	.comm	_platform_bus_type,4,2          ## @platform_bus_type
L_.str.2:                               ## @.str.2
	.asciz	"Failed to allocate iommu domain\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.3:                               ## @.str.3
	.asciz	"could not attach device\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_venus_firmware_init            ; -- Begin function venus_firmware_init
	.p2align	2
_venus_firmware_init:                   ; @venus_firmware_init
	.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	x21, x0
	ldr	x8, [x0, #24]
	ldr	x0, [x8]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_of_get_child_by_name
	cbz	x0, LBB0_3
; %bb.1:
	mov	x19, x0
	add	x0, sp, #8
	mov	w1, #0
	mov	w2, #24
	bl	_memset
	mov	x8, x19
	ldr	w9, [x8], #4
	ldr	x10, [x21, #24]
	stp	x10, x8, [sp, #16]
	str	w9, [sp, #12]
	mov	w0, #32
	bl	_DMA_BIT_MASK
	str	w0, [sp, #8]
	add	x0, sp, #8
	bl	_platform_device_register_full
	mov	x20, x0
	bl	_IS_ERR
	cbz	x0, LBB0_4
; %bb.2:
	mov	x0, x19
	bl	_of_node_put
	mov	x0, x20
	bl	_PTR_ERR
	mov	x22, x0
	b	LBB0_8
LBB0_3:
	mov	w22, #0
	mov	w8, #1
	str	w8, [x21]
	b	LBB0_8
LBB0_4:
	str	x19, [x20]
	mov	x0, x20
	mov	x1, x19
	mov	w2, #1
	bl	_of_dma_configure
	cbz	w0, LBB0_9
; %bb.5:
	mov	x22, x0
	ldr	x0, [x21, #24]
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
LBB0_6:
	mov	x0, x20
	bl	_platform_device_unregister
LBB0_7:
	mov	x0, x19
	bl	_of_node_put
LBB0_8:
	mov	x0, x22
	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_9:
	str	x20, [x21, #16]
Lloh4:
	adrp	x0, _platform_bus_type@GOTPAGE
Lloh5:
	ldr	x0, [x0, _platform_bus_type@GOTPAGEOFF]
	bl	_iommu_domain_alloc
	ldr	x1, [x21, #16]
	cbz	x0, LBB0_12
; %bb.10:
	mov	x23, x0
	bl	_iommu_attach_device
	mov	x22, x0
	cbz	w0, LBB0_13
; %bb.11:
	ldr	x0, [x21, #16]
Lloh6:
	adrp	x1, l_.str.3@PAGE
Lloh7:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_err
	mov	x0, x23
	bl	_iommu_domain_free
	b	LBB0_6
LBB0_12:
Lloh8:
	adrp	x8, l_.str.2@PAGE
Lloh9:
	add	x8, x8, l_.str.2@PAGEOFF
	mov	x0, x1
	mov	x1, x8
	bl	_dev_err
Lloh10:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_6
LBB0_13:
	str	x23, [x21, #8]
	b	LBB0_7
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"video-firmware"

l_.str.1:                               ; @.str.1
	.asciz	"dma configure fail\n"

	.comm	_platform_bus_type,4,2          ; @platform_bus_type
l_.str.2:                               ; @.str.2
	.asciz	"Failed to allocate iommu domain\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.3:                               ; @.str.3
	.asciz	"could not attach device\n"

.subsections_via_symbols
