	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pkcs11_open_session
_pkcs11_open_session:                   ## @pkcs11_open_session
	.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	%rdx, %r14
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movq	(%rdi), %rax
	movq	16(%rdi), %rcx
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	leaq	(%rsi,%rsi,2), %r12
	movq	_CKF_LOGIN_REQUIRED@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r13d
	andl	8(%rax,%r12,4), %r13d
	testq	%rdx, %rdx
	je	LBB0_4
## %bb.1:
	testl	%r13d, %r13d
	je	LBB0_4
## %bb.2:
	movq	%r14, %rdi
	callq	_strlen
	testl	%eax, %eax
	je	LBB0_3
LBB0_4:
	movq	8(%r15), %rax
	movl	(%rax,%rbx,4), %edi
	movq	_CKF_RW_SESSION@GOTPCREL(%rip), %rax
	movq	_CKF_SERIAL_SESSION@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	leaq	-44(%rbp), %r8
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	callq	*(%rax)
	movq	_CKR_OK@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_5
## %bb.6:
	testq	%r14, %r14
	je	LBB0_8
## %bb.7:
	testl	%r13d, %r13d
	je	LBB0_8
## %bb.9:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %r13
	movl	-44(%rbp), %eax
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movq	_CKU_USER@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%r14, %rdi
	callq	_strlen
	movl	-60(%rbp), %edi                 ## 4-byte Reload
	movl	%ebx, %esi
	movq	%r14, %rdx
	movl	%eax, %ecx
	callq	*%r13
	movq	_CKR_OK@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	je	LBB0_13
## %bb.10:
	movq	_CKR_USER_ALREADY_LOGGED_IN@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_13
## %bb.11:
	leaq	L_.str.2(%rip), %rdi
	movq	%rax, %rsi
	xorl	%eax, %eax
	movq	%rdx, %r14
	callq	_error
	movl	-44(%rbp), %edi
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	callq	*16(%rax)
	movl	$-1, %ebx
	cmpq	(%r14), %rax
	je	LBB0_15
## %bb.12:
	leaq	L_.str.3(%rip), %rdi
	movq	%rax, %rsi
	xorl	%eax, %eax
	callq	_error
	jmp	LBB0_15
LBB0_5:
	leaq	L_.str.1(%rip), %rdi
	movq	%rax, %rsi
	xorl	%eax, %eax
	callq	_error
	movl	$-1, %ebx
	jmp	LBB0_15
LBB0_8:
	movq	(%r15), %rax
	jmp	LBB0_14
LBB0_3:
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_error
	movl	$-1, %ebx
	jmp	LBB0_15
LBB0_13:
	movq	(%r15), %rax
	movl	$1, (%rax,%r12,4)
LBB0_14:
	movl	-44(%rbp), %ecx
	movl	%ecx, 4(%rax,%r12,4)
	xorl	%ebx, %ebx
LBB0_15:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CKF_LOGIN_REQUIRED,4,2         ## @CKF_LOGIN_REQUIRED
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"pin required"

	.comm	_CKF_RW_SESSION,4,2             ## @CKF_RW_SESSION
	.comm	_CKF_SERIAL_SESSION,4,2         ## @CKF_SERIAL_SESSION
	.comm	_CKR_OK,8,3                     ## @CKR_OK
L_.str.1:                               ## @.str.1
	.asciz	"C_OpenSession failed: %lu"

	.comm	_CKU_USER,4,2                   ## @CKU_USER
	.comm	_CKR_USER_ALREADY_LOGGED_IN,8,3 ## @CKR_USER_ALREADY_LOGGED_IN
L_.str.2:                               ## @.str.2
	.asciz	"C_Login failed: %lu"

L_.str.3:                               ## @.str.3
	.asciz	"C_CloseSession failed: %lu"

	.no_dead_strip	_pkcs11_open_session
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pkcs11_open_session
_pkcs11_open_session:                   ; @pkcs11_open_session
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x21, x2
	mov	x19, x1
	mov	x20, x0
	ldr	x24, [x0, #16]
	ldr	x8, [x0]
	mov	w9, #12
	madd	x8, x1, x9, x8
	ldr	w8, [x8, #8]
Lloh0:
	adrp	x9, _CKF_LOGIN_REQUIRED@GOTPAGE
Lloh1:
	ldr	x9, [x9, _CKF_LOGIN_REQUIRED@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	and	w22, w9, w8
	cbz	x2, LBB0_3
; %bb.1:
	cbz	w22, LBB0_3
; %bb.2:
	mov	x0, x21
	bl	_strlen
	cbz	w0, LBB0_11
LBB0_3:
	ldr	x8, [x20, #8]
	ldr	w0, [x8, x19, lsl #2]
Lloh3:
	adrp	x8, _CKF_RW_SESSION@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CKF_RW_SESSION@GOTPAGEOFF]
	ldr	x9, [x24]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x10, _CKF_SERIAL_SESSION@GOTPAGE
Lloh7:
	ldr	x10, [x10, _CKF_SERIAL_SESSION@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	orr	w1, w10, w8
	add	x4, sp, #12
	mov	x2, #0
	mov	x3, #0
	blr	x9
Lloh9:
	adrp	x25, _CKR_OK@GOTPAGE
Lloh10:
	ldr	x25, [x25, _CKR_OK@GOTPAGEOFF]
	ldr	x8, [x25]
	cmp	x0, x8
	b.ne	LBB0_8
; %bb.4:
	cbz	x21, LBB0_9
; %bb.5:
	cbz	w22, LBB0_9
; %bb.6:
	ldr	x26, [x24, #8]
	ldr	w22, [sp, #12]
Lloh11:
	adrp	x8, _CKU_USER@GOTPAGE
Lloh12:
	ldr	x8, [x8, _CKU_USER@GOTPAGEOFF]
Lloh13:
	ldr	w23, [x8]
	mov	x0, x21
	bl	_strlen
	mov	x3, x0
	mov	x0, x22
	mov	x1, x23
	mov	x2, x21
	blr	x26
	ldr	x8, [x25]
Lloh14:
	adrp	x9, _CKR_USER_ALREADY_LOGGED_IN@GOTPAGE
Lloh15:
	ldr	x9, [x9, _CKR_USER_ALREADY_LOGGED_IN@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	cmp	x0, x8
	ccmp	x0, x9, #4, ne
	b.ne	LBB0_12
; %bb.7:
	ldr	x8, [x20]
	mov	w9, #12
	mul	x9, x19, x9
	mov	w10, #1
	str	w10, [x8, x9]
	b	LBB0_10
LBB0_8:
	str	x0, [sp]
Lloh17:
	adrp	x0, l_.str.1@PAGE
Lloh18:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_14
LBB0_9:
	ldr	x8, [x20]
LBB0_10:
	mov	w0, #0
	ldr	w9, [sp, #12]
	mov	w10, #12
	madd	x8, x19, x10, x8
	str	w9, [x8, #4]
	b	LBB0_16
LBB0_11:
Lloh19:
	adrp	x0, l_.str@PAGE
Lloh20:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_14
LBB0_12:
	str	x0, [sp]
Lloh21:
	adrp	x0, l_.str.2@PAGE
Lloh22:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_error
	ldr	x8, [x24, #16]
	ldr	w0, [sp, #12]
	blr	x8
	ldr	x8, [x25]
	cmp	x0, x8
	b.eq	LBB0_15
; %bb.13:
	str	x0, [sp]
Lloh23:
	adrp	x0, l_.str.3@PAGE
Lloh24:
	add	x0, x0, l_.str.3@PAGEOFF
LBB0_14:
	bl	_error
LBB0_15:
	mov	w0, #-1
LBB0_16:
	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
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_CKF_LOGIN_REQUIRED,4,2         ; @CKF_LOGIN_REQUIRED
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"pin required"

	.comm	_CKF_RW_SESSION,4,2             ; @CKF_RW_SESSION
	.comm	_CKF_SERIAL_SESSION,4,2         ; @CKF_SERIAL_SESSION
	.comm	_CKR_OK,8,3                     ; @CKR_OK
l_.str.1:                               ; @.str.1
	.asciz	"C_OpenSession failed: %lu"

	.comm	_CKU_USER,4,2                   ; @CKU_USER
	.comm	_CKR_USER_ALREADY_LOGGED_IN,8,3 ; @CKR_USER_ALREADY_LOGGED_IN
l_.str.2:                               ; @.str.2
	.asciz	"C_Login failed: %lu"

l_.str.3:                               ; @.str.3
	.asciz	"C_CloseSession failed: %lu"

	.no_dead_strip	_pkcs11_open_session
.subsections_via_symbols
