	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sn9c102_write_regs             ## -- Begin function sn9c102_write_regs
	.p2align	4, 0x90
_sn9c102_write_regs:                    ## @sn9c102_write_regs
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	testl	%edx, %edx
	jle	LBB0_5
## %bb.1:
	movq	%rdi, %r15
	movq	(%rdi), %r13
	movq	16(%rdi), %r12
	movl	%edx, %eax
	shlq	$4, %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx,%r14), %rax
	movq	8(%rcx,%r14), %rbx
	movq	%rax, (%r13)
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_usb_sndctrlpipe
	movq	_SN9C102_CTRL_TIMEOUT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r10d
	subq	$8, %rsp
	movq	%r12, %rdi
	movl	%eax, %esi
	movl	$8, %edx
	movl	$65, %ecx
	movq	%rbx, %r8
	xorl	%r9d, %r9d
	pushq	%r10
	pushq	$1
	pushq	%r13
	callq	_usb_control_msg
	addq	$32, %rsp
	movq	(%r13), %rdx
	testl	%eax, %eax
	js	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	8(%r15), %rax
	movq	%rdx, (%rax,%rbx,8)
	addq	$16, %r14
	cmpq	%r14, -48(%rbp)                 ## 8-byte Folded Reload
	jne	LBB0_2
LBB0_5:
	xorl	%eax, %eax
	jmp	LBB0_6
LBB0_3:
	leaq	L_.str(%rip), %rsi
	movl	$3, %edi
	movq	%rbx, %rcx
	movl	%eax, %r8d
	callq	_DBG
	movl	$-1, %eax
LBB0_6:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SN9C102_CTRL_TIMEOUT,4,2       ## @SN9C102_CTRL_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to write a register (value 0x%02X, index 0x%02X, error %d)"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sn9c102_write_regs             ; -- Begin function sn9c102_write_regs
	.p2align	2
_sn9c102_write_regs:                    ; @sn9c102_write_regs
	.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
	cmp	w2, #1
	b.lt	LBB0_4
; %bb.1:
	mov	x19, x0
	ldr	x20, [x0, #16]
	ldr	x21, [x0]
	mov	w23, w2
	add	x24, x1, #8
Lloh0:
	adrp	x25, _SN9C102_CTRL_TIMEOUT@GOTPAGE
Lloh1:
	ldr	x25, [x25, _SN9C102_CTRL_TIMEOUT@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldp	x8, x22, [x24, #-8]
	str	x8, [x21]
	mov	x0, x20
	mov	w1, #0
	bl	_usb_sndctrlpipe
	mov	x1, x0
	ldr	w8, [x25]
	str	w8, [sp]
	mov	x0, x20
	mov	w2, #8
	mov	w3, #65
	mov	x4, x22
	mov	w5, #0
	mov	x6, x21
	mov	w7, #1
	bl	_usb_control_msg
	ldr	x2, [x21]
	tbnz	w0, #31, LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x8, [x19, #8]
	str	x2, [x8, x22, lsl #3]
	add	x24, x24, #16
	subs	x23, x23, #1
	b.ne	LBB0_2
LBB0_4:
	mov	w0, #0
	b	LBB0_6
LBB0_5:
	mov	x4, x0
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #3
	mov	x3, x22
	bl	_DBG
	mov	w0, #-1
LBB0_6:
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_SN9C102_CTRL_TIMEOUT,4,2       ; @SN9C102_CTRL_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to write a register (value 0x%02X, index 0x%02X, error %d)"

.subsections_via_symbols
