	.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, %r15d
	movl	%ecx, %r14d
	movq	%rdx, %rbx
	movl	%esi, %r13d
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	%r8, -64(%rbp)                  ## 8-byte Spill
	testq	%r8, %r8
	je	LBB0_2
## %bb.1:
	testl	%r15d, %r15d
	je	LBB0_2
## %bb.3:
	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
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r15d, %edi
	callq	_kmalloc
	jmp	LBB0_4
LBB0_2:
	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
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_kmemdup
LBB0_4:
	movq	%rax, %r12
	testq	%rax, %rax
	je	LBB0_5
## %bb.7:
	shll	$9, %r13d
	cmpl	$1, %r14d
	je	LBB0_10
## %bb.8:
	cmpl	$2, %r14d
	jne	LBB0_16
## %bb.9:
	addl	4(%rbx), %r13d
LBB0_10:
	movl	(%rbx), %r14d
	movl	$1000, %edi                     ## imm = 0x3E8
	movl	$2000, %esi                     ## imm = 0x7D0
	callq	_usleep_range
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_usb_rcvctrlpipe
	subq	$8, %rsp
	movq	%rbx, %rdi
	movl	%eax, %esi
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movl	%r13d, %r8d
	movl	%r14d, %r9d
	pushq	$2000                           ## imm = 0x7D0
	pushq	%r15
	pushq	%r12
	callq	_usb_control_msg
	addq	$32, %rsp
	movl	%eax, %ebx
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	testq	%rdi, %rdi
	je	LBB0_14
## %bb.11:
	testl	%r15d, %r15d
	je	LBB0_14
## %bb.12:
	testl	%ebx, %ebx
	jle	LBB0_14
## %bb.13:
	movq	%r12, %rsi
	movl	%r15d, %edx
	callq	_memcpy
LBB0_14:
	movq	%r12, %rdi
	callq	_kfree
	jmp	LBB0_15
LBB0_5:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_16:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rdi
	movq	_KBUILD_MODNAME@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %ecx
	callq	_dev_err
	movq	%r12, %rdi
	callq	_kfree
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_6:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_15:
	movl	%ebx, %eax
	addq	$24, %rsp
	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	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_GL861_REQ_I2C_READ,4,2         ## @GL861_REQ_I2C_READ
	.comm	_GL861_READ,4,2                 ## @GL861_READ
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: wlen=%d, aborting\n"

	.comm	_KBUILD_MODNAME,4,2             ## @KBUILD_MODNAME
	.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	x26, x3
	mov	x25, x2
	mov	x27, x1
	mov	x23, x0
	cbz	x4, LBB0_11
; %bb.1:
	cbz	w19, LBB0_11
; %bb.2:
Lloh0:
	adrp	x8, _GL861_REQ_I2C_READ@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GL861_REQ_I2C_READ@GOTPAGEOFF]
Lloh2:
	ldr	w22, [x8]
Lloh3:
	adrp	x8, _GL861_READ@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GL861_READ@GOTPAGEOFF]
Lloh5:
	ldr	w24, [x8]
Lloh6:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_kmalloc
	mov	x21, x0
	cbz	x0, LBB0_12
LBB0_3:
	lsl	w27, w27, #9
	cmp	w26, #1
	b.eq	LBB0_6
; %bb.4:
	cmp	w26, #2
	b.ne	LBB0_13
; %bb.5:
	ldr	w8, [x25, #4]
	add	w27, w8, w27
LBB0_6:
	ldr	w25, [x25]
	mov	w26, #2000
	mov	w0, #1000
	mov	w1, #2000
	bl	_usleep_range
	ldr	x23, [x23]
	mov	x0, x23
	mov	w1, #0
	bl	_usb_rcvctrlpipe
	mov	x1, x0
	str	w26, [sp]
	mov	x0, x23
	mov	x2, x22
	mov	x3, x24
	mov	x4, x27
	mov	x5, x25
	mov	x6, x21
	mov	x7, x19
	bl	_usb_control_msg
	mov	x22, x0
	cbz	x20, LBB0_10
; %bb.7:
	cbz	w19, LBB0_10
; %bb.8:
	cmp	w22, #1
	b.lt	LBB0_10
; %bb.9:
	mov	x0, x20
	mov	x1, x21
	mov	x2, x19
	bl	_memcpy
LBB0_10:
	mov	x0, x21
	bl	_kfree
	b	LBB0_15
LBB0_11:
Lloh9:
	adrp	x8, _GL861_REQ_I2C_WRITE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _GL861_REQ_I2C_WRITE@GOTPAGEOFF]
Lloh11:
	ldr	w22, [x8]
Lloh12:
	adrp	x8, _GL861_WRITE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _GL861_WRITE@GOTPAGEOFF]
Lloh14:
	ldr	w24, [x8]
Lloh15:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh17:
	ldr	w2, [x8]
	mov	x0, x25
	mov	x1, x26
	bl	_kmemdup
	mov	x21, x0
	cbnz	x0, LBB0_3
LBB0_12:
Lloh18:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_14
LBB0_13:
	ldr	x0, [x23]
Lloh20:
	adrp	x8, _KBUILD_MODNAME@GOTPAGE
Lloh21:
	ldr	x8, [x8, _KBUILD_MODNAME@GOTPAGEOFF]
Lloh22:
	ldr	w2, [x8]
Lloh23:
	adrp	x1, l_.str@PAGE
Lloh24:
	add	x1, x1, l_.str@PAGEOFF
	mov	x3, x26
	bl	_dev_err
	mov	x0, x21
	bl	_kfree
Lloh25:
	adrp	x8, _EINVAL@GOTPAGE
Lloh26:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_14:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_15:
	mov	x0, x22
	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	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_GL861_REQ_I2C_WRITE,4,2        ; @GL861_REQ_I2C_WRITE
	.comm	_GL861_WRITE,4,2                ; @GL861_WRITE
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_GL861_REQ_I2C_READ,4,2         ; @GL861_REQ_I2C_READ
	.comm	_GL861_READ,4,2                 ; @GL861_READ
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: wlen=%d, aborting\n"

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