#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 getchar();
scalar_t__ isalnum(int);
int /*<<< orphan*/ printf(char *, int, int, int);
int main(int argc, char **argv) {
  int cc = 0;
  do {
    cc = getchar();
    if (cc >= 0) {
      int print = isalnum(cc) || cc == ' ' || cc == '.' || cc == '-' ||
                  cc == '_' || cc == ':' || cc == ';';
      printf("%03d %02x %c\n", cc, cc, print ? cc : '?');
    }
  } while (cc >= 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     121e <main+0xee>
mov    -0x14(%rbp),%edi
call   1040 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x19(%rbp)
jne    11d0 <main+0xa0>
mov    $0x1,%al
cmpl   $0x20,-0x14(%rbp)
mov    %al,-0x19(%rbp)
je     11d0 <main+0xa0>
mov    $0x1,%al
cmpl   $0x2e,-0x14(%rbp)
mov    %al,-0x19(%rbp)
je     11d0 <main+0xa0>
mov    $0x1,%al
cmpl   $0x2d,-0x14(%rbp)
mov    %al,-0x19(%rbp)
je     11d0 <main+0xa0>
mov    $0x1,%al
cmpl   $0x5f,-0x14(%rbp)
mov    %al,-0x19(%rbp)
je     11d0 <main+0xa0>
mov    $0x1,%al
cmpl   $0x3a,-0x14(%rbp)
mov    %al,-0x19(%rbp)
je     11d0 <main+0xa0>
cmpl   $0x3b,-0x14(%rbp)
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     11fc <main+0xcc>
mov    -0x14(%rbp),%eax
mov    %eax,-0x28(%rbp)
jmp    1209 <main+0xd9>
mov    $0x3f,%eax
mov    %eax,-0x28(%rbp)
jmp    1209 <main+0xd9>
mov    -0x20(%rbp),%edx
mov    -0x24(%rbp),%esi
mov    -0x28(%rbp),%ecx
lea    0xde7(%rip),%rdi
call   1030 <printf@plt>
jmp    1223 <main+0xf3>
cmpl   $0x0,-0x14(%rbp)
jge    114d <main+0x1d>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
xor    %eax,%eax
call   1050 <getchar@plt>
test   %eax,%eax
js     119a <main+0x6a>
mov    %eax,%ebx
movabs $0x800000000c006001,%r15
lea    0xead(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
call   1040 <isalnum@plt>
test   %rax,%rax
jne    117f <main+0x4f>
mov    $0x3f,%ecx
lea    -0x20(%rbx),%eax
cmp    $0x3f,%eax
ja     1181 <main+0x51>
bt     %rax,%r15
jae    1181 <main+0x51>
mov    %ebx,%ecx
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1160 <main+0x30>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [14 x i8] c"%03d %02x %c\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
br label %8
8: ; preds = %48, %2
%9 = call i32 (...) @getchar()
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp sge i32 %10, 0
br i1 %11, label %12, label %47
12: ; preds = %8
%13 = load i32, i32* %6
%14 = call i64 @isalnum(i32 %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %34, label %16
16: ; preds = %12
%17 = load i32, i32* %6
%18 = icmp eq i32 %17, 32
br i1 %18, label %34, label %19
19: ; preds = %16
%20 = load i32, i32* %6
%21 = icmp eq i32 %20, 46
br i1 %21, label %34, label %22
22: ; preds = %19
%23 = load i32, i32* %6
%24 = icmp eq i32 %23, 45
br i1 %24, label %34, label %25
25: ; preds = %22
%26 = load i32, i32* %6
%27 = icmp eq i32 %26, 95
br i1 %27, label %34, label %28
28: ; preds = %25
%29 = load i32, i32* %6
%30 = icmp eq i32 %29, 58
br i1 %30, label %34, label %31
31: ; preds = %28
%32 = load i32, i32* %6
%33 = icmp eq i32 %32, 59
br label %34
34: ; preds = %31, %28, %25, %22, %19, %16, %12
%35 = phi i1 [ true, %28 ], [ true, %25 ], [ true, %22 ], [ true, %19 ], [ true, %16 ], [ true, %12 ], [ %33, %31 ]
%36 = zext i1 %35 to i32
store i32 %36, i32* %7
%37 = load i32, i32* %6
%38 = load i32, i32* %6
%39 = load i32, i32* %7
%40 = icmp ne i32 %39, 0
br i1 %40, label %41, label %43
41: ; preds = %34
%42 = load i32, i32* %6
br label %44
43: ; preds = %34
br label %44
44: ; preds = %43, %41
%45 = phi i32 [ %42, %41 ], [ 63, %43 ]
%46 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %37, i32 %38, i32 %45)
br label %47
47: ; preds = %44, %8
br label %48
48: ; preds = %47
%49 = load i32, i32* %6
%50 = icmp sge i32 %49, 0
br i1 %50, label %8, label %51
51: ; preds = %48
%52 = load i32, i32* %3
ret i32 %52
}

LLVM IR (-O2):
@.str = [14 x i8] c"%03d %02x %c\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getchar()
%4 = icmp sgt i32 %3, -1
br i1 %4, label %5, label %17
5: ; preds = %2, %12
%6 = phi i32 [ %15, %12 ], [ %3, %2 ]
%7 = tail call i64 @isalnum(i32 %6)
%8 = freeze i64 %7
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %5
switch i32 %6, label %12 [
i32 95, label %11
i32 58, label %11
i32 46, label %11
i32 45, label %11
i32 32, label %11
i32 59, label %11
]
11: ; preds = %10, %10, %10, %10, %10, %10, %5
br label %12
12: ; preds = %10, %11
%13 = phi i32 [ %6, %11 ], [ 63, %10 ]
%14 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %6, i32 %13)
%15 = tail call i32 (...) @getchar()
%16 = icmp sgt i32 %15, -1
br i1 %16, label %5, label %17
17: ; preds = %12, %2
ret i32 0
}