#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*/ _drop_metadata(char const *, int);
int /*<<< orphan*/ init_full_scan_done(int /*<<< orphan*/);
int /*<<< orphan*/ strcmp(char const *, char *);
int /*<<< orphan*/ vgname_is_locked(char *);
void lvmcache_drop_metadata(const char *vgname, int drop_precommitted) {
  if (!strcmp(vgname, "#orphans")) {
    _drop_metadata("#orphans"
                   "_"
                   "lvm2",
                   0);
    _drop_metadata("#orphans"
                   "_"
                   "lvm1",
                   0);
    _drop_metadata("#orphans"
                   "_"
                   "pool",
                   0);
    init_full_scan_done(0);
  } else if (!vgname_is_locked("#global"))
    _drop_metadata(vgname, drop_precommitted);
}


x86 assembly (clang, -O0):
<lvmcache_drop_metadata>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea6(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    119e <lvmcache_drop_metadata+0x5e>
lea    0xe9a(%rip),%rdi
xor    %esi,%esi
call   1040 <_drop_metadata@plt>
lea    0xe9a(%rip),%rdi
xor    %esi,%esi
call   1040 <_drop_metadata@plt>
lea    0xe9a(%rip),%rdi
xor    %esi,%esi
call   1040 <_drop_metadata@plt>
xor    %edi,%edi
call   1060 <init_full_scan_done@plt>
jmp    11c4 <lvmcache_drop_metadata+0x84>
lea    0xe8e(%rip),%rdi
call   1030 <vgname_is_locked@plt>
cmp    $0x0,%eax
jne    11bf <lvmcache_drop_metadata+0x7f>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <_drop_metadata@plt>
jmp    11c4 <lvmcache_drop_metadata+0x84>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lvmcache_drop_metadata>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xeb1(%rip),%rsi
call   1050 <strcmp@plt>
test   %eax,%eax
je     116f <lvmcache_drop_metadata+0x2f>
lea    0xed4(%rip),%rdi
call   1030 <vgname_is_locked@plt>
test   %eax,%eax
je     11a6 <lvmcache_drop_metadata+0x66>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xe93(%rip),%rdi
xor    %esi,%esi
call   1040 <_drop_metadata@plt>
lea    0xe93(%rip),%rdi
xor    %esi,%esi
call   1040 <_drop_metadata@plt>
lea    0xe93(%rip),%rdi
xor    %esi,%esi
call   1040 <_drop_metadata@plt>
xor    %edi,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <init_full_scan_done@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <_drop_metadata@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"#orphans\00"
@.str.1 = [14 x i8] c"#orphans_lvm2\00"
@.str.2 = [14 x i8] c"#orphans_lvm1\00"
@.str.3 = [14 x i8] c"#orphans_pool\00"
@.str.4 = [8 x i8] c"#global\00"
define void @lvmcache_drop_metadata(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 @strcmp(i8* %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%7 = icmp ne i32 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %2
%9 = call i32 @_drop_metadata(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 0)
%10 = call i32 @_drop_metadata(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 0)
%11 = call i32 @_drop_metadata(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 0)
%12 = call i32 @init_full_scan_done(i32 0)
br label %21
13: ; preds = %2
%14 = call i32 @vgname_is_locked(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
%15 = icmp ne i32 %14, 0
br i1 %15, label %20, label %16
16: ; preds = %13
%17 = load i8*, i8** %3
%18 = load i32, i32* %4
%19 = call i32 @_drop_metadata(i8* %17, i32 %18)
br label %20
20: ; preds = %16, %13
br label %21
21: ; preds = %20, %8
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"#orphans\00"
@.str.1 = [14 x i8] c"#orphans_lvm2\00"
@.str.2 = [14 x i8] c"#orphans_lvm1\00"
@.str.3 = [14 x i8] c"#orphans_pool\00"
@.str.4 = [8 x i8] c"#global\00"
define void @lvmcache_drop_metadata(i8* %0, i32 %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(9) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = tail call i32 @_drop_metadata(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 0)
%7 = tail call i32 @_drop_metadata(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 0)
%8 = tail call i32 @_drop_metadata(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 0)
%9 = tail call i32 @init_full_scan_done(i32 0)
br label %15
10: ; preds = %2
%11 = tail call i32 @vgname_is_locked(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = tail call i32 @_drop_metadata(i8* %0, i32 %1)
br label %15
15: ; preds = %10, %13, %5
ret void
}