	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gsc_set_prescaler
_gsc_set_prescaler:                     ## @gsc_set_prescaler
	.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	%rsi, %r15
	movq	%rdi, %rbx
	movl	(%rdx), %r13d
	movl	4(%rdx), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	xorl	%eax, %eax
	xorl	%edx, %edx
	cmpq	$0, 8(%rdi)
	setne	%al
	sete	%dl
	movl	(%rcx,%rdx,4), %edx
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movl	(%rcx,%rax,4), %r12d
	leaq	12(%rsi), %rcx
	movl	%r13d, %esi
	movl	%r12d, %edx
	callq	_gsc_get_ratio_shift
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %r14d
	movl	(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	callq	_DRM_DEV_ERROR
	jmp	LBB0_5
LBB0_2:
	leaq	8(%r15), %rcx
	movq	%rbx, %rdi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_gsc_get_ratio_shift
	movl	(%rbx), %edi
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %r14d
	leaq	L_.str.1(%rip), %rsi
	callq	_DRM_DEV_ERROR
	jmp	LBB0_5
LBB0_4:
	movl	8(%r15), %ecx
	movl	12(%r15), %edx
	leaq	L_.str.2(%rip), %rsi
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_DRM_DEV_DEBUG_KMS
	shll	$16, %r13d
	movl	%r13d, %eax
	cltd
	idivl	%r12d
	movl	%eax, %ecx
	movl	%eax, (%r15)
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	shll	$16, %eax
	cltd
	idivl	-44(%rbp)                       ## 4-byte Folded Reload
	movl	%eax, 4(%r15)
	movl	(%rbx), %edi
	leaq	L_.str.3(%rip), %rsi
	movl	%ecx, %edx
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_DRM_DEV_DEBUG_KMS
	movl	8(%r15), %esi
	movl	12(%r15), %edi
	leaq	16(%r15), %rdx
	callq	_gsc_get_prescaler_shfactor
	movl	(%rbx), %edi
	movl	16(%r15), %edx
	leaq	L_.str.4(%rip), %rsi
	xorl	%eax, %eax
	callq	_DRM_DEV_DEBUG_KMS
	movl	16(%r15), %edi
	callq	_GSC_PRESC_SHFACTOR
	movl	%eax, %ebx
	movl	12(%r15), %edi
	callq	_GSC_PRESC_H_RATIO
	orl	%eax, %ebx
	movl	8(%r15), %edi
	callq	_GSC_PRESC_V_RATIO
	orl	%eax, %ebx
	movq	_GSC_PRE_SCALE_RATIO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	callq	_gsc_write
LBB0_5:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to get ratio horizontal.\n"

L_.str.1:                               ## @.str.1
	.asciz	"failed to get ratio vertical.\n"

L_.str.2:                               ## @.str.2
	.asciz	"pre_hratio[%d]pre_vratio[%d]\n"

L_.str.3:                               ## @.str.3
	.asciz	"main_hratio[%ld]main_vratio[%ld]\n"

L_.str.4:                               ## @.str.4
	.asciz	"pre_shfactor[%d]\n"

	.comm	_GSC_PRE_SCALE_RATIO,4,2        ## @GSC_PRE_SCALE_RATIO
	.no_dead_strip	_gsc_set_prescaler
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gsc_set_prescaler
_gsc_set_prescaler:                     ; @gsc_set_prescaler
	.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, x1
	mov	x20, x0
	ldp	w22, w21, [x2]
	ldr	x8, [x0, #8]
	cmp	x8, #0
	cset	w8, ne
	cset	w9, eq
	ldr	w23, [x3, w9, uxtw #2]
	ldr	w24, [x3, w8, uxtw #2]
	add	x3, x1, #12
	mov	x1, x22
	mov	x2, x24
	bl	_gsc_get_ratio_shift
	cbz	w0, LBB0_2
; %bb.1:
	mov	x25, x0
	ldr	w0, [x20]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_DRM_DEV_ERROR
	b	LBB0_5
LBB0_2:
	add	x3, x19, #8
	mov	x0, x20
	mov	x1, x21
	mov	x2, x23
	bl	_gsc_get_ratio_shift
	mov	x25, x0
	ldr	w0, [x20]
	cbz	w25, LBB0_4
; %bb.3:
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_DRM_DEV_ERROR
	b	LBB0_5
LBB0_4:
	ldp	w8, w2, [x19, #8]
	str	x8, [sp]
Lloh4:
	adrp	x1, l_.str.2@PAGE
Lloh5:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_DRM_DEV_DEBUG_KMS
	lsl	w8, w22, #16
	sdiv	w2, w8, w24
	lsl	w8, w21, #16
	sdiv	w8, w8, w23
	stp	w2, w8, [x19]
	ldr	w0, [x20]
	str	x8, [sp]
Lloh6:
	adrp	x1, l_.str.3@PAGE
Lloh7:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_DRM_DEV_DEBUG_KMS
	ldp	w1, w0, [x19, #8]
	add	x2, x19, #16
	bl	_gsc_get_prescaler_shfactor
	ldr	w0, [x20]
	ldr	w2, [x19, #16]
Lloh8:
	adrp	x1, l_.str.4@PAGE
Lloh9:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_DRM_DEV_DEBUG_KMS
	ldr	w0, [x19, #16]
	bl	_GSC_PRESC_SHFACTOR
	mov	x20, x0
	ldr	w0, [x19, #12]
	bl	_GSC_PRESC_H_RATIO
	orr	w20, w0, w20
	ldr	w0, [x19, #8]
	bl	_GSC_PRESC_V_RATIO
	orr	w0, w20, w0
Lloh10:
	adrp	x8, _GSC_PRE_SCALE_RATIO@GOTPAGE
Lloh11:
	ldr	x8, [x8, _GSC_PRE_SCALE_RATIO@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	bl	_gsc_write
LBB0_5:
	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
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to get ratio horizontal.\n"

l_.str.1:                               ; @.str.1
	.asciz	"failed to get ratio vertical.\n"

l_.str.2:                               ; @.str.2
	.asciz	"pre_hratio[%d]pre_vratio[%d]\n"

l_.str.3:                               ; @.str.3
	.asciz	"main_hratio[%ld]main_vratio[%ld]\n"

l_.str.4:                               ; @.str.4
	.asciz	"pre_shfactor[%d]\n"

	.comm	_GSC_PRE_SCALE_RATIO,4,2        ; @GSC_PRE_SCALE_RATIO
	.no_dead_strip	_gsc_set_prescaler
.subsections_via_symbols
