	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gsc_set_scaler_info            ## -- Begin function gsc_set_scaler_info
	.p2align	4, 0x90
_gsc_set_scaler_info:                   ## @gsc_set_scaler_info
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	16(%rdi), %rax
	movq	(%rax), %r14
	movq	8(%rax), %r15
	movl	32(%rdi), %esi
	movl	36(%rdi), %edx
	movl	24(%rdi), %ecx
	movl	28(%rdi), %r8d
	movq	(%rdi), %rax
	movl	(%rax), %r9d
	movl	8(%rdi), %eax
	movl	%eax, (%rsp)
	movq	%r15, %rdi
	callq	_gsc_check_scaler_ratio
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %r13d
	leaq	L_.str(%rip), %rdi
	callq	_pr_err
	jmp	LBB0_14
LBB0_2:
	leaq	24(%rbx), %rcx
	leaq	28(%rbx), %rax
	movq	(%rbx), %rdx
	movl	(%rdx), %edx
	cmpl	$90, %edx
	je	LBB0_3
## %bb.4:
	cmpl	$270, %edx                      ## imm = 0x10E
	jne	LBB0_5
LBB0_3:
	movq	%rax, %rdx
	movq	%rcx, %rax
	jmp	LBB0_6
LBB0_5:
	movq	%rcx, %rdx
LBB0_6:
	movl	(%rax), %ecx
	movl	(%rdx), %r12d
	testl	%r12d, %r12d
	jle	LBB0_8
## %bb.7:
	testl	%ecx, %ecx
	jle	LBB0_8
## %bb.9:
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movl	32(%rbx), %esi
	leaq	52(%rbx), %r14
	movq	%r15, %rdi
	movl	%r12d, %edx
	movq	%r14, %rcx
	callq	_gsc_cal_prescaler_ratio
	testl	%eax, %eax
	je	LBB0_11
## %bb.10:
	movl	%eax, %r13d
	leaq	L_.str.2(%rip), %rdi
	callq	_pr_err
	jmp	LBB0_14
LBB0_8:
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	movl	%r12d, %edx
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
LBB0_14:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movl	36(%rbx), %esi
	leaq	48(%rbx), %rcx
	movq	%r15, %rdi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	callq	_gsc_cal_prescaler_ratio
	testl	%eax, %eax
	je	LBB0_13
## %bb.12:
	movl	%eax, %r13d
	leaq	L_.str.3(%rip), %rdi
	callq	_pr_err
	jmp	LBB0_14
LBB0_13:
	leaq	32(%rbx), %rsi
	movq	%r15, %rdi
	movq	%r14, %rdx
	movl	%r12d, %ecx
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	movl	%r14d, %r8d
	movq	-56(%rbp), %r9                  ## 8-byte Reload
	callq	_gsc_check_src_scale_info
	movl	48(%rbx), %esi
	movl	52(%rbx), %edi
	leaq	56(%rbx), %rdx
	callq	_gsc_get_prescaler_shfactor
	movl	32(%rbx), %esi
	movl	36(%rbx), %ecx
	movl	%esi, %eax
	shll	$16, %eax
	cltd
	idivl	%r12d
	movl	%eax, 40(%rbx)
	movl	%ecx, %eax
	shll	$16, %eax
	cltd
	idivl	%r14d
	movl	%eax, 44(%rbx)
	leaq	L_.str.4(%rip), %rdi
	xorl	%r13d, %r13d
	movl	%ecx, %edx
	movl	%r12d, %ecx
	movl	%r14d, %r8d
	xorl	%eax, %eax
	callq	_pr_debug
	movl	52(%rbx), %edx
	movl	56(%rbx), %esi
	leaq	L_.str.5(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_debug
	movl	48(%rbx), %esi
	movl	40(%rbx), %edx
	movl	44(%rbx), %ecx
	leaq	L_.str.6(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_debug
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"out of scaler range"

L_.str.1:                               ## @.str.1
	.asciz	"Invalid target size: %dx%d"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.2:                               ## @.str.2
	.asciz	"Horizontal scale ratio is out of range"

L_.str.3:                               ## @.str.3
	.asciz	"Vertical scale ratio is out of range"

L_.str.4:                               ## @.str.4
	.asciz	"scaler input/output size : sx = %d, sy = %d, tx = %d, ty = %d"

L_.str.5:                               ## @.str.5
	.asciz	"scaler ratio info : pre_shfactor : %d, pre_h : %d"

L_.str.6:                               ## @.str.6
	.asciz	"pre_v :%d, main_h : %d, main_v : %d"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gsc_set_scaler_info            ; -- Begin function gsc_set_scaler_info
	.p2align	2
_gsc_set_scaler_info:                   ; @gsc_set_scaler_info
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x19, x0
	mov	x20, x0
	ldr	w1, [x20, #32]!
	ldr	x8, [x0, #16]
	ldp	x24, x21, [x8]
	ldr	w2, [x0, #36]
	mov	x22, x0
	ldr	w3, [x22, #24]!
	mov	x23, x0
	ldr	w4, [x23, #28]!
	ldr	x8, [x0]
	ldr	w5, [x8]
	ldr	w6, [x0, #8]
	mov	x0, x21
	bl	_gsc_check_scaler_ratio
	cbz	w0, LBB0_2
; %bb.1:
	mov	x25, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
	b	LBB0_9
LBB0_2:
	ldr	x8, [x19]
	ldr	w8, [x8]
	cmp	w8, #90
	b.eq	LBB0_4
; %bb.3:
	cmp	w8, #270
	csel	x8, x23, x22, eq
	csel	x22, x22, x23, eq
	mov	x23, x8
LBB0_4:
	ldr	w22, [x22]
	ldr	w23, [x23]
	cmp	w23, #1
	b.lt	LBB0_8
; %bb.5:
	cmp	w22, #0
	b.le	LBB0_8
; %bb.6:
	ldr	w1, [x19, #32]
	add	x24, x19, #52
	mov	x0, x21
	mov	x2, x23
	mov	x3, x24
	bl	_gsc_cal_prescaler_ratio
	cbz	w0, LBB0_10
; %bb.7:
	mov	x25, x0
Lloh2:
	adrp	x0, l_.str.2@PAGE
Lloh3:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_pr_err
	b	LBB0_9
LBB0_8:
Lloh4:
	adrp	x1, l_.str.1@PAGE
Lloh5:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x24
	mov	x2, x23
	mov	x3, x22
	bl	_dev_err
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w25, w8
LBB0_9:
	mov	x0, x25
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_10:
	ldr	w1, [x19, #36]
	add	x26, x19, #48
	mov	x0, x21
	mov	x2, x22
	mov	x3, x26
	bl	_gsc_cal_prescaler_ratio
	mov	x25, x0
	cbz	w0, LBB0_12
; %bb.11:
Lloh9:
	adrp	x0, l_.str.3@PAGE
Lloh10:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_pr_err
	b	LBB0_9
LBB0_12:
	mov	x0, x21
	mov	x1, x20
	mov	x2, x24
	mov	x3, x23
	mov	x4, x22
	mov	x5, x26
	bl	_gsc_check_src_scale_info
	ldp	w1, w0, [x19, #48]
	add	x2, x19, #56
	bl	_gsc_get_prescaler_shfactor
	ldp	w1, w2, [x19, #32]
	lsl	w8, w1, #16
	sdiv	w8, w8, w23
	lsl	w9, w2, #16
	sdiv	w9, w9, w22
	stp	w8, w9, [x19, #40]
	stp	x23, x22, [sp]
Lloh11:
	adrp	x0, l_.str.4@PAGE
Lloh12:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_pr_debug
	ldp	w2, w1, [x19, #52]
Lloh13:
	adrp	x0, l_.str.5@PAGE
Lloh14:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_pr_debug
	ldp	w8, w1, [x19, #44]
	ldr	w2, [x19, #40]
	str	x8, [sp]
Lloh15:
	adrp	x0, l_.str.6@PAGE
Lloh16:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_pr_debug
	b	LBB0_9
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"out of scaler range"

l_.str.1:                               ; @.str.1
	.asciz	"Invalid target size: %dx%d"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.2:                               ; @.str.2
	.asciz	"Horizontal scale ratio is out of range"

l_.str.3:                               ; @.str.3
	.asciz	"Vertical scale ratio is out of range"

l_.str.4:                               ; @.str.4
	.asciz	"scaler input/output size : sx = %d, sy = %d, tx = %d, ty = %d"

l_.str.5:                               ; @.str.5
	.asciz	"scaler ratio info : pre_shfactor : %d, pre_h : %d"

l_.str.6:                               ; @.str.6
	.asciz	"pre_v :%d, main_h : %d, main_v : %d"

.subsections_via_symbols
