#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 path {
  int dummy;
};
struct inode {
  int dummy;
};
struct dentry {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ au_set_dbwh(struct dentry *, int);
int do_unlink_wh(struct inode *, struct path *);
int au_wh_unlink_dentry(struct inode *h_dir, struct path *h_path,
                        struct dentry *dentry) {
  int err;
  err = do_unlink_wh(h_dir, h_path);
  if (!err && dentry)
    au_set_dbwh(dentry, -1);
  return err;
}


x86 assembly (clang, -O0):
<au_wh_unlink_dentry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <do_unlink_wh@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    1167 <au_wh_unlink_dentry+0x47>
cmpq   $0x0,-0x18(%rbp)
je     1167 <au_wh_unlink_dentry+0x47>
mov    -0x18(%rbp),%rdi
mov    $0xffffffff,%esi
call   1040 <au_set_dbwh@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<au_wh_unlink_dentry>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
call   1030 <do_unlink_wh@plt>
mov    %eax,%ebp
test   %rbx,%rbx
je     1143 <au_wh_unlink_dentry+0x23>
test   %ebp,%ebp
jne    1143 <au_wh_unlink_dentry+0x23>
mov    %rbx,%rdi
mov    $0xffffffff,%esi
call   1040 <au_set_dbwh@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.inode = type { i32 }
%struct.path = type { i32 }
%struct.dentry = type { i32 }
define i32 @au_wh_unlink_dentry(%struct.inode* %0, %struct.path* %1, %struct.dentry* %2) {
%4 = alloca %struct.inode*
%5 = alloca %struct.path*
%6 = alloca %struct.dentry*
%7 = alloca i32
store %struct.inode* %0, %struct.inode** %4
store %struct.path* %1, %struct.path** %5
store %struct.dentry* %2, %struct.dentry** %6
%8 = load %struct.inode*, %struct.inode** %4
%9 = load %struct.path*, %struct.path** %5
%10 = call i32 @do_unlink_wh(%struct.inode* %8, %struct.path* %9)
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = icmp ne i32 %11, 0
br i1 %12, label %19, label %13
13: ; preds = %3
%14 = load %struct.dentry*, %struct.dentry** %6
%15 = icmp ne %struct.dentry* %14, null
br i1 %15, label %16, label %19
16: ; preds = %13
%17 = load %struct.dentry*, %struct.dentry** %6
%18 = call i32 @au_set_dbwh(%struct.dentry* %17, i32 -1)
br label %19
19: ; preds = %16, %13, %3
%20 = load i32, i32* %7
ret i32 %20
}

LLVM IR (-O2):
%struct.inode = type { i32 }
%struct.path = type { i32 }
%struct.dentry = type { i32 }
define i32 @au_wh_unlink_dentry(%struct.inode* %0, %struct.path* %1, %struct.dentry* %2) {
%4 = tail call i32 @do_unlink_wh(%struct.inode* %0, %struct.path* %1)
%5 = icmp eq i32 %4, 0
%6 = icmp ne %struct.dentry* %2, null
%7 = and i1 %6, %5
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = tail call i32 @au_set_dbwh(%struct.dentry* %2, i32 -1)
br label %10
10: ; preds = %8, %3
ret i32 %4
}