#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 */
int BUFSIZ;
int /*<<< orphan*/ generateStreamUrl(char *, char const *);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *, char const *,
                           char *);
void generateStarterScript(char *cmd, const char *ip) {
  char url[BUFSIZ];
  generateStreamUrl(url, ip);
  sprintf(cmd, "%s %s %s %s", url, "7578", ip, "4546");
}


x86 assembly (clang, -O0):
<generateStarterScript>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x28(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
call   1030 <generateStreamUrl@plt>
mov    -0x28(%rbp),%rdx
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%r8
lea    0xe88(%rip),%rsi
lea    0xe8d(%rip),%rcx
lea    0xe8b(%rip),%r9
call   1040 <sprintf@plt>
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generateStarterScript>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r15
mov    %rdi,%r14
mov    0x2ea9(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %rbx,%rdi
call   1030 <generateStreamUrl@plt>
lea    0xea7(%rip),%rsi
lea    0xeac(%rip),%rcx
lea    0xeaa(%rip),%r9
mov    %r14,%rdi
mov    %rbx,%rdx
mov    %r15,%r8
call   1040 <sprintf@plt>
lea    -0x18(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@BUFSIZ = global i32 0
@.str = [12 x i8] c"%s %s %s %s\00"
@.str.1 = [5 x i8] c"7578\00"
@.str.2 = [5 x i8] c"4546\00"
define void @generateStarterScript(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i32, i32* @BUFSIZ
%8 = zext i32 %7 to i64
%9 = call i8* @llvm.stacksave()
store i8* %9, i8** %5
%10 = alloca i8, i64 %8
store i64 %8, i64* %6
%11 = load i8*, i8** %4
%12 = call i32 @generateStreamUrl(i8* %10, i8* %11)
%13 = load i8*, i8** %3
%14 = load i8*, i8** %4
%15 = call i32 @sprintf(i8* %13, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %14, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%16 = load i8*, i8** %5
ret void
}

LLVM IR (-O2):
@BUFSIZ = global i32 0
@.str = [12 x i8] c"%s %s %s %s\00"
@.str.1 = [5 x i8] c"7578\00"
@.str.2 = [5 x i8] c"4546\00"
define void @generateStarterScript(i8* nocapture writeonly %0, i8* %1) {
%3 = load i32, i32* @BUFSIZ
%4 = zext i32 %3 to i64
%5 = alloca i8, i64 %4
%6 = call i32 @generateStreamUrl(i8* %5, i8* %1)
%7 = call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
ret void
}