	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rgb2hls
_rgb2hls:                               ## @rgb2hls
	.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	%rbx
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %r14d
	subl	%esi, %r14d
	movl	%esi, %r11d
	cmovll	%edi, %r11d
	movl	%esi, %ebx
	cmovgl	%edi, %ebx
	movl	%edx, %r10d
	cmpl	%edx, %r11d
	cmovgel	%edx, %r11d
	cmpl	%edx, %ebx
	cmovlel	%edx, %ebx
	leal	(%r11,%rbx), %r15d
	movslq	%r15d, %rax
	imulq	$1717986919, %rax, %rax         ## imm = 0x66666667
	movq	%rax, %rdx
	shrq	$63, %rdx
	sarq	$35, %rax
	addl	%edx, %eax
	movl	%eax, (%r8)
	movl	%ebx, %eax
	subl	%r11d, %eax
	jne	LBB0_2
## %bb.1:
	movl	$0, (%rcx)
	movl	$0, (%r9)
	jmp	LBB0_8
LBB0_2:
	imull	$100, %eax, %eax
	movl	$2000, %r8d                     ## imm = 0x7D0
	subl	%r15d, %r8d
	cmpl	$1000, %r15d                    ## imm = 0x3E8
	cmovll	%r15d, %r8d
	cltd
	idivl	%r8d
	movl	%eax, (%r9)
	cmpl	%edi, %ebx
	jne	LBB0_4
## %bb.3:
	subl	%r10d, %esi
	movl	$120, %r8d
	movl	%esi, %r14d
	jmp	LBB0_7
LBB0_4:
	cmpl	%esi, %ebx
	jne	LBB0_6
## %bb.5:
	subl	%edi, %r10d
	movl	$240, %r8d
	movl	%r10d, %r14d
	movl	%esi, %edi
	jmp	LBB0_7
LBB0_6:
	movl	$360, %r8d                      ## imm = 0x168
	movl	%ebx, %edi
LBB0_7:
	imull	$60, %r14d, %eax
	subl	%r11d, %edi
	cltd
	idivl	%edi
	addl	%r8d, %eax
	cltq
	imulq	$-1240768329, %rax, %rdx        ## imm = 0xB60B60B7
	shrq	$32, %rdx
	addl	%eax, %edx
	movl	%edx, %esi
	shrl	$31, %esi
	sarl	$8, %edx
	addl	%esi, %edx
	imull	$360, %edx, %edx                ## imm = 0x168
	subl	%edx, %eax
	movl	%eax, (%rcx)
LBB0_8:
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_rgb2hls
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rgb2hls
_rgb2hls:                               ; @rgb2hls
	.cfi_startproc
; %bb.0:
	subs	w9, w0, w1
	csel	w8, w0, w1, lt
	csel	w10, w0, w1, gt
	cmp	w8, w2
	csel	w8, w8, w2, lt
	cmp	w10, w2
	csel	w10, w10, w2, gt
	add	w11, w8, w10
	mov	w12, #26215
	movk	w12, #26214, lsl #16
	smull	x12, w11, w12
	lsr	x13, x12, #63
	asr	x12, x12, #35
	add	w12, w12, w13
	str	w12, [x4]
	subs	w12, w10, w8
	b.ne	LBB0_2
; %bb.1:
	str	wzr, [x3]
	str	wzr, [x5]
	ret
LBB0_2:
	mov	w13, #100
	mul	w12, w12, w13
	mov	w13, #2000
	sub	w13, w13, w11
	cmp	w11, #1000
	csel	w11, w11, w13, lt
	sdiv	w11, w12, w11
	str	w11, [x5]
	mov	w11, #360
	sub	w12, w2, w0
	mov	w13, #240
	cmp	w10, w1
	csel	w9, w9, w12, ne
	csel	w12, w10, w1, ne
	csel	w13, w11, w13, ne
	sub	w14, w1, w2
	mov	w15, #120
	cmp	w10, w0
	csel	w9, w9, w14, ne
	csel	w10, w12, w0, ne
	csel	w12, w13, w15, ne
	mov	w13, #60
	mul	w9, w9, w13
	sub	w8, w10, w8
	sdiv	w8, w9, w8
	mov	w9, #24759
	movk	w9, #46603, lsl #16
	add	w8, w8, w12
	smull	x9, w8, w9
	lsr	x9, x9, #32
	add	w9, w9, w8
	asr	w10, w9, #8
	add	w9, w10, w9, lsr #31
	msub	w8, w9, w11, w8
	str	w8, [x3]
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_rgb2hls
.subsections_via_symbols
