#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 */
typedef int uid_t;
typedef int gid_t;

/* Variables and functions */
int getegid();
int geteuid();
int getgid();
int getuid();
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ seteuid(int);
scalar_t__ setuid(int);
int main(int argc, char *argv[]) {
  uid_t uid = getuid();
  uid_t euid = geteuid();
  gid_t gid = getgid();
  gid_t egid = getegid();
  printf("=== uid=%d gid=%d euid=%d egid=%d\n", getuid(), getgid(), geteuid(),
         getegid());
  printf("seteuid(uid)\n");
  if (seteuid(uid) < 0)
    return 1;
  printf("=== uid=%d gid=%d euid=%d egid=%d\n", getuid(), getgid(), geteuid(),
         getegid());
  printf("seteuid(euid)\n");
  if (seteuid(euid) < 0)
    return 1;
  printf("=== uid=%d gid=%d euid=%d egid=%d\n", getuid(), getgid(), geteuid(),
         getegid());
  printf("seteuid(uid)\n");
  if (seteuid(uid) < 0)
    return 1;
  printf("=== uid=%d gid=%d euid=%d egid=%d\n", getuid(), getgid(), geteuid(),
         getegid());
  printf("seteuid(euid)\n");
  if (seteuid(euid) < 0)
    return 1;
  printf("=== uid=%d gid=%d euid=%d egid=%d\n", getuid(), getgid(), geteuid(),
         getegid());
  printf("setuid(uid)\n");
  if (setuid(uid) < 0)
    return 1;
  printf("=== uid=%d gid=%d euid=%d egid=%d\n", getuid(), getgid(), geteuid(),
         getegid());
  printf("setuid(euid)\n");
  if (setuid(euid) < 0)
    return 1;
  printf("=== uid=%d gid=%d euid=%d egid=%d\n", getuid(), getgid(), geteuid(),
         getegid());
  printf("setuid(uid)\n");
  if (setuid(uid) < 0)
    return 1;
  printf("=== uid=%d gid=%d euid=%d egid=%d\n", getuid(), getgid(), geteuid(),
         getegid());
  printf("setuid(euid)\n");
  if (setuid(euid) < 0)
    return 1;
  printf("=== uid=%d gid=%d euid=%d egid=%d\n", getuid(), getgid(), geteuid(),
         getegid());
  printf("=== DONE\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getuid@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1050 <geteuid@plt>
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1060 <getgid@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1070 <getegid@plt>
mov    %eax,-0x20(%rbp)
mov    $0x0,%al
call   1030 <getuid@plt>
mov    %eax,-0x2c(%rbp)
mov    $0x0,%al
call   1060 <getgid@plt>
mov    %eax,-0x28(%rbp)
mov    $0x0,%al
call   1050 <geteuid@plt>
mov    %eax,-0x24(%rbp)
mov    $0x0,%al
call   1070 <getegid@plt>
mov    -0x2c(%rbp),%esi
mov    -0x28(%rbp),%edx
mov    -0x24(%rbp),%ecx
mov    %eax,%r8d
lea    0xe17(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe2c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%edi
call   1090 <seteuid@plt>
cmp    $0x0,%rax
jge    121c <main+0xac>
movl   $0x1,-0x4(%rbp)
jmp    156f <main+0x3ff>
mov    $0x0,%al
call   1030 <getuid@plt>
mov    %eax,-0x38(%rbp)
mov    $0x0,%al
call   1060 <getgid@plt>
mov    %eax,-0x34(%rbp)
mov    $0x0,%al
call   1050 <geteuid@plt>
mov    %eax,-0x30(%rbp)
mov    $0x0,%al
call   1070 <getegid@plt>
mov    -0x38(%rbp),%esi
mov    -0x34(%rbp),%edx
mov    -0x30(%rbp),%ecx
mov    %eax,%r8d
lea    0xdac(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xdcf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%edi
call   1090 <seteuid@plt>
cmp    $0x0,%rax
jge    1287 <main+0x117>
movl   $0x1,-0x4(%rbp)
jmp    156f <main+0x3ff>
mov    $0x0,%al
call   1030 <getuid@plt>
mov    %eax,-0x44(%rbp)
mov    $0x0,%al
call   1060 <getgid@plt>
mov    %eax,-0x40(%rbp)
mov    $0x0,%al
call   1050 <geteuid@plt>
mov    %eax,-0x3c(%rbp)
mov    $0x0,%al
call   1070 <getegid@plt>
mov    -0x44(%rbp),%esi
mov    -0x40(%rbp),%edx
mov    -0x3c(%rbp),%ecx
mov    %eax,%r8d
lea    0xd41(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd56(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%edi
call   1090 <seteuid@plt>
cmp    $0x0,%rax
jge    12f2 <main+0x182>
movl   $0x1,-0x4(%rbp)
jmp    156f <main+0x3ff>
mov    $0x0,%al
call   1030 <getuid@plt>
mov    %eax,-0x50(%rbp)
mov    $0x0,%al
call   1060 <getgid@plt>
mov    %eax,-0x4c(%rbp)
mov    $0x0,%al
call   1050 <geteuid@plt>
mov    %eax,-0x48(%rbp)
mov    $0x0,%al
call   1070 <getegid@plt>
mov    -0x50(%rbp),%esi
mov    -0x4c(%rbp),%edx
mov    -0x48(%rbp),%ecx
mov    %eax,%r8d
lea    0xcd6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xcf9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%edi
call   1090 <seteuid@plt>
cmp    $0x0,%rax
jge    135d <main+0x1ed>
movl   $0x1,-0x4(%rbp)
jmp    156f <main+0x3ff>
mov    $0x0,%al
call   1030 <getuid@plt>
mov    %eax,-0x5c(%rbp)
mov    $0x0,%al
call   1060 <getgid@plt>
mov    %eax,-0x58(%rbp)
mov    $0x0,%al
call   1050 <geteuid@plt>
mov    %eax,-0x54(%rbp)
mov    $0x0,%al
call   1070 <getegid@plt>
mov    -0x5c(%rbp),%esi
mov    -0x58(%rbp),%edx
mov    -0x54(%rbp),%ecx
mov    %eax,%r8d
lea    0xc6b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xc9d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%edi
call   1080 <setuid@plt>
cmp    $0x0,%rax
jge    13c8 <main+0x258>
movl   $0x1,-0x4(%rbp)
jmp    156f <main+0x3ff>
mov    $0x0,%al
call   1030 <getuid@plt>
mov    %eax,-0x68(%rbp)
mov    $0x0,%al
call   1060 <getgid@plt>
mov    %eax,-0x64(%rbp)
mov    $0x0,%al
call   1050 <geteuid@plt>
mov    %eax,-0x60(%rbp)
mov    $0x0,%al
call   1070 <getegid@plt>
mov    -0x68(%rbp),%esi
mov    -0x64(%rbp),%edx
mov    -0x60(%rbp),%ecx
mov    %eax,%r8d
lea    0xc00(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xc3f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%edi
call   1080 <setuid@plt>
cmp    $0x0,%rax
jge    1433 <main+0x2c3>
movl   $0x1,-0x4(%rbp)
jmp    156f <main+0x3ff>
mov    $0x0,%al
call   1030 <getuid@plt>
mov    %eax,-0x74(%rbp)
mov    $0x0,%al
call   1060 <getgid@plt>
mov    %eax,-0x70(%rbp)
mov    $0x0,%al
call   1050 <geteuid@plt>
mov    %eax,-0x6c(%rbp)
mov    $0x0,%al
call   1070 <getegid@plt>
mov    -0x74(%rbp),%esi
mov    -0x70(%rbp),%edx
mov    -0x6c(%rbp),%ecx
mov    %eax,%r8d
lea    0xb95(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xbc7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%edi
call   1080 <setuid@plt>
cmp    $0x0,%rax
jge    149e <main+0x32e>
movl   $0x1,-0x4(%rbp)
jmp    156f <main+0x3ff>
mov    $0x0,%al
call   1030 <getuid@plt>
mov    %eax,-0x80(%rbp)
mov    $0x0,%al
call   1060 <getgid@plt>
mov    %eax,-0x7c(%rbp)
mov    $0x0,%al
call   1050 <geteuid@plt>
mov    %eax,-0x78(%rbp)
mov    $0x0,%al
call   1070 <getegid@plt>
mov    -0x80(%rbp),%esi
mov    -0x7c(%rbp),%edx
mov    -0x78(%rbp),%ecx
mov    %eax,%r8d
lea    0xb2a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xb69(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%edi
call   1080 <setuid@plt>
cmp    $0x0,%rax
jge    1509 <main+0x399>
movl   $0x1,-0x4(%rbp)
jmp    156f <main+0x3ff>
mov    $0x0,%al
call   1030 <getuid@plt>
mov    %eax,-0x8c(%rbp)
mov    $0x0,%al
call   1060 <getgid@plt>
mov    %eax,-0x88(%rbp)
mov    $0x0,%al
call   1050 <geteuid@plt>
mov    %eax,-0x84(%rbp)
mov    $0x0,%al
call   1070 <getegid@plt>
mov    -0x8c(%rbp),%esi
mov    -0x88(%rbp),%edx
mov    -0x84(%rbp),%ecx
mov    %eax,%r8d
lea    0xaad(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xafa(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getuid@plt>
mov    %eax,%r15d
xor    %eax,%eax
call   1060 <geteuid@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1070 <getgid@plt>
xor    %eax,%eax
call   1080 <getegid@plt>
xor    %eax,%eax
call   1040 <getuid@plt>
mov    %eax,%r12d
xor    %eax,%eax
call   1070 <getgid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1060 <geteuid@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1080 <getegid@plt>
lea    0xe29(%rip),%rdi
mov    %r12d,%esi
mov    %ebx,%edx
mov    %ebp,%ecx
mov    %eax,%r8d
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe34(%rip),%rdi
call   1030 <puts@plt>
mov    %r15d,%edi
call   10a0 <seteuid@plt>
mov    $0x1,%r12d
test   %rax,%rax
js     14b9 <main+0x339>
xor    %eax,%eax
call   1040 <getuid@plt>
mov    %eax,%r13d
xor    %eax,%eax
call   1070 <getgid@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1060 <geteuid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1080 <getegid@plt>
lea    0xdcb(%rip),%rdi
mov    %r13d,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
mov    %eax,%r8d
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xde3(%rip),%rdi
call   1030 <puts@plt>
mov    %r14d,%edi
call   10a0 <seteuid@plt>
test   %rax,%rax
js     14b9 <main+0x339>
xor    %eax,%eax
call   1040 <getuid@plt>
mov    %eax,%r13d
xor    %eax,%eax
call   1070 <getgid@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1060 <geteuid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1080 <getegid@plt>
lea    0xd73(%rip),%rdi
mov    %r13d,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
mov    %eax,%r8d
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xd7e(%rip),%rdi
call   1030 <puts@plt>
mov    %r15d,%edi
call   10a0 <seteuid@plt>
test   %rax,%rax
js     14b9 <main+0x339>
xor    %eax,%eax
call   1040 <getuid@plt>
mov    %eax,%r13d
xor    %eax,%eax
call   1070 <getgid@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1060 <geteuid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1080 <getegid@plt>
lea    0xd1b(%rip),%rdi
mov    %r13d,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
mov    %eax,%r8d
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xd33(%rip),%rdi
call   1030 <puts@plt>
mov    %r14d,%edi
call   10a0 <seteuid@plt>
test   %rax,%rax
js     14b9 <main+0x339>
xor    %eax,%eax
call   1040 <getuid@plt>
mov    %eax,%r13d
xor    %eax,%eax
call   1070 <getgid@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1060 <geteuid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1080 <getegid@plt>
lea    0xcc3(%rip),%rdi
mov    %r13d,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
mov    %eax,%r8d
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xce9(%rip),%rdi
call   1030 <puts@plt>
mov    %r15d,%edi
call   1090 <setuid@plt>
test   %rax,%rax
js     14b9 <main+0x339>
xor    %eax,%eax
call   1040 <getuid@plt>
mov    %eax,%r13d
xor    %eax,%eax
call   1070 <getgid@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1060 <geteuid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1080 <getegid@plt>
lea    0xc6b(%rip),%rdi
mov    %r13d,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
mov    %eax,%r8d
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xc9d(%rip),%rdi
call   1030 <puts@plt>
mov    %r14d,%edi
call   1090 <setuid@plt>
test   %rax,%rax
js     14b9 <main+0x339>
xor    %eax,%eax
call   1040 <getuid@plt>
mov    %eax,%r13d
xor    %eax,%eax
call   1070 <getgid@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1060 <geteuid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1080 <getegid@plt>
lea    0xc13(%rip),%rdi
mov    %r13d,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
mov    %eax,%r8d
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xc39(%rip),%rdi
call   1030 <puts@plt>
mov    %r15d,%edi
call   1090 <setuid@plt>
test   %rax,%rax
js     14b9 <main+0x339>
xor    %eax,%eax
call   1040 <getuid@plt>
mov    %eax,%r15d
xor    %eax,%eax
call   1070 <getgid@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1060 <geteuid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1080 <getegid@plt>
lea    0xbbb(%rip),%rdi
mov    %r15d,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
mov    %eax,%r8d
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xbed(%rip),%rdi
call   1030 <puts@plt>
mov    %r14d,%edi
call   1090 <setuid@plt>
test   %rax,%rax
js     14b9 <main+0x339>
xor    %eax,%eax
call   1040 <getuid@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1070 <getgid@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1060 <geteuid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1080 <getegid@plt>
lea    0xb67(%rip),%rdi
mov    %r14d,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
mov    %eax,%r8d
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xba6(%rip),%rdi
call   1030 <puts@plt>
xor    %r12d,%r12d
mov    %r12d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [35 x i8] c"=== uid=%d gid=%d euid=%d egid=%d\0A\00"
@.str.1 = [14 x i8] c"seteuid(uid)\0A\00"
@.str.2 = [15 x i8] c"seteuid(euid)\0A\00"
@.str.3 = [13 x i8] c"setuid(uid)\0A\00"
@.str.4 = [14 x i8] c"setuid(euid)\0A\00"
@.str.5 = [10 x i8] c"=== DONE\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 i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = call i32 (...) @getuid()
store i32 %10, i32* %6
%11 = call i32 (...) @geteuid()
store i32 %11, i32* %7
%12 = call i32 (...) @getgid()
store i32 %12, i32* %8
%13 = call i32 (...) @getegid()
store i32 %13, i32* %9
%14 = call i32 (...) @getuid()
%15 = call i32 (...) @getgid()
%16 = call i32 (...) @geteuid()
%17 = call i32 (...) @getegid()
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %15, i32 %16, i32 %17)
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%20 = load i32, i32* %6
%21 = call i64 @seteuid(i32 %20)
%22 = icmp slt i64 %21, 0
br i1 %22, label %23, label %24
23: ; preds = %2
store i32 1, i32* %3
br label %108
24: ; preds = %2
%25 = call i32 (...) @getuid()
%26 = call i32 (...) @getgid()
%27 = call i32 (...) @geteuid()
%28 = call i32 (...) @getegid()
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %25, i32 %26, i32 %27, i32 %28)
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%31 = load i32, i32* %7
%32 = call i64 @seteuid(i32 %31)
%33 = icmp slt i64 %32, 0
br i1 %33, label %34, label %35
34: ; preds = %24
store i32 1, i32* %3
br label %108
35: ; preds = %24
%36 = call i32 (...) @getuid()
%37 = call i32 (...) @getgid()
%38 = call i32 (...) @geteuid()
%39 = call i32 (...) @getegid()
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %36, i32 %37, i32 %38, i32 %39)
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%42 = load i32, i32* %6
%43 = call i64 @seteuid(i32 %42)
%44 = icmp slt i64 %43, 0
br i1 %44, label %45, label %46
45: ; preds = %35
store i32 1, i32* %3
br label %108
46: ; preds = %35
%47 = call i32 (...) @getuid()
%48 = call i32 (...) @getgid()
%49 = call i32 (...) @geteuid()
%50 = call i32 (...) @getegid()
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %47, i32 %48, i32 %49, i32 %50)
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%53 = load i32, i32* %7
%54 = call i64 @seteuid(i32 %53)
%55 = icmp slt i64 %54, 0
br i1 %55, label %56, label %57
56: ; preds = %46
store i32 1, i32* %3
br label %108
57: ; preds = %46
%58 = call i32 (...) @getuid()
%59 = call i32 (...) @getgid()
%60 = call i32 (...) @geteuid()
%61 = call i32 (...) @getegid()
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %58, i32 %59, i32 %60, i32 %61)
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%64 = load i32, i32* %6
%65 = call i64 @setuid(i32 %64)
%66 = icmp slt i64 %65, 0
br i1 %66, label %67, label %68
67: ; preds = %57
store i32 1, i32* %3
br label %108
68: ; preds = %57
%69 = call i32 (...) @getuid()
%70 = call i32 (...) @getgid()
%71 = call i32 (...) @geteuid()
%72 = call i32 (...) @getegid()
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %69, i32 %70, i32 %71, i32 %72)
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
%75 = load i32, i32* %7
%76 = call i64 @setuid(i32 %75)
%77 = icmp slt i64 %76, 0
br i1 %77, label %78, label %79
78: ; preds = %68
store i32 1, i32* %3
br label %108
79: ; preds = %68
%80 = call i32 (...) @getuid()
%81 = call i32 (...) @getgid()
%82 = call i32 (...) @geteuid()
%83 = call i32 (...) @getegid()
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %80, i32 %81, i32 %82, i32 %83)
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%86 = load i32, i32* %6
%87 = call i64 @setuid(i32 %86)
%88 = icmp slt i64 %87, 0
br i1 %88, label %89, label %90
89: ; preds = %79
store i32 1, i32* %3
br label %108
90: ; preds = %79
%91 = call i32 (...) @getuid()
%92 = call i32 (...) @getgid()
%93 = call i32 (...) @geteuid()
%94 = call i32 (...) @getegid()
%95 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %91, i32 %92, i32 %93, i32 %94)
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
%97 = load i32, i32* %7
%98 = call i64 @setuid(i32 %97)
%99 = icmp slt i64 %98, 0
br i1 %99, label %100, label %101
100: ; preds = %90
store i32 1, i32* %3
br label %108
101: ; preds = %90
%102 = call i32 (...) @getuid()
%103 = call i32 (...) @getgid()
%104 = call i32 (...) @geteuid()
%105 = call i32 (...) @getegid()
%106 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %102, i32 %103, i32 %104, i32 %105)
%107 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %3
br label %108
108: ; preds = %101, %100, %89, %78, %67, %56, %45, %34, %23
%109 = load i32, i32* %3
ret i32 %109
}

LLVM IR (-O2):
@.str = [35 x i8] c"=== uid=%d gid=%d euid=%d egid=%d\0A\00"
@str.7 = [13 x i8] c"seteuid(uid)\00"
@str.8 = [14 x i8] c"seteuid(euid)\00"
@str.11 = [12 x i8] c"setuid(uid)\00"
@str.12 = [13 x i8] c"setuid(euid)\00"
@str.13 = [9 x i8] c"=== DONE\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getuid()
%4 = tail call i32 (...) @geteuid()
%5 = tail call i32 (...) @getgid()
%6 = tail call i32 (...) @getegid()
%7 = tail call i32 (...) @getuid()
%8 = tail call i32 (...) @getgid()
%9 = tail call i32 (...) @geteuid()
%10 = tail call i32 (...) @getegid()
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8, i32 %9, i32 %10)
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.7, i64 0, i64 0))
%13 = tail call i64 @seteuid(i32 %3)
%14 = icmp slt i64 %13, 0
br i1 %14, label %85, label %15
15: ; preds = %2
%16 = tail call i32 (...) @getuid()
%17 = tail call i32 (...) @getgid()
%18 = tail call i32 (...) @geteuid()
%19 = tail call i32 (...) @getegid()
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %16, i32 %17, i32 %18, i32 %19)
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.8, i64 0, i64 0))
%22 = tail call i64 @seteuid(i32 %4)
%23 = icmp slt i64 %22, 0
br i1 %23, label %85, label %24
24: ; preds = %15
%25 = tail call i32 (...) @getuid()
%26 = tail call i32 (...) @getgid()
%27 = tail call i32 (...) @geteuid()
%28 = tail call i32 (...) @getegid()
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %25, i32 %26, i32 %27, i32 %28)
%30 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.7, i64 0, i64 0))
%31 = tail call i64 @seteuid(i32 %3)
%32 = icmp slt i64 %31, 0
br i1 %32, label %85, label %33
33: ; preds = %24
%34 = tail call i32 (...) @getuid()
%35 = tail call i32 (...) @getgid()
%36 = tail call i32 (...) @geteuid()
%37 = tail call i32 (...) @getegid()
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %34, i32 %35, i32 %36, i32 %37)
%39 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.8, i64 0, i64 0))
%40 = tail call i64 @seteuid(i32 %4)
%41 = icmp slt i64 %40, 0
br i1 %41, label %85, label %42
42: ; preds = %33
%43 = tail call i32 (...) @getuid()
%44 = tail call i32 (...) @getgid()
%45 = tail call i32 (...) @geteuid()
%46 = tail call i32 (...) @getegid()
%47 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %43, i32 %44, i32 %45, i32 %46)
%48 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.11, i64 0, i64 0))
%49 = tail call i64 @setuid(i32 %3)
%50 = icmp slt i64 %49, 0
br i1 %50, label %85, label %51
51: ; preds = %42
%52 = tail call i32 (...) @getuid()
%53 = tail call i32 (...) @getgid()
%54 = tail call i32 (...) @geteuid()
%55 = tail call i32 (...) @getegid()
%56 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %52, i32 %53, i32 %54, i32 %55)
%57 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.12, i64 0, i64 0))
%58 = tail call i64 @setuid(i32 %4)
%59 = icmp slt i64 %58, 0
br i1 %59, label %85, label %60
60: ; preds = %51
%61 = tail call i32 (...) @getuid()
%62 = tail call i32 (...) @getgid()
%63 = tail call i32 (...) @geteuid()
%64 = tail call i32 (...) @getegid()
%65 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %61, i32 %62, i32 %63, i32 %64)
%66 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.11, i64 0, i64 0))
%67 = tail call i64 @setuid(i32 %3)
%68 = icmp slt i64 %67, 0
br i1 %68, label %85, label %69
69: ; preds = %60
%70 = tail call i32 (...) @getuid()
%71 = tail call i32 (...) @getgid()
%72 = tail call i32 (...) @geteuid()
%73 = tail call i32 (...) @getegid()
%74 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %70, i32 %71, i32 %72, i32 %73)
%75 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.12, i64 0, i64 0))
%76 = tail call i64 @setuid(i32 %4)
%77 = icmp slt i64 %76, 0
br i1 %77, label %85, label %78
78: ; preds = %69
%79 = tail call i32 (...) @getuid()
%80 = tail call i32 (...) @getgid()
%81 = tail call i32 (...) @geteuid()
%82 = tail call i32 (...) @getegid()
%83 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %79, i32 %80, i32 %81, i32 %82)
%84 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.13, i64 0, i64 0))
br label %85
85: ; preds = %69, %60, %51, %42, %33, %24, %15, %2, %78
%86 = phi i32 [ 0, %78 ], [ 1, %2 ], [ 1, %15 ], [ 1, %24 ], [ 1, %33 ], [ 1, %42 ], [ 1, %51 ], [ 1, %60 ], [ 1, %69 ]
ret i32 %86
}