#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_mkRef(char *);
char *OC_mkSome(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_mkTYSkelVar(char *varName, char *tySkel) {
  char *tyskelvar;
  char *ctr = OC_mkDotStr("Absyn", "Skeleton");
  char *index = OC_mkRef("None");
  char *adjust = OC_mkRef("false");
  size_t length =
      strlen(ctr) + strlen(index) + strlen(adjust) + strlen(tySkel) + 15;
  char *def = UTIL_mallocStr(length + 1);
  char *somedef;
  strcpy(def, "(");
  strcat(def, ctr);
  free(ctr);
  strcat(def, "(");
  strcat(def, tySkel);
  strcat(def, ", ");
  strcat(def, index);
  free(index);
  strcat(def, ", ");
  strcat(def, adjust);
  free(adjust);
  strcat(def, "))");
  somedef = OC_mkSome(def);
  free(def);
  tyskelvar = OC_mkVarDef(varName, somedef);
  free(somedef);
  return tyskelvar;
}


x86 assembly (clang, -O0):
<OC_mkTYSkelVar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe59(%rip),%rdi
lea    0xe58(%rip),%rsi
call   10b0 <OC_mkDotStr@plt>
mov    %rax,-0x20(%rbp)
lea    0xe51(%rip),%rdi
call   1070 <OC_mkRef@plt>
mov    %rax,-0x28(%rbp)
lea    0xe46(%rip),%rdi
call   1070 <OC_mkRef@plt>
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x54(%rbp)
mov    -0x28(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%ecx
mov    -0x54(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x50(%rbp)
mov    -0x30(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%ecx
mov    -0x50(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4c(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%ecx
mov    -0x4c(%rbp),%eax
add    %ecx,%eax
add    $0xf,%eax
cltq
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
add    $0x1,%rdi
call   1090 <UTIL_mallocStr@plt>
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
lea    0xddc(%rip),%rsi
call   1040 <strcpy@plt>
mov    -0x40(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   10a0 <strcat@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%rdi
lea    0xdb6(%rip),%rsi
call   10a0 <strcat@plt>
mov    -0x40(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   10a0 <strcat@plt>
mov    -0x40(%rbp),%rdi
lea    0xd9b(%rip),%rsi
call   10a0 <strcat@plt>
mov    -0x40(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   10a0 <strcat@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%rdi
lea    0xd75(%rip),%rsi
call   10a0 <strcat@plt>
mov    -0x40(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   10a0 <strcat@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%rdi
lea    0xd52(%rip),%rsi
call   10a0 <strcat@plt>
mov    -0x40(%rbp),%rdi
call   1060 <OC_mkSome@plt>
mov    %rax,-0x48(%rbp)
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
mov    -0x48(%rbp),%rsi
call   1080 <OC_mkVarDef@plt>
mov    %rax,-0x18(%rbp)
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OC_mkTYSkelVar>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r15
mov    %rdi,(%rsp)
lea    0xe57(%rip),%rdi
lea    0xe56(%rip),%rsi
call   10b0 <OC_mkDotStr@plt>
mov    %rax,%rbp
lea    0xe50(%rip),%rdi
call   1070 <OC_mkRef@plt>
mov    %rax,%r13
lea    0xe46(%rip),%rdi
call   1070 <OC_mkRef@plt>
mov    %rax,%r12
mov    %rbp,%rdi
call   1050 <strlen@plt>
mov    %eax,%ebx
mov    %r13,%rdi
call   1050 <strlen@plt>
mov    %eax,%r14d
add    %ebx,%r14d
mov    %r12,%rdi
call   1050 <strlen@plt>
mov    %eax,%ebx
add    %r14d,%ebx
mov    %r15,%rdi
call   1050 <strlen@plt>
add    %ebx,%eax
movslq %eax,%rdi
add    $0x10,%rdi
call   1090 <UTIL_mallocStr@plt>
mov    %rax,%rbx
lea    0xdff(%rip),%r14
mov    %rax,%rdi
mov    %r14,%rsi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   10a0 <strcat@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   10a0 <strcat@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   10a0 <strcat@plt>
lea    0xdc6(%rip),%rbp
mov    %rbx,%rdi
mov    %rbp,%rsi
call   10a0 <strcat@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   10a0 <strcat@plt>
mov    %r13,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   10a0 <strcat@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   10a0 <strcat@plt>
mov    %r12,%rdi
call   1030 <free@plt>
lea    0xd86(%rip),%rsi
mov    %rbx,%rdi
call   10a0 <strcat@plt>
mov    %rbx,%rdi
call   1060 <OC_mkSome@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    (%rsp),%rdi
mov    %rbp,%rsi
call   1080 <OC_mkVarDef@plt>
mov    %rax,%rbx
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"Absyn\00"
@.str.1 = [9 x i8] c"Skeleton\00"
@.str.2 = [5 x i8] c"None\00"
@.str.3 = [6 x i8] c"false\00"
@.str.4 = [2 x i8] c"(\00"
@.str.5 = [3 x i8] c", \00"
@.str.6 = [3 x i8] c"))\00"
define i8* @OC_mkTYSkelVar(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i8*
%11 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%12 = call i8* @OC_mkDotStr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
store i8* %12, i8** %6
%13 = call i8* @OC_mkRef(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
store i8* %13, i8** %7
%14 = call i8* @OC_mkRef(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
store i8* %14, i8** %8
%15 = load i8*, i8** %6
%16 = call i32 @strlen(i8* %15)
%17 = load i8*, i8** %7
%18 = call i32 @strlen(i8* %17)
%19 = add nsw i32 %16, %18
%20 = load i8*, i8** %8
%21 = call i32 @strlen(i8* %20)
%22 = add nsw i32 %19, %21
%23 = load i8*, i8** %4
%24 = call i32 @strlen(i8* %23)
%25 = add nsw i32 %22, %24
%26 = add nsw i32 %25, 15
%27 = sext i32 %26 to i64
store i64 %27, i64* %9
%28 = load i64, i64* %9
%29 = add i64 %28, 1
%30 = call i8* @UTIL_mallocStr(i64 %29)
store i8* %30, i8** %10
%31 = load i8*, i8** %10
%32 = call i32 @strcpy(i8* %31, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%33 = load i8*, i8** %10
%34 = load i8*, i8** %6
%35 = call i32 @strcat(i8* %33, i8* %34)
%36 = load i8*, i8** %6
%37 = call i32 @free(i8* %36)
%38 = load i8*, i8** %10
%39 = call i32 @strcat(i8* %38, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%40 = load i8*, i8** %10
%41 = load i8*, i8** %4
%42 = call i32 @strcat(i8* %40, i8* %41)
%43 = load i8*, i8** %10
%44 = call i32 @strcat(i8* %43, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%45 = load i8*, i8** %10
%46 = load i8*, i8** %7
%47 = call i32 @strcat(i8* %45, i8* %46)
%48 = load i8*, i8** %7
%49 = call i32 @free(i8* %48)
%50 = load i8*, i8** %10
%51 = call i32 @strcat(i8* %50, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%52 = load i8*, i8** %10
%53 = load i8*, i8** %8
%54 = call i32 @strcat(i8* %52, i8* %53)
%55 = load i8*, i8** %8
%56 = call i32 @free(i8* %55)
%57 = load i8*, i8** %10
%58 = call i32 @strcat(i8* %57, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%59 = load i8*, i8** %10
%60 = call i8* @OC_mkSome(i8* %59)
store i8* %60, i8** %11
%61 = load i8*, i8** %10
%62 = call i32 @free(i8* %61)
%63 = load i8*, i8** %3
%64 = load i8*, i8** %11
%65 = call i8* @OC_mkVarDef(i8* %63, i8* %64)
store i8* %65, i8** %5
%66 = load i8*, i8** %11
%67 = call i32 @free(i8* %66)
%68 = load i8*, i8** %5
ret i8* %68
}

LLVM IR (-O2):
@.str = [6 x i8] c"Absyn\00"
@.str.1 = [9 x i8] c"Skeleton\00"
@.str.2 = [5 x i8] c"None\00"
@.str.3 = [6 x i8] c"false\00"
@.str.4 = [2 x i8] c"(\00"
@.str.5 = [3 x i8] c", \00"
@.str.6 = [3 x i8] c"))\00"
define i8* @OC_mkTYSkelVar(i8* %0, i8* %1) {
%3 = tail call i8* @OC_mkDotStr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i8* @OC_mkRef(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i8* @OC_mkRef(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%6 = tail call i32 @strlen(i8* %3)
%7 = tail call i32 @strlen(i8* %4)
%8 = add nsw i32 %7, %6
%9 = tail call i32 @strlen(i8* %5)
%10 = add nsw i32 %8, %9
%11 = tail call i32 @strlen(i8* %1)
%12 = add nsw i32 %10, %11
%13 = sext i32 %12 to i64
%14 = add nsw i64 %13, 16
%15 = tail call i8* @UTIL_mallocStr(i64 %14)
%16 = tail call i32 @strcpy(i8* %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%17 = tail call i32 @strcat(i8* %15, i8* %3)
%18 = tail call i32 @free(i8* %3)
%19 = tail call i32 @strcat(i8* %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%20 = tail call i32 @strcat(i8* %15, i8* %1)
%21 = tail call i32 @strcat(i8* %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%22 = tail call i32 @strcat(i8* %15, i8* %4)
%23 = tail call i32 @free(i8* %4)
%24 = tail call i32 @strcat(i8* %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%25 = tail call i32 @strcat(i8* %15, i8* %5)
%26 = tail call i32 @free(i8* %5)
%27 = tail call i32 @strcat(i8* %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%28 = tail call i8* @OC_mkSome(i8* %15)
%29 = tail call i32 @free(i8* %15)
%30 = tail call i8* @OC_mkVarDef(i8* %0, i8* %28)
%31 = tail call i32 @free(i8* %28)
ret i8* %30
}