#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*/ fprintf(int /*<<< orphan*/ *, char *, ...);
scalar_t__ strcmp(char const *, char *);
void CreateInitFile(const char *libName, FILE *fout) {
  const char *prefix = "";
  const char *dllexp = "VTK_ABI_EXPORT ";
  fprintf(fout, "// Generated by vtkWrapPythonInit in VTK/Wrapping\n");
  fprintf(fout, "#include \"vtkSystemIncludes.h\"\n");
  fprintf(fout,
          "// Handle compiler warning messages, etc.\n"
          "#if defined( _MSC_VER ) && !defined(VTK_DISPLAY_WIN32_WARNINGS)\n"
          "#pragma warning ( disable : 4706 )\n"
          "#endif // Windows Warnings \n\n");
  fprintf(fout, "extern \"C\" void real_init%s(const char *modulename);\n\n",
          libName);
  for (;;) {
    fprintf(fout, "extern  \"C\" { %svoid init%s%s(); }\n\n", dllexp, prefix,
            libName);
    fprintf(fout, "void init%s%s()\n{\n", prefix, libName);
    fprintf(fout, "  static const char modulename[] = \"%s%s\";\n", prefix,
            libName);
    fprintf(fout, "  real_init%s(modulename);\n}\n\n", libName);
    if (strcmp(prefix, "lib") != 0) {
      prefix = "lib";
      continue;
    }
    break;
  }
}


x86 assembly (clang, -O0):
<CreateInitFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xfd6(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xebe(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xebf(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xee0(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xeee(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xf83(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%r8
lea    0xf9c(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rcx
lea    0xfa7(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rcx
lea    0xfa0(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xfb6(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xfc3(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     1224 <CreateInitFile+0x104>
lea    0xfad(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1192 <CreateInitFile+0x72>
jmp    1229 <CreateInitFile+0x109>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CreateInitFile>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r13
mov    %rdi,%r14
lea    0xec8(%rip),%rdi
mov    $0x32,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1050 <fwrite@plt>
lea    0xee2(%rip),%rdi
mov    $0x1f,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1050 <fwrite@plt>
lea    0xee9(%rip),%rdi
mov    $0xaa,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1050 <fwrite@plt>
lea    0xf7b(%rip),%rsi
mov    %r13,%rdi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xf9e(%rip),%rsi
lea    0xe52(%rip),%rdx
lea    0xf58(%rip),%rbx
mov    %r13,%rdi
mov    %rbx,%rcx
mov    %r14,%r8
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xf9e(%rip),%rsi
mov    %r13,%rdi
mov    %rbx,%rdx
mov    %r14,%rcx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xf9a(%rip),%rsi
mov    %r13,%rdi
mov    %rbx,%rdx
mov    %r14,%rcx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xfaf(%rip),%rsi
mov    %r13,%rdi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xfba(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     12a4 <CreateInitFile+0x174>
lea    0xfa2(%rip),%rbx
lea    0xf3d(%rip),%rbp
lea    0xf49(%rip),%r15
lea    0xf6e(%rip),%r12
nopl   0x0(%rax,%rax,1)
mov    %r13,%rdi
lea    0xefb(%rip),%rsi
lea    0xdaf(%rip),%rdx
mov    %rbx,%rcx
mov    %r14,%r8
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    %r13,%rdi
mov    %rbp,%rsi
mov    %rbx,%rdx
mov    %r14,%rcx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    %r13,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
mov    %r14,%rcx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    %r13,%rdi
mov    %r12,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    %rbx,%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
jne    1240 <CreateInitFile+0x110>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [16 x i8] c"VTK_ABI_EXPORT \00"
@.str.2 = [51 x i8] c"// Generated by vtkWrapPythonInit in VTK/Wrapping\0A\00"
@.str.3 = [32 x i8] c"#include \22vtkSystemIncludes.h\22\0A\00"
@.str.4 = [171 x i8] c"// Handle compiler warning messages, etc.\0A#if defined( _MSC_VER ) && !defined(VTK_DISPLAY_WIN32_WARNINGS)\0A#pragma warning ( disable : 4706 )\0A#endif // Windows Warnings \0A\0A\00"
@.str.5 = [55 x i8] c"extern \22C\22 void real_init%s(const char *modulename);\0A\0A\00"
@.str.6 = [37 x i8] c"extern \22C\22 { %svoid init%s%s(); }\0A\0A\00"
@.str.7 = [19 x i8] c"void init%s%s()\0A{\0A\00"
@.str.8 = [44 x i8] c" static const char modulename[] = \22%s%s\22;\0A\00"
@.str.9 = [31 x i8] c" real_init%s(modulename);\0A}\0A\0A\00"
@.str.10 = [4 x i8] c"lib\00"
define void @CreateInitFile(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i32* %1, i32** %4
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %5
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8** %6
%7 = load i32*, i32** %4
%8 = call i32 (i32*, i8*, ...) @fprintf(i32* %7, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0))
%9 = load i32*, i32** %4
%10 = call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
%11 = load i32*, i32** %4
%12 = call i32 (i32*, i8*, ...) @fprintf(i32* %11, i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str.4, i64 0, i64 0))
%13 = load i32*, i32** %4
%14 = load i8*, i8** %3
%15 = call i32 (i32*, i8*, ...) @fprintf(i32* %13, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.5, i64 0, i64 0), i8* %14)
br label %16
16: ; preds = %36, %2
%17 = load i32*, i32** %4
%18 = load i8*, i8** %6
%19 = load i8*, i8** %5
%20 = load i8*, i8** %3
%21 = call i32 (i32*, i8*, ...) @fprintf(i32* %17, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.6, i64 0, i64 0), i8* %18, i8* %19, i8* %20)
%22 = load i32*, i32** %4
%23 = load i8*, i8** %5
%24 = load i8*, i8** %3
%25 = call i32 (i32*, i8*, ...) @fprintf(i32* %22, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i8* %23, i8* %24)
%26 = load i32*, i32** %4
%27 = load i8*, i8** %5
%28 = load i8*, i8** %3
%29 = call i32 (i32*, i8*, ...) @fprintf(i32* %26, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.8, i64 0, i64 0), i8* %27, i8* %28)
%30 = load i32*, i32** %4
%31 = load i8*, i8** %3
%32 = call i32 (i32*, i8*, ...) @fprintf(i32* %30, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.9, i64 0, i64 0), i8* %31)
%33 = load i8*, i8** %5
%34 = call i64 @strcmp(i8* %33, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
%35 = icmp ne i64 %34, 0
br i1 %35, label %36, label %37
36: ; preds = %16
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i8** %5
br label %16
37: ; preds = %16
br label %38
38: ; preds = %37
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [16 x i8] c"VTK_ABI_EXPORT \00"
@.str.2 = [51 x i8] c"// Generated by vtkWrapPythonInit in VTK/Wrapping\0A\00"
@.str.3 = [32 x i8] c"#include \22vtkSystemIncludes.h\22\0A\00"
@.str.4 = [171 x i8] c"// Handle compiler warning messages, etc.\0A#if defined( _MSC_VER ) && !defined(VTK_DISPLAY_WIN32_WARNINGS)\0A#pragma warning ( disable : 4706 )\0A#endif // Windows Warnings \0A\0A\00"
@.str.5 = [55 x i8] c"extern \22C\22 void real_init%s(const char *modulename);\0A\0A\00"
@.str.6 = [37 x i8] c"extern \22C\22 { %svoid init%s%s(); }\0A\0A\00"
@.str.7 = [19 x i8] c"void init%s%s()\0A{\0A\00"
@.str.8 = [44 x i8] c" static const char modulename[] = \22%s%s\22;\0A\00"
@.str.9 = [31 x i8] c" real_init%s(modulename);\0A}\0A\0A\00"
@.str.10 = [4 x i8] c"lib\00"
define void @CreateInitFile(i8* %0, i32* nocapture %1) {
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0), i64 50, i64 1, i32* %1)
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), i64 31, i64 1, i32* %1)
%5 = tail call i64 @fwrite(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str.4, i64 0, i64 0), i64 170, i64 1, i32* %1)
%6 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.5, i64 0, i64 0), i8* %0)
%7 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %0)
%8 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %0)
%9 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %0)
%10 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.9, i64 0, i64 0), i8* %0)
%11 = tail call i64 @strcmp(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %20, label %13
13: ; preds = %2, %13
%14 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i8* %0)
%15 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i8* %0)
%16 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i8* %0)
%17 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.9, i64 0, i64 0), i8* %0)
%18 = tail call i64 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %13
20: ; preds = %13, %2
ret void
}