	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fill_readbuf
_fill_readbuf:                          ## @fill_readbuf
	.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
	testq	%rdx, %rdx
	je	LBB0_6
## %bb.1:
	movl	%ecx, %r13d
	movq	%rdx, %rbx
	movq	%rsi, %r15
	movq	%rdi, %r14
	callq	_port_has_data
	testl	%eax, %eax
	je	LBB0_6
## %bb.2:
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	movq	16(%r14), %r12
	movq	(%r12), %rsi
	subq	8(%r12), %rsi
	movq	%rbx, %rdi
	callq	_min
	movq	%rax, %r15
	movq	8(%r12), %rsi
	addq	16(%r12), %rsi
	testl	%r13d, %r13d
	je	LBB0_7
## %bb.3:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r15, %rdx
	callq	_copy_to_user
	testq	%rax, %rax
	je	LBB0_8
## %bb.4:
	movq	_EFAULT@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subq	(%rax), %r15
	jmp	LBB0_12
LBB0_6:
	xorl	%r15d, %r15d
LBB0_12:
	movq	%r15, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r15, %rdx
	callq	_memcpy
LBB0_8:
	movq	8(%r12), %rax
	addq	%r15, %rax
	movq	%rax, 8(%r12)
	cmpq	(%r12), %rax
	jne	LBB0_12
## %bb.9:
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movq	$0, 16(%r14)
	movl	8(%r14), %edi
	movq	%r12, %rsi
	callq	_add_inbuf
	testq	%rax, %rax
	jns	LBB0_11
## %bb.10:
	movl	4(%r14), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_warn
LBB0_11:
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_EFAULT,8,3                     ## @EFAULT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed add_buf\n"

	.no_dead_strip	_fill_readbuf
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fill_readbuf
_fill_readbuf:                          ; @fill_readbuf
	.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, x2
	cbz	x2, LBB0_11
; %bb.1:
	mov	x23, x3
	mov	x22, x1
	mov	x19, x0
	bl	_port_has_data
	cbz	w0, LBB0_5
; %bb.2:
	ldr	x21, [x19, #16]
	ldp	x8, x9, [x21]
	sub	x1, x8, x9
	mov	x0, x20
	bl	_min
	mov	x20, x0
	ldp	x9, x8, [x21, #8]
	add	x1, x9, x8
	mov	x0, x22
	mov	x2, x20
	cbz	w23, LBB0_6
; %bb.3:
	bl	_copy_to_user
	cbz	x0, LBB0_7
; %bb.4:
Lloh0:
	adrp	x8, _EFAULT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	neg	x20, x8
	b	LBB0_11
LBB0_5:
	mov	x20, #0
	b	LBB0_11
LBB0_6:
	bl	_memcpy
LBB0_7:
	ldp	x9, x8, [x21]
	add	x8, x8, x20
	cmp	x8, x9
	str	x8, [x21, #8]
	b.ne	LBB0_11
; %bb.8:
	mov	x0, x19
	bl	_spin_lock_irqsave
	str	xzr, [x19, #16]
	ldr	w0, [x19, #8]
	mov	x1, x21
	bl	_add_inbuf
	tbz	x0, #63, LBB0_10
; %bb.9:
	ldr	w0, [x19, #4]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_warn
LBB0_10:
	mov	x0, x19
	bl	_spin_unlock_irqrestore
LBB0_11:
	mov	x0, x20
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_EFAULT,8,3                     ; @EFAULT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed add_buf\n"

	.no_dead_strip	_fill_readbuf
.subsections_via_symbols
