#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*/ check_amex_15(long);
int /*<<< orphan*/ check_diners_club_cb_14(long);
int /*<<< orphan*/ check_discover_16(long);
int /*<<< orphan*/ check_enroute_15(long);
int /*<<< orphan*/ check_jcb_15(long);
int /*<<< orphan*/ check_jcb_16(long);
int /*<<< orphan*/ check_mastercard_16(long);
int /*<<< orphan*/ check_visa_16(long);
int process_prefix(int len, long offset) {
  switch (len) {
  case 16:
    check_mastercard_16(offset);
    check_visa_16(offset);
    check_discover_16(offset);
    check_jcb_16(offset);
    break;
  case 15:
    check_amex_15(offset);
    check_enroute_15(offset);
    check_jcb_15(offset);
    break;
  case 14:
    check_diners_club_cb_14(offset);
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<process_prefix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
sub    $0xe,%eax
je     120e <process_prefix+0x8e>
jmp    11a3 <process_prefix+0x23>
mov    -0x14(%rbp),%eax
sub    $0xf,%eax
je     11ee <process_prefix+0x6e>
jmp    11b4 <process_prefix+0x34>
mov    -0x14(%rbp),%eax
sub    $0x10,%eax
jne    1217 <process_prefix+0x97>
jmp    11c5 <process_prefix+0x45>
mov    -0x10(%rbp),%rdi
call   1060 <check_mastercard_16@plt>
mov    -0x10(%rbp),%rdi
call   1070 <check_visa_16@plt>
mov    -0x10(%rbp),%rdi
call   1040 <check_discover_16@plt>
mov    -0x10(%rbp),%rdi
call   1050 <check_jcb_16@plt>
jmp    1217 <process_prefix+0x97>
mov    -0x10(%rbp),%rdi
call   1030 <check_amex_15@plt>
mov    -0x10(%rbp),%rdi
call   1080 <check_enroute_15@plt>
mov    -0x10(%rbp),%rdi
call   10a0 <check_jcb_15@plt>
jmp    1217 <process_prefix+0x97>
mov    -0x10(%rbp),%rdi
call   1090 <check_diners_club_cb_14@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_prefix>:
push   %rbx
mov    %rsi,%rbx
cmp    $0xe,%edi
je     11b5 <process_prefix+0x35>
cmp    $0xf,%edi
je     11bf <process_prefix+0x3f>
cmp    $0x10,%edi
jne    11d7 <process_prefix+0x57>
mov    %rbx,%rdi
call   1060 <check_mastercard_16@plt>
mov    %rbx,%rdi
call   1070 <check_visa_16@plt>
mov    %rbx,%rdi
call   1040 <check_discover_16@plt>
mov    %rbx,%rdi
call   1050 <check_jcb_16@plt>
jmp    11d7 <process_prefix+0x57>
mov    %rbx,%rdi
call   1090 <check_diners_club_cb_14@plt>
jmp    11d7 <process_prefix+0x57>
mov    %rbx,%rdi
call   1030 <check_amex_15@plt>
mov    %rbx,%rdi
call   1080 <check_enroute_15@plt>
mov    %rbx,%rdi
call   10a0 <check_jcb_15@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @process_prefix(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* %3
switch i32 %5, label %25 [
i32 16, label %6
i32 15, label %15
i32 14, label %22
]
6: ; preds = %2
%7 = load i64, i64* %4
%8 = call i32 @check_mastercard_16(i64 %7)
%9 = load i64, i64* %4
%10 = call i32 @check_visa_16(i64 %9)
%11 = load i64, i64* %4
%12 = call i32 @check_discover_16(i64 %11)
%13 = load i64, i64* %4
%14 = call i32 @check_jcb_16(i64 %13)
br label %25
15: ; preds = %2
%16 = load i64, i64* %4
%17 = call i32 @check_amex_15(i64 %16)
%18 = load i64, i64* %4
%19 = call i32 @check_enroute_15(i64 %18)
%20 = load i64, i64* %4
%21 = call i32 @check_jcb_15(i64 %20)
br label %25
22: ; preds = %2
%23 = load i64, i64* %4
%24 = call i32 @check_diners_club_cb_14(i64 %23)
br label %25
25: ; preds = %2, %22, %15, %6
ret i32 0
}

LLVM IR (-O2):
define i32 @process_prefix(i32 %0, i64 %1) {
switch i32 %0, label %14 [
i32 16, label %3
i32 15, label %8
i32 14, label %12
]
3: ; preds = %2
%4 = tail call i32 @check_mastercard_16(i64 %1)
%5 = tail call i32 @check_visa_16(i64 %1)
%6 = tail call i32 @check_discover_16(i64 %1)
%7 = tail call i32 @check_jcb_16(i64 %1)
br label %14
8: ; preds = %2
%9 = tail call i32 @check_amex_15(i64 %1)
%10 = tail call i32 @check_enroute_15(i64 %1)
%11 = tail call i32 @check_jcb_15(i64 %1)
br label %14
12: ; preds = %2
%13 = tail call i32 @check_diners_club_cb_14(i64 %1)
br label %14
14: ; preds = %2, %12, %8, %3
ret i32 0
}