	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vc_filesys_write_sectors       ## -- Begin function vc_filesys_write_sectors
	.p2align	4, 0x90
_vc_filesys_write_sectors:              ## @vc_filesys_write_sectors
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, %r14
	movq	%rcx, %rbx
	movq	%rdx, %r15
	movq	%rsi, %r13
	movq	%rdi, %r12
	callq	_strlen
	movq	_FS_MAX_PATH@GOTPCREL(%rip), %rdx
	movl	$-1, %ecx
	cmpl	%eax, (%rdx)
	jle	LBB0_11
## %bb.1:
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	%r12, -72(%rbp)                 ## 8-byte Spill
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	xorl	%eax, %eax
	callq	_lock_obtain
	movl	$-1, %ecx
	testq	%rax, %rax
	jne	LBB0_11
## %bb.2:
	movq	_vc_filesys_client@GOTPCREL(%rip), %r14
	movq	(%r14), %rax
	movq	%r13, (%rax)
	movq	%rbx, 8(%rax)
	movq	_VCHI_BULK_ALIGN@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	decq	%rcx
	andq	%r15, %rcx
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	%rcx, 16(%rax)
	movq	16(%r14), %rdi
	movq	_FS_MAX_PATH@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	callq	_strncpy
	movq	_VC_FILESYS_WRITE_SECTORS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	addl	$17, %edx
	movq	%r14, %rdi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_vchi_msg_stub_noblock
	movl	$-1, %ecx
	testq	%rax, %rax
	jne	LBB0_10
## %bb.3:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	subq	%rax, %r15
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	testq	%rbx, %rbx
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	_FILESERV_MAX_BULK_SECTOR@GOTPCREL(%rip), %rcx
	movq	(%rcx), %r12
	cmpq	%r12, %rbx
	cmovlq	%rbx, %r12
	movl	28(%r14), %r13d
	movq	_FILESERV_SECTOR_LENGTH@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdi
	imulq	%r12, %rdi
	addq	%rax, %rdi
	callq	_VCHI_BULK_ROUND_UP
	movq	_VCHI_FLAGS_BLOCK_UNTIL_DATA_READ@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%r13d, %edi
	movq	%r15, %rsi
	movl	%eax, %edx
	xorl	%r8d, %r8d
	callq	_vchi_bulk_queue_transmit
	movq	_FILESERV_MAX_BULK@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	addq	%rcx, %r15
	subq	%r12, %rbx
	testq	%rax, %rax
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	je	LBB0_4
LBB0_6:
	leaq	24(%r14), %rdi
	callq	_vcos_event_wait
	movq	_VCOS_SUCCESS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_9
## %bb.7:
	movq	8(%r14), %rax
	movq	_FILESERV_RESP_OK@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_9
## %bb.8:
	movq	(%r14), %rax
	movq	(%rax), %rax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, (%rcx)
	xorl	%ecx, %ecx
	jmp	LBB0_10
LBB0_9:
	movq	(%r14), %rax
	movq	8(%rax), %rcx
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movq	%rcx, (%rdx)
	movl	(%rax), %ecx
LBB0_10:
	xorl	%eax, %eax
	movl	%ecx, %ebx
	callq	_lock_release
	movl	%ebx, %ecx
LBB0_11:
	movl	%ecx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_FS_MAX_PATH,4,2                ## @FS_MAX_PATH
	.comm	_vc_filesys_client,32,3         ## @vc_filesys_client
	.comm	_VCHI_BULK_ALIGN,4,2            ## @VCHI_BULK_ALIGN
	.comm	_VC_FILESYS_WRITE_SECTORS,4,2   ## @VC_FILESYS_WRITE_SECTORS
	.comm	_FILESERV_MAX_BULK_SECTOR,8,3   ## @FILESERV_MAX_BULK_SECTOR
	.comm	_FILESERV_SECTOR_LENGTH,8,3     ## @FILESERV_SECTOR_LENGTH
	.comm	_VCHI_FLAGS_BLOCK_UNTIL_DATA_READ,4,2 ## @VCHI_FLAGS_BLOCK_UNTIL_DATA_READ
	.comm	_FILESERV_MAX_BULK,4,2          ## @FILESERV_MAX_BULK
	.comm	_VCOS_SUCCESS,8,3               ## @VCOS_SUCCESS
	.comm	_FILESERV_RESP_OK,8,3           ## @FILESERV_RESP_OK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vc_filesys_write_sectors       ; -- Begin function vc_filesys_write_sectors
	.p2align	2
_vc_filesys_write_sectors:              ; @vc_filesys_write_sectors
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x4
	mov	x21, x3
	mov	x22, x2
	mov	x25, x1
	mov	x24, x0
	bl	_strlen
	mov	x23, x0
Lloh0:
	adrp	x26, _FS_MAX_PATH@GOTPAGE
Lloh1:
	ldr	x26, [x26, _FS_MAX_PATH@GOTPAGEOFF]
	ldr	w8, [x26]
	cmp	w8, w23
	b.le	LBB0_2
; %bb.1:
	bl	_lock_obtain
	cbz	x0, LBB0_4
LBB0_2:
	mov	w21, #-1
LBB0_3:
	mov	x0, x21
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_4:
Lloh2:
	adrp	x20, _vc_filesys_client@GOTPAGE
Lloh3:
	ldr	x20, [x20, _vc_filesys_client@GOTPAGEOFF]
	ldr	x8, [x20]
	stp	x25, x21, [x8]
Lloh4:
	adrp	x9, _VCHI_BULK_ALIGN@GOTPAGE
Lloh5:
	ldr	x9, [x9, _VCHI_BULK_ALIGN@GOTPAGEOFF]
Lloh6:
	ldrsw	x9, [x9]
	sub	x9, x9, #1
	and	x25, x9, x22
	str	x25, [x8, #16]
	ldr	x0, [x20, #16]
	ldr	w2, [x26]
	mov	x1, x24
	bl	_strncpy
Lloh7:
	adrp	x8, _VC_FILESYS_WRITE_SECTORS@GOTPAGE
Lloh8:
	ldr	x8, [x8, _VC_FILESYS_WRITE_SECTORS@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	add	w2, w23, #17
	mov	x0, x20
	bl	_vchi_msg_stub_noblock
	cbz	x0, LBB0_6
; %bb.5:
	mov	w21, #-1
	b	LBB0_13
LBB0_6:
	str	x19, [sp, #8]                   ; 8-byte Folded Spill
	sub	x22, x22, x25
Lloh10:
	adrp	x24, _FILESERV_MAX_BULK_SECTOR@GOTPAGE
Lloh11:
	ldr	x24, [x24, _FILESERV_MAX_BULK_SECTOR@GOTPAGEOFF]
Lloh12:
	adrp	x26, _FILESERV_SECTOR_LENGTH@GOTPAGE
Lloh13:
	ldr	x26, [x26, _FILESERV_SECTOR_LENGTH@GOTPAGEOFF]
Lloh14:
	adrp	x27, _VCHI_FLAGS_BLOCK_UNTIL_DATA_READ@GOTPAGE
Lloh15:
	ldr	x27, [x27, _VCHI_FLAGS_BLOCK_UNTIL_DATA_READ@GOTPAGEOFF]
Lloh16:
	adrp	x28, _FILESERV_MAX_BULK@GOTPAGE
Lloh17:
	ldr	x28, [x28, _FILESERV_MAX_BULK@GOTPAGEOFF]
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	cbz	x21, LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	x8, [x24]
	cmp	x21, x8
	csel	x19, x21, x8, lt
	ldr	w23, [x20, #28]
	ldr	x8, [x26]
	madd	x0, x8, x19, x25
	bl	_VCHI_BULK_ROUND_UP
	mov	x2, x0
	ldr	w3, [x27]
	mov	x0, x23
	mov	x1, x22
	mov	x4, #0
	bl	_vchi_bulk_queue_transmit
	ldrsw	x8, [x28]
	add	x22, x22, x8
	sub	x21, x21, x19
	cbz	x0, LBB0_7
LBB0_9:
	add	x0, x20, #24
	bl	_vcos_event_wait
Lloh18:
	adrp	x8, _VCOS_SUCCESS@GOTPAGE
Lloh19:
	ldr	x8, [x8, _VCOS_SUCCESS@GOTPAGEOFF]
Lloh20:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_12
; %bb.10:
	ldr	x8, [x20, #8]
Lloh21:
	adrp	x9, _FILESERV_RESP_OK@GOTPAGE
Lloh22:
	ldr	x9, [x9, _FILESERV_RESP_OK@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_12
; %bb.11:
	mov	w21, #0
	ldr	x8, [x20]
	ldr	x8, [x8]
	ldr	x9, [sp, #8]                    ; 8-byte Folded Reload
	str	x8, [x9]
	b	LBB0_13
LBB0_12:
	ldr	x8, [x20]
	ldr	x9, [x8, #8]
	ldr	x10, [sp, #8]                   ; 8-byte Folded Reload
	str	x9, [x10]
	ldr	w21, [x8]
LBB0_13:
	bl	_lock_release
	b	LBB0_3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_FS_MAX_PATH,4,2                ; @FS_MAX_PATH
	.comm	_vc_filesys_client,32,3         ; @vc_filesys_client
	.comm	_VCHI_BULK_ALIGN,4,2            ; @VCHI_BULK_ALIGN
	.comm	_VC_FILESYS_WRITE_SECTORS,4,2   ; @VC_FILESYS_WRITE_SECTORS
	.comm	_FILESERV_MAX_BULK_SECTOR,8,3   ; @FILESERV_MAX_BULK_SECTOR
	.comm	_FILESERV_SECTOR_LENGTH,8,3     ; @FILESERV_SECTOR_LENGTH
	.comm	_VCHI_FLAGS_BLOCK_UNTIL_DATA_READ,4,2 ; @VCHI_FLAGS_BLOCK_UNTIL_DATA_READ
	.comm	_FILESERV_MAX_BULK,4,2          ; @FILESERV_MAX_BULK
	.comm	_VCOS_SUCCESS,8,3               ; @VCOS_SUCCESS
	.comm	_FILESERV_RESP_OK,8,3           ; @FILESERV_RESP_OK
.subsections_via_symbols
