	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function amdgpufb_create_pinned_object
_amdgpufb_create_pinned_object:         ## @amdgpufb_create_pinned_object
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r14
	movq	(%rdi), %r13
	movq	_AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED@GOTPCREL(%rip), %rax
	movq	_AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	orl	(%rax), %ebx
	movq	$0, -48(%rbp)
	movq	_AMDGPU_GEM_CREATE_VRAM_CLEARED@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movq	_AMDGPU_GEM_CREATE_CPU_GTT_USWC@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movl	4(%r13), %edi
	callq	_drm_get_format_info
	movq	(%rax), %rax
	movq	(%rax), %rdx
	movl	16(%r14), %esi
	xorl	%r15d, %r15d
	movq	%r13, %rdi
	xorl	%ecx, %ecx
	callq	_amdgpu_align_pitch
	movq	8(%r14), %rcx
	movl	%eax, (%rcx)
	movq	%r13, %rdi
	movl	%ebx, %esi
	callq	_amdgpu_display_supported_domains
	movq	%rax, %r12
	movl	(%r14), %edi
	movl	$8, %esi
	callq	_ALIGN
	movq	8(%r14), %rcx
	imull	(%rcx), %eax
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	callq	_ALIGN
	movl	%eax, %r14d
	movq	_ttm_bo_type_kernel@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	leaq	-48(%rbp), %rax
	movq	%r13, %rdi
	movl	%r14d, %esi
	xorl	%edx, %edx
	movq	%r12, %rcx
	movl	%ebx, %r8d
	pushq	%rax
	pushq	$0
	callq	_amdgpu_gem_object_create
	addq	$16, %rsp
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	movl	%r14d, %esi
	callq	_pr_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	jmp	LBB0_10
LBB0_2:
	movq	-48(%rbp), %rdi
	callq	_gem_to_amdgpu_bo
	movq	%rax, %rbx
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	_amdgpu_bo_reserve
	movl	%eax, %r14d
	xorl	%edi, %edi
	testl	%eax, %eax
	setne	%dil
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_5
## %bb.3:
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_amdgpu_bo_pin
	testl	%eax, %eax
	je	LBB0_6
## %bb.4:
	movl	%eax, %r14d
	movq	%rbx, %rdi
	callq	_amdgpu_bo_unreserve
	jmp	LBB0_5
LBB0_6:
	movq	%rbx, %rdi
	callq	_amdgpu_ttm_alloc_gart
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	movl	%eax, %r14d
	movq	%rbx, %rdi
	callq	_amdgpu_bo_unreserve
	movl	(%r13), %edi
	leaq	L_.str.2(%rip), %rsi
	movq	%rbx, %rdx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_5
LBB0_8:
	xorl	%r15d, %r15d
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_amdgpu_bo_kmap
	movl	%eax, %r14d
	movq	%rbx, %rdi
	callq	_amdgpu_bo_unreserve
	testl	%r14d, %r14d
	je	LBB0_9
LBB0_5:
	movq	-48(%rbp), %rdi
	callq	_amdgpufb_destroy_pinned_object
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	$0, (%rax)
	movl	%r14d, %r15d
LBB0_10:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	-48(%rbp), %rax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, (%rcx)
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED,4,2 ## @AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED
	.comm	_AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS,4,2 ## @AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS
	.comm	_AMDGPU_GEM_CREATE_VRAM_CLEARED,4,2 ## @AMDGPU_GEM_CREATE_VRAM_CLEARED
	.comm	_AMDGPU_GEM_CREATE_CPU_GTT_USWC,4,2 ## @AMDGPU_GEM_CREATE_CPU_GTT_USWC
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_ttm_bo_type_kernel,4,2         ## @ttm_bo_type_kernel
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to allocate framebuffer (%d)\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_ARRAY_MODE,4,2                 ## @ARRAY_MODE
	.comm	_GRPH_ARRAY_2D_TILED_THIN1,4,2  ## @GRPH_ARRAY_2D_TILED_THIN1
L_.str.2:                               ## @.str.2
	.asciz	"%p bind failed\n"

	.no_dead_strip	_amdgpufb_create_pinned_object
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function amdgpufb_create_pinned_object
_amdgpufb_create_pinned_object:         ; @amdgpufb_create_pinned_object
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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, x2
	mov	x23, x1
	ldr	x20, [x0]
	str	xzr, [sp, #8]
Lloh0:
	adrp	x8, _AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED@GOTPAGEOFF]
Lloh2:
	adrp	x9, _AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS@GOTPAGE
Lloh3:
	ldr	x9, [x9, _AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh6:
	adrp	x9, _AMDGPU_GEM_CREATE_VRAM_CLEARED@GOTPAGE
Lloh7:
	ldr	x9, [x9, _AMDGPU_GEM_CREATE_VRAM_CLEARED@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh9:
	adrp	x9, _AMDGPU_GEM_CREATE_CPU_GTT_USWC@GOTPAGE
Lloh10:
	ldr	x9, [x9, _AMDGPU_GEM_CREATE_CPU_GTT_USWC@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	orr	w21, w8, w9
	ldr	w0, [x20, #4]
	bl	_drm_get_format_info
	ldr	x8, [x0]
	ldr	x2, [x8]
	ldr	w1, [x23, #16]
	mov	x0, x20
	mov	w3, #0
	bl	_amdgpu_align_pitch
	ldr	x8, [x23, #8]
	str	w0, [x8]
	mov	x0, x20
	mov	x1, x21
	bl	_amdgpu_display_supported_domains
	mov	x22, x0
	ldr	w0, [x23]
	mov	w1, #8
	bl	_ALIGN
	ldr	x8, [x23, #8]
	ldr	w8, [x8]
	mul	w0, w8, w0
Lloh12:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	bl	_ALIGN
	mov	x23, x0
Lloh15:
	adrp	x8, _ttm_bo_type_kernel@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ttm_bo_type_kernel@GOTPAGEOFF]
Lloh17:
	ldr	w5, [x8]
	add	x7, sp, #8
	mov	x0, x20
	mov	x1, x23
	mov	w2, #0
	mov	x3, x22
	mov	x4, x21
	mov	x6, #0
	bl	_amdgpu_gem_object_create
	cbz	w0, LBB0_2
; %bb.1:
Lloh18:
	adrp	x0, l_.str@PAGE
Lloh19:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x23
	bl	_pr_err
Lloh20:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_9
LBB0_2:
	ldr	x0, [sp, #8]
	bl	_gem_to_amdgpu_bo
	mov	x23, x0
	mov	w1, #0
	bl	_amdgpu_bo_reserve
	mov	x21, x0
	cmp	w0, #0
	cset	w0, ne
	bl	_unlikely
	cbnz	x0, LBB0_8
; %bb.3:
	mov	x0, x23
	mov	x1, x22
	bl	_amdgpu_bo_pin
	cbz	w0, LBB0_5
; %bb.4:
	mov	x21, x0
	mov	x0, x23
	bl	_amdgpu_bo_unreserve
	b	LBB0_8
LBB0_5:
	mov	x0, x23
	bl	_amdgpu_ttm_alloc_gart
	cbz	w0, LBB0_7
; %bb.6:
	mov	x21, x0
	mov	x0, x23
	bl	_amdgpu_bo_unreserve
	ldr	w0, [x20]
	str	x23, [sp]
Lloh23:
	adrp	x1, l_.str.2@PAGE
Lloh24:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_err
	b	LBB0_8
LBB0_7:
	mov	x0, x23
	mov	x1, #0
	bl	_amdgpu_bo_kmap
	mov	x21, x0
	mov	x0, x23
	bl	_amdgpu_bo_unreserve
	cbz	w21, LBB0_10
LBB0_8:
	ldr	x0, [sp, #8]
	bl	_amdgpufb_destroy_pinned_object
	str	xzr, [x19]
LBB0_9:
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_10:
	ldr	x8, [sp, #8]
	str	x8, [x19]
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh4
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED,4,2 ; @AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED
	.comm	_AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS,4,2 ; @AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS
	.comm	_AMDGPU_GEM_CREATE_VRAM_CLEARED,4,2 ; @AMDGPU_GEM_CREATE_VRAM_CLEARED
	.comm	_AMDGPU_GEM_CREATE_CPU_GTT_USWC,4,2 ; @AMDGPU_GEM_CREATE_CPU_GTT_USWC
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_ttm_bo_type_kernel,4,2         ; @ttm_bo_type_kernel
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to allocate framebuffer (%d)\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_ARRAY_MODE,4,2                 ; @ARRAY_MODE
	.comm	_GRPH_ARRAY_2D_TILED_THIN1,4,2  ; @GRPH_ARRAY_2D_TILED_THIN1
l_.str.2:                               ; @.str.2
	.asciz	"%p bind failed\n"

	.no_dead_strip	_amdgpufb_create_pinned_object
.subsections_via_symbols
