#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 PATH_MAX;
int /*<<< orphan*/ logprintf(char *, char const *);
int /*<<< orphan*/ sprintf(char *, char *, char const *);
int /*<<< orphan*/ wipe_lv(char *);
void wipe_lv_set(const char *lv_set) {
  char lv[PATH_MAX];
  logprintf("0wiping volumes starting with %s", lv_set);
  sprintf(lv, "%s-system", lv_set);
  wipe_lv(lv);
  sprintf(lv, "%s-data", lv_set);
  wipe_lv(lv);
  sprintf(lv, "%s-cache", lv_set);
  wipe_lv(lv);
}


x86 assembly (clang, -O0):
<wipe_lv_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x20(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xe8d(%rip),%rdi
call   1050 <logprintf@plt>
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe9a(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <wipe_lv@plt>
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe87(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <wipe_lv@plt>
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe72(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <wipe_lv@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wipe_lv_set>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
mov    %rdi,%r14
mov    0x2eaf(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
lea    0xea5(%rip),%rdi
mov    %r14,%rsi
call   1050 <logprintf@plt>
lea    0xeb7(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <wipe_lv@plt>
lea    0xea7(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <wipe_lv@plt>
lea    0xe95(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <wipe_lv@plt>
lea    -0x10(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@PATH_MAX = global i32 0
@.str = [33 x i8] c"0wiping volumes starting with %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 @wipe_lv_set(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i32, i32* @PATH_MAX
%6 = zext i32 %5 to i64
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %3
%8 = alloca i8, i64 %6
store i64 %6, i64* %4
%9 = load i8*, i8** %2
%10 = call i32 @logprintf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = load i8*, i8** %2
%12 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %11)
%13 = call i32 @wipe_lv(i8* %8)
%14 = load i8*, i8** %2
%15 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %14)
%16 = call i32 @wipe_lv(i8* %8)
%17 = load i8*, i8** %2
%18 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8* %17)
%19 = call i32 @wipe_lv(i8* %8)
%20 = load i8*, i8** %3
ret void
}

LLVM IR (-O2):
@PATH_MAX = global i32 0
@.str = [33 x i8] c"0wiping volumes starting with %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 @wipe_lv_set(i8* %0) {
%2 = load i32, i32* @PATH_MAX
%3 = zext i32 %2 to i64
%4 = alloca i8, i64 %3
%5 = tail call i32 @logprintf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%7 = call i32 @wipe_lv(i8* %4)
%8 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %0)
%9 = call i32 @wipe_lv(i8* %4)
%10 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8* %0)
%11 = call i32 @wipe_lv(i8* %4)
ret void
}