#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__ unlink(char *);
int /*<<< orphan*/ write_log(int, char *, char *, char *);
int close_pid() {
  if (unlink("/var/run/hwmultd/hwmultd.pid")) {
    write_log(1,
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/blueness/hwmultd/refs/heads/master/"
              "src/pidfile.c",
              "unlink pid file failed: %s", "/var/run/hwmultd/hwmultd.pid");
    return 0;
  } else
    write_log(3,
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/blueness/hwmultd/refs/heads/master/"
              "src/pidfile.c",
              "unlink pid file: %s", "/var/run/hwmultd/hwmultd.pid");
  return 1;
}


x86 assembly (clang, -O0):
<close_pid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <unlink@plt>
cmp    $0x0,%rax
je     1169 <close_pid+0x49>
mov    $0x1,%edi
lea    0xed3(%rip),%rsi
lea    0xf57(%rip),%rdx
lea    0xea8(%rip),%rcx
call   1040 <write_log@plt>
movl   $0x0,-0x4(%rbp)
jmp    118f <close_pid+0x6f>
mov    $0x3,%edi
lea    0xea8(%rip),%rsi
lea    0xf47(%rip),%rdx
lea    0xe7d(%rip),%rcx
call   1040 <write_log@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_pid>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <unlink@plt>
lea    0xee9(%rip),%rsi
test   %rax,%rax
je     1155 <close_pid+0x35>
lea    0xf68(%rip),%rdx
lea    0xeb9(%rip),%rcx
mov    $0x1,%edi
call   1040 <write_log@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xf67(%rip),%rdx
lea    0xe9d(%rip),%rcx
mov    $0x3,%edi
call   1040 <write_log@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"/var/run/hwmultd/hwmultd.pid\00"
@.str.1 = [139 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/blueness/hwmultd/refs/heads/master/src/pidfile.c\00"
@.str.2 = [27 x i8] c"unlink pid file failed: %s\00"
@.str.3 = [20 x i8] c"unlink pid file: %s\00"
define i32 @close_pid() {
%1 = alloca i32
%2 = call i64 @unlink(i8* getelementptr inbounds ([29 x i8], [29 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 @write_log(i32 1, i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %1
br label %9
6: ; preds = %0
%7 = call i32 @write_log(i32 3, i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6
store i32 1, i32* %1
br label %9
9: ; preds = %8, %4
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@.str = [29 x i8] c"/var/run/hwmultd/hwmultd.pid\00"
@.str.1 = [139 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/blueness/hwmultd/refs/heads/master/src/pidfile.c\00"
@.str.2 = [27 x i8] c"unlink pid file failed: %s\00"
@.str.3 = [20 x i8] c"unlink pid file: %s\00"
define i32 @close_pid() {
%1 = tail call i64 @unlink(i8* getelementptr inbounds ([29 x i8], [29 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 @write_log(i32 1, i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %0
%6 = tail call i32 @write_log(i32 3, i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
%8 = phi i32 [ 0, %3 ], [ 1, %5 ]
ret i32 %8
}