#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 */
typedef int uint64_t;

/* Variables and functions */
uint64_t suffix2factor(char c) {
  switch (c) {
  case 'K':
    return 1024;
  case 'M':
    return 1048576;
  case 'G':
    return 1073741824;
  case 'T':
    return 1099511627776UL;
  case 's':
    return 1;
  case 'm':
    return 60;
  case 'h':
    return 3600;
  case 'd':
    return 86400;
  case 'w':
    return (7 * 86400);
  default:
    return 1;
  }
}


x86 assembly (clang, -O0):
<suffix2factor>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0xffffffb9,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x30,%eax
ja     11a0 <suffix2factor+0xa0>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x400,-0x4(%rbp)
jmp    11a7 <suffix2factor+0xa7>
movl   $0x100000,-0x4(%rbp)
jmp    11a7 <suffix2factor+0xa7>
movl   $0x40000000,-0x4(%rbp)
jmp    11a7 <suffix2factor+0xa7>
movl   $0x0,-0x4(%rbp)
jmp    11a7 <suffix2factor+0xa7>
movl   $0x1,-0x4(%rbp)
jmp    11a7 <suffix2factor+0xa7>
movl   $0x3c,-0x4(%rbp)
jmp    11a7 <suffix2factor+0xa7>
movl   $0xe10,-0x4(%rbp)
jmp    11a7 <suffix2factor+0xa7>
movl   $0x15180,-0x4(%rbp)
jmp    11a7 <suffix2factor+0xa7>
movl   $0x93a80,-0x4(%rbp)
jmp    11a7 <suffix2factor+0xa7>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<suffix2factor>:
add    $0xffffffb9,%edi
cmp    $0x30,%edi
ja     111d <suffix2factor+0x1d>
mov    $0x400,%eax
lea    0xeec(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x1,%eax
ret
mov    $0x40000000,%eax
ret
mov    $0x100000,%eax
ret
xor    %eax,%eax
ret
mov    $0x15180,%eax
ret
mov    $0xe10,%eax
ret
mov    $0x3c,%eax
ret
mov    $0x93a80,%eax
ret

LLVM IR (-O0):
define i32 @suffix2factor(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %15 [
i32 75, label %6
i32 77, label %7
i32 71, label %8
i32 84, label %9
i32 115, label %10
i32 109, label %11
i32 104, label %12
i32 100, label %13
i32 119, label %14
]
6: ; preds = %1
store i32 1024, i32* %2
br label %16
7: ; preds = %1
store i32 1048576, i32* %2
br label %16
8: ; preds = %1
store i32 1073741824, i32* %2
br label %16
9: ; preds = %1
store i32 0, i32* %2
br label %16
10: ; preds = %1
store i32 1, i32* %2
br label %16
11: ; preds = %1
store i32 60, i32* %2
br label %16
12: ; preds = %1
store i32 3600, i32* %2
br label %16
13: ; preds = %1
store i32 86400, i32* %2
br label %16
14: ; preds = %1
store i32 604800, i32* %2
br label %16
15: ; preds = %1
store i32 1, i32* %2
br label %16
16: ; preds = %15, %14, %13, %12, %11, %10, %9, %8, %7, %6
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @suffix2factor(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %11 [
i32 75, label %12
i32 77, label %3
i32 71, label %4
i32 84, label %5
i32 115, label %6
i32 109, label %7
i32 104, label %8
i32 100, label %9
i32 119, label %10
]
3: ; preds = %1
br label %12
4: ; preds = %1
br label %12
5: ; preds = %1
br label %12
6: ; preds = %1
br label %12
7: ; preds = %1
br label %12
8: ; preds = %1
br label %12
9: ; preds = %1
br label %12
10: ; preds = %1
br label %12
11: ; preds = %1
br label %12
12: ; preds = %1, %11, %10, %9, %8, %7, %6, %5, %4, %3
%13 = phi i32 [ 1, %11 ], [ 604800, %10 ], [ 86400, %9 ], [ 3600, %8 ], [ 60, %7 ], [ 1, %6 ], [ 0, %5 ], [ 1073741824, %4 ], [ 1048576, %3 ], [ 1024, %1 ]
ret i32 %13
}