	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_YabauseSetVideoFormat          ## -- Begin function YabauseSetVideoFormat
	.p2align	4, 0x90
_YabauseSetVideoFormat:                 ## @YabauseSetVideoFormat
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	_yabsys@GOTPCREL(%rip), %rbx
	movl	%edi, (%rbx)
	movl	$263, %eax                      ## imm = 0x107
	movl	$313, %ecx                      ## imm = 0x139
	testl	%edi, %edi
	cmovel	%eax, %ecx
	movl	%ecx, 4(%rbx)
	movl	8(%rbx), %eax
	je	LBB0_2
## %bb.1:
	cltq
	imulq	$1374389535, %rax, %rax         ## imm = 0x51EB851F
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$36, %rax
	jmp	LBB0_3
LBB0_2:
	imull	$1001, %eax, %eax               ## imm = 0x3E9
	cltq
	imulq	$1172812403, %rax, %rax         ## imm = 0x45E7B273
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$46, %rax
LBB0_3:
	addl	%ecx, %eax
	movl	%eax, 12(%rbx)
	movq	_Vdp2Regs@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	%edi, %ecx
	andl	$1, %ecx
	orl	%ecx, (%rax)
	callq	_ScspChangeVideoFormat
	movl	16(%rbx), %edi
	callq	_YabauseChangeTiming
	xorl	%eax, %eax
	callq	_YabauseGetTicks
	movq	_lastticks@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_yabsys,20,2                    ## @yabsys
	.comm	_Vdp2Regs,8,3                   ## @Vdp2Regs
	.comm	_lastticks,4,2                  ## @lastticks
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_YabauseSetVideoFormat          ; -- Begin function YabauseSetVideoFormat
	.p2align	2
_YabauseSetVideoFormat:                 ; @YabauseSetVideoFormat
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
Lloh0:
	adrp	x19, _yabsys@GOTPAGE
Lloh1:
	ldr	x19, [x19, _yabsys@GOTPAGEOFF]
	mov	w8, #313
	mov	w9, #263
	cmp	w0, #0
	csel	w8, w9, w8, eq
	stp	w0, w8, [x19]
	ldr	w8, [x19, #8]
	mov	w9, #1001
	mul	w9, w8, w9
	mov	w10, #45683
	movk	w10, #17895, lsl #16
	smull	x9, w9, w10
	lsr	x10, x9, #63
	asr	x9, x9, #46
	add	w9, w9, w10
	mov	w10, #34079
	movk	w10, #20971, lsl #16
	smull	x8, w8, w10
	lsr	x10, x8, #63
	asr	x8, x8, #36
	add	w8, w8, w10
	cmp	w0, #0
	csel	w8, w9, w8, eq
Lloh2:
	adrp	x9, _Vdp2Regs@GOTPAGE
Lloh3:
	ldr	x9, [x9, _Vdp2Regs@GOTPAGEOFF]
	str	w8, [x19, #12]
Lloh4:
	ldr	x8, [x9]
	ldr	w9, [x8]
	and	w10, w0, #0x1
	orr	w9, w9, w10
	str	w9, [x8]
	bl	_ScspChangeVideoFormat
	ldr	w0, [x19, #16]
	bl	_YabauseChangeTiming
	bl	_YabauseGetTicks
Lloh5:
	adrp	x8, _lastticks@GOTPAGE
Lloh6:
	ldr	x8, [x8, _lastticks@GOTPAGEOFF]
Lloh7:
	str	w0, [x8]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotStr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_yabsys,20,2                    ; @yabsys
	.comm	_Vdp2Regs,8,3                   ; @Vdp2Regs
	.comm	_lastticks,4,2                  ; @lastticks
.subsections_via_symbols
