#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 EOF;
int getchar();
scalar_t__ isalnum(int);
scalar_t__ isideogram(int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int c;
  while ((c = getchar()) != EOF) {
    if (isideogram(c))
      printf("[%c] = ideogram\n", c);
    if (isalnum(c))
      printf("[%c] = alnum\n", c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e88(%rip),%rcx
cmp    (%rcx),%eax
je     11af <main+0x6f>
mov    -0x8(%rbp),%edi
call   1060 <isideogram@plt>
cmp    $0x0,%rax
je     1189 <main+0x49>
mov    -0x8(%rbp),%esi
lea    0xe7c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
call   1040 <isalnum@plt>
cmp    $0x0,%rax
je     11aa <main+0x6a>
mov    -0x8(%rbp),%esi
lea    0xe6c(%rip),%rdi
call   1030 <printf@plt>
jmp    114f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0x2e93(%rip),%rbx
cmp    (%rbx),%eax
jne    1166 <main+0x26>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %eax,%ebp
lea    0xea2(%rip),%r14
lea    0xe8a(%rip),%r15
jmp    118d <main+0x4d>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %eax,%ebp
cmp    (%rbx),%eax
je     1159 <main+0x19>
mov    %ebp,%edi
call   1060 <isideogram@plt>
test   %rax,%rax
je     11a3 <main+0x63>
mov    %r15,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
mov    %ebp,%edi
call   1040 <isalnum@plt>
test   %rax,%rax
je     1180 <main+0x40>
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
jmp    1180 <main+0x40>

LLVM IR (-O0):
@EOF = global i32 0
@.str = [17 x i8] c"[%c] = ideogram\0A\00"
@.str.1 = [14 x i8] c"[%c] = alnum\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %21, %0
%4 = call i32 (...) @getchar()
store i32 %4, i32* %2
%5 = load i32, i32* @EOF
%6 = icmp ne i32 %4, %5
br i1 %6, label %7, label %22
7: ; preds = %3
%8 = load i32, i32* %2
%9 = call i64 @isideogram(i32 %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i32, i32* %2
%13 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %11, %7
%15 = load i32, i32* %2
%16 = call i64 @isalnum(i32 %15)
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %14
%19 = load i32, i32* %2
%20 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %19)
br label %21
21: ; preds = %18, %14
br label %3
22: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@EOF = global i32 0
@.str = [17 x i8] c"[%c] = ideogram\0A\00"
@.str.1 = [14 x i8] c"[%c] = alnum\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %19, label %4
4: ; preds = %0, %15
%5 = phi i32 [ %16, %15 ], [ %1, %0 ]
%6 = tail call i64 @isideogram(i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %4
%9 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %10
10: ; preds = %8, %4
%11 = tail call i64 @isalnum(i32 %5)
%12 = icmp eq i64 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %10
%14 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %5)
br label %15
15: ; preds = %13, %10
%16 = tail call i32 (...) @getchar()
%17 = load i32, i32* @EOF
%18 = icmp eq i32 %16, %17
br i1 %18, label %19, label %4
19: ; preds = %15, %0
ret i32 0
}