	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_htc_connect_service            ## -- Begin function htc_connect_service
	.p2align	4, 0x90
_htc_connect_service:                   ## @htc_connect_service
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movq	%rsi, %r13
	movq	%rdi, %r14
	movl	12(%rdi), %edi
	callq	_get_next_avail_ep
	testq	%rax, %rax
	je	LBB0_4
## %bb.1:
	movq	%rax, %rbx
	movl	(%r13), %edi
	movl	%edi, 16(%rax)
	movl	12(%r13), %eax
	movl	%eax, 12(%rbx)
	callq	_service_to_ulpipe
	movl	%eax, (%rbx)
	movl	(%r13), %edi
	callq	_service_to_dlpipe
	movl	%eax, 4(%rbx)
	movl	8(%r13), %eax
	movl	%eax, 8(%rbx)
	movq	_GFP_ATOMIC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$36, %edi
	callq	_alloc_skb
	testq	%rax, %rax
	je	LBB0_5
## %bb.2:
	movq	%rax, %r12
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	movq	%rax, %rdi
	movl	$4, %esi
	callq	_skb_reserve
	movq	%r12, %rdi
	movl	$32, %esi
	callq	_skb_put
	movq	%rax, %r15
	movl	(%r13), %edi
	callq	_cpu_to_be16
	movq	%rax, 24(%r15)
	movq	_HTC_MSG_CONNECT_SERVICE_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_cpu_to_be16
	movq	%rax, 16(%r15)
	movl	4(%r13), %edi
	callq	_cpu_to_be16
	movq	%rax, 8(%r15)
	movl	4(%rbx), %eax
	movl	%eax, 4(%r15)
	movl	(%rbx), %eax
	movl	%eax, (%r15)
	movl	(%r12), %edx
	movq	_ENDPOINT0@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%r14, %rdi
	movq	%r12, %rsi
	xorl	%ecx, %ecx
	callq	_htc_issue_send
	testl	%eax, %eax
	je	LBB0_6
## %bb.3:
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_kfree_skb
	jmp	LBB0_10
LBB0_4:
	movl	4(%r14), %edi
	movl	(%r13), %edx
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_5:
	movl	4(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dev_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_6:
	leaq	8(%r14), %rdi
	movq	_HZ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_wait_for_completion_timeout
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movl	(%r14), %eax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
	xorl	%ebx, %ebx
	jmp	LBB0_10
LBB0_8:
	movl	4(%r14), %edi
	movl	(%r13), %edx
	leaq	L_.str.2(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dev_err
	movq	%r12, %rdi
	callq	_kfree_skb
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
LBB0_9:
	subl	(%rax), %ebx
LBB0_10:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Endpoint is not available for service %d\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_GFP_ATOMIC,4,2                 ## @GFP_ATOMIC
L_.str.1:                               ## @.str.1
	.asciz	"Failed to allocate buf to sendservice connect req\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_HTC_MSG_CONNECT_SERVICE_ID,4,2 ## @HTC_MSG_CONNECT_SERVICE_ID
	.comm	_ENDPOINT0,4,2                  ## @ENDPOINT0
	.comm	_HZ,4,2                         ## @HZ
L_.str.2:                               ## @.str.2
	.asciz	"Service connection timeout for: %d\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_htc_connect_service            ; -- Begin function htc_connect_service
	.p2align	2
_htc_connect_service:                   ; @htc_connect_service
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x21, x2
	mov	x19, x1
	mov	x20, x0
	ldr	w0, [x0, #12]
	bl	_get_next_avail_ep
	cbz	x0, LBB0_4
; %bb.1:
	mov	x23, x0
	ldr	w0, [x19]
	ldr	w8, [x19, #12]
	stp	w8, w0, [x23, #12]
	bl	_service_to_ulpipe
	str	w0, [x23]
	ldr	w0, [x19]
	bl	_service_to_dlpipe
	ldr	w8, [x19, #8]
	stp	w0, w8, [x23, #4]
Lloh0:
	adrp	x8, _GFP_ATOMIC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_ATOMIC@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #36
	bl	_alloc_skb
	cbz	x0, LBB0_5
; %bb.2:
	mov	x22, x0
	mov	w1, #4
	bl	_skb_reserve
	mov	x0, x22
	mov	w1, #32
	bl	_skb_put
	mov	x24, x0
	ldr	w0, [x19]
	bl	_cpu_to_be16
	str	x0, [x24, #24]
Lloh3:
	adrp	x8, _HTC_MSG_CONNECT_SERVICE_ID@GOTPAGE
Lloh4:
	ldr	x8, [x8, _HTC_MSG_CONNECT_SERVICE_ID@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	bl	_cpu_to_be16
	str	x0, [x24, #16]
	ldr	w0, [x19, #4]
	bl	_cpu_to_be16
	str	x0, [x24, #8]
	ldr	d0, [x23]
	str	d0, [x24]
	ldr	w2, [x22]
Lloh6:
	adrp	x8, _ENDPOINT0@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENDPOINT0@GOTPAGEOFF]
Lloh8:
	ldr	w4, [x8]
	mov	x0, x20
	mov	x1, x22
	mov	w3, #0
	bl	_htc_issue_send
	cbz	w0, LBB0_6
; %bb.3:
	mov	x23, x0
	mov	x0, x22
	bl	_kfree_skb
	b	LBB0_10
LBB0_4:
	ldr	w0, [x20, #4]
	ldr	w8, [x19]
	str	x8, [sp]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh11:
	adrp	x8, _EINVAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_9
LBB0_5:
	ldr	w0, [x20, #4]
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
Lloh15:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_9
LBB0_6:
	add	x0, x20, #8
Lloh17:
	adrp	x8, _HZ@GOTPAGE
Lloh18:
	ldr	x8, [x8, _HZ@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	bl	_wait_for_completion_timeout
	cbz	x0, LBB0_8
; %bb.7:
	mov	w23, #0
	ldr	w8, [x20]
	str	w8, [x21]
	b	LBB0_10
LBB0_8:
	ldr	w0, [x20, #4]
	ldr	w8, [x19]
	str	x8, [sp]
Lloh20:
	adrp	x1, l_.str.2@PAGE
Lloh21:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_err
	mov	x0, x22
	bl	_kfree_skb
Lloh22:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh23:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_10:
	mov	x0, x23
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpAdd	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Endpoint is not available for service %d\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_GFP_ATOMIC,4,2                 ; @GFP_ATOMIC
l_.str.1:                               ; @.str.1
	.asciz	"Failed to allocate buf to sendservice connect req\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_HTC_MSG_CONNECT_SERVICE_ID,4,2 ; @HTC_MSG_CONNECT_SERVICE_ID
	.comm	_ENDPOINT0,4,2                  ; @ENDPOINT0
	.comm	_HZ,4,2                         ; @HZ
l_.str.2:                               ; @.str.2
	.asciz	"Service connection timeout for: %d\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
.subsections_via_symbols
