#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 *, char *);
scalar_t__ is_file(char *);
int /*<<< orphan*/ unlink(char *);
void cache_update_stamp(void) {
  FILE *file;
  if (is_file("/usr/ports/.ilenia.stamp"))
    unlink("/usr/ports/.ilenia.stamp");
  file = fopen("/usr/ports/.ilenia.stamp", "w");
  if (file != NULL)
    fclose(file);
}


x86 assembly (clang, -O0):
<cache_update_stamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
call   1050 <is_file@plt>
cmp    $0x0,%rax
je     116a <cache_update_stamp+0x2a>
lea    0xe9b(%rip),%rdi
call   1030 <unlink@plt>
lea    0xe8f(%rip),%rdi
lea    0xea1(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1195 <cache_update_stamp+0x55>
mov    -0x8(%rbp),%rdi
call   1040 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cache_update_stamp>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1050 <is_file@plt>
test   %rax,%rax
je     115e <cache_update_stamp+0x1e>
lea    0xea7(%rip),%rdi
call   1030 <unlink@plt>
lea    0xe9b(%rip),%rdi
lea    0xead(%rip),%rsi
call   1060 <fopen@plt>
test   %rax,%rax
je     117f <cache_update_stamp+0x3f>
mov    %rax,%rdi
pop    %rax
jmp    1040 <fclose@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [25 x i8] c"/usr/ports/.ilenia.stamp\00"
@.str.1 = [2 x i8] c"w\00"
define void @cache_update_stamp() {
%1 = alloca i32*
%2 = call i64 @is_file(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @unlink(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
%7 = call i32* @fopen(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %7, i32** %1
%8 = load i32*, i32** %1
%9 = icmp ne i32* %8, null
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = load i32*, i32** %1
%12 = call i32 @fclose(i32* %11)
br label %13
13: ; preds = %10, %6
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"/usr/ports/.ilenia.stamp\00"
@.str.1 = [2 x i8] c"w\00"
define void @cache_update_stamp() {
%1 = tail call i64 @is_file(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @unlink(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
%6 = tail call i32* @fopen(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp eq i32* %6, null
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 @fclose(i32* %6)
br label %10
10: ; preds = %8, %5
ret void
}