	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_virtio_gpu_object_get_sg_table ## -- Begin function virtio_gpu_object_get_sg_table
	.p2align	4, 0x90
_virtio_gpu_object_get_sg_table:        ## @virtio_gpu_object_get_sg_table
	.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	%rdi, %r13
	movq	16(%rsi), %rdi
	movq	16(%rdi), %r14
	movl	8(%rsi), %r15d
	movq	$0, -48(%rbp)
	xorl	%r12d, %r12d
	cmpq	$0, (%rsi)
	jne	LBB0_7
## %bb.1:
	movq	%rsi, %rbx
	movq	(%rdi), %rax
	movq	_tt_unpopulated@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_3
## %bb.2:
	movq	8(%rdi), %rax
	movq	(%rax), %rax
	leaq	-48(%rbp), %rsi
	callq	*(%rax)
LBB0_3:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$4, %edi
	callq	_kmalloc
	movq	%rax, (%rbx)
	xorl	%r12d, %r12d
	testq	%rax, %rax
	je	LBB0_6
## %bb.4:
	movl	(%r13), %edi
	callq	_virtio_max_dma_size
	movq	_PAGE_MASK@GOTPCREL(%rip), %rcx
	andq	(%rcx), %rax
	movq	_SCATTERLIST_MAX_SEGMENT@GOTPCREL(%rip), %rcx
	movq	(%rcx), %r9
	cmpq	%r9, %rax
	cmovbq	%rax, %r9
	movq	(%rbx), %rdi
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	%r15d, %r8d
	shll	%cl, %r8d
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rsp)
	movq	%r14, %rsi
	movl	%r15d, %edx
	xorl	%ecx, %ecx
	callq	___sg_alloc_table_from_pages
	testl	%eax, %eax
	je	LBB0_7
## %bb.5:
	movq	(%rbx), %r12
LBB0_6:
	movq	%r12, %rdi
	callq	_kfree
	movq	$0, (%rbx)
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
LBB0_7:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_tt_unpopulated,8,3             ## @tt_unpopulated
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_PAGE_MASK,8,3                  ## @PAGE_MASK
	.comm	_SCATTERLIST_MAX_SEGMENT,8,3    ## @SCATTERLIST_MAX_SEGMENT
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.comm	_ENOMEM,4,2                     ## @ENOMEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_virtio_gpu_object_get_sg_table ; -- Begin function virtio_gpu_object_get_sg_table
	.p2align	2
_virtio_gpu_object_get_sg_table:        ; @virtio_gpu_object_get_sg_table
	.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	x22, x0
	ldr	x0, [x1, #16]
	ldr	x20, [x0, #16]
	ldr	w21, [x1, #8]
	str	xzr, [sp, #8]
	ldr	x8, [x1]
	cbz	x8, LBB0_2
; %bb.1:
	mov	w0, #0
	b	LBB0_8
LBB0_2:
	mov	x19, x1
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _tt_unpopulated@GOTPAGE
Lloh1:
	ldr	x9, [x9, _tt_unpopulated@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.3:
	ldr	x8, [x0, #8]
	ldr	x8, [x8]
	ldr	x8, [x8]
	add	x1, sp, #8
	blr	x8
LBB0_4:
Lloh3:
	adrp	x23, _GFP_KERNEL@GOTPAGE
Lloh4:
	ldr	x23, [x23, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	w0, #4
	bl	_kmalloc
	str	x0, [x19]
	cbz	x0, LBB0_7
; %bb.5:
	ldr	w0, [x22]
	bl	_virtio_max_dma_size
Lloh5:
	adrp	x8, _PAGE_MASK@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PAGE_MASK@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	and	x8, x8, x0
Lloh8:
	adrp	x9, _SCATTERLIST_MAX_SEGMENT@GOTPAGE
Lloh9:
	ldr	x9, [x9, _SCATTERLIST_MAX_SEGMENT@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x8, x9
	csel	x5, x8, x9, lo
	ldr	x0, [x19]
Lloh11:
	adrp	x8, _PAGE_SHIFT@GOTPAGE
Lloh12:
	ldr	x8, [x8, _PAGE_SHIFT@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	lsl	w4, w21, w8
	ldr	w6, [x23]
	mov	x1, x20
	mov	x2, x21
	mov	w3, #0
	bl	___sg_alloc_table_from_pages
	cbz	w0, LBB0_8
; %bb.6:
	ldr	x0, [x19]
LBB0_7:
	bl	_kfree
	str	xzr, [x19]
Lloh14:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_tt_unpopulated,8,3             ; @tt_unpopulated
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_PAGE_MASK,8,3                  ; @PAGE_MASK
	.comm	_SCATTERLIST_MAX_SEGMENT,8,3    ; @SCATTERLIST_MAX_SEGMENT
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
