	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_peek                           ## -- Begin function peek
	.p2align	4, 0x90
_peek:                                  ## @peek
	.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
	movq	_length@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	movl	%eax, %ecx
	cmpq	%rsi, %rcx
	movq	%rsi, %r15
	cmovbq	%rax, %r15
	cmpq	$-1, %rax
	cmoveq	%rsi, %r15
	testq	%r15, %r15
	je	LBB0_9
## %bb.1:
	movq	%rdi, %r14
	movq	_EOF@GOTPCREL(%rip), %r12
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	xorl	%eax, %eax
	callq	_getchar
	cmpl	(%r12), %eax
	je	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%eax, (%r14)
	addq	$4, %r14
	incq	%r13
	cmpq	%r13, %r15
	jne	LBB0_2
## %bb.4:
	movq	%r15, %r13
LBB0_5:
	testq	%r13, %r13
	je	LBB0_9
## %bb.6:
	xorl	%ebx, %ebx
	movq	_stdin@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	-4(%r14,%rbx,4), %edi
	movl	(%r15), %esi
	callq	_ungetc
	decq	%rbx
	movq	%r13, %rax
	addq	%rbx, %rax
	jne	LBB0_7
	jmp	LBB0_10
LBB0_9:
	xorl	%r13d, %r13d
LBB0_10:
	movq	%r13, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_length,4,2                     ## @length
	.comm	_EOF,4,2                        ## @EOF
	.comm	_stdin,4,2                      ## @stdin
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_peek                           ; -- Begin function peek
	.p2align	2
_peek:                                  ; @peek
	.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, _length@GOTPAGE
Lloh1:
	ldr	x8, [x8, _length@GOTPAGEOFF]
Lloh2:
	ldrsw	x8, [x8]
	and	x9, x8, #0xffffffff
	cmp	x9, x1
	mov	x9, #-1
	ccmp	x8, x9, #4, lo
	csel	x21, x8, x1, ne
	cbz	x21, LBB0_8
; %bb.1:
	mov	x20, x0
	mov	x19, #0
Lloh3:
	adrp	x22, _EOF@GOTPAGE
Lloh4:
	ldr	x22, [x22, _EOF@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	bl	_getchar
	ldr	w8, [x22]
	cmp	w0, w8
	b.eq	LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	str	w0, [x20], #4
	add	x19, x19, #1
	cmp	x21, x19
	b.ne	LBB0_2
; %bb.4:
	mov	x19, x21
LBB0_5:
	cbz	x19, LBB0_9
; %bb.6:
	mov	x21, #0
	sub	x20, x20, #4
Lloh5:
	adrp	x22, _stdin@GOTPAGE
Lloh6:
	ldr	x22, [x22, _stdin@GOTPAGEOFF]
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x20, x21, lsl #2]
	ldr	w1, [x22]
	bl	_ungetc
	sub	x21, x21, #1
	cmn	x19, x21
	b.ne	LBB0_7
	b	LBB0_9
LBB0_8:
	mov	x19, #0
LBB0_9:
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_length,4,2                     ; @length
	.comm	_EOF,4,2                        ; @EOF
	.comm	_stdin,4,2                      ; @stdin
.subsections_via_symbols
