	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function max44009_threshold_byte_from_fraction
_max44009_threshold_byte_from_fraction: ## @max44009_threshold_byte_from_fraction
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	testl	%edi, %edi
	jg	LBB0_2
## %bb.1:
	testl	%esi, %esi
	jle	LBB0_5
LBB0_2:
	movq	_MAX44009_MAXIMUM_THRESHOLD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%edi, %eax
	jl	LBB0_5
## %bb.3:
	testl	%esi, %esi
	je	LBB0_6
## %bb.4:
	cmpl	%edi, %eax
	jne	LBB0_6
LBB0_5:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	popq	%rbp
	retq
LBB0_6:
	movq	_MAX44009_SCALE_DENOMINATOR@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	imull	%r8d, %edi
	movq	_MAX44009_SCALE_NUMERATOR@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%edi, %eax
	cltd
	idivl	%ecx
	movl	%eax, %edi
	movq	_MAX44009_FRACT_MULT@GOTPCREL(%rip), %r9
	movl	%esi, %eax
	cltd
	idivl	(%r9)
	movl	%eax, %esi
	movl	%r8d, %eax
	cltd
	idivl	%ecx
	movl	%eax, %ecx
	imull	%esi, %ecx
	addl	%edi, %ecx
	xorl	%edx, %edx
	cmpl	$256, %ecx                      ## imm = 0x100
	jl	LBB0_7
## %bb.8:
	xorl	%edx, %edx
	movl	%ecx, %eax
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	shrl	%eax
	addl	$16, %edx
	cmpl	$511, %ecx                      ## imm = 0x1FF
	movl	%eax, %ecx
	ja	LBB0_9
	jmp	LBB0_10
LBB0_7:
	movl	%ecx, %eax
LBB0_10:
	shrl	$4, %eax
	andl	$15, %eax
	orl	%edx, %eax
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX44009_MAXIMUM_THRESHOLD,4,2 ## @MAX44009_MAXIMUM_THRESHOLD
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MAX44009_SCALE_DENOMINATOR,4,2 ## @MAX44009_SCALE_DENOMINATOR
	.comm	_MAX44009_SCALE_NUMERATOR,4,2   ## @MAX44009_SCALE_NUMERATOR
	.comm	_MAX44009_FRACT_MULT,4,2        ## @MAX44009_FRACT_MULT
	.no_dead_strip	_max44009_threshold_byte_from_fraction
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function max44009_threshold_byte_from_fraction
_max44009_threshold_byte_from_fraction: ; @max44009_threshold_byte_from_fraction
	.cfi_startproc
; %bb.0:
	cmp	w0, #0
	b.gt	LBB0_2
; %bb.1:
	cmp	w1, #1
	b.lt	LBB0_5
LBB0_2:
Lloh0:
	adrp	x8, _MAX44009_MAXIMUM_THRESHOLD@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAX44009_MAXIMUM_THRESHOLD@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w0
	b.lt	LBB0_5
; %bb.3:
	cbz	w1, LBB0_6
; %bb.4:
	cmp	w8, w0
	b.ne	LBB0_6
LBB0_5:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w0, w8
	ret
LBB0_6:
Lloh6:
	adrp	x8, _MAX44009_SCALE_DENOMINATOR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MAX44009_SCALE_DENOMINATOR@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	mul	w9, w8, w0
Lloh9:
	adrp	x10, _MAX44009_SCALE_NUMERATOR@GOTPAGE
Lloh10:
	ldr	x10, [x10, _MAX44009_SCALE_NUMERATOR@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
Lloh12:
	adrp	x11, _MAX44009_FRACT_MULT@GOTPAGE
Lloh13:
	ldr	x11, [x11, _MAX44009_FRACT_MULT@GOTPAGEOFF]
	sdiv	w9, w9, w10
Lloh14:
	ldr	w11, [x11]
	sdiv	w11, w1, w11
	sdiv	w8, w8, w10
	madd	w8, w8, w11, w9
	cmp	w8, #256
	b.lt	LBB0_9
; %bb.7:
	mov	w9, #0
	mov	x10, x8
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	lsr	w8, w10, #1
	add	w9, w9, #16
	cmp	w10, #511
	mov	x10, x8
	b.hi	LBB0_8
	b	LBB0_10
LBB0_9:
	mov	w9, #0
LBB0_10:
	ubfx	w8, w8, #4, #4
	orr	w0, w9, w8
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX44009_MAXIMUM_THRESHOLD,4,2 ; @MAX44009_MAXIMUM_THRESHOLD
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MAX44009_SCALE_DENOMINATOR,4,2 ; @MAX44009_SCALE_DENOMINATOR
	.comm	_MAX44009_SCALE_NUMERATOR,4,2   ; @MAX44009_SCALE_NUMERATOR
	.comm	_MAX44009_FRACT_MULT,4,2        ; @MAX44009_FRACT_MULT
	.no_dead_strip	_max44009_threshold_byte_from_fraction
.subsections_via_symbols
