	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function snd_opl4_update_pitch
_snd_opl4_update_pitch:                 ## @snd_opl4_update_pitch
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	24(%rsi), %rax
	movq	24(%rax), %rcx
	xorl	%edx, %edx
	testq	%rcx, %rcx
	jne	LBB0_2
## %bb.1:
	movl	(%r15), %edx
	shll	$7, %edx
	addl	$-7680, %edx                    ## imm = 0xE200
LBB0_2:
	movq	16(%r15), %rsi
	imull	(%rsi), %edx
	movslq	%edx, %rdx
	imulq	$1374389535, %rdx, %rdx         ## imm = 0x51EB851F
	movq	%rdx, %rdi
	shrq	$63, %rdi
	sarq	$37, %rdx
	addl	%edi, %edx
	movl	8(%rsi), %esi
	addl	%esi, %edx
	addl	$7680, %edx                     ## imm = 0x1E00
	testq	%rcx, %rcx
	jne	LBB0_4
## %bb.3:
	addl	16(%rax), %edx
LBB0_4:
	movl	(%rax), %ecx
	movl	8(%rax), %esi
	sarl	$7, %ecx
	addl	%edx, %ecx
	imull	4(%rax), %esi
	leal	8191(%rsi), %eax
	testl	%esi, %esi
	cmovnsl	%esi, %eax
	sarl	$13, %eax
	addl	%ecx, %eax
	cmpl	$24575, %eax                    ## imm = 0x5FFF
	movl	$24575, %ecx                    ## imm = 0x5FFF
	cmovll	%eax, %ecx
	xorl	%eax, %eax
	testl	%ecx, %ecx
	cmovgl	%ecx, %eax
	movq	_snd_opl4_pitch_map@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	imull	$43691, %eax, %edi              ## imm = 0xAAAB
	shrl	$26, %edi
	movl	%edi, %edx
	shll	$9, %edx
	leal	(%rdx,%rdx,2), %edx
	subl	%edx, %eax
	movzwl	%ax, %eax
	movq	_OPL4_REG_OCTAVE@GOTPCREL(%rip), %rdx
	movq	8(%r15), %rsi
	addq	(%rdx), %rsi
	movl	(%rcx,%rax,4), %ebx
	shll	$4, %edi
	addl	$-128, %edi
	movl	%ebx, %edx
	sarl	$7, %edx
	movq	_OPL4_F_NUMBER_HIGH_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %edx
	orl	%edi, %edx
	movq	%r14, %rdi
	callq	_snd_opl4_write
	movq	_OPL4_TONE_NUMBER_BIT8@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	4(%r15), %eax
	addl	%ebx, %ebx
	movq	_OPL4_F_NUMBER_LOW_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %ebx
	orl	%eax, %ebx
	movl	%ebx, 4(%r15)
	movq	_OPL4_REG_F_NUMBER@GOTPCREL(%rip), %rax
	movq	8(%r15), %rsi
	addq	(%rax), %rsi
	movq	%r14, %rdi
	movl	%ebx, %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_snd_opl4_write                 ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_snd_opl4_pitch_map,8,3         ## @snd_opl4_pitch_map
	.comm	_OPL4_REG_OCTAVE,8,3            ## @OPL4_REG_OCTAVE
	.comm	_OPL4_F_NUMBER_HIGH_MASK,4,2    ## @OPL4_F_NUMBER_HIGH_MASK
	.comm	_OPL4_TONE_NUMBER_BIT8,4,2      ## @OPL4_TONE_NUMBER_BIT8
	.comm	_OPL4_F_NUMBER_LOW_MASK,4,2     ## @OPL4_F_NUMBER_LOW_MASK
	.comm	_OPL4_REG_F_NUMBER,8,3          ## @OPL4_REG_F_NUMBER
	.no_dead_strip	_snd_opl4_update_pitch
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function snd_opl4_update_pitch
_snd_opl4_update_pitch:                 ; @snd_opl4_update_pitch
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x20, x1
	mov	x19, x0
	ldr	x8, [x1, #24]
	ldr	x9, [x8, #24]
	cbz	x9, LBB0_2
; %bb.1:
	mov	w10, #0
	b	LBB0_3
LBB0_2:
	ldr	w10, [x20]
	mov	w11, #-7680
	add	w10, w11, w10, lsl #7
LBB0_3:
	ldr	x11, [x20, #16]
	ldr	w12, [x11]
	mul	w10, w12, w10
	mov	w12, #34079
	movk	w12, #20971, lsl #16
	smull	x10, w10, w12
	lsr	x12, x10, #63
	asr	x10, x10, #37
	ldr	w11, [x11, #8]
	add	w10, w10, w12
	add	w10, w10, w11
	mov	w11, #7680
	add	w10, w10, w11
	cbnz	x9, LBB0_5
; %bb.4:
	ldr	w9, [x8, #16]
	add	w10, w10, w9
LBB0_5:
	ldp	w9, w11, [x8]
	add	w9, w10, w9, asr #7
	ldr	w8, [x8, #8]
	mul	w8, w8, w11
	mov	w10, #8191
	add	w10, w8, w10
	cmp	w8, #0
	csel	w8, w10, w8, lt
	add	w8, w9, w8, asr #13
	mov	w9, #24575
	cmp	w8, w9
	csel	w8, w8, w9, lt
	cmp	w8, #0
	csel	w8, w8, wzr, gt
	and	w9, w8, #0xffff
	mov	w10, #43691
	mul	w9, w9, w10
	lsr	w9, w9, #26
Lloh0:
	adrp	x10, _snd_opl4_pitch_map@GOTPAGE
Lloh1:
	ldr	x10, [x10, _snd_opl4_pitch_map@GOTPAGEOFF]
Lloh2:
	ldr	x10, [x10]
	mov	w11, #1536
	msub	w8, w9, w11, w8
	and	x8, x8, #0xffff
	ldr	w21, [x10, x8, lsl #2]
Lloh3:
	adrp	x8, _OPL4_REG_OCTAVE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _OPL4_REG_OCTAVE@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	ldr	x10, [x20, #8]
	add	x1, x10, x8
	lsl	w8, w9, #4
	sub	w8, w8, #128
Lloh6:
	adrp	x9, _OPL4_F_NUMBER_HIGH_MASK@GOTPAGE
Lloh7:
	ldr	x9, [x9, _OPL4_F_NUMBER_HIGH_MASK@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	and	w9, w9, w21, asr #7
	orr	w2, w8, w9
	mov	x0, x19
	bl	_snd_opl4_write
	ldr	w8, [x20, #4]
Lloh9:
	adrp	x9, _OPL4_TONE_NUMBER_BIT8@GOTPAGE
Lloh10:
	ldr	x9, [x9, _OPL4_TONE_NUMBER_BIT8@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	and	w8, w9, w8
Lloh12:
	adrp	x9, _OPL4_F_NUMBER_LOW_MASK@GOTPAGE
Lloh13:
	ldr	x9, [x9, _OPL4_F_NUMBER_LOW_MASK@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	and	w9, w9, w21, lsl #1
	orr	w2, w9, w8
	str	w2, [x20, #4]
Lloh15:
	adrp	x8, _OPL4_REG_F_NUMBER@GOTPAGE
Lloh16:
	ldr	x8, [x8, _OPL4_REG_F_NUMBER@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
	ldr	x9, [x20, #8]
	add	x1, x9, x8
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_snd_opl4_write
	.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
	.cfi_endproc
                                        ; -- End function
	.comm	_snd_opl4_pitch_map,8,3         ; @snd_opl4_pitch_map
	.comm	_OPL4_REG_OCTAVE,8,3            ; @OPL4_REG_OCTAVE
	.comm	_OPL4_F_NUMBER_HIGH_MASK,4,2    ; @OPL4_F_NUMBER_HIGH_MASK
	.comm	_OPL4_TONE_NUMBER_BIT8,4,2      ; @OPL4_TONE_NUMBER_BIT8
	.comm	_OPL4_F_NUMBER_LOW_MASK,4,2     ; @OPL4_F_NUMBER_LOW_MASK
	.comm	_OPL4_REG_F_NUMBER,8,3          ; @OPL4_REG_F_NUMBER
	.no_dead_strip	_snd_opl4_update_pitch
.subsections_via_symbols
