#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 inode_info {
  int dummy;
};
struct dir_info {
  int dummy;
};
struct dir_ent {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ add_dir_entry(struct dir_ent *, struct dir_info *,
                                 struct inode_info *);
struct dir_ent *create_dir_entry(char *, char *, char *, struct dir_info *);
void add_dir_entry2(char *name, char *source_name, char *nonstandard_pathname,
                    struct dir_info *sub_dir, struct inode_info *inode_info,
                    struct dir_info *dir) {
  struct dir_ent *dir_ent =
      create_dir_entry(name, source_name, nonstandard_pathname, dir);
  add_dir_entry(dir_ent, sub_dir, inode_info);
}


x86 assembly (clang, -O0):
<add_dir_entry2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x30(%rbp),%rcx
call   1040 <create_dir_entry@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1030 <add_dir_entry@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_dir_entry2>:
push   %r14
push   %rbx
push   %rax
mov    %r8,%r14
mov    %rcx,%rbx
mov    %r9,%rcx
call   1040 <create_dir_entry@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <add_dir_entry@plt>

LLVM IR (-O0):
%struct.inode_info = type { i32 }
%struct.dir_info = type { i32 }
%struct.dir_ent = type { i32 }
define void @add_dir_entry2(i8* %0, i8* %1, i8* %2, %struct.dir_info* %3, %struct.inode_info* %4, %struct.dir_info* %5) {
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca %struct.dir_info*
%11 = alloca %struct.inode_info*
%12 = alloca %struct.dir_info*
%13 = alloca %struct.dir_ent*
store i8* %0, i8** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store %struct.dir_info* %3, %struct.dir_info** %10
store %struct.inode_info* %4, %struct.inode_info** %11
store %struct.dir_info* %5, %struct.dir_info** %12
%14 = load i8*, i8** %7
%15 = load i8*, i8** %8
%16 = load i8*, i8** %9
%17 = load %struct.dir_info*, %struct.dir_info** %12
%18 = call %struct.dir_ent* @create_dir_entry(i8* %14, i8* %15, i8* %16, %struct.dir_info* %17)
store %struct.dir_ent* %18, %struct.dir_ent** %13
%19 = load %struct.dir_ent*, %struct.dir_ent** %13
%20 = load %struct.dir_info*, %struct.dir_info** %10
%21 = load %struct.inode_info*, %struct.inode_info** %11
%22 = call i32 @add_dir_entry(%struct.dir_ent* %19, %struct.dir_info* %20, %struct.inode_info* %21)
ret void
}

LLVM IR (-O2):
%struct.inode_info = type { i32 }
%struct.dir_info = type { i32 }
%struct.dir_ent = type { i32 }
define void @add_dir_entry2(i8* %0, i8* %1, i8* %2, %struct.dir_info* %3, %struct.inode_info* %4, %struct.dir_info* %5) {
%7 = tail call %struct.dir_ent* @create_dir_entry(i8* %0, i8* %1, i8* %2, %struct.dir_info* %5)
%8 = tail call i32 @add_dir_entry(%struct.dir_ent* %7, %struct.dir_info* %3, %struct.inode_info* %4)
ret void
}