#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 *C_mkIndexName(char *);
char *UTIL_mallocStr(scalar_t__);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *C_genTySkelFunc(char *name, char *arity) {
  char *kindName = C_mkIndexName(name);
  char *mytext = NULL;
  mytext = UTIL_mallocStr(strlen("    DF_mkStrFuncType(tySkelBase, ") +
                          strlen(kindName) + strlen(arity) + strlen(");\n") +
                          strlen("    tySkelBase += DF_TY_ATOMIC_SIZE;\n") + 5);
  strcpy(mytext, "    DF_mkStrFuncType(tySkelBase, ");
  strcat(mytext, kindName);
  free(kindName);
  strcat(mytext, ", ");
  strcat(mytext, arity);
  strcat(mytext, ");\n");
  strcat(mytext, "    tySkelBase += DF_TY_ATOMIC_SIZE;\n");
  return mytext;
}


x86 assembly (clang, -O0):
<C_genTySkelFunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <C_mkIndexName@plt>
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
lea    0xe74(%rip),%rdi
call   1050 <strlen@plt>
mov    %rax,-0x40(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,%rcx
mov    -0x40(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,%rcx
mov    -0x38(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
lea    0xe58(%rip),%rdi
call   1050 <strlen@plt>
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
lea    0xe42(%rip),%rdi
call   1050 <strlen@plt>
mov    -0x28(%rbp),%rdi
add    %rax,%rdi
add    $0x5,%rdi
call   1070 <UTIL_mallocStr@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xdf8(%rip),%rsi
call   1040 <strcpy@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1080 <strcat@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
lea    0xdf1(%rip),%rsi
call   1080 <strcat@plt>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1080 <strcat@plt>
mov    -0x20(%rbp),%rdi
lea    0xdd7(%rip),%rsi
call   1080 <strcat@plt>
mov    -0x20(%rbp),%rdi
lea    0xdcb(%rip),%rsi
call   1080 <strcat@plt>
mov    -0x20(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C_genTySkelFunc>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
call   1060 <C_mkIndexName@plt>
mov    %rax,%r15
mov    %rax,%rdi
call   1050 <strlen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1050 <strlen@plt>
lea    (%rbx,%rax,1),%rdi
add    $0x4e,%rdi
call   1070 <UTIL_mallocStr@plt>
mov    %rax,%rbx
lea    0xe66(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1080 <strcat@plt>
mov    %r15,%rdi
call   1030 <free@plt>
lea    0xe63(%rip),%rsi
mov    %rbx,%rdi
call   1080 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1080 <strcat@plt>
lea    0xe4c(%rip),%rsi
mov    %rbx,%rdi
call   1080 <strcat@plt>
lea    0xe41(%rip),%rsi
mov    %rbx,%rdi
call   1080 <strcat@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [34 x i8] c" DF_mkStrFuncType(tySkelBase, \00"
@.str.1 = [4 x i8] c");\0A\00"
@.str.2 = [38 x i8] c" tySkelBase += DF_TY_ATOMIC_SIZE;\0A\00"
@.str.3 = [3 x i8] c", \00"
define i8* @C_genTySkelFunc(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i8* @C_mkIndexName(i8* %7)
store i8* %8, i8** %5
store i8* null, i8** %6
%9 = call i64 @strlen(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%10 = load i8*, i8** %5
%11 = call i64 @strlen(i8* %10)
%12 = add nsw i64 %9, %11
%13 = load i8*, i8** %4
%14 = call i64 @strlen(i8* %13)
%15 = add nsw i64 %12, %14
%16 = call i64 @strlen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%17 = add nsw i64 %15, %16
%18 = call i64 @strlen(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
%19 = add nsw i64 %17, %18
%20 = add nsw i64 %19, 5
%21 = call i8* @UTIL_mallocStr(i64 %20)
store i8* %21, i8** %6
%22 = load i8*, i8** %6
%23 = call i32 @strcpy(i8* %22, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%24 = load i8*, i8** %6
%25 = load i8*, i8** %5
%26 = call i32 @strcat(i8* %24, i8* %25)
%27 = load i8*, i8** %5
%28 = call i32 @free(i8* %27)
%29 = load i8*, i8** %6
%30 = call i32 @strcat(i8* %29, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%31 = load i8*, i8** %6
%32 = load i8*, i8** %4
%33 = call i32 @strcat(i8* %31, i8* %32)
%34 = load i8*, i8** %6
%35 = call i32 @strcat(i8* %34, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%36 = load i8*, i8** %6
%37 = call i32 @strcat(i8* %36, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
%38 = load i8*, i8** %6
ret i8* %38
}

LLVM IR (-O2):
@.str = [34 x i8] c" DF_mkStrFuncType(tySkelBase, \00"
@.str.1 = [4 x i8] c");\0A\00"
@.str.2 = [38 x i8] c" tySkelBase += DF_TY_ATOMIC_SIZE;\0A\00"
@.str.3 = [3 x i8] c", \00"
define i8* @C_genTySkelFunc(i8* %0, i8* %1) {
%3 = tail call i8* @C_mkIndexName(i8* %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %3)
%5 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%6 = add i64 %4, 78
%7 = add i64 %6, %5
%8 = tail call i8* @UTIL_mallocStr(i64 %7)
%9 = tail call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @strcat(i8* %8, i8* %3)
%11 = tail call i32 @free(i8* %3)
%12 = tail call i32 @strcat(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%13 = tail call i32 @strcat(i8* %8, i8* %1)
%14 = tail call i32 @strcat(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%15 = tail call i32 @strcat(i8* %8, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
ret i8* %8
}