#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 int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ strcpy(char *, int /*<<< orphan*/);
int strlen(char *);
int /*<<< orphan*/ ucs_symbol(unsigned int);
int /*<<< orphan*/ ucs_symbol_range(unsigned int, unsigned int);
void output_charclass(FILE *stream, const char *classname,
                      bool (*func)(unsigned int)) {
  char table[0x110000];
  unsigned int i;
  bool need_semicolon;
  const int max_column = 75;
  int column;
  for (i = 0; i < 0x110000; i++)
    table[i] = (int)func(i);
  fprintf(stream, "%s ", classname);
  need_semicolon = false;
  column = 1000;
  for (i = 0; i < 0x110000;) {
    if (!table[i])
      i++;
    else {
      unsigned int low, high;
      char buf[25];
      low = i;
      do
        i++;
      while (i < 0x110000 && table[i]);
      high = i - 1;
      if (low == high)
        strcpy(buf, ucs_symbol(low));
      else
        strcpy(buf, ucs_symbol_range(low, high));
      if (need_semicolon) {
        fprintf(stream, ";");
        column++;
      }
      if (column + strlen(buf) > max_column) {
        fprintf(stream, "/\n   ");
        column = 3;
      }
      fprintf(stream, "%s", buf);
      column += strlen(buf);
      need_semicolon = true;
    }
  }
  fprintf(stream, "\n");
}


x86 assembly (clang, -O0):
<output_charclass>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110080,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x4b,-0x11002c(%rbp)
movl   $0x0,-0x110024(%rbp)
cmpl   $0x110000,-0x110024(%rbp)
jae    11ba <output_charclass+0x6a>
mov    -0x18(%rbp),%rax
mov    -0x110024(%rbp),%edi
call   *%rax
mov    %al,%cl
mov    -0x110024(%rbp),%eax
mov    %cl,-0x110020(%rbp,%rax,1)
mov    -0x110024(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x110024(%rbp)
jmp    117b <output_charclass+0x2b>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe37(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x0,-0x110028(%rbp)
movl   $0x3e8,-0x110030(%rbp)
movl   $0x0,-0x110024(%rbp)
cmpl   $0x110000,-0x110024(%rbp)
jae    13b0 <output_charclass+0x260>
mov    -0x110024(%rbp),%eax
cmpb   $0x0,-0x110020(%rbp,%rax,1)
jne    1226 <output_charclass+0xd6>
mov    -0x110024(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x110024(%rbp)
jmp    13ab <output_charclass+0x25b>
mov    -0x110024(%rbp),%eax
mov    %eax,-0x110034(%rbp)
mov    -0x110024(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x110024(%rbp)
xor    %eax,%eax
cmpl   $0x110000,-0x110024(%rbp)
mov    %al,-0x110061(%rbp)
jae    1273 <output_charclass+0x123>
mov    -0x110024(%rbp),%eax
movsbl -0x110020(%rbp,%rax,1),%eax
ff
cmp    $0x0,%eax
setne  %al
mov    %al,-0x110061(%rbp)
mov    -0x110061(%rbp),%al
test   $0x1,%al
jne    1232 <output_charclass+0xe2>
mov    -0x110024(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x110038(%rbp)
mov    -0x110034(%rbp),%eax
cmp    -0x110038(%rbp),%eax
jne    12ce <output_charclass+0x17e>
lea    -0x110060(%rbp),%rax
mov    %rax,-0x110070(%rbp)
mov    -0x110034(%rbp),%edi
call   1040 <ucs_symbol@plt>
mov    -0x110070(%rbp),%rdi
mov    %eax,%esi
call   1030 <strcpy@plt>
jmp    12fb <output_charclass+0x1ab>
lea    -0x110060(%rbp),%rax
mov    %rax,-0x110078(%rbp)
mov    -0x110034(%rbp),%edi
mov    -0x110038(%rbp),%esi
call   1050 <ucs_symbol_range@plt>
mov    -0x110078(%rbp),%rdi
mov    %eax,%esi
call   1030 <strcpy@plt>
cmpl   $0x0,-0x110028(%rbp)
je     1329 <output_charclass+0x1d9>
mov    -0x8(%rbp),%rdi
lea    0xcf1(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x110030(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x110030(%rbp)
mov    -0x110030(%rbp),%eax
mov    %eax,-0x11007c(%rbp)
lea    -0x110060(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,%ecx
mov    -0x11007c(%rbp),%eax
add    %ecx,%eax
cmp    $0x4b,%eax
jle    1370 <output_charclass+0x220>
mov    -0x8(%rbp),%rdi
lea    0xca7(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x3,-0x110030(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x110060(%rbp),%rdx
lea    0xc8a(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
lea    -0x110060(%rbp),%rdi
call   1060 <strlen@plt>
add    -0x110030(%rbp),%eax
mov    %eax,-0x110030(%rbp)
movl   $0x1,-0x110028(%rbp)
jmp    11ee <output_charclass+0x9e>
mov    -0x8(%rbp),%rdi
lea    0xc54(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
add    $0x110080,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_charclass>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x110028,%rsp
mov    %rdx,%r12
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    %ebx,%edi
call   *%r12
mov    %al,0x20(%rsp,%rbx,1)
add    $0x1,%rbx
cmp    $0x110000,%rbx
jne    11a0 <output_charclass+0x20>
lea    0xe43(%rip),%rsi
xor    %ebx,%ebx
mov    %r14,%rdi
mov    %r15,%rdx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    $0x3e8,%ebp
mov    %rsp,%r12
lea    0xe29(%rip),%r15
xor    %r13d,%r13d
jmp    1207 <output_charclass+0x87>
mov    %r12,%rdi
mov    %r14,%rsi
call   1070 <fputs@plt>
mov    %r12,%rdi
call   1060 <strlen@plt>
add    %eax,%ebp
mov    $0x1,%r13d
cmp    $0x110000,%ebx
jae    12c6 <output_charclass+0x146>
mov    %ebx,%edi
cmpb   $0x0,0x20(%rsp,%rdi,1)
je     1260 <output_charclass+0xe0>
cmp    $0x110000,%edi
mov    $0x10ffff,%esi
cmovae %edi,%esi
lea    0x1(%rsi),%ebx
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmp    $0x10fffe,%rcx
ja     124c <output_charclass+0xcc>
lea    0x1(%rcx),%rax
cmpb   $0x0,0x21(%rsp,%rcx,1)
mov    %rax,%rcx
jne    1230 <output_charclass+0xb0>
lea    -0x1(%rax),%esi
mov    %eax,%ebx
cmp    %esi,%edi
jne    1270 <output_charclass+0xf0>
call   1040 <ucs_symbol@plt>
jmp    1275 <output_charclass+0xf5>
nopw   0x0(%rax,%rax,1)
add    $0x1,%edi
mov    %edi,%ebx
cmp    $0x110000,%ebx
jb     1207 <output_charclass+0x87>
jmp    12c6 <output_charclass+0x146>
nop
call   1050 <ucs_symbol_range@plt>
mov    %eax,%esi
mov    %r12,%rdi
call   1030 <strcpy@plt>
test   %r13d,%r13d
je     1294 <output_charclass+0x114>
mov    $0x3b,%edi
mov    %r14,%rsi
call   1080 <fputc@plt>
add    $0x1,%ebp
mov    %r12,%rdi
call   1060 <strlen@plt>
add    %ebp,%eax
cmp    $0x4c,%eax
jl     11e0 <output_charclass+0x60>
mov    $0x5,%esi
mov    $0x1,%edx
mov    %r15,%rdi
mov    %r14,%rcx
call   10a0 <fwrite@plt>
mov    $0x3,%ebp
jmp    11e0 <output_charclass+0x60>
mov    $0xa,%edi
mov    %r14,%rsi
call   1080 <fputc@plt>
add    $0x110028,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s \00"
@.str.1 = [2 x i8] c";\00"
@.str.2 = [6 x i8] c"/\0A \00"
@.str.3 = [3 x i8] c"%s\00"
@.str.4 = [2 x i8] c"\0A\00"
define void @output_charclass(i32* %0, i8* %1, i32 (i32)* %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32 (i32)*
%7 = alloca [1114112 x i8]
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca [25 x i8]
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 (i32)* %2, i32 (i32)** %6
store i32 75, i32* %10
store i32 0, i32* %8
br label %15
15: ; preds = %26, %3
%16 = load i32, i32* %8
%17 = icmp ult i32 %16, 1114112
br i1 %17, label %18, label %29
18: ; preds = %15
%19 = load i32 (i32)*, i32 (i32)** %6
%20 = load i32, i32* %8
%21 = call i32 %19(i32 %20)
%22 = trunc i32 %21 to i8
%23 = load i32, i32* %8
%24 = zext i32 %23 to i64
%25 = getelementptr inbounds [1114112 x i8], [1114112 x i8]* %7, i64 0, i64 %24
store i8 %22, i8* %25
br label %26
26: ; preds = %18
%27 = load i32, i32* %8
%28 = add i32 %27, 1
store i32 %28, i32* %8
br label %15
29: ; preds = %15
%30 = load i32*, i32** %4
%31 = load i8*, i8** %5
%32 = call i32 (i32*, i8*, ...) @fprintf(i32* %30, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %31)
store i32 0, i32* %9
store i32 1000, i32* %11
store i32 0, i32* %8
br label %33
33: ; preds = %104, %29
%34 = load i32, i32* %8
%35 = icmp ult i32 %34, 1114112
br i1 %35, label %36, label %105
36: ; preds = %33
%37 = load i32, i32* %8
%38 = zext i32 %37 to i64
%39 = getelementptr inbounds [1114112 x i8], [1114112 x i8]* %7, i64 0, i64 %38
%40 = load i8, i8* %39
%41 = icmp ne i8 %40, 0
br i1 %41, label %45, label %42
42: ; preds = %36
%43 = load i32, i32* %8
%44 = add i32 %43, 1
store i32 %44, i32* %8
br label %104
45: ; preds = %36
%46 = load i32, i32* %8
store i32 %46, i32* %12
br label %47
47: ; preds = %60, %45
%48 = load i32, i32* %8
%49 = add i32 %48, 1
store i32 %49, i32* %8
br label %50
50: ; preds = %47
%51 = load i32, i32* %8
%52 = icmp ult i32 %51, 1114112
br i1 %52, label %53, label %60
53: ; preds = %50
%54 = load i32, i32* %8
%55 = zext i32 %54 to i64
%56 = getelementptr inbounds [1114112 x i8], [1114112 x i8]* %7, i64 0, i64 %55
%57 = load i8, i8* %56
%58 = sext i8 %57 to i32
%59 = icmp ne i32 %58, 0
br label %60
60: ; preds = %53, %50
%61 = phi i1 [ false, %50 ], [ %59, %53 ]
br i1 %61, label %47, label %62
62: ; preds = %60
%63 = load i32, i32* %8
%64 = sub i32 %63, 1
store i32 %64, i32* %13
%65 = load i32, i32* %12
%66 = load i32, i32* %13
%67 = icmp eq i32 %65, %66
br i1 %67, label %68, label %73
68: ; preds = %62
%69 = getelementptr inbounds [25 x i8], [25 x i8]* %14, i64 0, i64 0
%70 = load i32, i32* %12
%71 = call i32 @ucs_symbol(i32 %70)
%72 = call i32 @strcpy(i8* %69, i32 %71)
br label %79
73: ; preds = %62
%74 = getelementptr inbounds [25 x i8], [25 x i8]* %14, i64 0, i64 0
%75 = load i32, i32* %12
%76 = load i32, i32* %13
%77 = call i32 @ucs_symbol_range(i32 %75, i32 %76)
%78 = call i32 @strcpy(i8* %74, i32 %77)
br label %79
79: ; preds = %73, %68
%80 = load i32, i32* %9
%81 = icmp ne i32 %80, 0
br i1 %81, label %82, label %87
82: ; preds = %79
%83 = load i32*, i32** %4
%84 = call i32 (i32*, i8*, ...) @fprintf(i32* %83, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%85 = load i32, i32* %11
%86 = add nsw i32 %85, 1
store i32 %86, i32* %11
br label %87
87: ; preds = %82, %79
%88 = load i32, i32* %11
%89 = getelementptr inbounds [25 x i8], [25 x i8]* %14, i64 0, i64 0
%90 = call i32 @strlen(i8* %89)
%91 = add nsw i32 %88, %90
%92 = icmp sgt i32 %91, 75
br i1 %92, label %93, label %96
93: ; preds = %87
%94 = load i32*, i32** %4
%95 = call i32 (i32*, i8*, ...) @fprintf(i32* %94, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
store i32 3, i32* %11
br label %96
96: ; preds = %93, %87
%97 = load i32*, i32** %4
%98 = getelementptr inbounds [25 x i8], [25 x i8]* %14, i64 0, i64 0
%99 = call i32 (i32*, i8*, ...) @fprintf(i32* %97, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %98)
%100 = getelementptr inbounds [25 x i8], [25 x i8]* %14, i64 0, i64 0
%101 = call i32 @strlen(i8* %100)
%102 = load i32, i32* %11
%103 = add nsw i32 %102, %101
store i32 %103, i32* %11
store i32 1, i32* %9
br label %104
104: ; preds = %96, %42
br label %33
105: ; preds = %33
%106 = load i32*, i32** %4
%107 = call i32 (i32*, i8*, ...) @fprintf(i32* %106, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s \00"
@.str.2 = [6 x i8] c"/\0A \00"
define void @output_charclass(i32* nocapture %0, i8* %1, i32 (i32)* nocapture %2) {
%4 = alloca [1114112 x i8]
%5 = alloca [25 x i8]
%6 = getelementptr inbounds [1114112 x i8], [1114112 x i8]* %4, i64 0, i64 0
br label %7
7: ; preds = %3, %7
%8 = phi i64 [ 0, %3 ], [ %13, %7 ]
%9 = trunc i64 %8 to i32
%10 = tail call i32 %2(i32 %9)
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds [1114112 x i8], [1114112 x i8]* %4, i64 0, i64 %8
store i8 %11, i8* %12
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, 1114112
br i1 %14, label %15, label %7
15: ; preds = %7
%16 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%17 = getelementptr inbounds [25 x i8], [25 x i8]* %5, i64 0, i64 0
br label %18
18: ; preds = %15, %69
%19 = phi i32 [ 0, %15 ], [ %72, %69 ]
%20 = phi i32 [ 0, %15 ], [ %71, %69 ]
%21 = phi i32 [ 1000, %15 ], [ %70, %69 ]
%22 = zext i32 %19 to i64
%23 = getelementptr inbounds [1114112 x i8], [1114112 x i8]* %4, i64 0, i64 %22
%24 = load i8, i8* %23
%25 = icmp eq i8 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %18
%27 = add nuw nsw i32 %19, 1
br label %69
28: ; preds = %18
%29 = call i32 @llvm.umax.i32(i32 %19, i32 1114111)
%30 = add nuw nsw i32 %29, 1
br label %31
31: ; preds = %35, %28
%32 = phi i64 [ %33, %35 ], [ %22, %28 ]
%33 = add nuw nsw i64 %32, 1
%34 = icmp ult i64 %32, 1114111
br i1 %34, label %35, label %42
35: ; preds = %31
%36 = getelementptr inbounds [1114112 x i8], [1114112 x i8]* %4, i64 0, i64 %33
%37 = load i8, i8* %36
%38 = icmp eq i8 %37, 0
br i1 %38, label %39, label %31
39: ; preds = %35
%40 = trunc i64 %32 to i32
%41 = trunc i64 %33 to i32
br label %42
42: ; preds = %31, %39
%43 = phi i32 [ %40, %39 ], [ %29, %31 ]
%44 = phi i32 [ %41, %39 ], [ %30, %31 ]
%45 = icmp eq i32 %19, %43
br i1 %45, label %46, label %48
46: ; preds = %42
%47 = call i32 @ucs_symbol(i32 %19)
br label %50
48: ; preds = %42
%49 = call i32 @ucs_symbol_range(i32 %19, i32 %43)
br label %50
50: ; preds = %48, %46
%51 = phi i32 [ %49, %48 ], [ %47, %46 ]
%52 = call i32 @strcpy(i8* %17, i32 %51)
%53 = icmp eq i32 %20, 0
br i1 %53, label %57, label %54
54: ; preds = %50
%55 = call i32 @fputc(i32 59, i32* %0)
%56 = add nsw i32 %21, 1
br label %57
57: ; preds = %54, %50
%58 = phi i32 [ %56, %54 ], [ %21, %50 ]
%59 = call i32 @strlen(i8* %17)
%60 = add nsw i32 %59, %58
%61 = icmp sgt i32 %60, 75
br i1 %61, label %62, label %64
62: ; preds = %57
%63 = call i64 @fwrite(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i64 5, i64 1, i32* %0)
br label %64
64: ; preds = %62, %57
%65 = phi i32 [ 3, %62 ], [ %58, %57 ]
%66 = call i32 @fputs(i8* %17, i32* %0)
%67 = call i32 @strlen(i8* %17)
%68 = add nsw i32 %67, %65
br label %69
69: ; preds = %64, %26
%70 = phi i32 [ %68, %64 ], [ %21, %26 ]
%71 = phi i32 [ 1, %64 ], [ %20, %26 ]
%72 = phi i32 [ %44, %64 ], [ %27, %26 ]
%73 = icmp ult i32 %72, 1114112
br i1 %73, label %18, label %74
74: ; preds = %69
%75 = call i32 @fputc(i32 10, i32* %0)
ret void
}