	.file	"extr_cms_sd.c_cms_sd_set_version.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	cms_sd_set_version, @function
cms_sd_set_version:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	xor	ebp, ebp
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	mov	rbx, rdi
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L3:
	cmp	rax, QWORD PTR CMS_CERTCHOICE_V2ACERT[rip]
	je	.L21
	cmp	rax, QWORD PTR CMS_CERTCHOICE_V1ACERT[rip]
	je	.L22
.L4:
	add	ebp, 1
.L2:
	mov	edi, DWORD PTR 20[rbx]
	call	sk_CMS_CertificateChoices_num@PLT
	cmp	eax, ebp
	jle	.L23
	mov	edi, DWORD PTR 20[rbx]
	mov	esi, ebp
	call	sk_CMS_CertificateChoices_value@PLT
	mov	rax, QWORD PTR [rax]
	cmp	rax, QWORD PTR CMS_CERTCHOICE_OTHER[rip]
	jne	.L3
	cmp	DWORD PTR [rbx], 4
	jg	.L4
	mov	DWORD PTR [rbx], 5
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L21:
	cmp	DWORD PTR [rbx], 3
	jg	.L4
	mov	DWORD PTR [rbx], 4
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L22:
	cmp	DWORD PTR [rbx], 2
	jg	.L4
	mov	DWORD PTR [rbx], 3
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L23:
	xor	ebp, ebp
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L8:
	add	ebp, 1
.L7:
	mov	edi, DWORD PTR 16[rbx]
	call	sk_CMS_RevocationInfoChoice_num@PLT
	cmp	eax, ebp
	jle	.L24
	mov	edi, DWORD PTR 16[rbx]
	mov	esi, ebp
	call	sk_CMS_RevocationInfoChoice_value@PLT
	mov	rcx, QWORD PTR CMS_REVCHOICE_OTHER[rip]
	cmp	QWORD PTR [rax], rcx
	jne	.L8
	cmp	DWORD PTR [rbx], 4
	jg	.L8
	mov	DWORD PTR [rbx], 5
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L24:
	mov	rax, QWORD PTR 8[rbx]
	mov	edi, DWORD PTR [rax]
	call	OBJ_obj2nid@PLT
	cmp	rax, QWORD PTR NID_pkcs7_data[rip]
	je	.L10
	cmp	DWORD PTR [rbx], 2
	jle	.L25
.L10:
	xor	ebp, ebp
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L12:
	mov	edx, DWORD PTR [rax]
	test	edx, edx
	jg	.L15
	mov	DWORD PTR [rax], 1
.L15:
	add	ebp, 1
.L11:
	mov	edi, DWORD PTR 4[rbx]
	call	sk_CMS_SignerInfo_num@PLT
	cmp	eax, ebp
	jle	.L26
	mov	edi, DWORD PTR 4[rbx]
	mov	esi, ebp
	call	sk_CMS_SignerInfo_value@PLT
	mov	rcx, QWORD PTR CMS_SIGNERINFO_KEYIDENTIFIER[rip]
	mov	rdx, QWORD PTR 8[rax]
	cmp	QWORD PTR [rdx], rcx
	jne	.L12
	cmp	DWORD PTR [rax], 2
	jg	.L13
	mov	DWORD PTR [rax], 3
.L13:
	cmp	DWORD PTR [rbx], 2
	jg	.L15
	mov	DWORD PTR [rbx], 3
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L26:
	mov	eax, DWORD PTR [rbx]
	test	eax, eax
	jg	.L1
	mov	DWORD PTR [rbx], 1
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L25:
	.cfi_restore_state
	mov	DWORD PTR [rbx], 3
	jmp	.L10
	.cfi_endproc
.LFE0:
	.size	cms_sd_set_version, .-cms_sd_set_version
	.comm	NID_pkcs7_data,8,8
	.comm	CMS_SIGNERINFO_KEYIDENTIFIER,8,8
	.comm	CMS_REVCHOICE_OTHER,8,8
	.comm	CMS_CERTCHOICE_V2ACERT,8,8
	.comm	CMS_CERTCHOICE_V1ACERT,8,8
	.comm	CMS_CERTCHOICE_OTHER,8,8
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_cms_sd.c_cms_sd_set_version.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	cms_sd_set_version, %function
cms_sd_set_version:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r5, #0
	mov	r4, r0
	ldr	r6, .L25
	ldr	r7, .L25+4
	ldr	r8, .L25+8
	b	.L2
.L3:
	ldr	r2, [r7]
	cmp	r3, r2
	beq	.L21
	ldr	r2, [r8]
	cmp	r3, r2
	bne	.L4
	ldr	r3, [r4]
	cmp	r3, #2
	movle	r3, #3
	strle	r3, [r4]
.L4:
	add	r5, r5, #1
.L2:
	ldr	r0, [r4, #16]
	bl	sk_CMS_CertificateChoices_num
	cmp	r0, r5
	ble	.L22
	mov	r1, r5
	ldr	r0, [r4, #16]
	bl	sk_CMS_CertificateChoices_value
	ldr	r2, [r6]
	ldr	r3, [r0]
	cmp	r3, r2
	bne	.L3
	ldr	r3, [r4]
	cmp	r3, #4
	movle	r3, #5
	strle	r3, [r4]
	b	.L4
.L21:
	ldr	r3, [r4]
	cmp	r3, #3
	movle	r3, #4
	strle	r3, [r4]
	b	.L4
.L22:
	mov	r5, #0
	mov	r7, #5
	ldr	r6, .L25+12
.L7:
	ldr	r0, [r4, #12]
	bl	sk_CMS_RevocationInfoChoice_num
	cmp	r0, r5
	ble	.L23
.L9:
	mov	r1, r5
	ldr	r0, [r4, #12]
	bl	sk_CMS_RevocationInfoChoice_value
	ldr	r3, [r6]
	ldr	r2, [r0]
	add	r5, r5, #1
	cmp	r2, r3
	bne	.L7
	ldr	r3, [r4]
	ldr	r0, [r4, #12]
	cmp	r3, #4
	strle	r7, [r4]
	bl	sk_CMS_RevocationInfoChoice_num
	cmp	r0, r5
	bgt	.L9
.L23:
	ldr	r3, [r4, #8]
	ldr	r0, [r3]
	bl	OBJ_obj2nid
	ldr	r3, .L25+16
	ldr	r3, [r3]
	cmp	r0, r3
	beq	.L10
	ldr	r3, [r4]
	cmp	r3, #2
	movle	r3, #3
	strle	r3, [r4]
.L10:
	mov	r5, #0
	mov	r8, #1
	mov	r7, #3
	ldr	r6, .L25+20
	b	.L11
.L12:
	cmp	r3, #0
	strle	r8, [r0]
.L15:
	add	r5, r5, #1
.L11:
	ldr	r0, [r4, #4]
	bl	sk_CMS_SignerInfo_num
	cmp	r0, r5
	ble	.L24
	mov	r1, r5
	ldr	r0, [r4, #4]
	bl	sk_CMS_SignerInfo_value
	ldr	r2, [r0, #4]
	ldr	r3, [r6]
	ldr	r2, [r2]
	cmp	r2, r3
	ldr	r3, [r0]
	bne	.L12
	cmp	r3, #2
	ldr	r3, [r4]
	strle	r7, [r0]
	cmp	r3, #2
	strle	r7, [r4]
	b	.L15
.L24:
	ldr	r3, [r4]
	cmp	r3, #0
	movle	r3, #1
	strle	r3, [r4]
	pop	{r4, r5, r6, r7, r8, pc}
.L26:
	.align	2
.L25:
	.word	CMS_CERTCHOICE_OTHER
	.word	CMS_CERTCHOICE_V2ACERT
	.word	CMS_CERTCHOICE_V1ACERT
	.word	CMS_REVCHOICE_OTHER
	.word	NID_pkcs7_data
	.word	CMS_SIGNERINFO_KEYIDENTIFIER
	.size	cms_sd_set_version, .-cms_sd_set_version
	.comm	NID_pkcs7_data,4,4
	.comm	CMS_SIGNERINFO_KEYIDENTIFIER,4,4
	.comm	CMS_REVCHOICE_OTHER,4,4
	.comm	CMS_CERTCHOICE_V2ACERT,4,4
	.comm	CMS_CERTCHOICE_V1ACERT,4,4
	.comm	CMS_CERTCHOICE_OTHER,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
