	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function radeonfb_create
_radeonfb_create:                       ## @radeonfb_create
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r12
	movq	32(%rdi), %r14
	movq	$0, -56(%rbp)
	movq	24(%r14), %r15
	movl	20(%rsi), %eax
	movl	%eax, -64(%rbp)
	movl	16(%rsi), %eax
	movl	%eax, -68(%rbp)
	movl	(%rsi), %edi
	cmpl	$24, %edi
	jne	LBB0_4
## %bb.1:
	movq	%r14, %rdi
	callq	_ASIC_IS_AVIVO
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	movl	$32, (%rbx)
	movl	$32, %edi
	jmp	LBB0_4
LBB0_2:
	movl	(%rbx), %edi
LBB0_4:
	movl	12(%rbx), %esi
	callq	_drm_mode_legacy_fb_format
	movl	%eax, -72(%rbp)
	leaq	-72(%rbp), %rsi
	leaq	-56(%rbp), %rdx
	movq	%r12, %rdi
	callq	_radeonfb_create_pinned_object
	testl	%eax, %eax
	je	LBB0_7
## %bb.5:
	movl	%eax, %r13d
	leaq	L_.str(%rip), %rdi
LBB0_6:
	movl	%r13d, %esi
	callq	_DRM_ERROR
LBB0_17:
	movl	%r13d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	-56(%rbp), %rdi
	callq	_gem_to_radeon_bo
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	xorl	%r13d, %r13d
	xorl	%edi, %edi
	movq	%r15, %rsi
	callq	_framebuffer_alloc
	testq	%rax, %rax
	je	LBB0_8
## %bb.9:
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	movq	%r12, 64(%rax)
	movq	(%r14), %rdi
	leaq	16(%r12), %r15
	movq	-56(%rbp), %rcx
	leaq	-72(%rbp), %rdx
	movq	%r15, %rsi
	callq	_radeon_framebuffer_init
	testl	%eax, %eax
	je	LBB0_11
## %bb.10:
	movl	%eax, %r13d
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_6
LBB0_8:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r13d
	jmp	LBB0_17
LBB0_11:
	movq	%r15, -80(%rbp)                 ## 8-byte Spill
	movq	%r15, 8(%r12)
	movq	-96(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, (%r12)
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	(%rdi), %rax
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	callq	_radeon_bo_size
	xorl	%r13d, %r13d
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	xorl	%esi, %esi
	movq	%rax, %rdx
	callq	_memset_io
	movl	24(%r15), %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_strcpy
	movq	16(%r12), %rax
	movq	24(%r12), %rdx
	movq	(%rax), %rsi
	movq	%r15, %rdi
	callq	_drm_fb_helper_fill_fix
	movq	_FBINFO_DEFAULT@GOTPCREL(%rip), %rax
	movq	_FBINFO_CAN_FORCE_OUTPUT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movl	%ecx, (%r15)
	movq	_radeonfb_ops@GOTPCREL(%rip), %rax
	movq	%rax, 56(%r15)
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_radeon_bo_gpu_offset
	subq	8(%r14), %rax
	addq	16(%r14), %rax
	movq	%rax, 8(%r15)
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_radeon_bo_size
	movq	%rax, 16(%r15)
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	(%rdi), %rax
	movq	%rax, 40(%r15)
	callq	_radeon_bo_size
	movq	%rax, 48(%r15)
	movl	4(%rbx), %ecx
	movl	8(%rbx), %edx
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_drm_fb_helper_fill_var
	cmpq	$0, 40(%r15)
	je	LBB0_12
## %bb.13:
	movq	%r15, %rdi
	addq	$32, %rdi
	movl	$256, %esi                      ## imm = 0x100
	xorl	%edx, %edx
	callq	_fb_alloc_cmap
	testl	%eax, %eax
	je	LBB0_18
## %bb.14:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_15
LBB0_12:
	movq	_ENOSPC@GOTPCREL(%rip), %rax
LBB0_15:
	movq	-80(%rbp), %r14                 ## 8-byte Reload
	movl	(%rax), %ebx
	testl	%ebx, %ebx
	je	LBB0_17
## %bb.16:
	negl	%ebx
	movq	-56(%rbp), %rdi
	callq	_drm_gem_object_unreference
	movq	%r14, %rdi
	callq	_drm_framebuffer_unregister_private
	movq	%r14, %rdi
	callq	_drm_framebuffer_cleanup
	movq	%r14, %rdi
	callq	_kfree
	movl	%ebx, %r13d
	jmp	LBB0_17
LBB0_18:
	movq	8(%r15), %rsi
	leaq	L_.str.3(%rip), %rdi
	callq	_DRM_INFO
	movq	16(%r14), %rsi
	leaq	L_.str.4(%rip), %rdi
	callq	_DRM_INFO
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_radeon_bo_size
	leaq	L_.str.5(%rip), %rdi
	movq	%rax, %rsi
	callq	_DRM_INFO
	movq	24(%r12), %rsi
	leaq	L_.str.6(%rip), %rdi
	callq	_DRM_INFO
	movq	16(%r12), %rax
	movq	(%rax), %rsi
	leaq	L_.str.7(%rip), %rdi
	callq	_DRM_INFO
	movq	(%r14), %rax
	movl	(%rax), %edi
	movq	%r15, %rsi
	callq	_vga_switcheroo_client_fb_set
	xorl	%r13d, %r13d
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to create fbcon object %d\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.1:                               ## @.str.1
	.asciz	"failed to initalise framebuffer %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"radeondrmfb"

	.comm	_FBINFO_DEFAULT,4,2             ## @FBINFO_DEFAULT
	.comm	_FBINFO_CAN_FORCE_OUTPUT,4,2    ## @FBINFO_CAN_FORCE_OUTPUT
	.comm	_radeonfb_ops,4,2               ## @radeonfb_ops
	.comm	_ENOSPC,4,2                     ## @ENOSPC
L_.str.3:                               ## @.str.3
	.asciz	"fb mappable at 0x%lX\n"

L_.str.4:                               ## @.str.4
	.asciz	"vram apper at 0x%lX\n"

L_.str.5:                               ## @.str.5
	.asciz	"size %lu\n"

L_.str.6:                               ## @.str.6
	.asciz	"fb depth is %d\n"

L_.str.7:                               ## @.str.7
	.asciz	"   pitch is %d\n"

	.no_dead_strip	_radeonfb_create
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function radeonfb_create
_radeonfb_create:                       ; @radeonfb_create
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x21, x1
	mov	x20, x0
	ldr	x19, [x0, #32]
	str	xzr, [sp, #8]
	ldr	x22, [x19, #24]
	ldr	d0, [x1, #16]
	stur	d0, [sp, #20]
	ldr	w0, [x1]
	cmp	w0, #24
	b.ne	LBB0_4
; %bb.1:
	mov	x0, x19
	bl	_ASIC_IS_AVIVO
	cbz	x0, LBB0_3
; %bb.2:
	mov	w0, #32
	str	w0, [x21]
	b	LBB0_4
LBB0_3:
	ldr	w0, [x21]
LBB0_4:
	ldr	w1, [x21, #12]
	bl	_drm_mode_legacy_fb_format
	str	w0, [sp, #16]
	add	x1, sp, #16
	add	x2, sp, #8
	mov	x0, x20
	bl	_radeonfb_create_pinned_object
	cbz	w0, LBB0_8
; %bb.5:
	mov	x25, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
LBB0_6:
	mov	x1, x25
	bl	_DRM_ERROR
LBB0_7:
	mov	x0, x25
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_8:
	ldr	x0, [sp, #8]
	bl	_gem_to_radeon_bo
	mov	x24, x0
	mov	w0, #0
	mov	x1, x22
	bl	_framebuffer_alloc
	cbz	x0, LBB0_11
; %bb.9:
	mov	x22, x0
	str	x20, [x0, #64]
	ldr	x0, [x19]
	add	x23, x20, #16
	ldr	x3, [sp, #8]
	add	x2, sp, #16
	mov	x1, x23
	bl	_radeon_framebuffer_init
	cbz	w0, LBB0_12
; %bb.10:
	mov	x25, x0
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_6
LBB0_11:
Lloh4:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w25, w8
	b	LBB0_7
LBB0_12:
	stp	x22, x23, [x20]
	ldr	x25, [x24]
	mov	x0, x24
	bl	_radeon_bo_size
	mov	x2, x0
	mov	x0, x25
	mov	w1, #0
	bl	_memset_io
	ldr	w0, [x22, #24]
Lloh7:
	adrp	x1, l_.str.2@PAGE
Lloh8:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_strcpy
	ldp	x8, x2, [x20, #16]
	ldr	x1, [x8]
	mov	x0, x22
	bl	_drm_fb_helper_fill_fix
Lloh9:
	adrp	x8, _FBINFO_DEFAULT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _FBINFO_DEFAULT@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	adrp	x9, _FBINFO_CAN_FORCE_OUTPUT@GOTPAGE
Lloh13:
	ldr	x9, [x9, _FBINFO_CAN_FORCE_OUTPUT@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [x22]
Lloh15:
	adrp	x8, _radeonfb_ops@GOTPAGE
Lloh16:
	ldr	x8, [x8, _radeonfb_ops@GOTPAGEOFF]
	str	x8, [x22, #56]
	mov	x0, x24
	bl	_radeon_bo_gpu_offset
	ldp	x8, x9, [x19, #8]
	sub	x8, x0, x8
	add	x8, x8, x9
	str	x8, [x22, #8]
	mov	x0, x24
	bl	_radeon_bo_size
	str	x0, [x22, #16]
	ldr	x8, [x24]
	str	x8, [x22, #40]
	mov	x0, x24
	bl	_radeon_bo_size
	str	x0, [x22, #48]
	ldp	w3, w2, [x21, #4]
	mov	x0, x22
	mov	x1, x20
	bl	_drm_fb_helper_fill_var
	ldr	x8, [x22, #40]
	cbz	x8, LBB0_16
; %bb.13:
	add	x0, x22, #32
	mov	w1, #256
	mov	w2, #0
	bl	_fb_alloc_cmap
	cbz	w0, LBB0_18
; %bb.14:
Lloh17:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	cbz	w8, LBB0_17
LBB0_15:
	neg	w25, w8
	ldr	x0, [sp, #8]
	bl	_drm_gem_object_unreference
	mov	x0, x23
	bl	_drm_framebuffer_unregister_private
	mov	x0, x23
	bl	_drm_framebuffer_cleanup
	mov	x0, x23
	bl	_kfree
	b	LBB0_7
LBB0_16:
Lloh20:
	adrp	x8, _ENOSPC@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ENOSPC@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	cbnz	w8, LBB0_15
LBB0_17:
	mov	w25, #0
	b	LBB0_7
LBB0_18:
	ldr	x1, [x22, #8]
Lloh23:
	adrp	x0, l_.str.3@PAGE
Lloh24:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_DRM_INFO
	ldr	x1, [x19, #16]
Lloh25:
	adrp	x0, l_.str.4@PAGE
Lloh26:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_DRM_INFO
	mov	x0, x24
	bl	_radeon_bo_size
	mov	x1, x0
Lloh27:
	adrp	x0, l_.str.5@PAGE
Lloh28:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_DRM_INFO
	ldr	x1, [x20, #24]
Lloh29:
	adrp	x0, l_.str.6@PAGE
Lloh30:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_DRM_INFO
	ldr	x8, [x20, #16]
	ldr	x1, [x8]
Lloh31:
	adrp	x0, l_.str.7@PAGE
Lloh32:
	add	x0, x0, l_.str.7@PAGEOFF
	bl	_DRM_INFO
	ldr	x8, [x19]
	ldr	w0, [x8]
	mov	x1, x22
	bl	_vga_switcheroo_client_fb_set
	mov	w25, #0
	b	LBB0_7
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpAdd	Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to create fbcon object %d\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.1:                               ; @.str.1
	.asciz	"failed to initalise framebuffer %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"radeondrmfb"

	.comm	_FBINFO_DEFAULT,4,2             ; @FBINFO_DEFAULT
	.comm	_FBINFO_CAN_FORCE_OUTPUT,4,2    ; @FBINFO_CAN_FORCE_OUTPUT
	.comm	_radeonfb_ops,4,2               ; @radeonfb_ops
	.comm	_ENOSPC,4,2                     ; @ENOSPC
l_.str.3:                               ; @.str.3
	.asciz	"fb mappable at 0x%lX\n"

l_.str.4:                               ; @.str.4
	.asciz	"vram apper at 0x%lX\n"

l_.str.5:                               ; @.str.5
	.asciz	"size %lu\n"

l_.str.6:                               ; @.str.6
	.asciz	"fb depth is %d\n"

l_.str.7:                               ; @.str.7
	.asciz	"   pitch is %d\n"

	.no_dead_strip	_radeonfb_create
.subsections_via_symbols
