	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_C_Sign                         ## -- Begin function C_Sign
	.p2align	4, 0x90
_C_Sign:                                ## @C_Sign
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, %r12
	movq	%rcx, %r14
	movq	%rdx, %r15
	movq	%rsi, %r13
	movl	%edi, %ebx
	xorl	%eax, %eax
	callq	_INIT_CONTEXT
	leaq	L_.str(%rip), %rdi
	callq	_st_logf
	leaq	-72(%rbp), %rsi
	movl	%ebx, %edi
	callq	_VERIFY_SESSION_HANDLE
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -64(%rbp)
	movq	-72(%rbp), %rax
	movslq	(%rax), %rax
	cmpq	$-1, %rax
	je	LBB0_1
## %bb.2:
	testq	%r12, %r12
	je	LBB0_3
## %bb.5:
	movq	_NULL_PTR@GOTPCREL(%rip), %rcx
	cmpq	%r13, (%rcx)
	jne	LBB0_7
## %bb.6:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_4
LBB0_3:
	leaq	L_.str.1(%rip), %rdi
LBB0_4:
	callq	_st_logf
	movq	_CKR_ARGUMENTS_BAD@GOTPCREL(%rip), %rbx
LBB0_15:
	movl	(%rbx), %ebx
	movq	-56(%rbp), %rdi
	testq	%rdi, %rdi
	je	LBB0_17
## %bb.16:
	movq	-64(%rbp), %rdx
	xorl	%esi, %esi
	callq	_memset
	leaq	-64(%rbp), %rdi
	callq	_der_free_octet_string
	jmp	LBB0_17
LBB0_7:
	movq	_soft_token@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%rcx,%rax,8), %rbx
	movl	(%rbx), %edi
	callq	_hx509_cert_have_private_key
	testq	%rax, %rax
	je	LBB0_8
## %bb.9:
	movq	-72(%rbp), %rax
	movq	8(%rax), %rax
	cmpl	$128, (%rax)
	jne	LBB0_10
## %bb.11:
	xorl	%eax, %eax
	callq	_hx509_signature_rsa_pkcs1_x509
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	%r13, -88(%rbp)
	movq	%r15, -96(%rbp)
	movq	_context@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movl	(%rbx), %edi
	callq	__hx509_cert_private_key
	leaq	-96(%rbp), %rcx
	leaq	-64(%rbp), %r9
	movl	%r15d, %edi
	movl	%eax, %esi
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
	xorl	%r8d, %r8d
	callq	__hx509_create_signature
	testl	%eax, %eax
	je	LBB0_13
## %bb.12:
	movq	_CKR_DEVICE_ERROR@GOTPCREL(%rip), %rbx
	jmp	LBB0_15
LBB0_8:
	leaq	L_.str.3(%rip), %rdi
	callq	_st_logf
LBB0_1:
	movq	_CKR_ARGUMENTS_BAD@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_17:
	movl	%ebx, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movq	_CKR_FUNCTION_NOT_SUPPORTED@GOTPCREL(%rip), %rbx
	jmp	LBB0_15
LBB0_13:
	movq	-64(%rbp), %rdx
	movq	%rdx, (%r12)
	movq	_CKR_OK@GOTPCREL(%rip), %rbx
	movq	_NULL_PTR@GOTPCREL(%rip), %rax
	cmpq	%r14, (%rax)
	je	LBB0_15
## %bb.14:
	movq	-56(%rbp), %rsi
	movq	%r14, %rdi
	callq	_memcpy
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Sign\n"

	.comm	_CKR_ARGUMENTS_BAD,4,2          ## @CKR_ARGUMENTS_BAD
L_.str.1:                               ## @.str.1
	.asciz	"signature len NULL\n"

	.comm	_NULL_PTR,8,3                   ## @NULL_PTR
L_.str.2:                               ## @.str.2
	.asciz	"data NULL\n"

	.comm	_soft_token,8,3                 ## @soft_token
L_.str.3:                               ## @.str.3
	.asciz	"private key NULL\n"

	.comm	_CKR_FUNCTION_NOT_SUPPORTED,4,2 ## @CKR_FUNCTION_NOT_SUPPORTED
	.comm	_context,4,2                    ## @context
	.comm	_CKR_DEVICE_ERROR,4,2           ## @CKR_DEVICE_ERROR
	.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_Sign                         ; -- Begin function C_Sign
	.p2align	2
_C_Sign:                                ; @C_Sign
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x20, x4
	mov	x19, x3
	mov	x21, x2
	mov	x22, x1
	mov	x23, x0
	bl	_INIT_CONTEXT
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_st_logf
	add	x1, sp, #40
	mov	x0, x23
	bl	_VERIFY_SESSION_HANDLE
	stp	xzr, xzr, [sp, #24]
	ldr	x8, [sp, #40]
	ldrsw	x8, [x8]
	cmn	w8, #1
	b.eq	LBB0_13
; %bb.1:
	cbz	x20, LBB0_4
; %bb.2:
Lloh2:
	adrp	x24, _NULL_PTR@GOTPAGE
Lloh3:
	ldr	x24, [x24, _NULL_PTR@GOTPAGEOFF]
	ldr	x9, [x24]
	cmp	x9, x22
	b.ne	LBB0_8
; %bb.3:
Lloh4:
	adrp	x0, l_.str.2@PAGE
Lloh5:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_5
LBB0_4:
Lloh6:
	adrp	x0, l_.str.1@PAGE
Lloh7:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_5:
	bl	_st_logf
Lloh8:
	adrp	x8, _CKR_ARGUMENTS_BAD@GOTPAGE
Lloh9:
	ldr	x8, [x8, _CKR_ARGUMENTS_BAD@GOTPAGEOFF]
LBB0_6:
	ldr	w19, [x8]
	ldr	x0, [sp, #32]
	cbz	x0, LBB0_14
; %bb.7:
	ldr	x2, [sp, #24]
	mov	w1, #0
	bl	_memset
	add	x0, sp, #24
	bl	_der_free_octet_string
	b	LBB0_14
LBB0_8:
Lloh10:
	adrp	x9, _soft_token@GOTPAGE
Lloh11:
	ldr	x9, [x9, _soft_token@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	ldr	x25, [x9, x8, lsl #3]
	ldr	w0, [x25]
	bl	_hx509_cert_have_private_key
	cbz	x0, LBB0_12
; %bb.9:
	ldr	x8, [sp, #40]
	ldr	x8, [x8, #8]
	ldr	w8, [x8]
	cmp	w8, #128
	b.ne	LBB0_15
; %bb.10:
	bl	_hx509_signature_rsa_pkcs1_x509
	mov	x23, x0
	stp	x21, x22, [sp, #8]
Lloh13:
	adrp	x8, _context@GOTPAGE
Lloh14:
	ldr	x8, [x8, _context@GOTPAGEOFF]
Lloh15:
	ldr	w21, [x8]
	ldr	w0, [x25]
	bl	__hx509_cert_private_key
	mov	x1, x0
	add	x3, sp, #8
	add	x5, sp, #24
	mov	x0, x21
	mov	x2, x23
	mov	x4, #0
	bl	__hx509_create_signature
	cbz	w0, LBB0_16
; %bb.11:
Lloh16:
	adrp	x8, _CKR_DEVICE_ERROR@GOTPAGE
Lloh17:
	ldr	x8, [x8, _CKR_DEVICE_ERROR@GOTPAGEOFF]
	b	LBB0_6
LBB0_12:
Lloh18:
	adrp	x0, l_.str.3@PAGE
Lloh19:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_st_logf
LBB0_13:
Lloh20:
	adrp	x8, _CKR_ARGUMENTS_BAD@GOTPAGE
Lloh21:
	ldr	x8, [x8, _CKR_ARGUMENTS_BAD@GOTPAGEOFF]
Lloh22:
	ldr	w19, [x8]
LBB0_14:
	mov	x0, x19
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_15:
Lloh23:
	adrp	x8, _CKR_FUNCTION_NOT_SUPPORTED@GOTPAGE
Lloh24:
	ldr	x8, [x8, _CKR_FUNCTION_NOT_SUPPORTED@GOTPAGEOFF]
	b	LBB0_6
LBB0_16:
	ldr	x2, [sp, #24]
	str	x2, [x20]
	ldr	x8, [x24]
	cmp	x8, x19
	b.eq	LBB0_18
; %bb.17:
	ldr	x1, [sp, #32]
	mov	x0, x19
	bl	_memcpy
LBB0_18:
Lloh25:
	adrp	x8, _CKR_OK@GOTPAGE
Lloh26:
	ldr	x8, [x8, _CKR_OK@GOTPAGEOFF]
	b	LBB0_6
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Sign\n"

	.comm	_CKR_ARGUMENTS_BAD,4,2          ; @CKR_ARGUMENTS_BAD
l_.str.1:                               ; @.str.1
	.asciz	"signature len NULL\n"

	.comm	_NULL_PTR,8,3                   ; @NULL_PTR
l_.str.2:                               ; @.str.2
	.asciz	"data NULL\n"

	.comm	_soft_token,8,3                 ; @soft_token
l_.str.3:                               ; @.str.3
	.asciz	"private key NULL\n"

	.comm	_CKR_FUNCTION_NOT_SUPPORTED,4,2 ; @CKR_FUNCTION_NOT_SUPPORTED
	.comm	_context,4,2                    ; @context
	.comm	_CKR_DEVICE_ERROR,4,2           ; @CKR_DEVICE_ERROR
	.comm	_CKR_OK,4,2                     ; @CKR_OK
.subsections_via_symbols
