	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function exynos_open
_exynos_open:                           ## @exynos_open
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$48, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -24(%rbp)
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -48(%rbp)
	movaps	%xmm0, -64(%rbp)
	xorl	%eax, %eax
	callq	_exynos_get_device_index
	testq	%r14, %r14
	je	LBB0_2
## %bb.1:
	movq	_g_drm_fd@GOTPCREL(%rip), %rcx
	movl	$-1, (%rcx)
LBB0_2:
	cmpl	$-1, %eax
	je	LBB0_8
## %bb.3:
	leaq	L_.str(%rip), %rdx
	leaq	-64(%rbp), %rbx
	movq	%rbx, %rdi
	movl	$32, %esi
	movl	%eax, %ecx
	callq	_snprintf
	movq	_O_RDWR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_open
	testl	%eax, %eax
	js	LBB0_10
## %bb.4:
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_drm_get_resources
	testl	%eax, %eax
	je	LBB0_9
## %bb.5:
	movl	%ebx, %edi
	callq	_drm_get_decoder
	testl	%eax, %eax
	je	LBB0_9
## %bb.6:
	movl	%ebx, %edi
	callq	_drm_get_encoder
	testl	%eax, %eax
	je	LBB0_9
## %bb.7:
	movq	_g_drm_fds@GOTPCREL(%rip), %rax
	movl	%ebx, (%rax)
	movq	_POLLIN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 4(%rax)
	movq	_DRM_EVENT_CONTEXT_VERSION@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_g_drm_evctx@GOTPCREL(%rip), %rcx
	movl	%eax, 4(%rcx)
	movq	_exynos_page_flip_handler@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rcx)
	movl	(%r14), %edi
	leaq	-64(%rbp), %rsi
	movl	$32, %edx
	callq	_strncpy
	movq	_g_drm_fd@GOTPCREL(%rip), %rax
	movl	%ebx, (%rax)
	movl	(%r14), %esi
	movq	_g_drm_connector@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax), %edx
	leaq	L_.str.3(%rip), %rdi
	callq	_RARCH_LOG
	xorl	%eax, %eax
	jmp	LBB0_13
LBB0_8:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_11
LBB0_9:
	xorl	%eax, %eax
	callq	_drm_free
	movq	_g_drm_fd@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_close
	jmp	LBB0_12
LBB0_10:
	leaq	L_.str.2(%rip), %rdi
LBB0_11:
	callq	_RARCH_ERR
LBB0_12:
	movl	$-1, %eax
LBB0_13:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-24(%rbp), %rcx
	jne	LBB0_15
## %bb.14:
	addq	$48, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_15:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_g_drm_fd,4,2                   ## @g_drm_fd
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"/dev/dri/card%d"

L_.str.1:                               ## @.str.1
	.asciz	"[video_exynos]: no compatible DRM device found\n"

	.comm	_O_RDWR,4,2                     ## @O_RDWR
L_.str.2:                               ## @.str.2
	.asciz	"[video_exynos]: can't open DRM device\n"

	.comm	_g_drm_fds,8,2                  ## @g_drm_fds
	.comm	_POLLIN,4,2                     ## @POLLIN
	.comm	_DRM_EVENT_CONTEXT_VERSION,4,2  ## @DRM_EVENT_CONTEXT_VERSION
	.comm	_g_drm_evctx,8,2                ## @g_drm_evctx
	.comm	_exynos_page_flip_handler,4,2   ## @exynos_page_flip_handler
L_.str.3:                               ## @.str.3
	.asciz	"[video_exynos]: using DRM device \"%s\" with connector id %u.\n"

	.comm	_g_drm_connector,8,3            ## @g_drm_connector
	.no_dead_strip	_exynos_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function exynos_open
_exynos_open:                           ; @exynos_open
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-24]
	movi.2d	v0, #0000000000000000
	stp	q0, q0, [sp]
	bl	_exynos_get_device_index
	mov	x3, x0
	cbz	x19, LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _g_drm_fd@GOTPAGE
Lloh4:
	ldr	x8, [x8, _g_drm_fd@GOTPAGEOFF]
	mov	w9, #-1
Lloh5:
	str	w9, [x8]
LBB0_2:
	cmn	w3, #1
	b.eq	LBB0_8
; %bb.3:
Lloh6:
	adrp	x2, l_.str@PAGE
Lloh7:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, sp
	mov	w1, #32
	bl	_snprintf
Lloh8:
	adrp	x8, _O_RDWR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _O_RDWR@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, sp
	bl	_open
	tbnz	w0, #31, LBB0_10
; %bb.4:
	mov	x20, x0
	bl	_drm_get_resources
	cbz	w0, LBB0_9
; %bb.5:
	mov	x0, x20
	bl	_drm_get_decoder
	cbz	w0, LBB0_9
; %bb.6:
	mov	x0, x20
	bl	_drm_get_encoder
	cbz	w0, LBB0_9
; %bb.7:
Lloh11:
	adrp	x8, _g_drm_fds@GOTPAGE
Lloh12:
	ldr	x8, [x8, _g_drm_fds@GOTPAGEOFF]
Lloh13:
	adrp	x9, _POLLIN@GOTPAGE
Lloh14:
	ldr	x9, [x9, _POLLIN@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	stp	w20, w9, [x8]
Lloh16:
	adrp	x8, _DRM_EVENT_CONTEXT_VERSION@GOTPAGE
Lloh17:
	ldr	x8, [x8, _DRM_EVENT_CONTEXT_VERSION@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
Lloh19:
	adrp	x9, _g_drm_evctx@GOTPAGE
Lloh20:
	ldr	x9, [x9, _g_drm_evctx@GOTPAGEOFF]
Lloh21:
	adrp	x10, _exynos_page_flip_handler@GOTPAGE
Lloh22:
	ldr	x10, [x10, _exynos_page_flip_handler@GOTPAGEOFF]
Lloh23:
	ldr	w10, [x10]
	stp	w10, w8, [x9]
	ldr	w0, [x19]
	mov	x1, sp
	mov	w2, #32
	bl	_strncpy
Lloh24:
	adrp	x8, _g_drm_fd@GOTPAGE
Lloh25:
	ldr	x8, [x8, _g_drm_fd@GOTPAGEOFF]
Lloh26:
	str	w20, [x8]
	ldr	w1, [x19]
Lloh27:
	adrp	x8, _g_drm_connector@GOTPAGE
Lloh28:
	ldr	x8, [x8, _g_drm_connector@GOTPAGEOFF]
Lloh29:
	ldr	x8, [x8]
	ldr	w2, [x8]
Lloh30:
	adrp	x0, l_.str.3@PAGE
Lloh31:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_RARCH_LOG
	mov	w0, #0
	b	LBB0_13
LBB0_8:
Lloh32:
	adrp	x0, l_.str.1@PAGE
Lloh33:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_11
LBB0_9:
	bl	_drm_free
Lloh34:
	adrp	x8, _g_drm_fd@GOTPAGE
Lloh35:
	ldr	x8, [x8, _g_drm_fd@GOTPAGEOFF]
Lloh36:
	ldr	w0, [x8]
	bl	_close
	b	LBB0_12
LBB0_10:
Lloh37:
	adrp	x0, l_.str.2@PAGE
Lloh38:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_11:
	bl	_RARCH_ERR
LBB0_12:
	mov	w0, #-1
LBB0_13:
	ldur	x8, [x29, #-24]
Lloh39:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh40:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh41:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_15
; %bb.14:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_15:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotStr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotStr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.cfi_endproc
                                        ; -- End function
	.comm	_g_drm_fd,4,2                   ; @g_drm_fd
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"/dev/dri/card%d"

l_.str.1:                               ; @.str.1
	.asciz	"[video_exynos]: no compatible DRM device found\n"

	.comm	_O_RDWR,4,2                     ; @O_RDWR
l_.str.2:                               ; @.str.2
	.asciz	"[video_exynos]: can't open DRM device\n"

	.comm	_g_drm_fds,8,2                  ; @g_drm_fds
	.comm	_POLLIN,4,2                     ; @POLLIN
	.comm	_DRM_EVENT_CONTEXT_VERSION,4,2  ; @DRM_EVENT_CONTEXT_VERSION
	.comm	_g_drm_evctx,8,2                ; @g_drm_evctx
	.comm	_exynos_page_flip_handler,4,2   ; @exynos_page_flip_handler
l_.str.3:                               ; @.str.3
	.asciz	"[video_exynos]: using DRM device \"%s\" with connector id %u.\n"

	.comm	_g_drm_connector,8,3            ; @g_drm_connector
	.no_dead_strip	_exynos_open
.subsections_via_symbols
