#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*/ parse_file(char *, char *, char **, int);
int /*<<< orphan*/ printf(char *, char *, char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *, char *);
void make_source(char *module_name) {
  printf("Make source file %s/%s/%s.c \n", "./", module_name, module_name);
  char new_file_name[128];
  char *replace_args[] = {"{{module_name}}", module_name};
  sprintf(new_file_name, "%s/%s/%s.c", "./", module_name, module_name);
  parse_file("tpls/source.tpl", new_file_name, replace_args, 2);
}


x86 assembly (clang, -O0):
<make_source>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x8(%rbp),%rcx
lea    0xeb2(%rip),%rdi
lea    0xec9(%rip),%rsi
call   1030 <printf@plt>
lea    0xec0(%rip),%rax
mov    %rax,-0xa0(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x98(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    -0x8(%rbp),%r8
lea    0xea8(%rip),%rsi
lea    0xe8e(%rip),%rdx
call   1050 <sprintf@plt>
lea    -0x90(%rbp),%rsi
lea    -0xa0(%rbp),%rdx
lea    0xe92(%rip),%rdi
mov    $0x2,%ecx
call   1040 <parse_file@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_source>:
push   %r15
push   %r14
push   %rbx
sub    $0x90,%rsp
mov    %rdi,%rbx
lea    0xeba(%rip),%rdi
lea    0xed1(%rip),%r14
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %rbx,%rcx
call   1030 <printf@plt>
lea    0xebf(%rip),%rax
mov    %rax,(%rsp)
mov    %rbx,0x8(%rsp)
lea    0xebf(%rip),%rsi
lea    0x10(%rsp),%r15
mov    %r15,%rdi
mov    %r14,%rdx
mov    %rbx,%rcx
mov    %rbx,%r8
call   1050 <sprintf@plt>
lea    0xead(%rip),%rdi
mov    %rsp,%rdx
mov    %r15,%rsi
mov    $0x2,%ecx
call   1040 <parse_file@plt>
add    $0x90,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Make source file %s/%s/%s.c \0A\00"
@.str.1 = [3 x i8] c"./\00"
@.str.2 = [16 x i8] c"{{module_name}}\00"
@.str.3 = [11 x i8] c"%s/%s/%s.c\00"
@.str.4 = [16 x i8] c"tpls/source.tpl\00"
define void @make_source(i8* %0) {
%2 = alloca i8*
%3 = alloca [128 x i8]
%4 = alloca [2 x i8*]
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %5, i8* %6)
%8 = getelementptr inbounds [2 x i8*], [2 x i8*]* %4, i64 0, i64 0
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8** %8
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %2
store i8* %10, i8** %9
%11 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%12 = load i8*, i8** %2
%13 = load i8*, i8** %2
%14 = call i32 @sprintf(i8* %11, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %12, i8* %13)
%15 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%16 = getelementptr inbounds [2 x i8*], [2 x i8*]* %4, i64 0, i64 0
%17 = call i32 @parse_file(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i8* %15, i8** %16, i32 2)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"Make source file %s/%s/%s.c \0A\00"
@.str.1 = [3 x i8] c"./\00"
@.str.2 = [16 x i8] c"{{module_name}}\00"
@.str.3 = [11 x i8] c"%s/%s/%s.c\00"
@.str.4 = [16 x i8] c"tpls/source.tpl\00"
define void @make_source(i8* %0) {
%2 = alloca [128 x i8]
%3 = alloca [2 x i8*]
%4 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %0)
%5 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%6 = bitcast [2 x i8*]* %3 to i8*
%7 = getelementptr inbounds [2 x i8*], [2 x i8*]* %3, i64 0, i64 0
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8** %7
%8 = getelementptr inbounds [2 x i8*], [2 x i8*]* %3, i64 0, i64 1
store i8* %0, i8** %8
%9 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %0)
%10 = call i32 @parse_file(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i8* %5, i8** %7, i32 2)
ret void
}