#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_mkVarDec(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_mkTabDec(char *tabName, char *typeName) {
  char *dec;
  char *symbolTab = OC_mkDotStr("Table", "SymbolTable.t");
  char *myType = OC_mkDotStr("Absyn", typeName);
  size_t length = strlen(symbolTab) + strlen(myType) + 5;
  char *typedec = UTIL_mallocStr(length + 1);
  strcpy(typedec, myType);
  free(myType);
  strcat(typedec, " ");
  strcat(typedec, symbolTab);
  free(symbolTab);
  strcat(typedec, "\n");
  dec = OC_mkVarDec(tabName, typedec);
  free(typedec);
  return dec;
}


x86 assembly (clang, -O0):
<OC_mkTabDec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe79(%rip),%rdi
lea    0xe78(%rip),%rsi
call   1080 <OC_mkDotStr@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe72(%rip),%rdi
call   1080 <OC_mkDotStr@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x28(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%ecx
mov    -0x3c(%rbp),%eax
add    %ecx,%eax
add    $0x5,%eax
cltq
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
add    $0x1,%rdi
call   1060 <UTIL_mallocStr@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x38(%rbp),%rdi
lea    0xe18(%rip),%rsi
call   1070 <strcat@plt>
mov    -0x38(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1070 <strcat@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x38(%rbp),%rdi
lea    0xdf4(%rip),%rsi
call   1070 <strcat@plt>
mov    -0x8(%rbp),%rdi
mov    -0x38(%rbp),%rsi
call   1090 <OC_mkVarDec@plt>
mov    %rax,-0x18(%rbp)
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OC_mkTabDec>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xe7b(%rip),%rdi
lea    0xe7a(%rip),%rsi
call   1080 <OC_mkDotStr@plt>
mov    %rax,%r15
lea    0xe79(%rip),%rdi
mov    %rbx,%rsi
call   1080 <OC_mkDotStr@plt>
mov    %rax,%r12
mov    %r15,%rdi
call   1050 <strlen@plt>
mov    %eax,%ebx
mov    %r12,%rdi
call   1050 <strlen@plt>
add    %ebx,%eax
movslq %eax,%rdi
add    $0x6,%rdi
call   1060 <UTIL_mallocStr@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r12,%rsi
call   1040 <strcpy@plt>
mov    %r12,%rdi
call   1030 <free@plt>
lea    0xe37(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcat@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1070 <strcat@plt>
mov    %r15,%rdi
call   1030 <free@plt>
lea    0xe17(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcat@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1090 <OC_mkVarDec@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

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