#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
struct passwd {
  int /*<<< orphan*/ pw_uid;
};
struct group {
  int /*<<< orphan*/ gr_gid;
};

/* Variables and functions */
int ENOENT;
int EPERM;
int errno;
struct group *getgrnam(char const *);
struct passwd *getpwnam(char const *);
int /*<<< orphan*/ logError(char *, int, int, char *);
scalar_t__ setegid(int /*<<< orphan*/);
scalar_t__ seteuid(int /*<<< orphan*/);
char *strerror(int);
int set_run_by(const char *group_name, const char *username) {
  struct group *pGroup;
  struct passwd *pUser;
  int nErrNo;
  if (group_name != NULL && *group_name != '\0') {
    pGroup = getgrnam(group_name);
    if (pGroup == NULL) {
      nErrNo = errno != 0 ? errno : ENOENT;
      logError("file: "
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/fatedier/studies/refs/heads/"
               "master/fastdfs-5.01/common/shared_func.c"
               ", line: %d, "
               "getgrnam fail, errno: %d, error info: %s.",
               1452, nErrNo,
               (strerror(nErrNo) != NULL ? strerror(nErrNo) : "Unkown error"));
      return nErrNo;
    }
    if (setegid(pGroup->gr_gid) != 0) {
      nErrNo = errno != 0 ? errno : EPERM;
      logError("file: "
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/fatedier/studies/refs/heads/"
               "master/fastdfs-5.01/common/shared_func.c"
               ", line: %d, "
               "setegid fail, errno: %d, error info: %s.",
               1461, nErrNo,
               (strerror(nErrNo) != NULL ? strerror(nErrNo) : "Unkown error"));
      return nErrNo;
    }
  }
  if (username != NULL && *username != '\0') {
    pUser = getpwnam(username);
    if (pUser == NULL) {
      nErrNo = errno != 0 ? errno : ENOENT;
      logError("file: "
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/fatedier/studies/refs/heads/"
               "master/fastdfs-5.01/common/shared_func.c"
               ", line: %d, "
               "getpwnam fail, errno: %d, error info: %s.",
               1474, nErrNo,
               (strerror(nErrNo) != NULL ? strerror(nErrNo) : "Unkown error"));
      return nErrNo;
    }
    if (seteuid(pUser->pw_uid) != 0) {
      nErrNo = errno != 0 ? errno : EPERM;
      logError("file: "
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/fatedier/studies/refs/heads/"
               "master/fastdfs-5.01/common/shared_func.c"
               ", line: %d, "
               "seteuid fail, errno: %d, error info: %s.",
               1483, nErrNo,
               (strerror(nErrNo) != NULL ? strerror(nErrNo) : "Unkown error"));
      return nErrNo;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<set_run_by>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     12db <set_run_by+0x17b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     12db <set_run_by+0x17b>
mov    -0x10(%rbp),%rdi
call   1050 <getgrnam@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1232 <set_run_by+0xd2>
mov    0x2e36(%rip),%rax
cmpl   $0x0,(%rax)
je     11c4 <set_run_by+0x64>
mov    0x2e26(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x30(%rbp)
jmp    11d0 <set_run_by+0x70>
mov    0x2e05(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x2c(%rbp),%edi
call   1060 <strerror@plt>
cmp    $0x0,%rax
je     11ff <set_run_by+0x9f>
mov    -0x2c(%rbp),%edi
call   1060 <strerror@plt>
mov    %rax,-0x40(%rbp)
jmp    120f <set_run_by+0xaf>
lea    0xed4(%rip),%rax
mov    %rax,-0x40(%rbp)
jmp    120f <set_run_by+0xaf>
mov    -0x34(%rbp),%edx
mov    -0x40(%rbp),%rcx
lea    0xde3(%rip),%rdi
mov    $0x5ac,%esi
call   1030 <logError@plt>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    144d <set_run_by+0x2ed>
mov    -0x20(%rbp),%rax
mov    (%rax),%edi
call   1070 <setegid@plt>
cmp    $0x0,%rax
je     12d6 <set_run_by+0x176>
mov    0x2d92(%rip),%rax
cmpl   $0x0,(%rax)
je     1268 <set_run_by+0x108>
mov    0x2d82(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x44(%rbp)
jmp    1274 <set_run_by+0x114>
mov    0x2d59(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x48(%rbp)
mov    -0x2c(%rbp),%edi
call   1060 <strerror@plt>
cmp    $0x0,%rax
je     12a3 <set_run_by+0x143>
mov    -0x2c(%rbp),%edi
call   1060 <strerror@plt>
mov    %rax,-0x50(%rbp)
jmp    12b3 <set_run_by+0x153>
lea    0xe30(%rip),%rax
mov    %rax,-0x50(%rbp)
jmp    12b3 <set_run_by+0x153>
mov    -0x48(%rbp),%edx
mov    -0x50(%rbp),%rcx
lea    0xe26(%rip),%rdi
mov    $0x5b5,%esi
call   1030 <logError@plt>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    144d <set_run_by+0x2ed>
jmp    12db <set_run_by+0x17b>
cmpq   $0x0,-0x18(%rbp)
je     1446 <set_run_by+0x2e6>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1446 <set_run_by+0x2e6>
mov    -0x18(%rbp),%rdi
call   1040 <getpwnam@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    139d <set_run_by+0x23d>
mov    0x2ccb(%rip),%rax
cmpl   $0x0,(%rax)
je     132f <set_run_by+0x1cf>
mov    0x2cbb(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x54(%rbp)
jmp    133b <set_run_by+0x1db>
mov    0x2c9a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x54(%rbp)
mov    -0x54(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x58(%rbp)
mov    -0x2c(%rbp),%edi
call   1060 <strerror@plt>
cmp    $0x0,%rax
je     136a <set_run_by+0x20a>
mov    -0x2c(%rbp),%edi
call   1060 <strerror@plt>
mov    %rax,-0x60(%rbp)
jmp    137a <set_run_by+0x21a>
lea    0xd69(%rip),%rax
mov    %rax,-0x60(%rbp)
jmp    137a <set_run_by+0x21a>
mov    -0x58(%rbp),%edx
mov    -0x60(%rbp),%rcx
lea    0xe38(%rip),%rdi
mov    $0x5c2,%esi
call   1030 <logError@plt>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    144d <set_run_by+0x2ed>
mov    -0x28(%rbp),%rax
mov    (%rax),%edi
call   1080 <seteuid@plt>
cmp    $0x0,%rax
je     1441 <set_run_by+0x2e1>
mov    0x2c27(%rip),%rax
cmpl   $0x0,(%rax)
je     13d3 <set_run_by+0x273>
mov    0x2c17(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x64(%rbp)
jmp    13df <set_run_by+0x27f>
mov    0x2bee(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x64(%rbp)
mov    -0x64(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x68(%rbp)
mov    -0x2c(%rbp),%edi
call   1060 <strerror@plt>
cmp    $0x0,%rax
je     140e <set_run_by+0x2ae>
mov    -0x2c(%rbp),%edi
call   1060 <strerror@plt>
mov    %rax,-0x70(%rbp)
jmp    141e <set_run_by+0x2be>
lea    0xcc5(%rip),%rax
mov    %rax,-0x70(%rbp)
jmp    141e <set_run_by+0x2be>
mov    -0x68(%rbp),%edx
mov    -0x70(%rbp),%rcx
lea    0xe6e(%rip),%rdi
mov    $0x5cb,%esi
call   1030 <logError@plt>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    144d <set_run_by+0x2ed>
jmp    1446 <set_run_by+0x2e6>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_run_by>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
test   %rdi,%rdi
je     11bf <set_run_by+0x5f>
cmpb   $0x0,(%rdi)
je     11bf <set_run_by+0x5f>
call   1050 <getgrnam@plt>
test   %rax,%rax
je     1225 <set_run_by+0xc5>
mov    (%rax),%edi
call   1070 <setegid@plt>
test   %rax,%rax
je     11bf <set_run_by+0x5f>
mov    0x2e4f(%rip),%rax
mov    (%rax),%ebp
test   %ebp,%ebp
jne    11a0 <set_run_by+0x40>
mov    0x2e2a(%rip),%rax
mov    (%rax),%ebp
mov    %ebp,%edi
call   1060 <strerror@plt>
test   %rax,%rax
je     1281 <set_run_by+0x121>
mov    %ebp,%edi
call   1060 <strerror@plt>
mov    %rax,%rcx
jmp    1288 <set_run_by+0x128>
xor    %ebp,%ebp
test   %rbx,%rbx
je     12da <set_run_by+0x17a>
cmpb   $0x0,(%rbx)
je     12da <set_run_by+0x17a>
mov    %rbx,%rdi
call   1040 <getpwnam@plt>
test   %rax,%rax
je     1253 <set_run_by+0xf3>
mov    (%rax),%edi
call   1080 <seteuid@plt>
test   %rax,%rax
je     12da <set_run_by+0x17a>
mov    0x2de9(%rip),%rax
mov    (%rax),%ebp
test   %ebp,%ebp
jne    1206 <set_run_by+0xa6>
mov    0x2dc4(%rip),%rax
mov    (%rax),%ebp
mov    %ebp,%edi
call   1060 <strerror@plt>
test   %rax,%rax
je     12ab <set_run_by+0x14b>
mov    %ebp,%edi
call   1060 <strerror@plt>
mov    %rax,%rcx
jmp    12b2 <set_run_by+0x152>
mov    0x2db4(%rip),%rax
mov    (%rax),%ebp
test   %ebp,%ebp
jne    123b <set_run_by+0xdb>
mov    0x2d97(%rip),%rax
mov    (%rax),%ebp
mov    %ebp,%edi
call   1060 <strerror@plt>
test   %rax,%rax
je     1296 <set_run_by+0x136>
mov    %ebp,%edi
call   1060 <strerror@plt>
mov    %rax,%rcx
jmp    129d <set_run_by+0x13d>
mov    0x2d86(%rip),%rax
mov    (%rax),%ebp
test   %ebp,%ebp
jne    1269 <set_run_by+0x109>
mov    0x2d69(%rip),%rax
mov    (%rax),%ebp
mov    %ebp,%edi
call   1060 <strerror@plt>
test   %rax,%rax
je     12c0 <set_run_by+0x160>
mov    %ebp,%edi
call   1060 <strerror@plt>
mov    %rax,%rcx
jmp    12c7 <set_run_by+0x167>
lea    0xe52(%rip),%rcx
lea    0xe58(%rip),%rdi
mov    $0x5b5,%esi
jmp    12d3 <set_run_by+0x173>
lea    0xe3d(%rip),%rcx
lea    0xd5c(%rip),%rdi
mov    $0x5ac,%esi
jmp    12d3 <set_run_by+0x173>
lea    0xe28(%rip),%rcx
lea    0xfe1(%rip),%rdi
mov    $0x5cb,%esi
jmp    12d3 <set_run_by+0x173>
lea    0xe13(%rip),%rcx
lea    0xef2(%rip),%rdi
mov    $0x5c2,%esi
mov    %ebp,%edx
call   1030 <logError@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.group = type { i32 }
%struct.passwd = type { i32 }
@errno = global i32 0
@ENOENT = global i32 0
@.str = [218 x i8] c"file: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fatedier/studies/refs/heads/master/fastdfs-5.01/common/shared_func.c, line: %d, getgrnam fail, errno: %d, error info: %s.\00"
@.str.1 = [13 x i8] c"Unkown error\00"
@EPERM = global i32 0
@.str.2 = [217 x i8] c"file: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fatedier/studies/refs/heads/master/fastdfs-5.01/common/shared_func.c, line: %d, setegid fail, errno: %d, error info: %s.\00"
@.str.3 = [218 x i8] c"file: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fatedier/studies/refs/heads/master/fastdfs-5.01/common/shared_func.c, line: %d, getpwnam fail, errno: %d, error info: %s.\00"
@.str.4 = [217 x i8] c"file: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fatedier/studies/refs/heads/master/fastdfs-5.01/common/shared_func.c, line: %d, seteuid fail, errno: %d, error info: %s.\00"
define i32 @set_run_by(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca %struct.group*
%7 = alloca %struct.passwd*
%8 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
%9 = load i8*, i8** %4
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %70
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %70
16: ; preds = %11
%17 = load i8*, i8** %4
%18 = call %struct.group* @getgrnam(i8* %17)
store %struct.group* %18, %struct.group** %6
%19 = load %struct.group*, %struct.group** %6
%20 = icmp eq %struct.group* %19, null
br i1 %20, label %21, label %42
21: ; preds = %16
%22 = load i32, i32* @errno
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %21
%25 = load i32, i32* @errno
br label %28
26: ; preds = %21
%27 = load i32, i32* @ENOENT
br label %28
28: ; preds = %26, %24
%29 = phi i32 [ %25, %24 ], [ %27, %26 ]
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = load i32, i32* %8
%32 = call i8* @strerror(i32 %31)
%33 = icmp ne i8* %32, null
br i1 %33, label %34, label %37
34: ; preds = %28
%35 = load i32, i32* %8
%36 = call i8* @strerror(i32 %35)
br label %38
37: ; preds = %28
br label %38
38: ; preds = %37, %34
%39 = phi i8* [ %36, %34 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), %37 ]
%40 = call i32 @logError(i8* getelementptr inbounds ([218 x i8], [218 x i8]* @.str, i64 0, i64 0), i32 1452, i32 %30, i8* %39)
%41 = load i32, i32* %8
store i32 %41, i32* %3
br label %133
42: ; preds = %16
%43 = load %struct.group*, %struct.group** %6
%44 = getelementptr inbounds %struct.group, %struct.group* %43, i32 0, i32 0
%45 = load i32, i32* %44
%46 = call i64 @setegid(i32 %45)
%47 = icmp ne i64 %46, 0
br i1 %47, label %48, label %69
48: ; preds = %42
%49 = load i32, i32* @errno
%50 = icmp ne i32 %49, 0
br i1 %50, label %51, label %53
51: ; preds = %48
%52 = load i32, i32* @errno
br label %55
53: ; preds = %48
%54 = load i32, i32* @EPERM
br label %55
55: ; preds = %53, %51
%56 = phi i32 [ %52, %51 ], [ %54, %53 ]
store i32 %56, i32* %8
%57 = load i32, i32* %8
%58 = load i32, i32* %8
%59 = call i8* @strerror(i32 %58)
%60 = icmp ne i8* %59, null
br i1 %60, label %61, label %64
61: ; preds = %55
%62 = load i32, i32* %8
%63 = call i8* @strerror(i32 %62)
br label %65
64: ; preds = %55
br label %65
65: ; preds = %64, %61
%66 = phi i8* [ %63, %61 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), %64 ]
%67 = call i32 @logError(i8* getelementptr inbounds ([217 x i8], [217 x i8]* @.str.2, i64 0, i64 0), i32 1461, i32 %57, i8* %66)
%68 = load i32, i32* %8
store i32 %68, i32* %3
br label %133
69: ; preds = %42
br label %70
70: ; preds = %69, %11, %2
%71 = load i8*, i8** %5
%72 = icmp ne i8* %71, null
br i1 %72, label %73, label %132
73: ; preds = %70
%74 = load i8*, i8** %5
%75 = load i8, i8* %74
%76 = sext i8 %75 to i32
%77 = icmp ne i32 %76, 0
br i1 %77, label %78, label %132
78: ; preds = %73
%79 = load i8*, i8** %5
%80 = call %struct.passwd* @getpwnam(i8* %79)
store %struct.passwd* %80, %struct.passwd** %7
%81 = load %struct.passwd*, %struct.passwd** %7
%82 = icmp eq %struct.passwd* %81, null
br i1 %82, label %83, label %104
83: ; preds = %78
%84 = load i32, i32* @errno
%85 = icmp ne i32 %84, 0
br i1 %85, label %86, label %88
86: ; preds = %83
%87 = load i32, i32* @errno
br label %90
88: ; preds = %83
%89 = load i32, i32* @ENOENT
br label %90
90: ; preds = %88, %86
%91 = phi i32 [ %87, %86 ], [ %89, %88 ]
store i32 %91, i32* %8
%92 = load i32, i32* %8
%93 = load i32, i32* %8
%94 = call i8* @strerror(i32 %93)
%95 = icmp ne i8* %94, null
br i1 %95, label %96, label %99
96: ; preds = %90
%97 = load i32, i32* %8
%98 = call i8* @strerror(i32 %97)
br label %100
99: ; preds = %90
br label %100
100: ; preds = %99, %96
%101 = phi i8* [ %98, %96 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), %99 ]
%102 = call i32 @logError(i8* getelementptr inbounds ([218 x i8], [218 x i8]* @.str.3, i64 0, i64 0), i32 1474, i32 %92, i8* %101)
%103 = load i32, i32* %8
store i32 %103, i32* %3
br label %133
104: ; preds = %78
%105 = load %struct.passwd*, %struct.passwd** %7
%106 = getelementptr inbounds %struct.passwd, %struct.passwd* %105, i32 0, i32 0
%107 = load i32, i32* %106
%108 = call i64 @seteuid(i32 %107)
%109 = icmp ne i64 %108, 0
br i1 %109, label %110, label %131
110: ; preds = %104
%111 = load i32, i32* @errno
%112 = icmp ne i32 %111, 0
br i1 %112, label %113, label %115
113: ; preds = %110
%114 = load i32, i32* @errno
br label %117
115: ; preds = %110
%116 = load i32, i32* @EPERM
br label %117
117: ; preds = %115, %113
%118 = phi i32 [ %114, %113 ], [ %116, %115 ]
store i32 %118, i32* %8
%119 = load i32, i32* %8
%120 = load i32, i32* %8
%121 = call i8* @strerror(i32 %120)
%122 = icmp ne i8* %121, null
br i1 %122, label %123, label %126
123: ; preds = %117
%124 = load i32, i32* %8
%125 = call i8* @strerror(i32 %124)
br label %127
126: ; preds = %117
br label %127
127: ; preds = %126, %123
%128 = phi i8* [ %125, %123 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), %126 ]
%129 = call i32 @logError(i8* getelementptr inbounds ([217 x i8], [217 x i8]* @.str.4, i64 0, i64 0), i32 1483, i32 %119, i8* %128)
%130 = load i32, i32* %8
store i32 %130, i32* %3
br label %133
131: ; preds = %104
br label %132
132: ; preds = %131, %73, %70
store i32 0, i32* %3
br label %133
133: ; preds = %132, %127, %100, %65, %38
%134 = load i32, i32* %3
ret i32 %134
}

LLVM IR (-O2):
%struct.group = type { i32 }
%struct.passwd = type { i32 }
@errno = global i32 0
@ENOENT = global i32 0
@.str = [218 x i8] c"file: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fatedier/studies/refs/heads/master/fastdfs-5.01/common/shared_func.c, line: %d, getgrnam fail, errno: %d, error info: %s.\00"
@.str.1 = [13 x i8] c"Unkown error\00"
@EPERM = global i32 0
@.str.2 = [217 x i8] c"file: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fatedier/studies/refs/heads/master/fastdfs-5.01/common/shared_func.c, line: %d, setegid fail, errno: %d, error info: %s.\00"
@.str.3 = [218 x i8] c"file: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fatedier/studies/refs/heads/master/fastdfs-5.01/common/shared_func.c, line: %d, getpwnam fail, errno: %d, error info: %s.\00"
@.str.4 = [217 x i8] c"file: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fatedier/studies/refs/heads/master/fastdfs-5.01/common/shared_func.c, line: %d, seteuid fail, errno: %d, error info: %s.\00"
define i32 @set_run_by(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %39, label %4
4: ; preds = %2
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %39, label %7
7: ; preds = %4
%8 = tail call %struct.group* @getgrnam(i8* %0)
%9 = icmp eq %struct.group* %8, null
br i1 %9, label %10, label %22
10: ; preds = %7
%11 = load i32, i32* @errno
%12 = icmp eq i32 %11, 0
%13 = load i32, i32* @ENOENT
%14 = select i1 %12, i32 %13, i32 %11
%15 = tail call i8* @strerror(i32 %14)
%16 = icmp eq i8* %15, null
br i1 %16, label %19, label %17
17: ; preds = %10
%18 = tail call i8* @strerror(i32 %14)
br label %19
19: ; preds = %10, %17
%20 = phi i8* [ %18, %17 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), %10 ]
%21 = tail call i32 @logError(i8* getelementptr inbounds ([218 x i8], [218 x i8]* @.str, i64 0, i64 0), i32 1452, i32 %14, i8* %20)
br label %76
22: ; preds = %7
%23 = getelementptr inbounds %struct.group, %struct.group* %8, i64 0, i32 0
%24 = load i32, i32* %23
%25 = tail call i64 @setegid(i32 %24)
%26 = icmp eq i64 %25, 0
br i1 %26, label %39, label %27
27: ; preds = %22
%28 = load i32, i32* @errno
%29 = icmp eq i32 %28, 0
%30 = load i32, i32* @EPERM
%31 = select i1 %29, i32 %30, i32 %28
%32 = tail call i8* @strerror(i32 %31)
%33 = icmp eq i8* %32, null
br i1 %33, label %36, label %34
34: ; preds = %27
%35 = tail call i8* @strerror(i32 %31)
br label %36
36: ; preds = %27, %34
%37 = phi i8* [ %35, %34 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), %27 ]
%38 = tail call i32 @logError(i8* getelementptr inbounds ([217 x i8], [217 x i8]* @.str.2, i64 0, i64 0), i32 1461, i32 %31, i8* %37)
br label %76
39: ; preds = %22, %4, %2
%40 = icmp eq i8* %1, null
br i1 %40, label %76, label %41
41: ; preds = %39
%42 = load i8, i8* %1
%43 = icmp eq i8 %42, 0
br i1 %43, label %76, label %44
44: ; preds = %41
%45 = tail call %struct.passwd* @getpwnam(i8* %1)
%46 = icmp eq %struct.passwd* %45, null
br i1 %46, label %47, label %59
47: ; preds = %44
%48 = load i32, i32* @errno
%49 = icmp eq i32 %48, 0
%50 = load i32, i32* @ENOENT
%51 = select i1 %49, i32 %50, i32 %48
%52 = tail call i8* @strerror(i32 %51)
%53 = icmp eq i8* %52, null
br i1 %53, label %56, label %54
54: ; preds = %47
%55 = tail call i8* @strerror(i32 %51)
br label %56
56: ; preds = %47, %54
%57 = phi i8* [ %55, %54 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), %47 ]
%58 = tail call i32 @logError(i8* getelementptr inbounds ([218 x i8], [218 x i8]* @.str.3, i64 0, i64 0), i32 1474, i32 %51, i8* %57)
br label %76
59: ; preds = %44
%60 = getelementptr inbounds %struct.passwd, %struct.passwd* %45, i64 0, i32 0
%61 = load i32, i32* %60
%62 = tail call i64 @seteuid(i32 %61)
%63 = icmp eq i64 %62, 0
br i1 %63, label %76, label %64
64: ; preds = %59
%65 = load i32, i32* @errno
%66 = icmp eq i32 %65, 0
%67 = load i32, i32* @EPERM
%68 = select i1 %66, i32 %67, i32 %65
%69 = tail call i8* @strerror(i32 %68)
%70 = icmp eq i8* %69, null
br i1 %70, label %73, label %71
71: ; preds = %64
%72 = tail call i8* @strerror(i32 %68)
br label %73
73: ; preds = %64, %71
%74 = phi i8* [ %72, %71 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), %64 ]
%75 = tail call i32 @logError(i8* getelementptr inbounds ([217 x i8], [217 x i8]* @.str.4, i64 0, i64 0), i32 1483, i32 %68, i8* %74)
br label %76
76: ; preds = %39, %41, %59, %73, %56, %36, %19
%77 = phi i32 [ %14, %19 ], [ %31, %36 ], [ %51, %56 ], [ %68, %73 ], [ 0, %59 ], [ 0, %41 ], [ 0, %39 ]
ret i32 %77
}