	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gl861_i2c_msg
_gl861_i2c_msg:                         ## @gl861_i2c_msg
	.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
	movl	%r9d, %r14d
	movq	%r8, %r15
	movl	%esi, %r13d
	shll	$9, %r13d
	testq	%r8, %r8
	sete	%al
	testl	%r9d, %r9d
	sete	%bl
	orb	%al, %bl
	movq	_GL861_READ@GOTPCREL(%rip), %rax
	cmovneq	_GL861_WRITE@GOTPCREL(%rip), %rax
	movq	_GL861_REQ_I2C_READ@GOTPCREL(%rip), %rsi
	cmovneq	_GL861_REQ_I2C_WRITE@GOTPCREL(%rip), %rsi
	movq	%rdi, %r12
	movl	(%rax), %eax
	movl	(%rsi), %esi
	cmpl	$1, %ecx
	je	LBB0_1
## %bb.2:
	cmpl	$2, %ecx
	jne	LBB0_5
## %bb.3:
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	addl	4(%rdx), %r13d
	jmp	LBB0_4
LBB0_1:
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
LBB0_4:
	movl	(%rdx), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movl	$1, %edi
	callq	_msleep
	movl	(%r12), %ebx
	movl	%ebx, %edi
	xorl	%esi, %esi
	callq	_usb_rcvctrlpipe
	subq	$8, %rsp
	movl	%ebx, %edi
	movl	%eax, %esi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	movl	%r13d, %r8d
	movl	-52(%rbp), %r9d                 ## 4-byte Reload
	pushq	$2000                           ## imm = 0x7D0
	pushq	%r14
	pushq	%r15
	callq	_usb_control_msg
	addq	$56, %rsp
	jmp	LBB0_6
LBB0_5:
	leaq	L_.str(%rip), %rdi
	movl	%ecx, %esi
	callq	_warn
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	addq	$24, %rsp
LBB0_6:
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GL861_REQ_I2C_WRITE,4,2        ## @GL861_REQ_I2C_WRITE
	.comm	_GL861_WRITE,4,2                ## @GL861_WRITE
	.comm	_GL861_REQ_I2C_READ,4,2         ## @GL861_REQ_I2C_READ
	.comm	_GL861_READ,4,2                 ## @GL861_READ
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"wlen = %x, aborting."

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_gl861_i2c_msg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gl861_i2c_msg
_gl861_i2c_msg:                         ; @gl861_i2c_msg
	.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
	mov	x19, x5
	mov	x20, x4
	mov	x24, x0
	lsl	w21, w1, #9
	cmp	x4, #0
Lloh0:
	adrp	x8, _GL861_WRITE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GL861_WRITE@GOTPAGEOFF]
	ccmp	w5, #0, #4, ne
Lloh2:
	adrp	x9, _GL861_READ@GOTPAGE
Lloh3:
	ldr	x9, [x9, _GL861_READ@GOTPAGEOFF]
	csel	x8, x8, x9, eq
Lloh4:
	adrp	x9, _GL861_REQ_I2C_WRITE@GOTPAGE
Lloh5:
	ldr	x9, [x9, _GL861_REQ_I2C_WRITE@GOTPAGEOFF]
	ldr	w22, [x8]
Lloh6:
	adrp	x8, _GL861_REQ_I2C_READ@GOTPAGE
Lloh7:
	ldr	x8, [x8, _GL861_REQ_I2C_READ@GOTPAGEOFF]
	csel	x8, x9, x8, eq
	ldr	w23, [x8]
	cmp	w3, #1
	b.eq	LBB0_3
; %bb.1:
	cmp	w3, #2
	b.ne	LBB0_4
; %bb.2:
	ldr	w8, [x2, #4]
	add	w21, w8, w21
LBB0_3:
	ldr	w25, [x2]
	mov	w0, #1
	bl	_msleep
	ldr	w24, [x24]
	mov	x0, x24
	mov	w1, #0
	bl	_usb_rcvctrlpipe
	mov	x1, x0
	mov	w8, #2000
	str	w8, [sp]
	mov	x0, x24
	mov	x2, x23
	mov	x3, x22
	mov	x4, x21
	mov	x5, x25
	mov	x6, x20
	mov	x7, x19
	bl	_usb_control_msg
	b	LBB0_5
LBB0_4:
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x3
	bl	_warn
Lloh10:
	adrp	x8, _EINVAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	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	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_GL861_REQ_I2C_WRITE,4,2        ; @GL861_REQ_I2C_WRITE
	.comm	_GL861_WRITE,4,2                ; @GL861_WRITE
	.comm	_GL861_REQ_I2C_READ,4,2         ; @GL861_REQ_I2C_READ
	.comm	_GL861_READ,4,2                 ; @GL861_READ
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"wlen = %x, aborting."

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_gl861_i2c_msg
.subsections_via_symbols
