	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bte_senddata                   ## -- Begin function bte_senddata
	.p2align	4, 0x90
_bte_senddata:                          ## @bte_senddata
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rdi, %rdi
	je	LBB0_7
## %bb.1:
	movq	%rsi, %r15
	testq	%rsi, %rsi
	je	LBB0_7
## %bb.2:
	movl	%edx, %r14d
	testl	%edx, %edx
	je	LBB0_7
## %bb.3:
	movq	%rdi, %rbx
	movq	(%rdi), %rax
	movq	_STATE_DISCONNECTING@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_8
## %bb.4:
	movq	_STATE_DISCONNECTED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_8
## %bb.5:
	movq	_PBUF_RAW@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leal	1(%r14), %esi
	movq	_PBUF_RAM@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_btpbuf_alloc
	testq	%rax, %rax
	je	LBB0_9
## %bb.6:
	movq	%rax, %r12
	movq	_HIDP_TRANS_DATA@GOTPCREL(%rip), %rax
	movq	_HIDP_DATA_RTYPE_OUPUT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	(%r12), %rdi
	movl	%ecx, (%rdi)
	incq	%rdi
	movq	%r15, %rsi
	movl	%r14d, %edx
	callq	_memcpy
	movl	8(%rbx), %edi
	movq	%r12, %rsi
	callq	_l2ca_datawrite
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_btpbuf_free
	movl	%ebx, %eax
	jmp	LBB0_11
LBB0_7:
	movq	_ERR_VAL@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_8:
	movq	_ERR_CLSD@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_9:
	leaq	L_.str(%rip), %rdi
	callq	_ERROR
	movq	_ERR_MEM@GOTPCREL(%rip), %rax
LBB0_10:
	movl	(%rax), %eax
LBB0_11:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ERR_VAL,4,2                    ## @ERR_VAL
	.comm	_STATE_DISCONNECTING,8,3        ## @STATE_DISCONNECTING
	.comm	_STATE_DISCONNECTED,8,3         ## @STATE_DISCONNECTED
	.comm	_ERR_CLSD,4,2                   ## @ERR_CLSD
	.comm	_PBUF_RAW,4,2                   ## @PBUF_RAW
	.comm	_PBUF_RAM,4,2                   ## @PBUF_RAM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"bte_senddata: Could not allocate memory for pbuf\n"

	.comm	_ERR_MEM,4,2                    ## @ERR_MEM
	.comm	_HIDP_TRANS_DATA,4,2            ## @HIDP_TRANS_DATA
	.comm	_HIDP_DATA_RTYPE_OUPUT,4,2      ## @HIDP_DATA_RTYPE_OUPUT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bte_senddata                   ; -- Begin function bte_senddata
	.p2align	2
_bte_senddata:                          ; @bte_senddata
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	cbz	x0, LBB0_5
; %bb.1:
	mov	x21, x1
	cbz	x1, LBB0_5
; %bb.2:
	mov	x20, x2
	cbz	w2, LBB0_5
; %bb.3:
	mov	x19, x0
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _STATE_DISCONNECTING@GOTPAGE
Lloh1:
	ldr	x9, [x9, _STATE_DISCONNECTING@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
Lloh3:
	adrp	x10, _STATE_DISCONNECTED@GOTPAGE
Lloh4:
	ldr	x10, [x10, _STATE_DISCONNECTED@GOTPAGEOFF]
Lloh5:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_8
; %bb.4:
Lloh6:
	adrp	x8, _ERR_CLSD@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ERR_CLSD@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:
Lloh8:
	adrp	x8, _ERR_VAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ERR_VAL@GOTPAGEOFF]
LBB0_6:
	ldr	w0, [x8]
LBB0_7:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_8:
Lloh10:
	adrp	x8, _PBUF_RAW@GOTPAGE
Lloh11:
	ldr	x8, [x8, _PBUF_RAW@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
	add	w1, w20, #1
Lloh13:
	adrp	x8, _PBUF_RAM@GOTPAGE
Lloh14:
	ldr	x8, [x8, _PBUF_RAM@GOTPAGEOFF]
Lloh15:
	ldr	w2, [x8]
	bl	_btpbuf_alloc
	cbz	x0, LBB0_10
; %bb.9:
	mov	x22, x0
Lloh16:
	adrp	x8, _HIDP_TRANS_DATA@GOTPAGE
Lloh17:
	ldr	x8, [x8, _HIDP_TRANS_DATA@GOTPAGEOFF]
Lloh18:
	adrp	x9, _HIDP_DATA_RTYPE_OUPUT@GOTPAGE
Lloh19:
	ldr	x9, [x9, _HIDP_DATA_RTYPE_OUPUT@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
Lloh21:
	ldr	w9, [x9]
	orr	w8, w9, w8
	ldr	x0, [x0]
	str	w8, [x0], #1
	mov	x1, x21
	mov	x2, x20
	bl	_memcpy
	ldr	w0, [x19, #8]
	mov	x1, x22
	bl	_l2ca_datawrite
	mov	x19, x0
	mov	x0, x22
	bl	_btpbuf_free
	mov	x0, x19
	b	LBB0_7
LBB0_10:
Lloh22:
	adrp	x0, l_.str@PAGE
Lloh23:
	add	x0, x0, l_.str@PAGEOFF
	bl	_ERROR
Lloh24:
	adrp	x8, _ERR_MEM@GOTPAGE
Lloh25:
	ldr	x8, [x8, _ERR_MEM@GOTPAGEOFF]
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh20
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_ERR_VAL,4,2                    ; @ERR_VAL
	.comm	_STATE_DISCONNECTING,8,3        ; @STATE_DISCONNECTING
	.comm	_STATE_DISCONNECTED,8,3         ; @STATE_DISCONNECTED
	.comm	_ERR_CLSD,4,2                   ; @ERR_CLSD
	.comm	_PBUF_RAW,4,2                   ; @PBUF_RAW
	.comm	_PBUF_RAM,4,2                   ; @PBUF_RAM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"bte_senddata: Could not allocate memory for pbuf\n"

	.comm	_ERR_MEM,4,2                    ; @ERR_MEM
	.comm	_HIDP_TRANS_DATA,4,2            ; @HIDP_TRANS_DATA
	.comm	_HIDP_DATA_RTYPE_OUPUT,4,2      ; @HIDP_DATA_RTYPE_OUPUT
.subsections_via_symbols
