	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_fb_helper_alloc_fbi        ## -- Begin function drm_fb_helper_alloc_fbi
	.p2align	4, 0x90
_drm_fb_helper_alloc_fbi:               ## @drm_fb_helper_alloc_fbi
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	8(%rdi), %rax
	movq	(%rax), %rsi
	xorl	%ebx, %ebx
	xorl	%edi, %edi
	callq	_framebuffer_alloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rax, %r13
	movq	%rax, %r15
	addq	$4, %r15
	movq	%r15, %rdi
	movl	$256, %esi                      ## imm = 0x100
	xorl	%edx, %edx
	callq	_fb_alloc_cmap
	movl	%eax, %r12d
	testl	%eax, %eax
	je	LBB0_4
LBB0_6:
	movq	%r13, %rdi
	callq	_framebuffer_release
	movl	%r12d, %edi
	jmp	LBB0_2
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	movl	%ebx, %edi
LBB0_2:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
LBB0_4:
	movl	$1, %edi
	callq	_alloc_apertures
	movl	%eax, 8(%r13)
	testl	%eax, %eax
	je	LBB0_5
## %bb.7:
	movq	%r13, (%r14)
	movl	$1, (%r13)
	movq	%r13, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	movq	%r15, %rdi
	callq	_fb_dealloc_cmap
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_fb_helper_alloc_fbi        ; -- Begin function drm_fb_helper_alloc_fbi
	.p2align	2
_drm_fb_helper_alloc_fbi:               ; @drm_fb_helper_alloc_fbi
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x20, x0
	ldr	x8, [x0, #8]
	ldr	x1, [x8]
	mov	w0, #0
	bl	_framebuffer_alloc
	cbz	x0, LBB0_3
; %bb.1:
	mov	x19, x0
	add	x21, x0, #4
	mov	x0, x21
	mov	w1, #256
	mov	w2, #0
	bl	_fb_alloc_cmap
	mov	x22, x0
	cbz	w0, LBB0_5
LBB0_2:
	mov	x0, x19
	bl	_framebuffer_release
	mov	x0, x22
	b	LBB0_4
LBB0_3:
Lloh0:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_4:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_ERR_PTR
LBB0_5:
	mov	w22, #1
	mov	w0, #1
	bl	_alloc_apertures
	str	w0, [x19, #8]
	cbz	w0, LBB0_7
; %bb.6:
	str	x19, [x20]
	str	w22, [x19]
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_7:
Lloh3:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w22, w8
	mov	x0, x21
	bl	_fb_dealloc_cmap
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
