	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function server_accept
_server_accept:                         ## @server_accept
	.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, %r15
	movq	%rdi, %r13
	movl	$4, -52(%rbp)
	leaq	-48(%rbp), %rsi
	leaq	-52(%rbp), %rdx
	movq	%r15, %rdi
	callq	_accept
	testq	%rax, %rax
	js	LBB0_1
## %bb.2:
	movq	%rax, %r14
	leaq	-48(%rbp), %rdi
	callq	_get_hid_device
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, %rbx
	leaq	-48(%rbp), %rsi
	movq	%r13, %rdi
	callq	_session_by_bdaddr
	movq	%rax, %r12
	testq	%rax, %rax
	jne	LBB0_8
## %bb.5:
	movq	$0, (%rbx)
	xorl	%eax, %eax
	callq	_write_hids_file
	movq	%r13, %rdi
	movq	%rbx, %rsi
	callq	_session_open
	movq	%rax, %r12
	testq	%rax, %rax
	je	LBB0_6
LBB0_8:
	cmpq	%r15, (%r13)
	jne	LBB0_10
## %bb.9:
	xorl	%edi, %edi
	cmpl	$-1, (%r12)
	sete	%dil
	callq	_assert
	movl	%r14d, (%r12)
	leaq	16(%r12), %rcx
	movq	_W4INTR@GOTPCREL(%rip), %rax
	cmpl	$-1, (%rcx)
	jne	LBB0_12
	jmp	LBB0_13
LBB0_1:
	movq	_LOG_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	cmpq	%r15, (%r13)
	leaq	L_.str.1(%rip), %rax
	leaq	L_.str.2(%rip), %rbx
	cmoveq	%rax, %rbx
	movq	_errno@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	callq	_strerror
	movl	(%r15), %r8d
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edi
	movq	%rbx, %rdx
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_syslog
	jmp	LBB0_19
LBB0_3:
	movq	_LOG_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	cmpq	%r15, (%r13)
	leaq	L_.str.1(%rip), %rax
	leaq	L_.str.2(%rip), %rbx
	cmoveq	%rax, %rbx
	leaq	-48(%rbp), %rdi
	xorl	%esi, %esi
	callq	_bt_ntoa
	leaq	L_.str.3(%rip), %rsi
	movl	%r12d, %edi
	movq	%rbx, %rdx
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_syslog
	jmp	LBB0_7
LBB0_10:
	xorl	%edi, %edi
	cmpl	$-1, 16(%r12)
	sete	%dil
	callq	_assert
	movl	%r14d, 16(%r12)
	movq	_W4CTRL@GOTPCREL(%rip), %rax
	movq	%r12, %rcx
	cmpl	$-1, (%rcx)
	je	LBB0_13
LBB0_12:
	movq	_OPEN@GOTPCREL(%rip), %rax
LBB0_13:
	movq	(%rax), %rax
	movq	%rax, 8(%r12)
	leaq	16(%r13), %rsi
	movq	%r14, %rdi
	callq	_FD_SET
	cmpq	8(%r13), %r14
	jle	LBB0_15
## %bb.14:
	movq	%r14, 8(%r13)
LBB0_15:
	movq	_LOG_NOTICE@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	cmpq	%r15, (%r13)
	leaq	L_.str.1(%rip), %rax
	leaq	L_.str.2(%rip), %r15
	cmoveq	%rax, %r15
	xorl	%ebx, %ebx
	leaq	-48(%rbp), %rdi
	xorl	%esi, %esi
	callq	_bt_ntoa
	leaq	L_.str.5(%rip), %rsi
	movl	%r14d, %edi
	movq	%r15, %rdx
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_syslog
	movq	8(%r12), %rax
	movq	_OPEN@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_20
## %bb.16:
	movq	%r12, %rdi
	callq	_session_run
	testq	%rax, %rax
	js	LBB0_18
## %bb.17:
	xorl	%ebx, %ebx
	jmp	LBB0_20
LBB0_18:
	movq	%r12, %rdi
	callq	_session_close
	jmp	LBB0_19
LBB0_6:
	movq	_LOG_CRIT@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	leaq	-48(%rbp), %rdi
	xorl	%esi, %esi
	callq	_bt_ntoa
	movslq	%eax, %rdx
	leaq	L_.str.4(%rip), %rsi
	movl	%ebx, %edi
	xorl	%eax, %eax
	callq	_syslog
LBB0_7:
	movq	%r14, %rdi
	callq	_close
LBB0_19:
	movq	$-1, %rbx
LBB0_20:
	movq	%rbx, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_LOG_ERR,4,2                    ## @LOG_ERR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Could not accept %s connection. %s (%d)"

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

L_.str.2:                               ## @.str.2
	.asciz	"interrupt"

	.comm	_errno,4,2                      ## @errno
L_.str.3:                               ## @.str.3
	.asciz	"Rejecting %s connection from %s. Device not configured"

	.comm	_LOG_CRIT,4,2                   ## @LOG_CRIT
L_.str.4:                               ## @.str.4
	.asciz	"Could not open inbound session for %s"

	.comm	_W4INTR,8,3                     ## @W4INTR
	.comm	_OPEN,8,3                       ## @OPEN
	.comm	_W4CTRL,8,3                     ## @W4CTRL
	.comm	_LOG_NOTICE,4,2                 ## @LOG_NOTICE
L_.str.5:                               ## @.str.5
	.asciz	"Accepted %s connection from %s"

	.no_dead_strip	_server_accept
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function server_accept
_server_accept:                         ; @server_accept
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x20, x1
	mov	x21, x0
	mov	w8, #4
	str	w8, [sp, #20]
	add	x1, sp, #24
	add	x2, sp, #20
	mov	x0, x20
	bl	_accept
	tbnz	x0, #63, LBB0_6
; %bb.1:
	mov	x19, x0
	add	x0, sp, #24
	bl	_get_hid_device
	cbz	x0, LBB0_7
; %bb.2:
	mov	x23, x0
	add	x1, sp, #24
	mov	x0, x21
	bl	_session_by_bdaddr
	mov	x22, x0
	cbnz	x0, LBB0_4
; %bb.3:
	str	xzr, [x23]
	bl	_write_hids_file
	mov	x0, x21
	mov	x1, x23
	bl	_session_open
	mov	x22, x0
	cbz	x0, LBB0_15
LBB0_4:
	ldr	x8, [x21]
	cmp	x8, x20
	b.ne	LBB0_8
; %bb.5:
	ldr	w8, [x22]
	cmn	w8, #1
	cset	w0, eq
	bl	_assert
	mov	x9, x22
	str	w19, [x9], #16
Lloh0:
	adrp	x8, _W4INTR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _W4INTR@GOTPAGEOFF]
	b	LBB0_9
LBB0_6:
Lloh2:
	adrp	x8, _LOG_ERR@GOTPAGE
Lloh3:
	ldr	x8, [x8, _LOG_ERR@GOTPAGEOFF]
Lloh4:
	ldr	w19, [x8]
Lloh5:
	adrp	x8, l_.str.2@PAGE
Lloh6:
	add	x8, x8, l_.str.2@PAGEOFF
Lloh7:
	adrp	x9, l_.str.1@PAGE
Lloh8:
	add	x9, x9, l_.str.1@PAGEOFF
	ldr	x10, [x21]
	cmp	x10, x20
	csel	x20, x9, x8, eq
Lloh9:
	adrp	x21, _errno@GOTPAGE
Lloh10:
	ldr	x21, [x21, _errno@GOTPAGEOFF]
	ldr	w0, [x21]
	bl	_strerror
                                        ; kill: def $w0 killed $w0 def $x0
	ldr	w8, [x21]
	stp	x0, x8, [sp]
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	bl	_syslog
	b	LBB0_17
LBB0_7:
Lloh13:
	adrp	x8, _LOG_ERR@GOTPAGE
Lloh14:
	ldr	x8, [x8, _LOG_ERR@GOTPAGEOFF]
Lloh15:
	ldr	w22, [x8]
	ldr	x8, [x21]
Lloh16:
	adrp	x9, l_.str.2@PAGE
Lloh17:
	add	x9, x9, l_.str.2@PAGEOFF
Lloh18:
	adrp	x10, l_.str.1@PAGE
Lloh19:
	add	x10, x10, l_.str.1@PAGEOFF
	cmp	x8, x20
	csel	x20, x10, x9, eq
	add	x0, sp, #24
	mov	x1, #0
	bl	_bt_ntoa
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh20:
	adrp	x1, l_.str.3@PAGE
Lloh21:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x22
	mov	x2, x20
	b	LBB0_16
LBB0_8:
	ldr	w8, [x22, #16]
	cmn	w8, #1
	cset	w0, eq
	bl	_assert
	str	w19, [x22, #16]
Lloh22:
	adrp	x8, _W4CTRL@GOTPAGE
Lloh23:
	ldr	x8, [x8, _W4CTRL@GOTPAGEOFF]
	mov	x9, x22
LBB0_9:
Lloh24:
	adrp	x23, _OPEN@GOTPAGE
Lloh25:
	ldr	x23, [x23, _OPEN@GOTPAGEOFF]
	ldr	w9, [x9]
	cmn	w9, #1
	csel	x8, x8, x23, eq
	ldr	x8, [x8]
	str	x8, [x22, #8]
	add	x1, x21, #16
	mov	x0, x19
	bl	_FD_SET
	ldr	x8, [x21, #8]
	cmp	x19, x8
	b.le	LBB0_11
; %bb.10:
	str	x19, [x21, #8]
LBB0_11:
Lloh26:
	adrp	x8, _LOG_NOTICE@GOTPAGE
Lloh27:
	ldr	x8, [x8, _LOG_NOTICE@GOTPAGEOFF]
Lloh28:
	ldr	w19, [x8]
	ldr	x8, [x21]
Lloh29:
	adrp	x9, l_.str.2@PAGE
Lloh30:
	add	x9, x9, l_.str.2@PAGEOFF
Lloh31:
	adrp	x10, l_.str.1@PAGE
Lloh32:
	add	x10, x10, l_.str.1@PAGEOFF
	cmp	x8, x20
	csel	x20, x10, x9, eq
	add	x0, sp, #24
	mov	x1, #0
	bl	_bt_ntoa
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh33:
	adrp	x1, l_.str.5@PAGE
Lloh34:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	bl	_syslog
	mov	x0, #0
	ldr	x8, [x22, #8]
	ldr	x9, [x23]
	cmp	x8, x9
	b.ne	LBB0_18
; %bb.12:
	mov	x0, x22
	bl	_session_run
	tbnz	x0, #63, LBB0_14
; %bb.13:
	mov	x0, #0
	b	LBB0_18
LBB0_14:
	mov	x0, x22
	bl	_session_close
	b	LBB0_17
LBB0_15:
Lloh35:
	adrp	x8, _LOG_CRIT@GOTPAGE
Lloh36:
	ldr	x8, [x8, _LOG_CRIT@GOTPAGEOFF]
Lloh37:
	ldr	w20, [x8]
	add	x0, sp, #24
	mov	x1, #0
	bl	_bt_ntoa
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x2, w0
Lloh38:
	adrp	x1, l_.str.4@PAGE
Lloh39:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x20
LBB0_16:
	bl	_syslog
	mov	x0, x19
	bl	_close
LBB0_17:
	mov	x0, #-1
LBB0_18:
	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
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.comm	_LOG_ERR,4,2                    ; @LOG_ERR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Could not accept %s connection. %s (%d)"

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

l_.str.2:                               ; @.str.2
	.asciz	"interrupt"

	.comm	_errno,4,2                      ; @errno
l_.str.3:                               ; @.str.3
	.asciz	"Rejecting %s connection from %s. Device not configured"

	.comm	_LOG_CRIT,4,2                   ; @LOG_CRIT
l_.str.4:                               ; @.str.4
	.asciz	"Could not open inbound session for %s"

	.comm	_W4INTR,8,3                     ; @W4INTR
	.comm	_OPEN,8,3                       ; @OPEN
	.comm	_W4CTRL,8,3                     ; @W4CTRL
	.comm	_LOG_NOTICE,4,2                 ; @LOG_NOTICE
l_.str.5:                               ; @.str.5
	.asciz	"Accepted %s connection from %s"

	.no_dead_strip	_server_accept
.subsections_via_symbols
