void describe_char(int c) {
  unsigned char cp = c, up = toupper(c), lo = tolower(c);
  if (!isprint(cp))
    cp = ' ';
  if (!isprint(up))
    up = ' ';
  if (!isprint(lo))
    lo = ' ';
  printf("chr#%-4d%2c%6s%6s%6s%6s%6s%6s%6s%6s%6s%6s%6s%4c%4c\n", c, cp,
         flag(isalnum(c)), flag(isalpha(c)), flag(iscntrl(c)), flag(isdigit(c)),
         flag(islower(c)), flag(isgraph(c)), flag(isprint(c)), flag(ispunct(c)),
         flag(isspace(c)), flag(isupper(c)), flag(isxdigit(c)), lo, up);
}


x86 assembly (clang, -O0):
<describe_char>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %edi,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    %al,-0x2d(%rbp)
mov    -0x2c(%rbp),%edi
call   1050 <toupper@plt>
mov    %al,-0x2e(%rbp)
mov    -0x2c(%rbp),%edi
call   10b0 <tolower@plt>
mov    %al,-0x2f(%rbp)
movzbl -0x2d(%rbp),%edi
call   10e0 <isprint@plt>
cmp    $0x0,%eax
jne    1236 <describe_char+0x46>
movb   $0x20,-0x2d(%rbp)
movzbl -0x2e(%rbp),%edi
call   10e0 <isprint@plt>
cmp    $0x0,%eax
jne    124c <describe_char+0x5c>
movb   $0x20,-0x2e(%rbp)
movzbl -0x2f(%rbp),%edi
call   10e0 <isprint@plt>
cmp    $0x0,%eax
jne    1262 <describe_char+0x72>
movb   $0x20,-0x2f(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x50(%rbp)
movzbl -0x2d(%rbp),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x2c(%rbp),%edi
call   1080 <isalnum@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1100 <flag@plt>
mov    %eax,-0x48(%rbp)
mov    -0x2c(%rbp),%edi
call   10c0 <isalpha@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1100 <flag@plt>
mov    %eax,-0x44(%rbp)
mov    -0x2c(%rbp),%edi
call   1060 <iscntrl@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1100 <flag@plt>
mov    %eax,-0x40(%rbp)
mov    -0x2c(%rbp),%edi
call   1030 <isdigit@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1100 <flag@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x2c(%rbp),%edi
call   1040 <islower@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1100 <flag@plt>
mov    %eax,-0x38(%rbp)
mov    -0x2c(%rbp),%edi
call   1110 <isgraph@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1100 <flag@plt>
mov    %eax,%r13d
mov    -0x2c(%rbp),%edi
call   10e0 <isprint@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1100 <flag@plt>
mov    %eax,%r12d
mov    -0x2c(%rbp),%edi
call   1090 <ispunct@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1100 <flag@plt>
mov    %eax,%r15d
mov    -0x2c(%rbp),%edi
call   10a0 <isspace@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1100 <flag@plt>
mov    %eax,%r14d
mov    -0x2c(%rbp),%edi
call   10d0 <isupper@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1100 <flag@plt>
mov    %eax,%ebx
mov    -0x2c(%rbp),%edi
call   10f0 <isxdigit@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1100 <flag@plt>
mov    -0x50(%rbp),%esi
mov    -0x4c(%rbp),%edx
mov    -0x48(%rbp),%ecx
mov    -0x44(%rbp),%r8d
mov    -0x40(%rbp),%r9d
mov    %eax,%r11d
mov    -0x3c(%rbp),%eax
movzbl -0x2f(%rbp),%r10d
movzbl -0x2e(%rbp),%edi
mov    %edi,-0x34(%rbp)
lea    0xc8f(%rip),%rdi
mov    %eax,(%rsp)
mov    -0x38(%rbp),%eax
mov    %eax,0x8(%rsp)
mov    -0x34(%rbp),%eax
mov    %r13d,0x10(%rsp)
mov    %r12d,0x18(%rsp)
mov    %r15d,0x20(%rsp)
mov    %r14d,0x28(%rsp)
mov    %ebx,0x30(%rsp)
mov    %r11d,0x38(%rsp)
mov    %r10d,0x40(%rsp)
mov    %eax,0x48(%rsp)
mov    $0x0,%al
call   1070 <printf@plt>
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<describe_char>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %edi,%ebx
call   1040 <toupper@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   10a0 <tolower@plt>
mov    %eax,%r12d
movzbl %bl,%r14d
mov    %r14d,%edi
call   10d0 <isprint@plt>
mov    %eax,%r13d
movzbl %bpl,%r15d
mov    %r15d,%edi
call   10d0 <isprint@plt>
mov    %eax,0x14(%rsp)
movzbl %r12b,%r12d
mov    %r12d,%edi
call   10d0 <isprint@plt>
mov    %eax,%ebp
test   %r13d,%r13d
mov    $0x20,%eax
cmove  %eax,%r14d
mov    %ebx,%edi
call   1070 <isalnum@plt>
mov    %eax,%edi
xor    %eax,%eax
call   10f0 <flag@plt>
mov    %eax,0x10(%rsp)
mov    %ebx,%edi
call   10b0 <isalpha@plt>
mov    %eax,%edi
xor    %eax,%eax
call   10f0 <flag@plt>
mov    %eax,0xc(%rsp)
mov    %ebx,%edi
call   1050 <iscntrl@plt>
mov    %eax,%edi
xor    %eax,%eax
call   10f0 <flag@plt>
mov    %eax,0x8(%rsp)
lea    -0x30(%rbx),%eax
xor    %edi,%edi
cmp    $0xa,%eax
setb   %dil
xor    %eax,%eax
call   10f0 <flag@plt>
mov    %rax,0x40(%rsp)
mov    %ebx,%edi
call   1030 <islower@plt>
mov    %eax,%edi
xor    %eax,%eax
call   10f0 <flag@plt>
mov    %rax,0x38(%rsp)
mov    %ebx,%edi
call   1100 <isgraph@plt>
mov    %eax,%edi
xor    %eax,%eax
call   10f0 <flag@plt>
mov    %rax,0x30(%rsp)
mov    %ebx,%edi
call   10d0 <isprint@plt>
mov    %eax,%edi
xor    %eax,%eax
call   10f0 <flag@plt>
mov    %rax,0x28(%rsp)
mov    %ebx,%edi
call   1080 <ispunct@plt>
mov    %eax,%edi
xor    %eax,%eax
call   10f0 <flag@plt>
mov    %rax,0x20(%rsp)
mov    %ebx,%edi
call   1090 <isspace@plt>
mov    %eax,%edi
xor    %eax,%eax
call   10f0 <flag@plt>
mov    %rax,0x18(%rsp)
mov    %ebx,%edi
call   10c0 <isupper@plt>
mov    %eax,%edi
xor    %eax,%eax
call   10f0 <flag@plt>
mov    %eax,%r13d
mov    %ebx,%edi
call   10e0 <isxdigit@plt>
mov    %eax,%edi
xor    %eax,%eax
call   10f0 <flag@plt>
test   %ebp,%ebp
mov    $0x20,%ecx
cmove  %ecx,%r12d
mov    %eax,%ebp
cmpl   $0x0,0x14(%rsp)
cmove  %ecx,%r15d
lea    0xcc9(%rip),%rdi
mov    %ebx,%esi
mov    %r14d,%edx
mov    0x10(%rsp),%ecx
mov    0xc(%rsp),%r8d
mov    0x8(%rsp),%r9d
xor    %eax,%eax
push   %r15
push   %r12
push   %rbp
push   %r13
push   0x38(%rsp)
push   0x48(%rsp)
push   0x58(%rsp)
push   0x68(%rsp)
push   0x78(%rsp)
push   0x88(%rsp)
call   1060 <printf@plt>
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [52 x i8] c"chr#%-4d%2c%6s%6s%6s%6s%6s%6s%6s%6s%6s%6s%6s%4c%4c\0A\00"
define void @describe_char(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = trunc i32 %6 to i8
store i8 %7, i8* %3
%8 = load i32, i32* %2
%9 = call i32 @toupper(i32 %8)
%10 = trunc i32 %9 to i8
store i8 %10, i8* %4
%11 = load i32, i32* %2
%12 = call i32 @tolower(i32 %11)
%13 = trunc i32 %12 to i8
store i8 %13, i8* %5
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = call i32 @isprint(i32 %15)
%17 = icmp ne i32 %16, 0
br i1 %17, label %19, label %18
18: ; preds = %1
store i8 32, i8* %3
br label %19
19: ; preds = %18, %1
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = call i32 @isprint(i32 %21)
%23 = icmp ne i32 %22, 0
br i1 %23, label %25, label %24
24: ; preds = %19
store i8 32, i8* %4
br label %25
25: ; preds = %24, %19
%26 = load i8, i8* %5
%27 = zext i8 %26 to i32
%28 = call i32 @isprint(i32 %27)
%29 = icmp ne i32 %28, 0
br i1 %29, label %31, label %30
30: ; preds = %25
store i8 32, i8* %5
br label %31
31: ; preds = %30, %25
%32 = load i32, i32* %2
%33 = load i8, i8* %3
%34 = zext i8 %33 to i32
%35 = load i32, i32* %2
%36 = call i32 @isalnum(i32 %35)
%37 = call i32 (i32, ...) bitcast (i32 (...)* @flag to i32 (i32, ...)*)(i32 %36)
%38 = load i32, i32* %2
%39 = call i32 @isalpha(i32 %38)
%40 = call i32 (i32, ...) bitcast (i32 (...)* @flag to i32 (i32, ...)*)(i32 %39)
%41 = load i32, i32* %2
%42 = call i32 @iscntrl(i32 %41)
%43 = call i32 (i32, ...) bitcast (i32 (...)* @flag to i32 (i32, ...)*)(i32 %42)
%44 = load i32, i32* %2
%45 = call i32 @isdigit(i32 %44)
%46 = call i32 (i32, ...) bitcast (i32 (...)* @flag to i32 (i32, ...)*)(i32 %45)
%47 = load i32, i32* %2
%48 = call i32 @islower(i32 %47)
%49 = call i32 (i32, ...) bitcast (i32 (...)* @flag to i32 (i32, ...)*)(i32 %48)
%50 = load i32, i32* %2
%51 = call i32 @isgraph(i32 %50)
%52 = call i32 (i32, ...) bitcast (i32 (...)* @flag to i32 (i32, ...)*)(i32 %51)
%53 = load i32, i32* %2
%54 = call i32 @isprint(i32 %53)
%55 = call i32 (i32, ...) bitcast (i32 (...)* @flag to i32 (i32, ...)*)(i32 %54)
%56 = load i32, i32* %2
%57 = call i32 @ispunct(i32 %56)
%58 = call i32 (i32, ...) bitcast (i32 (...)* @flag to i32 (i32, ...)*)(i32 %57)
%59 = load i32, i32* %2
%60 = call i32 @isspace(i32 %59)
%61 = call i32 (i32, ...) bitcast (i32 (...)* @flag to i32 (i32, ...)*)(i32 %60)
%62 = load i32, i32* %2
%63 = call i32 @isupper(i32 %62)
%64 = call i32 (i32, ...) bitcast (i32 (...)* @flag to i32 (i32, ...)*)(i32 %63)
%65 = load i32, i32* %2
%66 = call i32 @isxdigit(i32 %65)
%67 = call i32 (i32, ...) bitcast (i32 (...)* @flag to i32 (i32, ...)*)(i32 %66)
%68 = load i8, i8* %5
%69 = zext i8 %68 to i32
%70 = load i8, i8* %4
%71 = zext i8 %70 to i32
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %32, i32 %34, i32 %37, i32 %40, i32 %43, i32 %46, i32 %49, i32 %52, i32 %55, i32 %58, i32 %61, i32 %64, i32 %67, i32 %69, i32 %71)
ret void
}

LLVM IR (-O2):
@.str = [52 x i8] c"chr#%-4d%2c%6s%6s%6s%6s%6s%6s%6s%6s%6s%6s%6s%4c%4c\0A\00"
define void @describe_char(i32 %0) {
%2 = tail call i32 @toupper(i32 %0)
%3 = tail call i32 @tolower(i32 %0)
%4 = and i32 %0, 255
%5 = tail call i32 @isprint(i32 %4)
%6 = icmp eq i32 %5, 0
%7 = and i32 %2, 255
%8 = tail call i32 @isprint(i32 %7)
%9 = icmp eq i32 %8, 0
%10 = and i32 %3, 255
%11 = tail call i32 @isprint(i32 %10)
%12 = icmp eq i32 %11, 0
%13 = select i1 %6, i32 32, i32 %4
%14 = tail call i32 @isalnum(i32 %0)
%15 = tail call i32 (i32, ...) bitcast (i32 (...)* @flag to i32 (i32, ...)*)(i32 %14)
%16 = tail call i32 @isalpha(i32 %0)
%17 = tail call i32 (i32, ...) bitcast (i32 (...)* @flag to i32 (i32, ...)*)(i32 %16)
%18 = tail call i32 @iscntrl(i32 %0)
%19 = tail call i32 (i32, ...) bitcast (i32 (...)* @flag to i32 (i32, ...)*)(i32 %18)
%20 = add i32 %0, -48
%21 = icmp ult i32 %20, 10
%22 = zext i1 %21 to i32
%23 = tail call i32 (i32, ...) bitcast (i32 (...)* @flag to i32 (i32, ...)*)(i32 %22)
%24 = tail call i32 @islower(i32 %0)
%25 = tail call i32 (i32, ...) bitcast (i32 (...)* @flag to i32 (i32, ...)*)(i32 %24)
%26 = tail call i32 @isgraph(i32 %0)
%27 = tail call i32 (i32, ...) bitcast (i32 (...)* @flag to i32 (i32, ...)*)(i32 %26)
%28 = tail call i32 @isprint(i32 %0)
%29 = tail call i32 (i32, ...) bitcast (i32 (...)* @flag to i32 (i32, ...)*)(i32 %28)
%30 = tail call i32 @ispunct(i32 %0)
%31 = tail call i32 (i32, ...) bitcast (i32 (...)* @flag to i32 (i32, ...)*)(i32 %30)
%32 = tail call i32 @isspace(i32 %0)
%33 = tail call i32 (i32, ...) bitcast (i32 (...)* @flag to i32 (i32, ...)*)(i32 %32)
%34 = tail call i32 @isupper(i32 %0)
%35 = tail call i32 (i32, ...) bitcast (i32 (...)* @flag to i32 (i32, ...)*)(i32 %34)
%36 = tail call i32 @isxdigit(i32 %0)
%37 = tail call i32 (i32, ...) bitcast (i32 (...)* @flag to i32 (i32, ...)*)(i32 %36)
%38 = select i1 %12, i32 32, i32 %10
%39 = select i1 %9, i32 32, i32 %7
%40 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %13, i32 %15, i32 %17, i32 %19, i32 %23, i32 %25, i32 %27, i32 %29, i32 %31, i32 %33, i32 %35, i32 %37, i32 %38, i32 %39)
ret void
}