void test1() {
  int block1, block2, block3, block4;
  void *addr1;
  void *addr2;
  void *addr3;
  void *addr4;
  printf(0, "Executing test1\n");
  block1 = shm_create(4096);
  block2 = shm_create(4096);
  block3 = shm_create(4096);
  block4 = shm_create(4096);
  if (block1 < 0 || block2 < 0 || block3 < 0 || block4 < 0) {
    printf(1, "****Error creating shared memory blocks*****\n");
    return;
  }
  if (shm_get(block1, &addr1) < 0) {
    printf(0, "error getting block\n");
    return;
  }
  if (shm_get(block2, &addr2) < 0) {
    printf(0, "error getting block\n");
    return;
  }
  if (shm_get(block3, &addr3) < 0) {
    printf(0, "error getting block\n");
    return;
  }
  shm_close(block1);
  shm_get(block4, &addr4);
  if (addr4 >= addr2 || addr4 >= addr3) {
    printf(1, "****Error when in alloc orden*****\n");
    return;
  }
  if (!(addr4 < addr2 && addr2 < addr3)) {
    printf(1, "****Error when in alloc orden*****\n");
    return;
  }
  if ((block1 = shm_create(4096)) < 0) {
    printf(1, "****Error recreating shared memory blocks*****\n");
    return;
  }
  if (shm_get(block1, &addr1) < 0) {
    printf(0, "error getting block\n");
    return;
  }
  if (!(addr4 < addr2 && addr2 < addr3 && addr3 < addr1)) {
    printf(1, "****Error when in alloc orden*****\n");
    return;
  }
  shm_close(block2);
  shm_close(block3);
  if ((block3 = shm_create(4096)) < 0) {
    printf(1, "****Error recreating shared memory blocks*****\n");
    return;
  }
  if (shm_get(block3, &addr3) < 0) {
    printf(0, "error getting block\n");
    return;
  }
  if (!(addr4 < addr3 && addr3 < addr1)) {
    printf(1, "****Error when in alloc orden*****\n");
    return;
  }
  shm_close(block1);
  shm_close(block3);
  shm_close(block4);
  printf(0, "End Executing test1\n");
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
xor    %eax,%eax
mov    %eax,%edi
lea    0xf48(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x1000,%edi
mov    $0x0,%al
call   1030 <shm_create@plt>
mov    %eax,-0x4(%rbp)
mov    $0x1000,%edi
mov    $0x0,%al
call   1030 <shm_create@plt>
mov    %eax,-0x8(%rbp)
mov    $0x1000,%edi
mov    $0x0,%al
call   1030 <shm_create@plt>
mov    %eax,-0xc(%rbp)
mov    $0x1000,%edi
mov    $0x0,%al
call   1030 <shm_create@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     11be <test1+0x7e>
cmpl   $0x0,-0x8(%rbp)
jl     11be <test1+0x7e>
cmpl   $0x0,-0xc(%rbp)
jl     11be <test1+0x7e>
cmpl   $0x0,-0x10(%rbp)
jge    11d6 <test1+0x96>
mov    $0x1,%edi
lea    0xe36(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1456 <test1+0x316>
mov    -0x4(%rbp),%edi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1060 <shm_get@plt>
cmp    $0x0,%eax
jge    1204 <test1+0xc4>
xor    %eax,%eax
mov    %eax,%edi
lea    0xe36(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1456 <test1+0x316>
mov    -0x8(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1060 <shm_get@plt>
cmp    $0x0,%eax
jge    1232 <test1+0xf2>
xor    %eax,%eax
mov    %eax,%edi
lea    0xe08(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1456 <test1+0x316>
mov    -0xc(%rbp),%edi
lea    -0x28(%rbp),%rsi
mov    $0x0,%al
call   1060 <shm_get@plt>
cmp    $0x0,%eax
jge    1260 <test1+0x120>
xor    %eax,%eax
mov    %eax,%edi
lea    0xdda(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1456 <test1+0x316>
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1050 <shm_close@plt>
mov    -0x10(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    $0x0,%al
call   1060 <shm_get@plt>
mov    -0x30(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    1294 <test1+0x154>
mov    -0x30(%rbp),%rax
cmp    -0x28(%rbp),%rax
jb     12ac <test1+0x16c>
mov    $0x1,%edi
lea    0xda3(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1456 <test1+0x316>
mov    -0x30(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    12c8 <test1+0x188>
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jb     12e0 <test1+0x1a0>
mov    $0x1,%edi
lea    0xd6f(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1456 <test1+0x316>
mov    $0x1000,%edi
mov    $0x0,%al
call   1030 <shm_create@plt>
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
jge    1310 <test1+0x1d0>
mov    $0x1,%edi
lea    0xd63(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1456 <test1+0x316>
mov    -0x4(%rbp),%edi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1060 <shm_get@plt>
cmp    $0x0,%eax
jge    133e <test1+0x1fe>
xor    %eax,%eax
mov    %eax,%edi
lea    0xcfc(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1456 <test1+0x316>
mov    -0x30(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    1368 <test1+0x228>
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    1368 <test1+0x228>
mov    -0x28(%rbp),%rax
cmp    -0x18(%rbp),%rax
jb     1380 <test1+0x240>
mov    $0x1,%edi
lea    0xccf(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1456 <test1+0x316>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1050 <shm_close@plt>
mov    -0xc(%rbp),%edi
mov    $0x0,%al
call   1050 <shm_close@plt>
mov    $0x1000,%edi
mov    $0x0,%al
call   1030 <shm_create@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jge    13c4 <test1+0x284>
mov    $0x1,%edi
lea    0xcaf(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1456 <test1+0x316>
mov    -0xc(%rbp),%edi
lea    -0x28(%rbp),%rsi
mov    $0x0,%al
call   1060 <shm_get@plt>
cmp    $0x0,%eax
jge    13f2 <test1+0x2b2>
xor    %eax,%eax
mov    %eax,%edi
lea    0xc48(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1456 <test1+0x316>
mov    -0x30(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    140e <test1+0x2ce>
mov    -0x28(%rbp),%rax
cmp    -0x18(%rbp),%rax
jb     1426 <test1+0x2e6>
mov    $0x1,%edi
lea    0xc29(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1456 <test1+0x316>
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1050 <shm_close@plt>
mov    -0xc(%rbp),%edi
mov    $0x0,%al
call   1050 <shm_close@plt>
mov    -0x10(%rbp),%edi
mov    $0x0,%al
call   1050 <shm_close@plt>
xor    %eax,%eax
mov    %eax,%edi
lea    0xc48(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x28,%rsp
lea    0xf4a(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1000,%edi
xor    %eax,%eax
call   1030 <shm_create@plt>
mov    %eax,%ebx
mov    $0x1000,%edi
xor    %eax,%eax
call   1030 <shm_create@plt>
mov    %eax,%ebp
mov    $0x1000,%edi
xor    %eax,%eax
call   1030 <shm_create@plt>
mov    %eax,%r15d
mov    $0x1000,%edi
xor    %eax,%eax
call   1030 <shm_create@plt>
test   %ebx,%ebx
js     1302 <test1+0x1c2>
test   %ebp,%ebp
js     1302 <test1+0x1c2>
test   %r15d,%r15d
js     1302 <test1+0x1c2>
mov    %eax,%r14d
test   %eax,%eax
js     1302 <test1+0x1c2>
lea    0x18(%rsp),%rsi
mov    %ebx,%edi
xor    %eax,%eax
call   1060 <shm_get@plt>
test   %eax,%eax
js     131f <test1+0x1df>
lea    0x20(%rsp),%rsi
mov    %ebp,%edi
xor    %eax,%eax
call   1060 <shm_get@plt>
test   %eax,%eax
js     131f <test1+0x1df>
lea    0x8(%rsp),%rsi
mov    %r15d,%edi
xor    %eax,%eax
call   1060 <shm_get@plt>
test   %eax,%eax
js     131f <test1+0x1df>
mov    %ebx,%edi
xor    %eax,%eax
call   1050 <shm_close@plt>
lea    0x10(%rsp),%rsi
mov    %r14d,%edi
xor    %eax,%eax
call   1060 <shm_get@plt>
mov    0x10(%rsp),%rcx
mov    0x20(%rsp),%rax
cmp    %rax,%rcx
jae    132a <test1+0x1ea>
mov    0x8(%rsp),%rdx
cmp    %rdx,%rcx
jae    132a <test1+0x1ea>
cmp    %rdx,%rax
jae    132a <test1+0x1ea>
mov    $0x1000,%edi
xor    %eax,%eax
call   1030 <shm_create@plt>
test   %eax,%eax
js     1348 <test1+0x208>
mov    %eax,%ebx
lea    0x18(%rsp),%rsi
mov    %eax,%edi
xor    %eax,%eax
call   1060 <shm_get@plt>
test   %eax,%eax
js     131f <test1+0x1df>
mov    0x20(%rsp),%rax
cmp    %rax,0x10(%rsp)
jae    132a <test1+0x1ea>
mov    0x8(%rsp),%rcx
cmp    %rcx,%rax
jae    132a <test1+0x1ea>
cmp    0x18(%rsp),%rcx
jae    132a <test1+0x1ea>
mov    %ebp,%edi
xor    %eax,%eax
call   1050 <shm_close@plt>
mov    %r15d,%edi
xor    %eax,%eax
call   1050 <shm_close@plt>
mov    $0x1000,%edi
xor    %eax,%eax
call   1030 <shm_create@plt>
test   %eax,%eax
js     1348 <test1+0x208>
mov    %eax,%ebp
lea    0x8(%rsp),%rsi
mov    %eax,%edi
xor    %eax,%eax
call   1060 <shm_get@plt>
test   %eax,%eax
js     131f <test1+0x1df>
mov    0x8(%rsp),%rax
cmp    %rax,0x10(%rsp)
jae    132a <test1+0x1ea>
cmp    0x18(%rsp),%rax
jae    132a <test1+0x1ea>
mov    %ebx,%edi
xor    %eax,%eax
call   1050 <shm_close@plt>
mov    %ebp,%edi
xor    %eax,%eax
call   1050 <shm_close@plt>
mov    %r14d,%edi
xor    %eax,%eax
call   1050 <shm_close@plt>
lea    0xd97(%rip),%rsi
jmp    1326 <test1+0x1e6>
lea    0xcf7(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <printf@plt>
lea    0xd08(%rip),%rsi
xor    %edi,%edi
jmp    1336 <test1+0x1f6>
lea    0xd12(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xd18(%rip),%rsi
jmp    1331 <test1+0x1f1>

LLVM IR (-O0):
@.str = [17 x i8] c"Executing test1\0A\00"
@.str.1 = [46 x i8] c"****Error creating shared memory blocks*****\0A\00"
@.str.2 = [21 x i8] c"error getting block\0A\00"
@.str.3 = [36 x i8] c"****Error when in alloc orden*****\0A\00"
@.str.4 = [48 x i8] c"****Error recreating shared memory blocks*****\0A\00"
@.str.5 = [21 x i8] c"End Executing test1\0A\00"
define void @test1() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = call i32 (i8*, ...) @printf(i8* null, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (i32, ...) bitcast (i32 (...)* @shm_create to i32 (i32, ...)*)(i32 4096)
store i32 %10, i32* %1
%11 = call i32 (i32, ...) bitcast (i32 (...)* @shm_create to i32 (i32, ...)*)(i32 4096)
store i32 %11, i32* %2
%12 = call i32 (i32, ...) bitcast (i32 (...)* @shm_create to i32 (i32, ...)*)(i32 4096)
store i32 %12, i32* %3
%13 = call i32 (i32, ...) bitcast (i32 (...)* @shm_create to i32 (i32, ...)*)(i32 4096)
store i32 %13, i32* %4
%14 = load i32, i32* %1
%15 = icmp slt i32 %14, 0
br i1 %15, label %25, label %16
16: ; preds = %0
%17 = load i32, i32* %2
%18 = icmp slt i32 %17, 0
br i1 %18, label %25, label %19
19: ; preds = %16
%20 = load i32, i32* %3
%21 = icmp slt i32 %20, 0
br i1 %21, label %25, label %22
22: ; preds = %19
%23 = load i32, i32* %4
%24 = icmp slt i32 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %22, %19, %16, %0
%26 = call i32 (i8*, ...) @printf(i8* inttoptr (i64 1 to i8*), i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
br label %127
27: ; preds = %22
%28 = load i32, i32* %1
%29 = call i32 (i32, i8**, ...) bitcast (i32 (...)* @shm_get to i32 (i32, i8**, ...)*)(i32 %28, i8** %5)
%30 = icmp slt i32 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %27
%32 = call i32 (i8*, ...) @printf(i8* null, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
br label %127
33: ; preds = %27
%34 = load i32, i32* %2
%35 = call i32 (i32, i8**, ...) bitcast (i32 (...)* @shm_get to i32 (i32, i8**, ...)*)(i32 %34, i8** %6)
%36 = icmp slt i32 %35, 0
br i1 %36, label %37, label %39
37: ; preds = %33
%38 = call i32 (i8*, ...) @printf(i8* null, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
br label %127
39: ; preds = %33
%40 = load i32, i32* %3
%41 = call i32 (i32, i8**, ...) bitcast (i32 (...)* @shm_get to i32 (i32, i8**, ...)*)(i32 %40, i8** %7)
%42 = icmp slt i32 %41, 0
br i1 %42, label %43, label %45
43: ; preds = %39
%44 = call i32 (i8*, ...) @printf(i8* null, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
br label %127
45: ; preds = %39
%46 = load i32, i32* %1
%47 = call i32 (i32, ...) bitcast (i32 (...)* @shm_close to i32 (i32, ...)*)(i32 %46)
%48 = load i32, i32* %4
%49 = call i32 (i32, i8**, ...) bitcast (i32 (...)* @shm_get to i32 (i32, i8**, ...)*)(i32 %48, i8** %8)
%50 = load i8*, i8** %8
%51 = load i8*, i8** %6
%52 = icmp uge i8* %50, %51
br i1 %52, label %57, label %53
53: ; preds = %45
%54 = load i8*, i8** %8
%55 = load i8*, i8** %7
%56 = icmp uge i8* %54, %55
br i1 %56, label %57, label %59
57: ; preds = %53, %45
%58 = call i32 (i8*, ...) @printf(i8* inttoptr (i64 1 to i8*), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
br label %127
59: ; preds = %53
%60 = load i8*, i8** %8
%61 = load i8*, i8** %6
%62 = icmp ult i8* %60, %61
br i1 %62, label %63, label %67
63: ; preds = %59
%64 = load i8*, i8** %6
%65 = load i8*, i8** %7
%66 = icmp ult i8* %64, %65
br i1 %66, label %69, label %67
67: ; preds = %63, %59
%68 = call i32 (i8*, ...) @printf(i8* inttoptr (i64 1 to i8*), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
br label %127
69: ; preds = %63
%70 = call i32 (i32, ...) bitcast (i32 (...)* @shm_create to i32 (i32, ...)*)(i32 4096)
store i32 %70, i32* %1
%71 = icmp slt i32 %70, 0
br i1 %71, label %72, label %74
72: ; preds = %69
%73 = call i32 (i8*, ...) @printf(i8* inttoptr (i64 1 to i8*), i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.4, i64 0, i64 0))
br label %127
74: ; preds = %69
%75 = load i32, i32* %1
%76 = call i32 (i32, i8**, ...) bitcast (i32 (...)* @shm_get to i32 (i32, i8**, ...)*)(i32 %75, i8** %5)
%77 = icmp slt i32 %76, 0
br i1 %77, label %78, label %80
78: ; preds = %74
%79 = call i32 (i8*, ...) @printf(i8* null, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
br label %127
80: ; preds = %74
%81 = load i8*, i8** %8
%82 = load i8*, i8** %6
%83 = icmp ult i8* %81, %82
br i1 %83, label %84, label %92
84: ; preds = %80
%85 = load i8*, i8** %6
%86 = load i8*, i8** %7
%87 = icmp ult i8* %85, %86
br i1 %87, label %88, label %92
88: ; preds = %84
%89 = load i8*, i8** %7
%90 = load i8*, i8** %5
%91 = icmp ult i8* %89, %90
br i1 %91, label %94, label %92
92: ; preds = %88, %84, %80
%93 = call i32 (i8*, ...) @printf(i8* inttoptr (i64 1 to i8*), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
br label %127
94: ; preds = %88
%95 = load i32, i32* %2
%96 = call i32 (i32, ...) bitcast (i32 (...)* @shm_close to i32 (i32, ...)*)(i32 %95)
%97 = load i32, i32* %3
%98 = call i32 (i32, ...) bitcast (i32 (...)* @shm_close to i32 (i32, ...)*)(i32 %97)
%99 = call i32 (i32, ...) bitcast (i32 (...)* @shm_create to i32 (i32, ...)*)(i32 4096)
store i32 %99, i32* %3
%100 = icmp slt i32 %99, 0
br i1 %100, label %101, label %103
101: ; preds = %94
%102 = call i32 (i8*, ...) @printf(i8* inttoptr (i64 1 to i8*), i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.4, i64 0, i64 0))
br label %127
103: ; preds = %94
%104 = load i32, i32* %3
%105 = call i32 (i32, i8**, ...) bitcast (i32 (...)* @shm_get to i32 (i32, i8**, ...)*)(i32 %104, i8** %7)
%106 = icmp slt i32 %105, 0
br i1 %106, label %107, label %109
107: ; preds = %103
%108 = call i32 (i8*, ...) @printf(i8* null, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
br label %127
109: ; preds = %103
%110 = load i8*, i8** %8
%111 = load i8*, i8** %7
%112 = icmp ult i8* %110, %111
br i1 %112, label %113, label %117
113: ; preds = %109
%114 = load i8*, i8** %7
%115 = load i8*, i8** %5
%116 = icmp ult i8* %114, %115
br i1 %116, label %119, label %117
117: ; preds = %113, %109
%118 = call i32 (i8*, ...) @printf(i8* inttoptr (i64 1 to i8*), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
br label %127
119: ; preds = %113
%120 = load i32, i32* %1
%121 = call i32 (i32, ...) bitcast (i32 (...)* @shm_close to i32 (i32, ...)*)(i32 %120)
%122 = load i32, i32* %3
%123 = call i32 (i32, ...) bitcast (i32 (...)* @shm_close to i32 (i32, ...)*)(i32 %122)
%124 = load i32, i32* %4
%125 = call i32 (i32, ...) bitcast (i32 (...)* @shm_close to i32 (i32, ...)*)(i32 %124)
%126 = call i32 (i8*, ...) @printf(i8* null, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0))
br label %127
127: ; preds = %119, %117, %107, %101, %92, %78, %72, %67, %57, %43, %37, %31, %25
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Executing test1\0A\00"
@.str.1 = [46 x i8] c"****Error creating shared memory blocks*****\0A\00"
@.str.2 = [21 x i8] c"error getting block\0A\00"
@.str.3 = [36 x i8] c"****Error when in alloc orden*****\0A\00"
@.str.4 = [48 x i8] c"****Error recreating shared memory blocks*****\0A\00"
@.str.5 = [21 x i8] c"End Executing test1\0A\00"
define void @test1() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = bitcast i8** %1 to i8*
%6 = bitcast i8** %2 to i8*
%7 = bitcast i8** %3 to i8*
%8 = bitcast i8** %4 to i8*
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) null, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 (i32, ...) bitcast (i32 (...)* @shm_create to i32 (i32, ...)*)(i32 4096)
%11 = tail call i32 (i32, ...) bitcast (i32 (...)* @shm_create to i32 (i32, ...)*)(i32 4096)
%12 = tail call i32 (i32, ...) bitcast (i32 (...)* @shm_create to i32 (i32, ...)*)(i32 4096)
%13 = tail call i32 (i32, ...) bitcast (i32 (...)* @shm_create to i32 (i32, ...)*)(i32 4096)
%14 = icmp slt i32 %10, 0
%15 = icmp slt i32 %11, 0
%16 = select i1 %14, i1 true, i1 %15
%17 = icmp slt i32 %12, 0
%18 = select i1 %16, i1 true, i1 %17
%19 = icmp slt i32 %13, 0
%20 = select i1 %18, i1 true, i1 %19
br i1 %20, label %21, label %23
21: ; preds = %0
%22 = tail call i32 (i8*, ...) @printf(i8* inttoptr (i64 1 to i8*), i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
br label %101
23: ; preds = %0
%24 = call i32 (i32, i8**, ...) bitcast (i32 (...)* @shm_get to i32 (i32, i8**, ...)*)(i32 %10, i8** %1)
%25 = icmp slt i32 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) null, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
br label %101
28: ; preds = %23
%29 = call i32 (i32, i8**, ...) bitcast (i32 (...)* @shm_get to i32 (i32, i8**, ...)*)(i32 %11, i8** %2)
%30 = icmp slt i32 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %28
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) null, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
br label %101
33: ; preds = %28
%34 = call i32 (i32, i8**, ...) bitcast (i32 (...)* @shm_get to i32 (i32, i8**, ...)*)(i32 %12, i8** %3)
%35 = icmp slt i32 %34, 0
br i1 %35, label %36, label %38
36: ; preds = %33
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) null, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
br label %101
38: ; preds = %33
%39 = call i32 (i32, ...) bitcast (i32 (...)* @shm_close to i32 (i32, ...)*)(i32 %10)
%40 = call i32 (i32, i8**, ...) bitcast (i32 (...)* @shm_get to i32 (i32, i8**, ...)*)(i32 %13, i8** %4)
%41 = load i8*, i8** %4
%42 = load i8*, i8** %2
%43 = icmp ult i8* %41, %42
br i1 %43, label %44, label %47
44: ; preds = %38
%45 = load i8*, i8** %3
%46 = icmp ult i8* %41, %45
br i1 %46, label %49, label %47
47: ; preds = %44, %38
%48 = call i32 (i8*, ...) @printf(i8* inttoptr (i64 1 to i8*), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
br label %101
49: ; preds = %44
%50 = icmp ult i8* %42, %45
br i1 %50, label %53, label %51
51: ; preds = %49
%52 = call i32 (i8*, ...) @printf(i8* inttoptr (i64 1 to i8*), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
br label %101
53: ; preds = %49
%54 = call i32 (i32, ...) bitcast (i32 (...)* @shm_create to i32 (i32, ...)*)(i32 4096)
%55 = icmp slt i32 %54, 0
br i1 %55, label %56, label %58
56: ; preds = %53
%57 = call i32 (i8*, ...) @printf(i8* inttoptr (i64 1 to i8*), i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.4, i64 0, i64 0))
br label %101
58: ; preds = %53
%59 = call i32 (i32, i8**, ...) bitcast (i32 (...)* @shm_get to i32 (i32, i8**, ...)*)(i32 %54, i8** %1)
%60 = icmp slt i32 %59, 0
br i1 %60, label %61, label %63
61: ; preds = %58
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) null, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
br label %101
63: ; preds = %58
%64 = load i8*, i8** %4
%65 = load i8*, i8** %2
%66 = icmp ult i8* %64, %65
br i1 %66, label %67, label %73
67: ; preds = %63
%68 = load i8*, i8** %3
%69 = icmp ult i8* %65, %68
%70 = load i8*, i8** %1
%71 = icmp ult i8* %68, %70
%72 = select i1 %69, i1 %71, i1 false
br i1 %72, label %75, label %73
73: ; preds = %67, %63
%74 = call i32 (i8*, ...) @printf(i8* inttoptr (i64 1 to i8*), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
br label %101
75: ; preds = %67
%76 = call i32 (i32, ...) bitcast (i32 (...)* @shm_close to i32 (i32, ...)*)(i32 %11)
%77 = call i32 (i32, ...) bitcast (i32 (...)* @shm_close to i32 (i32, ...)*)(i32 %12)
%78 = call i32 (i32, ...) bitcast (i32 (...)* @shm_create to i32 (i32, ...)*)(i32 4096)
%79 = icmp slt i32 %78, 0
br i1 %79, label %80, label %82
80: ; preds = %75
%81 = call i32 (i8*, ...) @printf(i8* inttoptr (i64 1 to i8*), i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.4, i64 0, i64 0))
br label %101
82: ; preds = %75
%83 = call i32 (i32, i8**, ...) bitcast (i32 (...)* @shm_get to i32 (i32, i8**, ...)*)(i32 %78, i8** %3)
%84 = icmp slt i32 %83, 0
br i1 %84, label %85, label %87
85: ; preds = %82
%86 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) null, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
br label %101
87: ; preds = %82
%88 = load i8*, i8** %4
%89 = load i8*, i8** %3
%90 = icmp ult i8* %88, %89
%91 = load i8*, i8** %1
%92 = icmp ult i8* %89, %91
%93 = select i1 %90, i1 %92, i1 false
br i1 %93, label %96, label %94
94: ; preds = %87
%95 = call i32 (i8*, ...) @printf(i8* inttoptr (i64 1 to i8*), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
br label %101
96: ; preds = %87
%97 = call i32 (i32, ...) bitcast (i32 (...)* @shm_close to i32 (i32, ...)*)(i32 %54)
%98 = call i32 (i32, ...) bitcast (i32 (...)* @shm_close to i32 (i32, ...)*)(i32 %78)
%99 = call i32 (i32, ...) bitcast (i32 (...)* @shm_close to i32 (i32, ...)*)(i32 %13)
%100 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) null, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0))
br label %101
101: ; preds = %96, %94, %85, %80, %73, %61, %56, %51, %47, %36, %31, %26, %21
ret void
}