	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drainbuf                       ## -- Begin function drainbuf
	.p2align	4, 0x90
_drainbuf:                              ## @drainbuf
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	(%rdx), %rdx
	callq	_write
	cmpl	$-1, %eax
	je	LBB0_1
## %bb.2:
	movl	%eax, %ebx
	testl	%eax, %eax
	jle	LBB0_6
## %bb.3:
	movq	(%r14), %rax
	movl	%ebx, %r12d
	movl	%eax, %edx
	subl	%ebx, %edx
	testl	%edx, %edx
	jle	LBB0_5
## %bb.4:
	leaq	(%r15,%r12), %rsi
	movq	%r15, %rdi
	callq	_memmove
	movq	(%r14), %rax
LBB0_5:
	subq	%r12, %rax
	movq	%rax, (%r14)
	jmp	LBB0_6
LBB0_1:
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_EAGAIN@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	sete	%cl
	movq	_EINTR@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	sete	%al
	orb	%cl, %al
	movzbl	%al, %ebx
	notl	%ebx
LBB0_6:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_errno,8,3                      ## @errno
	.comm	_EAGAIN,8,3                     ## @EAGAIN
	.comm	_EINTR,8,3                      ## @EINTR
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drainbuf                       ; -- Begin function drainbuf
	.p2align	2
_drainbuf:                              ; @drainbuf
	.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	x21, x1
	ldr	x2, [x2]
	bl	_write
	cmn	w0, #1
	b.eq	LBB0_5
; %bb.1:
	mov	x19, x0
	cmp	w0, #1
	b.lt	LBB0_6
; %bb.2:
	ldr	x8, [x20]
	mov	w22, w19
	sub	w2, w8, w19
	cmp	w2, #1
	b.lt	LBB0_4
; %bb.3:
	add	x1, x21, x22
	mov	x0, x21
	bl	_memmove
	ldr	x8, [x20]
LBB0_4:
	sub	x8, x8, x22
	str	x8, [x20]
	b	LBB0_6
LBB0_5:
Lloh0:
	adrp	x8, _errno@GOTPAGE
Lloh1:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _EAGAIN@GOTPAGE
Lloh4:
	ldr	x9, [x9, _EAGAIN@GOTPAGEOFF]
Lloh5:
	adrp	x10, _EINTR@GOTPAGE
Lloh6:
	ldr	x10, [x10, _EINTR@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
Lloh8:
	ldr	x10, [x10]
	cmp	x8, x10
	ccmp	x8, x9, #4, ne
	mov	w8, #-2
	cinc	w19, w8, ne
LBB0_6:
	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	Lloh5, Lloh6, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_errno,8,3                      ; @errno
	.comm	_EAGAIN,8,3                     ; @EAGAIN
	.comm	_EINTR,8,3                      ; @EINTR
.subsections_via_symbols
