#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 /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
int /*<<< orphan*/ stderr;
int strlen(char *);
void open_standard_gen_files(FILE **h_fptr, FILE **cv_h_fptr, FILE **cv_c_fptr,
                             char *message_name) {
  int len = strlen(message_name);
  char h_fname[len + 6 + 1];
  char cv_h_fname[len + 8 + 1];
  char cv_c_fname[len + 8 + 1];
  sprintf(h_fname, "%s%s", message_name, "_set_h");
  sprintf(cv_h_fname, "%s%s", message_name, "_set_c_h");
  sprintf(cv_c_fname, "%s%s", message_name, "_set_c_c");
  if ((*h_fptr = fopen(h_fname, "w+")) == NULL) {
    fprintf(stderr, "[ERROR]: cannot create %s! aborting\n", h_fname);
    exit(-1);
  }
  if ((*cv_h_fptr = fopen(cv_h_fname, "w+")) == NULL) {
    fprintf(stderr, "[ERROR]: cannot create %s! aborting\n", cv_h_fname);
    exit(-1);
  }
  if ((*cv_c_fptr = fopen(cv_c_fname, "w+")) == NULL) {
    fprintf(stderr, "[ERROR]: cannot create %s! aborting\n", cv_c_fname);
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<open_standard_gen_files>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x7,%eax
mov    %rsp,%rcx
mov    %rcx,-0x30(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x50(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x38(%rbp)
mov    -0x24(%rbp),%eax
add    $0x9,%eax
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x60(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x40(%rbp)
mov    -0x24(%rbp),%eax
add    $0x9,%eax
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x58(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x48(%rbp)
mov    -0x20(%rbp),%rdx
lea    0xe14(%rip),%rsi
lea    0xe12(%rip),%rcx
call   1060 <sprintf@plt>
mov    -0x60(%rbp),%rdi
mov    -0x20(%rbp),%rdx
lea    0xdf9(%rip),%rsi
lea    0xdfe(%rip),%rcx
call   1060 <sprintf@plt>
mov    -0x58(%rbp),%rdi
mov    -0x20(%rbp),%rdx
lea    0xdde(%rip),%rsi
lea    0xdec(%rip),%rcx
call   1060 <sprintf@plt>
mov    -0x50(%rbp),%rdi
lea    0xde5(%rip),%rsi
call   1050 <fopen@plt>
mov    -0x8(%rbp),%rcx
mov    %rax,(%rcx)
cmp    $0x0,%rax
jne    1272 <open_standard_gen_files+0x122>
mov    -0x50(%rbp),%rdx
mov    0x2d86(%rip),%rax
mov    (%rax),%edi
lea    0xdbe(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
mov    -0x60(%rbp),%rdi
lea    0xda1(%rip),%rsi
call   1050 <fopen@plt>
mov    -0x10(%rbp),%rcx
mov    %rax,(%rcx)
cmp    $0x0,%rax
jne    12b6 <open_standard_gen_files+0x166>
mov    -0x60(%rbp),%rdx
mov    0x2d42(%rip),%rax
mov    (%rax),%edi
lea    0xd7a(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
mov    -0x58(%rbp),%rdi
lea    0xd5d(%rip),%rsi
call   1050 <fopen@plt>
mov    -0x18(%rbp),%rcx
mov    %rax,(%rcx)
cmp    $0x0,%rax
jne    12fa <open_standard_gen_files+0x1aa>
mov    -0x58(%rbp),%rdx
mov    0x2cfe(%rip),%rax
mov    (%rax),%edi
lea    0xd36(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
mov    -0x30(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_standard_gen_files>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rcx,%r15
mov    %rdx,-0x30(%rbp)
mov    %rsi,-0x38(%rbp)
mov    %rdi,-0x40(%rbp)
mov    %rcx,%rdi
call   1030 <strlen@plt>
lea    0x7(%rax),%ecx
mov    %rsp,%rbx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
sub    %rcx,%rbx
mov    %rbx,%rsp
add    $0x9,%eax
mov    %rsp,%r14
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r14
mov    %r14,%rsp
mov    %rsp,%r13
sub    %rax,%r13
mov    %r13,%rsp
lea    0xe50(%rip),%r12
lea    0xe4e(%rip),%rcx
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
call   1060 <sprintf@plt>
lea    0xe40(%rip),%rcx
mov    %r14,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
call   1060 <sprintf@plt>
lea    0xe34(%rip),%rcx
mov    %r13,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
call   1060 <sprintf@plt>
lea    0xe28(%rip),%rsi
mov    %rbx,%rdi
call   1050 <fopen@plt>
mov    -0x40(%rbp),%rcx
mov    %rax,(%rcx)
test   %rax,%rax
je     124f <open_standard_gen_files+0xff>
lea    0xe0d(%rip),%rsi
mov    %r14,%rdi
call   1050 <fopen@plt>
mov    -0x38(%rbp),%rcx
mov    %rax,(%rcx)
test   %rax,%rax
je     1264 <open_standard_gen_files+0x114>
lea    0xdf2(%rip),%rsi
mov    %r13,%rdi
call   1050 <fopen@plt>
mov    -0x30(%rbp),%rcx
mov    %rax,(%rcx)
test   %rax,%rax
je     1279 <open_standard_gen_files+0x129>
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2d8a(%rip),%rax
mov    (%rax),%edi
lea    0xdc2(%rip),%rsi
mov    %rbx,%rdx
jmp    128c <open_standard_gen_files+0x13c>
mov    0x2d75(%rip),%rax
mov    (%rax),%edi
lea    0xdad(%rip),%rsi
mov    %r14,%rdx
jmp    128c <open_standard_gen_files+0x13c>
mov    0x2d60(%rip),%rax
mov    (%rax),%edi
lea    0xd98(%rip),%rsi
mov    %r13,%rdx
call   1040 <fprintf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%s%s\00"
@.str.1 = [7 x i8] c"_set_h\00"
@.str.2 = [9 x i8] c"_set_c_h\00"
@.str.3 = [9 x i8] c"_set_c_c\00"
@.str.4 = [3 x i8] c"w+\00"
@stderr = global i32 0
@.str.5 = [37 x i8] c"[ERROR]: cannot create %s! aborting\0A\00"
define void @open_standard_gen_files(i32** %0, i32** %1, i32** %2, i8* %3) {
%5 = alloca i32**
%6 = alloca i32**
%7 = alloca i32**
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
store i32** %0, i32*** %5
store i32** %1, i32*** %6
store i32** %2, i32*** %7
store i8* %3, i8** %8
%14 = load i8*, i8** %8
%15 = call i32 @strlen(i8* %14)
store i32 %15, i32* %9
%16 = load i32, i32* %9
%17 = add nsw i32 %16, 6
%18 = add nsw i32 %17, 1
%19 = zext i32 %18 to i64
%20 = call i8* @llvm.stacksave()
store i8* %20, i8** %10
%21 = alloca i8, i64 %19
store i64 %19, i64* %11
%22 = load i32, i32* %9
%23 = add nsw i32 %22, 8
%24 = add nsw i32 %23, 1
%25 = zext i32 %24 to i64
%26 = alloca i8, i64 %25
store i64 %25, i64* %12
%27 = load i32, i32* %9
%28 = add nsw i32 %27, 8
%29 = add nsw i32 %28, 1
%30 = zext i32 %29 to i64
%31 = alloca i8, i64 %30
store i64 %30, i64* %13
%32 = load i8*, i8** %8
%33 = call i32 @sprintf(i8* %21, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %32, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%34 = load i8*, i8** %8
%35 = call i32 @sprintf(i8* %26, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %34, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%36 = load i8*, i8** %8
%37 = call i32 @sprintf(i8* %31, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %36, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%38 = call i32* @fopen(i8* %21, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%39 = load i32**, i32*** %5
store i32* %38, i32** %39
%40 = icmp eq i32* %38, null
br i1 %40, label %41, label %45
41: ; preds = %4
%42 = load i32, i32* @stderr
%43 = call i32 @fprintf(i32 %42, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0), i8* %21)
%44 = call i32 @exit(i32 -1)
unreachable
45: ; preds = %4
%46 = call i32* @fopen(i8* %26, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%47 = load i32**, i32*** %6
store i32* %46, i32** %47
%48 = icmp eq i32* %46, null
br i1 %48, label %49, label %53
49: ; preds = %45
%50 = load i32, i32* @stderr
%51 = call i32 @fprintf(i32 %50, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0), i8* %26)
%52 = call i32 @exit(i32 -1)
unreachable
53: ; preds = %45
%54 = call i32* @fopen(i8* %31, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%55 = load i32**, i32*** %7
store i32* %54, i32** %55
%56 = icmp eq i32* %54, null
br i1 %56, label %57, label %61
57: ; preds = %53
%58 = load i32, i32* @stderr
%59 = call i32 @fprintf(i32 %58, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0), i8* %31)
%60 = call i32 @exit(i32 -1)
unreachable
61: ; preds = %53
%62 = load i8*, i8** %10
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s%s\00"
@.str.1 = [7 x i8] c"_set_h\00"
@.str.2 = [9 x i8] c"_set_c_h\00"
@.str.3 = [9 x i8] c"_set_c_c\00"
@.str.4 = [3 x i8] c"w+\00"
@stderr = global i32 0
@.str.5 = [37 x i8] c"[ERROR]: cannot create %s! aborting\0A\00"
define void @open_standard_gen_files(i32** nocapture writeonly %0, i32** nocapture writeonly %1, i32** nocapture writeonly %2, i8* %3) {
%5 = tail call i32 @strlen(i8* %3)
%6 = add nsw i32 %5, 7
%7 = zext i32 %6 to i64
%8 = alloca i8, i64 %7
%9 = add nsw i32 %5, 9
%10 = zext i32 %9 to i64
%11 = alloca i8, i64 %10
%12 = alloca i8, i64 %10
%13 = call i32 @sprintf(i8* %8, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%14 = call i32 @sprintf(i8* %11, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%15 = call i32 @sprintf(i8* %12, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%16 = call i32* @fopen(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
store i32* %16, i32** %0
%17 = icmp eq i32* %16, null
br i1 %17, label %18, label %22
18: ; preds = %4
%19 = load i32, i32* @stderr
%20 = call i32 @fprintf(i32 %19, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0), i8* %8)
%21 = call i32 @exit(i32 -1)
unreachable
22: ; preds = %4
%23 = call i32* @fopen(i8* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
store i32* %23, i32** %1
%24 = icmp eq i32* %23, null
br i1 %24, label %25, label %29
25: ; preds = %22
%26 = load i32, i32* @stderr
%27 = call i32 @fprintf(i32 %26, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0), i8* %11)
%28 = call i32 @exit(i32 -1)
unreachable
29: ; preds = %22
%30 = call i32* @fopen(i8* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
store i32* %30, i32** %2
%31 = icmp eq i32* %30, null
br i1 %31, label %32, label %36
32: ; preds = %29
%33 = load i32, i32* @stderr
%34 = call i32 @fprintf(i32 %33, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0), i8* %12)
%35 = call i32 @exit(i32 -1)
unreachable
36: ; preds = %29
ret void
}