	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_atom_allocate_fb_scratch       ## -- Begin function atom_allocate_fb_scratch
	.p2align	4, 0x90
_atom_allocate_fb_scratch:              ## @atom_allocate_fb_scratch
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_VRAM_UsageByFirmware@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_GetIndexIntoMasterTable
	leaq	-40(%rbp), %r9
	movq	%r14, %rdi
	movl	%eax, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_atom_parse_data_header
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	8(%r14), %r12
	movq	-40(%rbp), %rbx
	movq	(%rbx,%r12), %rax
	movl	4(%rax), %edi
	callq	_le32_to_cpu
	movl	%eax, %r15d
	movq	(%rbx,%r12), %rax
	movl	(%rax), %edi
	callq	_le16_to_cpu
	leaq	L_.str(%rip), %rdi
	movl	%r15d, %esi
	movl	%eax, %edx
	callq	_DRM_DEBUG
	movq	(%rbx,%r12), %rax
	movl	(%rax), %edi
	callq	_le16_to_cpu
	movl	$0, (%r14)
	testl	%eax, %eax
	je	LBB0_2
## %bb.4:
	movl	%eax, %ebx
	shll	$10, %ebx
	jmp	LBB0_5
LBB0_1:
	movl	$0, (%r14)
LBB0_2:
	movl	$20480, %ebx                    ## imm = 0x5000
LBB0_5:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	callq	_kzalloc
	movl	%eax, 4(%r14)
	testl	%eax, %eax
	je	LBB0_6
## %bb.7:
	movl	%ebx, (%r14)
	xorl	%eax, %eax
	jmp	LBB0_8
LBB0_6:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_8:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DATA,4,2                       ## @DATA
	.comm	_VRAM_UsageByFirmware,4,2       ## @VRAM_UsageByFirmware
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"atom firmware requested %08x %dkb\n"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_atom_allocate_fb_scratch       ; -- Begin function atom_allocate_fb_scratch
	.p2align	2
_atom_allocate_fb_scratch:              ; @atom_allocate_fb_scratch
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x19, x0
Lloh0:
	adrp	x8, _DATA@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DATA@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x8, _VRAM_UsageByFirmware@GOTPAGE
Lloh4:
	ldr	x8, [x8, _VRAM_UsageByFirmware@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_GetIndexIntoMasterTable
	mov	x1, x0
	add	x5, sp, #8
	mov	x0, x19
	mov	x2, #0
	mov	x3, #0
	mov	x4, #0
	bl	_atom_parse_data_header
	cbz	x0, LBB0_3
; %bb.1:
	ldr	x21, [x19, #8]
	ldr	x22, [sp, #8]
	ldr	x8, [x22, x21]
	ldr	w0, [x8, #4]
	bl	_le32_to_cpu
	mov	x20, x0
	ldr	x8, [x22, x21]
	ldr	w0, [x8]
	bl	_le16_to_cpu
	mov	x2, x0
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	bl	_DRM_DEBUG
	ldr	x8, [x22, x21]
	ldr	w0, [x8]
	bl	_le16_to_cpu
	str	wzr, [x19]
	cbz	w0, LBB0_4
; %bb.2:
	lsl	w20, w0, #10
	b	LBB0_5
LBB0_3:
	str	wzr, [x19]
LBB0_4:
	mov	w20, #20480
LBB0_5:
Lloh8:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_kzalloc
	str	w0, [x19, #4]
	cbz	w0, LBB0_7
; %bb.6:
	mov	w0, #0
	str	w20, [x19]
	b	LBB0_8
LBB0_7:
Lloh11:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_DATA,4,2                       ; @DATA
	.comm	_VRAM_UsageByFirmware,4,2       ; @VRAM_UsageByFirmware
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"atom firmware requested %08x %dkb\n"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
