	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function color_to_hsv
_color_to_hsv:                          ## @color_to_hsv
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, -48(%rbp)                  ## 8-byte Spill
	movq	%r8, %r13
	movl	%ecx, %r12d
	movl	%edx, %r15d
	movl	%esi, %ebx
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	sarl	$4, %ebx
	sarl	$4, %r15d
	sarl	$4, %r12d
	movl	%ebx, %edi
	movl	%r15d, %esi
	movl	%r12d, %edx
	callq	_max3
	movl	%eax, %r14d
	movq	16(%rbp), %rax
	movl	%r14d, (%rax)
	testl	%r14d, %r14d
	je	LBB0_1
## %bb.2:
	movl	%ebx, %edi
	movl	%r15d, %esi
	movl	%r12d, %edx
	callq	_min3
	movl	%r14d, %ecx
	subl	%eax, %ecx
	movl	%ecx, %edx
	shll	$8, %edx
	subl	%ecx, %edx
	movl	%r14d, %eax
	shrl	$31, %eax
	addl	%r14d, %eax
	sarl	%eax
	addl	%edx, %eax
	cltd
	idivl	%r14d
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movl	%eax, (%rdx)
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rsi
	movq	_V4L2_HSV_ENC_180@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	cmpq	%rdi, %rsi
	movl	$60, %eax
	movl	$85, %edx
	cmovel	%eax, %edx
	cmpl	%ebx, %r14d
	jne	LBB0_6
## %bb.5:
	subl	%r12d, %r15d
	xorl	%r8d, %r8d
	jmp	LBB0_9
LBB0_1:
	movl	$0, (%r13)
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	$0, (%rax)
	jmp	LBB0_15
LBB0_3:
	movl	$0, (%r13)
	jmp	LBB0_15
LBB0_6:
	cmpl	%r15d, %r14d
	jne	LBB0_8
## %bb.7:
	subl	%ebx, %r12d
	movl	%r12d, %r15d
	movl	%edx, %r8d
	jmp	LBB0_9
LBB0_8:
	subl	%r15d, %ebx
	leal	(%rdx,%rdx), %r8d
	movl	%ebx, %r15d
LBB0_9:
	shrl	%edx
	imull	%r15d, %edx
	movl	%ecx, %eax
	shrl	$31, %eax
	addl	%ecx, %eax
	sarl	%eax
	addl	%edx, %eax
	cltd
	idivl	%ecx
                                        ## kill: def $eax killed $eax def $rax
	addl	%r8d, %eax
	cmpq	%rdi, %rsi
	jne	LBB0_13
## %bb.10:
	testl	%eax, %eax
	js	LBB0_11
## %bb.12:
	leal	-180(%rax), %ecx
	cmpl	$181, %eax
	cmovbl	%eax, %ecx
	movl	%ecx, %eax
	jmp	LBB0_14
LBB0_13:
	movzbl	%al, %eax
	jmp	LBB0_14
LBB0_11:
	addl	$180, %eax
LBB0_14:
	movl	%eax, (%r13)
LBB0_15:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_V4L2_HSV_ENC_180,8,3           ## @V4L2_HSV_ENC_180
	.no_dead_strip	_color_to_hsv
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function color_to_hsv
_color_to_hsv:                          ; @color_to_hsv
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x26, x6
	mov	x24, x5
	mov	x19, x4
	mov	x25, x0
	asr	w20, w1, #4
	asr	w21, w2, #4
	asr	w22, w3, #4
	mov	x0, x20
	mov	x1, x21
	mov	x2, x22
	bl	_max3
	str	w0, [x26]
	cbz	w0, LBB0_3
; %bb.1:
	mov	x23, x0
	mov	x0, x20
	mov	x1, x21
	mov	x2, x22
	bl	_min3
	sub	w8, w23, w0
	lsl	w9, w8, #8
	sub	w9, w9, w8
	cmp	w23, #0
	cinc	w10, w23, lt
	add	w9, w9, w10, asr #1
	sdiv	w9, w9, w23
	str	w9, [x24]
	cbz	w9, LBB0_4
; %bb.2:
	ldr	x9, [x25]
Lloh0:
	adrp	x10, _V4L2_HSV_ENC_180@GOTPAGE
Lloh1:
	ldr	x10, [x10, _V4L2_HSV_ENC_180@GOTPAGEOFF]
Lloh2:
	ldr	x10, [x10]
	cmp	x9, x10
	mov	w11, #85
	mov	w12, #60
	csel	w11, w12, w11, eq
	sub	w12, w20, w21
	lsl	w13, w11, #1
	sub	w14, w22, w20
	cmp	w23, w21
	csel	w12, w12, w14, ne
	csel	w13, w13, w11, ne
	sub	w14, w21, w22
	cmp	w23, w20
	csel	w12, w12, w14, ne
	csel	w13, w13, wzr, ne
	lsr	w11, w11, #1
	mul	w11, w12, w11
	cmp	w8, #0
	cinc	w12, w8, lt
	add	w11, w11, w12, asr #1
	sdiv	w8, w11, w8
	add	w8, w8, w13
	and	w11, w8, #0xff
	subs	w12, w8, #180
	csel	w12, w12, w8, hi
	add	w13, w8, #180
	tst	w8, #0x80000000
	csel	w8, w12, w13, eq
	cmp	x9, x10
	csel	w8, w11, w8, ne
	str	w8, [x19]
	b	LBB0_5
LBB0_3:
	str	wzr, [x19]
	str	wzr, [x24]
	b	LBB0_5
LBB0_4:
	str	wzr, [x19]
LBB0_5:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_V4L2_HSV_ENC_180,8,3           ; @V4L2_HSV_ENC_180
	.no_dead_strip	_color_to_hsv
.subsections_via_symbols
