#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 char uint8_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int PrintDataToChar(uint8_t dat) {
  if ((dat >= '0' && dat <= '9') || (dat >= 'a' && dat <= 'z') ||
      (dat >= 'A' && dat <= 'Z'))
    printf("%c", dat);
  else
    printf(".");
  return 0;
}


x86 assembly (clang, -O0):
<PrintDataToChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x30,%eax
jl     1138 <PrintDataToChar+0x28>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
jle    116c <PrintDataToChar+0x5c>
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1152 <PrintDataToChar+0x42>
movsbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
jle    116c <PrintDataToChar+0x5c>
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1183 <PrintDataToChar+0x73>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
jg     1183 <PrintDataToChar+0x73>
movsbl -0x1(%rbp),%esi
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1191 <PrintDataToChar+0x81>
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintDataToChar>:
push   %rax
mov    %edi,%eax
and    $0xdf,%al
add    $0xbf,%al
cmp    $0x1a,%al
mov    $0x2e,%eax
cmovb  %edi,%eax
lea    -0x30(%rdi),%ecx
cmp    $0xa,%cl
cmovae %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [2 x i8] c".\00"
define i32 @PrintDataToChar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br i1 %9, label %26, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 97
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 122
br i1 %17, label %26, label %18
18: ; preds = %14, %10
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp sge i32 %20, 65
br i1 %21, label %22, label %30
22: ; preds = %18
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = icmp sle i32 %24, 90
br i1 %25, label %26, label %30
26: ; preds = %22, %14, %6
%27 = load i8, i8* %2
%28 = sext i8 %27 to i32
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %28)
br label %32
30: ; preds = %22, %18
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %32
32: ; preds = %30, %26
ret i32 0
}

LLVM IR (-O2):
define i32 @PrintDataToChar(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = and i8 %0, -33
%5 = add i8 %4, -65
%6 = icmp ult i8 %5, 26
%7 = or i1 %3, %6
%8 = sext i8 %0 to i32
%9 = select i1 %7, i32 %8, i32 46
%10 = tail call i32 @putchar(i32 %9)
ret i32 0
}