	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function atmel_hlcdc_attach_endpoint
_atmel_hlcdc_attach_endpoint:           ## @atmel_hlcdc_attach_endpoint
	.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
	movl	%esi, %r15d
	movq	%rdi, %r12
	movq	(%rdi), %rax
	movl	(%rax), %edi
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	movl	%r15d, %edx
	callq	_of_graph_get_endpoint_by_regs
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	%rax, %r13
	movq	(%r12), %rax
	movl	(%rax), %edi
	leaq	-56(%rbp), %rcx
	leaq	-48(%rbp), %r8
	xorl	%esi, %esi
	movl	%r15d, %edx
	callq	_drm_of_find_panel_or_bridge
	testl	%eax, %eax
	je	LBB0_4
## %bb.2:
	movl	%eax, %ebx
	movq	%r13, %rdi
	callq	_of_node_put
	jmp	LBB0_14
LBB0_3:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_13
LBB0_4:
	movq	(%r12), %rdi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$16, %esi
	callq	_devm_kzalloc
	testq	%rax, %rax
	je	LBB0_10
## %bb.5:
	movq	%rax, %r14
	movq	%r13, %rdi
	callq	_atmel_hlcdc_of_bus_fmt
	movq	%rax, (%r14)
	movq	%r13, %rdi
	callq	_of_node_put
	cmpq	$0, (%r14)
	js	LBB0_11
## %bb.6:
	addq	$8, %r14
	movq	_DRM_MODE_ENCODER_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_atmel_hlcdc_panel_encoder_funcs@GOTPCREL(%rip), %rdx
	movq	%r12, %rdi
	movq	%r14, %rsi
	xorl	%r8d, %r8d
	callq	_drm_encoder_init
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_14
## %bb.7:
	movl	$1, (%r14)
	movq	-56(%rbp), %rdi
	testq	%rdi, %rdi
	je	LBB0_15
## %bb.8:
	movq	_DRM_MODE_CONNECTOR_Unknown@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_drm_panel_bridge_add
	movq	%rax, -48(%rbp)
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_15
## %bb.9:
	movq	-48(%rbp), %rdi
	callq	_PTR_ERR
	movl	%eax, %ebx
	jmp	LBB0_14
LBB0_10:
	movq	%r13, %rdi
	callq	_of_node_put
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_11:
	movq	(%r12), %rdi
	leaq	L_.str(%rip), %rsi
	movl	%r15d, %edx
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_12:
	xorl	%ebx, %ebx
LBB0_13:
	subl	(%rax), %ebx
LBB0_14:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	movq	-48(%rbp), %rsi
	testq	%rsi, %rsi
	je	LBB0_19
## %bb.16:
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_drm_bridge_attach
	testl	%eax, %eax
	je	LBB0_14
## %bb.17:
	movl	%eax, %r15d
	cmpq	$0, -56(%rbp)
	je	LBB0_20
## %bb.18:
	movq	-48(%rbp), %rdi
	callq	_drm_panel_bridge_remove
	jmp	LBB0_20
LBB0_19:
	xorl	%r15d, %r15d
LBB0_20:
	movq	%r14, %rdi
	callq	_drm_encoder_cleanup
	movl	%r15d, %ebx
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"endpoint %d: invalid bus width\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_atmel_hlcdc_panel_encoder_funcs,4,2 ## @atmel_hlcdc_panel_encoder_funcs
	.comm	_DRM_MODE_ENCODER_NONE,4,2      ## @DRM_MODE_ENCODER_NONE
	.comm	_DRM_MODE_CONNECTOR_Unknown,4,2 ## @DRM_MODE_CONNECTOR_Unknown
	.no_dead_strip	_atmel_hlcdc_attach_endpoint
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function atmel_hlcdc_attach_endpoint
_atmel_hlcdc_attach_endpoint:           ; @atmel_hlcdc_attach_endpoint
	.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, x1
	mov	x20, x0
	ldr	x8, [x0]
	ldr	w0, [x8]
	mov	w1, #0
	mov	x2, x19
	bl	_of_graph_get_endpoint_by_regs
	cbz	x0, LBB0_3
; %bb.1:
	mov	x22, x0
	ldr	x8, [x20]
	ldr	w0, [x8]
	add	x3, sp, #8
	mov	x4, sp
	mov	w1, #0
	mov	x2, x19
	bl	_drm_of_find_panel_or_bridge
	cbz	w0, LBB0_6
; %bb.2:
	mov	x21, x0
	mov	x0, x22
	bl	_of_node_put
	b	LBB0_5
LBB0_3:
Lloh0:
	adrp	x8, _ENODEV@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_5:
	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_6:
	ldr	x0, [x20]
Lloh2:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	mov	w1, #16
	bl	_devm_kzalloc
	cbz	x0, LBB0_12
; %bb.7:
	mov	x21, x0
	mov	x0, x22
	bl	_atmel_hlcdc_of_bus_fmt
	str	x0, [x21]
	mov	x0, x22
	bl	_of_node_put
	ldr	x8, [x21]
	tbnz	x8, #63, LBB0_13
; %bb.8:
	add	x19, x21, #8
Lloh5:
	adrp	x8, _DRM_MODE_ENCODER_NONE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _DRM_MODE_ENCODER_NONE@GOTPAGEOFF]
Lloh7:
	ldr	w3, [x8]
Lloh8:
	adrp	x2, _atmel_hlcdc_panel_encoder_funcs@GOTPAGE
Lloh9:
	ldr	x2, [x2, _atmel_hlcdc_panel_encoder_funcs@GOTPAGEOFF]
	mov	x0, x20
	mov	x1, x19
	mov	x4, #0
	bl	_drm_encoder_init
	mov	x21, x0
	cbnz	w0, LBB0_5
; %bb.9:
	mov	w8, #1
	str	w8, [x19]
	ldr	x0, [sp, #8]
	cbz	x0, LBB0_14
; %bb.10:
Lloh10:
	adrp	x8, _DRM_MODE_CONNECTOR_Unknown@GOTPAGE
Lloh11:
	ldr	x8, [x8, _DRM_MODE_CONNECTOR_Unknown@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	bl	_drm_panel_bridge_add
	str	x0, [sp]
	bl	_IS_ERR
	cbz	x0, LBB0_14
; %bb.11:
	ldr	x0, [sp]
	bl	_PTR_ERR
	mov	x21, x0
	b	LBB0_5
LBB0_12:
	mov	x0, x22
	bl	_of_node_put
Lloh13:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_4
LBB0_13:
	ldr	x0, [x20]
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x19
	bl	_dev_err
Lloh17:
	adrp	x8, _EINVAL@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_4
LBB0_14:
	ldr	x1, [sp]
	cbz	x1, LBB0_18
; %bb.15:
	mov	x0, x19
	mov	x2, #0
	bl	_drm_bridge_attach
	mov	x21, x0
	cbz	w0, LBB0_5
; %bb.16:
	ldr	x8, [sp, #8]
	cbz	x8, LBB0_19
; %bb.17:
	ldr	x0, [sp]
	bl	_drm_panel_bridge_remove
	b	LBB0_19
LBB0_18:
	mov	w21, #0
LBB0_19:
	mov	x0, x19
	bl	_drm_encoder_cleanup
	b	LBB0_5
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"endpoint %d: invalid bus width\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_atmel_hlcdc_panel_encoder_funcs,4,2 ; @atmel_hlcdc_panel_encoder_funcs
	.comm	_DRM_MODE_ENCODER_NONE,4,2      ; @DRM_MODE_ENCODER_NONE
	.comm	_DRM_MODE_CONNECTOR_Unknown,4,2 ; @DRM_MODE_CONNECTOR_Unknown
	.no_dead_strip	_atmel_hlcdc_attach_endpoint
.subsections_via_symbols
