	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dowrite                        ## -- Begin function dowrite
	.p2align	4, 0x90
_dowrite:                               ## @dowrite
	.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
	movl	%edi, %ebx
	movq	_writebdy@GOTPCREL(%rip), %rcx
	movl	%edi, %eax
	xorl	%edx, %edx
	divl	(%rcx)
	subl	%edx, %ebx
	testl	%esi, %esi
	je	LBB0_1
## %bb.5:
	movl	%esi, %r14d
	movq	_OP_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_file_size@GOTPCREL(%rip), %r13
	movl	(%r13), %ecx
	movl	%ebx, %esi
	movl	%r14d, %edx
	callq	_log4
	movq	_original_buf@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_good_buf@GOTPCREL(%rip), %r12
	movq	(%r12), %rsi
	movl	%ebx, %edx
	movl	%r14d, %ecx
	callq	_gendata
	movl	(%r13), %eax
	leal	(%rbx,%r14), %r15d
	cmpl	%r15d, %eax
	jae	LBB0_10
## %bb.6:
	cmpl	%eax, %ebx
	jbe	LBB0_8
## %bb.7:
	movq	%rax, %rdi
	addq	(%r12), %rdi
	movl	%ebx, %edx
	subl	%eax, %edx
	xorl	%esi, %esi
	callq	_memset
LBB0_8:
	movl	%r15d, (%r13)
	movq	_lite@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_10
## %bb.9:
	leaq	L_.str.1(%rip), %rdi
	callq	_warn
	movl	$149, %edi
	callq	_report_failure
LBB0_10:
	movq	_testcalls@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_simulatedopcount@GOTPCREL(%rip), %rax
	cmpl	(%rax), %esi
	jle	LBB0_27
## %bb.11:
	movq	_quiet@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jne	LBB0_20
## %bb.12:
	movq	_progressinterval@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	testl	%ecx, %ecx
	je	LBB0_14
## %bb.13:
	movl	%esi, %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	je	LBB0_19
LBB0_14:
	movq	_debug@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_20
## %bb.15:
	movq	_monitorstart@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	$-1, %eax
	je	LBB0_19
## %bb.16:
	cmpl	%eax, %r15d
	jbe	LBB0_20
## %bb.17:
	movq	_monitorend@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	$-1, %eax
	je	LBB0_19
## %bb.18:
	cmpl	%eax, %ebx
	ja	LBB0_20
LBB0_19:
	decl	%r15d
	leaq	L_.str.2(%rip), %rdi
	movl	%ebx, %edx
	movl	%r15d, %ecx
	movl	%r14d, %r8d
	xorl	%eax, %eax
	callq	_prt
LBB0_20:
	movq	_fd@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	movl	%ebx, %ebx
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rsi
	callq	_lseek
	cmpq	$-1, %rax
	jne	LBB0_22
## %bb.21:
	leaq	L_.str.3(%rip), %rdi
	callq	_prterr
	movl	$150, %edi
	callq	_report_failure
LBB0_22:
	movl	(%r15), %edi
	addq	(%r12), %rbx
	movq	%rbx, %rsi
	movl	%r14d, %edx
	callq	_write
	cmpl	%r14d, %eax
	jne	LBB0_23
LBB0_27:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	_quiet@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jne	LBB0_4
## %bb.2:
	movq	_testcalls@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_simulatedopcount@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jle	LBB0_4
## %bb.3:
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_prt
LBB0_4:
	movq	_OP_SKIPPED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_OP_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edx
	xorl	%ecx, %ecx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_log4                           ## TAILCALL
LBB0_23:
	cmpl	$-1, %eax
	je	LBB0_24
## %bb.25:
	leaq	L_.str.5(%rip), %rdi
	movl	%eax, %esi
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_prt
	jmp	LBB0_26
LBB0_24:
	leaq	L_.str.4(%rip), %rdi
	callq	_prterr
LBB0_26:
	movl	$151, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_report_failure                 ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_writebdy,4,2                   ## @writebdy
	.comm	_quiet,4,2                      ## @quiet
	.comm	_testcalls,4,2                  ## @testcalls
	.comm	_simulatedopcount,4,2           ## @simulatedopcount
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"skipping zero size write\n"

	.comm	_OP_SKIPPED,4,2                 ## @OP_SKIPPED
	.comm	_OP_WRITE,4,2                   ## @OP_WRITE
	.comm	_file_size,4,2                  ## @file_size
	.comm	_original_buf,4,2               ## @original_buf
	.comm	_good_buf,8,3                   ## @good_buf
	.comm	_lite,8,3                       ## @lite
L_.str.1:                               ## @.str.1
	.asciz	"Lite file size bug in fsx!"

	.comm	_progressinterval,4,2           ## @progressinterval
	.comm	_debug,8,3                      ## @debug
	.comm	_monitorstart,4,2               ## @monitorstart
	.comm	_monitorend,4,2                 ## @monitorend
L_.str.2:                               ## @.str.2
	.asciz	"%lu write\t0x%x thru\t0x%x\t(0x%x bytes)\n"

	.comm	_fd,4,2                         ## @fd
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
L_.str.3:                               ## @.str.3
	.asciz	"dowrite: lseek"

L_.str.4:                               ## @.str.4
	.asciz	"dowrite: write"

L_.str.5:                               ## @.str.5
	.asciz	"short write: 0x%x bytes instead of 0x%x\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dowrite                        ; -- Begin function dowrite
	.p2align	2
_dowrite:                               ; @dowrite
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
Lloh0:
	adrp	x8, _writebdy@GOTPAGE
Lloh1:
	ldr	x8, [x8, _writebdy@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	udiv	w9, w0, w8
	mul	w19, w9, w8
	cbz	w1, LBB0_20
; %bb.1:
	mov	x20, x1
Lloh3:
	adrp	x8, _OP_WRITE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _OP_WRITE@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
Lloh6:
	adrp	x23, _file_size@GOTPAGE
Lloh7:
	ldr	x23, [x23, _file_size@GOTPAGEOFF]
	ldr	w3, [x23]
	mov	x1, x19
	mov	x2, x20
	bl	_log4
Lloh8:
	adrp	x8, _original_buf@GOTPAGE
Lloh9:
	ldr	x8, [x8, _original_buf@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
Lloh11:
	adrp	x21, _good_buf@GOTPAGE
Lloh12:
	ldr	x21, [x21, _good_buf@GOTPAGEOFF]
	ldr	x1, [x21]
	mov	x2, x19
	mov	x3, x20
	bl	_gendata
	ldr	w8, [x23]
	add	w22, w19, w20
	cmp	w8, w22
	b.hs	LBB0_6
; %bb.2:
	cmp	w19, w8
	b.ls	LBB0_4
; %bb.3:
	ldr	x9, [x21]
	add	x0, x9, x8
	sub	w2, w19, w8
	mov	w1, #0
	bl	_memset
LBB0_4:
	str	w22, [x23]
Lloh13:
	adrp	x8, _lite@GOTPAGE
Lloh14:
	ldr	x8, [x8, _lite@GOTPAGEOFF]
Lloh15:
	ldr	x8, [x8]
	cbz	x8, LBB0_6
; %bb.5:
Lloh16:
	adrp	x0, l_.str.1@PAGE
Lloh17:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_warn
	mov	w0, #149
	bl	_report_failure
LBB0_6:
Lloh18:
	adrp	x8, _testcalls@GOTPAGE
Lloh19:
	ldr	x8, [x8, _testcalls@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
Lloh21:
	adrp	x9, _simulatedopcount@GOTPAGE
Lloh22:
	ldr	x9, [x9, _simulatedopcount@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	cmp	w8, w9
	b.le	LBB0_19
; %bb.7:
Lloh24:
	adrp	x9, _quiet@GOTPAGE
Lloh25:
	ldr	x9, [x9, _quiet@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	cbnz	w9, LBB0_16
; %bb.8:
Lloh27:
	adrp	x9, _progressinterval@GOTPAGE
Lloh28:
	ldr	x9, [x9, _progressinterval@GOTPAGEOFF]
Lloh29:
	ldr	w9, [x9]
	cbz	w9, LBB0_10
; %bb.9:
	sdiv	w10, w8, w9
	msub	w9, w10, w9, w8
	cbz	w9, LBB0_15
LBB0_10:
Lloh30:
	adrp	x9, _debug@GOTPAGE
Lloh31:
	ldr	x9, [x9, _debug@GOTPAGEOFF]
Lloh32:
	ldr	x9, [x9]
	cbz	x9, LBB0_16
; %bb.11:
Lloh33:
	adrp	x9, _monitorstart@GOTPAGE
Lloh34:
	ldr	x9, [x9, _monitorstart@GOTPAGEOFF]
Lloh35:
	ldr	w9, [x9]
	cmn	w9, #1
	b.eq	LBB0_15
; %bb.12:
	cmp	w22, w9
	b.ls	LBB0_16
; %bb.13:
Lloh36:
	adrp	x9, _monitorend@GOTPAGE
Lloh37:
	ldr	x9, [x9, _monitorend@GOTPAGEOFF]
Lloh38:
	ldr	w9, [x9]
	cmn	w9, #1
	b.eq	LBB0_15
; %bb.14:
	cmp	w19, w9
	b.hi	LBB0_16
LBB0_15:
	sub	w9, w22, #1
	mov	x10, x19
	stp	x8, x10, [sp]
	stp	x9, x20, [sp, #16]
Lloh39:
	adrp	x0, l_.str.2@PAGE
Lloh40:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_prt
LBB0_16:
Lloh41:
	adrp	x22, _fd@GOTPAGE
Lloh42:
	ldr	x22, [x22, _fd@GOTPAGEOFF]
	ldr	w0, [x22]
Lloh43:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh44:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh45:
	ldr	w2, [x8]
	mov	x1, x19
	bl	_lseek
	cmn	x0, #1
	b.ne	LBB0_18
; %bb.17:
Lloh46:
	adrp	x0, l_.str.3@PAGE
Lloh47:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_prterr
	mov	w0, #150
	bl	_report_failure
LBB0_18:
	ldr	w0, [x22]
	ldr	x8, [x21]
	add	x1, x8, x19
	mov	x2, x20
	bl	_write
                                        ; kill: def $w0 killed $w0 def $x0
	cmp	w0, w20
	b.ne	LBB0_24
LBB0_19:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_20:
Lloh48:
	adrp	x8, _quiet@GOTPAGE
Lloh49:
	ldr	x8, [x8, _quiet@GOTPAGEOFF]
Lloh50:
	ldr	w8, [x8]
	cbnz	w8, LBB0_23
; %bb.21:
Lloh51:
	adrp	x8, _testcalls@GOTPAGE
Lloh52:
	ldr	x8, [x8, _testcalls@GOTPAGEOFF]
Lloh53:
	ldr	w8, [x8]
Lloh54:
	adrp	x9, _simulatedopcount@GOTPAGE
Lloh55:
	ldr	x9, [x9, _simulatedopcount@GOTPAGEOFF]
Lloh56:
	ldr	w9, [x9]
	cmp	w8, w9
	b.le	LBB0_23
; %bb.22:
Lloh57:
	adrp	x0, l_.str@PAGE
Lloh58:
	add	x0, x0, l_.str@PAGEOFF
	bl	_prt
LBB0_23:
Lloh59:
	adrp	x8, _OP_SKIPPED@GOTPAGE
Lloh60:
	ldr	x8, [x8, _OP_SKIPPED@GOTPAGEOFF]
Lloh61:
	adrp	x9, _OP_WRITE@GOTPAGE
Lloh62:
	ldr	x9, [x9, _OP_WRITE@GOTPAGEOFF]
Lloh63:
	ldr	w0, [x8]
Lloh64:
	ldr	w1, [x9]
	mov	x2, x19
	mov	w3, #0
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	b	_log4
LBB0_24:
	cmn	w0, #1
	b.eq	LBB0_26
; %bb.25:
                                        ; kill: def $w20 killed $w20 killed $x20 def $x20
	stp	x0, x20, [sp]
Lloh65:
	adrp	x0, l_.str.5@PAGE
Lloh66:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_prt
	b	LBB0_27
LBB0_26:
Lloh67:
	adrp	x0, l_.str.4@PAGE
Lloh68:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_prterr
LBB0_27:
	mov	w0, #151
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	b	_report_failure
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpAdd	Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGot	Lloh41, Lloh42
	.loh AdrpAdd	Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh54, Lloh55, Lloh56
	.loh AdrpLdrGotLdr	Lloh51, Lloh52, Lloh53
	.loh AdrpAdd	Lloh57, Lloh58
	.loh AdrpLdrGotLdr	Lloh61, Lloh62, Lloh64
	.loh AdrpLdrGotLdr	Lloh59, Lloh60, Lloh63
	.loh AdrpAdd	Lloh65, Lloh66
	.loh AdrpAdd	Lloh67, Lloh68
	.cfi_endproc
                                        ; -- End function
	.comm	_writebdy,4,2                   ; @writebdy
	.comm	_quiet,4,2                      ; @quiet
	.comm	_testcalls,4,2                  ; @testcalls
	.comm	_simulatedopcount,4,2           ; @simulatedopcount
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"skipping zero size write\n"

	.comm	_OP_SKIPPED,4,2                 ; @OP_SKIPPED
	.comm	_OP_WRITE,4,2                   ; @OP_WRITE
	.comm	_file_size,4,2                  ; @file_size
	.comm	_original_buf,4,2               ; @original_buf
	.comm	_good_buf,8,3                   ; @good_buf
	.comm	_lite,8,3                       ; @lite
l_.str.1:                               ; @.str.1
	.asciz	"Lite file size bug in fsx!"

	.comm	_progressinterval,4,2           ; @progressinterval
	.comm	_debug,8,3                      ; @debug
	.comm	_monitorstart,4,2               ; @monitorstart
	.comm	_monitorend,4,2                 ; @monitorend
l_.str.2:                               ; @.str.2
	.asciz	"%lu write\t0x%x thru\t0x%x\t(0x%x bytes)\n"

	.comm	_fd,4,2                         ; @fd
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
l_.str.3:                               ; @.str.3
	.asciz	"dowrite: lseek"

l_.str.4:                               ; @.str.4
	.asciz	"dowrite: write"

l_.str.5:                               ; @.str.5
	.asciz	"short write: 0x%x bytes instead of 0x%x\n"

.subsections_via_symbols
