#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 */
scalar_t__ omb_utils_file_exists(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, ...);
int /*<<< orphan*/ system(char *);
void omb_utils_remove_nextboot() {
  char tmp[255];
  sprintf(tmp, "%s/%s/.%s", "/omb", "open-multiboot", "nextboot");
  if (omb_utils_file_exists(tmp)) {
    char cmd[255];
    sprintf(cmd, "rm -rf %s", tmp);
    system(cmd);
  }
}


x86 assembly (clang, -O0):
<omb_utils_remove_nextboot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x200,%rsp
lea    -0x100(%rbp),%rdi
lea    0xeb7(%rip),%rsi
lea    0xeba(%rip),%rdx
lea    0xeb8(%rip),%rcx
lea    0xec0(%rip),%r8
mov    $0x0,%al
call   1050 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <omb_utils_file_exists@plt>
cmp    $0x0,%rax
je     11a3 <omb_utils_remove_nextboot+0x73>
lea    -0x200(%rbp),%rdi
lea    -0x100(%rbp),%rdx
lea    0xe97(%rip),%rsi
mov    $0x0,%al
call   1050 <sprintf@plt>
lea    -0x200(%rbp),%rdi
call   1040 <system@plt>
add    $0x200,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<omb_utils_remove_nextboot>:
push   %rbx
sub    $0x200,%rsp
lea    0xec1(%rip),%rsi
lea    0xec4(%rip),%rdx
lea    0xec2(%rip),%rcx
lea    0xeca(%rip),%r8
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <omb_utils_file_exists@plt>
test   %rax,%rax
je     1192 <omb_utils_remove_nextboot+0x62>
lea    0xeb2(%rip),%rsi
lea    0x100(%rsp),%rbx
mov    %rsp,%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <system@plt>
add    $0x200,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%s/%s/.%s\00"
@.str.1 = [5 x i8] c"/omb\00"
@.str.2 = [15 x i8] c"open-multiboot\00"
@.str.3 = [9 x i8] c"nextboot\00"
@.str.4 = [10 x i8] c"rm -rf %s\00"
define void @omb_utils_remove_nextboot() {
%1 = alloca [255 x i8]
%2 = alloca [255 x i8]
%3 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%4 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%5 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%6 = call i64 @omb_utils_file_exists(i8* %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %0
%9 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 0
%10 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%11 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %9, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8* %10)
%12 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 0
%13 = call i32 @system(i8* %12)
br label %14
14: ; preds = %8, %0
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"%s/%s/.%s\00"
@.str.1 = [5 x i8] c"/omb\00"
@.str.2 = [15 x i8] c"open-multiboot\00"
@.str.3 = [9 x i8] c"nextboot\00"
@.str.4 = [10 x i8] c"rm -rf %s\00"
define void @omb_utils_remove_nextboot() {
%1 = alloca [255 x i8]
%2 = alloca [255 x i8]
%3 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%4 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%5 = call i64 @omb_utils_file_exists(i8* %3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %0
%8 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 0
%9 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %8, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8* %3)
%10 = call i32 @system(i8* %8)
br label %11
11: ; preds = %7, %0
ret void
}