	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_fwrite                         ## -- Begin function fwrite
	.p2align	4, 0x90
_fwrite:                                ## @fwrite
	.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
	subq	$48, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	xorl	%eax, %eax
	testq	%rsi, %rsi
	je	LBB0_13
## %bb.1:
	movq	%rdx, %r14
	testq	%rdx, %rdx
	je	LBB0_13
## %bb.2:
	movq	%rcx, %r15
	movq	%rsi, %r12
	movq	%r14, %rax
	orq	%rsi, %rax
	cmpq	$65536, %rax                    ## imm = 0x10000
	jb	LBB0_8
## %bb.3:
	movq	_SIZE_MAX@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, %rcx
	orq	%r12, %rcx
	shrq	$32, %rcx
	je	LBB0_4
## %bb.5:
	xorl	%edx, %edx
	divq	%r12
	cmpq	%r14, %rax
	jae	LBB0_8
LBB0_7:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_errno@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movq	___SERR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%r15)
	xorl	%eax, %eax
	jmp	LBB0_13
LBB0_4:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%r12d
                                        ## kill: def $eax killed $eax def $rax
	cmpq	%r14, %rax
	jb	LBB0_7
LBB0_8:
	movq	%r14, %rbx
	imulq	%r12, %rbx
	movq	%rdi, -64(%rbp)
	movq	%rbx, -72(%rbp)
	movq	%rbx, -56(%rbp)
	leaq	-72(%rbp), %rax
	movq	%rax, -40(%rbp)
	movl	$1, -48(%rbp)
	movq	%r15, %rdi
	callq	_FLOCKFILE_CANCELSAFE
	movq	%r15, %rdi
	movl	$-1, %esi
	callq	_ORIENT
	leaq	-56(%rbp), %rsi
	movq	%r15, %rdi
	callq	___sfvwrite
	testq	%rax, %rax
	je	LBB0_12
## %bb.9:
	subq	-56(%rbp), %rbx
	movq	%rbx, %rax
	orq	%r12, %rax
	shrq	$32, %rax
	je	LBB0_10
## %bb.11:
	movq	%rbx, %rax
	xorl	%edx, %edx
	divq	%r12
	movq	%rax, %r14
	jmp	LBB0_12
LBB0_10:
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	%r12d
	movl	%eax, %r14d
LBB0_12:
	xorl	%eax, %eax
	callq	_FUNLOCKFILE_CANCELSAFE
	movq	%r14, %rax
LBB0_13:
	addq	$48, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SIZE_MAX,8,3                   ## @SIZE_MAX
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_errno,4,2                      ## @errno
	.comm	___SERR,4,2                     ## @__SERR
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_fwrite                         ; -- Begin function fwrite
	.p2align	2
_fwrite:                                ; @fwrite
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x8, x0
	mov	x0, #0
	cbz	x1, LBB0_8
; %bb.1:
	mov	x19, x2
	cbz	x2, LBB0_8
; %bb.2:
	mov	x20, x3
	mov	x21, x1
	orr	x9, x19, x1
	cmp	x9, #16, lsl #12                ; =65536
	b.lo	LBB0_5
; %bb.3:
Lloh0:
	adrp	x9, _SIZE_MAX@GOTPAGE
Lloh1:
	ldr	x9, [x9, _SIZE_MAX@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	udiv	x9, x9, x21
	cmp	x9, x19
	b.hs	LBB0_5
; %bb.4:
	mov	x0, #0
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _errno@GOTPAGE
Lloh7:
	ldr	x9, [x9, _errno@GOTPAGEOFF]
Lloh8:
	str	w8, [x9]
Lloh9:
	adrp	x8, ___SERR@GOTPAGE
Lloh10:
	ldr	x8, [x8, ___SERR@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	ldr	w9, [x20]
	orr	w8, w9, w8
	str	w8, [x20]
	b	LBB0_8
LBB0_5:
	mul	x22, x19, x21
	stp	x22, x8, [sp, #8]
	str	x22, [sp, #24]
	add	x8, sp, #8
	str	x8, [sp, #40]
	mov	w8, #1
	str	w8, [sp, #32]
	mov	x0, x20
	bl	_FLOCKFILE_CANCELSAFE
	mov	x0, x20
	mov	w1, #-1
	bl	_ORIENT
	add	x1, sp, #24
	mov	x0, x20
	bl	___sfvwrite
	cbz	x0, LBB0_7
; %bb.6:
	ldr	x8, [sp, #24]
	sub	x8, x22, x8
	udiv	x19, x8, x21
LBB0_7:
	bl	_FUNLOCKFILE_CANCELSAFE
	mov	x0, x19
LBB0_8:
	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
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotStr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_SIZE_MAX,8,3                   ; @SIZE_MAX
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_errno,4,2                      ; @errno
	.comm	___SERR,4,2                     ; @__SERR
.subsections_via_symbols
