#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 *malloc(int);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
size_t strlen(char *);
char *make_assignment_type_cast(char *args_control_type, int asterisks) {
  int i;
  const size_t len = strlen(args_control_type);
  char *buf = malloc(1 + len + 1 + asterisks + 1 + 1);
  if (NULL == buf) {
    return NULL;
  }
  strcpy(buf, "(");
  strcat(buf, args_control_type);
  if (0 != asterisks) {
    strcat(buf, " ");
    for (i = 0; i < asterisks; i++) {
      strcat(buf, "*");
    }
  }
  strcat(buf, ")");
  return buf;
}


x86 assembly (clang, -O0):
<make_assignment_type_cast>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
add    $0x1,%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
add    $0x1,%rax
add    $0x1,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x28(%rbp)
xor    %eax,%eax
cmp    -0x28(%rbp),%rax
jne    119b <make_assignment_type_cast+0x5b>
movq   $0x0,-0x8(%rbp)
jmp    1221 <make_assignment_type_cast+0xe1>
mov    -0x28(%rbp),%rdi
lea    0xe5a(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <strcat@plt>
xor    %eax,%eax
cmp    -0x14(%rbp),%eax
je     1209 <make_assignment_type_cast+0xc9>
mov    -0x28(%rbp),%rdi
lea    0xe34(%rip),%rsi
call   1060 <strcat@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1204 <make_assignment_type_cast+0xc4>
mov    -0x28(%rbp),%rdi
lea    0xe13(%rip),%rsi
call   1060 <strcat@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11da <make_assignment_type_cast+0x9a>
jmp    1209 <make_assignment_type_cast+0xc9>
mov    -0x28(%rbp),%rdi
lea    0xdf2(%rip),%rsi
call   1060 <strcat@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_assignment_type_cast>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %rdi,%r15
call   1040 <strlen@plt>
lea    (%rbx,%rax,1),%edi
add    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     11bf <make_assignment_type_cast+0x7f>
lea    0xe97(%rip),%rsi
mov    %r14,%rdi
call   1030 <strcpy@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1060 <strcat@plt>
test   %ebx,%ebx
je     11b0 <make_assignment_type_cast+0x70>
lea    0xe7b(%rip),%rsi
mov    %r14,%rdi
call   1060 <strcat@plt>
test   %ebx,%ebx
jle    11b0 <make_assignment_type_cast+0x70>
lea    0xe6a(%rip),%r15
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
call   1060 <strcat@plt>
add    $0xffffffff,%ebx
jne    11a0 <make_assignment_type_cast+0x60>
lea    0xe4f(%rip),%rsi
mov    %r14,%rdi
call   1060 <strcat@plt>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [2 x i8] c"(\00"
@.str.1 = [2 x i8] c" \00"
@.str.2 = [2 x i8] c"*\00"
@.str.3 = [2 x i8] c")\00"
define i8* @make_assignment_type_cast(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
%8 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
%9 = load i8*, i8** %4
%10 = call i64 @strlen(i8* %9)
store i64 %10, i64* %7
%11 = load i64, i64* %7
%12 = add i64 1, %11
%13 = add i64 %12, 1
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = add i64 %13, %15
%17 = add i64 %16, 1
%18 = add i64 %17, 1
%19 = trunc i64 %18 to i32
%20 = call i8* @malloc(i32 %19)
store i8* %20, i8** %8
%21 = load i8*, i8** %8
%22 = icmp eq i8* null, %21
br i1 %22, label %23, label %24
23: ; preds = %2
store i8* null, i8** %3
br label %50
24: ; preds = %2
%25 = load i8*, i8** %8
%26 = call i32 @strcpy(i8* %25, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%27 = load i8*, i8** %8
%28 = load i8*, i8** %4
%29 = call i32 @strcat(i8* %27, i8* %28)
%30 = load i32, i32* %5
%31 = icmp ne i32 0, %30
br i1 %31, label %32, label %46
32: ; preds = %24
%33 = load i8*, i8** %8
%34 = call i32 @strcat(i8* %33, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %6
br label %35
35: ; preds = %42, %32
%36 = load i32, i32* %6
%37 = load i32, i32* %5
%38 = icmp slt i32 %36, %37
br i1 %38, label %39, label %45
39: ; preds = %35
%40 = load i8*, i8** %8
%41 = call i32 @strcat(i8* %40, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %42
42: ; preds = %39
%43 = load i32, i32* %6
%44 = add nsw i32 %43, 1
store i32 %44, i32* %6
br label %35
45: ; preds = %35
br label %46
46: ; preds = %45, %24
%47 = load i8*, i8** %8
%48 = call i32 @strcat(i8* %47, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%49 = load i8*, i8** %8
store i8* %49, i8** %3
br label %50
50: ; preds = %46, %23
%51 = load i8*, i8** %3
ret i8* %51
}

LLVM IR (-O2):
@.str = [2 x i8] c"(\00"
@.str.1 = [2 x i8] c" \00"
@.str.2 = [2 x i8] c"*\00"
@.str.3 = [2 x i8] c")\00"
define i8* @make_assignment_type_cast(i8* %0, i32 %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = trunc i64 %3 to i32
%5 = add i32 %1, 4
%6 = add i32 %5, %4
%7 = tail call i8* @malloc(i32 %6)
%8 = icmp eq i8* %7, null
br i1 %8, label %23, label %9
9: ; preds = %2
%10 = tail call i32 @strcpy(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%11 = tail call i32 @strcat(i8* %7, i8* %0)
%12 = icmp eq i32 %1, 0
br i1 %12, label %21, label %13
13: ; preds = %9
%14 = tail call i32 @strcat(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%15 = icmp sgt i32 %1, 0
br i1 %15, label %16, label %21
16: ; preds = %13, %16
%17 = phi i32 [ %19, %16 ], [ 0, %13 ]
%18 = tail call i32 @strcat(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%19 = add nuw nsw i32 %17, 1
%20 = icmp eq i32 %19, %1
br i1 %20, label %21, label %16
21: ; preds = %16, %13, %9
%22 = tail call i32 @strcat(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %23
23: ; preds = %2, %21
ret i8* %7
}