	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function uninorth_create_gatt_table
_uninorth_create_gatt_table:            ## @uninorth_create_gatt_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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	40(%rdi), %rax
	movq	(%rax), %rax
	movq	_LVL2_APER_SIZE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_14
LBB0_2:
	movq	%rdi, %r12
	movl	(%rdi), %r14d
	movq	32(%rdi), %r15
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	callq	_A_SIZE_32
	movq	%r15, %rdi
	callq	_A_SIZE_32
	movl	4(%rax), %r13d
	movq	%r15, %rdi
	callq	_A_SIZE_32
	movl	8(%rax), %ebx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r13d, %esi
	callq	___get_free_pages
	testq	%rax, %rax
	jne	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	incl	%r14d
	movq	%r12, %rdi
	callq	_A_IDX32
	movq	%rax, 32(%r12)
	movq	40(%r12), %rax
	cmpl	8(%rax), %r14d
	jl	LBB0_3
	jmp	LBB0_13
LBB0_5:
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movl	$1, %ebx
	movl	%r13d, %ecx
	shll	%cl, %ebx
	movl	%r14d, (%r12)
	movq	%rax, %r14
	leal	(,%rbx,8), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kmalloc
	movq	%rax, %rdi
	testq	%rax, %rax
	je	LBB0_12
## %bb.6:
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
	movl	%r13d, %ecx
	shll	%cl, %eax
	cltq
	leaq	(%rax,%r14), %r15
	decq	%r15
	movq	%r14, %r13
	movq	%r14, %rdi
	callq	_virt_to_page
	movq	%rax, %rbx
	movq	%r15, %rdi
	callq	_virt_to_page
	cmpq	%rax, %rbx
	ja	LBB0_9
## %bb.7:
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	callq	_SetPageReserved
	movq	%rbx, (%r14)
	addq	$4, %rbx
	movq	%r15, %rdi
	callq	_virt_to_page
	addq	$8, %r14
	cmpq	%rax, %rbx
	jbe	LBB0_8
LBB0_9:
	movq	%r13, %r14
	movq	%r13, 24(%r12)
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	addq	%rax, %r15
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_flush_dcache_range
	movq	_PAGE_KERNEL_NCG@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	xorl	%ebx, %ebx
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	xorl	%edx, %edx
	callq	_vmap
	movq	%r13, %rdi
	movq	%rax, 8(%r12)
	testq	%rax, %rax
	movl	-44(%rbp), %r13d                ## 4-byte Reload
	je	LBB0_12
## %bb.10:
	movq	%r14, %rdi
	callq	_virt_to_phys
	movl	%eax, 16(%r12)
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	testl	%esi, %esi
	jle	LBB0_15
## %bb.11:
	movq	8(%r12), %rdi
	shlq	$3, %rsi
	callq	___bzero
	jmp	LBB0_15
LBB0_12:
	callq	_kfree
	movq	%r14, %rdi
	movl	%r13d, %esi
	callq	_free_pages
LBB0_13:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_14:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_15:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_LVL2_APER_SIZE,8,3             ## @LVL2_APER_SIZE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_PAGE_KERNEL_NCG,4,2            ## @PAGE_KERNEL_NCG
	.no_dead_strip	_uninorth_create_gatt_table
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function uninorth_create_gatt_table
_uninorth_create_gatt_table:            ; @uninorth_create_gatt_table
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	ldr	x8, [x0, #40]
	ldr	x8, [x8]
Lloh0:
	adrp	x9, _LVL2_APER_SIZE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _LVL2_APER_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_14
LBB0_2:
	mov	x19, x0
	ldr	w23, [x0]
	ldr	x22, [x0, #32]
Lloh5:
	adrp	x24, _GFP_KERNEL@GOTPAGE
Lloh6:
	ldr	x24, [x24, _GFP_KERNEL@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	bl	_A_SIZE_32
	mov	x0, x22
	bl	_A_SIZE_32
	ldr	w20, [x0, #4]
	mov	x0, x22
	bl	_A_SIZE_32
	ldr	w26, [x0, #8]
	ldr	w0, [x24]
	mov	x1, x20
	bl	___get_free_pages
	cbnz	x0, LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	add	w23, w23, #1
	mov	x0, x19
	bl	_A_IDX32
	str	x0, [x19, #32]
	ldr	x8, [x19, #40]
	ldr	w8, [x8, #8]
	cmp	w23, w8
	b.lt	LBB0_3
	b	LBB0_13
LBB0_5:
	mov	x21, x0
	str	w23, [x19]
	mov	w8, #1
	lsl	w23, w8, w20
	lsl	w0, w23, #3
	ldr	w1, [x24]
	bl	_kmalloc
	mov	x22, x0
	cbz	x0, LBB0_12
; %bb.6:
Lloh7:
	adrp	x27, _PAGE_SIZE@GOTPAGE
Lloh8:
	ldr	x27, [x27, _PAGE_SIZE@GOTPAGEOFF]
	ldr	w8, [x27]
	lsl	w8, w8, w20
	sub	w8, w8, #1
	add	x24, x21, w8, sxtw
	mov	x0, x21
	bl	_virt_to_page
	mov	x25, x0
	mov	x0, x24
	bl	_virt_to_page
	cmp	x25, x0
	b.hi	LBB0_9
; %bb.7:
	mov	x28, x22
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x25
	bl	_SetPageReserved
	str	x25, [x28], #8
	add	x25, x25, #4
	mov	x0, x24
	bl	_virt_to_page
	cmp	x25, x0
	b.ls	LBB0_8
LBB0_9:
	str	x21, [x19, #24]
	ldrsw	x8, [x27]
	add	x1, x24, x8
	mov	x0, x21
	bl	_flush_dcache_range
Lloh9:
	adrp	x8, _PAGE_KERNEL_NCG@GOTPAGE
Lloh10:
	ldr	x8, [x8, _PAGE_KERNEL_NCG@GOTPAGEOFF]
Lloh11:
	ldr	w3, [x8]
	mov	x0, x22
	mov	x1, x23
	mov	w2, #0
	bl	_vmap
	str	x0, [x19, #8]
	cbz	x0, LBB0_12
; %bb.10:
	mov	x0, x21
	bl	_virt_to_phys
	str	w0, [x19, #16]
	cmp	w26, #1
	b.lt	LBB0_16
; %bb.11:
	ldr	x0, [x19, #8]
	lsl	x1, x26, #3
	bl	_bzero
	mov	w0, #0
	b	LBB0_15
LBB0_12:
	mov	x0, x22
	bl	_kfree
	mov	x0, x21
	mov	x1, x20
	bl	_free_pages
LBB0_13:
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_14:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_15:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_16:
	mov	w0, #0
	b	LBB0_15
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_LVL2_APER_SIZE,8,3             ; @LVL2_APER_SIZE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_PAGE_KERNEL_NCG,4,2            ; @PAGE_KERNEL_NCG
	.no_dead_strip	_uninorth_create_gatt_table
.subsections_via_symbols
