	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function amdgpufb_create
_amdgpufb_create:                       ## @amdgpufb_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	$40, %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, %r15
	movq	24(%rdi), %r12
	movq	$0, -48(%rbp)
	movl	12(%rsi), %eax
	movl	%eax, -56(%rbp)
	movl	8(%rsi), %eax
	movl	%eax, -60(%rbp)
	movl	(%rsi), %edi
	cmpl	$24, %edi
	jne	LBB0_2
## %bb.1:
	movl	$32, (%rbx)
	movl	$32, %edi
LBB0_2:
	movl	4(%rbx), %esi
	callq	_drm_mode_legacy_fb_format
	movl	%eax, -64(%rbp)
	leaq	-64(%rbp), %rsi
	leaq	-48(%rbp), %rdx
	movq	%r15, %rdi
	callq	_amdgpufb_create_pinned_object
	testl	%eax, %eax
	je	LBB0_5
## %bb.3:
	movl	%eax, %r13d
	leaq	L_.str(%rip), %rdi
LBB0_4:
	movl	%r13d, %esi
	callq	_DRM_ERROR
	jmp	LBB0_14
LBB0_5:
	movq	-48(%rbp), %rdi
	callq	_gem_to_amdgpu_bo
	movq	%rax, %r13
	movq	%r15, %rdi
	callq	_drm_fb_helper_alloc_fbi
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movq	%r14, %rdi
	callq	_PTR_ERR
	movl	%eax, %r13d
LBB0_14:
	movl	%r13d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	%r13, -80(%rbp)                 ## 8-byte Spill
	movq	(%r12), %rdi
	leaq	8(%r15), %rsi
	movq	-48(%rbp), %rcx
	leaq	-64(%rbp), %rdx
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	callq	_amdgpu_display_framebuffer_init
	testl	%eax, %eax
	je	LBB0_9
## %bb.8:
	movl	%eax, %r13d
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_4
LBB0_9:
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, (%r15)
	movq	_amdgpufb_ops@GOTPCREL(%rip), %rax
	movq	%rax, 40(%r14)
	movq	-80(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rdi
	callq	_amdgpu_bo_gpu_offset
	subq	8(%r12), %rax
	addq	16(%r12), %rax
	movq	%rax, (%r14)
	movq	%r13, %rdi
	callq	_amdgpu_bo_size
	movq	%rax, 8(%r14)
	movq	%r13, %rdi
	callq	_amdgpu_bo_kptr
	movq	%rax, 16(%r14)
	movq	%r13, %rdi
	callq	_amdgpu_bo_size
	movq	%rax, 32(%r14)
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%rbx, %rdx
	callq	_drm_fb_helper_fill_info
	movq	(%r12), %rax
	movl	4(%rax), %eax
	movq	24(%r14), %rcx
	movq	(%rcx), %rcx
	movl	%eax, 4(%rcx)
	movl	24(%r12), %eax
	movl	%eax, (%rcx)
	cmpq	$0, 16(%r14)
	je	LBB0_11
## %bb.10:
	movq	(%r14), %rsi
	leaq	L_.str.2(%rip), %rdi
	callq	_DRM_INFO
	movq	16(%r12), %rsi
	leaq	L_.str.3(%rip), %rdi
	callq	_DRM_INFO
	movq	%r13, %rdi
	callq	_amdgpu_bo_size
	leaq	L_.str.4(%rip), %rdi
	movq	%rax, %rsi
	callq	_DRM_INFO
	movq	16(%r15), %rax
	movq	(%rax), %rsi
	leaq	L_.str.5(%rip), %rdi
	callq	_DRM_INFO
	movq	8(%r15), %rax
	movq	(%rax), %rsi
	leaq	L_.str.6(%rip), %rdi
	callq	_DRM_INFO
	movq	(%r12), %rax
	movl	(%rax), %edi
	movq	%r14, %rsi
	callq	_vga_switcheroo_client_fb_set
	xorl	%r13d, %r13d
	jmp	LBB0_14
LBB0_11:
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movq	_ENOSPC@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	testl	%r13d, %r13d
	je	LBB0_12
## %bb.13:
	negl	%r13d
	movq	-48(%rbp), %rdi
	callq	_drm_gem_object_put_unlocked
	movq	%rbx, %rdi
	callq	_drm_framebuffer_unregister_private
	movq	%rbx, %rdi
	callq	_drm_framebuffer_cleanup
	movq	%rbx, %rdi
	callq	_kfree
	jmp	LBB0_14
LBB0_12:
	xorl	%r13d, %r13d
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to create fbcon object %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"failed to initialize framebuffer %d\n"

	.comm	_amdgpufb_ops,4,2               ## @amdgpufb_ops
	.comm	_ENOSPC,4,2                     ## @ENOSPC
L_.str.2:                               ## @.str.2
	.asciz	"fb mappable at 0x%lX\n"

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

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

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

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

	.no_dead_strip	_amdgpufb_create
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function amdgpufb_create
_amdgpufb_create:                       ; @amdgpufb_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	x19, x0
	ldr	x25, [x0, #24]
	str	xzr, [sp, #8]
	ldr	d0, [x1, #8]
	stur	d0, [sp, #20]
	ldr	w0, [x1]
	cmp	w0, #24
	b.ne	LBB0_2
; %bb.1:
	mov	w0, #32
	str	w0, [x21]
LBB0_2:
	ldr	w1, [x21, #4]
	bl	_drm_mode_legacy_fb_format
	str	w0, [sp, #16]
	add	x1, sp, #16
	add	x2, sp, #8
	mov	x0, x19
	bl	_amdgpufb_create_pinned_object
	cbz	w0, LBB0_5
; %bb.3:
	mov	x24, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
LBB0_4:
	mov	x1, x24
	bl	_DRM_ERROR
	b	LBB0_7
LBB0_5:
	ldr	x0, [sp, #8]
	bl	_gem_to_amdgpu_bo
	mov	x22, x0
	mov	x0, x19
	bl	_drm_fb_helper_alloc_fbi
	mov	x20, x0
	bl	_IS_ERR
	cbz	x0, LBB0_8
; %bb.6:
	mov	x0, x20
	bl	_PTR_ERR
	mov	x24, x0
LBB0_7:
	mov	x0, x24
	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, [x25]
	add	x23, x19, #8
	ldr	x3, [sp, #8]
	add	x2, sp, #16
	mov	x1, x23
	bl	_amdgpu_display_framebuffer_init
	cbz	w0, LBB0_10
; %bb.9:
	mov	x24, x0
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_4
LBB0_10:
	str	x23, [x19]
Lloh4:
	adrp	x8, _amdgpufb_ops@GOTPAGE
Lloh5:
	ldr	x8, [x8, _amdgpufb_ops@GOTPAGEOFF]
	str	x8, [x20, #40]
	mov	x0, x22
	bl	_amdgpu_bo_gpu_offset
	ldp	x8, x9, [x25, #8]
	sub	x8, x0, x8
	add	x8, x8, x9
	str	x8, [x20]
	mov	x0, x22
	bl	_amdgpu_bo_size
	str	x0, [x20, #8]
	mov	x0, x22
	bl	_amdgpu_bo_kptr
	str	x0, [x20, #16]
	mov	x0, x22
	bl	_amdgpu_bo_size
	str	x0, [x20, #32]
	mov	x0, x20
	mov	x1, x19
	mov	x2, x21
	bl	_drm_fb_helper_fill_info
	ldr	x8, [x25]
	ldr	w8, [x8, #4]
	ldr	x9, [x20, #24]
	ldr	x9, [x9]
	str	w8, [x9, #4]
	ldr	w8, [x25, #24]
	str	w8, [x9]
	ldr	x8, [x20, #16]
	cbz	x8, LBB0_12
; %bb.11:
	ldr	x1, [x20]
Lloh6:
	adrp	x0, l_.str.2@PAGE
Lloh7:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DRM_INFO
	ldr	x1, [x25, #16]
Lloh8:
	adrp	x0, l_.str.3@PAGE
Lloh9:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_DRM_INFO
	mov	x0, x22
	bl	_amdgpu_bo_size
	mov	x1, x0
Lloh10:
	adrp	x0, l_.str.4@PAGE
Lloh11:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_DRM_INFO
	ldr	x8, [x19, #16]
	ldr	x1, [x8]
Lloh12:
	adrp	x0, l_.str.5@PAGE
Lloh13:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_DRM_INFO
	ldr	x8, [x19, #8]
	ldr	x1, [x8]
Lloh14:
	adrp	x0, l_.str.6@PAGE
Lloh15:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_DRM_INFO
	ldr	x8, [x25]
	ldr	w0, [x8]
	mov	x1, x20
	bl	_vga_switcheroo_client_fb_set
	mov	w24, #0
	b	LBB0_7
LBB0_12:
Lloh16:
	adrp	x8, _ENOSPC@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ENOSPC@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	cbz	w8, LBB0_14
; %bb.13:
	neg	w24, w8
	ldr	x0, [sp, #8]
	bl	_drm_gem_object_put_unlocked
	mov	x0, x23
	bl	_drm_framebuffer_unregister_private
	mov	x0, x23
	bl	_drm_framebuffer_cleanup
	mov	x0, x23
	bl	_kfree
	b	LBB0_7
LBB0_14:
	mov	w24, #0
	b	LBB0_7
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to create fbcon object %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"failed to initialize framebuffer %d\n"

	.comm	_amdgpufb_ops,4,2               ; @amdgpufb_ops
	.comm	_ENOSPC,4,2                     ; @ENOSPC
l_.str.2:                               ; @.str.2
	.asciz	"fb mappable at 0x%lX\n"

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

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

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

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

	.no_dead_strip	_amdgpufb_create
.subsections_via_symbols
