	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sm2_sig_gen
_sm2_sig_gen:                           ## @sm2_sig_gen
	.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	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, -128(%rbp)                ## 8-byte Spill
	movq	%rdi, %rbx
	callq	_EC_KEY_get0_private_key
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_EC_KEY_get0_group
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_EC_GROUP_get0_order
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	%rbx, -96(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_EC_POINT_new
	movq	%rax, %r13
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_BN_CTX_new
	movq	%rax, %r14
	movq	_ERR_R_MALLOC_FAILURE@GOTPCREL(%rip), %rbx
	testq	%r13, %r13
	je	LBB0_22
## %bb.1:
	testq	%r14, %r14
	je	LBB0_22
## %bb.2:
	movq	%r13, -64(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	callq	_BN_CTX_start
	movq	%r14, %rdi
	callq	_BN_CTX_get
	movq	%rax, %r13
	movq	%r14, %rdi
	callq	_BN_CTX_get
	movq	%rax, -112(%rbp)                ## 8-byte Spill
	movq	%r14, %rdi
	callq	_BN_CTX_get
	movq	%rax, -120(%rbp)                ## 8-byte Spill
	movq	%r14, %rdi
	callq	_BN_CTX_get
	testq	%rax, %rax
	je	LBB0_23
## %bb.3:
	movq	%rax, %rbx
	xorl	%eax, %eax
	callq	_BN_new
	movq	%rax, %r15
	xorl	%eax, %eax
	callq	_BN_new
	testq	%r15, %r15
	je	LBB0_25
## %bb.4:
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	testq	%rax, %rax
	je	LBB0_26
## %bb.5:
	movq	%r13, %rdi
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
	callq	_BN_priv_rand_range
	movq	_ERR_R_INTERNAL_ERROR@GOTPCREL(%rip), %rcx
	testl	%eax, %eax
	je	LBB0_27
## %bb.6:
	movq	%rbx, -104(%rbp)                ## 8-byte Spill
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_8 Depth=1
	movq	%r13, %rdi
	movq	%rbx, %rsi
	callq	_BN_priv_rand_range
	testl	%eax, %eax
	je	LBB0_28
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	-96(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movq	%r13, %rdx
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rsi
	movq	%rdx, %r12
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %r9
	callq	_EC_POINT_mul
	testl	%eax, %eax
	je	LBB0_30
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movq	%rbx, %rdi
	movq	%r13, %rsi
	movq	-120(%rbp), %rbx                ## 8-byte Reload
	movq	%rbx, %rdx
	xorl	%ecx, %ecx
	movq	%r14, %r8
	callq	_EC_POINT_get_affine_coordinates
	testl	%eax, %eax
	je	LBB0_31
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	%r15, %rdi
	movq	-128(%rbp), %rsi                ## 8-byte Reload
	movq	%rbx, %rdx
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rcx
	movq	%r14, %r8
	callq	_BN_mod_add
	testl	%eax, %eax
	je	LBB0_33
## %bb.11:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	%r15, %rdi
	callq	_BN_is_zero
	testq	%rax, %rax
	movq	%r12, %r13
	jne	LBB0_7
## %bb.12:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	-112(%rbp), %r14                ## 8-byte Reload
	movq	%r14, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movq	%r13, %rdx
	callq	_BN_add
	testl	%eax, %eax
	je	LBB0_28
## %bb.13:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_BN_cmp
	testq	%rax, %rax
	je	LBB0_7
## %bb.14:
	xorl	%eax, %eax
	callq	_BN_value_one
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	movq	-88(%rbp), %rsi                 ## 8-byte Reload
	movq	%rax, %rdx
	callq	_BN_add
	movq	_ERR_R_BN_LIB@GOTPCREL(%rip), %r15
	testl	%eax, %eax
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	je	LBB0_37
## %bb.15:
	movq	-96(%rbp), %rdi                 ## 8-byte Reload
	movq	%r14, %rsi
	movq	%r14, %rdx
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rcx
	callq	_ec_group_do_inverse_ord
	testl	%eax, %eax
	je	LBB0_38
## %bb.16:
	movq	-104(%rbp), %rbx                ## 8-byte Reload
	movq	%rbx, %rdi
	movq	-88(%rbp), %rsi                 ## 8-byte Reload
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	movq	%r14, %r8
	callq	_BN_mod_mul
	testl	%eax, %eax
	je	LBB0_39
## %bb.17:
	movq	%rbx, %rdi
	movq	%r12, %rsi
	movq	%rbx, %rdx
	callq	_BN_sub
	testl	%eax, %eax
	je	LBB0_39
## %bb.18:
	movq	%rbx, %rdx
	movq	%r15, %rbx
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdi
	movq	%r12, %rsi
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %r8
	callq	_BN_mod_mul
	testl	%eax, %eax
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	je	LBB0_35
## %bb.19:
	xorl	%eax, %eax
	callq	_ECDSA_SIG_new
	testq	%rax, %rax
	je	LBB0_24
## %bb.20:
	movq	%rax, %rbx
	movq	%rax, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	callq	_ECDSA_SIG_set0
	jmp	LBB0_36
LBB0_22:
	xorl	%r12d, %r12d
	jmp	LBB0_35
LBB0_23:
	xorl	%r15d, %r15d
	xorl	%r12d, %r12d
	movq	-64(%rbp), %r13                 ## 8-byte Reload
LBB0_24:
	movq	_ERR_R_MALLOC_FAILURE@GOTPCREL(%rip), %rbx
	jmp	LBB0_35
LBB0_25:
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	movq	_ERR_R_MALLOC_FAILURE@GOTPCREL(%rip), %rbx
	movq	%rax, %r12
	jmp	LBB0_35
LBB0_26:
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	movq	_ERR_R_MALLOC_FAILURE@GOTPCREL(%rip), %rbx
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	jmp	LBB0_35
LBB0_27:
	movq	%rcx, %rbx
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	jmp	LBB0_35
LBB0_28:
	movq	_ERR_R_INTERNAL_ERROR@GOTPCREL(%rip), %rbx
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	movq	-48(%rbp), %r12                 ## 8-byte Reload
LBB0_29:
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	jmp	LBB0_34
LBB0_30:
	movq	_ERR_R_INTERNAL_ERROR@GOTPCREL(%rip), %rbx
	jmp	LBB0_32
LBB0_31:
	movq	_ERR_R_INTERNAL_ERROR@GOTPCREL(%rip), %rbx
	movq	-64(%rbp), %r13                 ## 8-byte Reload
LBB0_32:
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	jmp	LBB0_35
LBB0_33:
	movq	_ERR_R_INTERNAL_ERROR@GOTPCREL(%rip), %rbx
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	movq	-48(%rbp), %r12                 ## 8-byte Reload
LBB0_34:
	movq	-72(%rbp), %r14                 ## 8-byte Reload
LBB0_35:
	movq	_SM2_F_SM2_SIG_GEN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%rbx), %esi
	callq	_SM2err
	movq	%r15, %rdi
	callq	_BN_free
	movq	%r12, %rdi
	callq	_BN_free
	xorl	%ebx, %ebx
LBB0_36:
	movq	%r14, %rdi
	callq	_BN_CTX_free
	movq	%r13, %rdi
	callq	_EC_POINT_free
	movq	%rbx, %rax
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_37:
	movq	%r15, %rbx
	movq	%r14, %r12
	jmp	LBB0_29
LBB0_38:
	movq	%r15, %rbx
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	jmp	LBB0_35
LBB0_39:
	movq	%r15, %rbx
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	jmp	LBB0_35
	.cfi_endproc
                                        ## -- End function
	.comm	_SM2_F_SM2_SIG_GEN,4,2          ## @SM2_F_SM2_SIG_GEN
	.comm	_ERR_R_MALLOC_FAILURE,4,2       ## @ERR_R_MALLOC_FAILURE
	.comm	_ERR_R_INTERNAL_ERROR,4,2       ## @ERR_R_INTERNAL_ERROR
	.comm	_ERR_R_BN_LIB,4,2               ## @ERR_R_BN_LIB
	.no_dead_strip	_sm2_sig_gen
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sm2_sig_gen
_sm2_sig_gen:                           ; @sm2_sig_gen
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x26, x1
	mov	x19, x0
	bl	_EC_KEY_get0_private_key
	mov	x27, x0
	mov	x0, x19
	bl	_EC_KEY_get0_group
	mov	x25, x0
	bl	_EC_GROUP_get0_order
	mov	x23, x0
	mov	x0, x25
	bl	_EC_POINT_new
	mov	x19, x0
	bl	_BN_CTX_new
	mov	x20, x0
	mov	x21, #0
Lloh0:
	adrp	x9, _ERR_R_MALLOC_FAILURE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ERR_R_MALLOC_FAILURE@GOTPAGEOFF]
	mov	x22, #0
	cbz	x19, LBB0_23
; %bb.1:
	cbz	x20, LBB0_23
; %bb.2:
	str	x27, [sp, #16]                  ; 8-byte Folded Spill
	mov	x0, x20
	bl	_BN_CTX_start
	mov	x0, x20
	bl	_BN_CTX_get
	mov	x27, x0
	mov	x0, x20
	bl	_BN_CTX_get
	mov	x21, x0
	mov	x0, x20
	bl	_BN_CTX_get
	mov	x28, x0
	mov	x0, x20
	bl	_BN_CTX_get
	cbz	x0, LBB0_21
; %bb.3:
	str	x21, [sp, #24]                  ; 8-byte Folded Spill
	str	x0, [sp, #8]                    ; 8-byte Folded Spill
	bl	_BN_new
	mov	x21, x0
	bl	_BN_new
	mov	x22, x0
Lloh2:
	adrp	x9, _ERR_R_MALLOC_FAILURE@GOTPAGE
Lloh3:
	ldr	x9, [x9, _ERR_R_MALLOC_FAILURE@GOTPAGEOFF]
	cbz	x21, LBB0_23
; %bb.4:
	cbz	x22, LBB0_23
; %bb.5:
	mov	x0, x27
	mov	x1, x23
	bl	_BN_priv_rand_range
	cbnz	w0, LBB0_8
LBB0_6:
Lloh4:
	adrp	x9, _ERR_R_INTERNAL_ERROR@GOTPAGE
Lloh5:
	ldr	x9, [x9, _ERR_R_INTERNAL_ERROR@GOTPAGEOFF]
	b	LBB0_23
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x27
	mov	x1, x23
	bl	_BN_priv_rand_range
	cbz	w0, LBB0_6
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x25
	mov	x1, x19
	mov	x2, x27
	mov	x3, #0
	mov	x4, #0
	mov	x5, x20
	bl	_EC_POINT_mul
	cbz	w0, LBB0_6
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x25
	mov	x1, x19
	mov	x2, x28
	mov	x3, #0
	mov	x4, x20
	bl	_EC_POINT_get_affine_coordinates
	cbz	w0, LBB0_6
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x21
	mov	x1, x26
	mov	x2, x28
	mov	x3, x23
	mov	x4, x20
	bl	_BN_mod_add
	cbz	w0, LBB0_6
; %bb.11:                               ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x21
	bl	_BN_is_zero
	cbnz	x0, LBB0_7
; %bb.12:                               ;   in Loop: Header=BB0_8 Depth=1
	mov	x2, x27
	mov	x24, x19
	mov	x19, x22
	mov	x22, x26
	ldr	x26, [sp, #24]                  ; 8-byte Folded Reload
	mov	x0, x26
	mov	x1, x21
	bl	_BN_add
	cbz	w0, LBB0_25
; %bb.13:                               ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x26
	mov	x1, x23
	bl	_BN_cmp
	mov	x26, x22
	mov	x22, x19
	mov	x19, x24
	cbz	x0, LBB0_7
; %bb.14:
	bl	_BN_value_one
	mov	x2, x0
	mov	x0, x22
	ldr	x24, [sp, #16]                  ; 8-byte Folded Reload
	mov	x1, x24
	bl	_BN_add
	cbz	w0, LBB0_26
; %bb.15:
	mov	x0, x25
	mov	x1, x22
	mov	x2, x22
	mov	x3, x20
	bl	_ec_group_do_inverse_ord
	cbz	w0, LBB0_26
; %bb.16:
	ldr	x25, [sp, #8]                   ; 8-byte Folded Reload
	mov	x0, x25
	mov	x1, x24
	mov	x2, x21
	mov	x3, x23
	mov	x4, x20
	bl	_BN_mod_mul
	cbz	w0, LBB0_26
; %bb.17:
	mov	x0, x25
	mov	x1, x27
	mov	x2, x25
	bl	_BN_sub
	cbz	w0, LBB0_26
; %bb.18:
	mov	x0, x22
	mov	x1, x22
	mov	x2, x25
	mov	x3, x23
	mov	x4, x20
	bl	_BN_mod_mul
	cbz	w0, LBB0_26
; %bb.19:
	bl	_ECDSA_SIG_new
	cbz	x0, LBB0_22
; %bb.20:
	mov	x23, x0
	mov	x1, x21
	mov	x2, x22
	bl	_ECDSA_SIG_set0
	b	LBB0_24
LBB0_21:
	mov	x21, #0
	mov	x22, #0
LBB0_22:
Lloh6:
	adrp	x9, _ERR_R_MALLOC_FAILURE@GOTPAGE
Lloh7:
	ldr	x9, [x9, _ERR_R_MALLOC_FAILURE@GOTPAGEOFF]
LBB0_23:
Lloh8:
	adrp	x8, _SM2_F_SM2_SIG_GEN@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SM2_F_SM2_SIG_GEN@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	ldr	w1, [x9]
	bl	_SM2err
	mov	x0, x21
	bl	_BN_free
	mov	x0, x22
	bl	_BN_free
	mov	x23, #0
LBB0_24:
	mov	x0, x20
	bl	_BN_CTX_free
	mov	x0, x19
	bl	_EC_POINT_free
	mov	x0, x23
	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
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_25:
	mov	x22, x19
	mov	x19, x24
	b	LBB0_6
LBB0_26:
Lloh11:
	adrp	x9, _ERR_R_BN_LIB@GOTPAGE
Lloh12:
	ldr	x9, [x9, _ERR_R_BN_LIB@GOTPAGEOFF]
	b	LBB0_23
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_SM2_F_SM2_SIG_GEN,4,2          ; @SM2_F_SM2_SIG_GEN
	.comm	_ERR_R_MALLOC_FAILURE,4,2       ; @ERR_R_MALLOC_FAILURE
	.comm	_ERR_R_INTERNAL_ERROR,4,2       ; @ERR_R_INTERNAL_ERROR
	.comm	_ERR_R_BN_LIB,4,2               ; @ERR_R_BN_LIB
	.no_dead_strip	_sm2_sig_gen
.subsections_via_symbols
