#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 *UTIL_mallocStr(size_t);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
char *OC_mkTySkelRef(char *tySkel) {
  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;
  char *ref;
  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);
  ref = OC_mkRef(somedef);
  free(somedef);
  return ref;
}


x86 assembly (clang, -O0):
<OC_mkTySkelRef>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xe6d(%rip),%rdi
lea    0xe6c(%rip),%rsi
call   10a0 <OC_mkDotStr@plt>
mov    %rax,-0x10(%rbp)
lea    0xe65(%rip),%rdi
call   1070 <OC_mkRef@plt>
mov    %rax,-0x18(%rbp)
lea    0xe5a(%rip),%rdi
call   1070 <OC_mkRef@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x4c(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%ecx
mov    -0x4c(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x48(%rbp)
mov    -0x20(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%ecx
mov    -0x48(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x44(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%ecx
mov    -0x44(%rbp),%eax
add    %ecx,%eax
add    $0xf,%eax
cltq
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
add    $0x1,%rdi
call   1080 <UTIL_mallocStr@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
lea    0xdf0(%rip),%rsi
call   1040 <strcpy@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
lea    0xdca(%rip),%rsi
call   1090 <strcat@plt>
mov    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1090 <strcat@plt>
mov    -0x30(%rbp),%rdi
lea    0xdaf(%rip),%rsi
call   1090 <strcat@plt>
mov    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1090 <strcat@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x30(%rbp),%rdi
lea    0xd89(%rip),%rsi
call   1090 <strcat@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    0xd66(%rip),%rsi
call   1090 <strcat@plt>
mov    -0x30(%rbp),%rdi
call   1060 <OC_mkSome@plt>
mov    %rax,-0x38(%rbp)
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    -0x38(%rbp),%rdi
call   1070 <OC_mkRef@plt>
mov    %rax,-0x40(%rbp)
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%rax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OC_mkTySkelRef>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r15
lea    0xe6b(%rip),%rdi
lea    0xe6a(%rip),%rsi
call   10a0 <OC_mkDotStr@plt>
mov    %rax,%r13
lea    0xe64(%rip),%rdi
call   1070 <OC_mkRef@plt>
mov    %rax,%r12
lea    0xe5a(%rip),%rdi
call   1070 <OC_mkRef@plt>
mov    %rax,%r14
mov    %r13,%rdi
call   1050 <strlen@plt>
mov    %eax,%ebx
mov    %r12,%rdi
call   1050 <strlen@plt>
mov    %eax,%ebp
add    %ebx,%ebp
mov    %r14,%rdi
call   1050 <strlen@plt>
mov    %eax,%ebx
add    %ebp,%ebx
mov    %r15,%rdi
call   1050 <strlen@plt>
add    %ebx,%eax
movslq %eax,%rdi
add    $0x10,%rdi
call   1080 <UTIL_mallocStr@plt>
mov    %rax,%rbx
lea    0xe16(%rip),%rbp
mov    %rax,%rdi
mov    %rbp,%rsi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1090 <strcat@plt>
mov    %r13,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1090 <strcat@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1090 <strcat@plt>
lea    0xddd(%rip),%rbp
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1090 <strcat@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1090 <strcat@plt>
mov    %r12,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1090 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1090 <strcat@plt>
mov    %r14,%rdi
call   1030 <free@plt>
lea    0xd9d(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcat@plt>
mov    %rbx,%rdi
call   1060 <OC_mkSome@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %rbp,%rdi
call   1070 <OC_mkRef@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_mkTySkelRef(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
store i8* %0, i8** %2
%10 = 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* %10, i8** %3
%11 = call i8* @OC_mkRef(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
store i8* %11, i8** %4
%12 = call i8* @OC_mkRef(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
store i8* %12, i8** %5
%13 = load i8*, i8** %3
%14 = call i32 @strlen(i8* %13)
%15 = load i8*, i8** %4
%16 = call i32 @strlen(i8* %15)
%17 = add nsw i32 %14, %16
%18 = load i8*, i8** %5
%19 = call i32 @strlen(i8* %18)
%20 = add nsw i32 %17, %19
%21 = load i8*, i8** %2
%22 = call i32 @strlen(i8* %21)
%23 = add nsw i32 %20, %22
%24 = add nsw i32 %23, 15
%25 = sext i32 %24 to i64
store i64 %25, i64* %6
%26 = load i64, i64* %6
%27 = add i64 %26, 1
%28 = call i8* @UTIL_mallocStr(i64 %27)
store i8* %28, i8** %7
%29 = load i8*, i8** %7
%30 = call i32 @strcpy(i8* %29, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%31 = load i8*, i8** %7
%32 = load i8*, i8** %3
%33 = call i32 @strcat(i8* %31, i8* %32)
%34 = load i8*, i8** %3
%35 = call i32 @free(i8* %34)
%36 = load i8*, i8** %7
%37 = call i32 @strcat(i8* %36, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%38 = load i8*, i8** %7
%39 = load i8*, i8** %2
%40 = call i32 @strcat(i8* %38, i8* %39)
%41 = load i8*, i8** %7
%42 = call i32 @strcat(i8* %41, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%43 = load i8*, i8** %7
%44 = load i8*, i8** %4
%45 = call i32 @strcat(i8* %43, i8* %44)
%46 = load i8*, i8** %4
%47 = call i32 @free(i8* %46)
%48 = load i8*, i8** %7
%49 = call i32 @strcat(i8* %48, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%50 = load i8*, i8** %7
%51 = load i8*, i8** %5
%52 = call i32 @strcat(i8* %50, i8* %51)
%53 = load i8*, i8** %5
%54 = call i32 @free(i8* %53)
%55 = load i8*, i8** %7
%56 = call i32 @strcat(i8* %55, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%57 = load i8*, i8** %7
%58 = call i8* @OC_mkSome(i8* %57)
store i8* %58, i8** %8
%59 = load i8*, i8** %7
%60 = call i32 @free(i8* %59)
%61 = load i8*, i8** %8
%62 = call i8* @OC_mkRef(i8* %61)
store i8* %62, i8** %9
%63 = load i8*, i8** %8
%64 = call i32 @free(i8* %63)
%65 = load i8*, i8** %9
ret i8* %65
}

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_mkTySkelRef(i8* %0) {
%2 = 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))
%3 = tail call i8* @OC_mkRef(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i8* @OC_mkRef(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @strlen(i8* %2)
%6 = tail call i32 @strlen(i8* %3)
%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* %0)
%11 = add nsw i32 %9, %10
%12 = sext i32 %11 to i64
%13 = add nsw i64 %12, 16
%14 = tail call i8* @UTIL_mallocStr(i64 %13)
%15 = tail call i32 @strcpy(i8* %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%16 = tail call i32 @strcat(i8* %14, i8* %2)
%17 = tail call i32 @free(i8* %2)
%18 = tail call i32 @strcat(i8* %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%19 = tail call i32 @strcat(i8* %14, i8* %0)
%20 = tail call i32 @strcat(i8* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%21 = tail call i32 @strcat(i8* %14, i8* %3)
%22 = tail call i32 @free(i8* %3)
%23 = tail call i32 @strcat(i8* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%24 = tail call i32 @strcat(i8* %14, i8* %4)
%25 = tail call i32 @free(i8* %4)
%26 = tail call i32 @strcat(i8* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%27 = tail call i8* @OC_mkSome(i8* %14)
%28 = tail call i32 @free(i8* %14)
%29 = tail call i8* @OC_mkRef(i8* %27)
%30 = tail call i32 @free(i8* %27)
ret i8* %29
}