	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function scale_double
_scale_double:                          ## @scale_double
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movq	_SBG_SCALE@GOTPCREL(%rip), %rax
	movsd	(%rax), %xmm2                   ## xmm2 = mem[0],zero
	mulsd	%xmm0, %xmm2
	mulsd	%xmm1, %xmm2
	movq	_INT_MIN@GOTPCREL(%rip), %rax
	movsd	(%rax), %xmm1                   ## xmm1 = mem[0],zero
	ucomisd	%xmm2, %xmm1
	ja	LBB0_2
## %bb.1:
	movq	_INT_MAX@GOTPCREL(%rip), %rax
	ucomisd	(%rax), %xmm2
	jae	LBB0_2
## %bb.5:
	cvttsd2si	%xmm2, %eax
	movl	%eax, (%rsi)
	xorl	%eax, %eax
	popq	%rbp
	retq
LBB0_2:
	testq	%rdi, %rdi
	je	LBB0_4
## %bb.3:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	callq	_av_log
LBB0_4:
	movq	_EDOM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_SBG_SCALE,8,3                  ## @SBG_SCALE
	.comm	_INT_MIN,8,3                    ## @INT_MIN
	.comm	_INT_MAX,8,3                    ## @INT_MAX
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%g is too large\n"

	.comm	_EDOM,4,2                       ## @EDOM
	.no_dead_strip	_scale_double
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function scale_double
_scale_double:                          ; @scale_double
	.cfi_startproc
; %bb.0:
	stp	x29, x30, [sp, #-16]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 16
	mov	x29, sp
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
Lloh0:
	adrp	x8, _SBG_SCALE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SBG_SCALE@GOTPAGEOFF]
Lloh2:
	ldr	d2, [x8]
	fmul	d2, d2, d0
	fmul	d1, d2, d1
Lloh3:
	adrp	x8, _INT_MIN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _INT_MIN@GOTPAGEOFF]
Lloh5:
	ldr	d2, [x8]
Lloh6:
	adrp	x8, _INT_MAX@GOTPAGE
Lloh7:
	ldr	x8, [x8, _INT_MAX@GOTPAGEOFF]
Lloh8:
	ldr	d3, [x8]
	fcmp	d1, d2
	fccmp	d1, d3, #0, pl
	b.lt	LBB0_4
; %bb.1:
	cbz	x0, LBB0_3
; %bb.2:
Lloh9:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh10:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
Lloh12:
	adrp	x2, l_.str@PAGE
Lloh13:
	add	x2, x2, l_.str@PAGEOFF
	bl	_av_log
LBB0_3:
Lloh14:
	adrp	x8, _EDOM@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EDOM@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	b	_AVERROR
LBB0_4:
	fcvtzs	w8, d1
	str	w8, [x1]
	mov	w0, #0
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_SBG_SCALE,8,3                  ; @SBG_SCALE
	.comm	_INT_MIN,8,3                    ; @INT_MIN
	.comm	_INT_MAX,8,3                    ; @INT_MAX
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%g is too large\n"

	.comm	_EDOM,4,2                       ; @EDOM
	.no_dead_strip	_scale_double
.subsections_via_symbols
