	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function calc_resize_coeffs
_calc_resize_coeffs:                    ## @calc_resize_coeffs
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movl	$8192, (%rdx)                   ## imm = 0x2000
	movl	$8192, (%rcx)                   ## imm = 0x2000
	leal	(,%r14,8), %eax
	cmpl	%edi, %eax
	jge	LBB0_1
## %bb.10:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_9
LBB0_1:
	movq	%rcx, %r15
	movq	%rdx, %r12
	movl	%edi, %r13d
	leal	(%r14,%r14), %edx
	xorl	%ecx, %ecx
	movl	%edi, %eax
	cmpl	%edi, %edx
	jg	LBB0_3
## %bb.2:
	movl	%r13d, %ecx
	sarl	%ecx
	movl	%r13d, %eax
	sarl	$2, %eax
	xorl	%esi, %esi
	cmpl	%edx, %ecx
	setl	%sil
	cmovll	%ecx, %eax
	movl	$2, %ecx
	subl	%esi, %ecx
LBB0_3:
	movl	%ecx, (%r15)
	cltq
	shlq	$13, %rax
	addq	$-8192, %rax                    ## imm = 0xE000
	leal	-1(%r14), %ecx
	movslq	%ecx, %rsi
	movq	%rax, %rdx
	orq	%rsi, %rdx
	shrq	$32, %rdx
	je	LBB0_4
## %bb.5:
	cqto
	idivq	%rsi
	jmp	LBB0_6
LBB0_4:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $eax killed $eax def $rax
LBB0_6:
	movl	%eax, (%r12)
	cmpl	$16384, %eax                    ## imm = 0x4000
	jl	LBB0_8
## %bb.7:
	movq	_ipu_data@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movl	$16383, (%r12)                  ## imm = 0x3FFF
	movl	$16383, %eax                    ## imm = 0x3FFF
LBB0_8:
	movq	_ipu_data@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movl	(%r15), %r8d
	xorl	%r9d, %r9d
	cmpl	$8192, %eax                     ## imm = 0x2000
	setge	%r9b
	movl	%eax, %ecx
	andl	$8191, %ecx                     ## imm = 0x1FFF
	imull	$10000, %ecx, %ebx              ## imm = 0x2710
	shrl	$13, %ebx
	leaq	L_.str.1(%rip), %rsi
	movl	%r13d, %edx
	movl	%r14d, %ecx
	pushq	%rax
	pushq	%rbx
	callq	_dev_dbg
	addq	$16, %rsp
	xorl	%eax, %eax
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ipu_data,4,2                   ## @ipu_data
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Warning! Overflow on resize coeff.\n"

L_.str.1:                               ## @.str.1
	.asciz	"resizing from %u -> %u pixels, downsize=%u, resize=%u.%lu (reg=%u)\n"

	.no_dead_strip	_calc_resize_coeffs
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function calc_resize_coeffs
_calc_resize_coeffs:                    ; @calc_resize_coeffs
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	w8, #8192
	str	w8, [x2]
	str	w8, [x3]
	cmp	w0, w1, lsl #3
	b.le	LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_5
LBB0_2:
	mov	x19, x1
	mov	x20, x0
	lsl	w8, w1, #1
	asr	w9, w0, #1
	asr	w10, w0, #2
	mov	w11, #1
	cmp	w9, w8
	csel	w9, w9, w10, lt
	cinc	w10, w11, ge
	cmp	w8, w0
	csel	w8, w0, w9, gt
	csel	w9, wzr, w10, gt
	mov	x21, x3
	mov	x22, x2
	str	w9, [x3]
	sub	w8, w8, #1
	sbfiz	x8, x8, #13, #32
	sub	w9, w1, #1
	sxtw	x9, w9
	sdiv	x7, x8, x9
	str	w7, [x2]
Lloh3:
	adrp	x23, _ipu_data@GOTPAGE
Lloh4:
	ldr	x23, [x23, _ipu_data@GOTPAGEOFF]
	cmp	w7, #4, lsl #12                 ; =16384
	b.lt	LBB0_4
; %bb.3:
	ldr	w0, [x23]
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	mov	w7, #16383
	str	w7, [x22]
LBB0_4:
	ldr	w0, [x23]
	ldr	w4, [x21]
	cmp	w7, #2, lsl #12                 ; =8192
	cset	w5, ge
	and	w8, w7, #0x1fff
	mov	w9, #10000
	mul	w8, w8, w9
	lsr	w6, w8, #13
Lloh7:
	adrp	x1, l_.str.1@PAGE
Lloh8:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x20
	mov	x3, x19
                                        ; kill: def $w7 killed $w7 killed $x7
	bl	_dev_dbg
	mov	w0, #0
LBB0_5:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ipu_data,4,2                   ; @ipu_data
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Warning! Overflow on resize coeff.\n"

l_.str.1:                               ; @.str.1
	.asciz	"resizing from %u -> %u pixels, downsize=%u, resize=%u.%lu (reg=%u)\n"

	.no_dead_strip	_calc_resize_coeffs
.subsections_via_symbols
