#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*/ string_append(int, char *, char *);
void handle_marvell(int which, int part, char *model_string) {
  switch (part) {
  case 0x0131:
    string_append(which, "Feroceon 88FR131", model_string);
    break;
  case 0x0581:
    string_append(which, "PJ4/PJ4b", model_string);
    break;
  case 0x0584:
    string_append(which, "PJ4B-MP", model_string);
    break;
  default:
    string_append(which, "Unknown", model_string);
    break;
  }
}


x86 assembly (clang, -O0):
<handle_marvell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
sub    $0x131,%eax
je     115e <handle_marvell+0x4e>
jmp    1138 <handle_marvell+0x28>
mov    -0x14(%rbp),%eax
sub    $0x581,%eax
je     1176 <handle_marvell+0x66>
jmp    114b <handle_marvell+0x3b>
mov    -0x14(%rbp),%eax
sub    $0x584,%eax
je     118e <handle_marvell+0x7e>
jmp    11a6 <handle_marvell+0x96>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
lea    0xe94(%rip),%rsi
call   1030 <string_append@plt>
jmp    11b9 <handle_marvell+0xa9>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
lea    0xe8d(%rip),%rsi
call   1030 <string_append@plt>
jmp    11b9 <handle_marvell+0xa9>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
lea    0xe7e(%rip),%rsi
call   1030 <string_append@plt>
jmp    11b9 <handle_marvell+0xa9>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
lea    0xe6e(%rip),%rsi
call   1030 <string_append@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_marvell>:
cmp    $0x131,%esi
je     1134 <handle_marvell+0x24>
cmp    $0x584,%esi
je     1140 <handle_marvell+0x30>
cmp    $0x581,%esi
jne    114c <handle_marvell+0x3c>
lea    0xee2(%rip),%rsi
jmp    1030 <string_append@plt>
lea    0xec5(%rip),%rsi
jmp    1030 <string_append@plt>
lea    0xed3(%rip),%rsi
jmp    1030 <string_append@plt>
lea    0xecf(%rip),%rsi
jmp    1030 <string_append@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Feroceon 88FR131\00"
@.str.1 = [9 x i8] c"PJ4/PJ4b\00"
@.str.2 = [8 x i8] c"PJ4B-MP\00"
@.str.3 = [8 x i8] c"Unknown\00"
define void @handle_marvell(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
switch i32 %7, label %20 [
i32 305, label %8
i32 1409, label %12
i32 1412, label %16
]
8: ; preds = %3
%9 = load i32, i32* %4
%10 = load i8*, i8** %6
%11 = call i32 @string_append(i32 %9, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %24
12: ; preds = %3
%13 = load i32, i32* %4
%14 = load i8*, i8** %6
%15 = call i32 @string_append(i32 %13, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %14)
br label %24
16: ; preds = %3
%17 = load i32, i32* %4
%18 = load i8*, i8** %6
%19 = call i32 @string_append(i32 %17, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %18)
br label %24
20: ; preds = %3
%21 = load i32, i32* %4
%22 = load i8*, i8** %6
%23 = call i32 @string_append(i32 %21, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* %22)
br label %24
24: ; preds = %20, %16, %12, %8
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Feroceon 88FR131\00"
@.str.1 = [9 x i8] c"PJ4/PJ4b\00"
@.str.2 = [8 x i8] c"PJ4B-MP\00"
@.str.3 = [8 x i8] c"Unknown\00"
define void @handle_marvell(i32 %0, i32 %1, i8* %2) {
switch i32 %1, label %6 [
i32 305, label %7
i32 1409, label %4
i32 1412, label %5
]
4: ; preds = %3
br label %7
5: ; preds = %3
br label %7
6: ; preds = %3
br label %7
7: ; preds = %3, %6, %5, %4
%8 = phi i8* [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), %6 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), %5 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), %4 ], [ getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), %3 ]
%9 = tail call i32 @string_append(i32 %0, i8* %8, i8* %2)
ret void
}