	.file	"extr_integrity.c_test_get_certificate.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"Unable to open %s, skipping test\n"
	.align 8
.LC1:
	.string	"ImageGetCertificateData gave unexpected result; ret=%d / err=%x\n"
	.align 8
.LC2:
	.string	"Unable to allocate memory, skipping test\n"
	.align 8
.LC3:
	.string	"Unable to retrieve certificate; err=%x\n"
	.align 8
.LC4:
	.string	"Certificate retrieved did not match original\n"
	.text
	.p2align 4
	.type	test_get_certificate, @function
test_get_certificate:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xor	ecx, ecx
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14, rdi
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13d, esi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 32
	.cfi_def_cfa_offset 88
	mov	edx, DWORD PTR FILE_SHARE_READ[rip]
	mov	esi, DWORD PTR GENERIC_READ[rip]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 16[rsp], rax
	xor	eax, eax
	mov	r9d, DWORD PTR FILE_ATTRIBUTE_NORMAL[rip]
	mov	QWORD PTR 8[rsp], 0
	mov	r8d, DWORD PTR OPEN_EXISTING[rip]
	mov	edi, DWORD PTR test_dll_path[rip]
	push	0
	.cfi_def_cfa_offset 96
	call	CreateFileA@PLT
	cmp	QWORD PTR INVALID_HANDLE_VALUE[rip], rax
	pop	rdx
	.cfi_def_cfa_offset 88
	pop	rcx
	.cfi_def_cfa_offset 80
	je	.L11
	mov	r15, rsp
	xor	edx, edx
	mov	rdi, rax
	mov	esi, r13d
	mov	rcx, r15
	mov	rbp, rax
	call	pImageGetCertificateData@PLT
	mov	r12d, eax
	xor	eax, eax
	call	GetLastError@PLT
	xor	edi, edi
	cmp	DWORD PTR FALSE[rip], r12d
	mov	rcx, rax
	jne	.L4
	xor	edi, edi
	cmp	QWORD PTR ERROR_INSUFFICIENT_BUFFER[rip], rax
	sete	dil
.L4:
	mov	edx, r12d
	lea	rsi, .LC1[rip]
	xor	eax, eax
	call	ok@PLT
	mov	r12d, DWORD PTR HEAP_ZERO_MEMORY[rip]
	mov	rbx, QWORD PTR [rsp]
	xor	eax, eax
	call	GetProcessHeap@PLT
	mov	edi, eax
	mov	esi, r12d
	mov	rdx, rbx
	call	HeapAlloc@PLT
	mov	r12, rax
	test	rax, rax
	je	.L12
	mov	rcx, r15
	mov	esi, r13d
	mov	rdx, rax
	mov	rdi, rbp
	call	pImageGetCertificateData@PLT
	mov	r13d, eax
	xor	eax, eax
	call	GetLastError@PLT
	lea	rsi, .LC3[rip]
	mov	edi, r13d
	mov	rdx, rax
	xor	eax, eax
	call	ok@PLT
	mov	rax, QWORD PTR [rsp]
	mov	edi, DWORD PTR [r12]
	mov	rsi, r14
	lea	rdx, -4[rax]
	call	memcmp@PLT
	xor	edi, edi
	lea	rsi, .LC4[rip]
	test	rax, rax
	sete	dil
	xor	eax, eax
	call	ok@PLT
	xor	eax, eax
	call	GetProcessHeap@PLT
	mov	rdx, r12
	xor	esi, esi
	mov	edi, eax
	call	HeapFree@PLT
	mov	rdi, rbp
	call	CloseHandle@PLT
.L1:
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L13
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	mov	esi, DWORD PTR test_dll_path[rip]
	lea	rdi, .LC0[rip]
	xor	eax, eax
	call	skip@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L12:
	lea	rdi, .LC2[rip]
	xor	eax, eax
	call	skip@PLT
	mov	rdi, rbp
	call	CloseHandle@PLT
	jmp	.L1
.L13:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	test_get_certificate, .-test_get_certificate
	.comm	test_dll_path,4,4
	.comm	OPEN_EXISTING,4,4
	.comm	INVALID_HANDLE_VALUE,8,8
	.comm	HEAP_ZERO_MEMORY,4,4
	.comm	GENERIC_READ,4,4
	.comm	FILE_SHARE_READ,4,4
	.comm	FILE_ATTRIBUTE_NORMAL,4,4
	.comm	FALSE,4,4
	.comm	ERROR_INSUFFICIENT_BUFFER,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_integrity.c_test_get_certificate.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Unable to open %s, skipping test\012\000"
	.align	2
.LC1:
	.ascii	"ImageGetCertificateData gave unexpected result; ret"
	.ascii	"=%d / err=%x\012\000"
	.align	2
.LC2:
	.ascii	"Unable to allocate memory, skipping test\012\000"
	.align	2
.LC3:
	.ascii	"Unable to retrieve certificate; err=%x\012\000"
	.align	2
.LC4:
	.ascii	"Certificate retrieved did not match original\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC5:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	test_get_certificate, %function
test_get_certificate:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r4, #0
	ldr	r2, .L14
	ldr	r3, .L14+4
	mov	r7, r0
	ldr	r3, [r3]
	ldr	r0, [r2]
	sub	sp, sp, #24
	mov	r6, r1
	ldr	r2, .L14+8
	ldr	r1, .L14+12
	ldr	r8, .L14+16
	str	r3, [sp]
	str	r0, [sp, #4]
	str	r4, [sp, #8]
	ldr	ip, .L14+20
	mov	r3, r4
	ldr	r2, [r2]
	ldr	r1, [r1]
	ldr	r0, [r8]
	ldr	ip, [ip]
	str	ip, [sp, #20]
	mov	ip,#0
	str	r4, [sp, #16]
	bl	CreateFileA
	ldr	r3, .L14+24
	ldr	r3, [r3]
	cmp	r3, r0
	beq	.L11
	mov	r2, r4
	mov	r1, r6
	add	r3, sp, #16
	mov	r5, r0
	bl	pImageGetCertificateData
	mov	r8, r0
	bl	GetLastError
	ldr	r2, .L14+28
	mov	r3, r0
	ldr	r2, [r2]
	ldr	r1, .L14+32
	cmp	r2, r8
	ldreq	r2, .L14+36
	movne	r0, r4
	ldreq	r4, [r2]
	mov	r2, r8
	subeq	r0, r4, r0
	clzeq	r0, r0
	lsreq	r0, r0, #5
	bl	ok
	bl	GetProcessHeap
	ldr	r3, .L14+40
	ldr	r2, [sp, #16]
	ldr	r1, [r3]
	bl	HeapAlloc
	subs	r4, r0, #0
	beq	.L12
	add	r3, sp, #16
	mov	r1, r6
	mov	r2, r4
	mov	r0, r5
	bl	pImageGetCertificateData
	mov	r6, r0
	bl	GetLastError
	ldr	r1, .L14+44
	mov	r2, r0
	mov	r0, r6
	bl	ok
	ldr	r2, [sp, #16]
	mov	r1, r7
	sub	r2, r2, #4
	ldr	r0, [r4]
	bl	memcmp
	clz	r0, r0
	ldr	r1, .L14+48
	lsr	r0, r0, #5
	bl	ok
	bl	GetProcessHeap
	mov	r2, r4
	mov	r1, #0
	bl	HeapFree
	mov	r0, r5
	bl	CloseHandle
.L1:
	ldr	r3, .L14+20
	ldr	r2, [r3]
	ldr	r3, [sp, #20]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L13
	add	sp, sp, #24
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L11:
	ldr	r1, [r8]
	ldr	r0, .L14+52
	bl	skip
	b	.L1
.L12:
	ldr	r0, .L14+56
	bl	skip
	mov	r0, r5
	bl	CloseHandle
	b	.L1
.L13:
	bl	__stack_chk_fail
.L15:
	.align	2
.L14:
	.word	FILE_ATTRIBUTE_NORMAL
	.word	OPEN_EXISTING
	.word	FILE_SHARE_READ
	.word	GENERIC_READ
	.word	test_dll_path
	.word	.LC5
	.word	INVALID_HANDLE_VALUE
	.word	FALSE
	.word	.LC1
	.word	ERROR_INSUFFICIENT_BUFFER
	.word	HEAP_ZERO_MEMORY
	.word	.LC3
	.word	.LC4
	.word	.LC0
	.word	.LC2
	.size	test_get_certificate, .-test_get_certificate
	.comm	test_dll_path,4,4
	.comm	OPEN_EXISTING,4,4
	.comm	INVALID_HANDLE_VALUE,4,4
	.comm	HEAP_ZERO_MEMORY,4,4
	.comm	GENERIC_READ,4,4
	.comm	FILE_SHARE_READ,4,4
	.comm	FILE_ATTRIBUTE_NORMAL,4,4
	.comm	FALSE,4,4
	.comm	ERROR_INSUFFICIENT_BUFFER,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
