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

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ puts(char *);
scalar_t__ remove(char const *);
int /*<<< orphan*/ spc_file_wipe(int /*<<< orphan*/ *);
int gutman(const char *ftex) {
  FILE *pFile;
  pFile = fopen(ftex, "r+w");
  if (pFile != NULL) {
    spc_file_wipe(pFile);
    fclose(pFile);
    if (remove(ftex) != 0)
      perror("Error deleting file\n");
    else
      puts("File successfully deleted\n");
  } else
    printf("%s\n", "error");
  return 0;
}


x86 assembly (clang, -O0):
<gutman>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe79(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     11e2 <gutman+0x72>
mov    -0x10(%rbp),%rdi
call   1070 <spc_file_wipe@plt>
mov    -0x10(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x8(%rbp),%rdi
call   1030 <remove@plt>
cmp    $0x0,%rax
je     11d1 <gutman+0x61>
lea    0xe3d(%rip),%rdi
call   1090 <perror@plt>
jmp    11dd <gutman+0x6d>
lea    0xe41(%rip),%rdi
call   1040 <puts@plt>
jmp    11f5 <gutman+0x85>
lea    0xe4b(%rip),%rdi
lea    0xe48(%rip),%rsi
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gutman>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xe82(%rip),%rsi
call   1080 <fopen@plt>
test   %rax,%rax
je     11b6 <gutman+0x46>
mov    %rax,%rbx
mov    %rax,%rdi
call   1070 <spc_file_wipe@plt>
mov    %rbx,%rdi
call   1050 <fclose@plt>
mov    %r14,%rdi
call   1030 <remove@plt>
test   %rax,%rax
jne    11d3 <gutman+0x63>
lea    0xe6a(%rip),%rdi
call   1040 <puts@plt>
jmp    11c9 <gutman+0x59>
lea    0xe77(%rip),%rdi
lea    0xe74(%rip),%rsi
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xe2a(%rip),%rdi
call   1090 <perror@plt>
jmp    11c9 <gutman+0x59>

LLVM IR (-O0):
@.str = [4 x i8] c"r+w\00"
@.str.1 = [21 x i8] c"Error deleting file\0A\00"
@.str.2 = [27 x i8] c"File successfully deleted\0A\00"
@.str.3 = [4 x i8] c"%s\0A\00"
@.str.4 = [6 x i8] c"error\00"
define i32 @gutman(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = icmp ne i32* %6, null
br i1 %7, label %8, label %21
8: ; preds = %1
%9 = load i32*, i32** %3
%10 = call i32 @spc_file_wipe(i32* %9)
%11 = load i32*, i32** %3
%12 = call i32 @fclose(i32* %11)
%13 = load i8*, i8** %2
%14 = call i64 @remove(i8* %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %8
%17 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
br label %20
18: ; preds = %8
%19 = call i32 @puts(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
br label %20
20: ; preds = %18, %16
br label %23
21: ; preds = %1
%22 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %23
23: ; preds = %21, %20
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"r+w\00"
@.str.1 = [21 x i8] c"Error deleting file\0A\00"
@.str.2 = [27 x i8] c"File successfully deleted\0A\00"
@.str.3 = [4 x i8] c"%s\0A\00"
@.str.4 = [6 x i8] c"error\00"
define i32 @gutman(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %13, label %4
4: ; preds = %1
%5 = tail call i32 @spc_file_wipe(i32* %2)
%6 = tail call i32 @fclose(i32* %2)
%7 = tail call i64 @remove(i8* %0)
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %4
%10 = tail call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
br label %15
11: ; preds = %4
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
br label %15
13: ; preds = %1
%14 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %15
15: ; preds = %9, %11, %13
ret i32 0
}