	.file	"43887194.c"
	.intel_syntax noprefix
	.text
	.local	argv0
	.comm	argv0,8,8
	.section	.rodata
	.align 8
.LC0:
	.string	"Usage: %s user-spec command [args]\n"
	.text
	.type	usage, @function
usage:
.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 -4[rbp], edi
	mov	rax, QWORD PTR argv0[rip]
	mov	rsi, rax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -4[rbp]
	mov	edi, eax
	call	exit@PLT
	.cfi_endproc
.LFE6:
	.size	usage, .-usage
	.section	.rodata
.LC1:
	.string	"getpwnam(%s)"
.LC2:
	.string	"/"
.LC3:
	.string	"HOME"
.LC4:
	.string	"getgrnam(%s)"
.LC5:
	.string	"setgroups(%i)"
.LC6:
	.string	"setgroups"
.LC7:
	.string	"malloc"
.LC8:
	.string	"setgid(%i)"
.LC9:
	.string	"setuid(%i)"
.LC10:
	.string	"%s"
	.text
	.globl	main
	.type	main, @function
main:
.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, 112
	mov	DWORD PTR -100[rbp], edi
	mov	QWORD PTR -112[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	call	getuid@PLT
	mov	DWORD PTR -80[rbp], eax
	call	getgid@PLT
	mov	DWORD PTR -88[rbp], eax
	mov	rax, QWORD PTR -112[rbp]
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR argv0[rip], rax
	cmp	DWORD PTR -100[rbp], 2
	jg	.L3
	mov	edi, 0
	call	usage
.L3:
	mov	rax, QWORD PTR -112[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	QWORD PTR -32[rbp], rax
	mov	rax, QWORD PTR -32[rbp]
	mov	esi, 58
	mov	rdi, rax
	call	strchr@PLT
	mov	QWORD PTR -56[rbp], rax
	cmp	QWORD PTR -56[rbp], 0
	je	.L4
	mov	rax, QWORD PTR -56[rbp]
	lea	rdx, 1[rax]
	mov	QWORD PTR -56[rbp], rdx
	mov	BYTE PTR [rax], 0
.L4:
	mov	rax, QWORD PTR -112[rbp]
	add	rax, 16
	mov	QWORD PTR -24[rbp], rax
	mov	QWORD PTR -48[rbp], 0
	mov	rax, QWORD PTR -32[rbp]
	movzx	eax, BYTE PTR [rax]
	test	al, al
	je	.L5
	lea	rcx, -64[rbp]
	mov	rax, QWORD PTR -32[rbp]
	mov	edx, 10
	mov	rsi, rcx
	mov	rdi, rax
	call	strtol@PLT
	mov	DWORD PTR -76[rbp], eax
	mov	rax, QWORD PTR -64[rbp]
	movzx	eax, BYTE PTR [rax]
	test	al, al
	jne	.L6
	mov	eax, DWORD PTR -76[rbp]
	mov	DWORD PTR -80[rbp], eax
	jmp	.L5
.L6:
	mov	rax, QWORD PTR -32[rbp]
	mov	rdi, rax
	call	getpwnam@PLT
	mov	QWORD PTR -48[rbp], rax
	cmp	QWORD PTR -48[rbp], 0
	jne	.L5
	mov	rax, QWORD PTR -32[rbp]
	mov	rdx, rax
	lea	rsi, .LC1[rip]
	mov	edi, 1
	mov	eax, 0
	call	err@PLT
.L5:
	cmp	QWORD PTR -48[rbp], 0
	jne	.L7
	mov	eax, DWORD PTR -80[rbp]
	mov	edi, eax
	call	getpwuid@PLT
	mov	QWORD PTR -48[rbp], rax
.L7:
	cmp	QWORD PTR -48[rbp], 0
	je	.L8
	mov	rax, QWORD PTR -48[rbp]
	mov	eax, DWORD PTR 16[rax]
	mov	DWORD PTR -80[rbp], eax
	mov	rax, QWORD PTR -48[rbp]
	mov	eax, DWORD PTR 20[rax]
	mov	DWORD PTR -88[rbp], eax
.L8:
	cmp	QWORD PTR -48[rbp], 0
	je	.L9
	mov	rax, QWORD PTR -48[rbp]
	mov	rax, QWORD PTR 32[rax]
	jmp	.L10
.L9:
	lea	rax, .LC2[rip]
.L10:
	mov	edx, 1
	mov	rsi, rax
	lea	rdi, .LC3[rip]
	call	setenv@PLT
	cmp	QWORD PTR -56[rbp], 0
	je	.L11
	mov	rax, QWORD PTR -56[rbp]
	movzx	eax, BYTE PTR [rax]
	test	al, al
	je	.L11
	mov	QWORD PTR -48[rbp], 0
	lea	rcx, -64[rbp]
	mov	rax, QWORD PTR -56[rbp]
	mov	edx, 10
	mov	rsi, rcx
	mov	rdi, rax
	call	strtol@PLT
	mov	DWORD PTR -72[rbp], eax
	mov	rax, QWORD PTR -64[rbp]
	movzx	eax, BYTE PTR [rax]
	test	al, al
	jne	.L12
	mov	eax, DWORD PTR -72[rbp]
	mov	DWORD PTR -88[rbp], eax
	jmp	.L11
.L12:
	mov	rax, QWORD PTR -56[rbp]
	mov	rdi, rax
	call	getgrnam@PLT
	mov	QWORD PTR -16[rbp], rax
	cmp	QWORD PTR -16[rbp], 0
	jne	.L13
	mov	rax, QWORD PTR -56[rbp]
	mov	rdx, rax
	lea	rsi, .LC4[rip]
	mov	edi, 1
	mov	eax, 0
	call	err@PLT
.L13:
	mov	rax, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR 16[rax]
	mov	DWORD PTR -88[rbp], eax
.L11:
	cmp	QWORD PTR -48[rbp], 0
	jne	.L14
	lea	rax, -88[rbp]
	mov	rsi, rax
	mov	edi, 1
	call	setgroups@PLT
	test	eax, eax
	jns	.L15
	mov	eax, DWORD PTR -88[rbp]
	mov	edx, eax
	lea	rsi, .LC5[rip]
	mov	edi, 1
	mov	eax, 0
	call	err@PLT
.L14:
	mov	DWORD PTR -84[rbp], 0
	mov	QWORD PTR -40[rbp], 0
.L20:
	mov	esi, DWORD PTR -88[rbp]
	mov	rax, QWORD PTR -48[rbp]
	mov	rax, QWORD PTR [rax]
	lea	rcx, -84[rbp]
	mov	rdx, QWORD PTR -40[rbp]
	mov	rdi, rax
	call	getgrouplist@PLT
	mov	DWORD PTR -68[rbp], eax
	cmp	DWORD PTR -68[rbp], 0
	js	.L16
	mov	eax, DWORD PTR -84[rbp]
	cdqe
	mov	rdx, QWORD PTR -40[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	setgroups@PLT
	test	eax, eax
	jns	.L24
	lea	rsi, .LC6[rip]
	mov	edi, 1
	mov	eax, 0
	call	err@PLT
.L16:
	mov	eax, DWORD PTR -84[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -40[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	realloc@PLT
	mov	QWORD PTR -40[rbp], rax
	cmp	QWORD PTR -40[rbp], 0
	jne	.L20
	lea	rsi, .LC7[rip]
	mov	edi, 1
	mov	eax, 0
	call	err@PLT
.L24:
	nop
.L15:
	mov	eax, DWORD PTR -88[rbp]
	mov	edi, eax
	call	setgid@PLT
	test	eax, eax
	jns	.L21
	mov	eax, DWORD PTR -88[rbp]
	mov	edx, eax
	lea	rsi, .LC8[rip]
	mov	edi, 1
	mov	eax, 0
	call	err@PLT
.L21:
	mov	eax, DWORD PTR -80[rbp]
	mov	edi, eax
	call	setuid@PLT
	test	eax, eax
	jns	.L22
	mov	eax, DWORD PTR -80[rbp]
	mov	edx, eax
	lea	rsi, .LC9[rip]
	mov	edi, 1
	mov	eax, 0
	call	err@PLT
.L22:
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rdx, QWORD PTR -24[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	execvp@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rdx, rax
	lea	rsi, .LC10[rip]
	mov	edi, 1
	mov	eax, 0
	call	err@PLT
	.cfi_endproc
.LFE7:
	.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	"43887194.c"
	.text
	.local	argv0
	.comm	argv0,4,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Usage: %s user-spec command [args]\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	usage, %function
usage:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	str	r0, [fp, #-8]
	ldr	r3, .L2
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L2+4
	bl	printf
	ldr	r0, [fp, #-8]
	bl	exit
.L3:
	.align	2
.L2:
	.word	argv0
	.word	.LC0
	.size	usage, .-usage
	.section	.rodata
	.align	2
.LC1:
	.ascii	"getpwnam(%s)\000"
	.align	2
.LC2:
	.ascii	"/\000"
	.align	2
.LC3:
	.ascii	"HOME\000"
	.align	2
.LC4:
	.ascii	"getgrnam(%s)\000"
	.align	2
.LC5:
	.ascii	"setgroups(%i)\000"
	.align	2
.LC6:
	.ascii	"setgroups\000"
	.align	2
.LC7:
	.ascii	"malloc\000"
	.align	2
.LC8:
	.ascii	"setgid(%i)\000"
	.align	2
.LC9:
	.ascii	"setuid(%i)\000"
	.align	2
.LC10:
	.ascii	"%s\000"
	.align	2
.LC11:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 64
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #64
	str	r0, [fp, #-64]
	str	r1, [fp, #-68]
	ldr	r3, .L27
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	bl	getuid
	str	r0, [fp, #-44]
	bl	getgid
	mov	r3, r0
	str	r3, [fp, #-56]
	ldr	r3, [fp, #-68]
	ldr	r3, [r3]
	ldr	r2, .L27+4
	str	r3, [r2]
	ldr	r3, [fp, #-64]
	cmp	r3, #2
	bgt	.L5
	mov	r0, #0
	bl	usage
.L5:
	ldr	r3, [fp, #-68]
	ldr	r3, [r3, #4]
	str	r3, [fp, #-32]
	mov	r1, #58
	ldr	r0, [fp, #-32]
	bl	strchr
	str	r0, [fp, #-48]
	ldr	r3, [fp, #-48]
	cmp	r3, #0
	beq	.L6
	ldr	r3, [fp, #-48]
	add	r2, r3, #1
	str	r2, [fp, #-48]
	mov	r2, #0
	strb	r2, [r3]
.L6:
	ldr	r3, [fp, #-68]
	add	r3, r3, #8
	str	r3, [fp, #-28]
	mov	r3, #0
	str	r3, [fp, #-40]
	ldr	r3, [fp, #-32]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L7
	sub	r3, fp, #60
	mov	r2, #10
	mov	r1, r3
	ldr	r0, [fp, #-32]
	bl	strtol
	mov	r3, r0
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-60]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L8
	ldr	r3, [fp, #-24]
	str	r3, [fp, #-44]
	b	.L7
.L8:
	ldr	r0, [fp, #-32]
	bl	getpwnam
	str	r0, [fp, #-40]
	ldr	r3, [fp, #-40]
	cmp	r3, #0
	bne	.L7
	ldr	r2, [fp, #-32]
	ldr	r1, .L27+8
	mov	r0, #1
	bl	err
.L7:
	ldr	r3, [fp, #-40]
	cmp	r3, #0
	bne	.L9
	ldr	r0, [fp, #-44]
	bl	getpwuid
	str	r0, [fp, #-40]
.L9:
	ldr	r3, [fp, #-40]
	cmp	r3, #0
	beq	.L10
	ldr	r3, [fp, #-40]
	ldr	r3, [r3, #8]
	str	r3, [fp, #-44]
	ldr	r3, [fp, #-40]
	ldr	r3, [r3, #12]
	str	r3, [fp, #-56]
.L10:
	ldr	r3, [fp, #-40]
	cmp	r3, #0
	beq	.L11
	ldr	r3, [fp, #-40]
	ldr	r3, [r3, #20]
	b	.L12
.L11:
	ldr	r3, .L27+12
.L12:
	mov	r2, #1
	mov	r1, r3
	ldr	r0, .L27+16
	bl	setenv
	ldr	r3, [fp, #-48]
	cmp	r3, #0
	beq	.L13
	ldr	r3, [fp, #-48]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L13
	mov	r3, #0
	str	r3, [fp, #-40]
	sub	r3, fp, #60
	mov	r2, #10
	mov	r1, r3
	ldr	r0, [fp, #-48]
	bl	strtol
	mov	r3, r0
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-60]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L14
	ldr	r3, [fp, #-20]
	str	r3, [fp, #-56]
	b	.L13
.L14:
	ldr	r0, [fp, #-48]
	bl	getgrnam
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bne	.L15
	ldr	r2, [fp, #-48]
	ldr	r1, .L27+20
	mov	r0, #1
	bl	err
.L15:
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #8]
	str	r3, [fp, #-56]
.L13:
	ldr	r3, [fp, #-40]
	cmp	r3, #0
	bne	.L16
	sub	r3, fp, #56
	mov	r1, r3
	mov	r0, #1
	bl	setgroups
	mov	r3, r0
	cmp	r3, #0
	bge	.L17
	ldr	r3, [fp, #-56]
	mov	r2, r3
	ldr	r1, .L27+24
	mov	r0, #1
	bl	err
.L16:
	mov	r3, #0
	str	r3, [fp, #-52]
	mov	r3, #0
	str	r3, [fp, #-36]
.L22:
	ldr	r3, [fp, #-40]
	ldr	r0, [r3]
	ldr	r1, [fp, #-56]
	sub	r3, fp, #52
	ldr	r2, [fp, #-36]
	bl	getgrouplist
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	blt	.L18
	ldr	r3, [fp, #-52]
	ldr	r1, [fp, #-36]
	mov	r0, r3
	bl	setgroups
	mov	r3, r0
	cmp	r3, #0
	bge	.L26
	ldr	r1, .L27+28
	mov	r0, #1
	bl	err
.L18:
	ldr	r3, [fp, #-52]
	lsl	r3, r3, #2
	mov	r1, r3
	ldr	r0, [fp, #-36]
	bl	realloc
	str	r0, [fp, #-36]
	ldr	r3, [fp, #-36]
	cmp	r3, #0
	bne	.L22
	ldr	r1, .L27+32
	mov	r0, #1
	bl	err
.L26:
	nop
.L17:
	ldr	r3, [fp, #-56]
	mov	r0, r3
	bl	setgid
	mov	r3, r0
	cmp	r3, #0
	bge	.L23
	ldr	r3, [fp, #-56]
	mov	r2, r3
	ldr	r1, .L27+36
	mov	r0, #1
	bl	err
.L23:
	ldr	r0, [fp, #-44]
	bl	setuid
	mov	r3, r0
	cmp	r3, #0
	bge	.L24
	ldr	r2, [fp, #-44]
	ldr	r1, .L27+40
	mov	r0, #1
	bl	err
.L24:
	ldr	r3, [fp, #-28]
	ldr	r3, [r3]
	ldr	r1, [fp, #-28]
	mov	r0, r3
	bl	execvp
	ldr	r3, [fp, #-28]
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L27+44
	mov	r0, #1
	bl	err
.L28:
	.align	2
.L27:
	.word	.LC11
	.word	argv0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
