	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function catu_init_sg_table
_catu_init_sg_table:                    ## @catu_init_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r13
	movl	%edx, %r12d
	movl	%esi, %ebx
	movq	%rdi, %r14
	movq	_SZ_1M@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%edx, %edi
	callq	_DIV_ROUND_UP
	movq	_CATU_PAGES_PER_SYSPAGE@GOTPCREL(%rip), %rcx
	cltd
	idivl	(%rcx)
	movl	%eax, %r15d
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	%r12d, %eax
	sarl	%cl, %eax
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	%r15d, %edx
	movl	%eax, %ecx
	movq	%r13, %r8
	callq	_tmc_alloc_sg_table
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	movq	%rbx, %rdi
	callq	_catu_populate_table
	movslq	%r12d, %rcx
	shrq	$10, %rcx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movq	%rbx, %rdx
	movl	%r15d, %r8d
	callq	_dev_dbg
	movq	%rbx, %rdi
	callq	_catu_dump_table
LBB0_2:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SZ_1M,4,2                      ## @SZ_1M
	.comm	_CATU_PAGES_PER_SYSPAGE,4,2     ## @CATU_PAGES_PER_SYSPAGE
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Setup table %p, size %ldKB, %d table pages\n"

	.no_dead_strip	_catu_init_sg_table
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function catu_init_sg_table
_catu_init_sg_table:                    ; @catu_init_sg_table
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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, x3
	mov	x20, x2
	mov	x23, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _SZ_1M@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SZ_1M@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x2
	bl	_DIV_ROUND_UP
Lloh3:
	adrp	x8, _CATU_PAGES_PER_SYSPAGE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CATU_PAGES_PER_SYSPAGE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	sdiv	w21, w0, w8
Lloh6:
	adrp	x8, _PAGE_SHIFT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PAGE_SHIFT@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	asr	w3, w20, w8
	mov	x0, x19
	mov	x1, x23
	mov	x2, x21
	mov	x4, x22
	bl	_tmc_alloc_sg_table
	mov	x22, x0
	bl	_IS_ERR
	cbnz	x0, LBB0_2
; %bb.1:
	mov	x0, x22
	bl	_catu_populate_table
	sxtw	x8, w20
	lsr	x3, x8, #10
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x22
	mov	x4, x21
	bl	_dev_dbg
	mov	x0, x22
	bl	_catu_dump_table
LBB0_2:
	mov	x0, x22
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_SZ_1M,4,2                      ; @SZ_1M
	.comm	_CATU_PAGES_PER_SYSPAGE,4,2     ; @CATU_PAGES_PER_SYSPAGE
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Setup table %p, size %ldKB, %d table pages\n"

	.no_dead_strip	_catu_init_sg_table
.subsections_via_symbols
