#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_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_mkIsConstFuncDef(char *funcName, char *constVarName) {
  char *funchead = UTIL_mallocStr(strlen(funcName) + 3);
  char *defbody = UTIL_mallocStr(strlen(constVarName) + 10);
  char *def;
  strcpy(funchead, funcName);
  strcat(funchead, " tm");
  strcpy(defbody, "(tm == ");
  strcat(defbody, constVarName);
  strcat(defbody, ")");
  def = OC_mkVarDef(funchead, defbody);
  free(funchead);
  free(defbody);
  return def;
}


x86 assembly (clang, -O0):
<OC_mkIsConstFuncDef>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,%rdi
add    $0x3,%rdi
call   1070 <UTIL_mallocStr@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,%rdi
add    $0xa,%rdi
call   1070 <UTIL_mallocStr@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x18(%rbp),%rdi
lea    0xe46(%rip),%rsi
call   1080 <strcat@plt>
mov    -0x20(%rbp),%rdi
lea    0xe3a(%rip),%rsi
call   1040 <strcpy@plt>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1080 <strcat@plt>
mov    -0x20(%rbp),%rdi
lea    0xe25(%rip),%rsi
call   1080 <strcat@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1060 <OC_mkVarDef@plt>
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OC_mkIsConstFuncDef>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r12
call   1050 <strlen@plt>
lea    0x3(%rax),%rdi
call   1070 <UTIL_mallocStr@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1050 <strlen@plt>
lea    0xa(%rax),%rdi
call   1070 <UTIL_mallocStr@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %r12,%rsi
call   1040 <strcpy@plt>
lea    0xe5b(%rip),%rsi
mov    %r15,%rdi
call   1080 <strcat@plt>
lea    0xe50(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1080 <strcat@plt>
lea    0xe3e(%rip),%rsi
mov    %rbx,%rdi
call   1080 <strcat@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1060 <OC_mkVarDef@plt>
mov    %rax,%r14
mov    %r15,%rdi
call   1030 <free@plt>
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 = [4 x i8] c" tm\00"
@.str.1 = [8 x i8] c"(tm == \00"
@.str.2 = [2 x i8] c")\00"
define i8* @OC_mkIsConstFuncDef(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %3
%9 = call i64 @strlen(i8* %8)
%10 = add nsw i64 %9, 3
%11 = call i8* @UTIL_mallocStr(i64 %10)
store i8* %11, i8** %5
%12 = load i8*, i8** %4
%13 = call i64 @strlen(i8* %12)
%14 = add nsw i64 %13, 10
%15 = call i8* @UTIL_mallocStr(i64 %14)
store i8* %15, i8** %6
%16 = load i8*, i8** %5
%17 = load i8*, i8** %3
%18 = call i32 @strcpy(i8* %16, i8* %17)
%19 = load i8*, i8** %5
%20 = call i32 @strcat(i8* %19, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%21 = load i8*, i8** %6
%22 = call i32 @strcpy(i8* %21, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%23 = load i8*, i8** %6
%24 = load i8*, i8** %4
%25 = call i32 @strcat(i8* %23, i8* %24)
%26 = load i8*, i8** %6
%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** %5
%29 = load i8*, i8** %6
%30 = call i8* @OC_mkVarDef(i8* %28, i8* %29)
store i8* %30, i8** %7
%31 = load i8*, i8** %5
%32 = call i32 @free(i8* %31)
%33 = load i8*, i8** %6
%34 = call i32 @free(i8* %33)
%35 = load i8*, i8** %7
ret i8* %35
}

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