#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*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
scalar_t__ sem_unlink(char *);
void clean() {
  if (sem_unlink("/readers") < 0) {
    perror("Mozliwy blad przy zamykaniu semafora pisarzy");
  }
  if (sem_unlink("/writers") < 0) {
    perror("Mozliwy blad przy zamykaniu semafora czytelnikow");
  }
  if (sem_unlink("/monitor") < 0) {
    perror("Mozliwy blad przy zamykaniu semafora monitor");
  }
  exit(0);
}


x86 assembly (clang, -O0):
<clean>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1050 <sem_unlink@plt>
cmp    $0x0,%rax
jge    1156 <clean+0x26>
lea    0xeb8(%rip),%rdi
call   1030 <perror@plt>
lea    0xed9(%rip),%rdi
call   1050 <sem_unlink@plt>
cmp    $0x0,%rax
jge    1178 <clean+0x48>
lea    0xecc(%rip),%rdi
call   1030 <perror@plt>
lea    0xef1(%rip),%rdi
call   1050 <sem_unlink@plt>
cmp    $0x0,%rax
jge    119a <clean+0x6a>
lea    0xee4(%rip),%rdi
call   1030 <perror@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<clean>:
push   %rax
lea    0xec8(%rip),%rdi
call   1050 <sem_unlink@plt>
test   %rax,%rax
jns    114e <clean+0x1e>
lea    0xec0(%rip),%rdi
call   1030 <perror@plt>
lea    0xee1(%rip),%rdi
call   1050 <sem_unlink@plt>
test   %rax,%rax
jns    116b <clean+0x3b>
lea    0xed9(%rip),%rdi
call   1030 <perror@plt>
lea    0xefe(%rip),%rdi
call   1050 <sem_unlink@plt>
test   %rax,%rax
jns    1188 <clean+0x58>
lea    0xef6(%rip),%rdi
call   1030 <perror@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"/readers\00"
@.str.1 = [45 x i8] c"Mozliwy blad przy zamykaniu semafora pisarzy\00"
@.str.2 = [9 x i8] c"/writers\00"
@.str.3 = [49 x i8] c"Mozliwy blad przy zamykaniu semafora czytelnikow\00"
@.str.4 = [9 x i8] c"/monitor\00"
@.str.5 = [45 x i8] c"Mozliwy blad przy zamykaniu semafora monitor\00"
define void @clean() {
%1 = call i64 @sem_unlink(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = icmp slt i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @perror(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
%6 = call i64 @sem_unlink(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = call i32 @perror(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.3, i64 0, i64 0))
br label %10
10: ; preds = %8, %5
%11 = call i64 @sem_unlink(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%12 = icmp slt i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = call i32 @perror(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.5, i64 0, i64 0))
br label %15
15: ; preds = %13, %10
%16 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [9 x i8] c"/readers\00"
@.str.1 = [45 x i8] c"Mozliwy blad przy zamykaniu semafora pisarzy\00"
@.str.2 = [9 x i8] c"/writers\00"
@.str.3 = [49 x i8] c"Mozliwy blad przy zamykaniu semafora czytelnikow\00"
@.str.4 = [9 x i8] c"/monitor\00"
@.str.5 = [45 x i8] c"Mozliwy blad przy zamykaniu semafora monitor\00"
define void @clean() {
%1 = tail call i64 @sem_unlink(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = icmp slt i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @perror(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
%6 = tail call i64 @sem_unlink(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 @perror(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.3, i64 0, i64 0))
br label %10
10: ; preds = %8, %5
%11 = tail call i64 @sem_unlink(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%12 = icmp slt i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = tail call i32 @perror(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.5, i64 0, i64 0))
br label %15
15: ; preds = %13, %10
%16 = tail call i32 @exit(i32 0)
unreachable
}