#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 lvmcache_vginfo {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _update_cache_vginfo_lock_state(struct lvmcache_vginfo *,
                                                   int);
struct lvmcache_vginfo *vginfo_from_vgname(char const *, char const *);
void _update_cache_lock_state(char const *vgname, int locked) {
  struct lvmcache_vginfo *vginfo;
  void *__cil_tmp4;
  char const *__cil_tmp5;
  {
    {
      __cil_tmp4 = (void *)0;
      __cil_tmp5 = (char const *)__cil_tmp4;
      vginfo = vginfo_from_vgname(vgname, __cil_tmp5);
    }
    if (vginfo) {
    } else {
      return;
    }
    { _update_cache_vginfo_lock_state(vginfo, locked); }
    return;
  }
}


x86 assembly (clang, -O0):
<_update_cache_lock_state>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1040 <vginfo_from_vgname@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1160 <_update_cache_lock_state+0x40>
jmp    1165 <_update_cache_lock_state+0x45>
jmp    1171 <_update_cache_lock_state+0x51>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <_update_cache_vginfo_lock_state@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_update_cache_lock_state>:
push   %rbx
mov    %esi,%ebx
xor    %esi,%esi
call   1040 <vginfo_from_vgname@plt>
test   %rax,%rax
je     113a <_update_cache_lock_state+0x1a>
mov    %rax,%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <_update_cache_vginfo_lock_state@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.lvmcache_vginfo = type { i32 }
define void @_update_cache_lock_state(i8* %0, i32 %1) {
%3 = tail call %struct.lvmcache_vginfo* @vginfo_from_vgname(i8* %0, i8* null)
%4 = icmp eq %struct.lvmcache_vginfo* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @_update_cache_vginfo_lock_state(%struct.lvmcache_vginfo* %3, i32 %1)
br label %7
7: ; preds = %2, %5
ret void
}