	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bw_frc_to_fixed                ## -- Begin function bw_frc_to_fixed
	.p2align	4, 0x90
_bw_frc_to_fixed:                       ## @bw_frc_to_fixed
	.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
	movq	%rsi, %r15
	movq	%rdi, %r14
	xorl	%edi, %edi
	testq	%rsi, %rsi
	setne	%dil
	callq	_ASSERT
	movq	%r14, %rdi
	callq	_abs_i64
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_abs_i64
	movl	%eax, %r12d
	leaq	-44(%rbp), %rdx
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_div64_u64_rem
	movl	%eax, %r13d
	movq	_BW_FIXED_MAX_I32@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	cmpl	(%rax), %r13d
	setle	%dil
	callq	_ASSERT
	movq	_BW_FIXED_BITS_PER_FRACTIONAL_PART@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movl	-44(%rbp), %eax
	testb	$1, %dl
	jne	LBB0_2
## %bb.1:
                                        ## implicit-def: $ebx
	movq	%rdx, %rcx
	cmpq	$1, %rdx
	jne	LBB0_4
	jmp	LBB0_9
LBB0_2:
	addl	%eax, %eax
	xorl	%ecx, %ecx
	xorl	%esi, %esi
	cmpl	%r12d, %eax
	cmovgel	%r12d, %ecx
	setge	%sil
	subl	%ecx, %eax
	leal	(%rsi,%r13,2), %ebx
	leaq	-1(%rdx), %rcx
	movl	%ebx, %r13d
	cmpq	$1, %rdx
	jne	LBB0_4
LBB0_9:
	movl	%eax, -44(%rbp)
	addl	%eax, %eax
	xorl	%r13d, %r13d
	cmpl	%r12d, %eax
	setge	%r13b
	movq	_MAX_I64@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	subl	%r13d, %eax
	xorl	%edi, %edi
	cmpl	%eax, %ebx
	setle	%dil
	callq	_ASSERT
	addl	%r13d, %ebx
	movslq	%ebx, %rcx
	movq	%rcx, %rax
	negq	%rax
	xorq	%r14, %r15
	cmovnsq	%rcx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_4 Depth=1
	leal	(%rsi,%r13,4), %esi
	subl	%edi, %eax
	movb	%dl, %bl
	orl	%esi, %ebx
	movl	%ebx, %r13d
	addq	$-2, %rcx
	je	LBB0_9
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	addl	%eax, %eax
	xorl	%edi, %edi
	xorl	%esi, %esi
	movl	$0, %ebx
	cmpl	%r12d, %eax
	setge	%dl
	jl	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	%r12d, %ebx
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	subl	%ebx, %eax
	addl	%eax, %eax
	movb	%dl, %sil
	addl	%esi, %esi
	xorl	%ebx, %ebx
	cmpl	%r12d, %eax
	setge	%dl
	jl	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	%r12d, %edi
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_BW_FIXED_MAX_I32,4,2           ## @BW_FIXED_MAX_I32
	.comm	_BW_FIXED_BITS_PER_FRACTIONAL_PART,8,3 ## @BW_FIXED_BITS_PER_FRACTIONAL_PART
	.comm	_MAX_I64,4,2                    ## @MAX_I64
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bw_frc_to_fixed                ; -- Begin function bw_frc_to_fixed
	.p2align	2
_bw_frc_to_fixed:                       ; @bw_frc_to_fixed
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x19, x1
	mov	x20, x0
	cmp	x1, #0
	cset	w0, ne
	bl	_ASSERT
	mov	x0, x20
	bl	_abs_i64
	mov	x22, x0
	mov	x0, x19
	bl	_abs_i64
	mov	x21, x0
	add	x2, sp, #12
	mov	x0, x22
	mov	x1, x21
	bl	_div64_u64_rem
	mov	x22, x0
Lloh0:
	adrp	x8, _BW_FIXED_MAX_I32@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BW_FIXED_MAX_I32@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w0, w8
	cset	w0, le
	bl	_ASSERT
Lloh3:
	adrp	x8, _BW_FIXED_BITS_PER_FRACTIONAL_PART@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BW_FIXED_BITS_PER_FRACTIONAL_PART@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	ldr	w10, [sp, #12]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	lsl	w10, w10, #1
	cmp	w10, w21
	csel	w11, wzr, w21, lt
	cset	w9, ge
	sub	w10, w10, w11
	bfi	w9, w22, #1, #31
	mov	x22, x9
	subs	x8, x8, #1
	b.ne	LBB0_1
; %bb.2:
	str	w10, [sp, #12]
	cmp	w21, w10, lsl #1
	cset	w8, le
Lloh6:
	adrp	x10, _MAX_I64@GOTPAGE
Lloh7:
	ldr	x10, [x10, _MAX_I64@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	cinc	w21, w9, le
	sub	w8, w10, w8
	cmp	w9, w8
	cset	w0, le
	bl	_ASSERT
	sxtw	x8, w21
	eor	x9, x19, x20
	cmp	x9, #0
	cneg	x0, x8, lt
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_BW_FIXED_MAX_I32,4,2           ; @BW_FIXED_MAX_I32
	.comm	_BW_FIXED_BITS_PER_FRACTIONAL_PART,8,3 ; @BW_FIXED_BITS_PER_FRACTIONAL_PART
	.comm	_MAX_I64,4,2                    ; @MAX_I64
.subsections_via_symbols
