#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*/ printf(char *);
void display_separator(int nbc, int nbr) {
  switch (nbr) {
  case 4:
    printf("+------+------+\n");
    break;
  case 6:
    printf("+---------+---------+\n");
    break;
  case 9:
    printf("+---------+---------+---------+\n");
    break;
  case 12:
    printf("+------------+------------+------------+\n");
    break;
  case 16:
    printf("+------------+------------+------------+------------+\n");
    break;
  default:
    printf("Error separator");
    break;
  }
}


x86 assembly (clang, -O0):
<display_separator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xfffffffc,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0xc,%eax
ja     119c <display_separator+0x8c>
mov    -0x10(%rbp),%rax
lea    0xec2(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xee6(%rip),%rdi
call   1030 <printf@plt>
jmp    11a8 <display_separator+0x98>
lea    0xef0(%rip),%rdi
call   1030 <printf@plt>
jmp    11a8 <display_separator+0x98>
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
jmp    11a8 <display_separator+0x98>
lea    0xef2(%rip),%rdi
call   1030 <printf@plt>
jmp    11a8 <display_separator+0x98>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
jmp    11a8 <display_separator+0x98>
lea    0xefa(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_separator>:
add    $0xfffffffc,%esi
cmp    $0xc,%esi
ja     1144 <display_separator+0x24>
lea    0xed1(%rip),%rax
movslq (%rax,%rsi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
lea    0xf5b(%rip),%rdi
jmp    1030 <puts@plt>
lea    0xee9(%rip),%rdi
jmp    1040 <printf@plt>
lea    0xf2d(%rip),%rdi
jmp    1030 <puts@plt>
lea    0xf17(%rip),%rdi
jmp    1030 <puts@plt>
lea    0xee2(%rip),%rdi
jmp    1030 <puts@plt>
lea    0xec9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"+------+------+\0A\00"
@.str.1 = [23 x i8] c"+---------+---------+\0A\00"
@.str.2 = [33 x i8] c"+---------+---------+---------+\0A\00"
@.str.3 = [42 x i8] c"+------------+------------+------------+\0A\00"
@.str.4 = [55 x i8] c"+------------+------------+------------+------------+\0A\00"
@.str.5 = [16 x i8] c"Error separator\00"
define void @display_separator(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
switch i32 %5, label %16 [
i32 4, label %6
i32 6, label %8
i32 9, label %10
i32 12, label %12
i32 16, label %14
]
6: ; preds = %2
%7 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %18
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
br label %18
10: ; preds = %2
%11 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
br label %18
12: ; preds = %2
%13 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0))
br label %18
14: ; preds = %2
%15 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.4, i64 0, i64 0))
br label %18
16: ; preds = %2
%17 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0))
br label %18
18: ; preds = %16, %14, %12, %10, %8, %6
ret void
}

LLVM IR (-O2):
@.str.5 = [16 x i8] c"Error separator\00"
@str = [54 x i8] c"+------------+------------+------------+------------+\00"
@str.6 = [41 x i8] c"+------------+------------+------------+\00"
@str.7 = [32 x i8] c"+---------+---------+---------+\00"
@str.8 = [22 x i8] c"+---------+---------+\00"
@str.9 = [16 x i8] c"+------+------+\00"
define void @display_separator(i32 %0, i32 %1) {
switch i32 %1, label %13 [
i32 4, label %3
i32 6, label %5
i32 9, label %7
i32 12, label %9
i32 16, label %11
]
3: ; preds = %2
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.9, i64 0, i64 0))
br label %15
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.8, i64 0, i64 0))
br label %15
7: ; preds = %2
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.7, i64 0, i64 0))
br label %15
9: ; preds = %2
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.6, i64 0, i64 0))
br label %15
11: ; preds = %2
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str, i64 0, i64 0))
br label %15
13: ; preds = %2
%14 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0))
br label %15
15: ; preds = %13, %11, %9, %7, %5, %3
ret void
}