#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 */

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
scalar_t__ getegid();
scalar_t__ geteuid();
scalar_t__ getgid();
scalar_t__ getuid();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ st_precolos();
int /*<<< orphan*/ stdout;
int main(int argc, char **argv, char **env) {
  long lc_alpha;
  printf("{");
  lc_alpha = (long)getuid();
  st_precolos();
  printf("\"uid\":%ld", lc_alpha);
  lc_alpha = (long)geteuid();
  st_precolos();
  printf("\"euid\":%ld", lc_alpha);
  lc_alpha = (long)getgid();
  st_precolos();
  printf("\"gid\":%ld", lc_alpha);
  lc_alpha = (long)getegid();
  st_precolos();
  printf("\"egid\":%ld", lc_alpha);
  printf("\n}\n");
  fflush(stdout);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <getuid@plt>
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1030 <st_precolos@plt>
mov    -0x20(%rbp),%rsi
lea    0xe54(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1060 <geteuid@plt>
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1030 <st_precolos@plt>
mov    -0x20(%rbp),%rsi
lea    0xe3a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1070 <getgid@plt>
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1030 <st_precolos@plt>
mov    -0x20(%rbp),%rsi
lea    0xe21(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1090 <getegid@plt>
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1030 <st_precolos@plt>
mov    -0x20(%rbp),%rsi
lea    0xe07(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe04(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x2daa(%rip),%rax
mov    (%rax),%edi
call   1080 <fflush@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x7b,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1060 <getuid@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <st_precolos@plt>
lea    0xe4d(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
xor    %eax,%eax
call   1080 <geteuid@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <st_precolos@plt>
lea    0xe35(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
xor    %eax,%eax
call   1090 <getgid@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <st_precolos@plt>
lea    0xe1e(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
xor    %eax,%eax
call   10b0 <getegid@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <st_precolos@plt>
lea    0xe06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xe00(%rip),%rdi
call   1040 <puts@plt>
mov    0x2daa(%rip),%rax
mov    (%rax),%edi
call   10a0 <fflush@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"{\00"
@.str.1 = [10 x i8] c"\22uid\22:%ld\00"
@.str.2 = [11 x i8] c"\22euid\22:%ld\00"
@.str.3 = [10 x i8] c"\22gid\22:%ld\00"
@.str.4 = [11 x i8] c"\22egid\22:%ld\00"
@.str.5 = [4 x i8] c"\0A}\0A\00"
@stdout = global i32 0
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8**
%7 = alloca i64
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8** %2, i8*** %6
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = call i64 (...) @getuid()
store i64 %9, i64* %7
%10 = call i32 (...) @st_precolos()
%11 = load i64, i64* %7
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64 %11)
%13 = call i64 (...) @geteuid()
store i64 %13, i64* %7
%14 = call i32 (...) @st_precolos()
%15 = load i64, i64* %7
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i64 %15)
%17 = call i64 (...) @getgid()
store i64 %17, i64* %7
%18 = call i32 (...) @st_precolos()
%19 = load i64, i64* %7
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i64 %19)
%21 = call i64 (...) @getegid()
store i64 %21, i64* %7
%22 = call i32 (...) @st_precolos()
%23 = load i64, i64* %7
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i64 %23)
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%26 = load i32, i32* @stdout
%27 = call i32 @fflush(i32 %26)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [10 x i8] c"\22uid\22:%ld\00"
@.str.2 = [11 x i8] c"\22euid\22:%ld\00"
@.str.3 = [10 x i8] c"\22gid\22:%ld\00"
@.str.4 = [11 x i8] c"\22egid\22:%ld\00"
@stdout = global i32 0
@str = [3 x i8] c"\0A}\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = tail call i32 @putchar(i32 123)
%5 = tail call i64 (...) @getuid()
%6 = tail call i32 (...) @st_precolos()
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64 %5)
%8 = tail call i64 (...) @geteuid()
%9 = tail call i32 (...) @st_precolos()
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i64 %8)
%11 = tail call i64 (...) @getgid()
%12 = tail call i32 (...) @st_precolos()
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i64 %11)
%14 = tail call i64 (...) @getegid()
%15 = tail call i32 (...) @st_precolos()
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i64 %14)
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
%18 = load i32, i32* @stdout
%19 = tail call i32 @fflush(i32 %18)
ret i32 0
}