#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*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ make_fs(char *);
int /*<<< orphan*/ stderr;
scalar_t__ umount_fs(char *);
int env_cleanup() {
  if (umount_fs("test.fs")) {
    fprintf(stderr, "env_cleanup: Couldn't unmount disk.\n");
    return -1;
  }
  if (make_fs("test.fs")) {
    fprintf(stderr, "env_cleanup: Couldn't wipe disk.\n");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<env_cleanup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1040 <umount_fs@plt>
cmp    $0x0,%rax
je     116f <env_cleanup+0x3f>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
lea    0xeaa(%rip),%rsi
call   1050 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    11ad <env_cleanup+0x7d>
lea    0xe8a(%rip),%rdi
call   1030 <make_fs@plt>
cmp    $0x0,%rax
je     11a6 <env_cleanup+0x76>
mov    0x2e54(%rip),%rax
mov    (%rax),%edi
lea    0xe98(%rip),%rsi
call   1050 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    11ad <env_cleanup+0x7d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<env_cleanup>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <umount_fs@plt>
test   %rax,%rax
je     114b <env_cleanup+0x1b>
lea    0xebf(%rip),%rsi
jmp    1163 <env_cleanup+0x33>
lea    0xeae(%rip),%rdi
call   1030 <make_fs@plt>
test   %rax,%rax
je     1178 <env_cleanup+0x48>
lea    0xeca(%rip),%rsi
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
call   1050 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"test.fs\00"
@stderr = global i32 0
@.str.1 = [37 x i8] c"env_cleanup: Couldn't unmount disk.\0A\00"
@.str.2 = [34 x i8] c"env_cleanup: Couldn't wipe disk.\0A\00"
define i32 @env_cleanup() {
%1 = alloca i32
%2 = call i64 @umount_fs(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %1
br label %14
7: ; preds = %0
%8 = call i64 @make_fs(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load i32, i32* @stderr
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0))
store i32 -1, i32* %1
br label %14
13: ; preds = %7
store i32 0, i32* %1
br label %14
14: ; preds = %13, %10, %4
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@.str = [8 x i8] c"test.fs\00"
@stderr = global i32 0
@.str.1 = [37 x i8] c"env_cleanup: Couldn't unmount disk.\0A\00"
@.str.2 = [34 x i8] c"env_cleanup: Couldn't wipe disk.\0A\00"
define i32 @env_cleanup() {
%1 = tail call i64 @umount_fs(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i64 @make_fs(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %3, %0
%7 = phi i8* [ getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), %0 ], [ getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), %3 ]
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* %7)
br label %10
10: ; preds = %6, %3
%11 = phi i32 [ 0, %3 ], [ -1, %6 ]
ret i32 %11
}