	.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
                                        ## kill: def $r9d killed $r9d def $r9
	movq	%r8, %r15
	movl	%ecx, %r14d
	movq	%rdx, %r13
	movl	%esi, %ebx
	movq	%rdi, %r12
	testq	%r8, %r8
	sete	%al
	testl	%r9d, %r9d
	sete	%cl
	movq	_friio_fe_config@GOTPCREL(%rip), %rdx
	cmpl	%esi, (%rdx)
	jne	LBB0_2
## %bb.1:
	movl	(%r13), %edx
	movq	_JDVBT90502_2ND_I2C_REG@GOTPCREL(%rip), %rsi
	cmpl	(%rsi), %edx
	jne	LBB0_2
## %bb.15:
	movq	%r12, %rdi
	movl	%ebx, %esi
	movq	%r13, %rdx
	movl	%r14d, %ecx
	movq	%r15, %r8
                                        ## kill: def $r9d killed $r9d killed $r9
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_gl861_i2c_ctrlmsg_data         ## TAILCALL
LBB0_2:
	movq	%r9, -64(%rbp)                  ## 8-byte Spill
	orb	%cl, %al
	je	LBB0_4
## %bb.3:
	movq	_GL861_REQ_I2C_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	_GL861_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	(%r12), %edi
	xorl	%esi, %esi
	callq	_usb_sndctrlpipe
	jmp	LBB0_5
LBB0_4:
	movq	_GL861_REQ_I2C_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	_GL861_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	(%r12), %edi
	xorl	%esi, %esi
	callq	_usb_rcvctrlpipe
LBB0_5:
	shll	$9, %ebx
	cmpl	$3, %r14d
	je	LBB0_9
## %bb.6:
	cmpl	$2, %r14d
	je	LBB0_12
## %bb.7:
	cmpl	$1, %r14d
	jne	LBB0_10
## %bb.8:
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	movl	%eax, %r15d
	movl	(%r13), %r14d
	jmp	LBB0_14
LBB0_9:
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	movl	%eax, %r15d
	movl	8(%r13), %r14d
	shll	$8, %r14d
	orl	(%r13), %r14d
	jmp	LBB0_13
LBB0_12:
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	movl	%eax, %r15d
	movl	(%r13), %r14d
LBB0_13:
	addl	4(%r13), %ebx
LBB0_14:
	movl	$1, %edi
	callq	_msleep
	movl	(%r12), %edi
	subq	$8, %rsp
	movl	%r15d, %esi
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movl	%ebx, %r8d
	movl	%r14d, %r9d
	pushq	$2000                           ## imm = 0x7D0
	pushq	-64(%rbp)                       ## 8-byte Folded Reload
	pushq	-56(%rbp)                       ## 8-byte Folded Reload
	callq	_usb_control_msg
	addq	$56, %rsp
	jmp	LBB0_11
LBB0_10:
	leaq	L_.str(%rip), %rdi
	movl	%r14d, %esi
	callq	_deb_xfer
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	addq	$24, %rsp
LBB0_11:
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_friio_fe_config,4,2            ## @friio_fe_config
	.comm	_JDVBT90502_2ND_I2C_REG,4,2     ## @JDVBT90502_2ND_I2C_REG
	.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, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x5
	mov	x20, x4
	mov	x25, x3
	mov	x23, x2
	mov	x27, x1
	mov	x21, x0
	cmp	x4, #0
	ccmp	w5, #0, #4, ne
	cset	w8, eq
Lloh0:
	adrp	x9, _friio_fe_config@GOTPAGE
Lloh1:
	ldr	x9, [x9, _friio_fe_config@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cmp	w9, w1
	b.ne	LBB0_3
; %bb.1:
	ldr	w9, [x23]
Lloh3:
	adrp	x10, _JDVBT90502_2ND_I2C_REG@GOTPAGE
Lloh4:
	ldr	x10, [x10, _JDVBT90502_2ND_I2C_REG@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	cmp	w9, w10
	b.ne	LBB0_3
; %bb.2:
	mov	x0, x21
	mov	x1, x27
	mov	x2, x23
	mov	x3, x25
	mov	x4, x20
	mov	x5, x19
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_gl861_i2c_ctrlmsg_data
LBB0_3:
	cbz	w8, LBB0_5
; %bb.4:
Lloh6:
	adrp	x8, _GL861_REQ_I2C_WRITE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _GL861_REQ_I2C_WRITE@GOTPAGEOFF]
Lloh8:
	ldr	w22, [x8]
Lloh9:
	adrp	x8, _GL861_WRITE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _GL861_WRITE@GOTPAGEOFF]
Lloh11:
	ldr	w24, [x8]
	ldr	w0, [x21]
	mov	w1, #0
	bl	_usb_sndctrlpipe
	b	LBB0_6
LBB0_5:
Lloh12:
	adrp	x8, _GL861_REQ_I2C_READ@GOTPAGE
Lloh13:
	ldr	x8, [x8, _GL861_REQ_I2C_READ@GOTPAGEOFF]
Lloh14:
	ldr	w22, [x8]
Lloh15:
	adrp	x8, _GL861_READ@GOTPAGE
Lloh16:
	ldr	x8, [x8, _GL861_READ@GOTPAGEOFF]
Lloh17:
	ldr	w24, [x8]
	ldr	w0, [x21]
	mov	w1, #0
	bl	_usb_rcvctrlpipe
LBB0_6:
	mov	x26, x0
	lsl	w27, w27, #9
	cmp	w25, #3
	b.eq	LBB0_10
; %bb.7:
	cmp	w25, #2
	b.eq	LBB0_11
; %bb.8:
	cmp	w25, #1
	b.ne	LBB0_13
; %bb.9:
	ldr	w25, [x23]
	b	LBB0_12
LBB0_10:
	ldp	w10, w8, [x23, #4]
	ldr	w9, [x23]
	orr	w25, w9, w8, lsl #8
	add	w27, w10, w27
	b	LBB0_12
LBB0_11:
	ldp	w25, w8, [x23]
	add	w27, w8, w27
LBB0_12:
	mov	w0, #1
	bl	_msleep
	ldr	w0, [x21]
	mov	w8, #2000
	str	w8, [sp]
	mov	x1, x26
	mov	x2, x22
	mov	x3, x24
	mov	x4, x27
	mov	x5, x25
	mov	x6, x20
	mov	x7, x19
	bl	_usb_control_msg
	b	LBB0_14
LBB0_13:
Lloh18:
	adrp	x0, l_.str@PAGE
Lloh19:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x25
	bl	_deb_xfer
Lloh20:
	adrp	x8, _EINVAL@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_14:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_friio_fe_config,4,2            ; @friio_fe_config
	.comm	_JDVBT90502_2ND_I2C_REG,4,2     ; @JDVBT90502_2ND_I2C_REG
	.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
