#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_dec(int which, int part, char *model_string) {
  switch (part) {
  case 0xa10:
    string_append(which, "SA110", model_string);
    break;
  case 0xa11:
    string_append(which, "SA1100", model_string);
    break;
  default:
    string_append(which, "Unknown", model_string);
    break;
  }
}


x86 assembly (clang, -O0):
<handle_dec>:
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    $0xa10,%eax
je     114b <handle_dec+0x3b>
jmp    1138 <handle_dec+0x28>
mov    -0x14(%rbp),%eax
sub    $0xa11,%eax
je     1163 <handle_dec+0x53>
jmp    117b <handle_dec+0x6b>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
lea    0xea7(%rip),%rsi
call   1030 <string_append@plt>
jmp    118e <handle_dec+0x7e>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
lea    0xe95(%rip),%rsi
call   1030 <string_append@plt>
jmp    118e <handle_dec+0x7e>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
lea    0xe84(%rip),%rsi
call   1030 <string_append@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_dec>:
cmp    $0xa11,%esi
lea    0xee9(%rip),%rax
lea    0xee9(%rip),%rcx
cmove  %rax,%rcx
cmp    $0xa10,%esi
lea    0xecb(%rip),%rsi
cmovne %rcx,%rsi
jmp    1030 <string_append@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"SA110\00"
@.str.1 = [7 x i8] c"SA1100\00"
@.str.2 = [8 x i8] c"Unknown\00"
define void @handle_dec(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 %16 [
i32 2576, label %8
i32 2577, label %12
]
8: ; preds = %3
%9 = load i32, i32* %4
%10 = load i8*, i8** %6
%11 = call i32 @string_append(i32 %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %20
12: ; preds = %3
%13 = load i32, i32* %4
%14 = load i8*, i8** %6
%15 = call i32 @string_append(i32 %13, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %14)
br label %20
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 %20
20: ; preds = %16, %12, %8
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"SA110\00"
@.str.1 = [7 x i8] c"SA1100\00"
@.str.2 = [8 x i8] c"Unknown\00"
define void @handle_dec(i32 %0, i32 %1, i8* %2) {
%4 = icmp eq i32 %1, 2577
%5 = select i1 %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0)
%6 = icmp eq i32 %1, 2576
%7 = select i1 %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %5
%8 = tail call i32 @string_append(i32 %0, i8* %7, i8* %2)
ret void
}