void report_shmget_errors(int s) {
  switch (s) {
  case -1:
    printf(1,
           "nroError:%d-current process has all shared memory blocks already "
           "busy.\n",
           s);
    break;
  case -2:
    printf(1,
           "nroError:%d-Sharem memory block with key descriptor hasn't been "
           "created.",
           s);
    break;
  case -3:
    printf(1, "nroError:%d-Process haven't enought adresses space.", s);
    break;
  }
}


x86 assembly (clang, -O0):
<report_shmget_errors>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0xfffffffd,%eax
je     1187 <report_shmget_errors+0x77>
jmp    112f <report_shmget_errors+0x1f>
mov    -0x8(%rbp),%eax
sub    $0xfffffffe,%eax
je     116c <report_shmget_errors+0x5c>
jmp    1140 <report_shmget_errors+0x30>
mov    -0x8(%rbp),%eax
sub    $0xffffffff,%eax
jne    119d <report_shmget_errors+0x8d>
jmp    1151 <report_shmget_errors+0x41>
mov    -0x4(%rbp),%edx
mov    $0x1,%edi
lea    0xea0(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    119d <report_shmget_errors+0x8d>
mov    -0x4(%rbp),%edx
mov    $0x1,%edi
lea    0xecd(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    119d <report_shmget_errors+0x8d>
mov    -0x4(%rbp),%edx
mov    $0x1,%edi
lea    0xefb(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<report_shmget_errors>:
cmp    $0xfffffffd,%edi
je     1137 <report_shmget_errors+0x27>
cmp    $0xfffffffe,%edi
je     114f <report_shmget_errors+0x3f>
cmp    $0xffffffff,%edi
jne    1167 <report_shmget_errors+0x57>
lea    0xeda(%rip),%rsi
mov    $0x1,%edi
mov    $0xffffffff,%edx
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xf53(%rip),%rsi
mov    $0x1,%edi
mov    $0xfffffffd,%edx
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xef2(%rip),%rsi
mov    $0x1,%edi
mov    $0xfffffffe,%edx
xor    %eax,%eax
jmp    1030 <printf@plt>
ret

LLVM IR (-O0):
@.str = [72 x i8] c"nroError:%d-current process has all shared memory blocks already busy.\0A\00"
@.str.1 = [73 x i8] c"nroError:%d-Sharem memory block with key descriptor hasn't been created.\00"
@.str.2 = [52 x i8] c"nroError:%d-Process haven't enought adresses space.\00"
define void @report_shmget_errors(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %13 [
i32 -1, label %4
i32 -2, label %7
i32 -3, label %10
]
4: ; preds = %1
%5 = load i32, i32* %2
%6 = call i32 (i8*, ...) @printf(i8* inttoptr (i64 1 to i8*), i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %13
7: ; preds = %1
%8 = load i32, i32* %2
%9 = call i32 (i8*, ...) @printf(i8* inttoptr (i64 1 to i8*), i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.1, i64 0, i64 0), i32 %8)
br label %13
10: ; preds = %1
%11 = load i32, i32* %2
%12 = call i32 (i8*, ...) @printf(i8* inttoptr (i64 1 to i8*), i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %1, %10, %7, %4
ret void
}

LLVM IR (-O2):
@.str = [72 x i8] c"nroError:%d-current process has all shared memory blocks already busy.\0A\00"
@.str.1 = [73 x i8] c"nroError:%d-Sharem memory block with key descriptor hasn't been created.\00"
@.str.2 = [52 x i8] c"nroError:%d-Process haven't enought adresses space.\00"
define void @report_shmget_errors(i32 %0) {
switch i32 %0, label %8 [
i32 -1, label %2
i32 -2, label %4
i32 -3, label %6
]
2: ; preds = %1
%3 = tail call i32 (i8*, ...) @printf(i8* inttoptr (i64 1 to i8*), i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0), i32 -1)
br label %8
4: ; preds = %1
%5 = tail call i32 (i8*, ...) @printf(i8* inttoptr (i64 1 to i8*), i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.1, i64 0, i64 0), i32 -2)
br label %8
6: ; preds = %1
%7 = tail call i32 (i8*, ...) @printf(i8* inttoptr (i64 1 to i8*), i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0), i32 -3)
br label %8
8: ; preds = %1, %6, %4, %2
ret void
}