#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 *);
int main() {
  if (sem_unlink("/empty") < 0) {
    perror("Blad przy zamykaniu semafora empty");
  }
  if (sem_unlink("/full") < 0) {
    perror("Blad przy zamykaniu semafora full");
  }
  if (sem_unlink("/take") < 0) {
    perror("Blad przy zamykaniu semafora take");
  }
  if (sem_unlink("/put") < 0) {
    perror("Blad przy zamykaniu semafora put");
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1050 <sem_unlink@plt>
cmp    $0x0,%rax
jge    1161 <main+0x31>
lea    0xeab(%rip),%rdi
call   1030 <perror@plt>
lea    0xec2(%rip),%rdi
call   1050 <sem_unlink@plt>
cmp    $0x0,%rax
jge    1183 <main+0x53>
lea    0xeb2(%rip),%rdi
call   1030 <perror@plt>
lea    0xec8(%rip),%rdi
call   1050 <sem_unlink@plt>
cmp    $0x0,%rax
jge    11a5 <main+0x75>
lea    0xeb8(%rip),%rdi
call   1030 <perror@plt>
lea    0xece(%rip),%rdi
call   1050 <sem_unlink@plt>
cmp    $0x0,%rax
jge    11c7 <main+0x97>
lea    0xebd(%rip),%rdi
call   1030 <perror@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1050 <sem_unlink@plt>
test   %rax,%rax
jns    114e <main+0x1e>
lea    0xebe(%rip),%rdi
call   1030 <perror@plt>
lea    0xed5(%rip),%rdi
call   1050 <sem_unlink@plt>
test   %rax,%rax
jns    116b <main+0x3b>
lea    0xeca(%rip),%rdi
call   1030 <perror@plt>
lea    0xee0(%rip),%rdi
call   1050 <sem_unlink@plt>
test   %rax,%rax
jns    1188 <main+0x58>
lea    0xed5(%rip),%rdi
call   1030 <perror@plt>
lea    0xeeb(%rip),%rdi
call   1050 <sem_unlink@plt>
test   %rax,%rax
jns    11a5 <main+0x75>
lea    0xedf(%rip),%rdi
call   1030 <perror@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"/empty\00"
@.str.1 = [35 x i8] c"Blad przy zamykaniu semafora empty\00"
@.str.2 = [6 x i8] c"/full\00"
@.str.3 = [34 x i8] c"Blad przy zamykaniu semafora full\00"
@.str.4 = [6 x i8] c"/take\00"
@.str.5 = [34 x i8] c"Blad przy zamykaniu semafora take\00"
@.str.6 = [5 x i8] c"/put\00"
@.str.7 = [33 x i8] c"Blad przy zamykaniu semafora put\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @sem_unlink(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @perror(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
%7 = call i64 @sem_unlink(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = call i32 @perror(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0))
br label %11
11: ; preds = %9, %6
%12 = call i64 @sem_unlink(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%13 = icmp slt i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 @perror(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0))
br label %16
16: ; preds = %14, %11
%17 = call i64 @sem_unlink(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%18 = icmp slt i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = call i32 @perror(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0))
br label %21
21: ; preds = %19, %16
%22 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [7 x i8] c"/empty\00"
@.str.1 = [35 x i8] c"Blad przy zamykaniu semafora empty\00"
@.str.2 = [6 x i8] c"/full\00"
@.str.3 = [34 x i8] c"Blad przy zamykaniu semafora full\00"
@.str.4 = [6 x i8] c"/take\00"
@.str.5 = [34 x i8] c"Blad przy zamykaniu semafora take\00"
@.str.6 = [5 x i8] c"/put\00"
@.str.7 = [33 x i8] c"Blad przy zamykaniu semafora put\00"
define i32 @main() {
%1 = tail call i64 @sem_unlink(i8* getelementptr inbounds ([7 x i8], [7 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 ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
%6 = tail call i64 @sem_unlink(i8* getelementptr inbounds ([6 x i8], [6 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 ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0))
br label %10
10: ; preds = %8, %5
%11 = tail call i64 @sem_unlink(i8* getelementptr inbounds ([6 x i8], [6 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 ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0))
br label %15
15: ; preds = %13, %10
%16 = tail call i64 @sem_unlink(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%17 = icmp slt i64 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = tail call i32 @perror(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0))
br label %20
20: ; preds = %18, %15
%21 = tail call i32 @exit(i32 0)
unreachable
}