	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function flexcop_usb_i2c_req
_flexcop_usb_i2c_req:                   ## @flexcop_usb_i2c_req
	.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 $edx killed $edx def $rdx
	movl	16(%rbp), %eax
	cmpl	$9, %eax
	jb	LBB0_3
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_err
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_3:
	leal	-128(%rdx), %eax
	cmpl	$6, %eax
	jae	LBB0_4
## %bb.5:
	movl	%ecx, %ebx
	movl	%esi, %r13d
	movq	%r9, -56(%rbp)                  ## 8-byte Spill
	movq	8(%rdi), %rcx
	movq	(%rcx), %r15
	movq	_USB_TYPE_VENDOR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r12d
	cltq
	leaq	l_switch.table.flexcop_usb_i2c_req(%rip), %rcx
	leaq	l_switch.table.flexcop_usb_i2c_req.3(%rip), %rsi
	movq	(%rsi,%rax,8), %rsi
	orl	(%rsi), %r12d
	movq	(%rcx,%rax,8), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	%edx, %r14d
	shll	$8, %r14d
	movl	(%rdi), %eax
	shll	$4, %eax
	orl	%eax, %r14d
	shll	$8, %ebx
	orl	%r8d, %ebx
	movzbl	%al, %r11d
	movl	%r14d, %r9d
	sarl	$8, %r9d
	movzbl	%r8b, %r10d
	movl	%ebx, %eax
	sarl	$8, %eax
	leaq	L_.str.2(%rip), %rdi
	movl	%edx, %esi
	movl	%r12d, %edx
	movl	%r13d, %ecx
	movl	%r11d, %r8d
	pushq	%rax
	pushq	%r10
	callq	_deb_i2c
	addq	$16, %rsp
	leaq	8(%r15), %rdi
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	callq	_mutex_lock
	movq	_USB_ENDPOINT_DIR_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%r12d, %eax
	movq	_USB_DIR_OUT@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_7
## %bb.6:
	movq	(%r15), %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movl	16(%rbp), %edx
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_memcpy
LBB0_7:
	movl	12(%r15), %edi
	movq	_HZ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%eax, %eax
	subq	$8, %rsp
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	%r13d, %edx
	movl	%r12d, %ecx
	movl	%r14d, %r8d
	movl	%ebx, %r9d
	pushq	%rax
	movl	16(%rbp), %r14d
	pushq	%r14
	pushq	(%r15)
	callq	_usb_control_msg
	addq	$32, %rsp
	movq	_EIO@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	xorl	%edx, %edx
	subl	(%rcx), %edx
	cmpl	%r14d, %eax
	cmovel	%eax, %edx
	testl	%edx, %edx
	js	LBB0_10
## %bb.8:
	movq	_USB_ENDPOINT_DIR_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %r12d
	movq	_USB_DIR_IN@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	jne	LBB0_10
## %bb.9:
	movq	(%r15), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r14d, %edx
	callq	_memcpy
LBB0_10:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
	jmp	LBB0_11
LBB0_4:
	leaq	L_.str.1(%rip), %rdi
	movl	%edx, %esi
	callq	_deb_info
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_11:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_USB_TYPE_VENDOR,4,2            ## @USB_TYPE_VENDOR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Buffer size bigger than max URB control message\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_B2C2_USB_CTRL_PIPE_OUT,4,2     ## @B2C2_USB_CTRL_PIPE_OUT
	.comm	_USB_DIR_OUT,4,2                ## @USB_DIR_OUT
	.comm	_B2C2_USB_CTRL_PIPE_IN,4,2      ## @B2C2_USB_CTRL_PIPE_IN
	.comm	_USB_DIR_IN,4,2                 ## @USB_DIR_IN
L_.str.1:                               ## @.str.1
	.asciz	"unsupported function for i2c_req %x\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.2:                               ## @.str.2
	.asciz	"i2c %2d: %02x %02x %02x %02x %02x %02x\n"

	.comm	_USB_ENDPOINT_DIR_MASK,4,2      ## @USB_ENDPOINT_DIR_MASK
	.comm	_HZ,4,2                         ## @HZ
	.no_dead_strip	_flexcop_usb_i2c_req
	.section	__DATA,__const
	.p2align	3                               ## @switch.table.flexcop_usb_i2c_req
l_switch.table.flexcop_usb_i2c_req:
	.quad	_B2C2_USB_CTRL_PIPE_OUT
	.quad	_B2C2_USB_CTRL_PIPE_OUT
	.quad	_B2C2_USB_CTRL_PIPE_IN
	.quad	_B2C2_USB_CTRL_PIPE_IN
	.quad	_B2C2_USB_CTRL_PIPE_OUT
	.quad	_B2C2_USB_CTRL_PIPE_OUT

	.p2align	3                               ## @switch.table.flexcop_usb_i2c_req.3
l_switch.table.flexcop_usb_i2c_req.3:
	.quad	_USB_DIR_OUT
	.quad	_USB_DIR_OUT
	.quad	_USB_DIR_IN
	.quad	_USB_DIR_IN
	.quad	_USB_DIR_OUT
	.quad	_USB_DIR_OUT

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function flexcop_usb_i2c_req
_flexcop_usb_i2c_req:                   ; @flexcop_usb_i2c_req
	.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
	cmp	w6, #9
	b.lo	LBB0_2
; %bb.1:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_err
Lloh2:
	adrp	x8, _EIO@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_10
LBB0_2:
	sub	w8, w2, #128
	cmp	w8, #6
	b.hs	LBB0_9
; %bb.3:
	mov	x19, x6
	mov	x20, x5
	mov	x21, x1
	ldr	x9, [x0, #8]
	ldr	x27, [x9]
Lloh4:
	adrp	x9, _USB_TYPE_VENDOR@GOTPAGE
Lloh5:
	ldr	x9, [x9, _USB_TYPE_VENDOR@GOTPAGEOFF]
	sbfiz	x8, x8, #3, #32
Lloh6:
	adrp	x10, l_switch.table.flexcop_usb_i2c_req@PAGE
Lloh7:
	add	x10, x10, l_switch.table.flexcop_usb_i2c_req@PAGEOFF
	ldr	x10, [x10, x8]
Lloh8:
	adrp	x11, l_switch.table.flexcop_usb_i2c_req.3@PAGE
Lloh9:
	add	x11, x11, l_switch.table.flexcop_usb_i2c_req.3@PAGEOFF
	ldr	x8, [x11, x8]
Lloh10:
	ldr	w9, [x9]
	ldr	w8, [x8]
	orr	w22, w8, w9
	ldr	w8, [x0]
	lsl	w8, w8, #4
	orr	w24, w8, w2, lsl #8
	orr	w25, w4, w3, lsl #8
	ldr	w26, [x10]
	and	w8, w8, #0xf0
	asr	w5, w24, #8
	and	w6, w4, #0xff
	asr	w7, w25, #8
Lloh11:
	adrp	x0, l_.str.2@PAGE
Lloh12:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x2
	mov	x2, x22
	mov	x3, x21
	mov	x4, x8
	bl	_deb_i2c
	add	x23, x27, #8
	mov	x0, x23
	bl	_mutex_lock
Lloh13:
	adrp	x28, _USB_ENDPOINT_DIR_MASK@GOTPAGE
Lloh14:
	ldr	x28, [x28, _USB_ENDPOINT_DIR_MASK@GOTPAGEOFF]
	ldr	w8, [x28]
	and	w8, w8, w22
Lloh15:
	adrp	x9, _USB_DIR_OUT@GOTPAGE
Lloh16:
	ldr	x9, [x9, _USB_DIR_OUT@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_5
; %bb.4:
	ldr	x0, [x27]
	mov	x1, x20
	mov	x2, x19
	bl	_memcpy
LBB0_5:
	ldr	w0, [x27, #12]
	ldr	x6, [x27]
Lloh18:
	adrp	x8, _HZ@GOTPAGE
Lloh19:
	ldr	x8, [x8, _HZ@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	lsl	w8, w8, #1
	str	w8, [sp]
	mov	x1, x26
	mov	x2, x21
	mov	x3, x22
	mov	x4, x24
	mov	x5, x25
	mov	x7, x19
	bl	_usb_control_msg
Lloh21:
	adrp	x8, _EIO@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	cmp	w0, w19
	csneg	w8, w0, w8, eq
	tbnz	w8, #31, LBB0_8
; %bb.6:
	ldr	w8, [x28]
	and	w8, w8, w22
Lloh24:
	adrp	x9, _USB_DIR_IN@GOTPAGE
Lloh25:
	ldr	x9, [x9, _USB_DIR_IN@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_8
; %bb.7:
	ldr	x1, [x27]
	mov	x0, x20
	mov	x2, x19
	bl	_memcpy
LBB0_8:
	mov	x0, x23
	bl	_mutex_unlock
	mov	w0, #0
	b	LBB0_11
LBB0_9:
Lloh27:
	adrp	x0, l_.str.1@PAGE
Lloh28:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x2
	bl	_deb_info
Lloh29:
	adrp	x8, _EINVAL@GOTPAGE
Lloh30:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_10:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_11:
	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 AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh10
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpAdd	Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_USB_TYPE_VENDOR,4,2            ; @USB_TYPE_VENDOR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Buffer size bigger than max URB control message\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_B2C2_USB_CTRL_PIPE_OUT,4,2     ; @B2C2_USB_CTRL_PIPE_OUT
	.comm	_USB_DIR_OUT,4,2                ; @USB_DIR_OUT
	.comm	_B2C2_USB_CTRL_PIPE_IN,4,2      ; @B2C2_USB_CTRL_PIPE_IN
	.comm	_USB_DIR_IN,4,2                 ; @USB_DIR_IN
l_.str.1:                               ; @.str.1
	.asciz	"unsupported function for i2c_req %x\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.2:                               ; @.str.2
	.asciz	"i2c %2d: %02x %02x %02x %02x %02x %02x\n"

	.comm	_USB_ENDPOINT_DIR_MASK,4,2      ; @USB_ENDPOINT_DIR_MASK
	.comm	_HZ,4,2                         ; @HZ
	.no_dead_strip	_flexcop_usb_i2c_req
	.section	__DATA,__const
	.p2align	3                               ; @switch.table.flexcop_usb_i2c_req
l_switch.table.flexcop_usb_i2c_req:
	.quad	_B2C2_USB_CTRL_PIPE_OUT
	.quad	_B2C2_USB_CTRL_PIPE_OUT
	.quad	_B2C2_USB_CTRL_PIPE_IN
	.quad	_B2C2_USB_CTRL_PIPE_IN
	.quad	_B2C2_USB_CTRL_PIPE_OUT
	.quad	_B2C2_USB_CTRL_PIPE_OUT

	.p2align	3                               ; @switch.table.flexcop_usb_i2c_req.3
l_switch.table.flexcop_usb_i2c_req.3:
	.quad	_USB_DIR_OUT
	.quad	_USB_DIR_OUT
	.quad	_USB_DIR_IN
	.quad	_USB_DIR_IN
	.quad	_USB_DIR_OUT
	.quad	_USB_DIR_OUT

.subsections_via_symbols
