#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*/ isalnum(char);
int multiplier_for_end_of_match(char next_char, bool in_filename_part,
                                char after_match) {
  int mult = 0;
  switch (next_char) {
  case '/':
    mult += 3;
    break;
  case '_':
    mult += 2;
    break;
  default:
    if (!isalnum(next_char))
      mult += 1;
  }
  if (mult) {
    if (!isalnum(after_match))
      mult += 1;
    if (in_filename_part)
      mult += 5;
  }
  return mult;
}


x86 assembly (clang, -O0):
<multiplier_for_end_of_match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,-0x14(%rbp)
sub    $0x2f,%eax
je     1153 <multiplier_for_end_of_match+0x43>
jmp    1142 <multiplier_for_end_of_match+0x32>
mov    -0x14(%rbp),%eax
sub    $0x5f,%eax
je     1161 <multiplier_for_end_of_match+0x51>
jmp    116f <multiplier_for_end_of_match+0x5f>
mov    -0x10(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x10(%rbp)
jmp    118f <multiplier_for_end_of_match+0x7f>
mov    -0x10(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x10(%rbp)
jmp    118f <multiplier_for_end_of_match+0x7f>
movsbl -0x1(%rbp),%edi
call   1030 <isalnum@plt>
cmp    $0x0,%eax
jne    118a <multiplier_for_end_of_match+0x7a>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    118f <multiplier_for_end_of_match+0x7f>
cmpl   $0x0,-0x10(%rbp)
je     11cc <multiplier_for_end_of_match+0xbc>
movsbl -0x9(%rbp),%edi
call   1030 <isalnum@plt>
cmp    $0x0,%eax
jne    11b4 <multiplier_for_end_of_match+0xa4>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     11c7 <multiplier_for_end_of_match+0xb7>
mov    -0x10(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0x10(%rbp)
jmp    11cc <multiplier_for_end_of_match+0xbc>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<multiplier_for_end_of_match>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %esi,%r14d
cmp    $0x2f,%edi
je     112a <multiplier_for_end_of_match+0x1a>
cmp    $0x5f,%edi
jne    1131 <multiplier_for_end_of_match+0x21>
mov    $0x2,%ebx
jmp    1147 <multiplier_for_end_of_match+0x37>
mov    $0x3,%ebx
jmp    1147 <multiplier_for_end_of_match+0x37>
movsbl %dil,%edi
call   1030 <isalnum@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
jne    115f <multiplier_for_end_of_match+0x4f>
mov    $0x1,%ebx
movsbl %bpl,%edi
call   1030 <isalnum@plt>
cmp    $0x1,%eax
adc    $0x0,%ebx
lea    0x5(%rbx),%eax
test   %r14d,%r14d
cmove  %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @multiplier_for_end_of_match(i8 signext %0, i32 %1, i8 signext %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i8
%7 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i8 %2, i8* %6
store i32 0, i32* %7
%8 = load i8, i8* %4
%9 = sext i8 %8 to i32
switch i32 %9, label %16 [
i32 47, label %10
i32 95, label %13
]
10: ; preds = %3
%11 = load i32, i32* %7
%12 = add nsw i32 %11, 3
store i32 %12, i32* %7
br label %24
13: ; preds = %3
%14 = load i32, i32* %7
%15 = add nsw i32 %14, 2
store i32 %15, i32* %7
br label %24
16: ; preds = %3
%17 = load i8, i8* %4
%18 = call i32 @isalnum(i8 signext %17)
%19 = icmp ne i32 %18, 0
br i1 %19, label %23, label %20
20: ; preds = %16
%21 = load i32, i32* %7
%22 = add nsw i32 %21, 1
store i32 %22, i32* %7
br label %23
23: ; preds = %20, %16
br label %24
24: ; preds = %23, %13, %10
%25 = load i32, i32* %7
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %41
27: ; preds = %24
%28 = load i8, i8* %6
%29 = call i32 @isalnum(i8 signext %28)
%30 = icmp ne i32 %29, 0
br i1 %30, label %34, label %31
31: ; preds = %27
%32 = load i32, i32* %7
%33 = add nsw i32 %32, 1
store i32 %33, i32* %7
br label %34
34: ; preds = %31, %27
%35 = load i32, i32* %5
%36 = icmp ne i32 %35, 0
br i1 %36, label %37, label %40
37: ; preds = %34
%38 = load i32, i32* %7
%39 = add nsw i32 %38, 5
store i32 %39, i32* %7
br label %40
40: ; preds = %37, %34
br label %41
41: ; preds = %40, %24
%42 = load i32, i32* %7
ret i32 %42
}

LLVM IR (-O2):
define i32 @multiplier_for_end_of_match(i8 signext %0, i32 %1, i8 signext %2) {
%4 = sext i8 %0 to i32
switch i32 %4, label %6 [
i32 47, label %9
i32 95, label %5
]
5: ; preds = %3
br label %9
6: ; preds = %3
%7 = tail call i32 @isalnum(i8 signext %0)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %18
9: ; preds = %3, %5, %6
%10 = phi i32 [ 1, %6 ], [ 3, %3 ], [ 2, %5 ]
%11 = tail call i32 @isalnum(i8 signext %2)
%12 = icmp eq i32 %11, 0
%13 = zext i1 %12 to i32
%14 = add nuw nsw i32 %10, %13
%15 = icmp eq i32 %1, 0
%16 = add nuw nsw i32 %14, 5
%17 = select i1 %15, i32 %14, i32 %16
br label %18
18: ; preds = %9, %6
%19 = phi i32 [ 0, %6 ], [ %17, %9 ]
ret i32 %19
}