	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bn_to_asn1_string
_bn_to_asn1_string:                     ## @bn_to_asn1_string
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r15
	testq	%rsi, %rsi
	je	LBB0_7
## %bb.1:
	movl	%edx, (%r14)
	movq	%r14, %r12
	jmp	LBB0_2
LBB0_7:
	movl	%edx, %edi
	callq	_ASN1_STRING_type_new
	movq	%rax, %r12
	testq	%rax, %rax
	je	LBB0_8
LBB0_2:
	movq	%r15, %rdi
	callq	_BN_is_negative
	testq	%rax, %rax
	je	LBB0_5
## %bb.3:
	movq	%r15, %rdi
	callq	_BN_is_zero
	testq	%rax, %rax
	jne	LBB0_5
## %bb.4:
	movq	_V_ASN1_NEG_INTEGER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%r12)
LBB0_5:
	movq	%r15, %rdi
	callq	_BN_num_bytes
	testl	%eax, %eax
	movl	$1, %ebx
	cmovnel	%eax, %ebx
	movq	%r12, %rdi
	xorl	%esi, %esi
	movl	%ebx, %edx
	callq	_ASN1_STRING_set
	testq	%rax, %rax
	je	LBB0_6
## %bb.12:
	movq	%r15, %rdi
	callq	_BN_is_zero
	movq	8(%r12), %rsi
	testq	%rax, %rax
	je	LBB0_14
## %bb.13:
	movq	$0, (%rsi)
	movl	%ebx, 4(%r12)
	jmp	LBB0_15
LBB0_6:
	movq	_ERR_R_MALLOC_FAILURE@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_14:
	movq	%r15, %rdi
	callq	_BN_bn2bin
	movl	%eax, 4(%r12)
	jmp	LBB0_15
LBB0_8:
	movq	_ERR_R_NESTED_ASN1_ERROR@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
LBB0_9:
	movq	_ASN1_F_BN_TO_ASN1_STRING@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movl	(%rax), %esi
	callq	_ASN1err
	cmpq	%r14, %r12
	je	LBB0_11
## %bb.10:
	movq	%r12, %rdi
	callq	_ASN1_INTEGER_free
LBB0_11:
	xorl	%r12d, %r12d
LBB0_15:
	movq	%r12, %rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ASN1_F_BN_TO_ASN1_STRING,4,2   ## @ASN1_F_BN_TO_ASN1_STRING
	.comm	_ERR_R_NESTED_ASN1_ERROR,4,2    ## @ERR_R_NESTED_ASN1_ERROR
	.comm	_V_ASN1_NEG_INTEGER,4,2         ## @V_ASN1_NEG_INTEGER
	.comm	_ERR_R_MALLOC_FAILURE,4,2       ## @ERR_R_MALLOC_FAILURE
	.no_dead_strip	_bn_to_asn1_string
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bn_to_asn1_string
_bn_to_asn1_string:                     ; @bn_to_asn1_string
	.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	x20, x1
	mov	x21, x0
	cbz	x1, LBB0_2
; %bb.1:
	str	w2, [x20]
	mov	x19, x20
	b	LBB0_3
LBB0_2:
	mov	x0, x2
	bl	_ASN1_STRING_type_new
	mov	x19, x0
	cbz	x0, LBB0_11
LBB0_3:
	mov	x0, x21
	bl	_BN_is_negative
	cbz	x0, LBB0_6
; %bb.4:
	mov	x0, x21
	bl	_BN_is_zero
	cbnz	x0, LBB0_6
; %bb.5:
Lloh0:
	adrp	x8, _V_ASN1_NEG_INTEGER@GOTPAGE
Lloh1:
	ldr	x8, [x8, _V_ASN1_NEG_INTEGER@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
LBB0_6:
	mov	x0, x21
	bl	_BN_num_bytes
	cmp	w0, #0
	csinc	w22, w0, wzr, ne
	mov	x0, x19
	mov	x1, #0
	mov	x2, x22
	bl	_ASN1_STRING_set
	cbz	x0, LBB0_9
; %bb.7:
	mov	x0, x21
	bl	_BN_is_zero
	ldr	x1, [x19, #8]
	cbz	x0, LBB0_10
; %bb.8:
	str	xzr, [x1]
	str	w22, [x19, #4]
	b	LBB0_15
LBB0_9:
Lloh3:
	adrp	x8, _ERR_R_MALLOC_FAILURE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ERR_R_MALLOC_FAILURE@GOTPAGEOFF]
	b	LBB0_12
LBB0_10:
	mov	x0, x21
	bl	_BN_bn2bin
	str	w0, [x19, #4]
	b	LBB0_15
LBB0_11:
Lloh5:
	adrp	x8, _ERR_R_NESTED_ASN1_ERROR@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ERR_R_NESTED_ASN1_ERROR@GOTPAGEOFF]
LBB0_12:
Lloh7:
	adrp	x9, _ASN1_F_BN_TO_ASN1_STRING@GOTPAGE
Lloh8:
	ldr	x9, [x9, _ASN1_F_BN_TO_ASN1_STRING@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x9]
	ldr	w1, [x8]
	bl	_ASN1err
	cmp	x19, x20
	b.eq	LBB0_14
; %bb.13:
	mov	x0, x19
	bl	_ASN1_INTEGER_free
LBB0_14:
	mov	x19, #0
LBB0_15:
	mov	x0, x19
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_ASN1_F_BN_TO_ASN1_STRING,4,2   ; @ASN1_F_BN_TO_ASN1_STRING
	.comm	_ERR_R_NESTED_ASN1_ERROR,4,2    ; @ERR_R_NESTED_ASN1_ERROR
	.comm	_V_ASN1_NEG_INTEGER,4,2         ; @V_ASN1_NEG_INTEGER
	.comm	_ERR_R_MALLOC_FAILURE,4,2       ; @ERR_R_MALLOC_FAILURE
	.no_dead_strip	_bn_to_asn1_string
.subsections_via_symbols
