	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_session_open                   ## -- Begin function session_open
	.p2align	4, 0x90
_session_open:                          ## @session_open
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r14
	xorl	%edi, %edi
	testq	%r14, %r14
	setne	%dil
	callq	_assert
	xorl	%edi, %edi
	testq	%r15, %r15
	setne	%dil
	callq	_assert
	movl	$80, %edi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_7
## %bb.1:
	movq	%rax, %rbx
	movq	%r14, 72(%rax)
	movq	%rax, %rdi
	addq	$64, %rdi
	movq	%r15, %rsi
	movl	$4, %edx
	callq	_memcpy
	movq	$0, 56(%rbx)
	pcmpeqd	%xmm0, %xmm0
	movdqu	%xmm0, (%rbx)
	movq	_CLOSED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 48(%rbx)
	movl	$-1, 16(%rbx)
	movq	$0, 40(%rbx)
	xorl	%eax, %eax
	callq	_kbd_maxkey
	movl	%eax, %edi
	callq	_bit_alloc
	movq	%rax, 24(%rbx)
	testq	%rax, %rax
	je	LBB0_6
## %bb.2:
	xorl	%eax, %eax
	callq	_kbd_maxkey
	movl	%eax, %edi
	callq	_bit_alloc
	movq	%rax, 32(%rbx)
	testq	%rax, %rax
	je	LBB0_5
## %bb.3:
	movq	_next@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_LIST_INSERT_HEAD
	jmp	LBB0_8
LBB0_5:
	movq	24(%rbx), %rdi
	callq	_free
LBB0_6:
	movq	%rbx, %rdi
	callq	_free
LBB0_7:
	xorl	%ebx, %ebx
LBB0_8:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CLOSED,4,2                     ## @CLOSED
	.comm	_next,4,2                       ## @next
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_session_open                   ; -- Begin function session_open
	.p2align	2
_session_open:                          ; @session_open
	.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
	mov	x21, x1
	mov	x20, x0
	cmp	x0, #0
	cset	w0, ne
	bl	_assert
	cmp	x21, #0
	cset	w0, ne
	bl	_assert
	mov	w0, #80
	bl	_malloc
	mov	x19, x0
	cbz	x0, LBB0_6
; %bb.1:
	str	x20, [x19, #72]
	add	x0, x19, #64
	mov	x1, x21
	mov	w2, #4
	bl	_memcpy
	movi.2d	v0, #0xffffffffffffffff
	str	d0, [x19]
	mov	w8, #-1
	str	w8, [x19, #8]
	str	xzr, [x19, #56]
Lloh0:
	adrp	x8, _CLOSED@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CLOSED@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x19, #48]
	stur	d0, [x19, #12]
	str	xzr, [x19, #40]
	bl	_kbd_maxkey
	bl	_bit_alloc
	str	x0, [x19, #24]
	cbz	x0, LBB0_5
; %bb.2:
	bl	_kbd_maxkey
	bl	_bit_alloc
	str	x0, [x19, #32]
	cbz	x0, LBB0_4
; %bb.3:
Lloh3:
	adrp	x8, _next@GOTPAGE
Lloh4:
	ldr	x8, [x8, _next@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x0, x20
	mov	x1, x19
	bl	_LIST_INSERT_HEAD
	b	LBB0_6
LBB0_4:
	ldr	x0, [x19, #24]
	bl	_free
LBB0_5:
	mov	x0, x19
	bl	_free
	mov	x19, #0
LBB0_6:
	mov	x0, x19
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_CLOSED,4,2                     ; @CLOSED
	.comm	_next,4,2                       ; @next
.subsections_via_symbols
