	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_C_OpenSession                  ## -- Begin function C_OpenSession
	.p2align	4, 0x90
_C_OpenSession:                         ## @C_OpenSession
	.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	%r8, %r14
	movl	%ecx, %r15d
	movl	%edx, %r12d
	movq	%rdi, %rbx
	xorl	%eax, %eax
	callq	_INIT_CONTEXT
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	callq	_st_logf
	movq	_soft_token@GOTPCREL(%rip), %r13
	movq	(%r13), %rax
	movq	_MAX_NUM_SESSION@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	%rcx, %rax
	jne	LBB0_2
## %bb.1:
	movq	_CKR_SESSION_COUNT@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_2:
	movl	%r12d, 20(%r13)
	movl	%r15d, 16(%r13)
	testq	%rcx, %rcx
	je	LBB0_3
## %bb.7:
	movq	8(%r13), %rdx
	movq	_CK_INVALID_HANDLE@GOTPCREL(%rip), %rsi
	movq	(%rsi), %rsi
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	%rsi, (%rdx,%rbx,8)
	je	LBB0_4
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	incq	%rbx
	cmpq	%rbx, %rcx
	jne	LBB0_8
LBB0_10:
	xorl	%eax, %eax
	callq	_abort
LBB0_3:
	xorl	%ebx, %ebx
LBB0_4:
	cmpq	%rcx, %rbx
	je	LBB0_10
## %bb.5:
	incq	%rax
	movq	%rax, (%r13)
	xorl	%eax, %eax
	callq	_random
                                        ## kill: def $eax killed $eax def $rax
	andl	$1048575, %eax                  ## imm = 0xFFFFF
	movq	8(%r13), %rcx
	movq	%rax, (%rcx,%rbx,8)
	movq	%rax, (%r14)
	movq	_CKR_OK@GOTPCREL(%rip), %rax
LBB0_6:
	movl	(%rax), %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	"OpenSession: slot: %d\n"

	.comm	_soft_token,24,3                ## @soft_token
	.comm	_MAX_NUM_SESSION,8,3            ## @MAX_NUM_SESSION
	.comm	_CKR_SESSION_COUNT,4,2          ## @CKR_SESSION_COUNT
	.comm	_CK_INVALID_HANDLE,8,3          ## @CK_INVALID_HANDLE
	.comm	_CKR_OK,4,2                     ## @CKR_OK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_C_OpenSession                  ; -- Begin function C_OpenSession
	.p2align	2
_C_OpenSession:                         ; @C_OpenSession
	.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	x19, x4
	mov	x20, x3
	mov	x21, x2
	mov	x22, x0
	bl	_INIT_CONTEXT
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x22
	bl	_st_logf
Lloh2:
	adrp	x22, _soft_token@GOTPAGE
Lloh3:
	ldr	x22, [x22, _soft_token@GOTPAGEOFF]
	ldr	x8, [x22]
Lloh4:
	adrp	x9, _MAX_NUM_SESSION@GOTPAGE
Lloh5:
	ldr	x9, [x9, _MAX_NUM_SESSION@GOTPAGEOFF]
Lloh6:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
Lloh7:
	adrp	x8, _CKR_SESSION_COUNT@GOTPAGE
Lloh8:
	ldr	x8, [x8, _CKR_SESSION_COUNT@GOTPAGEOFF]
	b	LBB0_9
LBB0_2:
	stp	w20, w21, [x22, #16]
	mov	x20, #0
	cbz	x9, LBB0_7
; %bb.3:
	ldr	x10, [x22, #8]
Lloh9:
	adrp	x11, _CK_INVALID_HANDLE@GOTPAGE
Lloh10:
	ldr	x11, [x11, _CK_INVALID_HANDLE@GOTPAGEOFF]
Lloh11:
	ldr	x11, [x11]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x12, [x10, x20, lsl #3]
	cmp	x12, x11
	b.eq	LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x20, x20, #1
	cmp	x9, x20
	b.ne	LBB0_4
LBB0_6:
	bl	_abort
LBB0_7:
	cmp	x20, x9
	b.eq	LBB0_6
; %bb.8:
	add	x8, x8, #1
	str	x8, [x22]
	bl	_random
	and	w8, w0, #0xfffff
	ldr	x9, [x22, #8]
	str	x8, [x9, x20, lsl #3]
	str	x8, [x19]
Lloh12:
	adrp	x8, _CKR_OK@GOTPAGE
Lloh13:
	ldr	x8, [x8, _CKR_OK@GOTPAGEOFF]
LBB0_9:
	ldr	w0, [x8]
	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	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"OpenSession: slot: %d\n"

	.comm	_soft_token,24,3                ; @soft_token
	.comm	_MAX_NUM_SESSION,8,3            ; @MAX_NUM_SESSION
	.comm	_CKR_SESSION_COUNT,4,2          ; @CKR_SESSION_COUNT
	.comm	_CK_INVALID_HANDLE,8,3          ; @CK_INVALID_HANDLE
	.comm	_CKR_OK,4,2                     ; @CKR_OK
.subsections_via_symbols
