	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function radeonfb_create_pinned_object
_radeonfb_create_pinned_object:         ## @radeonfb_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, %r13
	movq	%rsi, %rbx
	movq	(%rdi), %r12
	movq	$0, -48(%rbp)
	movl	(%rsi), %r15d
	movl	12(%r12), %edi
	callq	_drm_get_format_info
	movq	(%rax), %rax
	movl	(%rax), %edx
	movl	16(%rbx), %esi
	movq	%r12, %rdi
	xorl	%ecx, %ecx
	callq	_radeon_align_pitch
	movq	8(%rbx), %rcx
	movl	%eax, (%rcx)
	movq	(%r12), %rcx
	movq	_CHIP_R600@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jl	LBB0_2
## %bb.1:
	movl	(%rbx), %edi
	movl	$8, %esi
	callq	_ALIGN
	movl	%eax, %r15d
	movq	8(%rbx), %rax
	movl	(%rax), %eax
LBB0_2:
	imull	%r15d, %eax
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	callq	_ALIGN
	movl	%eax, %ebx
	movq	_RADEON_GEM_DOMAIN_VRAM@GOTPCREL(%rip), %r15
	movl	(%r15), %ecx
	leaq	-48(%rbp), %rax
	movq	%rax, (%rsp)
	xorl	%r14d, %r14d
	movq	%r12, %rdi
	movl	%ebx, %esi
	xorl	%edx, %edx
	xorl	%r8d, %r8d
	movl	$1, %r9d
	callq	_radeon_gem_object_create
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	callq	_pr_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
	jmp	LBB0_10
LBB0_4:
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	movq	-48(%rbp), %rdi
	callq	_gem_to_radeon_bo
	movq	%rax, %rbx
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	_radeon_bo_reserve
	movl	%eax, %r13d
	xorl	%edi, %edi
	testl	%eax, %eax
	setne	%dil
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_7
## %bb.5:
	movl	(%r15), %r14d
	movq	%r12, %rdi
	callq	_ASIC_IS_AVIVO
	xorl	%edx, %edx
	testq	%rax, %rax
	sete	%dl
	shll	$27, %edx
	movq	%rbx, %rdi
	movl	%r14d, %esi
	xorl	%ecx, %ecx
	callq	_radeon_bo_pin_restricted
	testl	%eax, %eax
	je	LBB0_8
## %bb.6:
	movl	%eax, %r13d
	movq	%rbx, %rdi
	callq	_radeon_bo_unreserve
	jmp	LBB0_7
LBB0_8:
	xorl	%r14d, %r14d
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_radeon_bo_kmap
	movl	%eax, %r13d
	movq	%rbx, %rdi
	callq	_radeon_bo_unreserve
	testl	%r13d, %r13d
	je	LBB0_9
LBB0_7:
	movq	-48(%rbp), %rdi
	callq	_radeonfb_destroy_pinned_object
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	$0, (%rax)
	movl	%r13d, %r14d
LBB0_10:
	movl	%r14d, %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	_CHIP_R600,8,3                  ## @CHIP_R600
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_RADEON_GEM_DOMAIN_VRAM,4,2     ## @RADEON_GEM_DOMAIN_VRAM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to allocate framebuffer (%d)\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_RADEON_TILING_MACRO,4,2        ## @RADEON_TILING_MACRO
	.comm	_RADEON_TILING_SURFACE,4,2      ## @RADEON_TILING_SURFACE
	.comm	_RADEON_TILING_SWAP_16BIT,4,2   ## @RADEON_TILING_SWAP_16BIT
	.comm	_RADEON_TILING_SWAP_32BIT,4,2   ## @RADEON_TILING_SWAP_32BIT
	.no_dead_strip	_radeonfb_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 radeonfb_create_pinned_object
_radeonfb_create_pinned_object:         ; @radeonfb_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	x21, x1
	ldr	x20, [x0]
	str	xzr, [sp, #8]
	ldr	w22, [x1]
	ldr	w0, [x20, #12]
	bl	_drm_get_format_info
	ldr	x8, [x0]
	ldr	w2, [x8]
	ldr	w1, [x21, #16]
	mov	x0, x20
	mov	w3, #0
	bl	_radeon_align_pitch
	ldr	x8, [x21, #8]
	str	w0, [x8]
	ldr	x8, [x20]
Lloh0:
	adrp	x9, _CHIP_R600@GOTPAGE
Lloh1:
	ldr	x9, [x9, _CHIP_R600@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.lt	LBB0_2
; %bb.1:
	ldr	w0, [x21]
	mov	w1, #8
	bl	_ALIGN
	mov	x22, x0
	ldr	x8, [x21, #8]
	ldr	w0, [x8]
LBB0_2:
	mul	w0, w0, w22
Lloh3:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_ALIGN
	mov	x21, x0
Lloh6:
	adrp	x23, _RADEON_GEM_DOMAIN_VRAM@GOTPAGE
Lloh7:
	ldr	x23, [x23, _RADEON_GEM_DOMAIN_VRAM@GOTPAGEOFF]
	ldr	w3, [x23]
	add	x6, sp, #8
	mov	x0, x20
	mov	x1, x21
	mov	w2, #0
	mov	w4, #0
	mov	w5, #1
	bl	_radeon_gem_object_create
	cbz	w0, LBB0_4
; %bb.3:
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	bl	_pr_err
Lloh10:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_9
LBB0_4:
	ldr	x0, [sp, #8]
	bl	_gem_to_radeon_bo
	mov	x21, x0
	mov	w1, #0
	bl	_radeon_bo_reserve
	mov	x22, x0
	cmp	w0, #0
	cset	w0, ne
	bl	_unlikely
	cbnz	x0, LBB0_8
; %bb.5:
	ldr	w22, [x23]
	mov	x0, x20
	bl	_ASIC_IS_AVIVO
	cmp	x0, #0
	cset	w8, eq
	lsl	w2, w8, #27
	mov	x0, x21
	mov	x1, x22
	mov	x3, #0
	bl	_radeon_bo_pin_restricted
	cbz	w0, LBB0_7
; %bb.6:
	mov	x22, x0
	mov	x0, x21
	bl	_radeon_bo_unreserve
	b	LBB0_8
LBB0_7:
	mov	x0, x21
	mov	x1, #0
	bl	_radeon_bo_kmap
	mov	x22, x0
	mov	x0, x21
	bl	_radeon_bo_unreserve
	cbz	w22, LBB0_10
LBB0_8:
	ldr	x0, [sp, #8]
	bl	_radeonfb_destroy_pinned_object
	str	xzr, [x19]
LBB0_9:
	mov	x0, x22
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_CHIP_R600,8,3                  ; @CHIP_R600
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_RADEON_GEM_DOMAIN_VRAM,4,2     ; @RADEON_GEM_DOMAIN_VRAM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to allocate framebuffer (%d)\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_RADEON_TILING_MACRO,4,2        ; @RADEON_TILING_MACRO
	.comm	_RADEON_TILING_SURFACE,4,2      ; @RADEON_TILING_SURFACE
	.comm	_RADEON_TILING_SWAP_16BIT,4,2   ; @RADEON_TILING_SWAP_16BIT
	.comm	_RADEON_TILING_SWAP_32BIT,4,2   ; @RADEON_TILING_SWAP_32BIT
	.no_dead_strip	_radeonfb_create_pinned_object
.subsections_via_symbols
