	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function technisat_usb2_i2c_access
_technisat_usb2_i2c_access:             ## @technisat_usb2_i2c_access
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, -44(%rbp)                 ## 4-byte Spill
	movq	%r8, %r12
	movl	%ecx, %ebx
	movq	%rdx, %r14
	movl	%esi, %r13d
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$64, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r15
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	leaq	L_.str(%rip), %rdi
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	movl	%r13d, %esi
	xorl	%eax, %eax
	callq	_deb_i2c
	movq	_deb_i2c@GOTPCREL(%rip), %rdx
	movq	%r14, %r12
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_debug_dump
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_deb_i2c
	cmpl	$63, %ebx
	jl	LBB0_4
## %bb.3:
	leaq	L_.str.2(%rip), %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	xorl	%eax, %eax
	callq	_err
	movl	$62, %ebx
LBB0_4:
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	cmpl	$63, %r14d
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	movq	%r12, %rsi
	jl	LBB0_6
## %bb.5:
	leaq	L_.str.3(%rip), %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	xorl	%eax, %eax
	callq	_err
	movq	%r12, %rsi
	movl	$62, %r14d
LBB0_6:
	movq	_I2C_SPEED_100KHZ_BIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r15)
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	addl	%ecx, %ecx
	movl	%ecx, 4(%r15)
	cmpq	$0, -64(%rbp)                   ## 8-byte Folded Reload
	je	LBB0_8
## %bb.7:
	orl	%r14d, %eax
	movl	%eax, (%r15)
	orl	$1, %ecx
	movl	%ecx, 4(%r15)
LBB0_8:
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	movq	%r15, %r12
	addq	$8, %r12
	movq	%r12, %rdi
	movl	%ebx, %edx
	callq	_memcpy
	movq	%r13, %rdi
	movl	$1, %esi
	callq	_usb_sndbulkpipe
	addl	$2, %ebx
	movq	%r13, %rdi
	movl	%eax, %esi
	movq	%r15, %rdx
	movl	%ebx, %ecx
	xorl	%r8d, %r8d
	movl	$1000, %r9d                     ## imm = 0x3E8
	callq	_usb_bulk_msg
	testl	%eax, %eax
	js	LBB0_9
## %bb.10:
	movq	%r13, %rdi
	movl	$1, %esi
	callq	_usb_rcvbulkpipe
	leaq	-76(%rbp), %r8
	movq	%r13, %rdi
	movl	%eax, %esi
	movq	%r15, %rdx
	movl	$64, %ecx
	movl	$1000, %r9d                     ## imm = 0x3E8
	callq	_usb_bulk_msg
	movl	%eax, %r14d
	testl	%eax, %eax
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	js	LBB0_11
## %bb.13:
	movl	(%r15), %edx
	movq	_I2C_STATUS_OK@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edx
	je	LBB0_16
## %bb.14:
	leaq	L_.str.6(%rip), %rdi
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_err
	cmpl	$96, %ebx
	jne	LBB0_19
## %bb.15:
	movl	(%r15), %edx
	movq	_I2C_STATUS_NAK@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edx
	jne	LBB0_19
LBB0_16:
	leaq	L_.str.7(%rip), %rdi
	movl	%edx, %esi
	xorl	%eax, %eax
	callq	_deb_i2c
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	testq	%rbx, %rbx
	je	LBB0_18
## %bb.17:
	movq	%rbx, %rdi
	movq	%r12, %rsi
	movl	-44(%rbp), %r12d                ## 4-byte Reload
	movl	%r12d, %edx
	callq	_memcpy
	leaq	L_.str.8(%rip), %rdi
	movl	%r12d, %esi
	xorl	%eax, %eax
	callq	_deb_i2c
	movq	_deb_i2c@GOTPCREL(%rip), %rdx
	movq	%rbx, %rdi
	movl	%r12d, %esi
	callq	_debug_dump
LBB0_18:
	leaq	L_.str.9(%rip), %rdi
	xorl	%eax, %eax
	callq	_deb_i2c
	jmp	LBB0_19
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_20
LBB0_9:
	movl	%eax, %r14d
	leaq	L_.str.4(%rip), %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	jmp	LBB0_12
LBB0_11:
	leaq	L_.str.5(%rip), %rdi
	movl	%ebx, %esi
LBB0_12:
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_err
LBB0_19:
	movq	%r15, %rdi
	callq	_kfree
LBB0_20:
	movl	%r14d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"i2c-access: %02x, tx: "

L_.str.1:                               ## @.str.1
	.asciz	" "

L_.str.2:                               ## @.str.2
	.asciz	"i2c TX buffer can't exceed 62 bytes (dev 0x%02x)"

L_.str.3:                               ## @.str.3
	.asciz	"i2c RX buffer can't exceed 62 bytes (dev 0x%02x)"

	.comm	_I2C_SPEED_100KHZ_BIT,4,2       ## @I2C_SPEED_100KHZ_BIT
L_.str.4:                               ## @.str.4
	.asciz	"i2c-error: out failed %02x = %d"

L_.str.5:                               ## @.str.5
	.asciz	"i2c-error: in failed %02x = %d"

	.comm	_I2C_STATUS_OK,4,2              ## @I2C_STATUS_OK
L_.str.6:                               ## @.str.6
	.asciz	"i2c-error: %02x = %d"

	.comm	_I2C_STATUS_NAK,4,2             ## @I2C_STATUS_NAK
L_.str.7:                               ## @.str.7
	.asciz	"status: %d, "

L_.str.8:                               ## @.str.8
	.asciz	"rx (%d): "

L_.str.9:                               ## @.str.9
	.asciz	"\n"

	.no_dead_strip	_technisat_usb2_i2c_access
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function technisat_usb2_i2c_access
_technisat_usb2_i2c_access:             ; @technisat_usb2_i2c_access
	.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	x21, x5
	mov	x20, x4
	mov	x24, x3
	mov	x26, x2
	mov	x22, x1
	mov	x23, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #64
	bl	_kmalloc
	cbz	x0, LBB0_15
; %bb.1:
	mov	x19, x0
	str	x22, [sp]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_deb_i2c
Lloh5:
	adrp	x2, _deb_i2c@GOTPAGE
Lloh6:
	ldr	x2, [x2, _deb_i2c@GOTPAGEOFF]
	mov	x0, x26
	mov	x1, x24
	bl	_debug_dump
Lloh7:
	adrp	x0, l_.str.1@PAGE
Lloh8:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_deb_i2c
	cmp	w24, #63
	b.lt	LBB0_3
; %bb.2:
Lloh9:
	adrp	x0, l_.str.2@PAGE
Lloh10:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x22
	bl	_err
	mov	w24, #62
LBB0_3:
	cmp	w21, #63
	b.lt	LBB0_5
; %bb.4:
Lloh11:
	adrp	x0, l_.str.3@PAGE
Lloh12:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x1, x22
	bl	_err
	mov	w21, #62
LBB0_5:
Lloh13:
	adrp	x8, _I2C_SPEED_100KHZ_BIT@GOTPAGE
Lloh14:
	ldr	x8, [x8, _I2C_SPEED_100KHZ_BIT@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	lsl	w9, w22, #1
	stp	w8, w9, [x19]
	cbz	x20, LBB0_7
; %bb.6:
	orr	w8, w8, w21
	orr	w9, w9, #0x1
	stp	w8, w9, [x19]
LBB0_7:
	add	x25, x19, #8
	mov	x0, x25
	mov	x1, x26
	mov	x2, x24
	bl	_memcpy
	mov	x0, x23
	mov	w1, #1
	bl	_usb_sndbulkpipe
	mov	x1, x0
	add	w3, w24, #2
	mov	x0, x23
	mov	x2, x19
	mov	x4, #0
	mov	w5, #1000
	bl	_usb_bulk_msg
	tbnz	w0, #31, LBB0_16
; %bb.8:
	mov	x0, x23
	mov	w1, #1
	bl	_usb_rcvbulkpipe
	mov	x1, x0
	add	x4, sp, #12
	mov	x0, x23
	mov	x2, x19
	mov	w3, #64
	mov	w5, #1000
	bl	_usb_bulk_msg
	mov	x24, x0
	tbnz	w0, #31, LBB0_17
; %bb.9:
	ldr	w8, [x19]
Lloh16:
	adrp	x9, _I2C_STATUS_OK@GOTPAGE
Lloh17:
	ldr	x9, [x9, _I2C_STATUS_OK@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	cmp	w8, w9
	b.eq	LBB0_12
; %bb.10:
                                        ; kill: def $w8 killed $w8 killed $x8 def $x8
	str	x8, [sp]
Lloh19:
	adrp	x0, l_.str.6@PAGE
Lloh20:
	add	x0, x0, l_.str.6@PAGEOFF
	mov	x1, x22
	bl	_err
	cmp	w22, #96
	b.ne	LBB0_19
; %bb.11:
	ldr	w8, [x19]
Lloh21:
	adrp	x9, _I2C_STATUS_NAK@GOTPAGE
Lloh22:
	ldr	x9, [x9, _I2C_STATUS_NAK@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_19
LBB0_12:
	str	x8, [sp]
Lloh24:
	adrp	x0, l_.str.7@PAGE
Lloh25:
	add	x0, x0, l_.str.7@PAGEOFF
	bl	_deb_i2c
	cbz	x20, LBB0_14
; %bb.13:
	mov	x0, x20
	mov	x1, x25
	mov	x2, x21
	bl	_memcpy
	str	x21, [sp]
Lloh26:
	adrp	x0, l_.str.8@PAGE
Lloh27:
	add	x0, x0, l_.str.8@PAGEOFF
	bl	_deb_i2c
Lloh28:
	adrp	x2, _deb_i2c@GOTPAGE
Lloh29:
	ldr	x2, [x2, _deb_i2c@GOTPAGEOFF]
	mov	x0, x20
	mov	x1, x21
	bl	_debug_dump
LBB0_14:
Lloh30:
	adrp	x0, l_.str.9@PAGE
Lloh31:
	add	x0, x0, l_.str.9@PAGEOFF
	bl	_deb_i2c
	b	LBB0_19
LBB0_15:
Lloh32:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh33:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh34:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_20
LBB0_16:
	mov	x24, x0
	str	x24, [sp]
Lloh35:
	adrp	x0, l_.str.4@PAGE
Lloh36:
	add	x0, x0, l_.str.4@PAGEOFF
	b	LBB0_18
LBB0_17:
	mov	x8, x24
	str	x8, [sp]
Lloh37:
	adrp	x0, l_.str.5@PAGE
Lloh38:
	add	x0, x0, l_.str.5@PAGEOFF
LBB0_18:
	mov	x1, x22
	bl	_err
LBB0_19:
	mov	x0, x19
	bl	_kfree
LBB0_20:
	mov	x0, x24
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpAdd	Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"i2c-access: %02x, tx: "

l_.str.1:                               ; @.str.1
	.asciz	" "

l_.str.2:                               ; @.str.2
	.asciz	"i2c TX buffer can't exceed 62 bytes (dev 0x%02x)"

l_.str.3:                               ; @.str.3
	.asciz	"i2c RX buffer can't exceed 62 bytes (dev 0x%02x)"

	.comm	_I2C_SPEED_100KHZ_BIT,4,2       ; @I2C_SPEED_100KHZ_BIT
l_.str.4:                               ; @.str.4
	.asciz	"i2c-error: out failed %02x = %d"

l_.str.5:                               ; @.str.5
	.asciz	"i2c-error: in failed %02x = %d"

	.comm	_I2C_STATUS_OK,4,2              ; @I2C_STATUS_OK
l_.str.6:                               ; @.str.6
	.asciz	"i2c-error: %02x = %d"

	.comm	_I2C_STATUS_NAK,4,2             ; @I2C_STATUS_NAK
l_.str.7:                               ; @.str.7
	.asciz	"status: %d, "

l_.str.8:                               ; @.str.8
	.asciz	"rx (%d): "

l_.str.9:                               ; @.str.9
	.asciz	"\n"

	.no_dead_strip	_technisat_usb2_i2c_access
.subsections_via_symbols
