	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_save_buffer                    ## -- Begin function save_buffer
	.p2align	4, 0x90
_save_buffer:                           ## @save_buffer
	.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
	testq	%rsi, %rsi
	je	LBB0_13
## %bb.1:
	movl	%edx, %r14d
	testl	%edx, %edx
	jle	LBB0_13
## %bb.2:
	movq	%rsi, %rbx
	movq	_SSIZE_MAX@GOTPCREL(%rip), %rax
	cmpq	%rsi, (%rax)
	jl	LBB0_14
## %bb.3:
	movq	%rdi, %r15
	movq	_lite@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_8
## %bb.4:
	movq	_SEEK_END@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r14d, %edi
	xorl	%esi, %esi
	callq	_lseek
	cmpq	$-1, %rax
	je	LBB0_5
## %bb.6:
	movq	%rax, %r12
	cmpq	%rbx, %rax
	jge	LBB0_8
## %bb.7:
	leaq	L_.str.2(%rip), %rdi
	movl	%r12d, %esi
	movq	%rbx, %rdx
	callq	_warn
	movq	%r12, %rbx
	jmp	LBB0_8
LBB0_5:
	leaq	L_.str.1(%rip), %rdi
	callq	_prterr
LBB0_8:
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r14d, %edi
	xorl	%esi, %esi
	callq	_lseek
	cmpq	$-1, %rax
	jne	LBB0_10
## %bb.9:
	leaq	L_.str.3(%rip), %rdi
	callq	_prterr
LBB0_10:
	movl	%r14d, %edi
	movq	%r15, %rsi
	movq	%rbx, %rdx
	callq	_write
	cmpq	%rbx, %rax
	jne	LBB0_11
LBB0_13:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	cmpq	$-1, %rax
	je	LBB0_15
## %bb.12:
	leaq	L_.str.5(%rip), %rdi
	movl	%eax, %esi
	movq	%rbx, %rdx
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_warn                           ## TAILCALL
LBB0_15:
	leaq	L_.str.4(%rip), %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_prterr                         ## TAILCALL
LBB0_14:
	leaq	L_.str(%rip), %rdi
	callq	_prt
	movl	$67, %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.comm	_SSIZE_MAX,8,3                  ## @SSIZE_MAX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"fsx flaw: overflow in save_buffer\n"

	.comm	_lite,8,3                       ## @lite
	.comm	_SEEK_END,4,2                   ## @SEEK_END
L_.str.1:                               ## @.str.1
	.asciz	"save_buffer: lseek eof"

L_.str.2:                               ## @.str.2
	.asciz	"save_buffer: .fsxgood file too short... will save 0x%llx bytes instead of 0x%llx\n"

	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
L_.str.3:                               ## @.str.3
	.asciz	"save_buffer: lseek 0"

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

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

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_save_buffer                    ; -- Begin function save_buffer
	.p2align	2
_save_buffer:                           ; @save_buffer
	.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
	cbz	x1, LBB0_11
; %bb.1:
	mov	x20, x2
	cmp	w2, #1
	b.lt	LBB0_11
; %bb.2:
	mov	x19, x1
Lloh0:
	adrp	x8, _SSIZE_MAX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SSIZE_MAX@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x8, x1
	b.lt	LBB0_15
; %bb.3:
	mov	x21, x0
Lloh3:
	adrp	x8, _lite@GOTPAGE
Lloh4:
	ldr	x8, [x8, _lite@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cbz	x8, LBB0_8
; %bb.4:
Lloh6:
	adrp	x8, _SEEK_END@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SEEK_END@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	mov	x0, x20
	mov	x1, #0
	bl	_lseek
	cmn	x0, #1
	b.eq	LBB0_7
; %bb.5:
	mov	x22, x0
	cmp	x0, x19
	b.ge	LBB0_8
; %bb.6:
Lloh9:
	adrp	x0, l_.str.2@PAGE
Lloh10:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x22
	mov	x2, x19
	bl	_warn
	mov	x19, x22
	b	LBB0_8
LBB0_7:
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_prterr
LBB0_8:
Lloh13:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh15:
	ldr	w2, [x8]
	mov	x0, x20
	mov	x1, #0
	bl	_lseek
	cmn	x0, #1
	b.ne	LBB0_10
; %bb.9:
Lloh16:
	adrp	x0, l_.str.3@PAGE
Lloh17:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_prterr
LBB0_10:
	mov	x0, x20
	mov	x1, x21
	mov	x2, x19
	bl	_write
	cmp	x0, x19
	b.ne	LBB0_12
LBB0_11:
	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
LBB0_12:
	mov	x1, x0
	cmn	x0, #1
	b.eq	LBB0_14
; %bb.13:
Lloh18:
	adrp	x0, l_.str.5@PAGE
Lloh19:
	add	x0, x0, l_.str.5@PAGEOFF
                                        ; kill: def $w1 killed $w1 killed $x1
	mov	x2, 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
	b	_warn
LBB0_14:
Lloh20:
	adrp	x0, l_.str.4@PAGE
Lloh21:
	add	x0, x0, l_.str.4@PAGEOFF
	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
	b	_prterr
LBB0_15:
Lloh22:
	adrp	x0, l_.str@PAGE
Lloh23:
	add	x0, x0, l_.str@PAGEOFF
	bl	_prt
	mov	w0, #67
	bl	_exit
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_SSIZE_MAX,8,3                  ; @SSIZE_MAX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"fsx flaw: overflow in save_buffer\n"

	.comm	_lite,8,3                       ; @lite
	.comm	_SEEK_END,4,2                   ; @SEEK_END
l_.str.1:                               ; @.str.1
	.asciz	"save_buffer: lseek eof"

l_.str.2:                               ; @.str.2
	.asciz	"save_buffer: .fsxgood file too short... will save 0x%llx bytes instead of 0x%llx\n"

	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
l_.str.3:                               ; @.str.3
	.asciz	"save_buffer: lseek 0"

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

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

.subsections_via_symbols
