	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function color_balance16_p
_color_balance16_p:                     ## @color_balance16_p
	.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	$104, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %ebx
	movq	(%rsi), %r15
	movl	(%r15), %r8d
	movl	%r8d, %eax
	imull	%edx, %eax
	cltd
	idivl	%ecx
	movl	%eax, %r12d
	incl	%ebx
	imull	%r8d, %ebx
	movl	%ebx, %eax
	cltd
	idivl	%ecx
	movl	%eax, -124(%rbp)                ## 4-byte Spill
	cmpl	%eax, %r12d
	jge	LBB0_12
## %bb.1:
	movq	24(%r15), %r8
	movq	8(%r15), %r9
	movl	12(%r9), %ebx
	imull	%r12d, %ebx
	movl	%ebx, %ecx
	shrl	$31, %ecx
	addl	%ebx, %ecx
	sarl	%ecx
	movslq	%ecx, %rax
	shlq	$2, %rax
	addq	24(%r8), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movl	8(%r9), %ebx
	imull	%r12d, %ebx
	movl	%ebx, %ecx
	shrl	$31, %ecx
	addl	%ebx, %ecx
	sarl	%ecx
	movslq	%ecx, %rax
	shlq	$2, %rax
	addq	16(%r8), %rax
	movq	%rax, -120(%rbp)                ## 8-byte Spill
	movl	4(%r9), %ebx
	imull	%r12d, %ebx
	movl	%ebx, %ecx
	shrl	$31, %ecx
	addl	%ebx, %ecx
	sarl	%ecx
	movslq	%ecx, %rax
	shlq	$2, %rax
	addq	8(%r8), %rax
	movq	%rax, -112(%rbp)                ## 8-byte Spill
	movl	(%r9), %r14d
	movl	%r14d, %edx
	imull	%r12d, %edx
	movl	%edx, %ebx
	shrl	$31, %ebx
	addl	%edx, %ebx
	sarl	%ebx
	movslq	%ebx, %rax
	shlq	$2, %rax
	addq	(%r8), %rax
	movq	%rax, -104(%rbp)                ## 8-byte Spill
	movq	8(%rsi), %rax
	movq	8(%rax), %r10
	movq	%rax, -136(%rbp)                ## 8-byte Spill
	movq	24(%rax), %r13
	movl	12(%r10), %ebx
	imull	%r12d, %ebx
	movl	%ebx, %esi
	shrl	$31, %esi
	addl	%ebx, %esi
	sarl	%esi
	movslq	%esi, %rax
	shlq	$2, %rax
	addq	24(%r13), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movl	8(%r10), %esi
	imull	%r12d, %esi
	movl	%esi, %ecx
	shrl	$31, %ecx
	addl	%esi, %ecx
	movl	4(%r10), %esi
	imull	%r12d, %esi
	movl	%esi, %r11d
	shrl	$31, %r11d
	addl	%esi, %r11d
	movl	(%r10), %r8d
	movl	%r12d, %eax
	imull	%r8d, %eax
	movl	%eax, %ebx
	shrl	$31, %ebx
	addl	%eax, %ebx
	movl	%r12d, %eax
	sarl	%ecx
	movslq	%ecx, %rcx
	shlq	$2, %rcx
	addq	16(%r13), %rcx
	movq	%rcx, -96(%rbp)                 ## 8-byte Spill
	sarl	%r11d
	movslq	%r11d, %rcx
	shlq	$2, %rcx
	addq	8(%r13), %rcx
	movq	%rcx, -88(%rbp)                 ## 8-byte Spill
	sarl	%ebx
	movslq	%ebx, %r12
	shlq	$2, %r12
	addq	(%r13), %r12
	movq	(%rdi), %r13
	movss	4(%r13), %xmm0                  ## xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, -60(%rbp)                ## 4-byte Spill
	movl	(%r13), %ebx
	movl	16(%r15), %edi
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	-136(%rbp), %rax                ## 8-byte Reload
	movq	8(%rax), %r10
	movl	(%r10), %r8d
	movq	8(%r15), %r9
	movl	(%r9), %r14d
	movl	-128(%rbp), %eax                ## 4-byte Reload
LBB0_11:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	%r8d, %esi
	shrl	$31, %esi
	addl	%r8d, %esi
	sarl	%esi
	movslq	%esi, %rsi
	leaq	(%r12,%rsi,4), %r12
	movl	4(%r10), %ecx
	movl	%ecx, %esi
	shrl	$31, %esi
	addl	%ecx, %esi
	movl	8(%r10), %ecx
	sarl	%esi
	movslq	%esi, %rsi
	movq	-88(%rbp), %rdx                 ## 8-byte Reload
	leaq	(%rdx,%rsi,4), %rdx
	movq	%rdx, -88(%rbp)                 ## 8-byte Spill
	movl	%ecx, %esi
	shrl	$31, %esi
	addl	%ecx, %esi
	sarl	%esi
	movslq	%esi, %rcx
	movq	-96(%rbp), %rdx                 ## 8-byte Reload
	leaq	(%rdx,%rcx,4), %rdx
	movq	%rdx, -96(%rbp)                 ## 8-byte Spill
	movl	12(%r10), %ecx
	movl	%ecx, %esi
	shrl	$31, %esi
	addl	%ecx, %esi
	sarl	%esi
	movslq	%esi, %rcx
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	leaq	(%rdx,%rcx,4), %rdx
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	movl	%r14d, %ecx
	shrl	$31, %ecx
	addl	%r14d, %ecx
	sarl	%ecx
	movslq	%ecx, %rcx
	movq	-104(%rbp), %rdx                ## 8-byte Reload
	leaq	(%rdx,%rcx,4), %rdx
	movq	%rdx, -104(%rbp)                ## 8-byte Spill
	movl	4(%r9), %ecx
	movl	%ecx, %esi
	shrl	$31, %esi
	addl	%ecx, %esi
	movl	8(%r9), %ecx
	sarl	%esi
	movslq	%esi, %rsi
	movq	-112(%rbp), %rdx                ## 8-byte Reload
	leaq	(%rdx,%rsi,4), %rdx
	movq	%rdx, -112(%rbp)                ## 8-byte Spill
	movl	%ecx, %esi
	shrl	$31, %esi
	addl	%ecx, %esi
	sarl	%esi
	movslq	%esi, %rcx
	movq	-120(%rbp), %rsi                ## 8-byte Reload
	leaq	(%rsi,%rcx,4), %rsi
	movq	%rsi, -120(%rbp)                ## 8-byte Spill
	movl	12(%r9), %ecx
	movl	%ecx, %esi
	shrl	$31, %esi
	addl	%ecx, %esi
	sarl	%esi
	movslq	%esi, %rcx
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
	leaq	(%rsi,%rcx,4), %rsi
	movq	%rsi, -80(%rbp)                 ## 8-byte Spill
	incl	%eax
	cmpl	-124(%rbp), %eax                ## 4-byte Folded Reload
	je	LBB0_12
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_4 Depth 2
	testl	%edi, %edi
	jle	LBB0_11
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%eax, -128(%rbp)                ## 4-byte Spill
	xorl	%r14d, %r14d
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_4 Depth=2
	incq	%r14
	movslq	16(%r15), %rdi
	cmpq	%rdi, %r14
	jge	LBB0_10
LBB0_4:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	movss	(%rax,%r14,4), %xmm0            ## xmm0 = mem[0],zero,zero,zero
	movss	-60(%rbp), %xmm3                ## 4-byte Reload
                                        ## xmm3 = mem[0],zero,zero,zero
	divss	%xmm3, %xmm0
	movss	%xmm0, -56(%rbp)
	movss	(%r12,%r14,4), %xmm1            ## xmm1 = mem[0],zero,zero,zero
	divss	%xmm3, %xmm1
	movss	%xmm1, -52(%rbp)
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	movss	(%rax,%r14,4), %xmm2            ## xmm2 = mem[0],zero,zero,zero
	divss	%xmm3, %xmm2
	movss	%xmm2, -48(%rbp)
	callq	_FFMAX3
	movss	%xmm0, -44(%rbp)                ## 4-byte Spill
	movss	-56(%rbp), %xmm0                ## xmm0 = mem[0],zero,zero,zero
	movss	-52(%rbp), %xmm1                ## xmm1 = mem[0],zero,zero,zero
	movss	-48(%rbp), %xmm2                ## xmm2 = mem[0],zero,zero,zero
	callq	_FFMIN3
	movaps	%xmm0, %xmm1
	addss	-44(%rbp), %xmm1                ## 4-byte Folded Reload
	movss	%xmm1, -44(%rbp)                ## 4-byte Spill
	movss	-56(%rbp), %xmm0                ## xmm0 = mem[0],zero,zero,zero
	movl	48(%r13), %edi
	movl	40(%r13), %edx
	movl	44(%r13), %esi
	callq	_get_component
	movss	%xmm0, -56(%rbp)
	movss	-52(%rbp), %xmm0                ## xmm0 = mem[0],zero,zero,zero
	movl	36(%r13), %edi
	movl	28(%r13), %edx
	movl	32(%r13), %esi
	movss	-44(%rbp), %xmm1                ## 4-byte Reload
                                        ## xmm1 = mem[0],zero,zero,zero
	callq	_get_component
	movss	%xmm0, -52(%rbp)
	movss	-48(%rbp), %xmm0                ## xmm0 = mem[0],zero,zero,zero
	movl	24(%r13), %edi
	movl	16(%r13), %edx
	movl	20(%r13), %esi
	movss	-44(%rbp), %xmm1                ## 4-byte Reload
                                        ## xmm1 = mem[0],zero,zero,zero
	callq	_get_component
	movss	%xmm0, -48(%rbp)
	cmpq	$0, 8(%r13)
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=2
	leaq	-56(%rbp), %rdi
	leaq	-52(%rbp), %rsi
	leaq	-48(%rbp), %rdx
	movss	-44(%rbp), %xmm0                ## 4-byte Reload
                                        ## xmm0 = mem[0],zero,zero,zero
	callq	_preservel
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=2
	movss	-56(%rbp), %xmm0                ## xmm0 = mem[0],zero,zero,zero
	mulss	-60(%rbp), %xmm0                ## 4-byte Folded Reload
	movl	%ebx, %edi
	callq	_av_clip_uintp2_c
	movq	-120(%rbp), %rax                ## 8-byte Reload
	movss	%xmm0, (%rax,%r14,4)
	movss	-52(%rbp), %xmm0                ## xmm0 = mem[0],zero,zero,zero
	mulss	-60(%rbp), %xmm0                ## 4-byte Folded Reload
	movl	%ebx, %edi
	callq	_av_clip_uintp2_c
	movq	-104(%rbp), %rax                ## 8-byte Reload
	movss	%xmm0, (%rax,%r14,4)
	movss	-48(%rbp), %xmm0                ## xmm0 = mem[0],zero,zero,zero
	mulss	-60(%rbp), %xmm0                ## 4-byte Folded Reload
	movl	%ebx, %edi
	callq	_av_clip_uintp2_c
	movq	-112(%rbp), %rax                ## 8-byte Reload
	movss	%xmm0, (%rax,%r14,4)
	cmpq	%r15, -136(%rbp)                ## 8-byte Folded Reload
	je	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=2
	movq	8(%r15), %rax
	cmpl	$0, 12(%rax)
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=2
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movss	(%rax,%r14,4), %xmm0            ## xmm0 = mem[0],zero,zero,zero
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movss	%xmm0, (%rax,%r14,4)
	jmp	LBB0_9
LBB0_12:
	xorl	%eax, %eax
	addq	$104, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_color_balance16_p
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function color_balance16_p
_color_balance16_p:                     ; @color_balance16_p
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #176
	.cfi_def_cfa_offset 176
	stp	d9, d8, [sp, #64]               ; 16-byte Folded Spill
	stp	x28, x27, [sp, #80]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #96]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #112]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #128]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #144]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #160]            ; 16-byte Folded Spill
	add	x29, sp, #160
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	.cfi_offset b8, -104
	.cfi_offset b9, -112
	ldr	x20, [x1]
	ldr	w8, [x20]
	mul	w9, w8, w2
	sdiv	w16, w9, w3
	add	w8, w8, w9
	sdiv	w8, w8, w3
	str	w8, [sp, #8]                    ; 4-byte Folded Spill
	cmp	w16, w8
	b.ge	LBB0_12
; %bb.1:
	ldr	x23, [x0]
	ldr	x14, [x1, #8]
	ldr	w19, [x23]
	ldr	s9, [x23, #4]
	ldr	x10, [x20, #24]
	ldr	x8, [x20, #8]
	ldp	w11, w9, [x8, #8]
	mul	w9, w9, w16
	cmp	w9, #0
	cinc	w9, w9, lt
	asr	w9, w9, #1
	ldp	x13, x12, [x10, #16]
	add	x9, x12, w9, sxtw #2
	str	x9, [sp, #24]                   ; 8-byte Folded Spill
	mul	w9, w11, w16
	cmp	w9, #0
	cinc	w9, w9, lt
	asr	w9, w9, #1
	add	x9, x13, w9, sxtw #2
	stp	x14, x9, [sp, #32]              ; 16-byte Folded Spill
	ldp	w9, w11, [x8]
	mul	w11, w11, w16
	cmp	w11, #0
	cinc	w11, w11, lt
	asr	w11, w11, #1
	ldp	x10, x12, [x10]
	add	x27, x12, w11, sxtw #2
	mul	w11, w9, w16
	cmp	w11, #0
	cinc	w11, w11, lt
	asr	w11, w11, #1
	add	x28, x10, w11, sxtw #2
	ldr	x11, [x14, #24]
	ldr	x10, [x14, #8]
	ldp	w13, w12, [x10, #8]
	mul	w12, w12, w16
	cmp	w12, #0
	cinc	w12, w12, lt
	asr	w12, w12, #1
	ldp	x15, x14, [x11, #16]
	add	x12, x14, w12, sxtw #2
	str	x12, [sp, #16]                  ; 8-byte Folded Spill
	mul	w12, w13, w16
	cmp	w12, #0
	cinc	w12, w12, lt
	asr	w12, w12, #1
	add	x21, x15, w12, sxtw #2
	ldp	w12, w13, [x10]
	mul	w13, w13, w16
	cmp	w13, #0
	cinc	w13, w13, lt
	asr	w13, w13, #1
	ldp	x11, x14, [x11]
	add	x25, x14, w13, sxtw #2
	mul	w13, w12, w16
	cmp	w13, #0
	cinc	w13, w13, lt
	asr	w13, w13, #1
	add	x22, x11, w13, sxtw #2
	ldr	w11, [x20, #16]
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [sp, #32]                   ; 8-byte Folded Reload
	ldr	x10, [x8, #8]
	ldr	w12, [x10]
	ldr	x8, [x20, #8]
	ldr	w9, [x8]
	ldr	w16, [sp, #12]                  ; 4-byte Folded Reload
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	cmp	w12, #0
	cinc	w13, w12, lt
	asr	w13, w13, #1
	add	x22, x22, w13, sxtw #2
	ldp	w13, w14, [x10, #4]
	cmp	w13, #0
	cinc	w13, w13, lt
	asr	w13, w13, #1
	add	x25, x25, w13, sxtw #2
	cmp	w14, #0
	cinc	w13, w14, lt
	asr	w13, w13, #1
	add	x21, x21, w13, sxtw #2
	ldr	w13, [x10, #12]
	cmp	w13, #0
	cinc	w13, w13, lt
	asr	w13, w13, #1
	ldr	x14, [sp, #16]                  ; 8-byte Folded Reload
	add	x14, x14, w13, sxtw #2
	str	x14, [sp, #16]                  ; 8-byte Folded Spill
	cmp	w9, #0
	cinc	w13, w9, lt
	asr	w13, w13, #1
	add	x28, x28, w13, sxtw #2
	ldp	w13, w14, [x8, #4]
	cmp	w13, #0
	cinc	w13, w13, lt
	asr	w13, w13, #1
	add	x27, x27, w13, sxtw #2
	cmp	w14, #0
	cinc	w13, w14, lt
	asr	w13, w13, #1
	ldr	x14, [sp, #40]                  ; 8-byte Folded Reload
	add	x14, x14, w13, sxtw #2
	str	x14, [sp, #40]                  ; 8-byte Folded Spill
	ldr	w13, [x8, #12]
	cmp	w13, #0
	cinc	w13, w13, lt
	asr	w13, w13, #1
	ldr	x14, [sp, #24]                  ; 8-byte Folded Reload
	add	x14, x14, w13, sxtw #2
	str	x14, [sp, #24]                  ; 8-byte Folded Spill
	add	w16, w16, #1
	ldr	w13, [sp, #8]                   ; 4-byte Folded Reload
	cmp	w16, w13
	b.eq	LBB0_12
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
	cmp	w11, #1
	b.lt	LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	str	w16, [sp, #12]                  ; 4-byte Folded Spill
	mov	x24, #0
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=2
	add	x24, x24, #1
	ldrsw	x11, [x20, #16]
	cmp	x24, x11
	b.ge	LBB0_2
LBB0_7:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	lsl	x26, x24, #2
	ldr	s0, [x21, x26]
	fdiv	s0, s0, s9
	str	s0, [sp, #60]
	ldr	s1, [x22, x26]
	fdiv	s1, s1, s9
	str	s1, [sp, #56]
	ldr	s2, [x25, x26]
	fdiv	s2, s2, s9
	str	s2, [sp, #52]
	bl	_FFMAX3
	fmov	s8, s0
	ldp	s1, s0, [sp, #56]
	ldr	s2, [sp, #52]
	bl	_FFMIN3
	fadd	s8, s8, s0
	ldr	s0, [sp, #60]
	ldp	w1, w0, [x23, #44]
	ldr	w2, [x23, #40]
	fmov	s1, s8
	bl	_get_component
	str	s0, [sp, #60]
	ldr	s0, [sp, #56]
	ldp	w1, w0, [x23, #32]
	ldr	w2, [x23, #28]
	fmov	s1, s8
	bl	_get_component
	str	s0, [sp, #56]
	ldr	s0, [sp, #52]
	ldp	w1, w0, [x23, #20]
	ldr	w2, [x23, #16]
	fmov	s1, s8
	bl	_get_component
	str	s0, [sp, #52]
	ldr	x8, [x23, #8]
	cbz	x8, LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=2
	add	x0, sp, #60
	add	x1, sp, #56
	add	x2, sp, #52
	fmov	s0, s8
	bl	_preservel
LBB0_9:                                 ;   in Loop: Header=BB0_7 Depth=2
	ldr	s0, [sp, #60]
	fmul	s0, s9, s0
	mov	x0, x19
	bl	_av_clip_uintp2_c
	ldr	x8, [sp, #40]                   ; 8-byte Folded Reload
	str	s0, [x8, x26]
	ldr	s0, [sp, #56]
	fmul	s0, s9, s0
	mov	x0, x19
	bl	_av_clip_uintp2_c
	str	s0, [x28, x26]
	ldr	s0, [sp, #52]
	fmul	s0, s9, s0
	mov	x0, x19
	bl	_av_clip_uintp2_c
	str	s0, [x27, x26]
	ldr	x8, [sp, #32]                   ; 8-byte Folded Reload
	cmp	x8, x20
	b.eq	LBB0_6
; %bb.10:                               ;   in Loop: Header=BB0_7 Depth=2
	ldr	x8, [x20, #8]
	ldr	w8, [x8, #12]
	cbz	w8, LBB0_6
; %bb.11:                               ;   in Loop: Header=BB0_7 Depth=2
	ldr	x8, [sp, #16]                   ; 8-byte Folded Reload
	ldr	s0, [x8, x26]
	ldr	x8, [sp, #24]                   ; 8-byte Folded Reload
	str	s0, [x8, x26]
	b	LBB0_6
LBB0_12:
	mov	w0, #0
	ldp	x29, x30, [sp, #160]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #144]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #128]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #112]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #96]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #80]             ; 16-byte Folded Reload
	ldp	d9, d8, [sp, #64]               ; 16-byte Folded Reload
	add	sp, sp, #176
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_color_balance16_p
.subsections_via_symbols
