#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_faraday(int which, int part, char *model_string) {
  switch (part) {
  case 0x0526:
    string_append(which, "FA526", model_string);
    break;
  case 0x0626:
    string_append(which, "FA626", model_string);
    break;
  default:
    string_append(which, "Unknown", model_string);
    break;
  }
}


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"FA526\00"
@.str.1 = [6 x i8] c"FA626\00"
@.str.2 = [8 x i8] c"Unknown\00"
define void @handle_faraday(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 1318, label %8
i32 1574, 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 ([6 x i8], [6 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"FA526\00"
@.str.1 = [6 x i8] c"FA626\00"
@.str.2 = [8 x i8] c"Unknown\00"
define void @handle_faraday(i32 %0, i32 %1, i8* %2) {
%4 = icmp eq i32 %1, 1574
%5 = select i1 %4, i8* getelementptr inbounds ([6 x i8], [6 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, 1318
%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
}