#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*/ sem_t;

/* Variables and functions */
int /*<<< orphan*/ sem_close(int /*<<< orphan*/ *);
int /*<<< orphan*/ sem_unlink(char *);
void cleanSemaphores(sem_t *xvalek02_cekarna, sem_t *xvalek02_vypis,
                     sem_t *xvalek02_holic_spi, sem_t *xvalek02_holicova_zidle,
                     sem_t *xvalek02_holic_dostrihal,
                     sem_t *xvalek02_ready_vypisy) {
  sem_close(xvalek02_cekarna);
  sem_unlink("/xvalek02_cekarna");
  sem_close(xvalek02_vypis);
  sem_unlink("/xvalek02_vypis");
  sem_close(xvalek02_holic_spi);
  sem_unlink("/xvalek02_holic_spi");
  sem_close(xvalek02_holicova_zidle);
  sem_unlink("/xvalek02_holicova_zidle");
  sem_close(xvalek02_holic_dostrihal);
  sem_unlink("/xvalek02_holic_dostrihal");
  sem_close(xvalek02_ready_vypisy);
  sem_unlink("/xvalek02_ready_vypisy");
}


x86 assembly (clang, -O0):
<cleanSemaphores>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <sem_close@plt>
lea    0xeb0(%rip),%rdi
call   1040 <sem_unlink@plt>
mov    -0x10(%rbp),%rdi
call   1030 <sem_close@plt>
lea    0xead(%rip),%rdi
call   1040 <sem_unlink@plt>
mov    -0x18(%rbp),%rdi
call   1030 <sem_close@plt>
lea    0xea8(%rip),%rdi
call   1040 <sem_unlink@plt>
mov    -0x20(%rbp),%rdi
call   1030 <sem_close@plt>
lea    0xea7(%rip),%rdi
call   1040 <sem_unlink@plt>
mov    -0x28(%rbp),%rdi
call   1030 <sem_close@plt>
lea    0xeab(%rip),%rdi
call   1040 <sem_unlink@plt>
mov    -0x30(%rbp),%rdi
call   1030 <sem_close@plt>
lea    0xeb0(%rip),%rdi
call   1040 <sem_unlink@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanSemaphores>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %r9,%r14
mov    %r8,%r15
mov    %rcx,%r12
mov    %rdx,%r13
mov    %rsi,%rbx
call   1030 <sem_close@plt>
lea    0xebc(%rip),%rdi
call   1040 <sem_unlink@plt>
mov    %rbx,%rdi
call   1030 <sem_close@plt>
lea    0xeba(%rip),%rdi
call   1040 <sem_unlink@plt>
mov    %r13,%rdi
call   1030 <sem_close@plt>
lea    0xeb6(%rip),%rdi
call   1040 <sem_unlink@plt>
mov    %r12,%rdi
call   1030 <sem_close@plt>
lea    0xeb6(%rip),%rdi
call   1040 <sem_unlink@plt>
mov    %r15,%rdi
call   1030 <sem_close@plt>
lea    0xebb(%rip),%rdi
call   1040 <sem_unlink@plt>
mov    %r14,%rdi
call   1030 <sem_close@plt>
lea    0xec1(%rip),%rdi
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1040 <sem_unlink@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"/xvalek02_cekarna\00"
@.str.1 = [16 x i8] c"/xvalek02_vypis\00"
@.str.2 = [20 x i8] c"/xvalek02_holic_spi\00"
@.str.3 = [25 x i8] c"/xvalek02_holicova_zidle\00"
@.str.4 = [26 x i8] c"/xvalek02_holic_dostrihal\00"
@.str.5 = [23 x i8] c"/xvalek02_ready_vypisy\00"
define void @cleanSemaphores(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5) {
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
store i32* %0, i32** %7
store i32* %1, i32** %8
store i32* %2, i32** %9
store i32* %3, i32** %10
store i32* %4, i32** %11
store i32* %5, i32** %12
%13 = load i32*, i32** %7
%14 = call i32 @sem_close(i32* %13)
%15 = call i32 @sem_unlink(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%16 = load i32*, i32** %8
%17 = call i32 @sem_close(i32* %16)
%18 = call i32 @sem_unlink(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%19 = load i32*, i32** %9
%20 = call i32 @sem_close(i32* %19)
%21 = call i32 @sem_unlink(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%22 = load i32*, i32** %10
%23 = call i32 @sem_close(i32* %22)
%24 = call i32 @sem_unlink(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%25 = load i32*, i32** %11
%26 = call i32 @sem_close(i32* %25)
%27 = call i32 @sem_unlink(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0))
%28 = load i32*, i32** %12
%29 = call i32 @sem_close(i32* %28)
%30 = call i32 @sem_unlink(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"/xvalek02_cekarna\00"
@.str.1 = [16 x i8] c"/xvalek02_vypis\00"
@.str.2 = [20 x i8] c"/xvalek02_holic_spi\00"
@.str.3 = [25 x i8] c"/xvalek02_holicova_zidle\00"
@.str.4 = [26 x i8] c"/xvalek02_holic_dostrihal\00"
@.str.5 = [23 x i8] c"/xvalek02_ready_vypisy\00"
define void @cleanSemaphores(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5) {
%7 = tail call i32 @sem_close(i32* %0)
%8 = tail call i32 @sem_unlink(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @sem_close(i32* %1)
%10 = tail call i32 @sem_unlink(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%11 = tail call i32 @sem_close(i32* %2)
%12 = tail call i32 @sem_unlink(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%13 = tail call i32 @sem_close(i32* %3)
%14 = tail call i32 @sem_unlink(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%15 = tail call i32 @sem_close(i32* %4)
%16 = tail call i32 @sem_unlink(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0))
%17 = tail call i32 @sem_close(i32* %5)
%18 = tail call i32 @sem_unlink(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0))
ret void
}