#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*/ mumps_io_sys_error(int, char *);
scalar_t__ remove(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
void mumps_ooc_remove_file_c(int *ierr, char *name, int l1) {
  char buf[256];
  *ierr = (int)remove(name);
  if (*ierr < 0) {
    sprintf(buf, "Unable to remove OOC file %s", name);
    *ierr = -90;
    mumps_io_sys_error((int)*ierr, buf);
    return;
  }
  return;
}


x86 assembly (clang, -O0):
<mumps_ooc_remove_file_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <remove@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
jge    119c <mumps_ooc_remove_file_c+0x6c>
lea    -0x120(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe8a(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x8(%rbp),%rax
movl   $0xffffffa6,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
lea    -0x120(%rbp),%rsi
call   1040 <mumps_io_sys_error@plt>
jmp    11a1 <mumps_ooc_remove_file_c+0x71>
jmp    11a1 <mumps_ooc_remove_file_c+0x71>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mumps_ooc_remove_file_c>:
push   %r15
push   %r14
push   %rbx
sub    $0x100,%rsp
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <remove@plt>
mov    %eax,(%r14)
test   %eax,%eax
jns    117a <mumps_ooc_remove_file_c+0x4a>
lea    0xea8(%rip),%rsi
mov    %rsp,%r15
mov    %r15,%rdi
mov    %rbx,%rdx
call   1050 <sprintf@plt>
movl   $0xffffffa6,(%r14)
mov    $0xffffffa6,%edi
mov    %r15,%rsi
call   1040 <mumps_io_sys_error@plt>
add    $0x100,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Unable to remove OOC file %s\00"
define void @mumps_ooc_remove_file_c(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca [256 x i8]
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %5
%9 = call i64 @remove(i8* %8)
%10 = trunc i64 %9 to i32
%11 = load i32*, i32** %4
store i32 %10, i32* %11
%12 = load i32*, i32** %4
%13 = load i32, i32* %12
%14 = icmp slt i32 %13, 0
br i1 %14, label %15, label %24
15: ; preds = %3
%16 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%17 = load i8*, i8** %5
%18 = call i32 @sprintf(i8* %16, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %17)
%19 = load i32*, i32** %4
store i32 -90, i32* %19
%20 = load i32*, i32** %4
%21 = load i32, i32* %20
%22 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%23 = call i32 @mumps_io_sys_error(i32 %21, i8* %22)
br label %25
24: ; preds = %3
br label %25
25: ; preds = %24, %15
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"Unable to remove OOC file %s\00"
define void @mumps_ooc_remove_file_c(i32* nocapture writeonly %0, i8* %1, i32 %2) {
%4 = alloca [256 x i8]
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%6 = tail call i64 @remove(i8* %1)
%7 = trunc i64 %6 to i32
store i32 %7, i32* %0
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %1)
store i32 -90, i32* %0
%11 = call i32 @mumps_io_sys_error(i32 -90, i8* %5)
br label %12
12: ; preds = %3, %9
ret void
}