	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_atmel_hlcdc_plane_setup_scaler ## -- Begin function atmel_hlcdc_plane_setup_scaler
	.p2align	4, 0x90
_atmel_hlcdc_plane_setup_scaler:        ## @atmel_hlcdc_plane_setup_scaler
	.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
	movq	(%rdi), %r14
	movl	(%r14), %r13d
	testl	%r13d, %r13d
	je	LBB0_13
## %bb.1:
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movl	(%rsi), %esi
	movl	4(%rbx), %edi
	cmpl	%edi, %esi
	jne	LBB0_5
## %bb.2:
	movl	8(%rbx), %eax
	cmpl	12(%rbx), %eax
	jne	LBB0_5
## %bb.3:
	movq	%r15, %rdi
	movl	%r13d, %esi
	xorl	%edx, %edx
	jmp	LBB0_4
LBB0_5:
	cmpq	$0, 16(%r14)
	je	LBB0_11
## %bb.6:
	movq	_ATMEL_HLCDC_XPHIDEF@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_atmel_hlcdc_plane_phiscaler_get_factor
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	8(%rbx), %esi
	movl	12(%rbx), %edi
	movq	_ATMEL_HLCDC_YPHIDEF@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_atmel_hlcdc_plane_phiscaler_get_factor
	movl	%eax, %r12d
	movl	(%rbx), %eax
	movq	_heo_upscaling_xcoef@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movl	%edi, %r13d
	cmpl	4(%rbx), %eax
	jge	LBB0_8
## %bb.7:
	movq	_heo_downscaling_xcoef@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
LBB0_8:
	callq	_ARRAY_SIZE
	movq	16(%r14), %rcx
	movq	%r15, %rdi
	movl	%r13d, %esi
	movl	%eax, %edx
	callq	_atmel_hlcdc_plane_scaler_set_phicoeff
	movl	8(%rbx), %eax
	movq	_heo_upscaling_ycoef@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movl	%edi, %r13d
	cmpl	12(%rbx), %eax
	jge	LBB0_10
## %bb.9:
	movq	_heo_downscaling_ycoef@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
LBB0_10:
	callq	_ARRAY_SIZE
	movq	8(%r14), %rcx
	movq	%r15, %rdi
	movl	%r13d, %esi
	movl	%eax, %edx
	callq	_atmel_hlcdc_plane_scaler_set_phicoeff
	movl	(%r14), %r13d
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	jmp	LBB0_12
LBB0_13:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	shll	$10, %edi
	movl	%edi, %eax
	cltd
	idivl	%esi
	movl	%eax, %edi
	movl	12(%rbx), %eax
	shll	$10, %eax
	cltd
	idivl	8(%rbx)
	movl	%eax, %r12d
LBB0_12:
	movq	_ATMEL_HLCDC_LAYER_SCALER_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	%r12d, %esi
	callq	_ATMEL_HLCDC_LAYER_SCALER_FACTORS
	orl	%eax, %ebx
	movq	%r15, %rdi
	movl	%r13d, %esi
	movl	%ebx, %edx
LBB0_4:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_atmel_hlcdc_layer_write_cfg    ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_ATMEL_HLCDC_XPHIDEF,4,2        ## @ATMEL_HLCDC_XPHIDEF
	.comm	_ATMEL_HLCDC_YPHIDEF,4,2        ## @ATMEL_HLCDC_YPHIDEF
	.comm	_heo_downscaling_xcoef,4,2      ## @heo_downscaling_xcoef
	.comm	_heo_upscaling_xcoef,4,2        ## @heo_upscaling_xcoef
	.comm	_heo_downscaling_ycoef,4,2      ## @heo_downscaling_ycoef
	.comm	_heo_upscaling_ycoef,4,2        ## @heo_upscaling_ycoef
	.comm	_ATMEL_HLCDC_LAYER_SCALER_ENABLE,4,2 ## @ATMEL_HLCDC_LAYER_SCALER_ENABLE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_atmel_hlcdc_plane_setup_scaler ; -- Begin function atmel_hlcdc_plane_setup_scaler
	.p2align	2
_atmel_hlcdc_plane_setup_scaler:        ; @atmel_hlcdc_plane_setup_scaler
	.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
	ldr	x24, [x0]
	ldr	w23, [x24]
	cbz	w23, LBB0_6
; %bb.1:
	mov	x21, x1
	mov	x19, x0
	ldr	w1, [x1]
	ldr	w0, [x21, #4]
	cmp	w1, w0
	b.ne	LBB0_4
; %bb.2:
	ldp	w8, w9, [x21, #8]
	cmp	w8, w9
	b.ne	LBB0_4
; %bb.3:
	mov	x0, x19
	mov	x1, x23
	mov	w2, #0
	b	LBB0_9
LBB0_4:
	ldr	x8, [x24, #16]
	cbz	x8, LBB0_7
; %bb.5:
Lloh0:
	adrp	x8, _ATMEL_HLCDC_XPHIDEF@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ATMEL_HLCDC_XPHIDEF@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	bl	_atmel_hlcdc_plane_phiscaler_get_factor
	mov	x20, x0
	ldp	w1, w0, [x21, #8]
Lloh3:
	adrp	x8, _ATMEL_HLCDC_YPHIDEF@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ATMEL_HLCDC_YPHIDEF@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	bl	_atmel_hlcdc_plane_phiscaler_get_factor
	mov	x22, x0
	ldp	w8, w9, [x21]
Lloh6:
	adrp	x10, _heo_downscaling_xcoef@GOTPAGE
Lloh7:
	ldr	x10, [x10, _heo_downscaling_xcoef@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
Lloh9:
	adrp	x11, _heo_upscaling_xcoef@GOTPAGE
Lloh10:
	ldr	x11, [x11, _heo_upscaling_xcoef@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x11]
	cmp	w8, w9
	csel	w23, w10, w0, lt
	bl	_ARRAY_SIZE
	mov	x2, x0
	ldr	x3, [x24, #16]
	mov	x0, x19
	mov	x1, x23
	bl	_atmel_hlcdc_plane_scaler_set_phicoeff
	ldp	w8, w9, [x21, #8]
Lloh12:
	adrp	x10, _heo_downscaling_ycoef@GOTPAGE
Lloh13:
	ldr	x10, [x10, _heo_downscaling_ycoef@GOTPAGEOFF]
Lloh14:
	ldr	w10, [x10]
Lloh15:
	adrp	x11, _heo_upscaling_ycoef@GOTPAGE
Lloh16:
	ldr	x11, [x11, _heo_upscaling_ycoef@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x11]
	cmp	w8, w9
	csel	w21, w10, w0, lt
	bl	_ARRAY_SIZE
	mov	x2, x0
	ldr	x3, [x24, #8]
	mov	x0, x19
	mov	x1, x21
	bl	_atmel_hlcdc_plane_scaler_set_phicoeff
	ldr	w23, [x24]
	b	LBB0_8
LBB0_6:
	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
LBB0_7:
	lsl	w8, w0, #10
	sdiv	w20, w8, w1
	ldp	w9, w8, [x21, #8]
	lsl	w8, w8, #10
	sdiv	w22, w8, w9
LBB0_8:
Lloh18:
	adrp	x8, _ATMEL_HLCDC_LAYER_SCALER_ENABLE@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ATMEL_HLCDC_LAYER_SCALER_ENABLE@GOTPAGEOFF]
Lloh20:
	ldr	w21, [x8]
	mov	x0, x20
	mov	x1, x22
	bl	_ATMEL_HLCDC_LAYER_SCALER_FACTORS
	orr	w2, w0, w21
	mov	x0, x19
	mov	x1, x23
LBB0_9:
	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
	b	_atmel_hlcdc_layer_write_cfg
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_ATMEL_HLCDC_XPHIDEF,4,2        ; @ATMEL_HLCDC_XPHIDEF
	.comm	_ATMEL_HLCDC_YPHIDEF,4,2        ; @ATMEL_HLCDC_YPHIDEF
	.comm	_heo_downscaling_xcoef,4,2      ; @heo_downscaling_xcoef
	.comm	_heo_upscaling_xcoef,4,2        ; @heo_upscaling_xcoef
	.comm	_heo_downscaling_ycoef,4,2      ; @heo_downscaling_ycoef
	.comm	_heo_upscaling_ycoef,4,2        ; @heo_upscaling_ycoef
	.comm	_ATMEL_HLCDC_LAYER_SCALER_ENABLE,4,2 ; @ATMEL_HLCDC_LAYER_SCALER_ENABLE
.subsections_via_symbols
