void report_shmcreate_errors(int s) {
  switch (s) {
  case -1:
    printf(1, "nroError:%d-non available resources for current request\n", s);
    break;
  case -2:
    printf(1, "nroError:%d-size bad: it is less or equal to 0", s);
    break;
  case -3:
    printf(1,
           "nroError:%d-size bad: the request block is bigger than the maximum "
           "block size",
           s);
    break;
  case -4:
    printf(
        1,
        "nroError:%d-current process has all shared memory blocks already busy",
        s);
    break;
  case -5:
    printf(1, "nroError:%d-OS has all shared memory blocks already busy.", s);
    break;
  }
}


x86 assembly (clang, -O0):
<report_shmcreate_errors>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x5,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x4,%eax
ja     11c6 <report_shmcreate_errors+0xb6>
mov    -0x10(%rbp),%rax
lea    0xec5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x4(%rbp),%edx
mov    $0x1,%edi
lea    0xec1(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11c6 <report_shmcreate_errors+0xb6>
mov    -0x4(%rbp),%edx
mov    $0x1,%edi
lea    0xedf(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11c6 <report_shmcreate_errors+0xb6>
mov    -0x4(%rbp),%edx
mov    $0x1,%edi
lea    0xef3(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11c6 <report_shmcreate_errors+0xb6>
mov    -0x4(%rbp),%edx
mov    $0x1,%edi
lea    0xf26(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11c6 <report_shmcreate_errors+0xb6>
mov    -0x4(%rbp),%edx
mov    $0x1,%edi
lea    0xf51(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<report_shmcreate_errors>:
add    $0x5,%edi
cmp    $0x4,%edi
ja     1140 <report_shmcreate_errors+0x30>
lea    0xee1(%rip),%rax
movslq (%rax,%rdi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
lea    0xfe1(%rip),%rsi
mov    $0x1,%edi
mov    $0xfffffffb,%edx
xor    %eax,%eax
jmp    1030 <printf@plt>
ret
lea    0xf82(%rip),%rsi
mov    $0x1,%edi
mov    $0xfffffffc,%edx
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xf1c(%rip),%rsi
mov    $0x1,%edi
mov    $0xfffffffd,%edx
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xed5(%rip),%rsi
mov    $0x1,%edi
mov    $0xfffffffe,%edx
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xe84(%rip),%rsi
mov    $0x1,%edi
mov    $0xffffffff,%edx
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [57 x i8] c"nroError:%d-non available resources for current request\0A\00"
@.str.1 = [47 x i8] c"nroError:%d-size bad: it is less or equal to 0\00"
@.str.2 = [78 x i8] c"nroError:%d-size bad: the request block is bigger than the maximum block size\00"
@.str.3 = [70 x i8] c"nroError:%d-current process has all shared memory blocks already busy\00"
@.str.4 = [58 x i8] c"nroError:%d-OS has all shared memory blocks already busy.\00"
define void @report_shmcreate_errors(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %19 [
i32 -1, label %4
i32 -2, label %7
i32 -3, label %10
i32 -4, label %13
i32 -5, label %16
]
4: ; preds = %1
%5 = load i32, i32* %2
%6 = call i32 (i8*, ...) @printf(i8* inttoptr (i64 1 to i8*), i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %19
7: ; preds = %1
%8 = load i32, i32* %2
%9 = call i32 (i8*, ...) @printf(i8* inttoptr (i64 1 to i8*), i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i32 %8)
br label %19
10: ; preds = %1
%11 = load i32, i32* %2
%12 = call i32 (i8*, ...) @printf(i8* inttoptr (i64 1 to i8*), i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.2, i64 0, i64 0), i32 %11)
br label %19
13: ; preds = %1
%14 = load i32, i32* %2
%15 = call i32 (i8*, ...) @printf(i8* inttoptr (i64 1 to i8*), i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.3, i64 0, i64 0), i32 %14)
br label %19
16: ; preds = %1
%17 = load i32, i32* %2
%18 = call i32 (i8*, ...) @printf(i8* inttoptr (i64 1 to i8*), i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.4, i64 0, i64 0), i32 %17)
br label %19
19: ; preds = %1, %16, %13, %10, %7, %4
ret void
}

LLVM IR (-O2):
@.str = [57 x i8] c"nroError:%d-non available resources for current request\0A\00"
@.str.1 = [47 x i8] c"nroError:%d-size bad: it is less or equal to 0\00"
@.str.2 = [78 x i8] c"nroError:%d-size bad: the request block is bigger than the maximum block size\00"
@.str.3 = [70 x i8] c"nroError:%d-current process has all shared memory blocks already busy\00"
@.str.4 = [58 x i8] c"nroError:%d-OS has all shared memory blocks already busy.\00"
define void @report_shmcreate_errors(i32 %0) {
switch i32 %0, label %12 [
i32 -1, label %2
i32 -2, label %4
i32 -3, label %6
i32 -4, label %8
i32 -5, label %10
]
2: ; preds = %1
%3 = tail call i32 (i8*, ...) @printf(i8* inttoptr (i64 1 to i8*), i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i32 -1)
br label %12
4: ; preds = %1
%5 = tail call i32 (i8*, ...) @printf(i8* inttoptr (i64 1 to i8*), i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i32 -2)
br label %12
6: ; preds = %1
%7 = tail call i32 (i8*, ...) @printf(i8* inttoptr (i64 1 to i8*), i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.2, i64 0, i64 0), i32 -3)
br label %12
8: ; preds = %1
%9 = tail call i32 (i8*, ...) @printf(i8* inttoptr (i64 1 to i8*), i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.3, i64 0, i64 0), i32 -4)
br label %12
10: ; preds = %1
%11 = tail call i32 (i8*, ...) @printf(i8* inttoptr (i64 1 to i8*), i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.4, i64 0, i64 0), i32 -5)
br label %12
12: ; preds = %1, %10, %8, %6, %4, %2
ret void
}