	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vivid_fb_init                  ## -- Begin function vivid_fb_init
	.p2align	4, 0x90
_vivid_fb_init:                         ## @vivid_fb_init
	.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
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	_MAX_OSD_HEIGHT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_MAX_OSD_WIDTH@GOTPCREL(%rip), %rcx
	imull	(%rcx), %eax
	movq	%rdi, %r14
	addl	%eax, %eax
	movl	%eax, (%rdi)
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rcx
	movq	_GFP_DMA32@GOTPCREL(%rip), %rdx
	movl	(%rdx), %esi
	orl	(%rcx), %esi
	movl	%eax, %edi
	callq	_kzalloc
	movq	%rax, 8(%r14)
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rax, %rdi
	callq	_virt_to_phys
	movl	%eax, 16(%r14)
	movq	8(%r14), %rdx
	movl	(%r14), %esi
	leal	1023(%rsi), %ecx
	testl	%esi, %esi
	cmovnsl	%esi, %ecx
	sarl	$10, %ecx
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_pr_info
	movq	%r14, %rdi
	callq	_vivid_fb_init_vidmode
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_vivid_fb_release_buffers
	jmp	LBB0_8
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_5:
	movq	%r14, %rdi
	callq	_vivid_clear_fb
	leaq	4(%r14), %rbx
	movq	%rbx, %rdi
	callq	_register_framebuffer
	testq	%rax, %rax
	js	LBB0_6
## %bb.7:
	movq	%rbx, %rdi
	callq	_vivid_fb_set_par
	xorl	%ebx, %ebx
	jmp	LBB0_8
LBB0_6:
	movq	%r14, %rdi
	callq	_vivid_fb_release_buffers
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_8:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_OSD_HEIGHT,4,2             ## @MAX_OSD_HEIGHT
	.comm	_MAX_OSD_WIDTH,4,2              ## @MAX_OSD_WIDTH
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_GFP_DMA32,4,2                  ## @GFP_DMA32
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Framebuffer at 0x%lx, mapped to 0x%p, size %dk\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vivid_fb_init                  ; -- Begin function vivid_fb_init
	.p2align	2
_vivid_fb_init:                         ; @vivid_fb_init
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.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, _MAX_OSD_HEIGHT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAX_OSD_HEIGHT@GOTPAGEOFF]
Lloh2:
	adrp	x9, _MAX_OSD_WIDTH@GOTPAGE
Lloh3:
	ldr	x9, [x9, _MAX_OSD_WIDTH@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	ldr	w9, [x9]
	mul	w8, w8, w9
	lsl	w0, w8, #1
Lloh6:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
	str	w0, [x19]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x9, _GFP_DMA32@GOTPAGE
Lloh10:
	ldr	x9, [x9, _GFP_DMA32@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	orr	w1, w9, w8
	bl	_kzalloc
	str	x0, [x19, #8]
	cbz	x0, LBB0_3
; %bb.1:
	bl	_virt_to_phys
	mov	x1, x0
	str	w0, [x19, #16]
	ldr	x2, [x19, #8]
	ldr	w8, [x19]
	add	w9, w8, #1023
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w3, w8, #10
Lloh12:
	adrp	x0, l_.str@PAGE
Lloh13:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_info
	mov	x0, x19
	bl	_vivid_fb_init_vidmode
	cbz	w0, LBB0_4
; %bb.2:
	mov	x20, x0
	mov	x0, x19
	bl	_vivid_fb_release_buffers
	b	LBB0_8
LBB0_3:
Lloh14:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_7
LBB0_4:
	mov	x0, x19
	bl	_vivid_clear_fb
	add	x20, x19, #4
	mov	x0, x20
	bl	_register_framebuffer
	tbnz	x0, #63, LBB0_6
; %bb.5:
	mov	x0, x20
	bl	_vivid_fb_set_par
	mov	w20, #0
	b	LBB0_8
LBB0_6:
	mov	x0, x19
	bl	_vivid_fb_release_buffers
Lloh16:
	adrp	x8, _EINVAL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_7:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_8:
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh4
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_OSD_HEIGHT,4,2             ; @MAX_OSD_HEIGHT
	.comm	_MAX_OSD_WIDTH,4,2              ; @MAX_OSD_WIDTH
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_GFP_DMA32,4,2                  ; @GFP_DMA32
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Framebuffer at 0x%lx, mapped to 0x%p, size %dk\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
.subsections_via_symbols
