	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function evbuffer_chain_new
_evbuffer_chain_new:                    ## @evbuffer_chain_new
	.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	_EVBUFFER_CHAIN_MAX@GOTPCREL(%rip), %rax
	movslq	(%rax), %rcx
	movq	_EVBUFFER_CHAIN_SIZE@GOTPCREL(%rip), %r15
	movq	(%r15), %rax
	movq	%rcx, %rdx
	subq	%rax, %rdx
	cmpq	%rdi, %rdx
	jb	LBB0_8
## %bb.2:
	addq	%rdi, %rax
	movl	%ecx, %edx
	shrl	$31, %edx
	addl	%ecx, %edx
	sarl	%edx
	movslq	%edx, %rcx
	cmpq	%rcx, %rax
	jae	LBB0_5
## %bb.3:
	movq	_MIN_BUFFER_SIZE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rcx, %rbx
	addq	%rcx, %rcx
	cmpq	%rax, %rbx
	jb	LBB0_4
	jmp	LBB0_6
LBB0_5:
	movq	%rax, %rbx
LBB0_6:
	movq	%rbx, %rdi
	callq	_mm_malloc
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movq	%rax, %r14
	movq	(%r15), %rdx
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	_memset
	subq	(%r15), %rbx
	movq	%rbx, (%r14)
	movq	_u_char@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r14, %rsi
	callq	_EVBUFFER_CHAIN_EXTRA
	movl	%eax, 12(%r14)
	movl	$1, 8(%r14)
	jmp	LBB0_9
LBB0_8:
	xorl	%r14d, %r14d
LBB0_9:
	movq	%r14, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EVBUFFER_CHAIN_MAX,4,2         ## @EVBUFFER_CHAIN_MAX
	.comm	_EVBUFFER_CHAIN_SIZE,8,3        ## @EVBUFFER_CHAIN_SIZE
	.comm	_MIN_BUFFER_SIZE,8,3            ## @MIN_BUFFER_SIZE
	.comm	_u_char,4,2                     ## @u_char
	.no_dead_strip	_evbuffer_chain_new
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function evbuffer_chain_new
_evbuffer_chain_new:                    ; @evbuffer_chain_new
	.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
Lloh0:
	adrp	x8, _EVBUFFER_CHAIN_MAX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EVBUFFER_CHAIN_MAX@GOTPAGEOFF]
Lloh2:
	ldrsw	x9, [x8]
Lloh3:
	adrp	x21, _EVBUFFER_CHAIN_SIZE@GOTPAGE
Lloh4:
	ldr	x21, [x21, _EVBUFFER_CHAIN_SIZE@GOTPAGEOFF]
	ldr	x8, [x21]
	sub	x10, x9, x8
	cmp	x10, x0
	b.hs	LBB0_2
; %bb.1:
	mov	x19, #0
	b	LBB0_7
LBB0_2:
	add	x8, x8, x0
	cmp	w9, #0
	cinc	w9, w9, lt
	asr	w9, w9, #1
	cmp	x8, w9, sxtw
	mov	x20, x8
	b.hs	LBB0_5
; %bb.3:
Lloh5:
	adrp	x9, _MIN_BUFFER_SIZE@GOTPAGE
Lloh6:
	ldr	x9, [x9, _MIN_BUFFER_SIZE@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x20, x9
	lsl	x9, x9, #1
	cmp	x20, x8
	b.lo	LBB0_4
LBB0_5:
	mov	x0, x20
	bl	_mm_malloc
	mov	x19, x0
	cbz	x0, LBB0_7
; %bb.6:
	ldr	x2, [x21]
	mov	x0, x19
	mov	w1, #0
	bl	_memset
	ldr	x8, [x21]
	sub	x8, x20, x8
	str	x8, [x19]
Lloh8:
	adrp	x8, _u_char@GOTPAGE
Lloh9:
	ldr	x8, [x8, _u_char@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	mov	x1, x19
	bl	_EVBUFFER_CHAIN_EXTRA
	mov	w8, #1
	stp	w8, w0, [x19, #8]
LBB0_7:
	mov	x0, x19
	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	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_EVBUFFER_CHAIN_MAX,4,2         ; @EVBUFFER_CHAIN_MAX
	.comm	_EVBUFFER_CHAIN_SIZE,8,3        ; @EVBUFFER_CHAIN_SIZE
	.comm	_MIN_BUFFER_SIZE,8,3            ; @MIN_BUFFER_SIZE
	.comm	_u_char,4,2                     ; @u_char
	.no_dead_strip	_evbuffer_chain_new
.subsections_via_symbols
