#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 */
scalar_t__ isalpha(unsigned char);
scalar_t__ isdigit(unsigned char);
int get_standard_integer_type(const char *l, const char **t) {
  int type;
  if (isalpha((unsigned char)l[1])) {
    switch (l[1]) {
    case 'C':
      type = 1;
      break;
    case 'S':
      type = 2;
      break;
    case 'I':
    case 'L':
      type = 4;
      break;
    case 'Q':
      type = 24;
      break;
    default:
      return 0;
    }
    l += 2;
  } else if (isdigit((unsigned char)l[1])) {
    if (isdigit((unsigned char)l[2])) {
      return 0;
    }
    switch (l[1]) {
    case '1':
      type = 1;
      break;
    case '2':
      type = 2;
      break;
    case '4':
      type = 4;
      break;
    case '8':
      type = 24;
      break;
    default:
      return 0;
    }
    l += 2;
  } else {
    type = 4;
    ++l;
  }
  if (t)
    *t = l;
  return type;
}


x86 assembly (clang, -O0):
<get_standard_integer_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movzbl 0x1(%rax),%edi
call   1040 <isalpha@plt>
cmp    $0x0,%rax
je     11c2 <get_standard_integer_type+0xa2>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
add    $0xffffffbd,%eax
mov    %eax,%ecx
mov    %rcx,-0x28(%rbp)
sub    $0x10,%eax
ja     11a5 <get_standard_integer_type+0x85>
mov    -0x28(%rbp),%rax
lea    0xeb4(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x1c(%rbp)
jmp    11b1 <get_standard_integer_type+0x91>
movl   $0x2,-0x1c(%rbp)
jmp    11b1 <get_standard_integer_type+0x91>
movl   $0x4,-0x1c(%rbp)
jmp    11b1 <get_standard_integer_type+0x91>
movl   $0x18,-0x1c(%rbp)
jmp    11b1 <get_standard_integer_type+0x91>
movl   $0x0,-0x4(%rbp)
jmp    12ab <get_standard_integer_type+0x18b>
mov    -0x10(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x10(%rbp)
jmp    128f <get_standard_integer_type+0x16f>
mov    -0x10(%rbp),%rax
movzbl 0x1(%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     1277 <get_standard_integer_type+0x157>
mov    -0x10(%rbp),%rax
movzbl 0x2(%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     11fc <get_standard_integer_type+0xdc>
movl   $0x0,-0x4(%rbp)
jmp    12ab <get_standard_integer_type+0x18b>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
add    $0xffffffcf,%eax
mov    %eax,%ecx
mov    %rcx,-0x30(%rbp)
sub    $0x7,%eax
ja     125a <get_standard_integer_type+0x13a>
mov    -0x30(%rbp),%rax
lea    0xddf(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x1c(%rbp)
jmp    1266 <get_standard_integer_type+0x146>
movl   $0x2,-0x1c(%rbp)
jmp    1266 <get_standard_integer_type+0x146>
movl   $0x4,-0x1c(%rbp)
jmp    1266 <get_standard_integer_type+0x146>
movl   $0x18,-0x1c(%rbp)
jmp    1266 <get_standard_integer_type+0x146>
movl   $0x0,-0x4(%rbp)
jmp    12ab <get_standard_integer_type+0x18b>
mov    -0x10(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x10(%rbp)
jmp    128a <get_standard_integer_type+0x16a>
movl   $0x4,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    128f <get_standard_integer_type+0x16f>
cmpq   $0x0,-0x18(%rbp)
je     12a5 <get_standard_integer_type+0x185>
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_standard_integer_type>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
movzbl 0x1(%rdi),%edi
call   1040 <isalpha@plt>
movsbl 0x1(%rbx),%edx
test   %rax,%rax
je     1167 <get_standard_integer_type+0x47>
xor    %eax,%eax
add    $0xffffffbd,%edx
cmp    $0x10,%edx
ja     11db <get_standard_integer_type+0xbb>
mov    $0x1,%ecx
lea    0xea9(%rip),%rsi
movslq (%rsi,%rdx,4),%rdx
add    %rsi,%rdx
jmp    *%rdx
mov    $0x4,%ecx
jmp    11cd <get_standard_integer_type+0xad>
lea    0x1(%rbx),%r15
movzbl %dl,%edi
call   1030 <isdigit@plt>
mov    $0x4,%ecx
test   %rax,%rax
je     11bc <get_standard_integer_type+0x9c>
movzbl 0x2(%rbx),%edi
call   1030 <isdigit@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
jne    11db <get_standard_integer_type+0xbb>
movsbl (%r15),%edx
add    $0xffffffcf,%edx
cmp    $0x7,%edx
ja     11db <get_standard_integer_type+0xbb>
add    $0x2,%rbx
mov    $0x1,%ecx
lea    0xe98(%rip),%rsi
movslq (%rsi,%rdx,4),%rdx
add    %rsi,%rdx
jmp    *%rdx
mov    $0x2,%ecx
jmp    11d1 <get_standard_integer_type+0xb1>
mov    %r15,%rbx
jmp    11d1 <get_standard_integer_type+0xb1>
mov    $0x18,%ecx
jmp    11cd <get_standard_integer_type+0xad>
mov    $0x2,%ecx
add    $0x2,%rbx
test   %r14,%r14
je     11d9 <get_standard_integer_type+0xb9>
mov    %rbx,(%r14)
mov    %ecx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret
mov    $0x4,%ecx
jmp    11d1 <get_standard_integer_type+0xb1>
mov    $0x18,%ecx
jmp    11d1 <get_standard_integer_type+0xb1>

LLVM IR (-O0):
define i32 @get_standard_integer_type(i8* %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i32
store i8* %0, i8** %4
store i8** %1, i8*** %5
%7 = load i8*, i8** %4
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = call i64 @isalpha(i8 zeroext %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %25
12: ; preds = %2
%13 = load i8*, i8** %4
%14 = getelementptr inbounds i8, i8* %13, i64 1
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
switch i32 %16, label %21 [
i32 67, label %17
i32 83, label %18
i32 73, label %19
i32 76, label %19
i32 81, label %20
]
17: ; preds = %12
store i32 1, i32* %6
br label %22
18: ; preds = %12
store i32 2, i32* %6
br label %22
19: ; preds = %12, %12
store i32 4, i32* %6
br label %22
20: ; preds = %12
store i32 24, i32* %6
br label %22
21: ; preds = %12
store i32 0, i32* %3
br label %63
22: ; preds = %20, %19, %18, %17
%23 = load i8*, i8** %4
%24 = getelementptr inbounds i8, i8* %23, i64 2
store i8* %24, i8** %4
br label %55
25: ; preds = %2
%26 = load i8*, i8** %4
%27 = getelementptr inbounds i8, i8* %26, i64 1
%28 = load i8, i8* %27
%29 = call i64 @isdigit(i8 zeroext %28)
%30 = icmp ne i64 %29, 0
br i1 %30, label %31, label %51
31: ; preds = %25
%32 = load i8*, i8** %4
%33 = getelementptr inbounds i8, i8* %32, i64 2
%34 = load i8, i8* %33
%35 = call i64 @isdigit(i8 zeroext %34)
%36 = icmp ne i64 %35, 0
br i1 %36, label %37, label %38
37: ; preds = %31
store i32 0, i32* %3
br label %63
38: ; preds = %31
%39 = load i8*, i8** %4
%40 = getelementptr inbounds i8, i8* %39, i64 1
%41 = load i8, i8* %40
%42 = sext i8 %41 to i32
switch i32 %42, label %47 [
i32 49, label %43
i32 50, label %44
i32 52, label %45
i32 56, label %46
]
43: ; preds = %38
store i32 1, i32* %6
br label %48
44: ; preds = %38
store i32 2, i32* %6
br label %48
45: ; preds = %38
store i32 4, i32* %6
br label %48
46: ; preds = %38
store i32 24, i32* %6
br label %48
47: ; preds = %38
store i32 0, i32* %3
br label %63
48: ; preds = %46, %45, %44, %43
%49 = load i8*, i8** %4
%50 = getelementptr inbounds i8, i8* %49, i64 2
store i8* %50, i8** %4
br label %54
51: ; preds = %25
store i32 4, i32* %6
%52 = load i8*, i8** %4
%53 = getelementptr inbounds i8, i8* %52, i32 1
store i8* %53, i8** %4
br label %54
54: ; preds = %51, %48
br label %55
55: ; preds = %54, %22
%56 = load i8**, i8*** %5
%57 = icmp ne i8** %56, null
br i1 %57, label %58, label %61
58: ; preds = %55
%59 = load i8*, i8** %4
%60 = load i8**, i8*** %5
store i8* %59, i8** %60
br label %61
61: ; preds = %58, %55
%62 = load i32, i32* %6
store i32 %62, i32* %3
br label %63
63: ; preds = %61, %47, %37, %21
%64 = load i32, i32* %3
ret i32 %64
}

LLVM IR (-O2):
define i32 @get_standard_integer_type(i8* %0, i8** writeonly %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = load i8, i8* %3
%5 = tail call i64 @isalpha(i8 zeroext %4)
%6 = icmp eq i64 %5, 0
%7 = load i8, i8* %3
br i1 %6, label %16, label %8
8: ; preds = %2
%9 = sext i8 %7 to i32
switch i32 %9, label %35 [
i32 67, label %13
i32 83, label %10
i32 73, label %11
i32 76, label %11
i32 81, label %12
]
10: ; preds = %8
br label %13
11: ; preds = %8, %8
br label %13
12: ; preds = %8
br label %13
13: ; preds = %8, %12, %11, %10
%14 = phi i32 [ 24, %12 ], [ 4, %11 ], [ 2, %10 ], [ 1, %8 ]
%15 = getelementptr inbounds i8, i8* %0, i64 2
br label %30
16: ; preds = %2
%17 = tail call i64 @isdigit(i8 zeroext %7)
%18 = icmp eq i64 %17, 0
br i1 %18, label %30, label %19
19: ; preds = %16
%20 = getelementptr inbounds i8, i8* %0, i64 2
%21 = load i8, i8* %20
%22 = tail call i64 @isdigit(i8 zeroext %21)
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %35
24: ; preds = %19
%25 = load i8, i8* %3
%26 = sext i8 %25 to i32
switch i32 %26, label %35 [
i32 49, label %30
i32 50, label %27
i32 52, label %28
i32 56, label %29
]
27: ; preds = %24
br label %30
28: ; preds = %24
br label %30
29: ; preds = %24
br label %30
30: ; preds = %16, %27, %28, %29, %24, %13
%31 = phi i8* [ %15, %13 ], [ %20, %24 ], [ %20, %29 ], [ %20, %28 ], [ %20, %27 ], [ %3, %16 ]
%32 = phi i32 [ %14, %13 ], [ 1, %24 ], [ 24, %29 ], [ 4, %28 ], [ 2, %27 ], [ 4, %16 ]
%33 = icmp eq i8** %1, null
br i1 %33, label %35, label %34
34: ; preds = %30
store i8* %31, i8** %1
br label %35
35: ; preds = %30, %34, %24, %19, %8
%36 = phi i32 [ 0, %8 ], [ 0, %19 ], [ 0, %24 ], [ %32, %34 ], [ %32, %30 ]
ret i32 %36
}