	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function arcpgu_load
_arcpgu_load:                           ## @arcpgu_load
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	(%rdi), %rdi
	callq	_to_platform_device
	movq	%rax, %r14
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movl	$8, %esi
	callq	_devm_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rax, %rbx
	movq	%rax, 8(%r15)
	movq	(%r15), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_devm_clk_get
	movl	%eax, 4(%rbx)
	movl	%eax, %edi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_6
## %bb.4:
	movl	4(%rbx), %edi
	jmp	LBB0_5
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_18:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	%r15, %rdi
	callq	_arcpgu_setup_mode_config
	movq	_IORESOURCE_MEM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_platform_get_resource
	movq	%r14, %rdi
	movq	%rax, %rsi
	callq	_devm_ioremap_resource
	movl	%eax, (%rbx)
	movl	%eax, %edi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movl	(%rbx), %edi
LBB0_5:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PTR_ERR                        ## TAILCALL
LBB0_8:
	movq	(%r15), %r12
	movq	_ARCPGU_REG_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_arc_pgu_read
	leaq	L_.str.1(%rip), %rsi
	movq	%r12, %rdi
	movl	%eax, %edx
	callq	_dev_info
	movq	(%r15), %rdi
	callq	_of_reserved_mem_device_init
	testl	%eax, %eax
	je	LBB0_10
## %bb.9:
	movl	%eax, %ebx
	movq	_ENODEV@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%ebx, %eax
	jne	LBB0_18
LBB0_10:
	movq	(%r15), %rbx
	movl	$32, %edi
	callq	_DMA_BIT_MASK
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_dma_set_mask_and_coherent
	testq	%rax, %rax
	je	LBB0_12
LBB0_11:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_12:
	movq	%r15, %rdi
	callq	_arc_pgu_setup_crtc
	testq	%rax, %rax
	js	LBB0_11
## %bb.13:
	movq	(%r15), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
	xorl	%edx, %edx
	callq	_of_parse_phandle
	testq	%rax, %rax
	je	LBB0_16
## %bb.14:
	movq	%rax, %r12
	movq	%r15, %rdi
	movq	%rax, %rsi
	callq	_arcpgu_drm_hdmi_init
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_of_node_put
	testl	%ebx, %ebx
	jns	LBB0_15
	jmp	LBB0_18
LBB0_16:
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_arcpgu_drm_sim_init
	testl	%eax, %eax
	js	LBB0_17
LBB0_15:
	movq	%r15, %rdi
	callq	_drm_mode_config_reset
	movq	%r15, %rdi
	callq	_drm_kms_helper_poll_init
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_platform_set_drvdata
	xorl	%ebx, %ebx
	jmp	LBB0_18
LBB0_17:
	movl	%eax, %ebx
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"pxlclk"

	.comm	_IORESOURCE_MEM,4,2             ## @IORESOURCE_MEM
L_.str.1:                               ## @.str.1
	.asciz	"arc_pgu ID: 0x%x\n"

	.comm	_ARCPGU_REG_ID,4,2              ## @ARCPGU_REG_ID
	.comm	_ENODEV,4,2                     ## @ENODEV
L_.str.2:                               ## @.str.2
	.asciz	"encoder-slave"

	.no_dead_strip	_arcpgu_load
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function arcpgu_load
_arcpgu_load:                           ; @arcpgu_load
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x19, x0
	ldr	x0, [x0]
	bl	_to_platform_device
	mov	x20, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	w1, #8
	bl	_devm_kzalloc
	cbz	x0, LBB0_3
; %bb.1:
	mov	x21, x0
	str	x0, [x19, #8]
	ldr	x0, [x19]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_devm_clk_get
	str	w0, [x21, #4]
	bl	_IS_ERR
	cbz	x0, LBB0_6
; %bb.2:
	ldr	w0, [x21, #4]
	b	LBB0_8
LBB0_3:
Lloh5:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
LBB0_4:
	neg	w21, w8
LBB0_5:
	mov	x0, x21
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_6:
	mov	x0, x19
	bl	_arcpgu_setup_mode_config
Lloh8:
	adrp	x8, _IORESOURCE_MEM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _IORESOURCE_MEM@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #0
	bl	_platform_get_resource
	mov	x1, x0
	mov	x0, x20
	bl	_devm_ioremap_resource
	str	w0, [x21]
	bl	_IS_ERR
	cbz	x0, LBB0_9
; %bb.7:
	ldr	w0, [x21]
LBB0_8:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_PTR_ERR
LBB0_9:
	ldr	x22, [x19]
Lloh11:
	adrp	x8, _ARCPGU_REG_ID@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ARCPGU_REG_ID@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_arc_pgu_read
	mov	x2, x0
Lloh14:
	adrp	x1, l_.str.1@PAGE
Lloh15:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x22
	bl	_dev_info
	ldr	x0, [x19]
	bl	_of_reserved_mem_device_init
Lloh16:
	adrp	x22, _ENODEV@GOTPAGE
Lloh17:
	ldr	x22, [x22, _ENODEV@GOTPAGEOFF]
	cbz	w0, LBB0_11
; %bb.10:
	mov	x21, x0
	ldr	w8, [x22]
	cmn	w0, w8
	b.ne	LBB0_5
LBB0_11:
	ldr	x21, [x19]
	mov	w0, #32
	bl	_DMA_BIT_MASK
	mov	x1, x0
	mov	x0, x21
	bl	_dma_set_mask_and_coherent
	cbz	x0, LBB0_13
LBB0_12:
	ldr	w8, [x22]
	b	LBB0_4
LBB0_13:
	mov	x0, x19
	bl	_arc_pgu_setup_crtc
	tbnz	x0, #63, LBB0_12
; %bb.14:
	ldr	x8, [x19]
	ldr	w0, [x8]
Lloh18:
	adrp	x1, l_.str.2@PAGE
Lloh19:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w2, #0
	bl	_of_parse_phandle
	cbz	x0, LBB0_16
; %bb.15:
	mov	x22, x0
	mov	x0, x19
	mov	x1, x22
	bl	_arcpgu_drm_hdmi_init
	mov	x21, x0
	mov	x0, x22
	bl	_of_node_put
	tbz	w21, #31, LBB0_17
	b	LBB0_5
LBB0_16:
	mov	x0, x19
	mov	x1, #0
	bl	_arcpgu_drm_sim_init
	tbnz	w0, #31, LBB0_18
LBB0_17:
	mov	x0, x19
	bl	_drm_mode_config_reset
	mov	x0, x19
	bl	_drm_kms_helper_poll_init
	mov	x0, x20
	mov	x1, x19
	bl	_platform_set_drvdata
	mov	w21, #0
	b	LBB0_5
LBB0_18:
	mov	x21, x0
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"pxlclk"

	.comm	_IORESOURCE_MEM,4,2             ; @IORESOURCE_MEM
l_.str.1:                               ; @.str.1
	.asciz	"arc_pgu ID: 0x%x\n"

	.comm	_ARCPGU_REG_ID,4,2              ; @ARCPGU_REG_ID
	.comm	_ENODEV,4,2                     ; @ENODEV
l_.str.2:                               ; @.str.2
	.asciz	"encoder-slave"

	.no_dead_strip	_arcpgu_load
.subsections_via_symbols
