	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_write_to                       ## -- Begin function write_to
	.p2align	4, 0x90
_write_to:                              ## @write_to
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%edx, %r14d
	movq	_fd@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	%edi, %rbx
	movl	8(%rax,%rbx,4), %edi
	callq	_write
	movslq	%r14d, %rcx
	xorl	%edi, %edi
	cmpq	%rcx, %rax
	sete	%dil
	callq	_assert
	movq	_log_drive@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_2
## %bb.1:
	movq	_header@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax,%rbx,4), %edx
	leaq	L_.str(%rip), %rdi
	movl	%r14d, %esi
	movl	%ebx, %ecx
	callq	_kprintf
LBB0_2:
	movq	_letter_stat@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax,%rbx,8), %rax
	incl	16(%rax)
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_fd,8,3                         ## @fd
	.comm	_log_drive,8,3                  ## @log_drive
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"write %9d bytes  to  position %12lld in buffer %d\n"

	.comm	_header,8,3                     ## @header
	.comm	_letter_stat,8,3                ## @letter_stat
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_write_to                       ; -- Begin function write_to
	.p2align	2
_write_to:                              ; @write_to
	.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, x0
Lloh0:
	adrp	x8, _fd@GOTPAGE
Lloh1:
	ldr	x8, [x8, _fd@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	add	x8, x8, w0, sxtw #2
	ldr	w0, [x8, #8]
	bl	_write
	cmp	x0, w20, sxtw
	cset	w0, eq
	bl	_assert
Lloh3:
	adrp	x8, _log_drive@GOTPAGE
Lloh4:
	ldr	x8, [x8, _log_drive@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cbz	x8, LBB0_2
; %bb.1:
	mov	x8, x19
	sxtw	x21, w8
Lloh6:
	adrp	x8, _header@GOTPAGE
Lloh7:
	ldr	x8, [x8, _header@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	ldr	w2, [x8, x21, lsl #2]
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	mov	x3, x19
	bl	_kprintf
	b	LBB0_3
LBB0_2:
	sxtw	x21, w19
LBB0_3:
Lloh11:
	adrp	x8, _letter_stat@GOTPAGE
Lloh12:
	ldr	x8, [x8, _letter_stat@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
	ldr	x8, [x8, x21, lsl #3]
	ldr	w9, [x8, #16]
	add	w9, w9, #1
	str	w9, [x8, #16]
	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	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_fd,8,3                         ; @fd
	.comm	_log_drive,8,3                  ; @log_drive
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"write %9d bytes  to  position %12lld in buffer %d\n"

	.comm	_header,8,3                     ; @header
	.comm	_letter_stat,8,3                ; @letter_stat
.subsections_via_symbols
