#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_mkVarDef(char *, 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 *OC_mkTypeSetVar(char *defaultty, char *arglist, char *tyName) {
  char *setVar;
  char *func = OC_mkDotStr("Absyn", "makeTypeSetVariable");
  char *def =
      UTIL_mallocStr(strlen(func) + strlen(arglist) + strlen(defaultty) + 2);
  strcpy(def, func);
  free(func);
  strcat(def, " ");
  strcat(def, defaultty);
  strcat(def, " ");
  strcat(def, arglist);
  setVar = OC_mkVarDef(tyName, def);
  free(def);
  return setVar;
}


x86 assembly (clang, -O0):
<OC_mkTypeSetVar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xe75(%rip),%rdi
lea    0xe74(%rip),%rsi
call   1090 <OC_mkDotStr@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,%rcx
mov    -0x40(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x38(%rbp),%rdi
add    %rax,%rdi
add    $0x2,%rdi
call   1070 <UTIL_mallocStr@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x30(%rbp),%rdi
lea    0xe1d(%rip),%rsi
call   1080 <strcat@plt>
mov    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1080 <strcat@plt>
mov    -0x30(%rbp),%rdi
lea    0xe00(%rip),%rsi
call   1080 <strcat@plt>
mov    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1080 <strcat@plt>
mov    -0x18(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1060 <OC_mkVarDef@plt>
mov    %rax,-0x20(%rbp)
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OC_mkTypeSetVar>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
lea    0xe75(%rip),%rdi
lea    0xe74(%rip),%rsi
call   1090 <OC_mkDotStr@plt>
mov    %rax,%r13
mov    %rax,%rdi
call   1050 <strlen@plt>
mov    %rax,%rbx
mov    %r15,%rdi
call   1050 <strlen@plt>
mov    %rax,%rbp
mov    %r12,%rdi
call   1050 <strlen@plt>
add    %rbx,%rbp
lea    (%rax,%rbp,1),%rdi
add    $0x2,%rdi
call   1070 <UTIL_mallocStr@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r13,%rsi
call   1040 <strcpy@plt>
mov    %r13,%rdi
call   1030 <free@plt>
lea    0xe35(%rip),%rbp
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1080 <strcat@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1080 <strcat@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1080 <strcat@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1080 <strcat@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1060 <OC_mkVarDef@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %rbp,%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 = [20 x i8] c"makeTypeSetVariable\00"
@.str.2 = [2 x i8] c" \00"
define i8* @OC_mkTypeSetVar(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%10 = call i8* @OC_mkDotStr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
store i8* %10, i8** %8
%11 = load i8*, i8** %8
%12 = call i64 @strlen(i8* %11)
%13 = load i8*, i8** %5
%14 = call i64 @strlen(i8* %13)
%15 = add nsw i64 %12, %14
%16 = load i8*, i8** %4
%17 = call i64 @strlen(i8* %16)
%18 = add nsw i64 %15, %17
%19 = add nsw i64 %18, 2
%20 = call i8* @UTIL_mallocStr(i64 %19)
store i8* %20, i8** %9
%21 = load i8*, i8** %9
%22 = load i8*, i8** %8
%23 = call i32 @strcpy(i8* %21, i8* %22)
%24 = load i8*, i8** %8
%25 = call i32 @free(i8* %24)
%26 = load i8*, i8** %9
%27 = call i32 @strcat(i8* %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%28 = load i8*, i8** %9
%29 = load i8*, i8** %4
%30 = call i32 @strcat(i8* %28, i8* %29)
%31 = load i8*, i8** %9
%32 = call i32 @strcat(i8* %31, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%33 = load i8*, i8** %9
%34 = load i8*, i8** %5
%35 = call i32 @strcat(i8* %33, i8* %34)
%36 = load i8*, i8** %6
%37 = load i8*, i8** %9
%38 = call i8* @OC_mkVarDef(i8* %36, i8* %37)
store i8* %38, i8** %7
%39 = load i8*, i8** %9
%40 = call i32 @free(i8* %39)
%41 = load i8*, i8** %7
ret i8* %41
}

LLVM IR (-O2):
@.str = [6 x i8] c"Absyn\00"
@.str.1 = [20 x i8] c"makeTypeSetVariable\00"
@.str.2 = [2 x i8] c" \00"
define i8* @OC_mkTypeSetVar(i8* %0, i8* %1, i8* %2) {
%4 = tail call i8* @OC_mkDotStr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i64 @strlen(i8* dereferenceable(1) %4)
%6 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%7 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%8 = add i64 %5, 2
%9 = add i64 %8, %6
%10 = add i64 %9, %7
%11 = tail call i8* @UTIL_mallocStr(i64 %10)
%12 = tail call i32 @strcpy(i8* %11, i8* %4)
%13 = tail call i32 @free(i8* %4)
%14 = tail call i32 @strcat(i8* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%15 = tail call i32 @strcat(i8* %11, i8* %0)
%16 = tail call i32 @strcat(i8* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%17 = tail call i32 @strcat(i8* %11, i8* %1)
%18 = tail call i8* @OC_mkVarDef(i8* %2, i8* %11)
%19 = tail call i32 @free(i8* %11)
ret i8* %18
}