	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sshbuf_dup_string              ## -- Begin function sshbuf_dup_string
	.p2align	4, 0x90
_sshbuf_dup_string:                     ## @sshbuf_dup_string
	.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	%rdi, %rbx
	callq	_sshbuf_ptr
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	_sshbuf_len
	xorl	%ebx, %ebx
	testq	%r14, %r14
	je	LBB0_13
## %bb.1:
	movq	%rax, %r15
	movq	_SIZE_MAX@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r15
	ja	LBB0_13
## %bb.2:
	testq	%r15, %r15
	je	LBB0_6
## %bb.3:
	movq	%r14, %rdi
	xorl	%esi, %esi
	movq	%r15, %rdx
	callq	_memchr
	testq	%rax, %rax
	je	LBB0_8
## %bb.4:
	leaq	(%r14,%r15,4), %rcx
	addq	$-4, %rcx
	cmpq	%rcx, %rax
	jne	LBB0_12
## %bb.7:
	decq	%r15
	jmp	LBB0_8
LBB0_6:
	xorl	%r15d, %r15d
LBB0_8:
	leaq	1(%r15), %rdi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_12
## %bb.9:
	movq	%rax, %rbx
	testq	%r15, %r15
	je	LBB0_11
## %bb.10:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movq	%r15, %rdx
	callq	_memcpy
LBB0_11:
	movb	$0, (%rbx,%r15)
	jmp	LBB0_13
LBB0_12:
	xorl	%ebx, %ebx
LBB0_13:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SIZE_MAX,8,3                   ## @SIZE_MAX
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sshbuf_dup_string              ; -- Begin function sshbuf_dup_string
	.p2align	2
_sshbuf_dup_string:                     ; @sshbuf_dup_string
	.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	x20, x0
	bl	_sshbuf_ptr
	mov	x19, x0
	mov	x0, x20
	bl	_sshbuf_len
	mov	x21, #0
	cbz	x19, LBB0_11
; %bb.1:
	mov	x20, x0
Lloh0:
	adrp	x8, _SIZE_MAX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SIZE_MAX@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x0, x8
	b.hi	LBB0_11
; %bb.2:
	cbz	x20, LBB0_7
; %bb.3:
	mov	x0, x19
	mov	w1, #0
	mov	x2, x20
	bl	_memchr
	cbz	x0, LBB0_7
; %bb.4:
	add	x8, x19, x20, lsl #2
	sub	x8, x8, #4
	cmp	x0, x8
	b.eq	LBB0_6
; %bb.5:
	mov	x21, #0
	b	LBB0_11
LBB0_6:
	sub	x20, x20, #1
LBB0_7:
	add	x0, x20, #1
	bl	_malloc
	mov	x21, x0
	cbz	x0, LBB0_11
; %bb.8:
	cbz	x20, LBB0_10
; %bb.9:
	mov	x0, x21
	mov	x1, x19
	mov	x2, x20
	bl	_memcpy
LBB0_10:
	strb	wzr, [x21, x20]
LBB0_11:
	mov	x0, x21
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_SIZE_MAX,8,3                   ; @SIZE_MAX
.subsections_via_symbols
