#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 stat {
  int dummy;
};
typedef int pid_t;

/* Variables and functions */
int execl(char *, char *, char *, ...);
int fork();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int getegid();
int geteuid();
int getgid();
int getuid();
int nice(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, int, int, int, int);
int setgid(int);
int setuid(int);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stat(char *, struct stat *);
int /*<<< orphan*/ stderr;
int wait(int *);
int /*<<< orphan*/ wait_status_correct(int);
int main(int argc, char **argv) {
  printf("Use: %d, Group: %d. Eff. usr: %d, Eff. group: %d\n", getuid(),
         getgid(), geteuid(), getegid());
  if (geteuid() == 0) {
    if (nice(-11) == -1) {
      perror("nice");
      return -1;
    }
    if (setgid(getgid()) == -1 || setuid(getuid()) == -1) {
      perror("setgid/setuid");
      return -1;
    }
  } else
    fprintf(stderr, "%s: this program needs root privileges. not renicing.\n",
            argv[0]);
  for (;;) {
    pid_t pid = fork();
    if (pid == -1) {
      perror("fork");
      return -1;
    } else if (pid == 0) {
      int padsp_command_available = 0;
      struct stat stat_buf;
      if (!stat("/usr/bin/padsp", &stat_buf))
        padsp_command_available++;
      if (padsp_command_available) {
        if (execl("/usr/bin/padsp", "eviacam", "/usr/local/bin/eviacam",
                  NULL) == -1) {
          perror("execl");
          return -1;
        }
      } else {
        if (execl("/usr/local/bin/eviacam", "eviacam", NULL) == -1) {
          perror("execl");
          return -1;
        }
      }
    } else {
      int status;
      if (wait(&status) == -1) {
        perror("wait");
        return -1;
      }
      if (!wait_status_correct(status)) {
        fprintf(stderr, "%s: abnormal process termination, restarting\n",
                argv[0]);
        sleep(1);
      } else
        break;
    }
  }
  printf("Use: %d, Group: %d. Eff. usr: %d, Eff. group: %d\n", getuid(),
         getgid(), geteuid(), getegid());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getuid@plt>
mov    %eax,-0x30(%rbp)
mov    $0x0,%al
call   1090 <getgid@plt>
mov    %eax,-0x2c(%rbp)
mov    $0x0,%al
call   1060 <geteuid@plt>
mov    %eax,-0x28(%rbp)
mov    $0x0,%al
call   10b0 <getegid@plt>
mov    -0x30(%rbp),%esi
mov    -0x2c(%rbp),%edx
mov    -0x28(%rbp),%ecx
mov    %eax,%r8d
lea    0xdb2(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1060 <geteuid@plt>
cmp    $0x0,%eax
jne    12d9 <main+0xd9>
mov    $0xfffffff5,%edi
call   10a0 <nice@plt>
cmp    $0xffffffff,%eax
jne    128e <main+0x8e>
lea    0xdb5(%rip),%rdi
call   10d0 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14ab <main+0x2ab>
mov    $0x0,%al
call   1090 <getgid@plt>
mov    %eax,%edi
call   10c0 <setgid@plt>
cmp    $0xffffffff,%eax
je     12bc <main+0xbc>
mov    $0x0,%al
call   1040 <getuid@plt>
mov    %eax,%edi
call   10e0 <setuid@plt>
cmp    $0xffffffff,%eax
jne    12d4 <main+0xd4>
lea    0xd74(%rip),%rdi
call   10d0 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14ab <main+0x2ab>
jmp    12f5 <main+0xf5>
mov    0x2d00(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xd55(%rip),%rsi
call   1070 <fprintf@plt>
jmp    12fa <main+0xfa>
mov    $0x0,%al
call   1120 <fork@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    1326 <main+0x126>
lea    0xd67(%rip),%rdi
call   10d0 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14ab <main+0x2ab>
cmpl   $0x0,-0x14(%rbp)
jne    13ed <main+0x1ed>
movl   $0x0,-0x18(%rbp)
lea    0xd43(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1080 <stat@plt>
cmp    $0x0,%eax
jne    1359 <main+0x159>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     13a9 <main+0x1a9>
lea    0xd17(%rip),%rdi
lea    0xd2e(%rip),%rsi
lea    0xd18(%rip),%rdx
xor    %eax,%eax
mov    %eax,%ecx
mov    $0x0,%al
call   10f0 <execl@plt>
cmp    $0xffffffff,%eax
jne    13a4 <main+0x1a4>
lea    0xd14(%rip),%rdi
call   10d0 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14ab <main+0x2ab>
jmp    13e8 <main+0x1e8>
lea    0xce0(%rip),%rdi
lea    0xce8(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
mov    $0x0,%al
call   10f0 <execl@plt>
cmp    $0xffffffff,%eax
jne    13e3 <main+0x1e3>
lea    0xcd5(%rip),%rdi
call   10d0 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14ab <main+0x2ab>
jmp    13e8 <main+0x1e8>
jmp    145d <main+0x25d>
lea    -0x24(%rbp),%rdi
call   1110 <wait@plt>
cmp    $0xffffffff,%eax
jne    1417 <main+0x217>
lea    0xca7(%rip),%rdi
call   10d0 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14ab <main+0x2ab>
mov    -0x24(%rbp),%edi
call   1030 <wait_status_correct@plt>
cmp    $0x0,%eax
jne    1453 <main+0x253>
mov    0x2bb1(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xc73(%rip),%rsi
call   1070 <fprintf@plt>
mov    $0x1,%edi
call   1100 <sleep@plt>
jmp    1458 <main+0x258>
jmp    1467 <main+0x267>
jmp    145d <main+0x25d>
jmp    1462 <main+0x262>
jmp    12fa <main+0xfa>
mov    $0x0,%al
call   1040 <getuid@plt>
mov    %eax,-0x3c(%rbp)
mov    $0x0,%al
call   1090 <getgid@plt>
mov    %eax,-0x38(%rbp)
mov    $0x0,%al
call   1060 <geteuid@plt>
mov    %eax,-0x34(%rbp)
mov    $0x0,%al
call   10b0 <getegid@plt>
mov    -0x3c(%rbp),%esi
mov    -0x38(%rbp),%edx
mov    -0x34(%rbp),%ecx
mov    %eax,%r8d
lea    0xb61(%rip),%rdi
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r15
xor    %eax,%eax
call   1040 <getuid@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1090 <getgid@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1060 <geteuid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   10b0 <getegid@plt>
lea    0xdc5(%rip),%rdi
mov    %r14d,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
mov    %eax,%r8d
call   1050 <printf@plt>
xor    %eax,%eax
call   1060 <geteuid@plt>
test   %eax,%eax
je     126f <main+0x6f>
mov    0x2d84(%rip),%rax
mov    (%rax),%edi
mov    (%r15),%rdx
lea    0xddd(%rip),%rsi
call   1070 <fprintf@plt>
jmp    12b0 <main+0xb0>
mov    $0xfffffff5,%edi
call   10a0 <nice@plt>
cmp    $0xffffffff,%eax
je     141a <main+0x21a>
xor    %eax,%eax
call   1090 <getgid@plt>
mov    %eax,%edi
call   10c0 <setgid@plt>
cmp    $0xffffffff,%eax
je     1411 <main+0x211>
xor    %eax,%eax
call   1040 <getuid@plt>
mov    %eax,%edi
call   10e0 <setuid@plt>
cmp    $0xffffffff,%eax
je     1411 <main+0x211>
lea    0xdca(%rip),%rbp
lea    0x10(%rsp),%r12
lea    0xddc(%rip),%r13
lea    0xdc6(%rip),%rbx
lea    0xc(%rsp),%r14
movl   $0x0,0x8(%rsp)
jmp    1300 <main+0x100>
mov    %rbp,%rdi
mov    %r13,%rsi
mov    %rbx,%rdx
xor    %ecx,%ecx
xor    %eax,%eax
call   10f0 <execl@plt>
cmp    $0xffffffff,%eax
jne    138b <main+0x18b>
jmp    142c <main+0x22c>
nopl   0x0(%rax)
xor    %eax,%eax
call   1120 <fork@plt>
test   %eax,%eax
je     1360 <main+0x160>
cmp    $0xffffffff,%eax
je     1423 <main+0x223>
mov    %r14,%rdi
call   1110 <wait@plt>
cmp    $0xffffffff,%eax
je     1397 <main+0x197>
mov    0xc(%rsp),%edi
call   1030 <wait_status_correct@plt>
mov    $0x2,%ecx
test   %eax,%eax
jne    138d <main+0x18d>
mov    0x2ca6(%rip),%rax
mov    (%rax),%edi
mov    (%r15),%rdx
lea    0xd6c(%rip),%rsi
call   1070 <fprintf@plt>
mov    $0x1,%edi
call   1100 <sleep@plt>
jmp    138b <main+0x18b>
nopw   0x0(%rax,%rax,1)
mov    %rbp,%rdi
mov    %r12,%rsi
call   1080 <stat@plt>
test   %eax,%eax
je     12d9 <main+0xd9>
mov    %rbx,%rdi
mov    %r13,%rsi
xor    %edx,%edx
xor    %eax,%eax
call   10f0 <execl@plt>
cmp    $0xffffffff,%eax
je     142c <main+0x22c>
xor    %ecx,%ecx
test   %ecx,%ecx
je     1300 <main+0x100>
jmp    13b8 <main+0x1b8>
lea    0xd0f(%rip),%rdi
call   10d0 <perror@plt>
mov    $0x1,%ecx
movl   $0xffffffff,0x8(%rsp)
ff
test   %ecx,%ecx
je     1300 <main+0x100>
cmp    $0x1,%ecx
jne    13c3 <main+0x1c3>
mov    0x8(%rsp),%ebp
jmp    1400 <main+0x200>
xor    %ebp,%ebp
xor    %eax,%eax
call   1040 <getuid@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1090 <getgid@plt>
mov    %eax,%r15d
xor    %eax,%eax
call   1060 <geteuid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   10b0 <getegid@plt>
lea    0xc10(%rip),%rdi
mov    %r14d,%esi
mov    %r15d,%edx
mov    %ebx,%ecx
mov    %eax,%r8d
call   1050 <printf@plt>
mov    %ebp,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc1f(%rip),%rdi
jmp    1433 <main+0x233>
lea    0xc11(%rip),%rdi
jmp    1433 <main+0x233>
lea    0xc52(%rip),%rdi
jmp    1433 <main+0x233>
lea    0xc74(%rip),%rdi
call   10d0 <perror@plt>
mov    $0xffffffff,%ebp
jmp    1400 <main+0x200>

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [50 x i8] c"Use: %d, Group: %d. Eff. usr: %d, Eff. group: %d\0A\00"
@.str.1 = [5 x i8] c"nice\00"
@.str.2 = [14 x i8] c"setgid/setuid\00"
@stderr = global i32 0
@.str.3 = [55 x i8] c"%s: this program needs root privileges. not renicing.\0A\00"
@.str.4 = [5 x i8] c"fork\00"
@.str.5 = [15 x i8] c"/usr/bin/padsp\00"
@.str.6 = [8 x i8] c"eviacam\00"
@.str.7 = [23 x i8] c"/usr/local/bin/eviacam\00"
@.str.8 = [6 x i8] c"execl\00"
@.str.9 = [5 x i8] c"wait\00"
@.str.10 = [46 x i8] c"%s: abnormal process termination, restarting\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca %struct.stat
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = call i32 (...) @getuid()
%11 = call i32 (...) @getgid()
%12 = call i32 (...) @geteuid()
%13 = call i32 (...) @getegid()
%14 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11, i32 %12, i32 %13)
%15 = call i32 (...) @geteuid()
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %33
17: ; preds = %2
%18 = call i32 @nice(i32 -11)
%19 = icmp eq i32 %18, -1
br i1 %19, label %20, label %22
20: ; preds = %17
%21 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %3
br label %97
22: ; preds = %17
%23 = call i32 (...) @getgid()
%24 = call i32 @setgid(i32 %23)
%25 = icmp eq i32 %24, -1
br i1 %25, label %30, label %26
26: ; preds = %22
%27 = call i32 (...) @getuid()
%28 = call i32 @setuid(i32 %27)
%29 = icmp eq i32 %28, -1
br i1 %29, label %30, label %32
30: ; preds = %26, %22
%31 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
store i32 -1, i32* %3
br label %97
32: ; preds = %26
br label %39
33: ; preds = %2
%34 = load i32, i32* @stderr
%35 = load i8**, i8*** %5
%36 = getelementptr inbounds i8*, i8** %35, i64 0
%37 = load i8*, i8** %36
%38 = call i32 @fprintf(i32 %34, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.3, i64 0, i64 0), i8* %37)
br label %39
39: ; preds = %33, %32
br label %40
40: ; preds = %90, %39
%41 = call i32 (...) @fork()
store i32 %41, i32* %6
%42 = load i32, i32* %6
%43 = icmp eq i32 %42, -1
br i1 %43, label %44, label %46
44: ; preds = %40
%45 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
store i32 -1, i32* %3
br label %97
46: ; preds = %40
%47 = load i32, i32* %6
%48 = icmp eq i32 %47, 0
br i1 %48, label %49, label %71
49: ; preds = %46
store i32 0, i32* %7
%50 = call i32 @stat(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), %struct.stat* %8)
%51 = icmp ne i32 %50, 0
br i1 %51, label %55, label %52
52: ; preds = %49
%53 = load i32, i32* %7
%54 = add nsw i32 %53, 1
store i32 %54, i32* %7
br label %55
55: ; preds = %52, %49
%56 = load i32, i32* %7
%57 = icmp ne i32 %56, 0
br i1 %57, label %58, label %64
58: ; preds = %55
%59 = call i32 (i8*, i8*, i8*, ...) @execl(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0), i8* null)
%60 = icmp eq i32 %59, -1
br i1 %60, label %61, label %63
61: ; preds = %58
%62 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
store i32 -1, i32* %3
br label %97
63: ; preds = %58
br label %70
64: ; preds = %55
%65 = call i32 (i8*, i8*, i8*, ...) @execl(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i8* null)
%66 = icmp eq i32 %65, -1
br i1 %66, label %67, label %69
67: ; preds = %64
%68 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
store i32 -1, i32* %3
br label %97
69: ; preds = %64
br label %70
70: ; preds = %69, %63
br label %89
71: ; preds = %46
%72 = call i32 @wait(i32* %9)
%73 = icmp eq i32 %72, -1
br i1 %73, label %74, label %76
74: ; preds = %71
%75 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
store i32 -1, i32* %3
br label %97
76: ; preds = %71
%77 = load i32, i32* %9
%78 = call i32 @wait_status_correct(i32 %77)
%79 = icmp ne i32 %78, 0
br i1 %79, label %87, label %80
80: ; preds = %76
%81 = load i32, i32* @stderr
%82 = load i8**, i8*** %5
%83 = getelementptr inbounds i8*, i8** %82, i64 0
%84 = load i8*, i8** %83
%85 = call i32 @fprintf(i32 %81, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.10, i64 0, i64 0), i8* %84)
%86 = call i32 @sleep(i32 1)
br label %88
87: ; preds = %76
br label %91
88: ; preds = %80
br label %89
89: ; preds = %88, %70
br label %90
90: ; preds = %89
br label %40
91: ; preds = %87
%92 = call i32 (...) @getuid()
%93 = call i32 (...) @getgid()
%94 = call i32 (...) @geteuid()
%95 = call i32 (...) @getegid()
%96 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 %92, i32 %93, i32 %94, i32 %95)
store i32 0, i32* %3
br label %97
97: ; preds = %91, %74, %67, %61, %44, %30, %20
%98 = load i32, i32* %3
ret i32 %98
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [50 x i8] c"Use: %d, Group: %d. Eff. usr: %d, Eff. group: %d\0A\00"
@.str.1 = [5 x i8] c"nice\00"
@.str.2 = [14 x i8] c"setgid/setuid\00"
@stderr = global i32 0
@.str.3 = [55 x i8] c"%s: this program needs root privileges. not renicing.\0A\00"
@.str.4 = [5 x i8] c"fork\00"
@.str.5 = [15 x i8] c"/usr/bin/padsp\00"
@.str.6 = [8 x i8] c"eviacam\00"
@.str.7 = [23 x i8] c"/usr/local/bin/eviacam\00"
@.str.8 = [6 x i8] c"execl\00"
@.str.9 = [5 x i8] c"wait\00"
@.str.10 = [46 x i8] c"%s: abnormal process termination, restarting\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.stat
%4 = alloca i32
%5 = tail call i32 (...) @getuid()
%6 = tail call i32 (...) @getgid()
%7 = tail call i32 (...) @geteuid()
%8 = tail call i32 (...) @getegid()
%9 = tail call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6, i32 %7, i32 %8)
%10 = tail call i32 (...) @geteuid()
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %27
12: ; preds = %2
%13 = tail call i32 @nice(i32 -11)
%14 = icmp eq i32 %13, -1
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %77
17: ; preds = %12
%18 = tail call i32 (...) @getgid()
%19 = tail call i32 @setgid(i32 %18)
%20 = icmp eq i32 %19, -1
br i1 %20, label %25, label %21
21: ; preds = %17
%22 = tail call i32 (...) @getuid()
%23 = tail call i32 @setuid(i32 %22)
%24 = icmp eq i32 %23, -1
br i1 %24, label %25, label %31
25: ; preds = %21, %17
%26 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %77
27: ; preds = %2
%28 = load i32, i32* @stderr
%29 = load i8*, i8** %1
%30 = tail call i32 @fprintf(i32 %28, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.3, i64 0, i64 0), i8* %29)
br label %31
31: ; preds = %21, %27
%32 = bitcast %struct.stat* %3 to i8*
%33 = bitcast i32* %4 to i8*
br label %34
34: ; preds = %68, %31
%35 = phi i32 [ 0, %31 ], [ %69, %68 ]
%36 = call i32 (...) @fork()
switch i32 %36, label %51 [
i32 -1, label %37
i32 0, label %39
]
37: ; preds = %34
%38 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
br label %77
39: ; preds = %34
%40 = call i32 @stat(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), %struct.stat* %3)
%41 = icmp eq i32 %40, 0
br i1 %41, label %42, label %45
42: ; preds = %39
%43 = call i32 (i8*, i8*, i8*, ...) @execl(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0), i8* null)
%44 = icmp eq i32 %43, -1
br i1 %44, label %49, label %48
45: ; preds = %39
%46 = call i32 (i8*, i8*, i8*, ...) @execl(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i8* null)
%47 = icmp eq i32 %46, -1
br i1 %47, label %49, label %48
48: ; preds = %45, %42
br label %68
49: ; preds = %45, %42
%50 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
br label %77
51: ; preds = %34
%52 = call i32 @wait(i32* %4)
%53 = icmp eq i32 %52, -1
br i1 %53, label %54, label %56
54: ; preds = %51
%55 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
br label %60
56: ; preds = %51
%57 = load i32, i32* %4
%58 = call i32 @wait_status_correct(i32 %57)
%59 = icmp eq i32 %58, 0
br i1 %59, label %63, label %60
60: ; preds = %54, %56
%61 = phi i32 [ %35, %56 ], [ -1, %54 ]
%62 = phi i32 [ 2, %56 ], [ 1, %54 ]
br label %68
63: ; preds = %56
%64 = load i32, i32* @stderr
%65 = load i8*, i8** %1
%66 = call i32 @fprintf(i32 %64, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.10, i64 0, i64 0), i8* %65)
%67 = call i32 @sleep(i32 1)
br label %68
68: ; preds = %48, %63, %60
%69 = phi i32 [ %61, %60 ], [ %35, %63 ], [ %35, %48 ]
%70 = phi i32 [ %62, %60 ], [ 0, %63 ], [ 0, %48 ]
switch i32 %70, label %79 [
i32 0, label %34
i32 1, label %77
i32 2, label %71
]
71: ; preds = %68
%72 = call i32 (...) @getuid()
%73 = call i32 (...) @getgid()
%74 = call i32 (...) @geteuid()
%75 = call i32 (...) @getegid()
%76 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 %72, i32 %73, i32 %74, i32 %75)
br label %77
77: ; preds = %68, %49, %37, %71, %25, %15
%78 = phi i32 [ -1, %15 ], [ -1, %25 ], [ 0, %71 ], [ -1, %49 ], [ -1, %37 ], [ %69, %68 ]
ret i32 %78
79: ; preds = %68
unreachable
}