	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function exynos_alloc
_exynos_alloc:                          ## @exynos_alloc
	.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	$120, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -64(%rbp)
	movaps	%xmm0, -80(%rbp)
	movaps	%xmm0, -96(%rbp)
	movaps	%xmm0, -112(%rbp)
	movaps	%xmm0, -128(%rbp)
	movaps	%xmm0, -144(%rbp)
	movq	_g_drm_fd@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_exynos_device_create
	movq	%rax, -152(%rbp)                ## 8-byte Spill
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movl	(%r13), %edi
	movl	$32, %esi
	callq	_calloc
	testq	%rax, %rax
	je	LBB0_35
## %bb.3:
	movq	%rax, %r14
	movq	_EXYNOS_BUFFER_COUNT@GOTPCREL(%rip), %r15
	cmpl	$0, (%r15)
	je	LBB0_12
## %bb.4:
	movq	%r14, -160(%rbp)                ## 8-byte Spill
	movl	$8, %ebx
	xorl	%r12d, %r12d
	movq	_defaults@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rax
	movl	-4(%rax,%rbx), %esi
	imull	-8(%rax,%rbx), %esi
	imull	(%rax,%rbx), %esi
	movq	-152(%rbp), %rdi                ## 8-byte Reload
	callq	_exynos_create_mapped_buffer
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	48(%r13), %rcx
	movq	%rax, (%rcx,%r12,8)
	incq	%r12
	movl	(%r15), %eax
	addq	$12, %rbx
	cmpq	%rax, %r12
	jb	LBB0_5
	jmp	LBB0_8
LBB0_1:
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_RARCH_ERR
	jmp	LBB0_32
LBB0_35:
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_RARCH_ERR
	jmp	LBB0_31
LBB0_6:
	movl	(%r15), %eax
LBB0_8:
	cmpl	%r12d, %eax
	movq	-160(%rbp), %r14                ## 8-byte Reload
	jne	LBB0_9
LBB0_12:
	cmpl	$0, (%r13)
	je	LBB0_13
## %bb.14:
	xorl	%r15d, %r15d
	movq	%r14, %rbx
	movabsq	$4294967296, %r14               ## imm = 0x100000000
	movq	%rbx, %r12
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movl	40(%r13), %esi
	movq	-152(%rbp), %rdi                ## 8-byte Reload
	xorl	%edx, %edx
	callq	_exynos_bo_create
	testq	%rax, %rax
	je	LBB0_16
## %bb.17:                              ##   in Loop: Header=BB0_15 Depth=1
	movq	%rax, 16(%rbx)
	movq	%r13, 24(%rbx)
	movq	%r14, (%rbx)
	incq	%r15
	movl	(%r13), %eax
	addq	$32, %rbx
	cmpq	%rax, %r15
	jb	LBB0_15
## %bb.18:
	testl	%eax, %eax
	sete	%cl
	movq	%r12, %r14
	cmpl	$2, 4(%r13)
	je	LBB0_21
LBB0_20:
	movq	_DRM_FORMAT_XRGB8888@GOTPCREL(%rip), %rax
	jmp	LBB0_22
LBB0_9:
	testl	%r12d, %r12d
	je	LBB0_30
## %bb.10:
	movl	%r12d, %ebx
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	48(%r13), %rax
	movq	-8(%rax,%rbx,8), %rdi
	callq	_exynos_bo_destroy
	movq	48(%r13), %rax
	movq	$0, -8(%rax,%rbx,8)
	decq	%rbx
	jne	LBB0_11
	jmp	LBB0_30
LBB0_13:
	movb	$1, %cl
	cmpl	$2, 4(%r13)
	jne	LBB0_20
LBB0_21:
	movq	_DRM_FORMAT_RGB565@GOTPCREL(%rip), %rax
LBB0_22:
	movq	(%rax), %r12
	movq	32(%r13), %rax
	movq	%rax, -112(%rbp)
	movq	$0, -144(%rbp)
	movl	$4294967295, %eax               ## imm = 0xFFFFFFFF
	testb	%cl, %cl
	jne	LBB0_28
## %bb.23:
	movq	%r14, %r15
	addq	$8, %r15
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_24:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%r15), %rax
	movq	(%rax), %rax
	movq	%rax, -80(%rbp)
	movq	_g_drm_fd@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	24(%r13), %edx
	movl	28(%r13), %esi
	subq	$8, %rsp
	movq	%r12, %rcx
	leaq	-80(%rbp), %r8
	leaq	-112(%rbp), %r9
	pushq	$0
	pushq	%r15
	leaq	-144(%rbp), %rax
	pushq	%rax
	callq	_drmModeAddFB2
	addq	$32, %rsp
	testq	%rax, %rax
	jne	LBB0_25
## %bb.26:                              ##   in Loop: Header=BB0_24 Depth=1
	incq	%rbx
	movl	(%r13), %eax
	addq	$32, %r15
	cmpq	%rax, %rbx
	jb	LBB0_24
## %bb.27:
	decl	%eax
LBB0_28:
	movq	_g_drm_fd@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movq	_g_crtc_id@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	shlq	$5, %rax
	movl	8(%r14,%rax), %edx
	movq	_g_drm_mode@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_g_drm_connector_id@GOTPCREL(%rip), %r9
	xorl	%ebx, %ebx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	pushq	%rax
	pushq	$1
	callq	_drmModeSetCrtc
	addq	$16, %rsp
	testq	%rax, %rax
	je	LBB0_36
## %bb.29:
	leaq	L_.str.4(%rip), %rdi
	xorl	%eax, %eax
	callq	_RARCH_ERR
	jmp	LBB0_30
LBB0_16:
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_RARCH_ERR
	movq	%r12, %r14
	jmp	LBB0_30
LBB0_36:
	movq	%r14, 16(%r13)
	movq	-152(%rbp), %rax                ## 8-byte Reload
	movq	%rax, 8(%r13)
	jmp	LBB0_33
LBB0_25:
	leaq	L_.str.3(%rip), %rdi
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_RARCH_ERR
LBB0_30:
	movl	(%r13), %esi
	movq	%r14, %rdi
	callq	_exynos_clean_up_pages
LBB0_31:
	movq	-152(%rbp), %rdi                ## 8-byte Reload
	callq	_exynos_device_destroy
LBB0_32:
	movl	$-1, %ebx
LBB0_33:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_37
## %bb.34:
	movl	%ebx, %eax
	addq	$120, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_37:
	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	"[video_exynos]: failed to create device from fd\n"

L_.str.1:                               ## @.str.1
	.asciz	"[video_exynos]: failed to allocate pages\n"

	.comm	_EXYNOS_BUFFER_COUNT,4,2        ## @EXYNOS_BUFFER_COUNT
	.comm	_defaults,8,3                   ## @defaults
L_.str.2:                               ## @.str.2
	.asciz	"[video_exynos]: failed to create buffer object\n"

	.comm	_DRM_FORMAT_RGB565,8,3          ## @DRM_FORMAT_RGB565
	.comm	_DRM_FORMAT_XRGB8888,8,3        ## @DRM_FORMAT_XRGB8888
L_.str.3:                               ## @.str.3
	.asciz	"[video_exynos]: failed to add bo %u to fb\n"

	.comm	_g_crtc_id,4,2                  ## @g_crtc_id
	.comm	_g_drm_connector_id,4,2         ## @g_drm_connector_id
	.comm	_g_drm_mode,4,2                 ## @g_drm_mode
L_.str.4:                               ## @.str.4
	.asciz	"[video_exynos]: initial CRTC setup failed.\n"

	.no_dead_strip	_exynos_alloc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function exynos_alloc
lCPI0_0:
	.long	0                               ; 0x0
	.long	1                               ; 0x1
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_exynos_alloc:                          ; @exynos_alloc
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #224
	.cfi_def_cfa_offset 224
	stp	d9, d8, [sp, #128]              ; 16-byte Folded Spill
	stp	x26, x25, [sp, #144]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #160]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #176]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #192]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #208]            ; 16-byte Folded Spill
	add	x29, sp, #208
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset b8, -88
	.cfi_offset b9, -96
	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, #-88]
	movi.2d	v0, #0000000000000000
	stp	q0, q0, [sp, #80]
	stp	q0, q0, [sp, #48]
	stp	q0, q0, [sp, #16]
Lloh3:
	adrp	x24, _g_drm_fd@GOTPAGE
Lloh4:
	ldr	x24, [x24, _g_drm_fd@GOTPAGEOFF]
	ldr	w0, [x24]
	bl	_exynos_device_create
	cbz	x0, LBB0_12
; %bb.1:
	mov	x20, x0
	ldr	w0, [x19]
	mov	w1, #32
	bl	_calloc
	cbz	x0, LBB0_13
; %bb.2:
	mov	x21, x0
Lloh5:
	adrp	x23, _EXYNOS_BUFFER_COUNT@GOTPAGE
Lloh6:
	ldr	x23, [x23, _EXYNOS_BUFFER_COUNT@GOTPAGEOFF]
	ldr	w8, [x23]
	cbz	w8, LBB0_7
; %bb.3:
	mov	x25, #0
	mov	x22, #0
Lloh7:
	adrp	x26, _defaults@GOTPAGE
Lloh8:
	ldr	x26, [x26, _defaults@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x26]
	add	x8, x8, x25
	ldp	w9, w10, [x8]
	mul	w9, w10, w9
	ldr	w8, [x8, #8]
	mul	w1, w9, w8
	mov	x0, x20
	bl	_exynos_create_mapped_buffer
	cbz	x0, LBB0_14
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x19, #48]
	str	x0, [x8, x22, lsl #3]
	add	x22, x22, #1
	ldr	w8, [x23]
	add	x25, x25, #12
	cmp	x22, x8
	b.lo	LBB0_4
; %bb.6:
	cmp	w8, w22
	b.ne	LBB0_15
LBB0_7:
	ldr	w8, [x19]
	cbz	w8, LBB0_18
; %bb.8:
	mov	x22, #0
	add	x23, x21, #16
Lloh9:
	adrp	x8, lCPI0_0@PAGE
Lloh10:
	ldr	d8, [x8, lCPI0_0@PAGEOFF]
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x19, #40]
	mov	x0, x20
	mov	w2, #0
	bl	_exynos_bo_create
	cbz	x0, LBB0_27
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	stp	x0, x19, [x23]
	stur	d8, [x23, #-16]
	add	x22, x22, #1
	ldr	w8, [x19]
	add	x23, x23, #32
	cmp	x22, x8
	b.lo	LBB0_9
; %bb.11:
	cmp	w8, #0
	cset	w8, eq
	b	LBB0_19
LBB0_12:
Lloh11:
	adrp	x0, l_.str@PAGE
Lloh12:
	add	x0, x0, l_.str@PAGEOFF
	bl	_RARCH_ERR
	b	LBB0_33
LBB0_13:
Lloh13:
	adrp	x0, l_.str.1@PAGE
Lloh14:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_RARCH_ERR
	b	LBB0_32
LBB0_14:
	ldr	w8, [x23]
	cmp	w8, w22
	b.eq	LBB0_7
LBB0_15:
	cbz	w22, LBB0_31
; %bb.16:
	lsl	x8, x22, #3
	sub	x22, x8, #8
LBB0_17:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #48]
	ldr	x0, [x8, x22]
	bl	_exynos_bo_destroy
	ldr	x8, [x19, #48]
	str	xzr, [x8, x22]
	sub	x22, x22, #8
	cmn	x22, #8
	b.ne	LBB0_17
	b	LBB0_31
LBB0_18:
	mov	w8, #1
LBB0_19:
	ldr	w9, [x19, #4]
Lloh15:
	adrp	x10, _DRM_FORMAT_RGB565@GOTPAGE
Lloh16:
	ldr	x10, [x10, _DRM_FORMAT_RGB565@GOTPAGEOFF]
Lloh17:
	adrp	x11, _DRM_FORMAT_XRGB8888@GOTPAGE
Lloh18:
	ldr	x11, [x11, _DRM_FORMAT_XRGB8888@GOTPAGEOFF]
	cmp	w9, #2
	csel	x9, x10, x11, eq
	ldr	x22, [x9]
	ldr	x9, [x19, #32]
	str	x9, [sp, #48]
	str	xzr, [sp, #16]
	tbz	w8, #0, LBB0_21
; %bb.20:
	mov	w8, #-1
	b	LBB0_25
LBB0_21:
	mov	x25, #0
	add	x23, x21, #8
LBB0_22:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x23, #8]
	ldr	x8, [x8]
	str	x8, [sp, #80]
	ldr	w0, [x24]
	ldp	w2, w1, [x19, #24]
	str	wzr, [sp]
	add	x4, sp, #80
	add	x5, sp, #48
	add	x6, sp, #16
	mov	x3, x22
	mov	x7, x23
	bl	_drmModeAddFB2
	cbnz	x0, LBB0_29
; %bb.23:                               ;   in Loop: Header=BB0_22 Depth=1
	add	x25, x25, #1
	ldr	w8, [x19]
	add	x23, x23, #32
	cmp	x25, x8
	b.lo	LBB0_22
; %bb.24:
	sub	w8, w8, #1
LBB0_25:
	ldr	w0, [x24]
Lloh19:
	adrp	x9, _g_crtc_id@GOTPAGE
Lloh20:
	ldr	x9, [x9, _g_crtc_id@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x9]
	add	x8, x21, x8, lsl #5
	ldr	w2, [x8, #8]
Lloh22:
	adrp	x8, _g_drm_mode@GOTPAGE
Lloh23:
	ldr	x8, [x8, _g_drm_mode@GOTPAGEOFF]
Lloh24:
	ldr	w7, [x8]
Lloh25:
	adrp	x5, _g_drm_connector_id@GOTPAGE
Lloh26:
	ldr	x5, [x5, _g_drm_connector_id@GOTPAGEOFF]
	mov	w3, #0
	mov	w4, #0
	mov	w6, #1
	bl	_drmModeSetCrtc
	cbz	x0, LBB0_28
; %bb.26:
Lloh27:
	adrp	x0, l_.str.4@PAGE
Lloh28:
	add	x0, x0, l_.str.4@PAGEOFF
	b	LBB0_30
LBB0_27:
Lloh29:
	adrp	x0, l_.str.2@PAGE
Lloh30:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_30
LBB0_28:
	stp	x20, x21, [x19, #8]
	b	LBB0_34
LBB0_29:
	str	x25, [sp]
Lloh31:
	adrp	x0, l_.str.3@PAGE
Lloh32:
	add	x0, x0, l_.str.3@PAGEOFF
LBB0_30:
	bl	_RARCH_ERR
LBB0_31:
	ldr	w1, [x19]
	mov	x0, x21
	bl	_exynos_clean_up_pages
LBB0_32:
	mov	x0, x20
	bl	_exynos_device_destroy
LBB0_33:
	mov	w0, #-1
LBB0_34:
	ldur	x8, [x29, #-88]
Lloh33:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh34:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh35:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_36
; %bb.35:
	ldp	x29, x30, [sp, #208]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #192]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #176]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #160]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #144]            ; 16-byte Folded Reload
	ldp	d9, d8, [sp, #128]              ; 16-byte Folded Reload
	add	sp, sp, #224
	ret
LBB0_36:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdr	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.comm	_g_drm_fd,4,2                   ; @g_drm_fd
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"[video_exynos]: failed to create device from fd\n"

l_.str.1:                               ; @.str.1
	.asciz	"[video_exynos]: failed to allocate pages\n"

	.comm	_EXYNOS_BUFFER_COUNT,4,2        ; @EXYNOS_BUFFER_COUNT
	.comm	_defaults,8,3                   ; @defaults
l_.str.2:                               ; @.str.2
	.asciz	"[video_exynos]: failed to create buffer object\n"

	.comm	_DRM_FORMAT_RGB565,8,3          ; @DRM_FORMAT_RGB565
	.comm	_DRM_FORMAT_XRGB8888,8,3        ; @DRM_FORMAT_XRGB8888
l_.str.3:                               ; @.str.3
	.asciz	"[video_exynos]: failed to add bo %u to fb\n"

	.comm	_g_crtc_id,4,2                  ; @g_crtc_id
	.comm	_g_drm_connector_id,4,2         ; @g_drm_connector_id
	.comm	_g_drm_mode,4,2                 ; @g_drm_mode
l_.str.4:                               ; @.str.4
	.asciz	"[video_exynos]: initial CRTC setup failed.\n"

	.no_dead_strip	_exynos_alloc
.subsections_via_symbols
