	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function buffer_gets
_buffer_gets:                           ## @buffer_gets
	.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
	movl	%edx, %r12d
	movq	%rsi, %r15
	movq	%rdi, %r13
	movq	8(%rdi), %r14
	decl	%r12d
	callq	_BIO_clear_retry_flags
	movl	(%r14), %ebx
	xorl	%eax, %eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_5 Depth 2
	testl	%ebx, %ebx
	jg	LBB0_2
## %bb.13:                              ##   in Loop: Header=BB0_1 Depth=1
	movl	(%r13), %edi
	movq	8(%r14), %rsi
	movl	24(%r14), %edx
	callq	_BIO_read
	movl	%eax, %ebx
	testl	%eax, %eax
	jle	LBB0_14
## %bb.16:                              ##   in Loop: Header=BB0_1 Depth=1
	movl	%ebx, (%r14)
	movq	$0, 16(%r14)
	jmp	LBB0_1
LBB0_2:                                 ##   in Loop: Header=BB0_1 Depth=1
	testl	%r12d, %r12d
	jle	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	8(%r14), %rdx
	addq	16(%r14), %rdx
	movl	%r12d, %esi
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_5:                                 ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%rax, %rcx
	movzbl	(%rdx,%rax), %eax
	movb	%al, (%r15,%rcx)
	cmpb	$10, (%rdx,%rcx)
	je	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=2
	leaq	1(%rcx), %rax
	movslq	(%r14), %rbx
	cmpq	%rbx, %rax
	jge	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=2
	cmpq	%rsi, %rax
	jb	LBB0_5
LBB0_9:                                 ##   in Loop: Header=BB0_1 Depth=1
	addq	%rcx, %r15
	incq	%r15
	xorl	%ecx, %ecx
	jmp	LBB0_10
LBB0_3:                                 ##   in Loop: Header=BB0_1 Depth=1
	xorl	%ecx, %ecx
	xorl	%eax, %eax
	jmp	LBB0_10
LBB0_6:                                 ##   in Loop: Header=BB0_1 Depth=1
	leal	1(%rcx), %eax
	movl	(%r14), %ebx
	addq	%rcx, %r15
	incq	%r15
	movb	$1, %cl
LBB0_10:                                ##   in Loop: Header=BB0_1 Depth=1
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	addl	%eax, %edx
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	subl	%eax, %ebx
	movl	%ebx, (%r14)
	movslq	%eax, %rdx
	addq	%rdx, 16(%r14)
	testb	%cl, %cl
	jne	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_1 Depth=1
	subl	%eax, %r12d
	jne	LBB0_1
LBB0_12:
	movb	$0, (%r15)
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	jmp	LBB0_18
LBB0_14:
	movq	%r13, %rdi
	callq	_BIO_copy_next_retry
	movb	$0, (%r15)
	testl	%ebx, %ebx
	js	LBB0_17
## %bb.15:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	jmp	LBB0_18
LBB0_17:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	testl	%eax, %eax
	cmovgl	%eax, %ebx
	movl	%ebx, %eax
LBB0_18:
                                        ## kill: def $eax killed $eax killed $rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_buffer_gets
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function buffer_gets
_buffer_gets:                           ; @buffer_gets
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x20, x1
	mov	x21, x0
	ldr	x23, [x0, #8]
	sub	w24, w2, #1
	bl	_BIO_clear_retry_flags
	mov	w19, #0
	ldr	w22, [x23]
LBB0_1:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_6 Depth 2
	cmp	w22, #1
	b.ge	LBB0_4
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w0, [x21]
	ldr	x1, [x23, #8]
	ldr	w2, [x23, #24]
	bl	_BIO_read
	mov	x22, x0
	cmp	w0, #0
	b.le	LBB0_14
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	str	w22, [x23]
	str	xzr, [x23, #16]
	b	LBB0_1
LBB0_4:                                 ;   in Loop: Header=BB0_1 Depth=1
	cmp	w24, #1
	b.lt	LBB0_9
; %bb.5:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x8, #0
	ldp	x9, x10, [x23, #8]
	add	x9, x9, x10
	mov	w11, w24
LBB0_6:                                 ;   Parent Loop BB0_1 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x10, x8
	ldrb	w8, [x9, x8]
	strb	w8, [x20, x10]
	ldrb	w8, [x9, x10]
	cmp	w8, #10
	b.eq	LBB0_10
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=2
	add	x8, x10, #1
	ldrsw	x22, [x23]
	cmp	x8, x22
	ccmp	x8, x11, #2, lt
	b.lo	LBB0_6
; %bb.8:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	w9, #0
	add	x10, x20, x10
	add	x20, x10, #1
	b	LBB0_11
LBB0_9:                                 ;   in Loop: Header=BB0_1 Depth=1
	mov	w9, #0
	mov	w8, #0
	b	LBB0_11
LBB0_10:                                ;   in Loop: Header=BB0_1 Depth=1
	add	w8, w10, #1
	ldr	w22, [x23]
	add	x9, x20, x10
	add	x20, x9, #1
	mov	w9, #1
LBB0_11:                                ;   in Loop: Header=BB0_1 Depth=1
	add	w19, w8, w19
	sub	w22, w22, w8
	str	w22, [x23]
	ldr	x10, [x23, #16]
	add	x10, x10, w8, sxtw
	str	x10, [x23, #16]
	tbnz	w9, #0, LBB0_13
; %bb.12:                               ;   in Loop: Header=BB0_1 Depth=1
	sub	w24, w24, w8
	cbnz	w24, LBB0_1
LBB0_13:
	strb	wzr, [x20]
	b	LBB0_15
LBB0_14:
	mov	x0, x21
	bl	_BIO_copy_next_retry
	strb	wzr, [x20]
	cmp	w19, #0
	csel	w8, w19, w22, gt
	tst	w22, #0x80000000
	csel	w19, w19, w8, eq
LBB0_15:
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_buffer_gets
.subsections_via_symbols
