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

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