	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	___wrap_realloc                 ## -- Begin function __wrap_realloc
	.p2align	4, 0x90
___wrap_realloc:                        ## @__wrap_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r14
	testl	$268435456, %r14d               ## imm = 0x10000000
	jne	LBB0_5
## %bb.1:
	callq	___real_realloc
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_6
## %bb.2:
	movq	%r15, %rdi
	callq	__mem2_malloc
	testq	%rax, %rax
	je	LBB0_11
## %bb.3:
	movq	%rax, %rbx
	testq	%r14, %r14
	je	LBB0_6
## %bb.4:
	movq	%r14, %rdi
	callq	___real_malloc_usable_size
	cmpq	%r15, %rax
	cmovbq	%rax, %r15
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movq	%r15, %rdx
	callq	_memcpy
	movq	%r14, %rdi
	callq	___real_free
	jmp	LBB0_6
LBB0_5:
	callq	__mem2_realloc
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_6
## %bb.7:
	movq	%r15, %rdi
	callq	___real_malloc
	testq	%rax, %rax
	je	LBB0_11
## %bb.8:
	movq	%rax, %rbx
	testq	%r14, %r14
	je	LBB0_6
## %bb.9:
	movq	_gx_mem2_heap@GOTPCREL(%rip), %rdi
	movq	%r14, %rsi
	callq	___lwp_heap_block_size
	cmpq	%r15, %rax
	cmovbq	%rax, %r15
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movq	%r15, %rdx
	callq	_memcpy
	movq	%r14, %rdi
	callq	__mem2_free
	jmp	LBB0_6
LBB0_11:
	xorl	%ebx, %ebx
LBB0_6:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_gx_mem2_heap,4,2               ## @gx_mem2_heap
	.no_dead_strip	___wrap_realloc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	___wrap_realloc                 ; -- Begin function __wrap_realloc
	.p2align	2
___wrap_realloc:                        ; @__wrap_realloc
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x21, x1
	mov	x19, x0
	tbnz	w19, #28, LBB0_5
; %bb.1:
	mov	x0, x19
	mov	x1, x21
	bl	___real_realloc
	mov	x20, x0
	cbnz	x0, LBB0_9
; %bb.2:
	mov	x0, x21
	bl	__mem2_malloc
	mov	x20, x0
	cbz	x0, LBB0_9
; %bb.3:
	cbz	x19, LBB0_9
; %bb.4:
	mov	x0, x19
	bl	___real_malloc_usable_size
	cmp	x0, x21
	csel	x2, x0, x21, lo
	mov	x0, x20
	mov	x1, x19
	bl	_memcpy
	mov	x0, x19
	bl	___real_free
	b	LBB0_9
LBB0_5:
	mov	x0, x19
	mov	x1, x21
	bl	__mem2_realloc
	mov	x20, x0
	cbnz	x0, LBB0_9
; %bb.6:
	mov	x0, x21
	bl	___real_malloc
	mov	x20, x0
	cbz	x0, LBB0_9
; %bb.7:
	cbz	x19, LBB0_9
; %bb.8:
Lloh0:
	adrp	x0, _gx_mem2_heap@GOTPAGE
Lloh1:
	ldr	x0, [x0, _gx_mem2_heap@GOTPAGEOFF]
	mov	x1, x19
	bl	___lwp_heap_block_size
	cmp	x0, x21
	csel	x2, x0, x21, lo
	mov	x0, x20
	mov	x1, x19
	bl	_memcpy
	mov	x0, x19
	bl	__mem2_free
LBB0_9:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_gx_mem2_heap,4,2               ; @gx_mem2_heap
	.no_dead_strip	___wrap_realloc
.subsections_via_symbols
