#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 EXIT_FAILURE;
int EXIT_SUCCESS;
int matchCharWithPattern(int pattern, int ch) {
  if ((ch == pattern) || (pattern == ':' && ch >= '0' && ch <= '9') ||
      (pattern == '^' && ch >= 'A' && ch <= 'Z') || (pattern == '.')) {
    return EXIT_SUCCESS;
  } else {
    return EXIT_FAILURE;
  }
}


x86 assembly (clang, -O0):
<matchCharWithPattern>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     115c <matchCharWithPattern+0x5c>
cmpl   $0x3a,-0x8(%rbp)
jne    1134 <matchCharWithPattern+0x34>
cmpl   $0x30,-0xc(%rbp)
jl     1134 <matchCharWithPattern+0x34>
cmpl   $0x39,-0xc(%rbp)
jle    115c <matchCharWithPattern+0x5c>
cmpl   $0x5e,-0x8(%rbp)
jne    1152 <matchCharWithPattern+0x52>
cmpl   $0x41,-0xc(%rbp)
jl     1152 <matchCharWithPattern+0x52>
cmpl   $0x5a,-0xc(%rbp)
jle    115c <matchCharWithPattern+0x5c>
cmpl   $0x2e,-0x8(%rbp)
jne    116d <matchCharWithPattern+0x6d>
mov    0x2e75(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1179 <matchCharWithPattern+0x79>
mov    0x2e6c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<matchCharWithPattern>:
mov    0x2ed1(%rip),%rax
cmp    %edi,%esi
je     1118 <matchCharWithPattern+0x18>
cmp    $0x3a,%edi
jne    111b <matchCharWithPattern+0x1b>
lea    -0x30(%rsi),%ecx
cmp    $0xa,%ecx
jae    111b <matchCharWithPattern+0x1b>
mov    (%rax),%eax
ret
add    $0xffffffbf,%esi
cmp    $0x1a,%esi
mov    0x2eb0(%rip),%rcx
mov    0x2eb1(%rip),%rdx
mov    %rdx,%rax
cmovb  %rcx,%rax
cmp    $0x5e,%edi
cmovne %rdx,%rax
cmp    $0x2e,%edi
cmove  %rcx,%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @matchCharWithPattern(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = load i32, i32* %4
%8 = icmp eq i32 %6, %7
br i1 %8, label %30, label %9
9: ; preds = %2
%10 = load i32, i32* %4
%11 = icmp eq i32 %10, 58
br i1 %11, label %12, label %18
12: ; preds = %9
%13 = load i32, i32* %5
%14 = icmp sge i32 %13, 48
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i32, i32* %5
%17 = icmp sle i32 %16, 57
br i1 %17, label %30, label %18
18: ; preds = %15, %12, %9
%19 = load i32, i32* %4
%20 = icmp eq i32 %19, 94
br i1 %20, label %21, label %27
21: ; preds = %18
%22 = load i32, i32* %5
%23 = icmp sge i32 %22, 65
br i1 %23, label %24, label %27
24: ; preds = %21
%25 = load i32, i32* %5
%26 = icmp sle i32 %25, 90
br i1 %26, label %30, label %27
27: ; preds = %24, %21, %18
%28 = load i32, i32* %4
%29 = icmp eq i32 %28, 46
br i1 %29, label %30, label %32
30: ; preds = %27, %24, %15, %2
%31 = load i32, i32* @EXIT_SUCCESS
store i32 %31, i32* %3
br label %34
32: ; preds = %27
%33 = load i32, i32* @EXIT_FAILURE
store i32 %33, i32* %3
br label %34
34: ; preds = %32, %30
%35 = load i32, i32* %3
ret i32 %35
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @matchCharWithPattern(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, %0
br i1 %3, label %17, label %4
4: ; preds = %2
%5 = icmp eq i32 %0, 58
%6 = add i32 %1, -48
%7 = icmp ult i32 %6, 10
%8 = and i1 %5, %7
br i1 %8, label %17, label %9
9: ; preds = %4
%10 = icmp eq i32 %0, 94
%11 = add i32 %1, -65
%12 = icmp ult i32 %11, 26
%13 = and i1 %10, %12
%14 = icmp eq i32 %0, 46
%15 = or i1 %14, %13
%16 = select i1 %15, i32* @EXIT_SUCCESS, i32* @EXIT_FAILURE
br label %17
17: ; preds = %9, %2, %4
%18 = phi i32* [ @EXIT_SUCCESS, %4 ], [ @EXIT_SUCCESS, %2 ], [ %16, %9 ]
%19 = load i32, i32* %18
ret i32 %19
}