#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 */
struct opctx {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *genb_fpath(char *);
int /*<<< orphan*/ outputf(struct opctx *, char *, char *);
int output_tool_prologue(struct opctx *outc) {
  char *fpath;
  fpath = genb_fpath("binding.h");
  outputf(outc, "\n#include \"%s\"\n", fpath);
  free(fpath);
  fpath = genb_fpath("private.h");
  outputf(outc, "#include \"%s\"\n", fpath);
  free(fpath);
  fpath = genb_fpath("prototype.h");
  outputf(outc, "#include \"%s\"\n", fpath);
  free(fpath);
  return 0;
}


x86 assembly (clang, -O0):
<output_tool_prologue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
call   1040 <genb_fpath@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xeaf(%rip),%rsi
call   1050 <outputf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
lea    0xeaa(%rip),%rdi
call   1040 <genb_fpath@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe83(%rip),%rsi
call   1050 <outputf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
lea    0xe87(%rip),%rdi
call   1040 <genb_fpath@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe56(%rip),%rsi
call   1050 <outputf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_tool_prologue>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
lea    0xec1(%rip),%rdi
call   1040 <genb_fpath@plt>
mov    %rax,%rbx
lea    0xebc(%rip),%rsi
mov    %r14,%rdi
mov    %rax,%rdx
call   1050 <outputf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
lea    0xeb2(%rip),%rdi
call   1040 <genb_fpath@plt>
mov    %rax,%rbx
lea    0xe94(%rip),%r15
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rax,%rdx
call   1050 <outputf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
lea    0xe90(%rip),%rdi
call   1040 <genb_fpath@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rax,%rdx
call   1050 <outputf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.opctx = type { i32 }
@.str = [10 x i8] c"binding.h\00"
@.str.1 = [16 x i8] c"\0A#include \22%s\22\0A\00"
@.str.2 = [10 x i8] c"private.h\00"
@.str.3 = [15 x i8] c"#include \22%s\22\0A\00"
@.str.4 = [12 x i8] c"prototype.h\00"
define i32 @output_tool_prologue(%struct.opctx* %0) {
%2 = alloca %struct.opctx*
%3 = alloca i8*
store %struct.opctx* %0, %struct.opctx** %2
%4 = call i8* @genb_fpath(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
store i8* %4, i8** %3
%5 = load %struct.opctx*, %struct.opctx** %2
%6 = load i8*, i8** %3
%7 = call i32 @outputf(%struct.opctx* %5, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %3
%9 = call i32 @free(i8* %8)
%10 = call i8* @genb_fpath(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
store i8* %10, i8** %3
%11 = load %struct.opctx*, %struct.opctx** %2
%12 = load i8*, i8** %3
%13 = call i32 @outputf(%struct.opctx* %11, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8* %12)
%14 = load i8*, i8** %3
%15 = call i32 @free(i8* %14)
%16 = call i8* @genb_fpath(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
store i8* %16, i8** %3
%17 = load %struct.opctx*, %struct.opctx** %2
%18 = load i8*, i8** %3
%19 = call i32 @outputf(%struct.opctx* %17, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8* %18)
%20 = load i8*, i8** %3
%21 = call i32 @free(i8* %20)
ret i32 0
}

LLVM IR (-O2):
%struct.opctx = type { i32 }
@.str = [10 x i8] c"binding.h\00"
@.str.1 = [16 x i8] c"\0A#include \22%s\22\0A\00"
@.str.2 = [10 x i8] c"private.h\00"
@.str.3 = [15 x i8] c"#include \22%s\22\0A\00"
@.str.4 = [12 x i8] c"prototype.h\00"
define i32 @output_tool_prologue(%struct.opctx* %0) {
%2 = tail call i8* @genb_fpath(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @outputf(%struct.opctx* %0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%4 = tail call i32 @free(i8* %2)
%5 = tail call i8* @genb_fpath(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @outputf(%struct.opctx* %0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8* %5)
%7 = tail call i32 @free(i8* %5)
%8 = tail call i8* @genb_fpath(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
%9 = tail call i32 @outputf(%struct.opctx* %0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8* %8)
%10 = tail call i32 @free(i8* %8)
ret i32 0
}