// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]libcperciva/liball/../util/setuidgid.c
// Function: set_group
static int
set_group(const char * groupname)
{
	gid_t gid;
	struct group * group_info;

	/*
	 * Attempt to convert the group name to a group ID.  If the database
	 * lookup fails with an error, return; but if it fails without an error
	 * (indicating that it successfully found that the name does not exist)
	 * fall back to trying to parse the name as a numeric group ID.
	 */
	errno = 0;
	if ((group_info = getgrnam(groupname)) != NULL) {
		gid = group_info->gr_gid;
	} else if (errno) {
		warnp("getgrnam(%s)", groupname);
		goto err0;
	} else if (PARSENUM(&gid, groupname)) {
		warn0("No such group: %s", groupname);
		goto err0;
	}

	/* Set GID. */
	if (setgid(gid)) {
		/* We handle EPERM separately; keep it in errno. */
		if (errno != EPERM)
			warnp("setgid(%lu)", (unsigned long int)gid);
		goto err0;
	}

	/* Success! */
	return (0);

err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
callq 0x1070
movl $0x0, (%rax)
movq -0x10(%rbp), %rdi
callq 0x1120
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
je 0x1859
movq -0x20(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0x14(%rbp)
jmp 0x197e
callq 0x1070
cmpl $0x0, (%rax)
je 0x18a7
jmp 0x1865
callq 0x1070
cmpl $0x0, (%rax)
je 0x188e
movq -0x10(%rbp), %rsi
leaq 0x190c(%rip), %rdi      # 0x3186
movb $0x0, %al
callq 0x1e10
callq 0x1070
movl $0x0, (%rax)
jmp 0x18a0
movq -0x10(%rbp), %rsi
leaq 0x18ed(%rip), %rdi      # 0x3186
movb $0x0, %al
callq 0x2060
jmp 0x18a2
jmp 0x19e3
callq 0x1070
movl $0x0, (%rax)
movl $0x1, -0x14(%rbp)
movl -0x14(%rbp), %eax
shrl %eax
movl %eax, -0x14(%rbp)
cmpl $0x0, %eax
jbe 0x18eb
movq -0x10(%rbp), %rdi
movsd 0x17ae(%rip), %xmm0     # 0x3080
movsd 0x17ae(%rip), %xmm1     # 0x3088
xorl %esi, %esi
callq 0x1be0
cvttsd2si %xmm0, %rax
movl %eax, -0x14(%rbp)
jmp 0x194f
movl $0xffffffff, -0x14(%rbp) # imm = 0xFFFFFFFF
movb $0x1, %al
testb $0x1, %al
jne 0x18fa
jmp 0x191c
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %eax
movl %eax, %edx
movl -0x14(%rbp), %eax
movl %eax, %ecx
xorl %eax, %eax
movl %eax, %esi
xorl %r9d, %r9d
movl %r9d, %r8d
callq 0x1c90
movl %eax, -0x14(%rbp)
jmp 0x194d
movq 0x36d5(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0x1866(%rip), %rsi      # 0x3193
leaq 0x18cd(%rip), %rdx      # 0x3201
leaq 0x17a0(%rip), %rcx      # 0x30db
movl $0x54, %r8d
movb $0x0, %al
callq 0x1100
callq 0x1060
jmp 0x194f
callq 0x1070
cmpl $0x0, (%rax)
je 0x197a
jmp 0x195b
movq -0x10(%rbp), %rsi
leaq 0x18a5(%rip), %rdi      # 0x320b
movb $0x0, %al
callq 0x2060
callq 0x1070
movl $0x0, (%rax)
jmp 0x19e3
jmp 0x197c
jmp 0x197e
movl -0x14(%rbp), %edi
callq 0x1170
cmpl $0x0, %eax
je 0x19da
callq 0x1070
cmpl $0x1, (%rax)
je 0x19d8
jmp 0x1997
callq 0x1070
cmpl $0x0, (%rax)
je 0x19c1
movl -0x14(%rbp), %eax
movl %eax, %esi
leaq 0x1870(%rip), %rdi      # 0x321d
movb $0x0, %al
callq 0x1e10
callq 0x1070
movl $0x0, (%rax)
jmp 0x19d4
movl -0x14(%rbp), %eax
movl %eax, %esi
leaq 0x1850(%rip), %rdi      # 0x321d
movb $0x0, %al
callq 0x2060
jmp 0x19d6
jmp 0x19d8
jmp 0x19e3
movl $0x0, -0x4(%rbp)
jmp 0x19ea
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)