	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_readline                       ## -- Begin function readline
	.p2align	4, 0x90
_readline:                              ## @readline
	.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
	movl	%edx, %r15d
	movq	%rsi, %r14
	movq	%rdi, %rbx
	callq	_clearerr
	movq	%r14, %rdi
	movl	%r15d, %esi
	movq	%rbx, %rdx
	callq	_fgets
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%r14, %rdi
	callq	_strlen
                                        ## kill: def $eax killed $eax def $rax
	testl	%eax, %eax
	jle	LBB0_10
## %bb.3:
	leal	-1(%rax), %ecx
	cmpb	$10, (%r14,%rcx)
	jne	LBB0_4
## %bb.5:
	movb	$0, (%r14,%rcx)
	testl	%ecx, %ecx
	je	LBB0_6
## %bb.7:
	addl	$-2, %eax
	movq	%rax, %rdx
	movl	%eax, %esi
	jmp	LBB0_8
LBB0_1:
	movl	$-1, %eax
	jmp	LBB0_10
LBB0_4:
	movq	%rcx, %rdx
	movl	%ecx, %esi
	movl	%eax, %ecx
LBB0_8:
	cmpb	$13, (%r14,%rdx)
	movl	%ecx, %eax
	jne	LBB0_10
## %bb.9:
	movb	$0, (%r14,%rdx)
	movl	%esi, %eax
	jmp	LBB0_10
LBB0_6:
	xorl	%eax, %eax
LBB0_10:
                                        ## kill: def $eax killed $eax killed $rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_readline                       ; -- Begin function readline
	.p2align	2
_readline:                              ; @readline
	.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, x2
	mov	x19, x1
	mov	x21, x0
	bl	_clearerr
	mov	x0, x19
	mov	x1, x20
	mov	x2, x21
	bl	_fgets
	cbz	x0, LBB0_5
; %bb.1:
	mov	x0, x19
	bl	_strlen
	subs	w8, w0, #1
	b.lt	LBB0_10
; %bb.2:
	ldrb	w9, [x19, x8]
	cmp	w9, #10
	b.ne	LBB0_6
; %bb.3:
	strb	wzr, [x19, x8]
	cbz	w8, LBB0_9
; %bb.4:
	sub	w9, w0, #2
	mov	x1, x9
	b	LBB0_7
LBB0_5:
	mov	w0, #-1
	b	LBB0_10
LBB0_6:
	mov	x9, x8
	mov	x1, x8
	mov	x8, x0
LBB0_7:
	ldrb	w10, [x19, x9]
	mov	x0, x8
	cmp	w10, #13
	b.ne	LBB0_10
; %bb.8:
	strb	wzr, [x19, x9]
	mov	x0, x1
	b	LBB0_10
LBB0_9:
	mov	w0, #0
LBB0_10:
	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
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
