#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 */
char *OC_mkDotStr(char *, char *);
char *OC_mkTab(char *, char *);
char *OC_mkVarDef(char *, char *);
char *UTIL_mallocStr(size_t);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
char *OC_mkFixedML() {
  char *kindDef = OC_mkTab("pervasiveKinds", "buildPervasiveKinds");
  char *constDef = OC_mkTab("pervasiveConstants", "buildPervasiveConstants");
  char *emptyTab = OC_mkDotStr("Table", "SymbolTable.empty");
  char *tyabbrDef = OC_mkVarDef("pervasiveTypeAbbrevs", emptyTab);
  size_t length =
      strlen(kindDef) + strlen(constDef) + strlen(tyabbrDef) +
      strlen("let andTerm = Absyn.ConstantTerm(andConstant, [], Errormsg.none) "
             "      \nlet implicationTerm = Absyn.ConstantTerm(implConstant, "
             "[], Errormsg.none)\n") +
      strlen("let isPerv const =                                               "
             "             \n  let constCat = Absyn.getConstantType(const) in  "
             "                              \n  match constCat with            "
             "                                              \n   "
             "Absyn.PervasiveConstant(_) -> true                               "
             "         \n  | _ -> false                                        "
             "                         \n") +
      10;
  char *defs = UTIL_mallocStr(length + 1);
  free(emptyTab);
  strcpy(defs, kindDef);
  free(kindDef);
  strcat(defs, constDef);
  free(constDef);
  strcat(defs, tyabbrDef);
  free(tyabbrDef);
  strcat(defs, "\n\n");
  strcat(defs, "let andTerm = Absyn.ConstantTerm(andConstant, [], "
               "Errormsg.none)       \nlet implicationTerm = "
               "Absyn.ConstantTerm(implConstant, [], Errormsg.none)\n");
  strcat(defs, "\n");
  strcat(defs,
         "let isPerv const =                                                   "
         "         \n  let constCat = Absyn.getConstantType(const) in          "
         "                      \n  match constCat with                        "
         "                                  \n   Absyn.PervasiveConstant(_) -> "
         "true                                        \n  | _ -> false         "
         "                                                        \n");
  strcat(defs, "\n");
  return defs;
}


x86 assembly (clang, -O0):
<OC_mkFixedML>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    0xe71(%rip),%rdi
lea    0xe79(%rip),%rsi
call   1050 <OC_mkTab@plt>
mov    %rax,-0x8(%rbp)
lea    0xe7d(%rip),%rdi
lea    0xe89(%rip),%rsi
call   1050 <OC_mkTab@plt>
mov    %rax,-0x10(%rbp)
lea    0xe91(%rip),%rdi
lea    0xe90(%rip),%rsi
call   10a0 <OC_mkDotStr@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe8e(%rip),%rdi
call   1070 <OC_mkVarDef@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,-0x40(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,%ecx
mov    -0x40(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x20(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,%ecx
mov    -0x3c(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x38(%rbp)
lea    0xe61(%rip),%rdi
call   1060 <strlen@plt>
mov    %eax,%ecx
mov    -0x38(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x34(%rbp)
lea    0xede(%rip),%rdi
call   1060 <strlen@plt>
mov    %eax,%ecx
mov    -0x34(%rbp),%eax
add    %ecx,%eax
add    $0xa,%eax
cltq
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
add    $0x1,%rdi
call   1080 <UTIL_mallocStr@plt>
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1090 <strcat@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x30(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1090 <strcat@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x30(%rbp),%rdi
lea    0xff1(%rip),%rsi
call   1090 <strcat@plt>
mov    -0x30(%rbp),%rdi
lea    0xdbf(%rip),%rsi
call   1090 <strcat@plt>
mov    -0x30(%rbp),%rdi
lea    0xfd2(%rip),%rsi
call   1090 <strcat@plt>
mov    -0x30(%rbp),%rdi
lea    0xe32(%rip),%rsi
call   1090 <strcat@plt>
mov    -0x30(%rbp),%rdi
lea    0xfb2(%rip),%rsi
call   1090 <strcat@plt>
mov    -0x30(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OC_mkFixedML>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xe6e(%rip),%rdi
lea    0xe76(%rip),%rsi
call   1050 <OC_mkTab@plt>
mov    %rax,%r15
lea    0xe7b(%rip),%rdi
lea    0xe87(%rip),%rsi
call   1050 <OC_mkTab@plt>
mov    %rax,%r14
lea    0xe90(%rip),%rdi
lea    0xe8f(%rip),%rsi
call   10a0 <OC_mkDotStr@plt>
mov    %rax,%r12
lea    0xe92(%rip),%rdi
mov    %rax,%rsi
call   1070 <OC_mkVarDef@plt>
mov    %rax,%r13
mov    %r15,%rdi
call   1060 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1060 <strlen@plt>
mov    %eax,%ebx
add    %ebp,%ebx
mov    %r13,%rdi
call   1060 <strlen@plt>
mov    %eax,%ebp
add    %ebx,%ebp
lea    0xe73(%rip),%rdi
call   1060 <strlen@plt>
mov    %eax,%ebx
add    %ebp,%ebx
lea    0xef6(%rip),%rdi
call   1060 <strlen@plt>
add    %ebx,%eax
movslq %eax,%rdi
add    $0xb,%rdi
call   1080 <UTIL_mallocStr@plt>
mov    %rax,%rbp
mov    %r12,%rdi
call   1030 <free@plt>
mov    %rbp,%rdi
mov    %r15,%rsi
call   1040 <strcpy@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %rbp,%rdi
mov    %r14,%rsi
call   1090 <strcat@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbp,%rdi
mov    %r13,%rsi
call   1090 <strcat@plt>
mov    %r13,%rdi
call   1030 <free@plt>
lea    0x1027(%rip),%rsi
mov    %rbp,%rdi
call   1090 <strcat@plt>
mov    %rbp,%rdi
lea    0xdf3(%rip),%rsi
call   1090 <strcat@plt>
lea    0x100a(%rip),%rbx
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1090 <strcat@plt>
mov    %rbp,%rdi
lea    0xe65(%rip),%rsi
call   1090 <strcat@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1090 <strcat@plt>
mov    %rbp,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"pervasiveKinds\00"
@.str.1 = [20 x i8] c"buildPervasiveKinds\00"
@.str.2 = [19 x i8] c"pervasiveConstants\00"
@.str.3 = [24 x i8] c"buildPervasiveConstants\00"
@.str.4 = [6 x i8] c"Table\00"
@.str.5 = [18 x i8] c"SymbolTable.empty\00"
@.str.6 = [21 x i8] c"pervasiveTypeAbbrevs\00"
@.str.7 = [147 x i8] c"let andTerm = Absyn.ConstantTerm(andConstant, [], Errormsg.none) \0Alet implicationTerm = Absyn.ConstantTerm(implConstant, [], Errormsg.none)\0A\00"
@.str.8 = [399 x i8] c"let isPerv const = \0A let constCat = Absyn.getConstantType(const) in \0A match constCat with \0A Absyn.PervasiveConstant(_) -> true \0A | _ -> false \0A\00"
@.str.9 = [3 x i8] c"\0A\0A\00"
@.str.10 = [2 x i8] c"\0A\00"
define i8* @OC_mkFixedML() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
%7 = call i8* @OC_mkTab(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
store i8* %7, i8** %1
%8 = call i8* @OC_mkTab(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
store i8* %8, i8** %2
%9 = call i8* @OC_mkDotStr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = call i8* @OC_mkVarDef(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0), i8* %10)
store i8* %11, i8** %4
%12 = load i8*, i8** %1
%13 = call i32 @strlen(i8* %12)
%14 = load i8*, i8** %2
%15 = call i32 @strlen(i8* %14)
%16 = add nsw i32 %13, %15
%17 = load i8*, i8** %4
%18 = call i32 @strlen(i8* %17)
%19 = add nsw i32 %16, %18
%20 = call i32 @strlen(i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str.7, i64 0, i64 0))
%21 = add nsw i32 %19, %20
%22 = call i32 @strlen(i8* getelementptr inbounds ([399 x i8], [399 x i8]* @.str.8, i64 0, i64 0))
%23 = add nsw i32 %21, %22
%24 = add nsw i32 %23, 10
%25 = sext i32 %24 to i64
store i64 %25, i64* %5
%26 = load i64, i64* %5
%27 = add i64 %26, 1
%28 = call i8* @UTIL_mallocStr(i64 %27)
store i8* %28, i8** %6
%29 = load i8*, i8** %3
%30 = call i32 @free(i8* %29)
%31 = load i8*, i8** %6
%32 = load i8*, i8** %1
%33 = call i32 @strcpy(i8* %31, i8* %32)
%34 = load i8*, i8** %1
%35 = call i32 @free(i8* %34)
%36 = load i8*, i8** %6
%37 = load i8*, i8** %2
%38 = call i32 @strcat(i8* %36, i8* %37)
%39 = load i8*, i8** %2
%40 = call i32 @free(i8* %39)
%41 = load i8*, i8** %6
%42 = load i8*, i8** %4
%43 = call i32 @strcat(i8* %41, i8* %42)
%44 = load i8*, i8** %4
%45 = call i32 @free(i8* %44)
%46 = load i8*, i8** %6
%47 = call i32 @strcat(i8* %46, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
%48 = load i8*, i8** %6
%49 = call i32 @strcat(i8* %48, i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str.7, i64 0, i64 0))
%50 = load i8*, i8** %6
%51 = call i32 @strcat(i8* %50, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%52 = load i8*, i8** %6
%53 = call i32 @strcat(i8* %52, i8* getelementptr inbounds ([399 x i8], [399 x i8]* @.str.8, i64 0, i64 0))
%54 = load i8*, i8** %6
%55 = call i32 @strcat(i8* %54, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%56 = load i8*, i8** %6
ret i8* %56
}

LLVM IR (-O2):
@.str = [15 x i8] c"pervasiveKinds\00"
@.str.1 = [20 x i8] c"buildPervasiveKinds\00"
@.str.2 = [19 x i8] c"pervasiveConstants\00"
@.str.3 = [24 x i8] c"buildPervasiveConstants\00"
@.str.4 = [6 x i8] c"Table\00"
@.str.5 = [18 x i8] c"SymbolTable.empty\00"
@.str.6 = [21 x i8] c"pervasiveTypeAbbrevs\00"
@.str.7 = [147 x i8] c"let andTerm = Absyn.ConstantTerm(andConstant, [], Errormsg.none) \0Alet implicationTerm = Absyn.ConstantTerm(implConstant, [], Errormsg.none)\0A\00"
@.str.8 = [399 x i8] c"let isPerv const = \0A let constCat = Absyn.getConstantType(const) in \0A match constCat with \0A Absyn.PervasiveConstant(_) -> true \0A | _ -> false \0A\00"
@.str.9 = [3 x i8] c"\0A\0A\00"
@.str.10 = [2 x i8] c"\0A\00"
define i8* @OC_mkFixedML() {
%1 = tail call i8* @OC_mkTab(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i8* @OC_mkTab(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
%3 = tail call i8* @OC_mkDotStr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
%4 = tail call i8* @OC_mkVarDef(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0), i8* %3)
%5 = tail call i32 @strlen(i8* %1)
%6 = tail call i32 @strlen(i8* %2)
%7 = add nsw i32 %6, %5
%8 = tail call i32 @strlen(i8* %4)
%9 = add nsw i32 %7, %8
%10 = tail call i32 @strlen(i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str.7, i64 0, i64 0))
%11 = add nsw i32 %9, %10
%12 = tail call i32 @strlen(i8* getelementptr inbounds ([399 x i8], [399 x i8]* @.str.8, i64 0, i64 0))
%13 = add nsw i32 %11, %12
%14 = sext i32 %13 to i64
%15 = add nsw i64 %14, 11
%16 = tail call i8* @UTIL_mallocStr(i64 %15)
%17 = tail call i32 @free(i8* %3)
%18 = tail call i32 @strcpy(i8* %16, i8* %1)
%19 = tail call i32 @free(i8* %1)
%20 = tail call i32 @strcat(i8* %16, i8* %2)
%21 = tail call i32 @free(i8* %2)
%22 = tail call i32 @strcat(i8* %16, i8* %4)
%23 = tail call i32 @free(i8* %4)
%24 = tail call i32 @strcat(i8* %16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
%25 = tail call i32 @strcat(i8* %16, i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str.7, i64 0, i64 0))
%26 = tail call i32 @strcat(i8* %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%27 = tail call i32 @strcat(i8* %16, i8* getelementptr inbounds ([399 x i8], [399 x i8]* @.str.8, i64 0, i64 0))
%28 = tail call i32 @strcat(i8* %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
ret i8* %16
}