	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function armada_fbdev_create
_armada_fbdev_create:                   ## @armada_fbdev_create
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	8(%rdi), %r13
	leaq	-72(%rbp), %rdi
	xorl	%r12d, %r12d
	xorl	%esi, %esi
	movl	$24, %edx
	callq	_memset
	movl	12(%rbx), %edi
	movl	%edi, -52(%rbp)
	movl	(%rbx), %eax
	movl	%eax, -72(%rbp)
	movl	8(%rbx), %esi
	callq	_armada_pitch
	movq	-64(%rbp), %rcx
	movl	%eax, (%rcx)
	movl	4(%rbx), %esi
	movl	8(%rbx), %edi
	callq	_drm_mode_legacy_fb_format
	movl	%eax, -56(%rbp)
	movq	-64(%rbp), %rax
	movl	-72(%rbp), %esi
	imull	(%rax), %esi
	movq	%r13, %rdi
	callq	_armada_gem_alloc_private_object
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	%rax, %r15
	movq	%r13, %rdi
	movq	%rax, %rsi
	callq	_armada_gem_linear_back
	testl	%eax, %eax
	je	LBB0_6
## %bb.2:
	movl	%eax, %r12d
	addq	$8, %r15
	movq	%r15, %rdi
	callq	_drm_gem_object_put_unlocked
	jmp	LBB0_5
LBB0_3:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_4:
	subl	(%rax), %r12d
LBB0_5:
	movl	%r12d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_armada_gem_map_object
	testq	%rax, %rax
	je	LBB0_9
## %bb.7:
	movq	%rax, %r12
	leaq	-72(%rbp), %rsi
	movq	%r13, %rdi
	movq	%r15, %rdx
	callq	_armada_framebuffer_create
	movq	%rax, %r13
	movq	%r15, %rdi
	addq	$8, %rdi
	callq	_drm_gem_object_put_unlocked
	movq	%r13, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_10
## %bb.8:
	movq	%r13, %rdi
	callq	_PTR_ERR
	movl	%eax, %r12d
	jmp	LBB0_5
LBB0_9:
	addq	$8, %r15
	movq	%r15, %rdi
	callq	_drm_gem_object_put_unlocked
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	jmp	LBB0_4
LBB0_10:
	movq	%r14, %rdi
	callq	_drm_fb_helper_alloc_fbi
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_PTR_ERR
	movl	%eax, %r12d
	movq	(%r13), %rax
	movq	%r13, %rdi
	callq	*(%rax)
	jmp	LBB0_5
LBB0_12:
	movq	_armada_fb_ops@GOTPCREL(%rip), %rax
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%rax, 56(%rdi)
	movq	(%r15), %rax
	movq	%rax, 48(%rdi)
	movl	8(%r15), %eax
	movl	%eax, 40(%rdi)
	movl	%eax, 32(%rdi)
	movq	%r12, 24(%rdi)
	movq	%r13, (%r14)
	movq	%r14, %rsi
	movq	%rbx, %rdx
	callq	_drm_fb_helper_fill_info
	movl	20(%r13), %esi
	movl	16(%r13), %edx
	movq	8(%r13), %rax
	movq	(%rax), %rax
	movl	(%rax), %ecx
	shll	$3, %ecx
	movq	(%r15), %r8
	leaq	L_.str.1(%rip), %rdi
	callq	_DRM_DEBUG_KMS
	xorl	%r12d, %r12d
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to allocate fb memory\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_armada_fb_ops,4,2              ## @armada_fb_ops
L_.str.1:                               ## @.str.1
	.asciz	"allocated %dx%d %dbpp fb: 0x%08llx\n"

	.no_dead_strip	_armada_fbdev_create
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function armada_fbdev_create
_armada_fbdev_create:                   ; @armada_fbdev_create
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x19, x1
	mov	x20, x0
	ldr	x22, [x0, #8]
	add	x0, sp, #8
	mov	w1, #0
	mov	w2, #24
	bl	_memset
	ldr	w8, [x19]
	ldp	w1, w0, [x19, #8]
	str	w0, [sp, #28]
	str	w8, [sp, #8]
	bl	_armada_pitch
	ldr	x8, [sp, #16]
	str	w0, [x8]
	ldp	w1, w0, [x19, #4]
	bl	_drm_mode_legacy_fb_format
	str	w0, [sp, #24]
	ldr	x8, [sp, #16]
	ldr	w8, [x8]
	ldr	w9, [sp, #8]
	mul	w1, w9, w8
	mov	x0, x22
	bl	_armada_gem_alloc_private_object
	cbz	x0, LBB0_3
; %bb.1:
	mov	x21, x0
	mov	x0, x22
	mov	x1, x21
	bl	_armada_gem_linear_back
	cbz	w0, LBB0_6
; %bb.2:
	mov	x23, x0
	add	x0, x21, #8
	bl	_drm_gem_object_put_unlocked
	b	LBB0_5
LBB0_3:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
LBB0_4:
Lloh2:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_5:
	mov	x0, x23
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_6:
	mov	x0, x22
	mov	x1, x21
	bl	_armada_gem_map_object
	cbz	x0, LBB0_9
; %bb.7:
	mov	x23, x0
	add	x1, sp, #8
	mov	x0, x22
	mov	x2, x21
	bl	_armada_framebuffer_create
	mov	x22, x0
	add	x0, x21, #8
	bl	_drm_gem_object_put_unlocked
	mov	x0, x22
	bl	_IS_ERR
	cbz	x0, LBB0_10
; %bb.8:
	mov	x0, x22
	bl	_PTR_ERR
	mov	x23, x0
	b	LBB0_5
LBB0_9:
	add	x0, x21, #8
	bl	_drm_gem_object_put_unlocked
	b	LBB0_4
LBB0_10:
	mov	x0, x20
	bl	_drm_fb_helper_alloc_fbi
	mov	x24, x0
	bl	_IS_ERR
	cbz	x0, LBB0_12
; %bb.11:
	mov	x0, x24
	bl	_PTR_ERR
	mov	x23, x0
	ldr	x8, [x22]
	ldr	x8, [x8]
	mov	x0, x22
	blr	x8
	b	LBB0_5
LBB0_12:
Lloh5:
	adrp	x8, _armada_fb_ops@GOTPAGE
Lloh6:
	ldr	x8, [x8, _armada_fb_ops@GOTPAGEOFF]
	str	x8, [x24, #56]
	ldr	x8, [x21]
	str	x8, [x24, #48]
	ldr	w8, [x21, #8]
	str	w8, [x24, #40]
	str	w8, [x24, #32]
	str	x23, [x24, #24]
	str	x22, [x20]
	mov	x0, x24
	mov	x1, x20
	mov	x2, x19
	bl	_drm_fb_helper_fill_info
	ldp	w2, w1, [x22, #16]
	ldr	x8, [x22, #8]
	ldr	x8, [x8]
	ldr	w8, [x8]
	lsl	w3, w8, #3
	ldr	x4, [x21]
Lloh7:
	adrp	x0, l_.str.1@PAGE
Lloh8:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_DEBUG_KMS
	mov	w23, #0
	b	LBB0_5
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to allocate fb memory\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_armada_fb_ops,4,2              ; @armada_fb_ops
l_.str.1:                               ; @.str.1
	.asciz	"allocated %dx%d %dbpp fb: 0x%08llx\n"

	.no_dead_strip	_armada_fbdev_create
.subsections_via_symbols
