#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*/ close(int);
int /*<<< orphan*/ sem_unlink(char *);
int /*<<< orphan*/ shm_unlink(char *);
void cleanShared(int *shmid) {
  sem_unlink("/xcoufa09-semMolo");
  sem_unlink("/xcoufa09-semShm");
  sem_unlink("/xcoufa09-semBoardSerf");
  sem_unlink("/xcoufa09-semBoardHacker");
  sem_unlink("/xcoufa09-semRole");
  sem_unlink("/xcoufa09-semRow");
  sem_unlink("/xcoufa09-semLand");
  sem_unlink("/xcoufa09-semFinish");
  shm_unlink("/xcoufa09-shm");
  close(*shmid);
}


x86 assembly (clang, -O0):
<cleanShared>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
call   1050 <sem_unlink@plt>
lea    0xec3(%rip),%rdi
call   1050 <sem_unlink@plt>
lea    0xec8(%rip),%rdi
call   1050 <sem_unlink@plt>
lea    0xed3(%rip),%rdi
call   1050 <sem_unlink@plt>
lea    0xee0(%rip),%rdi
call   1050 <sem_unlink@plt>
lea    0xee6(%rip),%rdi
call   1050 <sem_unlink@plt>
lea    0xeeb(%rip),%rdi
call   1050 <sem_unlink@plt>
lea    0xef1(%rip),%rdi
call   1050 <sem_unlink@plt>
lea    0xef9(%rip),%rdi
call   1040 <shm_unlink@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanShared>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
call   1050 <sem_unlink@plt>
lea    0xecb(%rip),%rdi
call   1050 <sem_unlink@plt>
lea    0xed0(%rip),%rdi
call   1050 <sem_unlink@plt>
lea    0xedb(%rip),%rdi
call   1050 <sem_unlink@plt>
lea    0xee8(%rip),%rdi
call   1050 <sem_unlink@plt>
lea    0xeee(%rip),%rdi
call   1050 <sem_unlink@plt>
lea    0xef3(%rip),%rdi
call   1050 <sem_unlink@plt>
lea    0xef9(%rip),%rdi
call   1050 <sem_unlink@plt>
lea    0xf01(%rip),%rdi
call   1040 <shm_unlink@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1030 <close@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"/xcoufa09-semMolo\00"
@.str.1 = [17 x i8] c"/xcoufa09-semShm\00"
@.str.2 = [23 x i8] c"/xcoufa09-semBoardSerf\00"
@.str.3 = [25 x i8] c"/xcoufa09-semBoardHacker\00"
@.str.4 = [18 x i8] c"/xcoufa09-semRole\00"
@.str.5 = [17 x i8] c"/xcoufa09-semRow\00"
@.str.6 = [18 x i8] c"/xcoufa09-semLand\00"
@.str.7 = [20 x i8] c"/xcoufa09-semFinish\00"
@.str.8 = [14 x i8] c"/xcoufa09-shm\00"
define void @cleanShared(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @sem_unlink(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @sem_unlink(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @sem_unlink(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @sem_unlink(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 @sem_unlink(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%8 = call i32 @sem_unlink(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0))
%9 = call i32 @sem_unlink(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0))
%10 = call i32 @sem_unlink(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0))
%11 = call i32 @shm_unlink(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0))
%12 = load i32*, i32** %2
%13 = load i32, i32* %12
%14 = call i32 @close(i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"/xcoufa09-semMolo\00"
@.str.1 = [17 x i8] c"/xcoufa09-semShm\00"
@.str.2 = [23 x i8] c"/xcoufa09-semBoardSerf\00"
@.str.3 = [25 x i8] c"/xcoufa09-semBoardHacker\00"
@.str.4 = [18 x i8] c"/xcoufa09-semRole\00"
@.str.5 = [17 x i8] c"/xcoufa09-semRow\00"
@.str.6 = [18 x i8] c"/xcoufa09-semLand\00"
@.str.7 = [20 x i8] c"/xcoufa09-semFinish\00"
@.str.8 = [14 x i8] c"/xcoufa09-shm\00"
define void @cleanShared(i32* nocapture %0) {
%2 = tail call i32 @sem_unlink(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @sem_unlink(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @sem_unlink(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @sem_unlink(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%6 = tail call i32 @sem_unlink(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%7 = tail call i32 @sem_unlink(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0))
%8 = tail call i32 @sem_unlink(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0))
%9 = tail call i32 @sem_unlink(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0))
%10 = tail call i32 @shm_unlink(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0))
%11 = load i32, i32* %0
%12 = tail call i32 @close(i32 %11)
ret void
}