	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hdlcd_load
_hdlcd_load:                            ## @hdlcd_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, %rbx
	movq	8(%rdi), %r14
	movl	(%rdi), %edi
	callq	_to_platform_device
	movq	%rax, %r15
	movl	(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	callq	_devm_clk_get
	movq	%rax, 32(%r14)
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_1
## %bb.15:
	movq	32(%r14), %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PTR_ERR                        ## TAILCALL
LBB0_1:
	movq	_IORESOURCE_MEM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_platform_get_resource
	movl	(%rbx), %edi
	movq	%rax, %rsi
	callq	_devm_ioremap_resource
	movq	%rax, 8(%r14)
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movq	8(%r14), %rdi
	callq	_PTR_ERR
	movq	$0, 8(%r14)
	jmp	LBB0_14
LBB0_3:
	movq	_HDLCD_REG_VERSION@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_hdlcd_read
	movq	_HDLCD_PRODUCT_MASK@GOTPCREL(%rip), %rcx
	movl	%eax, %edx
	andl	(%rcx), %edx
	movq	_HDLCD_PRODUCT_ID@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %edx
	jne	LBB0_4
## %bb.5:
	movq	_HDLCD_VERSION_MAJOR_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	andl	%eax, %esi
	sarl	$8, %esi
	movq	_HDLCD_VERSION_MINOR_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	andl	%eax, %edx
	leaq	L_.str.3(%rip), %rdi
	callq	_DRM_INFO
	movl	(%rbx), %edi
	callq	_of_reserved_mem_device_init
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movl	%eax, %r12d
	movq	_ENODEV@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%r12d, %eax
	jne	LBB0_13
LBB0_7:
	movl	(%rbx), %r12d
	movl	$32, %edi
	callq	_DMA_BIT_MASK
	movl	%r12d, %edi
	movl	%eax, %esi
	callq	_dma_set_mask_and_coherent
	movl	%eax, %r12d
	testl	%eax, %eax
	je	LBB0_8
LBB0_12:
	movl	(%rbx), %edi
	callq	_of_reserved_mem_device_release
	jmp	LBB0_13
LBB0_4:
	leaq	L_.str.2(%rip), %rdi
	xorl	%r12d, %r12d
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
LBB0_13:
	movl	%r12d, %eax
LBB0_14:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	%rbx, %rdi
	callq	_hdlcd_setup_crtc
	testl	%eax, %eax
	js	LBB0_9
## %bb.10:
	xorl	%r12d, %r12d
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_platform_get_irq
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_drm_irq_install
	testl	%eax, %eax
	jns	LBB0_13
## %bb.11:
	movl	%eax, %r15d
	leaq	L_.str.5(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movq	%r14, %rdi
	callq	_drm_crtc_cleanup
	movl	%r15d, %r12d
	jmp	LBB0_12
LBB0_9:
	movl	%eax, %r12d
	leaq	L_.str.4(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"pxlclk"

	.comm	_IORESOURCE_MEM,4,2             ## @IORESOURCE_MEM
L_.str.1:                               ## @.str.1
	.asciz	"failed to map control registers area\n"

	.comm	_HDLCD_REG_VERSION,4,2          ## @HDLCD_REG_VERSION
	.comm	_HDLCD_PRODUCT_MASK,4,2         ## @HDLCD_PRODUCT_MASK
	.comm	_HDLCD_PRODUCT_ID,4,2           ## @HDLCD_PRODUCT_ID
L_.str.2:                               ## @.str.2
	.asciz	"unknown product id: 0x%x\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.3:                               ## @.str.3
	.asciz	"found ARM HDLCD version r%dp%d\n"

	.comm	_HDLCD_VERSION_MAJOR_MASK,4,2   ## @HDLCD_VERSION_MAJOR_MASK
	.comm	_HDLCD_VERSION_MINOR_MASK,4,2   ## @HDLCD_VERSION_MINOR_MASK
	.comm	_ENODEV,4,2                     ## @ENODEV
L_.str.4:                               ## @.str.4
	.asciz	"failed to create crtc\n"

L_.str.5:                               ## @.str.5
	.asciz	"failed to install IRQ handler\n"

	.no_dead_strip	_hdlcd_load
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hdlcd_load
_hdlcd_load:                            ; @hdlcd_load
	.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, #8]
	ldr	w0, [x0]
	bl	_to_platform_device
	mov	x21, x0
	ldr	w0, [x19]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_devm_clk_get
	str	x0, [x20, #32]
	bl	_IS_ERR
	cbz	x0, LBB0_2
; %bb.1:
	ldr	x0, [x20, #32]
	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_2:
Lloh2:
	adrp	x8, _IORESOURCE_MEM@GOTPAGE
Lloh3:
	ldr	x8, [x8, _IORESOURCE_MEM@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x21
	mov	w2, #0
	bl	_platform_get_resource
	mov	x1, x0
	ldr	w0, [x19]
	bl	_devm_ioremap_resource
	str	x0, [x20, #8]
	bl	_IS_ERR
	cbz	x0, LBB0_4
; %bb.3:
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_ERROR
	ldr	x0, [x20, #8]
	bl	_PTR_ERR
	str	xzr, [x20, #8]
	b	LBB0_11
LBB0_4:
Lloh7:
	adrp	x8, _HDLCD_REG_VERSION@GOTPAGE
Lloh8:
	ldr	x8, [x8, _HDLCD_REG_VERSION@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_hdlcd_read
                                        ; kill: def $w0 killed $w0 def $x0
Lloh10:
	adrp	x8, _HDLCD_PRODUCT_MASK@GOTPAGE
Lloh11:
	ldr	x8, [x8, _HDLCD_PRODUCT_MASK@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	and	w8, w8, w0
Lloh13:
	adrp	x9, _HDLCD_PRODUCT_ID@GOTPAGE
Lloh14:
	ldr	x9, [x9, _HDLCD_PRODUCT_ID@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_9
; %bb.5:
Lloh16:
	adrp	x8, _HDLCD_VERSION_MAJOR_MASK@GOTPAGE
Lloh17:
	ldr	x8, [x8, _HDLCD_VERSION_MAJOR_MASK@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	and	w8, w8, w0
	asr	w1, w8, #8
Lloh19:
	adrp	x8, _HDLCD_VERSION_MINOR_MASK@GOTPAGE
Lloh20:
	ldr	x8, [x8, _HDLCD_VERSION_MINOR_MASK@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	and	w2, w8, w0
Lloh22:
	adrp	x0, l_.str.3@PAGE
Lloh23:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_DRM_INFO
	ldr	w0, [x19]
	bl	_of_reserved_mem_device_init
	cbz	w0, LBB0_7
; %bb.6:
	mov	x22, x0
Lloh24:
	adrp	x8, _ENODEV@GOTPAGE
Lloh25:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	cmn	w0, w8
	b.ne	LBB0_10
LBB0_7:
	ldr	w22, [x19]
	mov	w0, #32
	bl	_DMA_BIT_MASK
	mov	x1, x0
	mov	x0, x22
	bl	_dma_set_mask_and_coherent
	mov	x22, x0
	cbz	w0, LBB0_12
LBB0_8:
	ldr	w0, [x19]
	bl	_of_reserved_mem_device_release
	b	LBB0_10
LBB0_9:
	str	x0, [sp]
Lloh27:
	adrp	x0, l_.str.2@PAGE
Lloh28:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DRM_ERROR
Lloh29:
	adrp	x8, _EINVAL@GOTPAGE
Lloh30:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_10:
	mov	x0, x22
LBB0_11:
	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_12:
	mov	x0, x19
	bl	_hdlcd_setup_crtc
	tbnz	w0, #31, LBB0_15
; %bb.13:
	mov	x0, x21
	mov	w1, #0
	bl	_platform_get_irq
	mov	x1, x0
	mov	x0, x19
	bl	_drm_irq_install
	mov	w22, #0
	tbz	w0, #31, LBB0_10
; %bb.14:
	mov	x21, x0
Lloh32:
	adrp	x0, l_.str.5@PAGE
Lloh33:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_DRM_ERROR
	mov	x0, x20
	bl	_drm_crtc_cleanup
	mov	x22, x21
	b	LBB0_8
LBB0_15:
	mov	x22, x0
Lloh34:
	adrp	x0, l_.str.4@PAGE
Lloh35:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_8
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpAdd	Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"pxlclk"

	.comm	_IORESOURCE_MEM,4,2             ; @IORESOURCE_MEM
l_.str.1:                               ; @.str.1
	.asciz	"failed to map control registers area\n"

	.comm	_HDLCD_REG_VERSION,4,2          ; @HDLCD_REG_VERSION
	.comm	_HDLCD_PRODUCT_MASK,4,2         ; @HDLCD_PRODUCT_MASK
	.comm	_HDLCD_PRODUCT_ID,4,2           ; @HDLCD_PRODUCT_ID
l_.str.2:                               ; @.str.2
	.asciz	"unknown product id: 0x%x\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.3:                               ; @.str.3
	.asciz	"found ARM HDLCD version r%dp%d\n"

	.comm	_HDLCD_VERSION_MAJOR_MASK,4,2   ; @HDLCD_VERSION_MAJOR_MASK
	.comm	_HDLCD_VERSION_MINOR_MASK,4,2   ; @HDLCD_VERSION_MINOR_MASK
	.comm	_ENODEV,4,2                     ; @ENODEV
l_.str.4:                               ; @.str.4
	.asciz	"failed to create crtc\n"

l_.str.5:                               ; @.str.5
	.asciz	"failed to install IRQ handler\n"

	.no_dead_strip	_hdlcd_load
.subsections_via_symbols
