	.file	"extr_security.c_test_process_security_child.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"OpenProcess(PROCESS_TERMINATE) with err:%d\n"
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"duplicating handle err:%d\n"
	.section	.rodata.str1.8
	.align 8
.LC2:
	.string	"duplicating handle should have failed with STATUS_ACCESS_DENIED, instead of err:%d\n"
	.align 8
.LC3:
	.string	"OpenProcess(PROCESS_VM_READ) should have failed\n"
	.align 8
.LC4:
	.string	"OpenProcess(PROCESS_ALL_ACCESS) should have failed\n"
	.align 8
.LC5:
	.string	"OpenThread(THREAD_TERMINATE) with err:%d\n"
	.align 8
.LC6:
	.string	"OpenThread(THREAD_SET_THREAD_TOKEN) should have failed\n"
	.text
	.p2align 4
	.type	test_process_security_child, @function
test_process_security_child:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	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, 40
	.cfi_def_cfa_offset 96
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	lea	r12, 16[rsp]
	call	GetCurrentProcessId@PLT
	mov	esi, DWORD PTR FALSE[rip]
	mov	edi, DWORD PTR PROCESS_TERMINATE[rip]
	mov	edx, eax
	call	OpenProcess@PLT
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	call	GetLastError@PLT
	xor	edi, edi
	cmp	QWORD PTR 8[rsp], 0
	lea	rsi, .LC0[rip]
	setne	dil
	mov	rdx, rax
	xor	eax, eax
	call	ok@PLT
	mov	rdi, QWORD PTR 8[rsp]
	mov	esi, DWORD PTR PROCESS_TERMINATE[rip]
	call	TEST_GRANTED_ACCESS@PLT
	xor	eax, eax
	mov	r14d, DWORD PTR DUPLICATE_SAME_ACCESS[rip]
	mov	ebx, DWORD PTR TRUE[rip]
	call	GetCurrentProcess@PLT
	mov	rbp, QWORD PTR 8[rsp]
	mov	r13, rax
	xor	eax, eax
	call	GetCurrentProcess@PLT
	sub	rsp, 8
	.cfi_def_cfa_offset 104
	mov	r9d, ebx
	xor	r8d, r8d
	push	r14
	.cfi_def_cfa_offset 112
	mov	rcx, r12
	mov	rdx, r13
	mov	rsi, rbp
	mov	rdi, rax
	call	DuplicateHandle@PLT
	mov	ebp, eax
	xor	eax, eax
	call	GetLastError@PLT
	mov	edi, ebp
	lea	rsi, .LC1[rip]
	mov	rdx, rax
	xor	eax, eax
	call	ok@PLT
	mov	esi, DWORD PTR PROCESS_TERMINATE[rip]
	mov	rdi, QWORD PTR 32[rsp]
	call	TEST_GRANTED_ACCESS@PLT
	mov	rdi, QWORD PTR 32[rsp]
	call	CloseHandle@PLT
	mov	edi, -559038737
	call	SetLastError@PLT
	xor	eax, eax
	mov	r14d, DWORD PTR TRUE[rip]
	mov	ebx, DWORD PTR PROCESS_ALL_ACCESS[rip]
	call	GetCurrentProcess@PLT
	mov	rbp, QWORD PTR 24[rsp]
	mov	r13, rax
	xor	eax, eax
	call	GetCurrentProcess@PLT
	mov	rsi, rbp
	mov	rcx, r12
	mov	rdx, r13
	mov	rdi, rax
	mov	r9d, r14d
	mov	r8d, ebx
	mov	DWORD PTR [rsp], 0
	call	DuplicateHandle@PLT
	mov	ebp, eax
	xor	eax, eax
	call	GetLastError@PLT
	pop	rcx
	.cfi_def_cfa_offset 104
	xor	edi, edi
	pop	rsi
	.cfi_def_cfa_offset 96
	mov	rdx, rax
	test	ebp, ebp
	jne	.L2
	xor	edi, edi
	cmp	QWORD PTR ERROR_ACCESS_DENIED[rip], rax
	sete	dil
.L2:
	lea	rsi, .LC2[rip]
	xor	eax, eax
	lea	r14, 8[rsp]
	call	ok@PLT
	mov	rdi, QWORD PTR 8[rsp]
	call	CloseHandle@PLT
	xor	eax, eax
	call	GetCurrentProcessId@PLT
	mov	esi, DWORD PTR FALSE[rip]
	mov	edi, DWORD PTR PROCESS_VM_READ[rip]
	mov	edx, eax
	call	OpenProcess@PLT
	xor	edi, edi
	lea	rsi, .LC3[rip]
	test	rax, rax
	mov	QWORD PTR 8[rsp], rax
	sete	dil
	xor	eax, eax
	call	ok@PLT
	xor	eax, eax
	call	GetCurrentProcessId@PLT
	mov	esi, DWORD PTR FALSE[rip]
	mov	edi, DWORD PTR PROCESS_ALL_ACCESS[rip]
	mov	edx, eax
	call	OpenProcess@PLT
	xor	edi, edi
	lea	rsi, .LC4[rip]
	test	rax, rax
	mov	QWORD PTR 8[rsp], rax
	sete	dil
	xor	eax, eax
	call	ok@PLT
	xor	eax, eax
	mov	r15d, DWORD PTR DUPLICATE_SAME_ACCESS[rip]
	mov	ebx, DWORD PTR TRUE[rip]
	call	GetCurrentProcess@PLT
	mov	r13, rax
	xor	eax, eax
	call	GetCurrentProcess@PLT
	mov	rbp, rax
	xor	eax, eax
	call	GetCurrentProcess@PLT
	sub	rsp, 8
	.cfi_def_cfa_offset 104
	mov	r9d, ebx
	xor	r8d, r8d
	push	r15
	.cfi_def_cfa_offset 112
	mov	rcx, r14
	mov	rdx, r13
	mov	rsi, rbp
	mov	rdi, rax
	call	DuplicateHandle@PLT
	mov	ebp, eax
	xor	eax, eax
	call	GetLastError@PLT
	mov	edi, ebp
	lea	rsi, .LC1[rip]
	mov	rdx, rax
	xor	eax, eax
	call	ok@PLT
	mov	esi, DWORD PTR PROCESS_ALL_ACCESS_NT4[rip]
	mov	rdi, QWORD PTR 24[rsp]
	mov	edx, DWORD PTR STANDARD_RIGHTS_ALL[rip]
	or	edx, DWORD PTR SPECIFIC_RIGHTS_ALL[rip]
	call	TEST_GRANTED_ACCESS2@PLT
	mov	rdi, QWORD PTR 24[rsp]
	call	CloseHandle@PLT
	xor	eax, eax
	mov	ebx, DWORD PTR PROCESS_ALL_ACCESS[rip]
	mov	r15d, DWORD PTR TRUE[rip]
	call	GetCurrentProcess@PLT
	mov	r13, rax
	xor	eax, eax
	call	GetCurrentProcess@PLT
	mov	rbp, rax
	xor	eax, eax
	call	GetCurrentProcess@PLT
	mov	r8d, ebx
	mov	rcx, r14
	mov	r9d, r15d
	mov	rdx, r13
	mov	rsi, rbp
	mov	rdi, rax
	mov	DWORD PTR [rsp], 0
	call	DuplicateHandle@PLT
	mov	ebp, eax
	xor	eax, eax
	call	GetLastError@PLT
	mov	edi, ebp
	lea	rsi, .LC1[rip]
	mov	rdx, rax
	xor	eax, eax
	call	ok@PLT
	mov	rdi, QWORD PTR 24[rsp]
	mov	esi, DWORD PTR PROCESS_ALL_ACCESS_NT4[rip]
	mov	edx, DWORD PTR PROCESS_ALL_ACCESS[rip]
	or	edx, DWORD PTR PROCESS_QUERY_LIMITED_INFORMATION[rip]
	call	TEST_GRANTED_ACCESS2@PLT
	xor	eax, eax
	mov	ebx, DWORD PTR TRUE[rip]
	mov	r14d, DWORD PTR PROCESS_VM_READ[rip]
	call	GetCurrentProcess@PLT
	mov	rbp, QWORD PTR 24[rsp]
	mov	r13, rax
	xor	eax, eax
	call	GetCurrentProcess@PLT
	mov	r9d, ebx
	mov	r8d, r14d
	mov	rcx, r12
	mov	rsi, rbp
	mov	rdi, rax
	mov	rdx, r13
	mov	DWORD PTR [rsp], 0
	call	DuplicateHandle@PLT
	mov	ebp, eax
	xor	eax, eax
	call	GetLastError@PLT
	lea	rsi, .LC1[rip]
	mov	edi, ebp
	mov	rdx, rax
	xor	eax, eax
	call	ok@PLT
	mov	esi, DWORD PTR PROCESS_VM_READ[rip]
	mov	rdi, QWORD PTR 32[rsp]
	call	TEST_GRANTED_ACCESS@PLT
	mov	rdi, QWORD PTR 32[rsp]
	call	CloseHandle@PLT
	mov	rdi, QWORD PTR 24[rsp]
	call	CloseHandle@PLT
	xor	eax, eax
	call	GetCurrentThreadId@PLT
	mov	esi, DWORD PTR FALSE[rip]
	mov	edi, DWORD PTR THREAD_TERMINATE[rip]
	mov	edx, eax
	call	OpenThread@PLT
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	call	GetLastError@PLT
	xor	edi, edi
	cmp	QWORD PTR 24[rsp], 0
	lea	rsi, .LC5[rip]
	setne	dil
	mov	rdx, rax
	xor	eax, eax
	call	ok@PLT
	mov	esi, DWORD PTR PROCESS_TERMINATE[rip]
	mov	rdi, QWORD PTR 24[rsp]
	call	TEST_GRANTED_ACCESS@PLT
	mov	rdi, QWORD PTR 24[rsp]
	call	CloseHandle@PLT
	xor	eax, eax
	call	GetCurrentThreadId@PLT
	mov	esi, DWORD PTR FALSE[rip]
	mov	edi, DWORD PTR THREAD_SET_THREAD_TOKEN[rip]
	mov	edx, eax
	call	OpenThread@PLT
	xor	edi, edi
	lea	rsi, .LC6[rip]
	test	rax, rax
	mov	QWORD PTR 24[rsp], rax
	sete	dil
	xor	eax, eax
	call	ok@PLT
	pop	rax
	.cfi_def_cfa_offset 104
	pop	rdx
	.cfi_def_cfa_offset 96
	mov	rax, QWORD PTR 24[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L8
	add	rsp, 40
	.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
.L8:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	test_process_security_child, .-test_process_security_child
	.comm	TRUE,4,4
	.comm	THREAD_TERMINATE,4,4
	.comm	THREAD_SET_THREAD_TOKEN,4,4
	.comm	STANDARD_RIGHTS_ALL,4,4
	.comm	SPECIFIC_RIGHTS_ALL,4,4
	.comm	PROCESS_VM_READ,4,4
	.comm	PROCESS_TERMINATE,4,4
	.comm	PROCESS_QUERY_LIMITED_INFORMATION,4,4
	.comm	PROCESS_ALL_ACCESS_NT4,4,4
	.comm	PROCESS_ALL_ACCESS,4,4
	.comm	FALSE,4,4
	.comm	ERROR_ACCESS_DENIED,8,8
	.comm	DUPLICATE_SAME_ACCESS,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_security.c_test_process_security_child.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"OpenProcess(PROCESS_TERMINATE) with err:%d\012\000"
	.align	2
.LC1:
	.ascii	"duplicating handle err:%d\012\000"
	.align	2
.LC2:
	.ascii	"duplicating handle should have failed with STATUS_A"
	.ascii	"CCESS_DENIED, instead of err:%d\012\000"
	.align	2
.LC3:
	.ascii	"OpenProcess(PROCESS_VM_READ) should have failed\012"
	.ascii	"\000"
	.align	2
.LC4:
	.ascii	"OpenProcess(PROCESS_ALL_ACCESS) should have failed\012"
	.ascii	"\000"
	.align	2
.LC5:
	.ascii	"OpenThread(THREAD_TERMINATE) with err:%d\012\000"
	.align	2
.LC6:
	.ascii	"OpenThread(THREAD_SET_THREAD_TOKEN) should have fai"
	.ascii	"led\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC7:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	test_process_security_child, %function
test_process_security_child:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r3, .L8
	ldr	r4, .L8+4
	ldr	r6, .L8+8
	sub	sp, sp, #44
	ldr	r3, [r3]
	str	r3, [sp, #36]
	mov	r3,#0
	ldr	r7, [r4]
	ldr	r5, [r6]
	bl	GetCurrentProcessId
	mov	r1, r7
	mov	r2, r0
	mov	r0, r5
	bl	OpenProcess
	mov	r5, r0
	str	r0, [sp, #28]
	bl	GetLastError
	mov	r2, r0
	subs	r0, r5, #0
	movne	r0, #1
	ldr	r1, .L8+12
	bl	ok
	ldr	r1, [r6]
	ldr	r0, [sp, #28]
	bl	TEST_GRANTED_ACCESS
	bl	GetCurrentProcess
	mov	r8, #0
	mov	r7, r0
	ldr	r9, [sp, #28]
	bl	GetCurrentProcess
	ldr	r5, .L8+16
	ldr	r10, .L8+20
	ldr	r3, [r5]
	ldr	ip, [r10]
	mov	r2, r0
	stmib	sp, {r3, ip}
	mov	r1, r9
	add	r3, sp, #32
	str	r8, [sp]
	mov	r0, r7
	bl	DuplicateHandle
	mov	r7, r0
	bl	GetLastError
	ldr	r1, .L8+24
	mov	r2, r0
	mov	r0, r7
	bl	ok
	ldr	r1, [r6]
	ldr	r0, [sp, #32]
	bl	TEST_GRANTED_ACCESS
	ldr	r0, [sp, #32]
	bl	CloseHandle
	ldr	r0, .L8+28
	bl	SetLastError
	bl	GetCurrentProcess
	ldr	fp, [sp, #28]
	mov	r9, r0
	bl	GetCurrentProcess
	ldr	r7, .L8+32
	ldr	ip, [r5]
	ldr	r3, [r7]
	mov	r2, r0
	stm	sp, {r3, ip}
	mov	r1, fp
	add	r3, sp, #32
	str	r8, [sp, #8]
	mov	r0, r9
	bl	DuplicateHandle
	mov	r9, r0
	bl	GetLastError
	cmp	r9, r8
	ldreq	r3, .L8+36
	mov	r2, r0
	ldreq	r8, [r3]
	movne	r0, r8
	subeq	r0, r8, r0
	clzeq	r0, r0
	ldr	r1, .L8+40
	lsreq	r0, r0, #5
	ldr	r8, .L8+44
	bl	ok
	ldr	r0, [sp, #28]
	bl	CloseHandle
	ldr	fp, [r4]
	ldr	r9, [r8]
	bl	GetCurrentProcessId
	mov	r1, fp
	mov	r2, r0
	mov	r0, r9
	bl	OpenProcess
	mov	r3, r0
	clz	r0, r0
	ldr	r1, .L8+48
	lsr	r0, r0, #5
	str	r3, [sp, #28]
	bl	ok
	ldr	r9, [r7]
	ldr	fp, [r4]
	bl	GetCurrentProcessId
	mov	r1, fp
	mov	r2, r0
	mov	r0, r9
	bl	OpenProcess
	mov	r3, r0
	clz	r0, r0
	ldr	r1, .L8+52
	lsr	r0, r0, #5
	str	r3, [sp, #28]
	bl	ok
	bl	GetCurrentProcess
	mov	fp, r0
	bl	GetCurrentProcess
	mov	r9, #0
	str	r0, [sp, #20]
	bl	GetCurrentProcess
	ldr	ip, [r10]
	ldr	r3, [r5]
	mov	r2, r0
	str	ip, [sp, #8]
	ldr	r1, [sp, #20]
	mov	r0, fp
	str	r3, [sp, #4]
	str	r9, [sp]
	add	r3, sp, #28
	bl	DuplicateHandle
	mov	r10, r0
	bl	GetLastError
	ldr	r1, .L8+24
	mov	r2, r0
	mov	r0, r10
	bl	ok
	ldr	r2, .L8+56
	ldr	r3, .L8+60
	ldr	r2, [r2]
	ldr	r3, [r3]
	ldr	fp, .L8+64
	orr	r2, r2, r3
	ldr	r1, [fp]
	ldr	r0, [sp, #28]
	bl	TEST_GRANTED_ACCESS2
	ldr	r0, [sp, #28]
	bl	CloseHandle
	bl	GetCurrentProcess
	mov	r10, r0
	bl	GetCurrentProcess
	str	r0, [sp, #20]
	bl	GetCurrentProcess
	ldr	lr, [r7]
	ldr	ip, [r5]
	mov	r2, r0
	str	lr, [sp]
	str	ip, [sp, #4]
	add	r3, sp, #28
	ldr	r1, [sp, #20]
	mov	r0, r10
	str	r9, [sp, #8]
	bl	DuplicateHandle
	mov	r10, r0
	bl	GetLastError
	ldr	r1, .L8+24
	mov	r2, r0
	mov	r0, r10
	bl	ok
	ldr	r3, .L8+68
	ldr	r2, [r7]
	ldr	r3, [r3]
	ldr	r1, [fp]
	orr	r2, r2, r3
	ldr	r0, [sp, #28]
	bl	TEST_GRANTED_ACCESS2
	bl	GetCurrentProcess
	ldr	r10, [sp, #28]
	mov	r7, r0
	bl	GetCurrentProcess
	ldr	ip, [r8]
	ldr	r3, [r5]
	mov	r2, r0
	str	ip, [sp]
	mov	r1, r10
	mov	r0, r7
	str	r3, [sp, #4]
	str	r9, [sp, #8]
	add	r3, sp, #32
	bl	DuplicateHandle
	mov	r5, r0
	bl	GetLastError
	ldr	r1, .L8+24
	mov	r2, r0
	mov	r0, r5
	bl	ok
	ldr	r1, [r8]
	ldr	r0, [sp, #32]
	bl	TEST_GRANTED_ACCESS
	ldr	r0, [sp, #32]
	bl	CloseHandle
	ldr	r0, [sp, #28]
	bl	CloseHandle
	ldr	r3, .L8+72
	ldr	r7, [r4]
	ldr	r5, [r3]
	bl	GetCurrentThreadId
	mov	r1, r7
	mov	r2, r0
	mov	r0, r5
	bl	OpenThread
	mov	r5, r0
	str	r0, [sp, #28]
	bl	GetLastError
	mov	r2, r0
	subs	r0, r5, r9
	movne	r0, #1
	ldr	r1, .L8+76
	bl	ok
	ldr	r1, [r6]
	ldr	r0, [sp, #28]
	bl	TEST_GRANTED_ACCESS
	ldr	r0, [sp, #28]
	bl	CloseHandle
	ldr	r3, .L8+80
	ldr	r5, [r4]
	ldr	r4, [r3]
	bl	GetCurrentThreadId
	mov	r1, r5
	mov	r2, r0
	mov	r0, r4
	bl	OpenThread
	mov	r3, r0
	clz	r0, r0
	ldr	r1, .L8+84
	lsr	r0, r0, #5
	str	r3, [sp, #28]
	bl	ok
	ldr	r3, .L8
	ldr	r2, [r3]
	ldr	r3, [sp, #36]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L7
	add	sp, sp, #44
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L7:
	bl	__stack_chk_fail
.L9:
	.align	2
.L8:
	.word	.LC7
	.word	FALSE
	.word	PROCESS_TERMINATE
	.word	.LC0
	.word	TRUE
	.word	DUPLICATE_SAME_ACCESS
	.word	.LC1
	.word	-559038737
	.word	PROCESS_ALL_ACCESS
	.word	ERROR_ACCESS_DENIED
	.word	.LC2
	.word	PROCESS_VM_READ
	.word	.LC3
	.word	.LC4
	.word	STANDARD_RIGHTS_ALL
	.word	SPECIFIC_RIGHTS_ALL
	.word	PROCESS_ALL_ACCESS_NT4
	.word	PROCESS_QUERY_LIMITED_INFORMATION
	.word	THREAD_TERMINATE
	.word	.LC5
	.word	THREAD_SET_THREAD_TOKEN
	.word	.LC6
	.size	test_process_security_child, .-test_process_security_child
	.comm	TRUE,4,4
	.comm	THREAD_TERMINATE,4,4
	.comm	THREAD_SET_THREAD_TOKEN,4,4
	.comm	STANDARD_RIGHTS_ALL,4,4
	.comm	SPECIFIC_RIGHTS_ALL,4,4
	.comm	PROCESS_VM_READ,4,4
	.comm	PROCESS_TERMINATE,4,4
	.comm	PROCESS_QUERY_LIMITED_INFORMATION,4,4
	.comm	PROCESS_ALL_ACCESS_NT4,4,4
	.comm	PROCESS_ALL_ACCESS,4,4
	.comm	FALSE,4,4
	.comm	ERROR_ACCESS_DENIED,4,4
	.comm	DUPLICATE_SAME_ACCESS,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
