	.file	"195360.c"
	.intel_syntax noprefix
	.text
	.globl	LOGFILE
	.bss
	.align 8
	.type	LOGFILE, @object
	.size	LOGFILE, 8
LOGFILE:
	.zero	8
	.globl	ERRORFILE
	.align 8
	.type	ERRORFILE, @object
	.size	ERRORFILE, 8
ERRORFILE:
	.zero	8
	.globl	SETUID_OPER_FAILED
	.data
	.align 4
	.type	SETUID_OPER_FAILED, @object
	.size	SETUID_OPER_FAILED, 4
SETUID_OPER_FAILED:
	.long	10
	.globl	USER_NOT_FOUND
	.align 4
	.type	USER_NOT_FOUND, @object
	.size	USER_NOT_FOUND, 4
USER_NOT_FOUND:
	.long	20
	.globl	INVALID_INPUT
	.align 4
	.type	INVALID_INPUT, @object
	.size	INVALID_INPUT, 4
INVALID_INPUT:
	.long	30
	.section	.rodata
	.align 8
.LC0:
	.string	"Error setting supplementary groups for user %s: %s\n"
	.align 8
.LC1:
	.string	"unable to reacquire root - %s\n"
	.align 8
.LC2:
	.string	"Real: %d:%d; Effective: %d:%d\n"
	.align 8
.LC3:
	.string	"unable to set group to %d - %s\n"
	.align 8
.LC4:
	.string	"unable to set user to %d - %s\n"
	.text
	.globl	change_user
	.type	change_user, @function
change_user:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r13
	push	r12
	push	rbx
	sub	rsp, 24
	.cfi_offset 13, -24
	.cfi_offset 12, -32
	.cfi_offset 3, -40
	mov	QWORD PTR -40[rbp], rdi
	mov	DWORD PTR -44[rbp], esi
	mov	DWORD PTR -48[rbp], edx
	call	getuid@PLT
	cmp	DWORD PTR -44[rbp], eax
	jne	.L2
	call	geteuid@PLT
	cmp	DWORD PTR -44[rbp], eax
	jne	.L2
	call	getgid@PLT
	cmp	DWORD PTR -48[rbp], eax
	jne	.L2
	call	getegid@PLT
	cmp	DWORD PTR -48[rbp], eax
	jne	.L2
	mov	eax, 0
	jmp	.L3
.L2:
	mov	edx, DWORD PTR -48[rbp]
	mov	rax, QWORD PTR -40[rbp]
	mov	esi, edx
	mov	rdi, rax
	call	initgroups@PLT
	test	eax, eax
	je	.L4
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rcx, rax
	mov	rax, QWORD PTR LOGFILE[rip]
	mov	rdx, QWORD PTR -40[rbp]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, DWORD PTR SETUID_OPER_FAILED[rip]
	jmp	.L3
.L4:
	mov	edi, 0
	call	seteuid@PLT
	test	eax, eax
	je	.L5
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR LOGFILE[rip]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	call	getegid@PLT
	mov	r13d, eax
	call	geteuid@PLT
	mov	r12d, eax
	call	getgid@PLT
	mov	ebx, eax
	call	getuid@PLT
	mov	edx, eax
	mov	rax, QWORD PTR LOGFILE[rip]
	mov	r9d, r13d
	mov	r8d, r12d
	mov	ecx, ebx
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, DWORD PTR SETUID_OPER_FAILED[rip]
	jmp	.L3
.L5:
	mov	eax, DWORD PTR -48[rbp]
	mov	edi, eax
	call	setgid@PLT
	test	eax, eax
	je	.L6
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rcx, rax
	mov	rax, QWORD PTR LOGFILE[rip]
	mov	edx, DWORD PTR -48[rbp]
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	call	getegid@PLT
	mov	r13d, eax
	call	geteuid@PLT
	mov	r12d, eax
	call	getgid@PLT
	mov	ebx, eax
	call	getuid@PLT
	mov	edx, eax
	mov	rax, QWORD PTR LOGFILE[rip]
	mov	r9d, r13d
	mov	r8d, r12d
	mov	ecx, ebx
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, DWORD PTR SETUID_OPER_FAILED[rip]
	jmp	.L3
.L6:
	mov	eax, DWORD PTR -44[rbp]
	mov	edi, eax
	call	setuid@PLT
	test	eax, eax
	je	.L7
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rcx, rax
	mov	rax, QWORD PTR LOGFILE[rip]
	mov	edx, DWORD PTR -44[rbp]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	call	getegid@PLT
	mov	r13d, eax
	call	geteuid@PLT
	mov	r12d, eax
	call	getgid@PLT
	mov	ebx, eax
	call	getuid@PLT
	mov	edx, eax
	mov	rax, QWORD PTR LOGFILE[rip]
	mov	r9d, r13d
	mov	r8d, r12d
	mov	ecx, ebx
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, DWORD PTR SETUID_OPER_FAILED[rip]
	jmp	.L3
.L7:
	mov	eax, 0
.L3:
	add	rsp, 24
	pop	rbx
	pop	r12
	pop	r13
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	change_user, .-change_user
	.globl	join
	.type	join, @function
join:
.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, 48
	mov	QWORD PTR -40[rbp], rdi
	mov	QWORD PTR -48[rbp], rsi
	mov	DWORD PTR -16[rbp], 0
	mov	DWORD PTR -20[rbp], 0
	jmp	.L9
.L10:
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -40[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	strlen@PLT
	mov	edx, eax
	mov	eax, DWORD PTR -16[rbp]
	add	eax, edx
	mov	DWORD PTR -16[rbp], eax
	add	DWORD PTR -20[rbp], 1
.L9:
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -40[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	test	rax, rax
	jne	.L10
	mov	edx, DWORD PTR -16[rbp]
	mov	eax, DWORD PTR -20[rbp]
	add	eax, edx
	add	eax, 2
	cdqe
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -8[rbp], rax
	mov	DWORD PTR -12[rbp], 0
	jmp	.L11
.L14:
	cmp	DWORD PTR -12[rbp], 0
	jne	.L12
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -40[rbp]
	add	rax, rdx
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR -8[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	strcpy@PLT
	jmp	.L13
.L12:
	mov	rdx, QWORD PTR -48[rbp]
	mov	rax, QWORD PTR -8[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	strcat@PLT
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -40[rbp]
	add	rax, rdx
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR -8[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	strcat@PLT
.L13:
	add	DWORD PTR -12[rbp], 1
.L11:
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -40[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	test	rax, rax
	jne	.L14
	mov	rax, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	join, .-join
	.section	.rodata
	.align 8
.LC5:
	.string	"Requires at least 3 variables: ./execute-as-user username command [args]"
.LC6:
	.string	"user does not exist: %s"
	.align 8
.LC7:
	.string	"Changing user: user: %s, uid: %d, gid: %d\n"
.LC8:
	.string	"Error changing user to %s\n"
	.align 8
.LC9:
	.string	"user command starting from: %s\n"
.LC10:
	.string	" "
.LC11:
	.string	"cmd:[%s]\n"
.LC12:
	.string	"system call return value: %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.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	DWORD PTR -52[rbp], edi
	mov	QWORD PTR -64[rbp], rsi
	mov	rax, QWORD PTR LOGFILE[rip]
	test	rax, rax
	jne	.L17
	mov	rax, QWORD PTR stdout[rip]
	mov	QWORD PTR LOGFILE[rip], rax
.L17:
	mov	rax, QWORD PTR ERRORFILE[rip]
	test	rax, rax
	jne	.L18
	mov	rax, QWORD PTR stderr[rip]
	mov	QWORD PTR ERRORFILE[rip], rax
.L18:
	cmp	DWORD PTR -52[rbp], 2
	jg	.L19
	mov	rax, QWORD PTR ERRORFILE[rip]
	mov	rcx, rax
	mov	edx, 72
	mov	esi, 1
	lea	rdi, .LC5[rip]
	call	fwrite@PLT
	mov	eax, DWORD PTR INVALID_INPUT[rip]
	jmp	.L20
.L19:
	mov	rax, QWORD PTR -64[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	QWORD PTR -40[rbp], rax
	mov	rax, QWORD PTR -40[rbp]
	mov	rdi, rax
	call	getpwnam@PLT
	mov	QWORD PTR -32[rbp], rax
	cmp	QWORD PTR -32[rbp], 0
	jne	.L21
	mov	rax, QWORD PTR LOGFILE[rip]
	mov	rdx, QWORD PTR -40[rbp]
	lea	rsi, .LC6[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, DWORD PTR USER_NOT_FOUND[rip]
	jmp	.L20
.L21:
	mov	rax, QWORD PTR -32[rbp]
	mov	esi, DWORD PTR 20[rax]
	mov	rax, QWORD PTR -32[rbp]
	mov	ecx, DWORD PTR 16[rax]
	mov	rax, QWORD PTR LOGFILE[rip]
	mov	rdx, QWORD PTR -40[rbp]
	mov	r8d, esi
	lea	rsi, .LC7[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	rax, QWORD PTR -32[rbp]
	mov	edx, DWORD PTR 20[rax]
	mov	rax, QWORD PTR -32[rbp]
	mov	ecx, DWORD PTR 16[rax]
	mov	rax, QWORD PTR -40[rbp]
	mov	esi, ecx
	mov	rdi, rax
	call	change_user
	mov	DWORD PTR -44[rbp], eax
	cmp	DWORD PTR -44[rbp], 0
	je	.L22
	mov	rax, QWORD PTR LOGFILE[rip]
	mov	rdx, QWORD PTR -40[rbp]
	lea	rsi, .LC8[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, DWORD PTR SETUID_OPER_FAILED[rip]
	jmp	.L20
.L22:
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 16
	mov	QWORD PTR -24[rbp], rax
	mov	rax, QWORD PTR -24[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR LOGFILE[rip]
	lea	rsi, .LC9[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	rax, QWORD PTR LOGFILE[rip]
	mov	rdi, rax
	call	fflush@PLT
	lea	rax, .LC10[rip]
	mov	QWORD PTR -16[rbp], rax
	mov	rdx, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	join
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	mov	rsi, rax
	lea	rdi, .LC11[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	system@PLT
	mov	DWORD PTR -44[rbp], eax
	mov	rax, QWORD PTR LOGFILE[rip]
	mov	edx, DWORD PTR -44[rbp]
	lea	rsi, .LC12[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	cmp	DWORD PTR -44[rbp], 0
	je	.L23
	mov	eax, 1
	jmp	.L20
.L23:
	mov	eax, 0
.L20:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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	"195360.c"
	.text
	.global	LOGFILE
	.bss
	.align	2
	.type	LOGFILE, %object
	.size	LOGFILE, 4
LOGFILE:
	.space	4
	.global	ERRORFILE
	.align	2
	.type	ERRORFILE, %object
	.size	ERRORFILE, 4
ERRORFILE:
	.space	4
	.global	SETUID_OPER_FAILED
	.data
	.align	2
	.type	SETUID_OPER_FAILED, %object
	.size	SETUID_OPER_FAILED, 4
SETUID_OPER_FAILED:
	.word	10
	.global	USER_NOT_FOUND
	.align	2
	.type	USER_NOT_FOUND, %object
	.size	USER_NOT_FOUND, 4
USER_NOT_FOUND:
	.word	20
	.global	INVALID_INPUT
	.align	2
	.type	INVALID_INPUT, %object
	.size	INVALID_INPUT, 4
INVALID_INPUT:
	.word	30
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Error setting supplementary groups for user %s: %s\012"
	.ascii	"\000"
	.align	2
.LC1:
	.ascii	"unable to reacquire root - %s\012\000"
	.align	2
.LC2:
	.ascii	"Real: %d:%d; Effective: %d:%d\012\000"
	.align	2
.LC3:
	.ascii	"unable to set group to %d - %s\012\000"
	.align	2
.LC4:
	.ascii	"unable to set user to %d - %s\012\000"
	.text
	.align	2
	.global	change_user
	.syntax unified
	.arm
	.fpu softvfp
	.type	change_user, %function
change_user:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, fp, lr}
	add	fp, sp, #20
	sub	sp, sp, #24
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	str	r2, [fp, #-32]
	bl	getuid
	mov	r2, r0
	ldr	r3, [fp, #-28]
	cmp	r3, r2
	bne	.L2
	bl	geteuid
	mov	r2, r0
	ldr	r3, [fp, #-28]
	cmp	r3, r2
	bne	.L2
	bl	getgid
	mov	r2, r0
	ldr	r3, [fp, #-32]
	cmp	r3, r2
	bne	.L2
	bl	getegid
	mov	r2, r0
	ldr	r3, [fp, #-32]
	cmp	r3, r2
	bne	.L2
	mov	r3, #0
	b	.L3
.L2:
	ldr	r1, [fp, #-32]
	ldr	r0, [fp, #-24]
	bl	initgroups
	mov	r3, r0
	cmp	r3, #0
	beq	.L4
	ldr	r3, .L8
	ldr	r4, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	ldr	r2, [fp, #-24]
	ldr	r1, .L8+4
	mov	r0, r4
	bl	fprintf
	ldr	r3, .L8+8
	ldr	r3, [r3]
	b	.L3
.L4:
	mov	r0, #0
	bl	seteuid
	mov	r3, r0
	cmp	r3, #0
	beq	.L5
	ldr	r3, .L8
	ldr	r4, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L8+12
	mov	r0, r4
	bl	fprintf
	ldr	r3, .L8
	ldr	r4, [r3]
	bl	getuid
	mov	r6, r0
	bl	getgid
	mov	r7, r0
	bl	geteuid
	mov	r5, r0
	bl	getegid
	mov	r3, r0
	str	r3, [sp, #4]
	str	r5, [sp]
	mov	r3, r7
	mov	r2, r6
	ldr	r1, .L8+16
	mov	r0, r4
	bl	fprintf
	ldr	r3, .L8+8
	ldr	r3, [r3]
	b	.L3
.L5:
	ldr	r0, [fp, #-32]
	bl	setgid
	mov	r3, r0
	cmp	r3, #0
	beq	.L6
	ldr	r3, .L8
	ldr	r4, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	ldr	r2, [fp, #-32]
	ldr	r1, .L8+20
	mov	r0, r4
	bl	fprintf
	ldr	r3, .L8
	ldr	r4, [r3]
	bl	getuid
	mov	r6, r0
	bl	getgid
	mov	r7, r0
	bl	geteuid
	mov	r5, r0
	bl	getegid
	mov	r3, r0
	str	r3, [sp, #4]
	str	r5, [sp]
	mov	r3, r7
	mov	r2, r6
	ldr	r1, .L8+16
	mov	r0, r4
	bl	fprintf
	ldr	r3, .L8+8
	ldr	r3, [r3]
	b	.L3
.L6:
	ldr	r0, [fp, #-28]
	bl	setuid
	mov	r3, r0
	cmp	r3, #0
	beq	.L7
	ldr	r3, .L8
	ldr	r4, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	ldr	r2, [fp, #-28]
	ldr	r1, .L8+24
	mov	r0, r4
	bl	fprintf
	ldr	r3, .L8
	ldr	r4, [r3]
	bl	getuid
	mov	r6, r0
	bl	getgid
	mov	r7, r0
	bl	geteuid
	mov	r5, r0
	bl	getegid
	mov	r3, r0
	str	r3, [sp, #4]
	str	r5, [sp]
	mov	r3, r7
	mov	r2, r6
	ldr	r1, .L8+16
	mov	r0, r4
	bl	fprintf
	ldr	r3, .L8+8
	ldr	r3, [r3]
	b	.L3
.L7:
	mov	r3, #0
.L3:
	mov	r0, r3
	sub	sp, fp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, fp, pc}
.L9:
	.align	2
.L8:
	.word	LOGFILE
	.word	.LC0
	.word	SETUID_OPER_FAILED
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.size	change_user, .-change_user
	.align	2
	.global	join
	.syntax unified
	.arm
	.fpu softvfp
	.type	join, %function
join:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	mov	r3, #0
	str	r3, [fp, #-16]
	mov	r3, #0
	str	r3, [fp, #-20]
	b	.L11
.L12:
	ldr	r3, [fp, #-20]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r0, r3
	bl	strlen
	mov	r2, r0
	ldr	r3, [fp, #-16]
	add	r3, r2, r3
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
.L11:
	ldr	r3, [fp, #-20]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L12
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-20]
	add	r3, r2, r3
	add	r3, r3, #2
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-8]
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L13
.L16:
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bne	.L14
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, [fp, #-8]
	bl	strcpy
	b	.L15
.L14:
	ldr	r1, [fp, #-28]
	ldr	r0, [fp, #-8]
	bl	strcat
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, [fp, #-8]
	bl	strcat
.L15:
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L13:
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L16
	ldr	r3, [fp, #-8]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	join, .-join
	.section	.rodata
	.align	2
.LC5:
	.ascii	"Requires at least 3 variables: ./execute-as-user us"
	.ascii	"ername command [args]\000"
	.align	2
.LC6:
	.ascii	"user does not exist: %s\000"
	.align	2
.LC7:
	.ascii	"Changing user: user: %s, uid: %d, gid: %d\012\000"
	.align	2
.LC8:
	.ascii	"Error changing user to %s\012\000"
	.align	2
.LC9:
	.ascii	"user command starting from: %s\012\000"
	.align	2
.LC10:
	.ascii	" \000"
	.align	2
.LC11:
	.ascii	"cmd:[%s]\012\000"
	.align	2
.LC12:
	.ascii	"system call return value: %d\012\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #40
	str	r0, [fp, #-32]
	str	r1, [fp, #-36]
	ldr	r3, .L26
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L19
	ldr	r3, .L26+4
	ldr	r3, [r3]
	ldr	r2, .L26
	str	r3, [r2]
.L19:
	ldr	r3, .L26+8
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L20
	ldr	r3, .L26+12
	ldr	r3, [r3]
	ldr	r2, .L26+8
	str	r3, [r2]
.L20:
	ldr	r3, [fp, #-32]
	cmp	r3, #2
	bgt	.L21
	ldr	r3, .L26+8
	ldr	r3, [r3]
	mov	r2, #72
	mov	r1, #1
	ldr	r0, .L26+16
	bl	fwrite
	ldr	r3, .L26+20
	ldr	r3, [r3]
	b	.L22
.L21:
	ldr	r3, [fp, #-36]
	ldr	r3, [r3, #4]
	str	r3, [fp, #-28]
	ldr	r0, [fp, #-28]
	bl	getpwnam
	str	r0, [fp, #-24]
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	bne	.L23
	ldr	r3, .L26
	ldr	r3, [r3]
	ldr	r2, [fp, #-28]
	ldr	r1, .L26+24
	mov	r0, r3
	bl	fprintf
	ldr	r3, .L26+28
	ldr	r3, [r3]
	b	.L22
.L23:
	ldr	r3, .L26
	ldr	r0, [r3]
	ldr	r3, [fp, #-24]
	ldr	r2, [r3, #8]
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #12]
	str	r3, [sp]
	mov	r3, r2
	ldr	r2, [fp, #-28]
	ldr	r1, .L26+32
	bl	fprintf
	ldr	r3, [fp, #-24]
	ldr	r1, [r3, #8]
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #12]
	mov	r2, r3
	ldr	r0, [fp, #-28]
	bl	change_user
	str	r0, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	beq	.L24
	ldr	r3, .L26
	ldr	r3, [r3]
	ldr	r2, [fp, #-28]
	ldr	r1, .L26+36
	mov	r0, r3
	bl	fprintf
	ldr	r3, .L26+40
	ldr	r3, [r3]
	b	.L22
.L24:
	ldr	r3, [fp, #-36]
	add	r3, r3, #8
	str	r3, [fp, #-16]
	ldr	r3, .L26
	ldr	r0, [r3]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L26+44
	bl	fprintf
	ldr	r3, .L26
	ldr	r3, [r3]
	mov	r0, r3
	bl	fflush
	ldr	r3, .L26+48
	str	r3, [fp, #-12]
	ldr	r1, [fp, #-12]
	ldr	r0, [fp, #-16]
	bl	join
	str	r0, [fp, #-8]
	ldr	r1, [fp, #-8]
	ldr	r0, .L26+52
	bl	printf
	ldr	r0, [fp, #-8]
	bl	system
	str	r0, [fp, #-20]
	ldr	r3, .L26
	ldr	r3, [r3]
	ldr	r2, [fp, #-20]
	ldr	r1, .L26+56
	mov	r0, r3
	bl	fprintf
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	beq	.L25
	mov	r3, #1
	b	.L22
.L25:
	mov	r3, #0
.L22:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L27:
	.align	2
.L26:
	.word	LOGFILE
	.word	stdout
	.word	ERRORFILE
	.word	stderr
	.word	.LC5
	.word	INVALID_INPUT
	.word	.LC6
	.word	USER_NOT_FOUND
	.word	.LC7
	.word	.LC8
	.word	SETUID_OPER_FAILED
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
