	.file	"extr_ubc_subr.c_cs_blob_create_validated.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"CODESIGNING: csblob invalid: %d\n"
	.align 8
.LC1:
	.string	"validated CodeDirectory but unsupported type"
	.text
	.p2align 4
	.globl	cs_blob_create_validated
	.type	cs_blob_create_validated, @function
cs_blob_create_validated:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r15
	.cfi_offset 15, -24
	mov	r15, rsi
	push	r14
	.cfi_offset 14, -32
	mov	r14, rdi
	push	r13
	push	r12
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	mov	r12, rcx
	push	rbx
	.cfi_offset 3, -56
	mov	rbx, rdx
	sub	rsp, 88
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	test	rdx, rdx
	je	.L2
	mov	QWORD PTR [rdx], 0
.L2:
	mov	edi, 128
	call	kalloc@PLT
	mov	r13, rax
	test	rax, rax
	jne	.L3
	mov	r15d, DWORD PTR ENOMEM[rip]
.L1:
	mov	rax, QWORD PTR -56[rbp]
	xor	rax, QWORD PTR fs:40
	jne	.L37
	lea	rsp, -40[rbp]
	mov	eax, r15d
	pop	rbx
	pop	r12
	pop	r13
	pop	r14
	pop	r15
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	mov	QWORD PTR 120[rax], r15
	mov	rsi, r15
	lea	rcx, -64[rbp]
	lea	rdx, -72[rbp]
	mov	QWORD PTR 112[rax], 0
	mov	QWORD PTR -88[rbp], rax
	mov	rax, QWORD PTR [r14]
	mov	QWORD PTR 96[r13], 0
	mov	QWORD PTR 64[r13], rax
	mov	eax, DWORD PTR CS_SIGNER_TYPE_UNKNOWN[rip]
	mov	QWORD PTR 88[r13], 0
	mov	DWORD PTR 104[r13], eax
	mov	QWORD PTR 80[r13], 0
	mov	QWORD PTR 48[r13], 0
	mov	QWORD PTR 72[r13], 0
	mov	QWORD PTR 0[r13], 0
	mov	QWORD PTR [r14], 0
	mov	rdi, QWORD PTR 64[r13]
	call	cs_validate_csblob@PLT
	mov	r15d, eax
	test	eax, eax
	je	.L5
	cmp	QWORD PTR cs_debug[rip], 0
	jne	.L38
.L6:
	mov	rdi, r13
	call	cs_blob_free@PLT
	mov	QWORD PTR -72[rbp], 0
	mov	QWORD PTR -88[rbp], 0
.L7:
	test	rbx, rbx
	je	.L15
	mov	rax, QWORD PTR -88[rbp]
	mov	QWORD PTR [rbx], rax
.L15:
	test	r12, r12
	je	.L1
	mov	rax, QWORD PTR -72[rbp]
	mov	QWORD PTR [r12], rax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L5:
	movsx	rdx, DWORD PTR CS_HASH_MAX_SIZE[rip]
	mov	rsi, rsp
	mov	QWORD PTR -96[rbp], rsp
	lea	r14, 0[0+rdx*4]
	lea	rax, 15[r14]
	mov	rcx, rax
	and	rax, -4096
	sub	rsi, rax
	and	rcx, -16
	mov	rax, rsi
.L8:
	cmp	rsp, rax
	je	.L9
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L38:
	mov	esi, eax
	lea	rdi, .LC0[rip]
	call	printf@PLT
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L9:
	and	ecx, 4095
	sub	rsp, rcx
	test	rcx, rcx
	jne	.L39
.L10:
	mov	rax, QWORD PTR -72[rbp]
	mov	rcx, QWORD PTR -64[rbp]
	mov	QWORD PTR -120[rbp], rsp
	mov	QWORD PTR 56[r13], rax
	mov	edi, DWORD PTR 24[rax]
	mov	QWORD PTR 48[r13], rcx
	call	cs_find_md@PLT
	mov	QWORD PTR 32[r13], rax
	test	rax, rax
	je	.L11
	movsx	rax, DWORD PTR [rax]
	cmp	rax, r14
	jbe	.L12
.L11:
	lea	rdi, .LC1[rip]
	call	panic@PLT
.L12:
	mov	rdx, QWORD PTR -72[rbp]
	mov	eax, 1
	mov	ecx, DWORD PTR [rdx]
	mov	edi, DWORD PTR 20[rdx]
	mov	QWORD PTR 40[r13], 0
	sal	eax, cl
	mov	DWORD PTR 8[r13], ecx
	mov	DWORD PTR 12[r13], eax
	sub	eax, 1
	mov	DWORD PTR 16[r13], eax
	call	ntohl@PLT
	and	eax, DWORD PTR CS_ALLOWED_MACHO[rip]
	or	eax, DWORD PTR CS_VALID[rip]
	mov	DWORD PTR 0[r13], eax
	mov	rax, QWORD PTR -72[rbp]
	mov	edi, DWORD PTR 16[rax]
	call	ntohl@PLT
	mov	edx, DWORD PTR 16[r13]
	add	eax, edx
	not	edx
	and	eax, edx
	mov	DWORD PTR 20[r13], eax
	mov	rax, QWORD PTR -72[rbp]
	mov	edi, DWORD PTR 12[rax]
	call	ntohl@PLT
	cmp	eax, DWORD PTR CS_SUPPORTSSCATTER[rip]
	jge	.L40
.L13:
	mov	DWORD PTR 24[r13], 0
.L14:
	mov	rsi, QWORD PTR -72[rbp]
	lea	r14, -76[rbp]
	mov	edi, DWORD PTR 4[rsi]
	mov	QWORD PTR -112[rbp], rsi
	call	ntohl@PLT
	mov	rdi, r14
	mov	DWORD PTR -100[rbp], eax
	mov	rax, QWORD PTR 32[r13]
	call	[QWORD PTR 24[rax]]
	mov	rax, QWORD PTR 32[r13]
	mov	edx, DWORD PTR -100[rbp]
	mov	rdi, r14
	mov	rsi, QWORD PTR -112[rbp]
	call	[QWORD PTR 16[rax]]
	mov	rsi, r14
	mov	rax, QWORD PTR 32[r13]
	mov	r14, QWORD PTR -120[rbp]
	mov	rdi, r14
	call	[QWORD PTR 8[rax]]
	mov	edi, DWORD PTR 28[r13]
	mov	edx, DWORD PTR CS_CDHASH_LEN[rip]
	mov	rsi, r14
	call	memcpy@PLT
	mov	rsp, QWORD PTR -96[rbp]
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L40:
	mov	rax, QWORD PTR -72[rbp]
	mov	edi, DWORD PTR 8[rax]
	call	ntohl@PLT
	test	eax, eax
	je	.L13
	mov	r14, QWORD PTR -72[rbp]
	mov	edi, DWORD PTR 8[r14]
	call	ntohl@PLT
	cdqe
	mov	edi, DWORD PTR [r14+rax]
	call	ntohl@PLT
	imul	eax, DWORD PTR 12[r13]
	mov	DWORD PTR 24[r13], eax
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L39:
	or	QWORD PTR -8[rsp+rcx], 0
	jmp	.L10
.L37:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	cs_blob_create_validated, .-cs_blob_create_validated
	.comm	cs_debug,8,8
	.comm	ENOMEM,4,4
	.comm	EINVAL,4,4
	.comm	CS_VALID,4,4
	.comm	CS_SUPPORTSSCATTER,4,4
	.comm	CS_SIGNER_TYPE_UNKNOWN,4,4
	.comm	CS_HASH_MAX_SIZE,4,4
	.comm	CS_CDHASH_LEN,4,4
	.comm	CS_ALLOWED_MACHO,4,4
	.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_ubc_subr.c_cs_blob_create_validated.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"CODESIGNING: csblob invalid: %d\012\000"
	.align	2
.LC1:
	.ascii	"validated CodeDirectory but unsupported type\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	cs_blob_create_validated
	.syntax unified
	.arm
	.fpu softvfp
	.type	cs_blob_create_validated, %function
cs_blob_create_validated:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	add	fp, sp, #32
	sub	sp, sp, #28
	mov	r8, r3
	ldr	r3, .L37
	subs	r5, r2, #0
	ldr	r3, [r3]
	str	r3, [fp, #-40]
	mov	r3,#0
	movne	r3, #0
	mov	r7, r0
	strne	r3, [r5]
	mov	r0, #80
	mov	r6, r1
	bl	kalloc
	subs	r4, r0, #0
	bne	.L3
	ldr	r3, .L37+4
	ldr	r6, [r3]
.L1:
	ldr	r3, .L37
	ldr	r2, [r3]
	ldr	r3, [fp, #-40]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L34
	mov	r0, r6
	sub	sp, fp, #32
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L3:
	mov	ip, #0
	ldr	r3, .L37+8
	str	r6, [r4, #76]
	str	ip, [r4, #72]
	ldr	r2, [r7]
	ldr	r3, [r3]
	str	r2, [r4, #48]
	str	r3, [r4, #68]
	str	ip, [r4]
	str	ip, [r4, #64]
	str	ip, [r4, #60]
	str	ip, [r4, #56]
	str	ip, [r4, #40]
	str	ip, [r4, #52]
	str	ip, [r4, #4]
	str	ip, [r7]
	mov	r1, r6
	ldr	r0, [r4, #48]
	sub	r3, fp, #48
	sub	r2, fp, #52
	bl	cs_validate_csblob
	subs	r6, r0, #0
	mov	r7, r4
	beq	.L5
	ldr	r3, .L37+12
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L35
.L6:
	mov	r7, #0
	mov	r0, r4
	bl	cs_blob_free
	str	r7, [fp, #-52]
.L7:
	cmp	r5, #0
	strne	r7, [r5]
	cmp	r8, #0
	ldrne	r3, [fp, #-52]
	strne	r3, [r8]
	b	.L1
.L5:
	ldr	r3, .L37+16
	ldr	r1, [fp, #-52]
	ldr	r3, [r3]
	ldr	ip, [fp, #-48]
	lsl	r3, r3, #2
	add	r2, r3, #7
	bic	r2, r2, #7
	ldr	r0, [r1, #24]
	mov	r10, sp
	str	r1, [r4, #44]
	sub	sp, sp, r2
	str	ip, [r4, #40]
	str	r3, [fp, #-56]
	bl	cs_find_md
	cmp	r0, #0
	mov	r9, sp
	str	r0, [r4, #32]
	beq	.L8
	ldr	r2, [r0]
	ldr	r3, [fp, #-56]
	cmp	r2, r3
	bls	.L9
.L8:
	ldr	r0, .L37+20
	bl	panic
.L9:
	mov	r3, #1
	mov	ip, #0
	ldr	r1, [fp, #-52]
	ldr	r2, [r1]
	ldr	r0, [r1, #20]
	lsl	r3, r3, r2
	str	r2, [r4, #8]
	sub	r2, r3, #1
	str	ip, [r4, #36]
	str	r3, [r4, #12]
	str	r2, [r4, #16]
	bl	ntohl
	ldr	r3, .L37+24
	ldr	r2, .L37+28
	ldr	r3, [r3]
	ldr	r2, [r2]
	and	r0, r0, r3
	ldr	r3, [fp, #-52]
	orr	r0, r0, r2
	str	r0, [r4]
	ldr	r0, [r3, #16]
	bl	ntohl
	ldr	r3, [r4, #16]
	ldr	r2, [fp, #-52]
	add	r0, r0, r3
	bic	r0, r0, r3
	str	r0, [r4, #20]
	ldr	r0, [r2, #12]
	bl	ntohl
	ldr	r3, .L37+32
	ldr	r3, [r3]
	cmp	r0, r3
	bge	.L36
.L10:
	mov	r3, #0
	str	r3, [r4, #24]
.L11:
	ldr	r1, [fp, #-52]
	ldr	r0, [r1, #4]
	str	r1, [fp, #-60]
	bl	ntohl
	ldr	r3, [r4, #32]
	str	r0, [fp, #-56]
	ldr	r3, [r3, #12]
	sub	r0, fp, #44
	blx	r3
	ldr	r3, [r4, #32]
	ldr	r2, [fp, #-56]
	ldr	r1, [fp, #-60]
	ldr	r3, [r3, #8]
	sub	r0, fp, #44
	blx	r3
	ldr	r3, [r4, #32]
	sub	r1, fp, #44
	ldr	r3, [r3, #4]
	mov	r0, r9
	blx	r3
	ldr	r3, .L37+36
	mov	r1, r9
	ldr	r0, [r4, #28]
	ldr	r2, [r3]
	bl	memcpy
	mov	sp, r10
	b	.L7
.L35:
	mov	r1, r6
	ldr	r0, .L37+40
	bl	printf
	b	.L6
.L36:
	ldr	r3, [fp, #-52]
	ldr	r0, [r3, #8]
	bl	ntohl
	cmp	r0, #0
	beq	.L10
	ldr	r3, [fp, #-52]
	ldr	r0, [r3, #8]
	str	r3, [fp, #-56]
	bl	ntohl
	ldr	r3, [fp, #-56]
	ldr	r0, [r3, r0]
	bl	ntohl
	ldr	r3, [r4, #12]
	mul	r3, r0, r3
	str	r3, [r4, #24]
	b	.L11
.L34:
	bl	__stack_chk_fail
.L38:
	.align	2
.L37:
	.word	.LC2
	.word	ENOMEM
	.word	CS_SIGNER_TYPE_UNKNOWN
	.word	cs_debug
	.word	CS_HASH_MAX_SIZE
	.word	.LC1
	.word	CS_ALLOWED_MACHO
	.word	CS_VALID
	.word	CS_SUPPORTSSCATTER
	.word	CS_CDHASH_LEN
	.word	.LC0
	.size	cs_blob_create_validated, .-cs_blob_create_validated
	.comm	cs_debug,4,4
	.comm	ENOMEM,4,4
	.comm	EINVAL,4,4
	.comm	CS_VALID,4,4
	.comm	CS_SUPPORTSSCATTER,4,4
	.comm	CS_SIGNER_TYPE_UNKNOWN,4,4
	.comm	CS_HASH_MAX_SIZE,4,4
	.comm	CS_CDHASH_LEN,4,4
	.comm	CS_ALLOWED_MACHO,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
