	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_realloc                        ## -- Begin function realloc
	.p2align	4, 0x90
_realloc:                               ## @realloc
	.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	%rdi, %r14
	testl	%esi, %esi
	je	LBB0_1
## %bb.2:
	movl	%esi, %r13d
	testq	%r14, %r14
	je	LBB0_21
## %bb.3:
	movq	_malloc_first@GOTPCREL(%rip), %rax
	movq	(%rax), %r12
	testq	%r12, %r12
	je	LBB0_18
## %bb.4:
	movslq	%r14d, %rbx
	addq	$-4, %rbx
	movq	_MALLOC_MAGIC@GOTPCREL(%rip), %r15
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	24(%r12), %r12
	testq	%r12, %r12
	je	LBB0_18
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rax
	cmpq	(%r15), %rax
	jne	LBB0_18
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	cmpq	%rbx, %r12
	jne	LBB0_17
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	leaq	L_.str(%rip), %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_debug
	movslq	8(%rbx), %rax
	cmpl	%r13d, %eax
	je	LBB0_20
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	cmpl	%r13d, %eax
	jg	LBB0_9
## %bb.11:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	24(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_17
## %bb.12:
	movq	16(%rax), %rax
	movq	_MALLOC_FREE@GOTPCREL(%rip), %r12
	cmpq	(%r12), %rax
	jne	LBB0_15
## %bb.13:
	xorl	%eax, %eax
	callq	_malloc_gc
	movq	24(%rbx), %rdx
	movslq	8(%rdx), %rsi
	movslq	8(%rbx), %rcx
	leaq	(%rcx,%rsi), %rdi
	addq	$4, %rdi
	movslq	%r13d, %rax
	cmpq	%rax, %rdi
	jae	LBB0_14
LBB0_15:
	movl	%r13d, %edi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_19
## %bb.16:
	movq	%rax, %r15
	movl	8(%rbx), %edx
	movq	%rax, %rdi
	movq	%r14, %rsi
	callq	_memcpy
	movq	%r14, %rdi
	callq	_free
	movq	%r15, %r14
	jmp	LBB0_20
LBB0_1:
	movq	%r14, %rdi
	callq	_free
	jmp	LBB0_19
LBB0_18:
	leaq	L_.str(%rip), %rdi
	leaq	L_.str.2(%rip), %rsi
	callq	_debug
LBB0_19:
	xorl	%r14d, %r14d
LBB0_20:
	movq	%r14, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_21:
	movl	%r13d, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_malloc                         ## TAILCALL
LBB0_9:
	movslq	%r13d, %rcx
	addq	$4, %rcx
	cmpq	%rax, %rcx
	jae	LBB0_20
## %bb.10:
	movslq	%ebx, %rdx
	leaq	(%rdx,%rcx), %rsi
	movq	_MALLOC_FREE@GOTPCREL(%rip), %rdi
	movq	(%rdi), %rdi
	movq	%rdi, 16(%rdx,%rcx)
	subl	%r13d, %eax
	addl	$-4, %eax
	movl	%eax, 8(%rdx,%rcx)
	movq	(%r15), %rax
	movq	%rax, (%rdx,%rcx)
	movq	24(%rbx), %rax
	movq	%rax, 24(%rdx,%rcx)
	movq	%rsi, 24(%rbx)
	movl	%r13d, 8(%rbx)
	jmp	LBB0_20
LBB0_14:
	addq	%rsi, %rcx
	movslq	%ebx, %rsi
	leaq	(%rax,%rsi), %rdi
	addq	$4, %rdi
	movq	24(%rdx), %rdx
	movq	%rdx, 28(%rax,%rsi)
	movq	(%r12), %rdx
	movq	%rdx, 20(%rax,%rsi)
	subl	%r13d, %ecx
	addl	$-4, %ecx
	movl	%ecx, 12(%rax,%rsi)
	movq	(%r15), %rcx
	movq	%rcx, 4(%rax,%rsi)
	movq	%rdi, 24(%rbx)
	movl	%r13d, 8(%rbx)
	jmp	LBB0_20
	.cfi_endproc
                                        ## -- End function
	.comm	_malloc_first,8,3               ## @malloc_first
	.comm	_MALLOC_MAGIC,8,3               ## @MALLOC_MAGIC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"realloc"

L_.str.1:                               ## @.str.1
	.asciz	"Found hunk"

	.comm	_MALLOC_FREE,8,3                ## @MALLOC_FREE
L_.str.2:                               ## @.str.2
	.asciz	"No hunk found"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_realloc                        ; -- Begin function realloc
	.p2align	2
_realloc:                               ; @realloc
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x0
	cbz	w1, LBB0_14
; %bb.1:
	mov	x20, x1
	cbz	x19, LBB0_18
; %bb.2:
Lloh0:
	adrp	x8, _malloc_first@GOTPAGE
Lloh1:
	ldr	x8, [x8, _malloc_first@GOTPAGEOFF]
Lloh2:
	ldr	x25, [x8]
	cbz	x25, LBB0_15
; %bb.3:
	sxtw	x8, w19
	sub	x23, x8, #4
Lloh3:
	adrp	x24, _MALLOC_MAGIC@GOTPAGE
Lloh4:
	ldr	x24, [x24, _MALLOC_MAGIC@GOTPAGEOFF]
Lloh5:
	adrp	x21, l_.str@PAGE
Lloh6:
	add	x21, x21, l_.str@PAGEOFF
Lloh7:
	adrp	x22, l_.str.1@PAGE
Lloh8:
	add	x22, x22, l_.str.1@PAGEOFF
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	x25, [x25, #24]
	cbz	x25, LBB0_15
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x25]
	ldr	x9, [x24]
	cmp	x8, x9
	b.ne	LBB0_15
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	cmp	x25, x23
	b.ne	LBB0_4
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x21
	mov	x1, x22
	bl	_debug
	ldrsw	x8, [x23, #8]
	cmp	w8, w20
	b.eq	LBB0_17
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	cmp	w8, w20
	b.gt	LBB0_19
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x23, #24]
	cbz	x8, LBB0_4
; %bb.10:
	ldr	x8, [x8, #16]
Lloh9:
	adrp	x21, _MALLOC_FREE@GOTPAGE
Lloh10:
	ldr	x21, [x21, _MALLOC_FREE@GOTPAGEOFF]
	ldr	x9, [x21]
	cmp	x8, x9
	b.ne	LBB0_12
; %bb.11:
	bl	_malloc_gc
	ldr	x9, [x23, #24]
	ldrsw	x8, [x9, #8]
	ldrsw	x10, [x23, #8]
	add	x8, x10, x8
	add	x11, x8, #4
	mov	x10, x20
	sxtw	x10, w10
	cmp	x11, x10
	b.hs	LBB0_21
LBB0_12:
	mov	x0, x20
	bl	_malloc
	cbz	x0, LBB0_16
; %bb.13:
	mov	x20, x0
	ldr	w2, [x23, #8]
	mov	x1, x19
	bl	_memcpy
	mov	x0, x19
	bl	_free
	mov	x19, x20
	b	LBB0_17
LBB0_14:
	mov	x0, x19
	bl	_free
	b	LBB0_16
LBB0_15:
Lloh11:
	adrp	x0, l_.str@PAGE
Lloh12:
	add	x0, x0, l_.str@PAGEOFF
Lloh13:
	adrp	x1, l_.str.2@PAGE
Lloh14:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_debug
LBB0_16:
	mov	x19, #0
LBB0_17:
	mov	x0, x19
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_18:
	mov	x0, x20
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_malloc
LBB0_19:
	sxtw	x9, w20
	add	x9, x9, #4
	cmp	x9, x8
	b.hs	LBB0_17
; %bb.20:
Lloh15:
	adrp	x10, _MALLOC_FREE@GOTPAGE
Lloh16:
	ldr	x10, [x10, _MALLOC_FREE@GOTPAGEOFF]
	add	x9, x9, w23, sxtw
Lloh17:
	ldr	x10, [x10]
	sub	w8, w8, w20
	sub	w8, w8, #4
	str	w8, [x9, #8]
	ldr	x8, [x24]
	str	x8, [x9]
	ldr	x8, [x23, #24]
	stp	x10, x8, [x9, #16]
	str	x9, [x23, #24]
	str	w20, [x23, #8]
	b	LBB0_17
LBB0_21:
	add	x10, x10, w23, sxtw
	ldr	x9, [x9, #24]
	ldr	x11, [x21]
	ldr	x12, [x24]
	str	x12, [x10, #4]!
	stp	x11, x9, [x10, #16]
	sub	w8, w8, w20
	sub	w8, w8, #4
	str	w8, [x10, #8]
	str	x10, [x23, #24]
	str	w20, [x23, #8]
	b	LBB0_17
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_malloc_first,8,3               ; @malloc_first
	.comm	_MALLOC_MAGIC,8,3               ; @MALLOC_MAGIC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"realloc"

l_.str.1:                               ; @.str.1
	.asciz	"Found hunk"

	.comm	_MALLOC_FREE,8,3                ; @MALLOC_FREE
l_.str.2:                               ; @.str.2
	.asciz	"No hunk found"

.subsections_via_symbols
