#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 */
scalar_t__ calloc(int, int);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
char *Place_Campaign_Ship() {
  char *buffer;
  buffer = (char *)calloc(4096, sizeof(char));
  if (!buffer)
    return NULL;
  strcpy(buffer, "create_object 3\n");
  strcat(buffer, "model_file vessels/uscg378.3d\n");
  strcat(buffer, "translation -23758.0 34647.0 0.0\n");
  strcat(buffer, "rotate 300 0 0\n");
  strcat(buffer, "object_name uscg378_01\n");
  strcat(buffer, "create_helipad vehicle 29.0 18.0 3.2 USCG y y y y y "
                 "uscg378_01 0.0 -58.5 36.0  0.0 0.0 0.0\n");
  strcat(buffer, "object_name helipad_uscg\n");
  strcat(buffer, "object_map_description Coast Guard helipad\n");
  strcat(buffer, "range 2200\n");
  return buffer;
}


x86 assembly (clang, -O0):
<Place_Campaign_Ship>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1000,%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1163 <Place_Campaign_Ship+0x33>
movq   $0x0,-0x8(%rbp)
jmp    11fb <Place_Campaign_Ship+0xcb>
mov    -0x10(%rbp),%rdi
lea    0xe92(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
lea    0xe93(%rip),%rsi
call   1050 <strcat@plt>
mov    -0x10(%rbp),%rdi
lea    0xea2(%rip),%rsi
call   1050 <strcat@plt>
mov    -0x10(%rbp),%rdi
lea    0xeb4(%rip),%rsi
call   1050 <strcat@plt>
mov    -0x10(%rbp),%rdi
lea    0xeb4(%rip),%rsi
call   1050 <strcat@plt>
mov    -0x10(%rbp),%rdi
lea    0xebc(%rip),%rsi
call   1050 <strcat@plt>
mov    -0x10(%rbp),%rdi
lea    0xf08(%rip),%rsi
call   1050 <strcat@plt>
mov    -0x10(%rbp),%rdi
lea    0xf12(%rip),%rsi
call   1050 <strcat@plt>
mov    -0x10(%rbp),%rdi
lea    0xf2e(%rip),%rsi
call   1050 <strcat@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Place_Campaign_Ship>:
push   %rbx
mov    $0x1000,%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
test   %rax,%rax
je     11d5 <Place_Campaign_Ship+0xa5>
mov    %rax,%rbx
lea    0xead(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
lea    0xeaf(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcat@plt>
lea    0xebf(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcat@plt>
lea    0xed2(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcat@plt>
lea    0xed3(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcat@plt>
lea    0xedc(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcat@plt>
lea    0xf29(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcat@plt>
lea    0xf34(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcat@plt>
lea    0xf51(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcat@plt>
jmp    11d7 <Place_Campaign_Ship+0xa7>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"create_object 3\0A\00"
@.str.1 = [31 x i8] c"model_file vessels/uscg378.3d\0A\00"
@.str.2 = [34 x i8] c"translation -23758.0 34647.0 0.0\0A\00"
@.str.3 = [16 x i8] c"rotate 300 0 0\0A\00"
@.str.4 = [24 x i8] c"object_name uscg378_01\0A\00"
@.str.5 = [92 x i8] c"create_helipad vehicle 29.0 18.0 3.2 USCG y y y y y uscg378_01 0.0 -58.5 36.0 0.0 0.0 0.0\0A\00"
@.str.6 = [26 x i8] c"object_name helipad_uscg\0A\00"
@.str.7 = [44 x i8] c"object_map_description Coast Guard helipad\0A\00"
@.str.8 = [12 x i8] c"range 2200\0A\00"
define i8* @Place_Campaign_Ship() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i64 @calloc(i32 4096, i32 1)
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = icmp ne i8* %5, null
br i1 %6, label %8, label %7
7: ; preds = %0
store i8* null, i8** %1
br label %28
8: ; preds = %0
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %9, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%11 = load i8*, i8** %2
%12 = call i32 @strcat(i8* %11, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%13 = load i8*, i8** %2
%14 = call i32 @strcat(i8* %13, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0))
%15 = load i8*, i8** %2
%16 = call i32 @strcat(i8* %15, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%17 = load i8*, i8** %2
%18 = call i32 @strcat(i8* %17, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
%19 = load i8*, i8** %2
%20 = call i32 @strcat(i8* %19, i8* getelementptr inbounds ([92 x i8], [92 x i8]* @.str.5, i64 0, i64 0))
%21 = load i8*, i8** %2
%22 = call i32 @strcat(i8* %21, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0))
%23 = load i8*, i8** %2
%24 = call i32 @strcat(i8* %23, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.7, i64 0, i64 0))
%25 = load i8*, i8** %2
%26 = call i32 @strcat(i8* %25, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0))
%27 = load i8*, i8** %2
store i8* %27, i8** %1
br label %28
28: ; preds = %8, %7
%29 = load i8*, i8** %1
ret i8* %29
}

LLVM IR (-O2):
@.str = [17 x i8] c"create_object 3\0A\00"
@.str.1 = [31 x i8] c"model_file vessels/uscg378.3d\0A\00"
@.str.2 = [34 x i8] c"translation -23758.0 34647.0 0.0\0A\00"
@.str.3 = [16 x i8] c"rotate 300 0 0\0A\00"
@.str.4 = [24 x i8] c"object_name uscg378_01\0A\00"
@.str.5 = [92 x i8] c"create_helipad vehicle 29.0 18.0 3.2 USCG y y y y y uscg378_01 0.0 -58.5 36.0 0.0 0.0 0.0\0A\00"
@.str.6 = [26 x i8] c"object_name helipad_uscg\0A\00"
@.str.7 = [44 x i8] c"object_map_description Coast Guard helipad\0A\00"
@.str.8 = [12 x i8] c"range 2200\0A\00"
define i8* @Place_Campaign_Ship() {
%1 = tail call i64 @calloc(i32 4096, i32 1)
%2 = inttoptr i64 %1 to i8*
%3 = icmp eq i64 %1, 0
br i1 %3, label %14, label %4
4: ; preds = %0
%5 = tail call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @strcat(i8* %2, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @strcat(i8* %2, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0))
%8 = tail call i32 @strcat(i8* %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%9 = tail call i32 @strcat(i8* %2, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
%10 = tail call i32 @strcat(i8* %2, i8* getelementptr inbounds ([92 x i8], [92 x i8]* @.str.5, i64 0, i64 0))
%11 = tail call i32 @strcat(i8* %2, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0))
%12 = tail call i32 @strcat(i8* %2, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.7, i64 0, i64 0))
%13 = tail call i32 @strcat(i8* %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0))
br label %14
14: ; preds = %0, %4
%15 = phi i8* [ %2, %4 ], [ null, %0 ]
ret i8* %15
}