	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function aspeed_video_init
_aspeed_video_init:                     ## @aspeed_video_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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	24(%rdi), %r15
	movl	(%r15), %edi
	xorl	%r12d, %r12d
	xorl	%esi, %esi
	callq	_irq_of_parse_and_map
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movl	%eax, %ebx
	movq	_aspeed_video_irq@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_IRQF_ONESHOT@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_DEVICE_NAME@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movq	%r14, (%rsp)
	movq	%r15, %rdi
	movl	%ebx, %esi
	xorl	%edx, %edx
	callq	_devm_request_threaded_irq
	testl	%eax, %eax
	js	LBB0_3
## %bb.4:
	leaq	L_.str.2(%rip), %rsi
	movq	%r15, %rdi
	callq	_devm_clk_get
	movq	%rax, (%r14)
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_5
## %bb.16:
	leaq	L_.str.3(%rip), %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	movq	(%r14), %rdi
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PTR_ERR                        ## TAILCALL
LBB0_1:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
	jmp	LBB0_15
LBB0_3:
	movl	%eax, %r12d
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_15
LBB0_5:
	movq	(%r14), %rdi
	callq	_clk_prepare
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_15
## %bb.6:
	leaq	L_.str.4(%rip), %rsi
	movq	%r15, %rdi
	callq	_devm_clk_get
	movq	%rax, 8(%r14)
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	leaq	L_.str.5(%rip), %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	movq	8(%r14), %rdi
	callq	_PTR_ERR
	movl	%eax, %r12d
	jmp	LBB0_14
LBB0_8:
	movq	8(%r14), %rdi
	callq	_clk_prepare
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_14
## %bb.9:
	movq	%r15, %rdi
	callq	_of_reserved_mem_device_init
	movl	$32, %edi
	callq	_DMA_BIT_MASK
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_dma_set_mask_and_coherent
	testl	%eax, %eax
	je	LBB0_11
## %bb.10:
	movl	%eax, %r12d
	leaq	L_.str.6(%rip), %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_dev_err
LBB0_13:
	movq	%r15, %rdi
	callq	_of_reserved_mem_device_release
	movq	8(%r14), %rdi
	callq	_clk_unprepare
LBB0_14:
	movq	(%r14), %rdi
	callq	_clk_unprepare
LBB0_15:
	movl	%r12d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	leaq	20(%r14), %rsi
	movq	_VE_JPEG_HEADER_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_aspeed_video_alloc_buf
	testl	%eax, %eax
	je	LBB0_12
## %bb.17:
	movl	16(%r14), %esi
	movl	20(%r14), %edi
	callq	_aspeed_video_init_jpeg_table
	xorl	%r12d, %r12d
	jmp	LBB0_15
LBB0_12:
	leaq	L_.str.7(%rip), %rsi
	xorl	%r12d, %r12d
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unable to find IRQ\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_aspeed_video_irq,4,2           ## @aspeed_video_irq
	.comm	_IRQF_ONESHOT,4,2               ## @IRQF_ONESHOT
	.comm	_DEVICE_NAME,4,2                ## @DEVICE_NAME
L_.str.1:                               ## @.str.1
	.asciz	"Unable to request IRQ %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"eclk"

L_.str.3:                               ## @.str.3
	.asciz	"Unable to get ECLK\n"

L_.str.4:                               ## @.str.4
	.asciz	"vclk"

L_.str.5:                               ## @.str.5
	.asciz	"Unable to get VCLK\n"

L_.str.6:                               ## @.str.6
	.asciz	"Failed to set DMA mask\n"

	.comm	_VE_JPEG_HEADER_SIZE,4,2        ## @VE_JPEG_HEADER_SIZE
L_.str.7:                               ## @.str.7
	.asciz	"Failed to allocate DMA for JPEG header\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_aspeed_video_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function aspeed_video_init
_aspeed_video_init:                     ; @aspeed_video_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x0
	ldr	x20, [x0, #24]
	ldr	w0, [x20]
	mov	w1, #0
	bl	_irq_of_parse_and_map
	cbz	w0, LBB0_4
; %bb.1:
	mov	x22, x0
Lloh0:
	adrp	x8, _aspeed_video_irq@GOTPAGE
Lloh1:
	ldr	x8, [x8, _aspeed_video_irq@GOTPAGEOFF]
Lloh2:
	ldr	w3, [x8]
Lloh3:
	adrp	x8, _IRQF_ONESHOT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _IRQF_ONESHOT@GOTPAGEOFF]
Lloh5:
	ldr	w4, [x8]
Lloh6:
	adrp	x8, _DEVICE_NAME@GOTPAGE
Lloh7:
	ldr	x8, [x8, _DEVICE_NAME@GOTPAGEOFF]
Lloh8:
	ldr	w5, [x8]
	mov	x0, x20
	mov	x1, x22
	mov	x2, #0
	mov	x6, x19
	bl	_devm_request_threaded_irq
	tbnz	w0, #31, LBB0_5
; %bb.2:
Lloh9:
	adrp	x1, l_.str.2@PAGE
Lloh10:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x20
	bl	_devm_clk_get
	str	x0, [x19]
	bl	_IS_ERR
	cbz	x0, LBB0_6
; %bb.3:
Lloh11:
	adrp	x1, l_.str.3@PAGE
Lloh12:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x20
	bl	_dev_err
	ldr	x0, [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
	add	sp, sp, #64
	b	_PTR_ERR
LBB0_4:
Lloh13:
	adrp	x1, l_.str@PAGE
Lloh14:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_dev_err
Lloh15:
	adrp	x8, _ENODEV@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_14
LBB0_5:
	mov	x21, x0
	str	x22, [sp]
Lloh18:
	adrp	x1, l_.str.1@PAGE
Lloh19:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_dev_err
	b	LBB0_14
LBB0_6:
	ldr	x0, [x19]
	bl	_clk_prepare
	mov	x21, x0
	cbnz	w0, LBB0_14
; %bb.7:
Lloh20:
	adrp	x1, l_.str.4@PAGE
Lloh21:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x20
	bl	_devm_clk_get
	str	x0, [x19, #8]
	bl	_IS_ERR
	cbz	x0, LBB0_9
; %bb.8:
Lloh22:
	adrp	x1, l_.str.5@PAGE
Lloh23:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x20
	bl	_dev_err
	ldr	x0, [x19, #8]
	bl	_PTR_ERR
	mov	x21, x0
	b	LBB0_13
LBB0_9:
	ldr	x0, [x19, #8]
	bl	_clk_prepare
	mov	x21, x0
	cbnz	w0, LBB0_13
; %bb.10:
	mov	x0, x20
	bl	_of_reserved_mem_device_init
	mov	w0, #32
	bl	_DMA_BIT_MASK
	mov	x1, x0
	mov	x0, x20
	bl	_dma_set_mask_and_coherent
	cbz	w0, LBB0_15
; %bb.11:
	mov	x21, x0
Lloh24:
	adrp	x1, l_.str.6@PAGE
Lloh25:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	x0, x20
	bl	_dev_err
LBB0_12:
	mov	x0, x20
	bl	_of_reserved_mem_device_release
	ldr	x0, [x19, #8]
	bl	_clk_unprepare
LBB0_13:
	ldr	x0, [x19]
	bl	_clk_unprepare
LBB0_14:
	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
	add	sp, sp, #64
	ret
LBB0_15:
	add	x1, x19, #20
Lloh26:
	adrp	x8, _VE_JPEG_HEADER_SIZE@GOTPAGE
Lloh27:
	ldr	x8, [x8, _VE_JPEG_HEADER_SIZE@GOTPAGEOFF]
Lloh28:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_aspeed_video_alloc_buf
	cbz	w0, LBB0_17
; %bb.16:
	ldp	w1, w0, [x19, #16]
	bl	_aspeed_video_init_jpeg_table
	mov	w21, #0
	b	LBB0_14
LBB0_17:
Lloh29:
	adrp	x1, l_.str.7@PAGE
Lloh30:
	add	x1, x1, l_.str.7@PAGEOFF
	mov	x0, x20
	bl	_dev_err
Lloh31:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh32:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_12
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpAdd	Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unable to find IRQ\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_aspeed_video_irq,4,2           ; @aspeed_video_irq
	.comm	_IRQF_ONESHOT,4,2               ; @IRQF_ONESHOT
	.comm	_DEVICE_NAME,4,2                ; @DEVICE_NAME
l_.str.1:                               ; @.str.1
	.asciz	"Unable to request IRQ %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"eclk"

l_.str.3:                               ; @.str.3
	.asciz	"Unable to get ECLK\n"

l_.str.4:                               ; @.str.4
	.asciz	"vclk"

l_.str.5:                               ; @.str.5
	.asciz	"Unable to get VCLK\n"

l_.str.6:                               ; @.str.6
	.asciz	"Failed to set DMA mask\n"

	.comm	_VE_JPEG_HEADER_SIZE,4,2        ; @VE_JPEG_HEADER_SIZE
l_.str.7:                               ; @.str.7
	.asciz	"Failed to allocate DMA for JPEG header\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_aspeed_video_init
.subsections_via_symbols
