#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 pw_uid;
  int pw_gid;
};
struct group {
  int gr_gid;
};
typedef int /*<<< orphan*/ errbuff;

/* Variables and functions */
scalar_t__ errno;
int /*<<< orphan*/ free(char *);
struct group *getgrnam(char const *);
struct passwd *getpwnam(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ memcpy(char *, char const *, int);
int /*<<< orphan*/ snprintf(char *, int, char *, char const *);
int strtoul(char const *, char **, int);
const char *owner_parse(const char *spec, int *uid, int *gid) {
  static char errbuff[128];
  const char *u, *ue, *g;
  *uid = -1;
  *gid = -1;
  if (spec[0] == '\0')
    return ("Invalid empty user/group spec");
  if (*spec == ':' || *spec == '.') {
    ue = u = NULL;
    g = spec + 1;
  } else {
    ue = u = spec;
    while (*ue != ':' && *ue != '.' && *ue != '\0')
      ++ue;
    g = ue;
    if (*g != '\0')
      ++g;
  }
  if (u != NULL) {
    char *user;
    struct passwd *pwent;
    user = (char *)malloc(ue - u + 1);
    if (user == NULL)
      return ("Couldn't allocate memory");
    memcpy(user, u, ue - u);
    user[ue - u] = '\0';
    if ((pwent = getpwnam(user)) != NULL) {
      *uid = pwent->pw_uid;
      if (*ue != '\0')
        *gid = pwent->pw_gid;
    } else {
      char *end;
      errno = 0;
      *uid = strtoul(user, &end, 10);
      if (errno || *end != '\0') {
        snprintf(errbuff, sizeof(errbuff), "Couldn't lookup user ``%s''", user);
        errbuff[sizeof(errbuff) - 1] = '\0';
        return (errbuff);
      }
    }
    free(user);
  }
  if (*g != '\0') {
    struct group *grp;
    if ((grp = getgrnam(g)) != NULL) {
      *gid = grp->gr_gid;
    } else {
      char *end;
      errno = 0;
      *gid = strtoul(g, &end, 10);
      if (errno || *end != '\0') {
        snprintf(errbuff, sizeof(errbuff), "Couldn't lookup group ``%s''", g);
        errbuff[sizeof(errbuff) - 1] = '\0';
        return (errbuff);
      }
    }
  }
  return (NULL);
}


x86 assembly (clang, -O0):
<owner_parse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movl   $0xffffffff,(%rax)
mov    -0x20(%rbp),%rax
movl   $0xffffffff,(%rax)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    11b8 <owner_parse+0x48>
lea    0xe51(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    148b <owner_parse+0x31b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3a,%eax
je     11d8 <owner_parse+0x68>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    11f9 <owner_parse+0x89>
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    1289 <owner_parse+0x119>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x3a,%ecx
mov    %al,-0x61(%rbp)
je     123f <owner_parse+0xcf>
mov    -0x30(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x2e,%ecx
mov    %al,-0x61(%rbp)
je     123f <owner_parse+0xcf>
mov    -0x30(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x61(%rbp)
mov    -0x61(%rbp),%al
test   $0x1,%al
jne    124f <owner_parse+0xdf>
jmp    1260 <owner_parse+0xf0>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    1205 <owner_parse+0x95>
mov    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1284 <owner_parse+0x114>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    1289 <owner_parse+0x119>
cmpq   $0x0,-0x28(%rbp)
je     13c5 <owner_parse+0x255>
mov    -0x30(%rbp),%rax
mov    -0x28(%rbp),%rcx
sub    %rcx,%rax
add    $0x1,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    12c9 <owner_parse+0x159>
lea    0xd5e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    148b <owner_parse+0x31b>
mov    -0x40(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rax
mov    -0x28(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%edx
call   1060 <memcpy@plt>
mov    -0x40(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    -0x28(%rbp),%rdx
sub    %rdx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x40(%rbp),%rdi
call   1050 <getpwnam@plt>
mov    %rax,-0x48(%rbp)
cmp    $0x0,%rax
je     133b <owner_parse+0x1cb>
mov    -0x48(%rbp),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x30(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1336 <owner_parse+0x1c6>
mov    -0x48(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
jmp    13bc <owner_parse+0x24c>
mov    0x2c9e(%rip),%rax
movq   $0x0,(%rax)
mov    -0x40(%rbp),%rdi
lea    -0x50(%rbp),%rsi
mov    $0xa,%edx
call   1090 <strtoul@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    0x2c76(%rip),%rax
cmpq   $0x0,(%rax)
jne    1384 <owner_parse+0x214>
mov    -0x50(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     13b7 <owner_parse+0x247>
mov    -0x40(%rbp),%rcx
lea    0x2ce1(%rip),%rdi
mov    $0x80,%esi
lea    0xc9c(%rip),%rdx
call   1040 <snprintf@plt>
movb   $0x0,0x2d48(%rip)
lea    0x2cc2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    148b <owner_parse+0x31b>
jmp    13bc <owner_parse+0x24c>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    -0x38(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1483 <owner_parse+0x313>
mov    -0x38(%rbp),%rdi
call   1070 <getgrnam@plt>
mov    %rax,-0x58(%rbp)
cmp    $0x0,%rax
je     13fd <owner_parse+0x28d>
mov    -0x58(%rbp),%rax
mov    (%rax),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
jmp    147e <owner_parse+0x30e>
mov    0x2bdc(%rip),%rax
movq   $0x0,(%rax)
mov    -0x38(%rbp),%rdi
lea    -0x60(%rbp),%rsi
mov    $0xa,%edx
call   1090 <strtoul@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    0x2bb4(%rip),%rax
cmpq   $0x0,(%rax)
jne    1446 <owner_parse+0x2d6>
mov    -0x60(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1479 <owner_parse+0x309>
mov    -0x38(%rbp),%rcx
lea    0x2c1f(%rip),%rdi
mov    $0x80,%esi
lea    0xbf6(%rip),%rdx
call   1040 <snprintf@plt>
movb   $0x0,0x2c86(%rip)
lea    0x2c00(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    148b <owner_parse+0x31b>
jmp    147e <owner_parse+0x30e>
jmp    1483 <owner_parse+0x313>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<owner_parse>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
movl   $0xffffffff,(%rsi)
movl   $0xffffffff,(%rdx)
mov    (%rdi),%al
test   %al,%al
je     11c9 <owner_parse+0x59>
mov    %rdx,%r14
mov    %rdi,%r13
cmp    $0x2e,%al
je     119b <owner_parse+0x2b>
cmp    $0x3a,%al
jne    11d5 <owner_parse+0x65>
add    $0x1,%r13
mov    %r13,%r15
cmpb   $0x0,(%r15)
je     12bd <owner_parse+0x14d>
mov    %r15,%rdi
call   1070 <getgrnam@plt>
test   %rax,%rax
je     1272 <owner_parse+0x102>
mov    (%rax),%eax
mov    %eax,(%r14)
xor    %ebx,%ebx
jmp    1326 <owner_parse+0x1b6>
lea    0xe30(%rip),%rbx
jmp    1326 <owner_parse+0x1b6>
mov    %rsi,%r12
xor    %ebx,%ebx
movabs $0x400400000000001,%rcx
jmp    11fa <owner_parse+0x8a>
cs nopw 0x0(%rax,%rax,1)
movzbl 0x1(%r13,%rbx,1),%eax
add    $0x1,%rbx
cmp    $0x3a,%al
ja     11f0 <owner_parse+0x80>
movzbl %al,%edx
bt     %rdx,%rcx
jae    11f0 <owner_parse+0x80>
cmp    $0x1,%al
mov    %r13,%r15
sbb    $0xffffffffffffffff,%r15
lea    0x1(%rbx),%edi
call   1080 <malloc@plt>
test   %rax,%rax
je     12c1 <owner_parse+0x151>
mov    %rax,%rbp
mov    %rax,%rdi
mov    %r13,%rsi
mov    %ebx,%edx
call   1060 <memcpy@plt>
movb   $0x0,0x0(%rbp,%rbx,1)
mov    %rbp,%rdi
call   1050 <getpwnam@plt>
test   %rax,%rax
je     12ca <owner_parse+0x15a>
mov    (%rax),%ecx
mov    %ecx,(%r12)
cmpb   $0x0,0x0(%r13,%rbx,1)
je     125b <owner_parse+0xeb>
mov    0x4(%rax),%eax
mov    %eax,(%r14)
add    %rbx,%r15
mov    %rbp,%rdi
call   1030 <free@plt>
cmpb   $0x0,(%r15)
jne    11ac <owner_parse+0x3c>
jmp    12bd <owner_parse+0x14d>
mov    0x2d67(%rip),%rbx
movq   $0x0,(%rbx)
mov    %rsp,%rsi
mov    %r15,%rdi
mov    $0xa,%edx
call   1090 <strtoul@plt>
mov    %eax,(%r14)
cmpq   $0x0,(%rbx)
jne    12a2 <owner_parse+0x132>
mov    (%rsp),%rax
cmpb   $0x0,(%rax)
je     12bd <owner_parse+0x14d>
lea    0x2dc7(%rip),%rbx
lea    0xda3(%rip),%rdx
mov    %rbx,%rdi
mov    $0x80,%esi
mov    %r15,%rcx
jmp    131a <owner_parse+0x1aa>
xor    %ebx,%ebx
jmp    1326 <owner_parse+0x1b6>
lea    0xd56(%rip),%rbx
jmp    1326 <owner_parse+0x1b6>
mov    0x2d0f(%rip),%r13
movq   $0x0,0x0(%r13)
mov    %rsp,%rsi
mov    %rbp,%rdi
mov    $0xa,%edx
call   1090 <strtoul@plt>
mov    %eax,(%r12)
cmpq   $0x0,0x0(%r13)
jne    1301 <owner_parse+0x191>
mov    (%rsp),%rax
cmpb   $0x0,(%rax)
je     125b <owner_parse+0xeb>
lea    0x2d68(%rip),%rbx
lea    0xd28(%rip),%rdx
mov    %rbx,%rdi
mov    $0x80,%esi
mov    %rbp,%rcx
call   1040 <snprintf@plt>
movb   $0x0,0x2dc9(%rip)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.passwd = type { i32, i32 }
%struct.group = type { i32 }
@owner_parse.errbuff = internal global [128 x i8] zeroinitializer
@.str = [30 x i8] c"Invalid empty user/group spec\00"
@.str.1 = [25 x i8] c"Couldn't allocate memory\00"
@errno = global i64 0
@.str.2 = [28 x i8] c"Couldn't lookup user ``%s''\00"
@.str.3 = [29 x i8] c"Couldn't lookup group ``%s''\00"
define i8* @owner_parse(i8* %0, i32* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca %struct.passwd*
%13 = alloca i8*
%14 = alloca %struct.group*
%15 = alloca i8*
store i8* %0, i8** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
%16 = load i32*, i32** %6
store i32 -1, i32* %16
%17 = load i32*, i32** %7
store i32 -1, i32* %17
%18 = load i8*, i8** %5
%19 = getelementptr inbounds i8, i8* %18, i64 0
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %24
23: ; preds = %3
store i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8** %4
br label %169
24: ; preds = %3
%25 = load i8*, i8** %5
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %27, 58
br i1 %28, label %34, label %29
29: ; preds = %24
%30 = load i8*, i8** %5
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = icmp eq i32 %32, 46
br i1 %33, label %34, label %37
34: ; preds = %29, %24
store i8* null, i8** %8
store i8* null, i8** %9
%35 = load i8*, i8** %5
%36 = getelementptr inbounds i8, i8* %35, i64 1
store i8* %36, i8** %10
br label %69
37: ; preds = %29
%38 = load i8*, i8** %5
store i8* %38, i8** %8
store i8* %38, i8** %9
br label %39
39: ; preds = %56, %37
%40 = load i8*, i8** %9
%41 = load i8, i8* %40
%42 = sext i8 %41 to i32
%43 = icmp ne i32 %42, 58
br i1 %43, label %44, label %54
44: ; preds = %39
%45 = load i8*, i8** %9
%46 = load i8, i8* %45
%47 = sext i8 %46 to i32
%48 = icmp ne i32 %47, 46
br i1 %48, label %49, label %54
49: ; preds = %44
%50 = load i8*, i8** %9
%51 = load i8, i8* %50
%52 = sext i8 %51 to i32
%53 = icmp ne i32 %52, 0
br label %54
54: ; preds = %49, %44, %39
%55 = phi i1 [ false, %44 ], [ false, %39 ], [ %53, %49 ]
br i1 %55, label %56, label %59
56: ; preds = %54
%57 = load i8*, i8** %9
%58 = getelementptr inbounds i8, i8* %57, i32 1
store i8* %58, i8** %9
br label %39
59: ; preds = %54
%60 = load i8*, i8** %9
store i8* %60, i8** %10
%61 = load i8*, i8** %10
%62 = load i8, i8* %61
%63 = sext i8 %62 to i32
%64 = icmp ne i32 %63, 0
br i1 %64, label %65, label %68
65: ; preds = %59
%66 = load i8*, i8** %10
%67 = getelementptr inbounds i8, i8* %66, i32 1
store i8* %67, i8** %10
br label %68
68: ; preds = %65, %59
br label %69
69: ; preds = %68, %34
%70 = load i8*, i8** %8
%71 = icmp ne i8* %70, null
br i1 %71, label %72, label %138
72: ; preds = %69
%73 = load i8*, i8** %9
%74 = load i8*, i8** %8
%75 = ptrtoint i8* %73 to i64
%76 = ptrtoint i8* %74 to i64
%77 = sub i64 %75, %76
%78 = add nsw i64 %77, 1
%79 = trunc i64 %78 to i32
%80 = call i64 @malloc(i32 %79)
%81 = inttoptr i64 %80 to i8*
store i8* %81, i8** %11
%82 = load i8*, i8** %11
%83 = icmp eq i8* %82, null
br i1 %83, label %84, label %85
84: ; preds = %72
store i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8** %4
br label %169
85: ; preds = %72
%86 = load i8*, i8** %11
%87 = load i8*, i8** %8
%88 = load i8*, i8** %9
%89 = load i8*, i8** %8
%90 = ptrtoint i8* %88 to i64
%91 = ptrtoint i8* %89 to i64
%92 = sub i64 %90, %91
%93 = trunc i64 %92 to i32
%94 = call i32 @memcpy(i8* %86, i8* %87, i32 %93)
%95 = load i8*, i8** %11
%96 = load i8*, i8** %9
%97 = load i8*, i8** %8
%98 = ptrtoint i8* %96 to i64
%99 = ptrtoint i8* %97 to i64
%100 = sub i64 %98, %99
%101 = getelementptr inbounds i8, i8* %95, i64 %100
store i8 0, i8* %101
%102 = load i8*, i8** %11
%103 = call %struct.passwd* @getpwnam(i8* %102)
store %struct.passwd* %103, %struct.passwd** %12
%104 = icmp ne %struct.passwd* %103, null
br i1 %104, label %105, label %120
105: ; preds = %85
%106 = load %struct.passwd*, %struct.passwd** %12
%107 = getelementptr inbounds %struct.passwd, %struct.passwd* %106, i32 0, i32 0
%108 = load i32, i32* %107
%109 = load i32*, i32** %6
store i32 %108, i32* %109
%110 = load i8*, i8** %9
%111 = load i8, i8* %110
%112 = sext i8 %111 to i32
%113 = icmp ne i32 %112, 0
br i1 %113, label %114, label %119
114: ; preds = %105
%115 = load %struct.passwd*, %struct.passwd** %12
%116 = getelementptr inbounds %struct.passwd, %struct.passwd* %115, i32 0, i32 1
%117 = load i32, i32* %116
%118 = load i32*, i32** %7
store i32 %117, i32* %118
br label %119
119: ; preds = %114, %105
br label %135
120: ; preds = %85
store i64 0, i64* @errno
%121 = load i8*, i8** %11
%122 = call i32 @strtoul(i8* %121, i8** %13, i32 10)
%123 = load i32*, i32** %6
store i32 %122, i32* %123
%124 = load i64, i64* @errno
%125 = icmp ne i64 %124, 0
br i1 %125, label %131, label %126
126: ; preds = %120
%127 = load i8*, i8** %13
%128 = load i8, i8* %127
%129 = sext i8 %128 to i32
%130 = icmp ne i32 %129, 0
br i1 %130, label %131, label %134
131: ; preds = %126, %120
%132 = load i8*, i8** %11
%133 = call i32 @snprintf(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @owner_parse.errbuff, i64 0, i64 0), i32 128, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i8* %132)
store i8 0, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @owner_parse.errbuff, i64 0, i64 127)
store i8* getelementptr inbounds ([128 x i8], [128 x i8]* @owner_parse.errbuff, i64 0, i64 0), i8** %4
br label %169
134: ; preds = %126
br label %135
135: ; preds = %134, %119
%136 = load i8*, i8** %11
%137 = call i32 @free(i8* %136)
br label %138
138: ; preds = %135, %69
%139 = load i8*, i8** %10
%140 = load i8, i8* %139
%141 = sext i8 %140 to i32
%142 = icmp ne i32 %141, 0
br i1 %142, label %143, label %168
143: ; preds = %138
%144 = load i8*, i8** %10
%145 = call %struct.group* @getgrnam(i8* %144)
store %struct.group* %145, %struct.group** %14
%146 = icmp ne %struct.group* %145, null
br i1 %146, label %147, label %152
147: ; preds = %143
%148 = load %struct.group*, %struct.group** %14
%149 = getelementptr inbounds %struct.group, %struct.group* %148, i32 0, i32 0
%150 = load i32, i32* %149
%151 = load i32*, i32** %7
store i32 %150, i32* %151
br label %167
152: ; preds = %143
store i64 0, i64* @errno
%153 = load i8*, i8** %10
%154 = call i32 @strtoul(i8* %153, i8** %15, i32 10)
%155 = load i32*, i32** %7
store i32 %154, i32* %155
%156 = load i64, i64* @errno
%157 = icmp ne i64 %156, 0
br i1 %157, label %163, label %158
158: ; preds = %152
%159 = load i8*, i8** %15
%160 = load i8, i8* %159
%161 = sext i8 %160 to i32
%162 = icmp ne i32 %161, 0
br i1 %162, label %163, label %166
163: ; preds = %158, %152
%164 = load i8*, i8** %10
%165 = call i32 @snprintf(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @owner_parse.errbuff, i64 0, i64 0), i32 128, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i8* %164)
store i8 0, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @owner_parse.errbuff, i64 0, i64 127)
store i8* getelementptr inbounds ([128 x i8], [128 x i8]* @owner_parse.errbuff, i64 0, i64 0), i8** %4
br label %169
166: ; preds = %158
br label %167
167: ; preds = %166, %147
br label %168
168: ; preds = %167, %138
store i8* null, i8** %4
br label %169
169: ; preds = %168, %163, %131, %84, %23
%170 = load i8*, i8** %4
ret i8* %170
}

LLVM IR (-O2):
%struct.passwd = type { i32, i32 }
%struct.group = type { i32 }
@owner_parse.errbuff = internal global [128 x i8] zeroinitializer
@.str = [30 x i8] c"Invalid empty user/group spec\00"
@.str.1 = [25 x i8] c"Couldn't allocate memory\00"
@errno = global i64 0
@.str.2 = [28 x i8] c"Couldn't lookup user ``%s''\00"
@.str.3 = [29 x i8] c"Couldn't lookup group ``%s''\00"
define i8* @owner_parse(i8* %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = alloca i8*
%5 = alloca i8*
store i32 -1, i32* %1
store i32 -1, i32* %2
%6 = load i8, i8* %0
switch i8 %6, label %9 [
i8 0, label %76
i8 58, label %7
i8 46, label %7
]
7: ; preds = %3, %3
%8 = getelementptr inbounds i8, i8* %0, i64 1
br label %54
9: ; preds = %3, %12
%10 = phi i8 [ %14, %12 ], [ %6, %3 ]
%11 = phi i8* [ %13, %12 ], [ %0, %3 ]
switch i8 %10, label %12 [
i8 58, label %15
i8 46, label %15
i8 0, label %15
]
12: ; preds = %9
%13 = getelementptr inbounds i8, i8* %11, i64 1
%14 = load i8, i8* %13
br label %9
15: ; preds = %9, %9, %9
%16 = icmp ne i8 %10, 0
%17 = zext i1 %16 to i64
%18 = getelementptr i8, i8* %11, i64 %17
%19 = ptrtoint i8* %11 to i64
%20 = ptrtoint i8* %0 to i64
%21 = sub i64 %19, %20
%22 = trunc i64 %21 to i32
%23 = add i32 %22, 1
%24 = tail call i64 @malloc(i32 %23)
%25 = inttoptr i64 %24 to i8*
%26 = icmp eq i64 %24, 0
br i1 %26, label %76, label %27
27: ; preds = %15
%28 = tail call i32 @memcpy(i8* %25, i8* %0, i32 %22)
%29 = getelementptr inbounds i8, i8* %25, i64 %21
store i8 0, i8* %29
%30 = tail call %struct.passwd* @getpwnam(i8* %25)
%31 = icmp eq %struct.passwd* %30, null
br i1 %31, label %40, label %32
32: ; preds = %27
%33 = getelementptr inbounds %struct.passwd, %struct.passwd* %30, i64 0, i32 0
%34 = load i32, i32* %33
store i32 %34, i32* %1
%35 = load i8, i8* %11
%36 = icmp eq i8 %35, 0
br i1 %36, label %52, label %37
37: ; preds = %32
%38 = getelementptr inbounds %struct.passwd, %struct.passwd* %30, i64 0, i32 1
%39 = load i32, i32* %38
store i32 %39, i32* %2
br label %52
40: ; preds = %27
%41 = bitcast i8** %4 to i8*
store i64 0, i64* @errno
%42 = call i32 @strtoul(i8* %25, i8** %4, i32 10)
store i32 %42, i32* %1
%43 = load i64, i64* @errno
%44 = icmp eq i64 %43, 0
br i1 %44, label %45, label %49
45: ; preds = %40
%46 = load i8*, i8** %4
%47 = load i8, i8* %46
%48 = icmp eq i8 %47, 0
br i1 %48, label %51, label %49
49: ; preds = %45, %40
%50 = tail call i32 @snprintf(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @owner_parse.errbuff, i64 0, i64 0), i32 128, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i8* %25)
store i8 0, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @owner_parse.errbuff, i64 0, i64 127)
br label %76
51: ; preds = %45
br label %52
52: ; preds = %37, %32, %51
%53 = tail call i32 @free(i8* %25)
br label %54
54: ; preds = %52, %7
%55 = phi i8* [ %18, %52 ], [ %8, %7 ]
%56 = load i8, i8* %55
%57 = icmp eq i8 %56, 0
br i1 %57, label %76, label %58
58: ; preds = %54
%59 = tail call %struct.group* @getgrnam(i8* %55)
%60 = icmp eq %struct.group* %59, null
br i1 %60, label %64, label %61
61: ; preds = %58
%62 = getelementptr inbounds %struct.group, %struct.group* %59, i64 0, i32 0
%63 = load i32, i32* %62
store i32 %63, i32* %2
br label %76
64: ; preds = %58
%65 = bitcast i8** %5 to i8*
store i64 0, i64* @errno
%66 = call i32 @strtoul(i8* %55, i8** %5, i32 10)
store i32 %66, i32* %2
%67 = load i64, i64* @errno
%68 = icmp eq i64 %67, 0
br i1 %68, label %69, label %74
69: ; preds = %64
%70 = load i8*, i8** %5
%71 = load i8, i8* %70
%72 = icmp eq i8 %71, 0
br i1 %72, label %73, label %74
73: ; preds = %69
br label %76
74: ; preds = %69, %64
%75 = tail call i32 @snprintf(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @owner_parse.errbuff, i64 0, i64 0), i32 128, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i8* %55)
store i8 0, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @owner_parse.errbuff, i64 0, i64 127)
br label %76
76: ; preds = %61, %73, %49, %15, %54, %74, %3
%77 = phi i8* [ getelementptr inbounds ([128 x i8], [128 x i8]* @owner_parse.errbuff, i64 0, i64 0), %74 ], [ getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), %3 ], [ null, %54 ], [ getelementptr inbounds ([128 x i8], [128 x i8]* @owner_parse.errbuff, i64 0, i64 0), %49 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), %15 ], [ null, %73 ], [ null, %61 ]
ret i8* %77
}