	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_khrn_cache_lookup              ## -- Begin function khrn_cache_lookup
	.p2align	4, 0x90
_khrn_cache_lookup:                     ## @khrn_cache_lookup
	.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
	movl	%ecx, %ebx
	movq	%rsi, %r15
	movq	%rdi, %r12
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movq	%rdx, %rdi
	movl	%ecx, %esi
	movl	%r8d, %edx
	callq	_hash
	movl	%eax, %r14d
	leaq	24(%r15), %r13
	movq	%r13, %rdi
	movl	%eax, %esi
	callq	_khrn_pointer_map_lookup
	testq	%rax, %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	je	LBB0_4
## %bb.1:
	cmpl	%ebx, (%rax)
	jl	LBB0_4
## %bb.2:
	movq	8(%rax), %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movl	%ebx, %edx
	callq	_memcmp
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	testl	%eax, %eax
	je	LBB0_3
LBB0_4:
	movl	%r14d, -64(%rbp)                ## 4-byte Spill
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	leal	23(%rbx), %edi
	callq	__msb
	movq	_CACHE_LOG2_BLOCK_SIZE@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	subq	%rcx, %rax
	leaq	2(%rax), %rdi
	movl	$1, %esi
	callq	__max
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movl	%eax, %r14d
	testq	%rdx, %rdx
	je	LBB0_6
## %bb.5:
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_discard
LBB0_6:
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_heap_avail
	testl	%eax, %eax
	jne	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_grow
	testq	%rax, %rax
	jne	LBB0_7
LBB0_9:
	leaq	8(%r15), %r13
	movq	32(%r15), %rbx
	cmpq	%r13, %rbx
	je	LBB0_13
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_heap_avail
	testl	%eax, %eax
	jne	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	%r12, %rdi
	movq	%r15, %rsi
	movq	%rbx, %rdx
	callq	_discard
	movq	8(%rbx), %rbx
	cmpq	%r13, %rbx
	jne	LBB0_11
LBB0_13:
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_heap_avail
	movl	$-1, %ecx
	testl	%eax, %eax
	je	LBB0_18
## %bb.14:
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_heap_alloc
	movl	%eax, %edx
	movq	(%r15), %rax
	movq	_CACHE_LOG2_BLOCK_SIZE@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	%edx, -60(%rbp)                 ## 4-byte Spill
	shll	%cl, %edx
	movslq	%edx, %rcx
	leaq	(%rax,%rcx,4), %r14
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	movl	%edx, (%rax,%rcx,4)
	movl	-64(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, 4(%rax,%rcx,4)
	movq	8(%rax,%rcx,4), %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_platform_memcpy
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %esi
	movq	%r14, %rdx
	callq	_khrn_pointer_map_insert
	testl	%eax, %eax
	je	LBB0_15
## %bb.16:
	leaq	16(%r14), %rdi
	movl	8(%r15), %esi
	movq	%r13, %rdx
	callq	_link_insert
	movq	%r14, %rsi
	subq	(%r15), %rsi
	shrq	$2, %rsi
	movq	%r12, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_send_create
	movq	8(%r14), %rsi
	subq	(%r15), %rsi
	shrq	$2, %rsi
	movq	%r12, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
                                        ## kill: def $ecx killed $ecx killed $rcx
	callq	_send_data
	movq	%r14, %rcx
	jmp	LBB0_17
LBB0_15:
	movq	%r15, %rdi
	movl	-60(%rbp), %esi                 ## 4-byte Reload
	callq	_heap_free
	movl	$-1, %ecx
	jmp	LBB0_18
LBB0_3:
	movq	%rcx, %r14
	addq	$16, %r14
	movq	%r14, %rdi
	callq	_link_remove
	leaq	8(%r15), %rdx
	movl	8(%r15), %esi
	movq	%r14, %rdi
	callq	_link_insert
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
LBB0_17:
	subq	(%r15), %rcx
	shrq	$2, %rcx
LBB0_18:
	movl	%ecx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CACHE_LOG2_BLOCK_SIZE,4,2      ## @CACHE_LOG2_BLOCK_SIZE
	.comm	_xxx_first,4,2                  ## @xxx_first
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_khrn_cache_lookup              ; -- Begin function khrn_cache_lookup
	.p2align	2
_khrn_cache_lookup:                     ; @khrn_cache_lookup
	.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
	mov	x20, x3
	mov	x21, x2
	mov	x19, x1
	mov	x22, x0
	mov	x0, x2
	mov	x1, x3
	mov	x2, x4
	bl	_hash
	mov	x23, x0
	add	x24, x19, #24
	mov	x0, x24
	mov	x1, x23
	bl	_khrn_pointer_map_lookup
	mov	x25, x0
	cbz	x0, LBB0_3
; %bb.1:
	ldr	w8, [x25]
	cmp	w8, w20
	b.lt	LBB0_3
; %bb.2:
	ldr	x0, [x25, #8]
	mov	x1, x21
	mov	x2, x20
	bl	_memcmp
	cbz	w0, LBB0_15
LBB0_3:
	add	w0, w20, #23
	bl	__msb
Lloh0:
	adrp	x28, _CACHE_LOG2_BLOCK_SIZE@GOTPAGE
Lloh1:
	ldr	x28, [x28, _CACHE_LOG2_BLOCK_SIZE@GOTPAGEOFF]
	ldrsw	x8, [x28]
	sub	x8, x0, x8
	add	x0, x8, #2
	mov	w1, #1
	bl	__max
	mov	x27, x0
	cbz	x25, LBB0_5
; %bb.4:
	mov	x0, x22
	mov	x1, x19
	mov	x2, x25
	bl	_discard
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x27
	bl	_heap_avail
	cbnz	w0, LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x22
	mov	x1, x19
	bl	_grow
	cbnz	x0, LBB0_5
LBB0_7:
	add	x26, x19, #8
	ldr	x25, [x19, #32]
	cmp	x25, x26
	b.eq	LBB0_10
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x27
	bl	_heap_avail
	cbnz	w0, LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x22
	mov	x1, x19
	mov	x2, x25
	bl	_discard
	ldr	x25, [x25, #8]
	cmp	x25, x26
	b.ne	LBB0_8
LBB0_10:
	mov	x0, x19
	mov	x1, x27
	bl	_heap_avail
	cbz	w0, LBB0_13
; %bb.11:
	mov	x0, x19
	mov	x1, x27
	bl	_heap_alloc
	mov	x27, x0
	ldr	x8, [x19]
	ldr	w9, [x28]
	lsl	w9, w0, w9
	add	x25, x8, w9, sxtw #2
	stp	w20, w23, [x25]
	ldr	x0, [x25, #8]
	mov	x1, x21
	mov	x2, x20
	bl	_platform_memcpy
	mov	x0, x24
	mov	x1, x23
	mov	x2, x25
	bl	_khrn_pointer_map_insert
	cbz	w0, LBB0_14
; %bb.12:
	add	x0, x25, #16
	ldr	w1, [x19, #8]
	mov	x2, x26
	bl	_link_insert
	ldr	x8, [x19]
	sub	x8, x25, x8
	lsr	x1, x8, #2
	mov	x0, x22
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_send_create
	ldr	x8, [x25, #8]
	ldr	x9, [x19]
	sub	x8, x8, x9
	lsr	x1, x8, #2
	mov	x0, x22
                                        ; kill: def $w1 killed $w1 killed $x1
	mov	x2, x21
	mov	x3, x20
	bl	_send_data
	b	LBB0_16
LBB0_13:
	mov	w0, #-1
	b	LBB0_17
LBB0_14:
	mov	x0, x19
	mov	x1, x27
	bl	_heap_free
	mov	w0, #-1
	b	LBB0_17
LBB0_15:
	add	x20, x25, #16
	mov	x0, x20
	bl	_link_remove
	mov	x2, x19
	ldr	w1, [x2, #8]!
	mov	x0, x20
	bl	_link_insert
LBB0_16:
	ldr	x8, [x19]
	sub	x8, x25, x8
	lsr	x0, x8, #2
LBB0_17:
                                        ; kill: def $w0 killed $w0 killed $x0
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_CACHE_LOG2_BLOCK_SIZE,4,2      ; @CACHE_LOG2_BLOCK_SIZE
	.comm	_xxx_first,4,2                  ; @xxx_first
.subsections_via_symbols
