#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 /*<<< orphan*/ get_include_flags(char *, int, char **);
int /*<<< orphan*/ sprintf(char *, char *, char const *, char *, char const *);
void construct_cproto_command_line(char *dst, const char *cproto, int argc,
                                   char *argv[]) {
  char iflags[1024];
  const char *filename = argv[2];
  get_include_flags(iflags, argc, argv);
  sprintf(dst, "\"%s\" -i -s -x %s \"%s\" 2>/dev/null", cproto, iflags,
          filename);
}


x86 assembly (clang, -O0):
<construct_cproto_command_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x430,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x428(%rbp)
lea    -0x420(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
call   1030 <get_include_flags@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    -0x420(%rbp),%rcx
mov    -0x428(%rbp),%r8
lea    0xe87(%rip),%rsi
call   1040 <sprintf@plt>
add    $0x430,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<construct_cproto_command_line>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x408,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x10(%rcx),%r15
mov    %rsp,%r12
mov    %r12,%rdi
mov    %edx,%esi
mov    %rcx,%rdx
call   1030 <get_include_flags@plt>
lea    0xeb1(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
mov    %r12,%rcx
mov    %r15,%r8
call   1040 <sprintf@plt>
add    $0x408,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [34 x i8] c"\22%s\22 -i -s -x %s \22%s\22 2>/dev/null\00"
define void @construct_cproto_command_line(i8* %0, i8* %1, i32 %2, i8** %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8**
%9 = alloca [1024 x i8]
%10 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8** %3, i8*** %8
%11 = load i8**, i8*** %8
%12 = getelementptr inbounds i8*, i8** %11, i64 2
%13 = load i8*, i8** %12
store i8* %13, i8** %10
%14 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%15 = load i32, i32* %7
%16 = load i8**, i8*** %8
%17 = call i32 @get_include_flags(i8* %14, i32 %15, i8** %16)
%18 = load i8*, i8** %5
%19 = load i8*, i8** %6
%20 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%21 = load i8*, i8** %10
%22 = call i32 @sprintf(i8* %18, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %19, i8* %20, i8* %21)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"\22%s\22 -i -s -x %s \22%s\22 2>/dev/null\00"
define void @construct_cproto_command_line(i8* nocapture writeonly %0, i8* %1, i32 %2, i8** %3) {
%5 = alloca [1024 x i8]
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%7 = getelementptr inbounds i8*, i8** %3, i64 2
%8 = load i8*, i8** %7
%9 = call i32 @get_include_flags(i8* %6, i32 %2, i8** %3)
%10 = call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %6, i8* %8)
ret void
}