	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gxResetScaler
_gxResetScaler:                         ## @gxResetScaler
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%edi, %r14d
	movl	$0, -20(%rbp)
	movl	$0, -24(%rbp)
	leaq	-20(%rbp), %rdi
	leaq	-24(%rbp), %rsi
	callq	_gxSetAspectRatio
	movq	_rmode@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movl	$640, (%rsi)                    ## imm = 0x280
	movq	_config@GOTPCREL(%rip), %r8
	movl	20(%r8), %edi
	movl	$640, %ebx                      ## imm = 0x280
	movl	16(%r8), %eax
	orl	%edi, %eax
	jne	LBB0_6
## %bb.1:
	movl	-20(%rbp), %eax
	cmpl	$320, %r14d                     ## imm = 0x140
	jg	LBB0_4
## %bb.2:
	cmpl	%r14d, %eax
	jl	LBB0_4
## %bb.3:
	addl	%r14d, %r14d
	jmp	LBB0_5
LBB0_4:
	movl	$640, %ebx                      ## imm = 0x280
	cmpl	$640, %r14d                     ## imm = 0x280
	jg	LBB0_7
LBB0_5:
	movl	%r14d, (%rsi)
	movl	%r14d, %ebx
LBB0_6:
	movl	-20(%rbp), %eax
LBB0_7:
	leal	(%rax,%rax), %ecx
	cmpl	%ebx, %ecx
	jle	LBB0_14
## %bb.8:
	xorl	%ecx, %ecx
	cmpl	$361, %eax                      ## imm = 0x169
	jl	LBB0_10
## %bb.9:
	addl	$-360, %eax                     ## imm = 0xFE98
	imull	%ebx, %eax
                                        ## kill: def $eax killed $eax killed $rax
	cltd
	idivl	4(%rsi)
	movl	%eax, %ecx
	movl	$360, -20(%rbp)                 ## imm = 0x168
	movl	(%rsi), %ebx
	movl	$360, %eax                      ## imm = 0x168
LBB0_10:
	movl	%ebx, %edx
	shrl	$31, %edx
	addl	%ebx, %edx
	movl	%eax, %ebx
	addl	%eax, %ebx
	movl	%ebx, 4(%rsi)
	movl	$720, %eax                      ## imm = 0x2D0
	subl	%ebx, %eax
	sarl	%eax
	movl	%eax, 8(%rsi)
	sarl	%edx
	movl	%edx, -20(%rbp)
	testl	%ecx, %ecx
	je	LBB0_15
## %bb.11:
	orl	16(%r8), %edi
	je	LBB0_12
## %bb.13:
	addl	%ecx, %edx
	movl	%edx, -20(%rbp)
	jmp	LBB0_15
LBB0_14:
	movl	%ebx, 4(%rsi)
	movl	$720, %eax                      ## imm = 0x2D0
	subl	%ebx, %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%eax, %ecx
	sarl	%ecx
	movl	%ecx, 8(%rsi)
	jmp	LBB0_15
LBB0_12:
	addl	%ecx, %ecx
	subl	%ecx, (%rsi)
LBB0_15:
	movl	(%r8), %edi
	movl	4(%r8), %edx
	movl	(%rsi), %ecx
	movl	12(%rsi), %eax
	movl	16(%rsi), %esi
	cmpq	$0, 8(%r8)
	je	LBB0_17
## %bb.16:
	shll	-24(%rbp)
LBB0_17:
	imull	%edx, %eax
	cltd
	idivl	%esi
	movl	%eax, %esi
	imull	%edi, %ecx
	movl	%ecx, %eax
	cltd
	idivl	%ebx
                                        ## kill: def $eax killed $eax def $rax
	movl	-20(%rbp), %ecx
	leal	(%rcx,%rax), %edx
	movq	_square@GOTPCREL(%rip), %rdi
	movq	(%rdi), %rdi
	movl	%edx, 12(%rdi)
	movl	%edx, 24(%rdi)
	subl	%ecx, %eax
	movl	%eax, 36(%rdi)
	movl	%eax, (%rdi)
	movl	-24(%rbp), %eax
	leal	(%rax,%rsi), %ecx
	movl	%ecx, 4(%rdi)
	movl	%ecx, 16(%rdi)
	subl	%eax, %esi
	movl	%esi, 40(%rdi)
	movl	%esi, 28(%rdi)
	movl	$32, %esi
	callq	_DCFlushRange
	xorl	%eax, %eax
	callq	_GX_InvVtxCache
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_rmode,8,3                      ## @rmode
	.comm	_config,24,3                    ## @config
	.comm	_square,8,3                     ## @square
	.no_dead_strip	_gxResetScaler
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gxResetScaler
_gxResetScaler:                         ; @gxResetScaler
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	str	xzr, [sp, #8]
	add	x0, sp, #12
	add	x1, sp, #8
	bl	_gxSetAspectRatio
Lloh0:
	adrp	x8, _rmode@GOTPAGE
Lloh1:
	ldr	x8, [x8, _rmode@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	mov	w10, #640
	str	w10, [x8]
Lloh3:
	adrp	x9, _config@GOTPAGE
Lloh4:
	ldr	x9, [x9, _config@GOTPAGEOFF]
	ldp	w12, w11, [x9, #16]
	orr	w12, w11, w12
	cbnz	w12, LBB0_6
; %bb.1:
	ldr	w12, [sp, #12]
	cmp	w19, #320
	b.gt	LBB0_4
; %bb.2:
	cmp	w12, w19
	b.lt	LBB0_4
; %bb.3:
	lsl	w19, w19, #1
	b	LBB0_5
LBB0_4:
	cmp	w19, #640
	b.gt	LBB0_14
LBB0_5:
	str	w19, [x8]
	mov	x10, x19
LBB0_6:
	ldr	w12, [sp, #12]
	cmp	w10, w12, lsl #1
	b.ge	LBB0_15
LBB0_7:
	cmp	w12, #361
	b.lt	LBB0_9
; %bb.8:
	sub	w12, w12, #360
	mul	w13, w12, w10
	mov	w12, #360
	str	w12, [sp, #12]
	ldp	w10, w14, [x8]
	sdiv	w13, w13, w14
	b	LBB0_10
LBB0_9:
	mov	w13, #0
LBB0_10:
	mov	x14, x10
	lsl	w10, w12, #1
	mov	w12, #720
	sub	w12, w12, w10
	mov	w15, #721
	sub	w15, w15, w10
	cmp	w12, #0
	csel	w12, w15, w12, lt
	asr	w12, w12, #1
	stp	w10, w12, [x8, #4]
	cmp	w14, #0
	cinc	w12, w14, lt
	asr	w12, w12, #1
	str	w12, [sp, #12]
	cbz	w13, LBB0_16
; %bb.11:
	ldr	w14, [x9, #16]
	orr	w11, w11, w14
	cbz	w11, LBB0_13
; %bb.12:
	add	w11, w12, w13
	str	w11, [sp, #12]
	b	LBB0_16
LBB0_13:
	ldr	w11, [x8]
	sub	w11, w11, w13, lsl #1
	str	w11, [x8]
	b	LBB0_16
LBB0_14:
	mov	w10, #640
	cmp	w10, w12, lsl #1
	b.lt	LBB0_7
LBB0_15:
	mov	w11, #720
	sub	w11, w11, w10
	mov	w12, #721
	sub	w12, w12, w10
	cmp	w11, #0
	csel	w11, w12, w11, lt
	asr	w11, w11, #1
	stp	w10, w11, [x8, #4]
LBB0_16:
	ldr	w11, [x8]
	ldp	w12, w13, [x9]
	ldp	w14, w8, [x8, #12]
	ldr	x9, [x9, #8]
	cbz	x9, LBB0_18
; %bb.17:
	ldr	w9, [sp, #8]
	lsl	w9, w9, #1
	str	w9, [sp, #8]
LBB0_18:
	mul	w9, w14, w13
	sdiv	w8, w9, w8
	mul	w9, w11, w12
	sdiv	w9, w9, w10
	ldr	w10, [sp, #12]
Lloh5:
	adrp	x11, _square@GOTPAGE
Lloh6:
	ldr	x11, [x11, _square@GOTPAGEOFF]
Lloh7:
	ldr	x0, [x11]
	sub	w11, w9, w10
	str	w11, [x0]
	ldr	w12, [sp, #8]
	add	w9, w10, w9
	add	w10, w12, w8
	str	w10, [x0, #4]
	stp	w9, w10, [x0, #12]
	sub	w8, w8, w12
	stp	w11, w8, [x0, #36]
	stp	w9, w8, [x0, #24]
	mov	w1, #32
	bl	_DCFlushRange
	bl	_GX_InvVtxCache
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_rmode,8,3                      ; @rmode
	.comm	_config,24,3                    ; @config
	.comm	_square,8,3                     ; @square
	.no_dead_strip	_gxResetScaler
.subsections_via_symbols
