#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;
struct passwd {
  char *pw_name;
};
struct group {
  char *gr_name;
};
typedef int mode_t;
typedef int gid_t;

/* Variables and functions */
struct group *getgrgid(int);
struct passwd *getpwuid(int);
int /*<<< orphan*/ printf(char *, char const *, int, int, char *, int, char *,
                          int);
void print_new_rule(const char *name, mode_t mode, uid_t uid, gid_t gid) {
  struct passwd *pw;
  struct group *gr;
  gr = getgrgid(gid);
  pw = getpwuid(uid);
  printf("%s %4o %4o %s %d %s %d\n", name, mode, mode, pw->pw_name, uid,
         gr->gr_name, gid);
}


x86 assembly (clang, -O0):
<print_new_rule>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <getgrgid@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <getpwuid@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    (%rax),%r8
mov    -0x10(%rbp),%r9d
mov    -0x28(%rbp),%rax
mov    (%rax),%r10
mov    -0x14(%rbp),%eax
lea    0xe7d(%rip),%rdi
mov    %r10,(%rsp)
mov    %eax,0x8(%rsp)
call   1040 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_new_rule>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %ecx,%r14d
mov    %edx,%ebp
mov    %esi,%ebx
mov    %rdi,%r15
mov    %ecx,%edi
call   1050 <getgrgid@plt>
mov    %rax,%r12
mov    %ebp,%edi
call   1030 <getpwuid@plt>
mov    (%rax),%r8
lea    0xea3(%rip),%rdi
mov    %r15,%rsi
mov    %ebx,%edx
mov    %ebx,%ecx
mov    %ebp,%r9d
push   %r14
push   (%r12)
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.passwd = type { i8* }
%struct.group = type { i8* }
@.str = [24 x i8] c"%s %4o %4o %s %d %s %d\0A\00"
define void @print_new_rule(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca %struct.passwd*
%10 = alloca %struct.group*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i32, i32* %8
%12 = call %struct.group* @getgrgid(i32 %11)
store %struct.group* %12, %struct.group** %10
%13 = load i32, i32* %7
%14 = call %struct.passwd* @getpwuid(i32 %13)
store %struct.passwd* %14, %struct.passwd** %9
%15 = load i8*, i8** %5
%16 = load i32, i32* %6
%17 = load i32, i32* %6
%18 = load %struct.passwd*, %struct.passwd** %9
%19 = getelementptr inbounds %struct.passwd, %struct.passwd* %18, i32 0, i32 0
%20 = load i8*, i8** %19
%21 = load i32, i32* %7
%22 = load %struct.group*, %struct.group** %10
%23 = getelementptr inbounds %struct.group, %struct.group* %22, i32 0, i32 0
%24 = load i8*, i8** %23
%25 = load i32, i32* %8
%26 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %15, i32 %16, i32 %17, i8* %20, i32 %21, i8* %24, i32 %25)
ret void
}

LLVM IR (-O2):
%struct.group = type { i8* }
%struct.passwd = type { i8* }
@.str = [24 x i8] c"%s %4o %4o %s %d %s %d\0A\00"
define void @print_new_rule(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call %struct.group* @getgrgid(i32 %3)
%6 = tail call %struct.passwd* @getpwuid(i32 %2)
%7 = getelementptr inbounds %struct.passwd, %struct.passwd* %6, i64 0, i32 0
%8 = load i8*, i8** %7
%9 = getelementptr inbounds %struct.group, %struct.group* %5, i64 0, i32 0
%10 = load i8*, i8** %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i32 %1, i8* %8, i32 %2, i8* %10, i32 %3)
ret void
}