#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_mkRef(char *);
char *OC_mkSome(char *);
char *UTIL_itoa(int);
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_mkSkelNeededness(int tyenvsize) {
  char *length = UTIL_itoa(tyenvsize);
  char *some;
  char *ref;
  char *init = UTIL_mallocStr(strlen(length) + 20);
  strcpy(init, "(Array.make ");
  strcat(init, length);
  free(length);
  strcat(init, " true)");
  some = OC_mkSome(init);
  free(init);
  ref = OC_mkRef(some);
  free(some);
  return ref;
}


x86 assembly (clang, -O0):
<OC_mkSkelNeededness>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <UTIL_itoa@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <strlen@plt>
mov    %rax,%rdi
add    $0x14,%rdi
call   1090 <UTIL_mallocStr@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
lea    0xe45(%rip),%rsi
call   1050 <strcpy@plt>
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   10a0 <strcat@plt>
mov    -0x10(%rbp),%rdi
call   1040 <free@plt>
mov    -0x28(%rbp),%rdi
lea    0xe2c(%rip),%rsi
call   10a0 <strcat@plt>
mov    -0x28(%rbp),%rdi
call   1070 <OC_mkSome@plt>
mov    %rax,-0x18(%rbp)
mov    -0x28(%rbp),%rdi
call   1040 <free@plt>
mov    -0x18(%rbp),%rdi
call   1080 <OC_mkRef@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <free@plt>
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OC_mkSkelNeededness>:
push   %r14
push   %rbx
push   %rax
call   1030 <UTIL_itoa@plt>
mov    %rax,%r14
mov    %rax,%rdi
call   1060 <strlen@plt>
lea    0x14(%rax),%rdi
call   1090 <UTIL_mallocStr@plt>
mov    %rax,%rbx
lea    0xe59(%rip),%rsi
mov    %rax,%rdi
call   1050 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   10a0 <strcat@plt>
mov    %r14,%rdi
call   1040 <free@plt>
lea    0xe44(%rip),%rsi
mov    %rbx,%rdi
call   10a0 <strcat@plt>
mov    %rbx,%rdi
call   1070 <OC_mkSome@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1040 <free@plt>
mov    %r14,%rdi
call   1080 <OC_mkRef@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <free@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"(Array.make \00"
@.str.1 = [7 x i8] c" true)\00"
define i8* @OC_mkSkelNeededness(i32 %0) {
%2 = tail call i8* @UTIL_itoa(i32 %0)
%3 = tail call i64 @strlen(i8* dereferenceable(1) %2)
%4 = add nsw i64 %3, 20
%5 = tail call i8* @UTIL_mallocStr(i64 %4)
%6 = tail call i32 @strcpy(i8* %5, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @strcat(i8* %5, i8* %2)
%8 = tail call i32 @free(i8* %2)
%9 = tail call i32 @strcat(i8* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%10 = tail call i8* @OC_mkSome(i8* %5)
%11 = tail call i32 @free(i8* %5)
%12 = tail call i8* @OC_mkRef(i8* %10)
%13 = tail call i32 @free(i8* %10)
ret i8* %12
}