#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*/ write(int, char *, int);
void printinfo(int cmd) {
  switch (cmd) {
  case 1:
    write(2, "Client closed the dedicated FIFO\n", 33);
    break;
  case 2:
    write(2, "No client\n", 10);
    break;
  case 3:
    write(2, "Server closed the well-known FIFO\n", 34);
    break;
  case 4:
    write(2, "Server closed the dedicated FIFO\n", 33);
    break;
  default:
    write(2, "I am a default action\n", 22);
  }
}


x86 assembly (clang, -O0):
<printinfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x3,%eax
ja     11b0 <printinfo+0xa0>
mov    -0x10(%rbp),%rax
lea    0xec5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x2,%edi
lea    0xec0(%rip),%rsi
mov    $0x21,%edx
call   1030 <write@plt>
jmp    11c6 <printinfo+0xb6>
mov    $0x2,%edi
lea    0xec7(%rip),%rsi
mov    $0xa,%edx
call   1030 <write@plt>
jmp    11c6 <printinfo+0xb6>
mov    $0x2,%edi
lea    0xeb7(%rip),%rsi
mov    $0x22,%edx
call   1030 <write@plt>
jmp    11c6 <printinfo+0xb6>
mov    $0x2,%edi
lea    0xebf(%rip),%rsi
mov    $0x21,%edx
call   1030 <write@plt>
jmp    11c6 <printinfo+0xb6>
mov    $0x2,%edi
lea    0xec6(%rip),%rsi
mov    $0x16,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printinfo>:
add    $0xffffffff,%edi
cmp    $0x3,%edi
ja     1131 <printinfo+0x21>
lea    0xee1(%rip),%rax
movslq (%rax,%rdi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
lea    0xee1(%rip),%rsi
jmp    117a <printinfo+0x6a>
lea    0xf4a(%rip),%rsi
mov    $0x2,%edi
mov    $0x16,%edx
jmp    1030 <write@plt>
lea    0xee4(%rip),%rsi
mov    $0x2,%edi
mov    $0xa,%edx
jmp    1030 <write@plt>
lea    0xed9(%rip),%rsi
mov    $0x2,%edi
mov    $0x22,%edx
jmp    1030 <write@plt>
lea    0xee6(%rip),%rsi
mov    $0x2,%edi
mov    $0x21,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"Client closed the dedicated FIFO\0A\00"
@.str.1 = [11 x i8] c"No client\0A\00"
@.str.2 = [35 x i8] c"Server closed the well-known FIFO\0A\00"
@.str.3 = [34 x i8] c"Server closed the dedicated FIFO\0A\00"
@.str.4 = [23 x i8] c"I am a default action\0A\00"
define void @printinfo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %12 [
i32 1, label %4
i32 2, label %6
i32 3, label %8
i32 4, label %10
]
4: ; preds = %1
%5 = call i32 @write(i32 2, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 33)
br label %14
6: ; preds = %1
%7 = call i32 @write(i32 2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 10)
br label %14
8: ; preds = %1
%9 = call i32 @write(i32 2, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i32 34)
br label %14
10: ; preds = %1
%11 = call i32 @write(i32 2, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i32 33)
br label %14
12: ; preds = %1
%13 = call i32 @write(i32 2, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i32 22)
br label %14
14: ; preds = %12, %10, %8, %6, %4
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"Client closed the dedicated FIFO\0A\00"
@.str.1 = [11 x i8] c"No client\0A\00"
@.str.2 = [35 x i8] c"Server closed the well-known FIFO\0A\00"
@.str.3 = [34 x i8] c"Server closed the dedicated FIFO\0A\00"
@.str.4 = [23 x i8] c"I am a default action\0A\00"
define void @printinfo(i32 %0) {
switch i32 %0, label %10 [
i32 1, label %2
i32 2, label %4
i32 3, label %6
i32 4, label %8
]
2: ; preds = %1
%3 = tail call i32 @write(i32 2, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 33)
br label %12
4: ; preds = %1
%5 = tail call i32 @write(i32 2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 10)
br label %12
6: ; preds = %1
%7 = tail call i32 @write(i32 2, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i32 34)
br label %12
8: ; preds = %1
%9 = tail call i32 @write(i32 2, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i32 33)
br label %12
10: ; preds = %1
%11 = tail call i32 @write(i32 2, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i32 22)
br label %12
12: ; preds = %10, %8, %6, %4, %2
ret void
}