#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 *UTIL_mallocStr(size_t);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
char *genTySkelVar(char *ind) {
  char *ctr = OC_mkDotStr("Absyn", "SkeletonVarType");
  char *ref = OC_mkRef(ind);
  size_t length = strlen(ctr) + strlen(ref) + 5;
  char *skelVar = UTIL_mallocStr(length + 1);
  strcpy(skelVar, ctr);
  free(ctr);
  strcat(skelVar, "(");
  strcat(skelVar, ref);
  free(ref);
  strcat(skelVar, ")");
  return skelVar;
}


x86 assembly (clang, -O0):
<genTySkelVar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xe7d(%rip),%rdi
lea    0xe7c(%rip),%rsi
call   1090 <OC_mkDotStr@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <OC_mkRef@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%ecx
mov    -0x2c(%rbp),%eax
add    %ecx,%eax
add    $0x5,%eax
cltq
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
add    $0x1,%rdi
call   1070 <UTIL_mallocStr@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rdi
lea    0xe1f(%rip),%rsi
call   1080 <strcat@plt>
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1080 <strcat@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rdi
lea    0xdfb(%rip),%rsi
call   1080 <strcat@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genTySkelVar>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
lea    0xe81(%rip),%rdi
lea    0xe80(%rip),%rsi
call   1090 <OC_mkDotStr@plt>
mov    %rax,%r15
mov    %rbx,%rdi
call   1060 <OC_mkRef@plt>
mov    %rax,%r14
mov    %r15,%rdi
call   1050 <strlen@plt>
mov    %eax,%ebx
mov    %r14,%rdi
call   1050 <strlen@plt>
add    %ebx,%eax
movslq %eax,%rdi
add    $0x6,%rdi
call   1070 <UTIL_mallocStr@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
call   1040 <strcpy@plt>
mov    %r15,%rdi
call   1030 <free@plt>
lea    0xe40(%rip),%rsi
mov    %rbx,%rdi
call   1080 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1080 <strcat@plt>
mov    %r14,%rdi
call   1030 <free@plt>
lea    0xe20(%rip),%rsi
mov    %rbx,%rdi
call   1080 <strcat@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"Absyn\00"
@.str.1 = [16 x i8] c"SkeletonVarType\00"
@.str.2 = [2 x i8] c"(\00"
@.str.3 = [2 x i8] c")\00"
define i8* @genTySkelVar(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 ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i8* @OC_mkRef(i8* %0)
%4 = tail call i32 @strlen(i8* %2)
%5 = tail call i32 @strlen(i8* %3)
%6 = add nsw i32 %5, %4
%7 = sext i32 %6 to i64
%8 = add nsw i64 %7, 6
%9 = tail call i8* @UTIL_mallocStr(i64 %8)
%10 = tail call i32 @strcpy(i8* %9, i8* %2)
%11 = tail call i32 @free(i8* %2)
%12 = tail call i32 @strcat(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%13 = tail call i32 @strcat(i8* %9, i8* %3)
%14 = tail call i32 @free(i8* %3)
%15 = tail call i32 @strcat(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret i8* %9
}