#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 /*<<< orphan*/ printf(char *, ...);
scalar_t__ u_base_char(int);
scalar_t__ u_combining_char(int);
scalar_t__ u_digit(int);
scalar_t__ u_extender(int);
scalar_t__ u_ideographic(int);
int main(int argc, char **argv) {
  int i;
  for (i = -1; i != 32768; ++i) {
    printf("%#x is", i);
    if (u_base_char(i))
      printf(" base");
    if (u_ideographic(i))
      printf(" ideographic");
    if (u_combining_char(i))
      printf(" combining");
    if (u_extender(i))
      printf(" extender");
    if (u_digit(i))
      printf(" digit");
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
cmpl   $0x8000,-0x14(%rbp)
je     1257 <main+0xf7>
mov    -0x14(%rbp),%esi
lea    0xe6c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%edi
call   1080 <u_base_char@plt>
cmp    $0x0,%rax
je     11bb <main+0x5b>
lea    0xe53(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%edi
call   1030 <u_ideographic@plt>
cmp    $0x0,%rax
je     11db <main+0x7b>
lea    0xe39(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%edi
call   1060 <u_combining_char@plt>
cmp    $0x0,%rax
je     11fb <main+0x9b>
lea    0xe26(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%edi
call   1040 <u_extender@plt>
cmp    $0x0,%rax
je     121b <main+0xbb>
lea    0xe11(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%edi
call   1070 <u_digit@plt>
cmp    $0x0,%rax
je     123b <main+0xdb>
lea    0xdfb(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xdf4(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    117d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    $0xffffffff,%ebx
lea    0xe79(%rip),%r14
lea    0xe97(%rip),%r12
lea    0xe85(%rip),%r13
lea    0xe71(%rip),%rbp
lea    0xe64(%rip),%r15
jmp    11c9 <main+0x59>
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    $0x8000,%ebx
je     1250 <main+0xe0>
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %ebx,%edi
call   1090 <u_base_char@plt>
test   %rax,%rax
je     11eb <main+0x7b>
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %ebx,%edi
call   1040 <u_ideographic@plt>
test   %rax,%rax
je     1201 <main+0x91>
mov    %rbp,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %ebx,%edi
call   1070 <u_combining_char@plt>
test   %rax,%rax
je     1217 <main+0xa7>
mov    %r13,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %ebx,%edi
call   1050 <u_extender@plt>
test   %rax,%rax
je     122d <main+0xbd>
mov    %r12,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %ebx,%edi
call   1080 <u_digit@plt>
test   %rax,%rax
je     11b0 <main+0x40>
lea    0xdeb(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    11b0 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%#x is\00"
@.str.1 = [6 x i8] c" base\00"
@.str.2 = [13 x i8] c" ideographic\00"
@.str.3 = [11 x i8] c" combining\00"
@.str.4 = [10 x i8] c" extender\00"
@.str.5 = [7 x i8] c" digit\00"
@.str.6 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 -1, i32* %6
br label %7
7: ; preds = %44, %2
%8 = load i32, i32* %6
%9 = icmp ne i32 %8, 32768
br i1 %9, label %10, label %47
10: ; preds = %7
%11 = load i32, i32* %6
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i32, i32* %6
%14 = call i64 @u_base_char(i32 %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %10
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %16, %10
%19 = load i32, i32* %6
%20 = call i64 @u_ideographic(i32 %19)
%21 = icmp ne i64 %20, 0
br i1 %21, label %22, label %24
22: ; preds = %18
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
br label %24
24: ; preds = %22, %18
%25 = load i32, i32* %6
%26 = call i64 @u_combining_char(i32 %25)
%27 = icmp ne i64 %26, 0
br i1 %27, label %28, label %30
28: ; preds = %24
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
br label %30
30: ; preds = %28, %24
%31 = load i32, i32* %6
%32 = call i64 @u_extender(i32 %31)
%33 = icmp ne i64 %32, 0
br i1 %33, label %34, label %36
34: ; preds = %30
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
br label %36
36: ; preds = %34, %30
%37 = load i32, i32* %6
%38 = call i64 @u_digit(i32 %37)
%39 = icmp ne i64 %38, 0
br i1 %39, label %40, label %42
40: ; preds = %36
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
br label %42
42: ; preds = %40, %36
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %44
44: ; preds = %42
%45 = load i32, i32* %6
%46 = add nsw i32 %45, 1
store i32 %46, i32* %6
br label %7
47: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%#x is\00"
@.str.1 = [6 x i8] c" base\00"
@.str.2 = [13 x i8] c" ideographic\00"
@.str.3 = [11 x i8] c" combining\00"
@.str.4 = [10 x i8] c" extender\00"
@.str.5 = [7 x i8] c" digit\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %30
%4 = phi i32 [ -1, %2 ], [ %32, %30 ]
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = tail call i64 @u_base_char(i32 %4)
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %3
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %3
%11 = tail call i64 @u_ideographic(i32 %4)
%12 = icmp eq i64 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %10
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
br label %15
15: ; preds = %13, %10
%16 = tail call i64 @u_combining_char(i32 %4)
%17 = icmp eq i64 %16, 0
br i1 %17, label %20, label %18
18: ; preds = %15
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
br label %20
20: ; preds = %18, %15
%21 = tail call i64 @u_extender(i32 %4)
%22 = icmp eq i64 %21, 0
br i1 %22, label %25, label %23
23: ; preds = %20
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
br label %25
25: ; preds = %23, %20
%26 = tail call i64 @u_digit(i32 %4)
%27 = icmp eq i64 %26, 0
br i1 %27, label %30, label %28
28: ; preds = %25
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
br label %30
30: ; preds = %28, %25
%31 = tail call i32 @putchar(i32 10)
%32 = add nsw i32 %4, 1
%33 = icmp eq i32 %32, 32768
br i1 %33, label %34, label %3
34: ; preds = %30
ret i32 0
}