#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 /*<<< orphan*/ uint8_t;
typedef int int16_t;

/* Variables and functions */
unsigned int sub_AQW4(int);
unsigned int sub_AQf4(unsigned int, int);
int sub_AQlY(unsigned int);
uint8_t meld_integers(int16_t a1, int16_t a2) {
  int result = ((a2 ^ a1) - (a1 & a2)) >> 2;
  while (result > 'z') {
    unsigned int v3 = sub_AQW4(result);
    unsigned int v6 = sub_AQf4(v3, 0x3FCCCCCD);
    result = sub_AQlY(v6) & 0xFFFF;
  }
  while (result < '0')
    result += 13;
  if ((unsigned int)(result - '9' - 1) <= 6)
    result += 7;
  if ((unsigned int)(result - 'Z' - 1) <= 5)
    result = result - 11;
  return (uint8_t)result;
}


x86 assembly (clang, -O0):
<meld_integers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
and    -0x8(%rbp),%ecx
sub    %ecx,%eax
sar    $0x2,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x7a,-0xc(%rbp)
jle    118c <meld_integers+0x5c>
mov    -0xc(%rbp),%edi
call   1040 <sub_AQW4@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    $0x3fcccccd,%esi
call   1030 <sub_AQf4@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <sub_AQlY@plt>
and    $0xffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1152 <meld_integers+0x22>
jmp    1191 <meld_integers+0x61>
cmpl   $0x30,-0xc(%rbp)
jge    11a9 <meld_integers+0x79>
mov    -0xc(%rbp),%eax
add    $0xd,%eax
mov    %eax,-0xc(%rbp)
jmp    1191 <meld_integers+0x61>
mov    -0xc(%rbp),%eax
sub    $0x39,%eax
sub    $0x1,%eax
cmp    $0x6,%eax
ja     11c4 <meld_integers+0x94>
mov    -0xc(%rbp),%eax
add    $0x7,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x5a,%eax
sub    $0x1,%eax
cmp    $0x5,%eax
ja     11df <meld_integers+0xaf>
mov    -0xc(%rbp),%eax
sub    $0xb,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<meld_integers>:
push   %rax
mov    %esi,%eax
xor    %edi,%eax
and    %edi,%esi
sub    %esi,%eax
mov    %eax,%edi
sar    $0x2,%edi
cmp    $0x1ec,%eax
jl     1170 <meld_integers+0x40>
cs nopw 0x0(%rax,%rax,1)
nop
call   1040 <sub_AQW4@plt>
mov    %eax,%edi
mov    $0x3fcccccd,%esi
call   1030 <sub_AQf4@plt>
mov    %eax,%edi
call   1050 <sub_AQlY@plt>
movzwl %ax,%edi
cmp    $0x7a,%edi
ja     1150 <meld_integers+0x20>
cmp    $0x31,%edi
mov    $0x30,%eax
cmovge %edi,%eax
xor    %ecx,%ecx
sub    %edi,%eax
setne  %cl
sub    %ecx,%eax
imul   $0x4ec4ec4f,%rax,%rax
shr    $0x22,%rax
add    %ecx,%eax
lea    (%rax,%rax,2),%ecx
lea    (%rax,%rcx,4),%eax
lea    (%rdi,%rax,1),%ecx
lea    (%rdi,%rax,1),%edx
add    $0xffffffc6,%edx
cmp    $0x7,%edx
lea    0x7(%rdi,%rax,1),%edx
cmovae %ecx,%edx
lea    -0x5b(%rdx),%ecx
lea    -0xb(%rdx),%eax
cmp    $0x6,%ecx
cmovae %edx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @meld_integers(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = load i32, i32* %4
%9 = load i32, i32* %3
%10 = xor i32 %8, %9
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = and i32 %11, %12
%14 = sub nsw i32 %10, %13
%15 = ashr i32 %14, 2
store i32 %15, i32* %5
br label %16
16: ; preds = %19, %2
%17 = load i32, i32* %5
%18 = icmp sgt i32 %17, 122
br i1 %18, label %19, label %27
19: ; preds = %16
%20 = load i32, i32* %5
%21 = call i32 @sub_AQW4(i32 %20)
store i32 %21, i32* %6
%22 = load i32, i32* %6
%23 = call i32 @sub_AQf4(i32 %22, i32 1070386381)
store i32 %23, i32* %7
%24 = load i32, i32* %7
%25 = call i32 @sub_AQlY(i32 %24)
%26 = and i32 %25, 65535
store i32 %26, i32* %5
br label %16
27: ; preds = %16
br label %28
28: ; preds = %31, %27
%29 = load i32, i32* %5
%30 = icmp slt i32 %29, 48
br i1 %30, label %31, label %34
31: ; preds = %28
%32 = load i32, i32* %5
%33 = add nsw i32 %32, 13
store i32 %33, i32* %5
br label %28
34: ; preds = %28
%35 = load i32, i32* %5
%36 = sub nsw i32 %35, 57
%37 = sub nsw i32 %36, 1
%38 = icmp ule i32 %37, 6
br i1 %38, label %39, label %42
39: ; preds = %34
%40 = load i32, i32* %5
%41 = add nsw i32 %40, 7
store i32 %41, i32* %5
br label %42
42: ; preds = %39, %34
%43 = load i32, i32* %5
%44 = sub nsw i32 %43, 90
%45 = sub nsw i32 %44, 1
%46 = icmp ule i32 %45, 5
br i1 %46, label %47, label %50
47: ; preds = %42
%48 = load i32, i32* %5
%49 = sub nsw i32 %48, 11
store i32 %49, i32* %5
br label %50
50: ; preds = %47, %42
%51 = load i32, i32* %5
ret i32 %51
}

LLVM IR (-O2):
define i32 @meld_integers(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
%4 = and i32 %1, %0
%5 = sub nsw i32 %3, %4
%6 = ashr i32 %5, 2
%7 = icmp sgt i32 %5, 491
br i1 %7, label %27, label %8
8: ; preds = %27, %2
%9 = phi i32 [ %6, %2 ], [ %32, %27 ]
%10 = call i32 @llvm.smax.i32(i32 %9, i32 48)
%11 = sub nsw i32 %10, %9
%12 = icmp ne i32 %11, 0
%13 = zext i1 %12 to i32
%14 = sub nsw i32 %11, %13
%15 = udiv i32 %14, 13
%16 = add nuw nsw i32 %15, %13
%17 = mul i32 %16, 13
%18 = add i32 %9, %17
%19 = add nsw i32 %18, -58
%20 = icmp ult i32 %19, 7
%21 = add nuw nsw i32 %18, 7
%22 = select i1 %20, i32 %21, i32 %18
%23 = add nsw i32 %22, -91
%24 = icmp ult i32 %23, 6
%25 = add nsw i32 %22, -11
%26 = select i1 %24, i32 %25, i32 %22
ret i32 %26
27: ; preds = %2, %27
%28 = phi i32 [ %32, %27 ], [ %6, %2 ]
%29 = tail call i32 @sub_AQW4(i32 %28)
%30 = tail call i32 @sub_AQf4(i32 %29, i32 1070386381)
%31 = tail call i32 @sub_AQlY(i32 %30)
%32 = and i32 %31, 65535
%33 = icmp ugt i32 %32, 122
br i1 %33, label %27, label %8
}