	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pkey_sm2_sign
_pkey_sm2_sign:                         ## @pkey_sm2_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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, -56(%rbp)                  ## 8-byte Spill
	movq	%rcx, %r13
	movq	%rdx, %r14
	movq	%rsi, %r12
	movq	(%rdi), %rax
	movq	(%rax), %r15
	movq	%r15, %rdi
	callq	_ECDSA_size
	xorl	%ebx, %ebx
	testl	%eax, %eax
	jle	LBB0_8
## %bb.1:
	movl	%eax, %eax
	testq	%r12, %r12
	je	LBB0_7
## %bb.2:
	cmpq	%rax, (%r14)
	jae	LBB0_4
## %bb.3:
	movq	_SM2_F_PKEY_SM2_SIGN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_SM2_R_BUFFER_TOO_SMALL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_SM2err
	jmp	LBB0_8
LBB0_4:
	leaq	-44(%rbp), %rcx
	movq	%r13, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movq	%r12, %rdx
	movq	%r15, %r8
	callq	_sm2_sign
	testl	%eax, %eax
	jle	LBB0_5
## %bb.6:
	movl	-44(%rbp), %eax
LBB0_7:
	movq	%rax, (%r14)
	movl	$1, %ebx
LBB0_8:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movl	%eax, %ebx
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_SM2_F_PKEY_SM2_SIGN,4,2        ## @SM2_F_PKEY_SM2_SIGN
	.comm	_SM2_R_BUFFER_TOO_SMALL,4,2     ## @SM2_R_BUFFER_TOO_SMALL
	.no_dead_strip	_pkey_sm2_sign
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pkey_sm2_sign
_pkey_sm2_sign:                         ; @pkey_sm2_sign
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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, x4
	mov	x21, x3
	mov	x19, x2
	mov	x22, x1
	ldr	x8, [x0]
	ldr	x23, [x8]
	mov	x0, x23
	bl	_ECDSA_size
	cmp	w0, #1
	b.lt	LBB0_4
; %bb.1:
	cbz	x22, LBB0_5
; %bb.2:
	ldr	x8, [x19]
	cmp	x8, w0, uxtw
	b.hs	LBB0_6
; %bb.3:
Lloh0:
	adrp	x8, _SM2_F_PKEY_SM2_SIGN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SM2_F_PKEY_SM2_SIGN@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x8, _SM2_R_BUFFER_TOO_SMALL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SM2_R_BUFFER_TOO_SMALL@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_SM2err
LBB0_4:
	mov	w0, #0
	b	LBB0_9
LBB0_5:
	mov	w8, w0
	b	LBB0_8
LBB0_6:
	add	x3, sp, #12
	mov	x0, x21
	mov	x1, x20
	mov	x2, x22
	mov	x4, x23
	bl	_sm2_sign
	cmp	w0, #1
	b.lt	LBB0_9
; %bb.7:
	ldr	w8, [sp, #12]
LBB0_8:
	str	x8, [x19]
	mov	w0, #1
LBB0_9:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_SM2_F_PKEY_SM2_SIGN,4,2        ; @SM2_F_PKEY_SM2_SIGN
	.comm	_SM2_R_BUFFER_TOO_SMALL,4,2     ; @SM2_R_BUFFER_TOO_SMALL
	.no_dead_strip	_pkey_sm2_sign
.subsections_via_symbols
