	.file	"875324.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"test1"
.LC1:
	.string	"test2"
.LC2:
	.string	"test3"
.LC3:
	.string	"test4"
.LC4:
	.string	"test5"
.LC5:
	.string	"test6"
	.section	.data.rel.local,"aw"
	.align 32
	.type	fd_list, @object
	.size	fd_list, 144
fd_list:
	.quad	.LC0
	.long	0
	.long	0
	.long	256
	.zero	4
	.quad	.LC1
	.long	500
	.long	0
	.long	256
	.zero	4
	.quad	.LC2
	.long	501
	.long	0
	.long	256
	.zero	4
	.quad	.LC3
	.long	0
	.long	0
	.long	32
	.zero	4
	.quad	.LC4
	.long	0
	.long	500
	.long	32
	.zero	4
	.quad	.LC5
	.long	0
	.long	501
	.long	32
	.zero	4
	.data
	.align 4
	.type	fd_list_count, @object
	.size	fd_list_count, 4
fd_list_count:
	.long	6
	.section	.rodata
.LC6:
	.string	"open"
.LC7:
	.string	"chown"
	.text
	.globl	setup
	.type	setup, @function
setup:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 16
	mov	DWORD PTR -8[rbp], 0
	jmp	.L2
.L6:
	mov	eax, DWORD PTR -8[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 3
	mov	rdx, rax
	lea	rax, fd_list[rip+16]
	mov	edx, DWORD PTR [rdx+rax]
	mov	eax, DWORD PTR -8[rbp]
	movsx	rcx, eax
	mov	rax, rcx
	add	rax, rax
	add	rax, rcx
	sal	rax, 3
	mov	rcx, rax
	lea	rax, fd_list[rip]
	mov	rax, QWORD PTR [rcx+rax]
	mov	esi, 192
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], -1
	jne	.L3
	lea	rdi, .LC6[rip]
	call	perror@PLT
	mov	eax, DWORD PTR -4[rbp]
	jmp	.L4
.L3:
	mov	eax, DWORD PTR -4[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR -8[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 3
	mov	rdx, rax
	lea	rax, fd_list[rip+12]
	mov	edx, DWORD PTR [rdx+rax]
	mov	eax, DWORD PTR -8[rbp]
	movsx	rcx, eax
	mov	rax, rcx
	add	rax, rax
	add	rax, rcx
	sal	rax, 3
	mov	rcx, rax
	lea	rax, fd_list[rip+8]
	mov	ecx, DWORD PTR [rcx+rax]
	mov	eax, DWORD PTR -8[rbp]
	movsx	rsi, eax
	mov	rax, rsi
	add	rax, rax
	add	rax, rsi
	sal	rax, 3
	mov	rsi, rax
	lea	rax, fd_list[rip]
	mov	rax, QWORD PTR [rsi+rax]
	mov	esi, ecx
	mov	rdi, rax
	call	chown@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 0
	je	.L5
	lea	rdi, .LC7[rip]
	call	perror@PLT
	mov	eax, DWORD PTR -4[rbp]
	jmp	.L4
.L5:
	add	DWORD PTR -8[rbp], 1
.L2:
	mov	eax, DWORD PTR fd_list_count[rip]
	cmp	DWORD PTR -8[rbp], eax
	jl	.L6
	mov	eax, 0
.L4:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	setup, .-setup
	.globl	restoreprivilege
	.type	restoreprivilege, @function
restoreprivilege:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 16
	mov	esi, 0
	mov	edi, 0
	call	setreuid@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 0
	je	.L8
	mov	eax, DWORD PTR -4[rbp]
	jmp	.L9
.L8:
	mov	esi, 0
	mov	edi, 0
	call	setregid@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 0
	je	.L10
	mov	eax, DWORD PTR -4[rbp]
	jmp	.L9
.L10:
	mov	eax, 0
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	restoreprivilege, .-restoreprivilege
	.section	.rodata
.LC8:
	.string	"getresuid"
.LC9:
	.string	"getresgid"
.LC10:
	.string	"%s: "
	.align 8
.LC11:
	.string	"ruid: %d, euid: %d, suid: %d,     "
.LC12:
	.string	"rgid: %d, egid: %d, sgid: %d\n"
	.text
	.globl	reportprivilege
	.type	reportprivilege, @function
reportprivilege:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 64
	mov	QWORD PTR -56[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rdx, -28[rbp]
	lea	rcx, -36[rbp]
	lea	rax, -32[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	mov	eax, 0
	call	getresuid@PLT
	mov	DWORD PTR -12[rbp], eax
	cmp	DWORD PTR -12[rbp], 0
	je	.L12
	lea	rdi, .LC8[rip]
	call	perror@PLT
	mov	eax, DWORD PTR -12[rbp]
	jmp	.L16
.L12:
	lea	rdx, -16[rbp]
	lea	rcx, -24[rbp]
	lea	rax, -20[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	mov	eax, 0
	call	getresgid@PLT
	mov	DWORD PTR -12[rbp], eax
	cmp	DWORD PTR -12[rbp], 0
	je	.L14
	lea	rdi, .LC9[rip]
	call	perror@PLT
	mov	eax, DWORD PTR -12[rbp]
	jmp	.L16
.L14:
	cmp	QWORD PTR -56[rbp], 0
	je	.L15
	mov	rax, QWORD PTR -56[rbp]
	mov	rsi, rax
	lea	rdi, .LC10[rip]
	mov	eax, 0
	call	printf@PLT
.L15:
	mov	ecx, DWORD PTR -28[rbp]
	mov	edx, DWORD PTR -36[rbp]
	mov	eax, DWORD PTR -32[rbp]
	mov	esi, eax
	lea	rdi, .LC11[rip]
	mov	eax, 0
	call	printf@PLT
	mov	ecx, DWORD PTR -16[rbp]
	mov	edx, DWORD PTR -24[rbp]
	mov	eax, DWORD PTR -20[rbp]
	mov	esi, eax
	lea	rdi, .LC12[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
.L16:
	mov	rsi, QWORD PTR -8[rbp]
	sub	rsi, QWORD PTR fs:40
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	reportprivilege, .-reportprivilege
	.section	.rodata
.LC13:
	.string	"restoreprivilege"
	.text
	.globl	cleanup
	.type	cleanup, @function
cleanup:
.LFB9:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 16
	call	restoreprivilege
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 0
	je	.L19
	lea	rdi, .LC13[rip]
	call	perror@PLT
	mov	eax, DWORD PTR -4[rbp]
	jmp	.L20
.L19:
	mov	DWORD PTR -8[rbp], 0
	jmp	.L21
.L23:
	mov	eax, DWORD PTR -8[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 3
	mov	rdx, rax
	lea	rax, fd_list[rip]
	mov	rax, QWORD PTR [rdx+rax]
	mov	rdi, rax
	call	unlink@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 0
	je	.L22
	mov	eax, DWORD PTR -4[rbp]
	jmp	.L20
.L22:
	add	DWORD PTR -8[rbp], 1
.L21:
	mov	eax, DWORD PTR fd_list_count[rip]
	cmp	DWORD PTR -8[rbp], eax
	jl	.L23
	mov	eax, 0
.L20:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	cleanup, .-cleanup
	.section	.rodata
.LC14:
	.string	"testaccess must run as root.\n"
.LC15:
	.string	"setresuid"
.LC16:
	.string	"setgroups"
.LC17:
	.string	"setresgid"
.LC18:
	.string	"setresuid.1"
	.align 8
.LC19:
	.string	"saved uid used instead of real uid\n"
.LC20:
	.string	"setresid.2"
	.align 8
.LC21:
	.string	"Effective uid was used instead of real uid in access().\n"
.LC22:
	.string	"setresgid.1"
.LC23:
	.string	"setresuid.3"
	.align 8
.LC24:
	.string	"saved gid used instead of real gid\n"
	.align 8
.LC25:
	.string	"Effective gid was used instead of real gid in access().\n"
.LC26:
	.string	"%d errors seen.\n"
.LC27:
	.string	"cleanup"
	.text
	.globl	main
	.type	main, @function
main:
.LFB10:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	DWORD PTR -20[rbp], edi
	mov	QWORD PTR -32[rbp], rsi
	call	geteuid@PLT
	test	eax, eax
	je	.L25
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 29
	mov	esi, 1
	lea	rdi, .LC14[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L25:
	call	setup
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 0
	je	.L26
	call	cleanup
	mov	edi, 1
	call	exit@PLT
.L26:
	mov	edx, 0
	mov	esi, 0
	mov	edi, 0
	mov	eax, 0
	call	setresuid@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 0
	je	.L27
	lea	rdi, .LC15[rip]
	call	perror@PLT
	call	cleanup
.L27:
	mov	esi, 0
	mov	edi, 0
	mov	eax, 0
	call	setgroups@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 0
	je	.L28
	lea	rdi, .LC16[rip]
	call	perror@PLT
	call	cleanup
.L28:
	mov	edx, 0
	mov	esi, 0
	mov	edi, 0
	mov	eax, 0
	call	setresgid@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 0
	je	.L29
	lea	rdi, .LC17[rip]
	call	perror@PLT
	call	cleanup
.L29:
	mov	edx, 0
	mov	esi, 500
	mov	edi, 500
	mov	eax, 0
	call	setresuid@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 0
	je	.L30
	lea	rdi, .LC18[rip]
	call	perror@PLT
	call	cleanup
	mov	edi, 1
	call	exit@PLT
.L30:
	mov	DWORD PTR -8[rbp], 0
	mov	esi, 4
	lea	rdi, .LC0[rip]
	call	access@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 0
	jne	.L31
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 35
	mov	esi, 1
	lea	rdi, .LC19[rip]
	call	fwrite@PLT
	add	DWORD PTR -8[rbp], 1
.L31:
	call	restoreprivilege
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 0
	je	.L32
	lea	rdi, .LC13[rip]
	call	perror@PLT
	call	cleanup
	mov	edi, 1
	call	exit@PLT
.L32:
	mov	edx, 0
	mov	esi, 501
	mov	edi, 500
	mov	eax, 0
	call	setresuid@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 0
	je	.L33
	lea	rdi, .LC20[rip]
	call	perror@PLT
	call	cleanup
	mov	edi, 1
	call	exit@PLT
.L33:
	mov	esi, 4
	lea	rdi, .LC1[rip]
	call	access@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 0
	je	.L34
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 56
	mov	esi, 1
	lea	rdi, .LC21[rip]
	call	fwrite@PLT
	add	DWORD PTR -8[rbp], 1
.L34:
	mov	esi, 4
	lea	rdi, .LC2[rip]
	call	access@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 0
	jne	.L35
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 56
	mov	esi, 1
	lea	rdi, .LC21[rip]
	call	fwrite@PLT
	add	DWORD PTR -8[rbp], 1
.L35:
	call	restoreprivilege
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 0
	je	.L36
	lea	rdi, .LC13[rip]
	call	perror@PLT
	call	cleanup
	mov	edi, 1
	call	exit@PLT
.L36:
	mov	edx, 0
	mov	esi, 501
	mov	edi, 500
	mov	eax, 0
	call	setresgid@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 0
	je	.L37
	lea	rdi, .LC22[rip]
	call	perror@PLT
	call	cleanup
	mov	edi, 1
	call	exit@PLT
.L37:
	mov	edx, 0
	mov	esi, 500
	mov	edi, 500
	mov	eax, 0
	call	setresuid@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 0
	je	.L38
	lea	rdi, .LC23[rip]
	call	perror@PLT
	call	cleanup
	mov	edi, 1
	call	exit@PLT
.L38:
	mov	esi, 4
	lea	rdi, .LC3[rip]
	call	access@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 0
	jne	.L39
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 35
	mov	esi, 1
	lea	rdi, .LC24[rip]
	call	fwrite@PLT
.L39:
	mov	esi, 4
	lea	rdi, .LC4[rip]
	call	access@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 0
	je	.L40
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 56
	mov	esi, 1
	lea	rdi, .LC25[rip]
	call	fwrite@PLT
	add	DWORD PTR -8[rbp], 1
.L40:
	mov	esi, 4
	lea	rdi, .LC5[rip]
	call	access@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 0
	jne	.L41
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 56
	mov	esi, 1
	lea	rdi, .LC25[rip]
	call	fwrite@PLT
	add	DWORD PTR -8[rbp], 1
.L41:
	mov	rax, QWORD PTR stderr[rip]
	mov	edx, DWORD PTR -8[rbp]
	lea	rsi, .LC26[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	call	cleanup
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 0
	je	.L42
	lea	rdi, .LC27[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L42:
	mov	edi, 0
	call	exit@PLT
	.cfi_endproc
.LFE10:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.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, 6
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"875324.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"test1\000"
	.align	2
.LC1:
	.ascii	"test2\000"
	.align	2
.LC2:
	.ascii	"test3\000"
	.align	2
.LC3:
	.ascii	"test4\000"
	.align	2
.LC4:
	.ascii	"test5\000"
	.align	2
.LC5:
	.ascii	"test6\000"
	.data
	.align	2
	.type	fd_list, %object
	.size	fd_list, 96
fd_list:
	.word	.LC0
	.word	0
	.word	0
	.word	256
	.word	.LC1
	.word	500
	.word	0
	.word	256
	.word	.LC2
	.word	501
	.word	0
	.word	256
	.word	.LC3
	.word	0
	.word	0
	.word	32
	.word	.LC4
	.word	0
	.word	500
	.word	32
	.word	.LC5
	.word	0
	.word	501
	.word	32
	.align	2
	.type	fd_list_count, %object
	.size	fd_list_count, 4
fd_list_count:
	.word	6
	.section	.rodata
	.align	2
.LC6:
	.ascii	"open\000"
	.align	2
.LC7:
	.ascii	"chown\000"
	.text
	.align	2
	.global	setup
	.syntax unified
	.arm
	.fpu softvfp
	.type	setup, %function
setup:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L2
.L6:
	ldr	r2, .L7
	ldr	r3, [fp, #-12]
	ldr	r0, [r2, r3, lsl #4]
	ldr	r2, .L7
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #4
	add	r3, r2, r3
	ldr	r3, [r3, #12]
	mov	r2, r3
	mov	r1, #192
	bl	open
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmn	r3, #1
	bne	.L3
	ldr	r0, .L7+4
	bl	perror
	ldr	r3, [fp, #-8]
	b	.L4
.L3:
	ldr	r0, [fp, #-8]
	bl	close
	ldr	r2, .L7
	ldr	r3, [fp, #-12]
	ldr	r0, [r2, r3, lsl #4]
	ldr	r2, .L7
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #4
	add	r3, r2, r3
	ldr	r1, [r3, #4]
	ldr	r2, .L7
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #4
	add	r3, r2, r3
	ldr	r3, [r3, #8]
	mov	r2, r3
	bl	chown
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L5
	ldr	r0, .L7+8
	bl	perror
	ldr	r3, [fp, #-8]
	b	.L4
.L5:
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L2:
	ldr	r3, .L7+12
	ldr	r3, [r3]
	ldr	r2, [fp, #-12]
	cmp	r2, r3
	blt	.L6
	mov	r3, #0
.L4:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L8:
	.align	2
.L7:
	.word	fd_list
	.word	.LC6
	.word	.LC7
	.word	fd_list_count
	.size	setup, .-setup
	.align	2
	.global	restoreprivilege
	.syntax unified
	.arm
	.fpu softvfp
	.type	restoreprivilege, %function
restoreprivilege:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	mov	r1, #0
	mov	r0, #0
	bl	setreuid
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L10
	ldr	r3, [fp, #-8]
	b	.L11
.L10:
	mov	r1, #0
	mov	r0, #0
	bl	setregid
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L12
	ldr	r3, [fp, #-8]
	b	.L11
.L12:
	mov	r3, #0
.L11:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	restoreprivilege, .-restoreprivilege
	.section	.rodata
	.align	2
.LC8:
	.ascii	"getresuid\000"
	.align	2
.LC9:
	.ascii	"getresgid\000"
	.align	2
.LC10:
	.ascii	"%s: \000"
	.align	2
.LC11:
	.ascii	"ruid: %d, euid: %d, suid: %d,     \000"
	.align	2
.LC12:
	.ascii	"rgid: %d, egid: %d, sgid: %d\012\000"
	.align	2
.LC13:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	reportprivilege
	.syntax unified
	.arm
	.fpu softvfp
	.type	reportprivilege, %function
reportprivilege:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #40
	str	r0, [fp, #-40]
	ldr	r3, .L20
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r2, fp, #28
	sub	r1, fp, #36
	sub	r3, fp, #32
	mov	r0, r3
	bl	getresuid
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	beq	.L14
	ldr	r0, .L20+4
	bl	perror
	ldr	r3, [fp, #-12]
	b	.L18
.L14:
	sub	r2, fp, #16
	sub	r1, fp, #24
	sub	r3, fp, #20
	mov	r0, r3
	bl	getresgid
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	beq	.L16
	ldr	r0, .L20+8
	bl	perror
	ldr	r3, [fp, #-12]
	b	.L18
.L16:
	ldr	r3, [fp, #-40]
	cmp	r3, #0
	beq	.L17
	ldr	r1, [fp, #-40]
	ldr	r0, .L20+12
	bl	printf
.L17:
	ldr	r1, [fp, #-32]
	ldr	r2, [fp, #-36]
	ldr	r3, [fp, #-28]
	ldr	r0, .L20+16
	bl	printf
	ldr	r1, [fp, #-20]
	ldr	r2, [fp, #-24]
	ldr	r3, [fp, #-16]
	ldr	r0, .L20+20
	bl	printf
	mov	r3, #0
.L18:
	ldr	r2, .L20
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L19
	bl	__stack_chk_fail
.L19:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L21:
	.align	2
.L20:
	.word	.LC13
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.size	reportprivilege, .-reportprivilege
	.section	.rodata
	.align	2
.LC14:
	.ascii	"restoreprivilege\000"
	.text
	.align	2
	.global	cleanup
	.syntax unified
	.arm
	.fpu softvfp
	.type	cleanup, %function
cleanup:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	bl	restoreprivilege
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L23
	ldr	r0, .L28
	bl	perror
	ldr	r3, [fp, #-8]
	b	.L24
.L23:
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L25
.L27:
	ldr	r2, .L28+4
	ldr	r3, [fp, #-12]
	ldr	r3, [r2, r3, lsl #4]
	mov	r0, r3
	bl	unlink
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L26
	ldr	r3, [fp, #-8]
	b	.L24
.L26:
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L25:
	ldr	r3, .L28+8
	ldr	r3, [r3]
	ldr	r2, [fp, #-12]
	cmp	r2, r3
	blt	.L27
	mov	r3, #0
.L24:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L29:
	.align	2
.L28:
	.word	.LC14
	.word	fd_list
	.word	fd_list_count
	.size	cleanup, .-cleanup
	.section	.rodata
	.align	2
.LC15:
	.ascii	"testaccess must run as root.\012\000"
	.align	2
.LC16:
	.ascii	"setresuid\000"
	.align	2
.LC17:
	.ascii	"setgroups\000"
	.align	2
.LC18:
	.ascii	"setresgid\000"
	.align	2
.LC19:
	.ascii	"setresuid.1\000"
	.align	2
.LC20:
	.ascii	"saved uid used instead of real uid\012\000"
	.align	2
.LC21:
	.ascii	"setresid.2\000"
	.align	2
.LC22:
	.ascii	"Effective uid was used instead of real uid in acces"
	.ascii	"s().\012\000"
	.align	2
.LC23:
	.ascii	"setresgid.1\000"
	.align	2
.LC24:
	.ascii	"setresuid.3\000"
	.align	2
.LC25:
	.ascii	"saved gid used instead of real gid\012\000"
	.align	2
.LC26:
	.ascii	"Effective gid was used instead of real gid in acces"
	.ascii	"s().\012\000"
	.align	2
.LC27:
	.ascii	"%d errors seen.\012\000"
	.align	2
.LC28:
	.ascii	"cleanup\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	bl	geteuid
	mov	r3, r0
	cmp	r3, #0
	beq	.L31
	ldr	r3, .L49
	ldr	r3, [r3]
	mov	r2, #29
	mov	r1, #1
	ldr	r0, .L49+4
	bl	fwrite
	mov	r0, #1
	bl	exit
.L31:
	bl	setup
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L32
	bl	cleanup
	mov	r0, #1
	bl	exit
.L32:
	mov	r2, #0
	mov	r1, #0
	mov	r0, #0
	bl	setresuid
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L33
	ldr	r0, .L49+8
	bl	perror
	bl	cleanup
.L33:
	mov	r1, #0
	mov	r0, #0
	bl	setgroups
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L34
	ldr	r0, .L49+12
	bl	perror
	bl	cleanup
.L34:
	mov	r2, #0
	mov	r1, #0
	mov	r0, #0
	bl	setresgid
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L35
	ldr	r0, .L49+16
	bl	perror
	bl	cleanup
.L35:
	mov	r2, #0
	mov	r1, #500
	mov	r0, #500
	bl	setresuid
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L36
	ldr	r0, .L49+20
	bl	perror
	bl	cleanup
	mov	r0, #1
	bl	exit
.L36:
	mov	r3, #0
	str	r3, [fp, #-12]
	mov	r1, #4
	ldr	r0, .L49+24
	bl	access
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L37
	ldr	r3, .L49
	ldr	r3, [r3]
	mov	r2, #35
	mov	r1, #1
	ldr	r0, .L49+28
	bl	fwrite
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L37:
	bl	restoreprivilege
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L38
	ldr	r0, .L49+32
	bl	perror
	bl	cleanup
	mov	r0, #1
	bl	exit
.L38:
	mov	r2, #0
	ldr	r1, .L49+36
	mov	r0, #500
	bl	setresuid
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L39
	ldr	r0, .L49+40
	bl	perror
	bl	cleanup
	mov	r0, #1
	bl	exit
.L39:
	mov	r1, #4
	ldr	r0, .L49+44
	bl	access
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L40
	ldr	r3, .L49
	ldr	r3, [r3]
	mov	r2, #56
	mov	r1, #1
	ldr	r0, .L49+48
	bl	fwrite
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L40:
	mov	r1, #4
	ldr	r0, .L49+52
	bl	access
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L41
	ldr	r3, .L49
	ldr	r3, [r3]
	mov	r2, #56
	mov	r1, #1
	ldr	r0, .L49+48
	bl	fwrite
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L41:
	bl	restoreprivilege
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L42
	ldr	r0, .L49+32
	bl	perror
	bl	cleanup
	mov	r0, #1
	bl	exit
.L42:
	mov	r2, #0
	ldr	r1, .L49+36
	mov	r0, #500
	bl	setresgid
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L43
	ldr	r0, .L49+56
	bl	perror
	bl	cleanup
	mov	r0, #1
	bl	exit
.L43:
	mov	r2, #0
	mov	r1, #500
	mov	r0, #500
	bl	setresuid
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L44
	ldr	r0, .L49+60
	bl	perror
	bl	cleanup
	mov	r0, #1
	bl	exit
.L44:
	mov	r1, #4
	ldr	r0, .L49+64
	bl	access
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L45
	ldr	r3, .L49
	ldr	r3, [r3]
	mov	r2, #35
	mov	r1, #1
	ldr	r0, .L49+68
	bl	fwrite
.L45:
	mov	r1, #4
	ldr	r0, .L49+72
	bl	access
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L46
	ldr	r3, .L49
	ldr	r3, [r3]
	mov	r2, #56
	mov	r1, #1
	ldr	r0, .L49+76
	bl	fwrite
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L46:
	mov	r1, #4
	ldr	r0, .L49+80
	bl	access
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L47
	ldr	r3, .L49
	ldr	r3, [r3]
	mov	r2, #56
	mov	r1, #1
	ldr	r0, .L49+76
	bl	fwrite
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L47:
	ldr	r3, .L49
	ldr	r3, [r3]
	ldr	r2, [fp, #-12]
	ldr	r1, .L49+84
	mov	r0, r3
	bl	fprintf
	bl	cleanup
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L48
	ldr	r0, .L49+88
	bl	perror
	mov	r0, #1
	bl	exit
.L48:
	mov	r0, #0
	bl	exit
.L50:
	.align	2
.L49:
	.word	stderr
	.word	.LC15
	.word	.LC16
	.word	.LC17
	.word	.LC18
	.word	.LC19
	.word	.LC0
	.word	.LC20
	.word	.LC14
	.word	501
	.word	.LC21
	.word	.LC1
	.word	.LC22
	.word	.LC2
	.word	.LC23
	.word	.LC24
	.word	.LC3
	.word	.LC25
	.word	.LC4
	.word	.LC26
	.word	.LC5
	.word	.LC27
	.word	.LC28
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
