#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int taka_tvpp_create_module_template(char const *, int /*<<< orphan*/ *);
int taka_tvpp_create_simulation_template(char const *, char const,
                                         int /*<<< orphan*/ *);
int taka_tvpp_create_template(const char *orig_file, const char cc,
                              FILE *cerr) {
  int err;
  err = taka_tvpp_create_module_template(orig_file, cerr);
  if (err)
    return (err);
  err = taka_tvpp_create_simulation_template(orig_file, cc, cerr);
  if (err)
    return (err);
  return (err);
}


x86 assembly (clang, -O0):
<taka_tvpp_create_template>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <taka_tvpp_create_module_template@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     115b <taka_tvpp_create_template+0x3b>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    118c <taka_tvpp_create_template+0x6c>
mov    -0x10(%rbp),%rdi
mov    -0x11(%rbp),%al
mov    -0x20(%rbp),%rdx
movsbl %al,%esi
call   1030 <taka_tvpp_create_simulation_template@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     1186 <taka_tvpp_create_template+0x66>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    118c <taka_tvpp_create_template+0x6c>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<taka_tvpp_create_template>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %rdx,%rsi
call   1040 <taka_tvpp_create_module_template@plt>
test   %eax,%eax
je     113d <taka_tvpp_create_template+0x1d>
pop    %rbx
pop    %r14
pop    %rbp
ret
movsbl %bpl,%esi
mov    %rbx,%rdi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <taka_tvpp_create_simulation_template@plt>

LLVM IR (-O0):
define i32 @taka_tvpp_create_template(i8* %0, i8 signext %1, i32* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8
%7 = alloca i32*
%8 = alloca i32
store i8* %0, i8** %5
store i8 %1, i8* %6
store i32* %2, i32** %7
%9 = load i8*, i8** %5
%10 = load i32*, i32** %7
%11 = call i32 @taka_tvpp_create_module_template(i8* %9, i32* %10)
store i32 %11, i32* %8
%12 = load i32, i32* %8
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %3
%15 = load i32, i32* %8
store i32 %15, i32* %4
br label %27
16: ; preds = %3
%17 = load i8*, i8** %5
%18 = load i8, i8* %6
%19 = load i32*, i32** %7
%20 = call i32 @taka_tvpp_create_simulation_template(i8* %17, i8 signext %18, i32* %19)
store i32 %20, i32* %8
%21 = load i32, i32* %8
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %16
%24 = load i32, i32* %8
store i32 %24, i32* %4
br label %27
25: ; preds = %16
%26 = load i32, i32* %8
store i32 %26, i32* %4
br label %27
27: ; preds = %25, %23, %14
%28 = load i32, i32* %4
ret i32 %28
}

LLVM IR (-O2):
define i32 @taka_tvpp_create_template(i8* %0, i8 signext %1, i32* %2) {
%4 = tail call i32 @taka_tvpp_create_module_template(i8* %0, i32* %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @taka_tvpp_create_simulation_template(i8* %0, i8 signext %1, i32* %2)
br label %8
8: ; preds = %6, %3
%9 = phi i32 [ %4, %3 ], [ %7, %6 ]
ret i32 %9
}