#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 /*<<< orphan*/ lv;

/* Variables and functions */
int /*<<< orphan*/ delete_lv(char *);
int /*<<< orphan*/ logprintf(char *, char const *);
int /*<<< orphan*/ snprintf(char *, int, char *, char const *);
void delete_lv_set(const char *set) {
  char lv[32];
  logprintf("0deleting volume set %s", set);
  snprintf(lv, sizeof(lv), "%s-system", set);
  delete_lv(lv);
  snprintf(lv, sizeof(lv), "%s-data", set);
  delete_lv(lv);
  snprintf(lv, sizeof(lv), "%s-cache", set);
  delete_lv(lv);
}


x86 assembly (clang, -O0):
<delete_lv_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1050 <logprintf@plt>
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x20,%esi
lea    0xeb8(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x30(%rbp),%rdi
call   1040 <delete_lv@plt>
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x20,%esi
lea    0xea0(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x30(%rbp),%rdi
call   1040 <delete_lv@plt>
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x20,%esi
lea    0xe86(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x30(%rbp),%rdi
call   1040 <delete_lv@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delete_lv_set>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rdi,%rbx
lea    0xebf(%rip),%rdi
mov    %rbx,%rsi
call   1050 <logprintf@plt>
lea    0xec8(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x20,%esi
mov    %rbx,%rcx
call   1030 <snprintf@plt>
mov    %r14,%rdi
call   1040 <delete_lv@plt>
lea    0xeb0(%rip),%rdx
mov    %r14,%rdi
mov    $0x20,%esi
mov    %rbx,%rcx
call   1030 <snprintf@plt>
mov    %r14,%rdi
call   1040 <delete_lv@plt>
lea    0xe99(%rip),%rdx
mov    %r14,%rdi
mov    $0x20,%esi
mov    %rbx,%rcx
call   1030 <snprintf@plt>
mov    %r14,%rdi
call   1040 <delete_lv@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [24 x i8] c"0deleting volume set %s\00"
@.str.1 = [10 x i8] c"%s-system\00"
@.str.2 = [8 x i8] c"%s-data\00"
@.str.3 = [9 x i8] c"%s-cache\00"
define void @delete_lv_set(i8* %0) {
%2 = alloca i8*
%3 = alloca [32 x i8]
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @logprintf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%7 = load i8*, i8** %2
%8 = call i32 @snprintf(i8* %6, i32 32, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%10 = call i32 @delete_lv(i8* %9)
%11 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%12 = load i8*, i8** %2
%13 = call i32 @snprintf(i8* %11, i32 32, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %12)
%14 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%15 = call i32 @delete_lv(i8* %14)
%16 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%17 = load i8*, i8** %2
%18 = call i32 @snprintf(i8* %16, i32 32, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8* %17)
%19 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%20 = call i32 @delete_lv(i8* %19)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"0deleting volume set %s\00"
@.str.1 = [10 x i8] c"%s-system\00"
@.str.2 = [8 x i8] c"%s-data\00"
@.str.3 = [9 x i8] c"%s-cache\00"
define void @delete_lv_set(i8* %0) {
%2 = alloca [32 x i8]
%3 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%4 = tail call i32 @logprintf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @snprintf(i8* %3, i32 32, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%6 = call i32 @delete_lv(i8* %3)
%7 = call i32 @snprintf(i8* %3, i32 32, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %0)
%8 = call i32 @delete_lv(i8* %3)
%9 = call i32 @snprintf(i8* %3, i32 32, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8* %0)
%10 = call i32 @delete_lv(i8* %3)
ret void
}