	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_client_connect                 ## -- Begin function client_connect
	.p2align	4, 0x90
_client_connect:                        ## @client_connect
	.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
	movq	%rsi, %r12
	movq	%rdi, %r14
	xorl	%edi, %edi
	testq	%r14, %r14
	setne	%dil
	callq	_assert
	movq	%r12, %rdi
	shrq	$63, %rdi
	xorl	$1, %edi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_assert
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_session_by_fd
	movq	%rax, %r15
	xorl	%edi, %edi
	testq	%rax, %rax
	setne	%dil
	callq	_assert
	movq	%r15, %rbx
	addq	$20, %rbx
	movq	%rbx, %rdi
	callq	_get_hid_device
	movq	%rax, %r13
	xorl	%edi, %edi
	testq	%rax, %rax
	setne	%dil
	callq	_assert
	movq	$0, -48(%rbp)
	movl	$8, -52(%rbp)
	movq	_SOL_SOCKET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SO_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-48(%rbp), %rcx
	leaq	-52(%rbp), %r8
	movq	%r12, %rdi
	callq	_getsockopt
	testq	%rax, %rax
	js	LBB0_1
## %bb.3:
	cmpq	$0, -48(%rbp)
	je	LBB0_5
## %bb.4:
	movq	_LOG_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	xorl	%r14d, %r14d
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_bt_ntoa
	movl	%eax, %ebx
	movq	-48(%rbp), %rdi
	callq	_strerror
	movq	-48(%rbp), %r8
	leaq	L_.str.1(%rip), %rsi
	movl	%r12d, %edi
	movl	%ebx, %edx
	movl	%eax, %ecx
	callq	_syslog
	movq	%r15, %rdi
	callq	_session_close
	movq	_connect_in_progress@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	jmp	LBB0_16
LBB0_1:
	movq	_LOG_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_bt_ntoa
	movl	%eax, %ebx
	movq	_errno@GOTPCREL(%rip), %r12
	movq	(%r12), %rdi
	callq	_strerror
	movq	(%r12), %r8
	leaq	L_.str(%rip), %rsi
LBB0_2:
	movl	%r14d, %edi
	movl	%ebx, %edx
	movl	%eax, %ecx
	callq	_syslog
	movq	%r15, %rdi
	callq	_session_close
	movq	_connect_in_progress@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	$-1, %r14
	jmp	LBB0_16
LBB0_5:
	movl	(%r15), %eax
	xorl	%edi, %edi
	cmpl	$128, %eax
	je	LBB0_12
## %bb.6:
	cmpl	$129, %eax
	jne	LBB0_14
## %bb.7:
	cmpq	%r12, 8(%r15)
	sete	%dil
	callq	_assert
	xorl	%edi, %edi
	cmpl	$-1, 16(%r15)
	sete	%dil
	callq	_assert
	movl	4(%r13), %esi
	movq	%rbx, %rdi
	callq	_client_socket
	movl	%eax, 16(%r15)
	testl	%eax, %eax
	js	LBB0_8
## %bb.9:
	movl	$128, (%r15)
	movl	%eax, %edi
	leaq	12(%r14), %rsi
	callq	_FD_SET
	movslq	16(%r15), %rax
	cmpq	%rax, (%r14)
	jge	LBB0_11
## %bb.10:
	movq	%rax, (%r14)
LBB0_11:
	movl	$0, (%r13)
	xorl	%eax, %eax
	callq	_write_hids_file
	jmp	LBB0_15
LBB0_12:
	cmpq	$-1, 8(%r15)
	setne	%dil
	callq	_assert
	movslq	16(%r15), %rax
	xorl	%edi, %edi
	cmpq	%r12, %rax
	sete	%dil
	callq	_assert
	movq	_OPEN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r15)
	movq	_connect_in_progress@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	%r15, %rdi
	callq	_session_run
	testl	%eax, %eax
	jns	LBB0_15
## %bb.13:
	movq	%r15, %rdi
	callq	_session_close
	movq	$-1, %r14
	jmp	LBB0_16
LBB0_14:
	callq	_assert
LBB0_15:
	leaq	12(%r14), %rsi
	movq	%r12, %rdi
	callq	_FD_CLR
	addq	$8, %r14
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_FD_SET
	xorl	%r14d, %r14d
LBB0_16:
	movq	%r14, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	_LOG_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_bt_ntoa
	movl	%eax, %ebx
	movq	_errno@GOTPCREL(%rip), %r12
	movq	(%r12), %rdi
	callq	_strerror
	movq	(%r12), %r8
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_2
	.cfi_endproc
                                        ## -- End function
	.comm	_SOL_SOCKET,4,2                 ## @SOL_SOCKET
	.comm	_SO_ERROR,4,2                   ## @SO_ERROR
	.comm	_LOG_ERR,4,2                    ## @LOG_ERR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Could not get socket error for %s. %s (%d)"

	.comm	_errno,8,3                      ## @errno
	.comm	_connect_in_progress,8,3        ## @connect_in_progress
L_.str.1:                               ## @.str.1
	.asciz	"Could not connect to %s. %s (%d)"

L_.str.2:                               ## @.str.2
	.asciz	"Could not open interrupt channel to %s. %s (%d)"

	.comm	_OPEN,4,2                       ## @OPEN
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_client_connect                 ; -- Begin function client_connect
	.p2align	2
_client_connect:                        ; @client_connect
	.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	x20, x1
	mov	x21, x0
	cmp	x0, #0
	cset	w0, ne
	bl	_assert
	lsr	x8, x20, #63
	eor	w0, w8, #0x1
	bl	_assert
	mov	x0, x21
	mov	x1, x20
	bl	_session_by_fd
	mov	x19, x0
	cmp	x0, #0
	cset	w0, ne
	bl	_assert
	add	x22, x19, #20
	mov	x0, x22
	bl	_get_hid_device
	mov	x23, x0
	cmp	x0, #0
	cset	w0, ne
	bl	_assert
	str	xzr, [sp, #8]
	mov	w8, #8
	str	w8, [sp, #4]
Lloh0:
	adrp	x8, _SOL_SOCKET@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SOL_SOCKET@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _SO_ERROR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SO_ERROR@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	add	x3, sp, #8
	add	x4, sp, #4
	mov	x0, x20
	bl	_getsockopt
	tbnz	x0, #63, LBB0_3
; %bb.1:
	ldr	x8, [sp, #8]
	cbz	x8, LBB0_5
; %bb.2:
Lloh6:
	adrp	x8, _LOG_ERR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _LOG_ERR@GOTPAGEOFF]
Lloh8:
	ldr	w20, [x8]
	mov	x0, x22
	mov	x1, #0
	bl	_bt_ntoa
	mov	x21, x0
	ldr	x0, [sp, #8]
	bl	_strerror
	mov	x3, x0
	ldr	x4, [sp, #8]
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	mov	x2, x21
	bl	_syslog
	mov	x0, x19
	bl	_session_close
	mov	x0, #0
Lloh11:
	adrp	x8, _connect_in_progress@GOTPAGE
Lloh12:
	ldr	x8, [x8, _connect_in_progress@GOTPAGEOFF]
Lloh13:
	str	xzr, [x8]
	b	LBB0_15
LBB0_3:
Lloh14:
	adrp	x8, _LOG_ERR@GOTPAGE
Lloh15:
	ldr	x8, [x8, _LOG_ERR@GOTPAGEOFF]
Lloh16:
	ldr	w20, [x8]
	mov	x0, x22
	mov	x1, #0
	bl	_bt_ntoa
	mov	x21, x0
Lloh17:
	adrp	x22, _errno@GOTPAGE
Lloh18:
	ldr	x22, [x22, _errno@GOTPAGEOFF]
	ldr	x0, [x22]
	bl	_strerror
	mov	x3, x0
	ldr	x4, [x22]
Lloh19:
	adrp	x1, l_.str@PAGE
Lloh20:
	add	x1, x1, l_.str@PAGEOFF
LBB0_4:
	mov	x0, x20
	mov	x2, x21
	bl	_syslog
	mov	x0, x19
	bl	_session_close
Lloh21:
	adrp	x8, _connect_in_progress@GOTPAGE
Lloh22:
	ldr	x8, [x8, _connect_in_progress@GOTPAGEOFF]
Lloh23:
	str	xzr, [x8]
	mov	x0, #-1
	b	LBB0_15
LBB0_5:
	ldr	w8, [x19]
	cmp	w8, #128
	b.eq	LBB0_11
; %bb.6:
	cmp	w8, #129
	b.ne	LBB0_13
; %bb.7:
	ldr	x8, [x19, #8]
	cmp	x8, x20
	cset	w0, eq
	bl	_assert
	ldr	w8, [x19, #16]
	cmn	w8, #1
	cset	w0, eq
	bl	_assert
	ldr	w1, [x23, #4]
	mov	x0, x22
	bl	_client_socket
	str	w0, [x19, #16]
	tbnz	w0, #31, LBB0_16
; %bb.8:
	mov	w8, #128
	str	w8, [x19]
	mov	w0, w0
	add	x1, x21, #12
	bl	_FD_SET
	ldrsw	x8, [x19, #16]
	ldr	x9, [x21]
	cmp	x9, x8
	b.ge	LBB0_10
; %bb.9:
	str	x8, [x21]
LBB0_10:
	str	wzr, [x23]
	bl	_write_hids_file
	b	LBB0_14
LBB0_11:
	ldr	x8, [x19, #8]
	cmn	x8, #1
	cset	w0, ne
	bl	_assert
	ldrsw	x8, [x19, #16]
	cmp	x8, x20
	cset	w0, eq
	bl	_assert
Lloh24:
	adrp	x8, _OPEN@GOTPAGE
Lloh25:
	ldr	x8, [x8, _OPEN@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	str	w8, [x19]
Lloh27:
	adrp	x8, _connect_in_progress@GOTPAGE
Lloh28:
	ldr	x8, [x8, _connect_in_progress@GOTPAGEOFF]
Lloh29:
	str	xzr, [x8]
	mov	x0, x19
	bl	_session_run
	tbz	w0, #31, LBB0_14
; %bb.12:
	mov	x0, x19
	bl	_session_close
	mov	x0, #-1
	b	LBB0_15
LBB0_13:
	mov	w0, #0
	bl	_assert
LBB0_14:
	add	x1, x21, #12
	mov	x0, x20
	bl	_FD_CLR
	add	x1, x21, #8
	mov	x0, x20
	bl	_FD_SET
	mov	x0, #0
LBB0_15:
	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
LBB0_16:
Lloh30:
	adrp	x8, _LOG_ERR@GOTPAGE
Lloh31:
	ldr	x8, [x8, _LOG_ERR@GOTPAGEOFF]
Lloh32:
	ldr	w20, [x8]
	mov	x0, x22
	mov	x1, #0
	bl	_bt_ntoa
	mov	x21, x0
Lloh33:
	adrp	x22, _errno@GOTPAGE
Lloh34:
	ldr	x22, [x22, _errno@GOTPAGEOFF]
	ldr	x0, [x22]
	bl	_strerror
	mov	x3, x0
	ldr	x4, [x22]
Lloh35:
	adrp	x1, l_.str.2@PAGE
Lloh36:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotStr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotStr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotStr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_SOL_SOCKET,4,2                 ; @SOL_SOCKET
	.comm	_SO_ERROR,4,2                   ; @SO_ERROR
	.comm	_LOG_ERR,4,2                    ; @LOG_ERR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Could not get socket error for %s. %s (%d)"

	.comm	_errno,8,3                      ; @errno
	.comm	_connect_in_progress,8,3        ; @connect_in_progress
l_.str.1:                               ; @.str.1
	.asciz	"Could not connect to %s. %s (%d)"

l_.str.2:                               ; @.str.2
	.asciz	"Could not open interrupt channel to %s. %s (%d)"

	.comm	_OPEN,4,2                       ; @OPEN
.subsections_via_symbols
