	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_SN76496Write                   ## -- Begin function SN76496Write
	.p2align	4, 0x90
_SN76496Write:                          ## @SN76496Write
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
                                        ## kill: def $edi killed $edi def $rdi
	testb	$-128, %dil
	jne	LBB0_1
## %bb.16:
	movq	_ono_sn@GOTPCREL(%rip), %r9
	movl	(%r9), %ecx
	cmpq	$7, %rcx
	ja	LBB0_33
## %bb.17:
	movl	%ecx, %edx
	shrl	$31, %edx
	addl	%ecx, %edx
	sarl	%edx
	movl	$170, %esi
	btl	%ecx, %esi
	jae	LBB0_18
## %bb.24:
	andl	$15, %edi
	movq	48(%r9), %rax
	movq	56(%r9), %rsi
	movl	(%rax,%rdi,4), %eax
	movl	%edx, %edx
	movl	%eax, (%rsi,%rdx,4)
	movq	8(%r9), %rax
	movl	$1008, %edx                     ## imm = 0x3F0
	andl	(%rax,%rcx,4), %edx
	orl	%edi, %edx
	movl	%edx, (%rax,%rcx,4)
	popq	%rbp
	retq
LBB0_1:
	movl	%edi, %ecx
	shrl	$4, %ecx
	andl	$7, %ecx
	movl	%ecx, %esi
	movq	_ono_sn@GOTPCREL(%rip), %r8
	movl	%ecx, (%r8)
	movq	8(%r8), %r9
	movl	$1008, %eax                     ## imm = 0x3F0
	andl	(%r9,%rcx,4), %eax
	shrl	%esi
	andl	$15, %edi
	orl	%edi, %eax
	movl	%eax, (%r9,%rcx,4)
	movl	$170, %edx
	btl	%ecx, %edx
	jae	LBB0_2
## %bb.8:
	movl	%edi, %eax
	movq	48(%r8), %rcx
	movq	56(%r8), %rdx
	movl	(%rcx,%rax,4), %eax
	movl	%esi, %ecx
	movl	%eax, (%rdx,%rcx,4)
	popq	%rbp
	retq
LBB0_2:
	movl	$21, %edx
	btl	%ecx, %edx
	jae	LBB0_9
## %bb.3:
	imull	24(%r8), %eax
	movq	16(%r8), %rdi
	movl	%esi, %esi
	movl	%eax, (%rdi,%rsi,4)
	testl	%eax, %eax
	je	LBB0_4
## %bb.5:
	cmpl	$4, %ecx
	je	LBB0_6
LBB0_33:
	popq	%rbp
	retq
LBB0_18:
	movl	$21, %esi
	btl	%ecx, %esi
	jae	LBB0_25
## %bb.19:
	movq	8(%r9), %rsi
	movl	(%rsi,%rcx,4), %eax
	andl	$15, %eax
	andl	$63, %edi
	shll	$4, %edi
	orl	%eax, %edi
	movl	%edi, (%rsi,%rcx,4)
	imull	24(%r9), %edi
	movq	16(%r9), %r8
	movl	%edx, %edx
	movl	%edi, (%r8,%rdx,4)
	testl	%edi, %edi
	jne	LBB0_21
## %bb.20:
	movl	24(%r9), %eax
	movl	%eax, (%r8,%rdx,4)
LBB0_21:
	cmpl	$4, %ecx
	jne	LBB0_33
## %bb.22:
	movl	24(%rsi), %eax
	notl	%eax
	testb	$3, %al
	jne	LBB0_33
## %bb.23:
	movl	8(%r8), %eax
	addl	%eax, %eax
	movl	%eax, 12(%r8)
	popq	%rbp
	retq
LBB0_4:
	movl	24(%r8), %eax
	movl	%eax, (%rdi,%rsi,4)
	cmpl	$4, %ecx
	jne	LBB0_33
LBB0_6:
	movl	24(%r9), %eax
	notl	%eax
	testb	$3, %al
	jne	LBB0_33
## %bb.7:
	movl	8(%rdi), %eax
	addl	%eax, %eax
	movl	%eax, 12(%rdi)
	popq	%rbp
	retq
LBB0_9:
	movl	24(%r9), %ecx
	testb	$4, %cl
	jne	LBB0_10
## %bb.11:
	movq	_FB_PNOISE@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_25:
	movq	8(%r9), %rax
	movl	$1008, %ecx                     ## imm = 0x3F0
	andl	24(%rax), %ecx
	movl	%edi, %edx
	andl	$15, %edx
	orl	%ecx, %edx
	movl	%edx, 24(%rax)
	testb	$4, %dil
	jne	LBB0_26
## %bb.27:
	movq	_FB_PNOISE@GOTPCREL(%rip), %rcx
	jmp	LBB0_28
LBB0_10:
	movq	_FB_WNOISE@GOTPCREL(%rip), %rax
LBB0_12:
	movq	(%rax), %rax
	movq	%rax, 40(%r8)
	andl	$3, %ecx
	cmpl	$3, %ecx
	jne	LBB0_14
## %bb.13:
	movq	16(%r8), %rcx
	movl	8(%rcx), %eax
	addl	%eax, %eax
	jmp	LBB0_15
LBB0_26:
	movq	_FB_WNOISE@GOTPCREL(%rip), %rcx
LBB0_28:
	movq	(%rcx), %rax
	movq	%rax, 40(%r9)
	andl	$3, %edi
	cmpl	$3, %edi
	jne	LBB0_30
## %bb.29:
	movq	16(%r9), %rcx
	movl	8(%rcx), %edx
	addl	%edx, %edx
	jmp	LBB0_31
LBB0_14:
	movl	24(%r8), %eax
	addb	$5, %cl
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %eax
	movq	16(%r8), %rcx
LBB0_15:
	movl	%eax, 12(%rcx)
	movq	_NG_PRESET@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 28(%r8)
	andl	$1, %eax
	movq	32(%r8), %rcx
	jmp	LBB0_32
LBB0_30:
	movl	24(%r9), %edx
	addb	$5, %dil
	movl	%edi, %ecx
	shll	%cl, %edx
	movq	16(%r9), %rcx
LBB0_31:
	movl	%edx, 12(%rcx)
	movq	_NG_PRESET@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 28(%r9)
	andl	$1, %eax
	movq	32(%r9), %rcx
LBB0_32:
	movl	%eax, 12(%rcx)
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ono_sn,64,3                    ## @ono_sn
	.comm	_FB_WNOISE,8,3                  ## @FB_WNOISE
	.comm	_FB_PNOISE,8,3                  ## @FB_PNOISE
	.comm	_NG_PRESET,8,3                  ## @NG_PRESET
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_SN76496Write                   ; -- Begin function SN76496Write
	.p2align	2
_SN76496Write:                          ; @SN76496Write
	.cfi_startproc
; %bb.0:
	tbnz	w0, #7, LBB0_4
; %bb.1:
Lloh0:
	adrp	x8, _ono_sn@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ono_sn@GOTPAGEOFF]
	ldr	w9, [x8]
	cmp	w9, #0
	cinc	w10, w9, lt
	cmp	w9, #7
	b.hi	LBB0_9
; %bb.2:
	asr	w10, w10, #1
	mov	w11, #1
	lsl	w11, w11, w9
	mov	w12, #170
	tst	w11, w12
	b.eq	LBB0_10
; %bb.3:
	and	w11, w0, #0xf
	ldp	x12, x13, [x8, #48]
	ldr	w11, [x12, w11, uxtw #2]
	str	w11, [x13, w10, uxtw #2]
	ldr	x8, [x8, #8]
	lsl	x9, x9, #2
	ldr	w10, [x8, x9]
	and	w10, w10, #0x3f0
	bfxil	w10, w0, #0, #4
	str	w10, [x8, x9]
	ret
LBB0_4:
	lsr	w11, w0, #4
Lloh2:
	adrp	x8, _ono_sn@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ono_sn@GOTPAGEOFF]
	ubfx	w10, w0, #4, #3
	str	w10, [x8]
	ldr	x9, [x8, #8]
	lsl	x14, x10, #2
	ldr	w12, [x9, x14]
	ubfx	w11, w11, #1, #2
	and	w12, w12, #0x3f0
	and	w13, w0, #0xf
	bfxil	w12, w0, #0, #4
	str	w12, [x9, x14]
	mov	w14, #1
	lsl	w14, w14, w10
	mov	w15, #170
	tst	w14, w15
	b.eq	LBB0_6
; %bb.5:
	ldp	x9, x8, [x8, #48]
	ldr	w9, [x9, w13, uxtw #2]
	str	w9, [x8, w11, uxtw #2]
	ret
LBB0_6:
	mov	w13, #21
	tst	w14, w13
	b.eq	LBB0_19
; %bb.7:
	ldr	w13, [x8, #24]
	mul	w13, w13, w12
	ldr	x12, [x8, #16]
	str	w13, [x12, w11, uxtw #2]
	cbz	w13, LBB0_16
; %bb.8:
	cmp	w10, #4
	b.eq	LBB0_17
LBB0_9:
	ret
LBB0_10:
	mov	w12, #21
	tst	w11, w12
	b.eq	LBB0_21
; %bb.11:
	lsl	x13, x9, #2
	ldp	x12, x11, [x8, #8]
	ldr	w14, [x12, x13]
	and	w14, w14, #0xf
	bfi	w14, w0, #4, #6
	str	w14, [x12, x13]
	ldr	w13, [x8, #24]
	mul	w13, w13, w14
	str	w13, [x11, w10, uxtw #2]
	cbnz	w13, LBB0_13
; %bb.12:
	ldr	w8, [x8, #24]
	str	w8, [x11, x10, lsl #2]
LBB0_13:
	cmp	w9, #4
	b.ne	LBB0_9
; %bb.14:
	ldr	w8, [x12, #24]
	mvn	w8, w8
	tst	w8, #0x3
	b.ne	LBB0_9
; %bb.15:
	ldr	w8, [x11, #8]
	lsl	w8, w8, #1
	str	w8, [x11, #12]
	ret
LBB0_16:
	ldr	w8, [x8, #24]
	str	w8, [x12, x11, lsl #2]
	cmp	w10, #4
	b.ne	LBB0_9
LBB0_17:
	ldr	w8, [x9, #24]
	mvn	w8, w8
	tst	w8, #0x3
	b.ne	LBB0_9
; %bb.18:
	ldr	w8, [x12, #8]
	lsl	w8, w8, #1
	str	w8, [x12, #12]
	ret
LBB0_19:
	ldr	w9, [x9, #24]
Lloh4:
	adrp	x10, _FB_WNOISE@GOTPAGE
Lloh5:
	ldr	x10, [x10, _FB_WNOISE@GOTPAGEOFF]
Lloh6:
	adrp	x11, _FB_PNOISE@GOTPAGE
Lloh7:
	ldr	x11, [x11, _FB_PNOISE@GOTPAGEOFF]
	tst	w9, #0x4
	csel	x10, x11, x10, eq
	ldr	x10, [x10]
	str	x10, [x8, #40]
	and	w9, w9, #0x3
	cmp	w9, #3
	b.eq	LBB0_22
LBB0_20:
	ldr	w10, [x8, #24]
	add	w9, w9, #5
	lsl	w10, w10, w9
	ldr	x9, [x8, #16]
	b	LBB0_23
LBB0_21:
	ldr	x9, [x8, #8]
	ldr	w10, [x9, #24]
	and	w10, w10, #0x3f0
	bfxil	w10, w0, #0, #4
	str	w10, [x9, #24]
Lloh8:
	adrp	x9, _FB_WNOISE@GOTPAGE
Lloh9:
	ldr	x9, [x9, _FB_WNOISE@GOTPAGEOFF]
Lloh10:
	adrp	x10, _FB_PNOISE@GOTPAGE
Lloh11:
	ldr	x10, [x10, _FB_PNOISE@GOTPAGEOFF]
	tst	w0, #0x4
	csel	x9, x10, x9, eq
	ldr	x9, [x9]
	str	x9, [x8, #40]
	and	w9, w0, #0x3
	cmp	w9, #3
	b.ne	LBB0_20
LBB0_22:
	ldr	x9, [x8, #16]
	ldr	w10, [x9, #8]
	lsl	w10, w10, #1
LBB0_23:
Lloh12:
	adrp	x11, _NG_PRESET@GOTPAGE
Lloh13:
	ldr	x11, [x11, _NG_PRESET@GOTPAGEOFF]
	str	w10, [x9, #12]
Lloh14:
	ldr	w9, [x11]
	str	w9, [x8, #28]
	and	w9, w9, #0x1
	ldr	x8, [x8, #32]
	str	w9, [x8, #12]
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_ono_sn,64,3                    ; @ono_sn
	.comm	_FB_WNOISE,8,3                  ; @FB_WNOISE
	.comm	_FB_PNOISE,8,3                  ; @FB_PNOISE
	.comm	_NG_PRESET,8,3                  ; @NG_PRESET
.subsections_via_symbols
