#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*/ MAP_SHARED;
int O_CREAT;
int O_RDWR;
int PROT_READ;
int PROT_WRITE;
int /*<<< orphan*/ S_IRWXU;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ fork();
int *mmap(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/, int,
          int /*<<< orphan*/);
int open(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
scalar_t__ sem_init(int /*<<< orphan*/ *, int, int);
int /*<<< orphan*/ sem_post(int /*<<< orphan*/ *);
int /*<<< orphan*/ sem_wait(int /*<<< orphan*/ *);
int /*<<< orphan*/ write(int, int *, int);
int main(int argc, char *argv[]) {
  int fd, i, count = 0, nloop = 10, zero = 0, *ptr;
  sem_t mutex;
  fd = open("log.txt", O_RDWR | O_CREAT, S_IRWXU);
  write(fd, &zero, sizeof(int));
  ptr = mmap(NULL, sizeof(int), PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
  close(fd);
  if (sem_init(&mutex, 1, 1) < 0)
    exit(0);
  if (fork() == 0) {
    for (i = 0; i < nloop; i++) {
      sem_wait(&mutex);
      printf("child:%d\n", (*ptr)++);
      sem_post(&mutex);
    }
    exit(0);
  }
  for (i = 0; i < nloop; i++) {
    sem_wait(&mutex);
    printf("Parent:%d\n", (*ptr)++);
    sem_post(&mutex);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0xa,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    0x2df6(%rip),%rax
mov    (%rax),%esi
mov    0x2e1d(%rip),%rax
or     (%rax),%esi
mov    0x2dec(%rip),%rax
mov    (%rax),%edx
lea    0xe13(%rip),%rdi
call   10a0 <open@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x24(%rbp),%rsi
mov    $0x4,%edx
call   1040 <write@plt>
mov    0x2de3(%rip),%rax
mov    (%rax),%edx
mov    0x2da2(%rip),%rax
or     (%rax),%edx
mov    0x2dc1(%rip),%rax
mov    (%rax),%ecx
mov    -0x14(%rbp),%r8d
xor    %eax,%eax
mov    %eax,%edi
mov    $0x4,%esi
xor    %r9d,%r9d
call   1050 <mmap@plt>
mov    %rax,-0x30(%rbp)
mov    -0x14(%rbp),%edi
call   1070 <close@plt>
lea    -0x34(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1090 <sem_init@plt>
cmp    $0x0,%rax
jge    1263 <main+0xc3>
xor    %edi,%edi
call   10b0 <exit@plt>
mov    $0x0,%al
call   10c0 <fork@plt>
cmp    $0x0,%rax
jne    12c7 <main+0x127>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    12c0 <main+0x120>
lea    -0x34(%rbp),%rdi
call   1030 <sem_wait@plt>
mov    -0x30(%rbp),%rax
mov    (%rax),%esi
mov    %esi,%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
lea    0xd64(%rip),%rdi
call   1060 <printf@plt>
lea    -0x34(%rbp),%rdi
call   1080 <sem_post@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    127b <main+0xdb>
xor    %edi,%edi
call   10b0 <exit@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1313 <main+0x173>
lea    -0x34(%rbp),%rdi
call   1030 <sem_wait@plt>
mov    -0x30(%rbp),%rax
mov    (%rax),%esi
mov    %esi,%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
lea    0xd1b(%rip),%rdi
call   1060 <printf@plt>
lea    -0x34(%rbp),%rdi
call   1080 <sem_post@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    12ce <main+0x12e>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
movl   $0x0,0x4(%rsp)
mov    0x2e12(%rip),%rax
mov    0x2e3b(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2e08(%rip),%rax
mov    (%rax),%edx
lea    0xe2f(%rip),%rdi
call   10a0 <open@plt>
mov    %eax,%ebp
lea    0x4(%rsp),%rsi
mov    %eax,%edi
mov    $0x4,%edx
call   1040 <write@plt>
mov    0x2e00(%rip),%rax
mov    0x2dc1(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
mov    0x2dde(%rip),%rax
mov    (%rax),%ecx
xor    %edi,%edi
mov    $0x4,%esi
mov    %ebp,%r8d
xor    %r9d,%r9d
call   1050 <mmap@plt>
mov    %rax,%rbx
mov    %ebp,%edi
call   1070 <close@plt>
mov    %rsp,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1090 <sem_init@plt>
test   %rax,%rax
js     14cc <main+0x32c>
xor    %eax,%eax
call   10c0 <fork@plt>
mov    %rax,%rbp
mov    %rsp,%rdi
call   1030 <sem_wait@plt>
mov    (%rbx),%esi
lea    0x1(%rsi),%eax
mov    %eax,(%rbx)
test   %rbp,%rbp
je     139b <main+0x1fb>
lea    0xdae(%rip),%r14
mov    %r14,%rdi
call   1060 <printf@plt>
mov    %rsp,%r15
mov    %r15,%rdi
call   1080 <sem_post@plt>
mov    %r15,%rdi
call   1030 <sem_wait@plt>
mov    (%rbx),%esi
lea    0x1(%rsi),%eax
mov    %eax,(%rbx)
mov    %r14,%rdi
call   1060 <printf@plt>
mov    %r15,%rdi
call   1080 <sem_post@plt>
mov    %r15,%rdi
call   1030 <sem_wait@plt>
mov    (%rbx),%esi
lea    0x1(%rsi),%eax
mov    %eax,(%rbx)
mov    %r14,%rdi
call   1060 <printf@plt>
mov    %r15,%rdi
call   1080 <sem_post@plt>
mov    %r15,%rdi
call   1030 <sem_wait@plt>
mov    (%rbx),%esi
lea    0x1(%rsi),%eax
mov    %eax,(%rbx)
mov    %r14,%rdi
call   1060 <printf@plt>
mov    %r15,%rdi
call   1080 <sem_post@plt>
mov    %r15,%rdi
call   1030 <sem_wait@plt>
mov    (%rbx),%esi
lea    0x1(%rsi),%eax
mov    %eax,(%rbx)
mov    %r14,%rdi
call   1060 <printf@plt>
mov    %r15,%rdi
call   1080 <sem_post@plt>
mov    %r15,%rdi
call   1030 <sem_wait@plt>
mov    (%rbx),%esi
lea    0x1(%rsi),%eax
mov    %eax,(%rbx)
mov    %r14,%rdi
call   1060 <printf@plt>
mov    %r15,%rdi
call   1080 <sem_post@plt>
mov    %r15,%rdi
call   1030 <sem_wait@plt>
mov    (%rbx),%esi
lea    0x1(%rsi),%eax
mov    %eax,(%rbx)
mov    %r14,%rdi
call   1060 <printf@plt>
mov    %r15,%rdi
call   1080 <sem_post@plt>
mov    %r15,%rdi
call   1030 <sem_wait@plt>
mov    (%rbx),%esi
lea    0x1(%rsi),%eax
mov    %eax,(%rbx)
mov    %r14,%rdi
call   1060 <printf@plt>
mov    %r15,%rdi
call   1080 <sem_post@plt>
mov    %r15,%rdi
call   1030 <sem_wait@plt>
mov    (%rbx),%esi
lea    0x1(%rsi),%eax
mov    %eax,(%rbx)
mov    %r14,%rdi
call   1060 <printf@plt>
mov    %r15,%rdi
call   1080 <sem_post@plt>
mov    %r15,%rdi
call   1030 <sem_wait@plt>
mov    (%rbx),%esi
lea    0x1(%rsi),%eax
mov    %eax,(%rbx)
mov    %r14,%rdi
call   1060 <printf@plt>
mov    %r15,%rdi
call   1080 <sem_post@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc66(%rip),%r14
mov    %r14,%rdi
call   1060 <printf@plt>
mov    %rsp,%r15
mov    %r15,%rdi
call   1080 <sem_post@plt>
mov    %r15,%rdi
call   1030 <sem_wait@plt>
mov    (%rbx),%esi
lea    0x1(%rsi),%eax
mov    %eax,(%rbx)
mov    %r14,%rdi
call   1060 <printf@plt>
mov    %r15,%rdi
call   1080 <sem_post@plt>
mov    %r15,%rdi
call   1030 <sem_wait@plt>
mov    (%rbx),%esi
lea    0x1(%rsi),%eax
mov    %eax,(%rbx)
mov    %r14,%rdi
call   1060 <printf@plt>
mov    %r15,%rdi
call   1080 <sem_post@plt>
mov    %r15,%rdi
call   1030 <sem_wait@plt>
mov    (%rbx),%esi
lea    0x1(%rsi),%eax
mov    %eax,(%rbx)
mov    %r14,%rdi
call   1060 <printf@plt>
mov    %r15,%rdi
call   1080 <sem_post@plt>
mov    %r15,%rdi
call   1030 <sem_wait@plt>
mov    (%rbx),%esi
lea    0x1(%rsi),%eax
mov    %eax,(%rbx)
mov    %r14,%rdi
call   1060 <printf@plt>
mov    %r15,%rdi
call   1080 <sem_post@plt>
mov    %r15,%rdi
call   1030 <sem_wait@plt>
mov    (%rbx),%esi
lea    0x1(%rsi),%eax
mov    %eax,(%rbx)
mov    %r14,%rdi
call   1060 <printf@plt>
mov    %r15,%rdi
call   1080 <sem_post@plt>
mov    %r15,%rdi
call   1030 <sem_wait@plt>
mov    (%rbx),%esi
lea    0x1(%rsi),%eax
mov    %eax,(%rbx)
mov    %r14,%rdi
call   1060 <printf@plt>
mov    %r15,%rdi
call   1080 <sem_post@plt>
mov    %r15,%rdi
call   1030 <sem_wait@plt>
mov    (%rbx),%esi
lea    0x1(%rsi),%eax
mov    %eax,(%rbx)
mov    %r14,%rdi
call   1060 <printf@plt>
mov    %r15,%rdi
call   1080 <sem_post@plt>
mov    %r15,%rdi
call   1030 <sem_wait@plt>
mov    (%rbx),%esi
lea    0x1(%rsi),%eax
mov    %eax,(%rbx)
mov    %r14,%rdi
call   1060 <printf@plt>
mov    %r15,%rdi
call   1080 <sem_post@plt>
mov    %r15,%rdi
call   1030 <sem_wait@plt>
mov    (%rbx),%esi
lea    0x1(%rsi),%eax
mov    %eax,(%rbx)
mov    %r14,%rdi
call   1060 <printf@plt>
mov    %r15,%rdi
call   1080 <sem_post@plt>
xor    %edi,%edi
call   10b0 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"log.txt\00"
@O_RDWR = global i32 0
@O_CREAT = global i32 0
@S_IRWXU = global i32 0
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_SHARED = global i32 0
@.str.1 = [10 x i8] c"child:%d\0A\00"
@.str.2 = [11 x i8] c"Parent:%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32*
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %8
store i32 10, i32* %9
store i32 0, i32* %10
%13 = load i32, i32* @O_RDWR
%14 = load i32, i32* @O_CREAT
%15 = or i32 %13, %14
%16 = load i32, i32* @S_IRWXU
%17 = call i32 @open(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %15, i32 %16)
store i32 %17, i32* %6
%18 = load i32, i32* %6
%19 = call i32 @write(i32 %18, i32* %10, i32 4)
%20 = load i32, i32* @PROT_READ
%21 = load i32, i32* @PROT_WRITE
%22 = or i32 %20, %21
%23 = load i32, i32* @MAP_SHARED
%24 = load i32, i32* %6
%25 = call i32* @mmap(i32* null, i32 4, i32 %22, i32 %23, i32 %24, i32 0)
store i32* %25, i32** %11
%26 = load i32, i32* %6
%27 = call i32 @close(i32 %26)
%28 = call i64 @sem_init(i32* %12, i32 1, i32 1)
%29 = icmp slt i64 %28, 0
br i1 %29, label %30, label %32
30: ; preds = %2
%31 = call i32 @exit(i32 0)
unreachable
32: ; preds = %2
%33 = call i64 (...) @fork()
%34 = icmp eq i64 %33, 0
br i1 %34, label %35, label %52
35: ; preds = %32
store i32 0, i32* %7
br label %36
36: ; preds = %47, %35
%37 = load i32, i32* %7
%38 = load i32, i32* %9
%39 = icmp slt i32 %37, %38
br i1 %39, label %40, label %50
40: ; preds = %36
%41 = call i32 @sem_wait(i32* %12)
%42 = load i32*, i32** %11
%43 = load i32, i32* %42
%44 = add nsw i32 %43, 1
store i32 %44, i32* %42
%45 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %43)
%46 = call i32 @sem_post(i32* %12)
br label %47
47: ; preds = %40
%48 = load i32, i32* %7
%49 = add nsw i32 %48, 1
store i32 %49, i32* %7
br label %36
50: ; preds = %36
%51 = call i32 @exit(i32 0)
unreachable
52: ; preds = %32
store i32 0, i32* %7
br label %53
53: ; preds = %64, %52
%54 = load i32, i32* %7
%55 = load i32, i32* %9
%56 = icmp slt i32 %54, %55
br i1 %56, label %57, label %67
57: ; preds = %53
%58 = call i32 @sem_wait(i32* %12)
%59 = load i32*, i32** %11
%60 = load i32, i32* %59
%61 = add nsw i32 %60, 1
store i32 %61, i32* %59
%62 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %60)
%63 = call i32 @sem_post(i32* %12)
br label %64
64: ; preds = %57
%65 = load i32, i32* %7
%66 = add nsw i32 %65, 1
store i32 %66, i32* %7
br label %53
67: ; preds = %53
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"log.txt\00"
@O_RDWR = global i32 0
@O_CREAT = global i32 0
@S_IRWXU = global i32 0
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_SHARED = global i32 0
@.str.1 = [10 x i8] c"child:%d\0A\00"
@.str.2 = [11 x i8] c"Parent:%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%6 = bitcast i32* %4 to i8*
%7 = load i32, i32* @O_RDWR
%8 = load i32, i32* @O_CREAT
%9 = or i32 %8, %7
%10 = load i32, i32* @S_IRWXU
%11 = tail call i32 @open(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10)
%12 = call i32 @write(i32 %11, i32* %3, i32 4)
%13 = load i32, i32* @PROT_READ
%14 = load i32, i32* @PROT_WRITE
%15 = or i32 %14, %13
%16 = load i32, i32* @MAP_SHARED
%17 = tail call i32* @mmap(i32* null, i32 4, i32 %15, i32 %16, i32 %11, i32 0)
%18 = tail call i32 @close(i32 %11)
%19 = call i64 @sem_init(i32* %4, i32 1, i32 1)
%20 = icmp slt i64 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %2
%22 = call i32 @exit(i32 0)
unreachable
23: ; preds = %2
%24 = call i64 (...) @fork()
%25 = icmp eq i64 %24, 0
%26 = call i32 @sem_wait(i32* %4)
%27 = load i32, i32* %17
%28 = add nsw i32 %27, 1
store i32 %28, i32* %17
br i1 %25, label %77, label %29
29: ; preds = %23
%30 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %27)
%31 = call i32 @sem_post(i32* %4)
%32 = call i32 @sem_wait(i32* %4)
%33 = load i32, i32* %17
%34 = add nsw i32 %33, 1
store i32 %34, i32* %17
%35 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %33)
%36 = call i32 @sem_post(i32* %4)
%37 = call i32 @sem_wait(i32* %4)
%38 = load i32, i32* %17
%39 = add nsw i32 %38, 1
store i32 %39, i32* %17
%40 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %38)
%41 = call i32 @sem_post(i32* %4)
%42 = call i32 @sem_wait(i32* %4)
%43 = load i32, i32* %17
%44 = add nsw i32 %43, 1
store i32 %44, i32* %17
%45 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %43)
%46 = call i32 @sem_post(i32* %4)
%47 = call i32 @sem_wait(i32* %4)
%48 = load i32, i32* %17
%49 = add nsw i32 %48, 1
store i32 %49, i32* %17
%50 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %48)
%51 = call i32 @sem_post(i32* %4)
%52 = call i32 @sem_wait(i32* %4)
%53 = load i32, i32* %17
%54 = add nsw i32 %53, 1
store i32 %54, i32* %17
%55 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %53)
%56 = call i32 @sem_post(i32* %4)
%57 = call i32 @sem_wait(i32* %4)
%58 = load i32, i32* %17
%59 = add nsw i32 %58, 1
store i32 %59, i32* %17
%60 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %58)
%61 = call i32 @sem_post(i32* %4)
%62 = call i32 @sem_wait(i32* %4)
%63 = load i32, i32* %17
%64 = add nsw i32 %63, 1
store i32 %64, i32* %17
%65 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %63)
%66 = call i32 @sem_post(i32* %4)
%67 = call i32 @sem_wait(i32* %4)
%68 = load i32, i32* %17
%69 = add nsw i32 %68, 1
store i32 %69, i32* %17
%70 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %68)
%71 = call i32 @sem_post(i32* %4)
%72 = call i32 @sem_wait(i32* %4)
%73 = load i32, i32* %17
%74 = add nsw i32 %73, 1
store i32 %74, i32* %17
%75 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %73)
%76 = call i32 @sem_post(i32* %4)
ret i32 0
77: ; preds = %23
%78 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %27)
%79 = call i32 @sem_post(i32* %4)
%80 = call i32 @sem_wait(i32* %4)
%81 = load i32, i32* %17
%82 = add nsw i32 %81, 1
store i32 %82, i32* %17
%83 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %81)
%84 = call i32 @sem_post(i32* %4)
%85 = call i32 @sem_wait(i32* %4)
%86 = load i32, i32* %17
%87 = add nsw i32 %86, 1
store i32 %87, i32* %17
%88 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %86)
%89 = call i32 @sem_post(i32* %4)
%90 = call i32 @sem_wait(i32* %4)
%91 = load i32, i32* %17
%92 = add nsw i32 %91, 1
store i32 %92, i32* %17
%93 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %91)
%94 = call i32 @sem_post(i32* %4)
%95 = call i32 @sem_wait(i32* %4)
%96 = load i32, i32* %17
%97 = add nsw i32 %96, 1
store i32 %97, i32* %17
%98 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %96)
%99 = call i32 @sem_post(i32* %4)
%100 = call i32 @sem_wait(i32* %4)
%101 = load i32, i32* %17
%102 = add nsw i32 %101, 1
store i32 %102, i32* %17
%103 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %101)
%104 = call i32 @sem_post(i32* %4)
%105 = call i32 @sem_wait(i32* %4)
%106 = load i32, i32* %17
%107 = add nsw i32 %106, 1
store i32 %107, i32* %17
%108 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %106)
%109 = call i32 @sem_post(i32* %4)
%110 = call i32 @sem_wait(i32* %4)
%111 = load i32, i32* %17
%112 = add nsw i32 %111, 1
store i32 %112, i32* %17
%113 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %111)
%114 = call i32 @sem_post(i32* %4)
%115 = call i32 @sem_wait(i32* %4)
%116 = load i32, i32* %17
%117 = add nsw i32 %116, 1
store i32 %117, i32* %17
%118 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %116)
%119 = call i32 @sem_post(i32* %4)
%120 = call i32 @sem_wait(i32* %4)
%121 = load i32, i32* %17
%122 = add nsw i32 %121, 1
store i32 %122, i32* %17
%123 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %121)
%124 = call i32 @sem_post(i32* %4)
%125 = call i32 @exit(i32 0)
unreachable
}