#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 *, int);
int select_size_cell_c(int nbline) {
  printf("nbline : %d\n", nbline);
  int size;
  switch (nbline) {
  case 4:
    size = 2;
    break;
  case 6:
    size = 3;
    break;
  case 9:
    size = 3;
    break;
  case 12:
    size = 4;
    break;
  case 16:
    size = 4;
    break;
  default:
    size = 0;
  }
  return size;
}


x86 assembly (clang, -O0):
<select_size_cell_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xf0f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0xfffffffc,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0xc,%eax
ja     118f <select_size_cell_c+0x7f>
mov    -0x10(%rbp),%rax
lea    0xeb6(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x2,-0x8(%rbp)
jmp    1196 <select_size_cell_c+0x86>
movl   $0x3,-0x8(%rbp)
jmp    1196 <select_size_cell_c+0x86>
movl   $0x3,-0x8(%rbp)
jmp    1196 <select_size_cell_c+0x86>
movl   $0x4,-0x8(%rbp)
jmp    1196 <select_size_cell_c+0x86>
movl   $0x4,-0x8(%rbp)
jmp    1196 <select_size_cell_c+0x86>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<select_size_cell_c>:
push   %rbx
mov    %edi,%ebx
lea    0xf1a(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0xfffffffc,%ebx
cmp    $0xc,%ebx
ja     114c <select_size_cell_c+0x3c>
mov    $0x2,%eax
lea    0xecb(%rip),%rcx
movslq (%rcx,%rbx,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x3,%eax
pop    %rbx
ret
mov    $0x4,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"nbline : %d\0A\00"
define i32 @select_size_cell_c(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %2
switch i32 %6, label %12 [
i32 4, label %7
i32 6, label %8
i32 9, label %9
i32 12, label %10
i32 16, label %11
]
7: ; preds = %1
store i32 2, i32* %3
br label %13
8: ; preds = %1
store i32 3, i32* %3
br label %13
9: ; preds = %1
store i32 3, i32* %3
br label %13
10: ; preds = %1
store i32 4, i32* %3
br label %13
11: ; preds = %1
store i32 4, i32* %3
br label %13
12: ; preds = %1
store i32 0, i32* %3
br label %13
13: ; preds = %12, %11, %10, %9, %8, %7
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@.str = [13 x i8] c"nbline : %d\0A\00"
define i32 @select_size_cell_c(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %0)
switch i32 %0, label %7 [
i32 4, label %8
i32 6, label %3
i32 9, label %4
i32 12, label %5
i32 16, label %6
]
3: ; preds = %1
br label %8
4: ; preds = %1
br label %8
5: ; preds = %1
br label %8
6: ; preds = %1
br label %8
7: ; preds = %1
br label %8
8: ; preds = %1, %7, %6, %5, %4, %3
%9 = phi i32 [ 0, %7 ], [ 4, %6 ], [ 4, %5 ], [ 3, %4 ], [ 3, %3 ], [ 2, %1 ]
ret i32 %9
}