#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 off_t;

/* Variables and functions */
off_t adjust_suffix(off_t n, char suffix) {
  switch (suffix) {
  case 'K':
    return n << 10;
  case 'M':
    return n << 20;
  case 'G':
    return n << 30;
  case 'T':
    return n << 40;
  case 'P':
    return n << 50;
  case 'E':
    return n << 60;
  default:
    return n;
  }
}


x86 assembly (clang, -O0):
<adjust_suffix>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
add    $0xffffffbb,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0xf,%eax
ja     1197 <adjust_suffix+0x97>
mov    -0x18(%rbp),%rax
lea    0xed2(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x8(%rbp),%eax
shl    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    119d <adjust_suffix+0x9d>
mov    -0x8(%rbp),%eax
shl    $0x14,%eax
mov    %eax,-0x4(%rbp)
jmp    119d <adjust_suffix+0x9d>
mov    -0x8(%rbp),%eax
shl    $0x1e,%eax
mov    %eax,-0x4(%rbp)
jmp    119d <adjust_suffix+0x9d>
mov    -0x8(%rbp),%eax
mov    $0x28,%ecx
shl    %cl,%eax
mov    %eax,-0x4(%rbp)
jmp    119d <adjust_suffix+0x9d>
mov    -0x8(%rbp),%eax
mov    $0x32,%ecx
shl    %cl,%eax
mov    %eax,-0x4(%rbp)
jmp    119d <adjust_suffix+0x9d>
mov    -0x8(%rbp),%eax
mov    $0x3c,%ecx
shl    %cl,%eax
mov    %eax,-0x4(%rbp)
jmp    119d <adjust_suffix+0x9d>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adjust_suffix>:
mov    %edi,%eax
cmp    $0x47,%esi
je     1115 <adjust_suffix+0x15>
cmp    $0x4d,%esi
je     1119 <adjust_suffix+0x19>
cmp    $0x4b,%esi
jne    1118 <adjust_suffix+0x18>
shl    $0xa,%eax
ret
shl    $0x1e,%eax
ret
shl    $0x14,%eax
ret

LLVM IR (-O0):
define i32 @adjust_suffix(i32 %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
store i32 %0, i32* %4
store i8 %1, i8* %5
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
switch i32 %7, label %26 [
i32 75, label %8
i32 77, label %11
i32 71, label %14
i32 84, label %17
i32 80, label %20
i32 69, label %23
]
8: ; preds = %2
%9 = load i32, i32* %4
%10 = shl i32 %9, 10
store i32 %10, i32* %3
br label %28
11: ; preds = %2
%12 = load i32, i32* %4
%13 = shl i32 %12, 20
store i32 %13, i32* %3
br label %28
14: ; preds = %2
%15 = load i32, i32* %4
%16 = shl i32 %15, 30
store i32 %16, i32* %3
br label %28
17: ; preds = %2
%18 = load i32, i32* %4
%19 = shl i32 %18, 40
store i32 %19, i32* %3
br label %28
20: ; preds = %2
%21 = load i32, i32* %4
%22 = shl i32 %21, 50
store i32 %22, i32* %3
br label %28
23: ; preds = %2
%24 = load i32, i32* %4
%25 = shl i32 %24, 60
store i32 %25, i32* %3
br label %28
26: ; preds = %2
%27 = load i32, i32* %4
store i32 %27, i32* %3
br label %28
28: ; preds = %26, %23, %20, %17, %14, %11, %8
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
define i32 @adjust_suffix(i32 %0, i8 signext %1) {
%3 = sext i8 %1 to i32
switch i32 %3, label %10 [
i32 75, label %4
i32 77, label %6
i32 71, label %8
]
4: ; preds = %2
%5 = shl i32 %0, 10
br label %10
6: ; preds = %2
%7 = shl i32 %0, 20
br label %10
8: ; preds = %2
%9 = shl i32 %0, 30
br label %10
10: ; preds = %2, %8, %6, %4
%11 = phi i32 [ %9, %8 ], [ %7, %6 ], [ %5, %4 ], [ %0, %2 ]
ret i32 %11
}