#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*/ close_the_file(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ gen_scalar_indices1(int /*<<< orphan*/ *,
                                       int /*<<< orphan*/ **);
int /*<<< orphan*/ gen_scalar_indices_init(int /*<<< orphan*/ *);
int /*<<< orphan*/ gen_scalar_tables(int /*<<< orphan*/ *);
int /*<<< orphan*/ gen_scalar_tables_init(int /*<<< orphan*/ *);
int /*<<< orphan*/ print_warning(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ sprintf(char *, char *, ...);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
int gen_scalar_indices(char *dirname) {
  FILE *fp, *fp5[26];
  char fname[512], fname5[512];
  char *fn = "scalar_indices.inc";
  char *fn2 = "scalar_tables.inc";
  char *fn3 = "scalar_tables_init.inc";
  char *fn4 = "scalar_indices_init.inc";
  int i;
  char fn5[26][512];
  strcpy(fname, fn);
  if (strlen(dirname) > 0) {
    sprintf(fname, "%s/%s", dirname, fn);
  }
  if ((fp = fopen(fname, "w")) == NULL)
    return (1);
  print_warning(fp, fname);
  for (i = 0; i < 26; i++) {
    sprintf(fn5[i], "in_use_for_config_%c.inc", 'a' + i);
    strcpy(fname5, fn5[i]);
    if (strlen(dirname) > 0) {
      sprintf(fname5, "%s/%s", dirname, fn5[i]);
    }
    if ((fp5[i] = fopen(fname5, "w")) == NULL)
      return (1);
    print_warning(fp5[i], fname5);
  }
  gen_scalar_indices1(fp, fp5);
  close_the_file(fp);
  for (i = 0; i < 26; i++) {
    close_the_file(fp5[i]);
  }
  strcpy(fname, fn2);
  if (strlen(dirname) > 0) {
    sprintf(fname, "%s/%s", dirname, fn2);
  }
  if ((fp = fopen(fname, "w")) == NULL) {
    fprintf(stderr, "returning\n");
    return (1);
  }
  print_warning(fp, fname);
  gen_scalar_tables(fp);
  close_the_file(fp);
  strcpy(fname, fn3);
  if (strlen(dirname) > 0) {
    sprintf(fname, "%s/%s", dirname, fn3);
  }
  if ((fp = fopen(fname, "w")) == NULL) {
    fprintf(stderr, "returning\n");
    return (1);
  }
  print_warning(fp, fname);
  gen_scalar_tables_init(fp);
  close_the_file(fp);
  strcpy(fname, fn4);
  if (strlen(dirname) > 0) {
    sprintf(fname, "%s/%s", dirname, fn4);
  }
  if ((fp = fopen(fname, "w")) == NULL) {
    fprintf(stderr, "returning\n");
    return (1);
  }
  print_warning(fp, fname);
  gen_scalar_indices_init(fp);
  close_the_file(fp);
  return (0);
}


x86 assembly (clang, -O0):
<gen_scalar_indices>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3920,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xe3a(%rip),%rax
mov    %rax,-0x4f8(%rbp)
lea    0xe3f(%rip),%rax
mov    %rax,-0x500(%rbp)
lea    0xe43(%rip),%rax
mov    %rax,-0x508(%rbp)
lea    0xe4c(%rip),%rax
mov    %rax,-0x510(%rbp)
lea    -0x2f0(%rbp),%rdi
mov    -0x4f8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x0,%rax
jle    123d <gen_scalar_indices+0x8d>
lea    -0x2f0(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x4f8(%rbp),%rcx
lea    0xe1e(%rip),%rsi
mov    $0x0,%al
call   10c0 <sprintf@plt>
lea    -0x2f0(%rbp),%rdi
lea    0xe0f(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    126a <gen_scalar_indices+0xba>
movl   $0x1,-0x4(%rbp)
jmp    15e3 <gen_scalar_indices+0x433>
mov    -0x18(%rbp),%rdi
lea    -0x2f0(%rbp),%rsi
call   1050 <print_warning@plt>
movl   $0x0,-0x514(%rbp)
cmpl   $0x1a,-0x514(%rbp)
jge    1386 <gen_scalar_indices+0x1d6>
movslq -0x514(%rbp),%rax
lea    -0x3920(%rbp),%rdi
shl    $0x9,%rax
add    %rax,%rdi
mov    -0x514(%rbp),%edx
add    $0x61,%edx
lea    0xda6(%rip),%rsi
mov    $0x0,%al
call   10c0 <sprintf@plt>
lea    -0x4f0(%rbp),%rdi
movslq -0x514(%rbp),%rax
lea    -0x3920(%rbp),%rsi
shl    $0x9,%rax
add    %rax,%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x0,%rax
jle    131f <gen_scalar_indices+0x16f>
lea    -0x4f0(%rbp),%rdi
mov    -0x10(%rbp),%rdx
movslq -0x514(%rbp),%rax
lea    -0x3920(%rbp),%rcx
shl    $0x9,%rax
add    %rax,%rcx
lea    0xd3c(%rip),%rsi
mov    $0x0,%al
call   10c0 <sprintf@plt>
lea    -0x4f0(%rbp),%rdi
lea    0xd2d(%rip),%rsi
call   10b0 <fopen@plt>
movslq -0x514(%rbp),%rcx
mov    %rax,-0xf0(%rbp,%rcx,8)
ff
cmp    $0x0,%rax
jne    1357 <gen_scalar_indices+0x1a7>
movl   $0x1,-0x4(%rbp)
jmp    15e3 <gen_scalar_indices+0x433>
movslq -0x514(%rbp),%rax
mov    -0xf0(%rbp,%rax,8),%rdi
ff
lea    -0x4f0(%rbp),%rsi
call   1050 <print_warning@plt>
mov    -0x514(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x514(%rbp)
jmp    1284 <gen_scalar_indices+0xd4>
mov    -0x18(%rbp),%rdi
lea    -0xf0(%rbp),%rsi
call   1080 <gen_scalar_indices1@plt>
mov    -0x18(%rbp),%rdi
call   1090 <close_the_file@plt>
movl   $0x0,-0x514(%rbp)
cmpl   $0x1a,-0x514(%rbp)
jge    13de <gen_scalar_indices+0x22e>
movslq -0x514(%rbp),%rax
mov    -0xf0(%rbp,%rax,8),%rdi
ff
call   1090 <close_the_file@plt>
mov    -0x514(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x514(%rbp)
jmp    13a9 <gen_scalar_indices+0x1f9>
lea    -0x2f0(%rbp),%rdi
mov    -0x500(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x0,%rax
jle    1424 <gen_scalar_indices+0x274>
lea    -0x2f0(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x500(%rbp),%rcx
lea    0xc37(%rip),%rsi
mov    $0x0,%al
call   10c0 <sprintf@plt>
lea    -0x2f0(%rbp),%rdi
lea    0xc28(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1466 <gen_scalar_indices+0x2b6>
mov    0x2b94(%rip),%rax
mov    (%rax),%edi
lea    0xc20(%rip),%rsi
call   10a0 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    15e3 <gen_scalar_indices+0x433>
mov    -0x18(%rbp),%rdi
lea    -0x2f0(%rbp),%rsi
call   1050 <print_warning@plt>
mov    -0x18(%rbp),%rdi
call   1070 <gen_scalar_tables@plt>
mov    -0x18(%rbp),%rdi
call   1090 <close_the_file@plt>
lea    -0x2f0(%rbp),%rdi
mov    -0x508(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x0,%rax
jle    14ce <gen_scalar_indices+0x31e>
lea    -0x2f0(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x508(%rbp),%rcx
lea    0xb8d(%rip),%rsi
mov    $0x0,%al
call   10c0 <sprintf@plt>
lea    -0x2f0(%rbp),%rdi
lea    0xb7e(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1510 <gen_scalar_indices+0x360>
mov    0x2aea(%rip),%rax
mov    (%rax),%edi
lea    0xb76(%rip),%rsi
call   10a0 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    15e3 <gen_scalar_indices+0x433>
mov    -0x18(%rbp),%rdi
lea    -0x2f0(%rbp),%rsi
call   1050 <print_warning@plt>
mov    -0x18(%rbp),%rdi
call   1060 <gen_scalar_tables_init@plt>
mov    -0x18(%rbp),%rdi
call   1090 <close_the_file@plt>
lea    -0x2f0(%rbp),%rdi
mov    -0x510(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x0,%rax
jle    1578 <gen_scalar_indices+0x3c8>
lea    -0x2f0(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x510(%rbp),%rcx
lea    0xae3(%rip),%rsi
mov    $0x0,%al
call   10c0 <sprintf@plt>
lea    -0x2f0(%rbp),%rdi
lea    0xad4(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    15ba <gen_scalar_indices+0x40a>
mov    0x2a40(%rip),%rax
mov    (%rax),%edi
lea    0xacc(%rip),%rsi
call   10a0 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    15e3 <gen_scalar_indices+0x433>
mov    -0x18(%rbp),%rdi
lea    -0x2f0(%rbp),%rsi
call   1050 <print_warning@plt>
mov    -0x18(%rbp),%rdi
call   10d0 <gen_scalar_indices_init@plt>
mov    -0x18(%rbp),%rdi
call   1090 <close_the_file@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x3920,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_scalar_indices>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38e8,%rsp
mov    %rdi,%r12
lea    0xe35(%rip),%rsi
lea    0xe0(%rsp),%rdi
call   1030 <strcpy@plt>
mov    %r12,%rdi
call   1040 <strlen@plt>
test   %rax,%rax
jle    1205 <gen_scalar_indices+0x55>
lea    0xe68(%rip),%rsi
lea    0xe0d(%rip),%rcx
lea    0xe0(%rsp),%rdi
mov    %r12,%rdx
xor    %eax,%eax
call   10c0 <sprintf@plt>
lea    0xe4e(%rip),%rsi
lea    0xe0(%rsp),%rdi
call   10b0 <fopen@plt>
mov    %rax,%rdi
mov    $0x1,%eax
test   %rdi,%rdi
je     15b0 <gen_scalar_indices+0x400>
lea    0xe0(%rsp),%rsi
mov    %rdi,0x8(%rsp)
call   1050 <print_warning@plt>
lea    0x4e0(%rsp),%rbp
lea    0xe11(%rip),%r13
lea    0x2e0(%rsp),%rbx
lea    0xe00(%rip),%r15
xor    %r14d,%r14d
nopl   (%rax)
lea    0x61(%r14),%edx
mov    %rbp,%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   10c0 <sprintf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1030 <strcpy@plt>
mov    %r12,%rdi
call   1040 <strlen@plt>
test   %rax,%rax
jle    12a0 <gen_scalar_indices+0xf0>
mov    %rbx,%rdi
lea    0xdc1(%rip),%rsi
mov    %r12,%rdx
mov    %rbp,%rcx
xor    %eax,%eax
call   10c0 <sprintf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   10b0 <fopen@plt>
mov    %rax,0x10(%rsp,%r14,8)
test   %rax,%rax
je     15ab <gen_scalar_indices+0x3fb>
mov    %rax,%rdi
mov    %rbx,%rsi
call   1050 <print_warning@plt>
add    $0x1,%r14
add    $0x200,%rbp
cmp    $0x1a,%r14
jne    1260 <gen_scalar_indices+0xb0>
lea    0x10(%rsp),%rsi
mov    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1080 <gen_scalar_indices1@plt>
mov    %rbx,%rdi
call   1090 <close_the_file@plt>
mov    0x10(%rsp),%rdi
call   1090 <close_the_file@plt>
mov    0x18(%rsp),%rdi
call   1090 <close_the_file@plt>
mov    0x20(%rsp),%rdi
call   1090 <close_the_file@plt>
mov    0x28(%rsp),%rdi
call   1090 <close_the_file@plt>
mov    0x30(%rsp),%rdi
call   1090 <close_the_file@plt>
mov    0x38(%rsp),%rdi
call   1090 <close_the_file@plt>
mov    0x40(%rsp),%rdi
call   1090 <close_the_file@plt>
mov    0x48(%rsp),%rdi
call   1090 <close_the_file@plt>
mov    0x50(%rsp),%rdi
call   1090 <close_the_file@plt>
mov    0x58(%rsp),%rdi
call   1090 <close_the_file@plt>
mov    0x60(%rsp),%rdi
call   1090 <close_the_file@plt>
mov    0x68(%rsp),%rdi
call   1090 <close_the_file@plt>
mov    0x70(%rsp),%rdi
call   1090 <close_the_file@plt>
mov    0x78(%rsp),%rdi
call   1090 <close_the_file@plt>
mov    0x80(%rsp),%rdi
call   1090 <close_the_file@plt>
mov    0x88(%rsp),%rdi
call   1090 <close_the_file@plt>
mov    0x90(%rsp),%rdi
call   1090 <close_the_file@plt>
mov    0x98(%rsp),%rdi
call   1090 <close_the_file@plt>
mov    0xa0(%rsp),%rdi
call   1090 <close_the_file@plt>
mov    0xa8(%rsp),%rdi
call   1090 <close_the_file@plt>
mov    0xb0(%rsp),%rdi
call   1090 <close_the_file@plt>
mov    0xb8(%rsp),%rdi
call   1090 <close_the_file@plt>
mov    0xc0(%rsp),%rdi
call   1090 <close_the_file@plt>
mov    0xc8(%rsp),%rdi
call   1090 <close_the_file@plt>
mov    0xd0(%rsp),%rdi
call   1090 <close_the_file@plt>
mov    0xd8(%rsp),%rdi
call   1090 <close_the_file@plt>
lea    0xbf5(%rip),%rsi
lea    0xe0(%rsp),%rdi
call   1030 <strcpy@plt>
mov    %r12,%rdi
call   1040 <strlen@plt>
test   %rax,%rax
jle    1458 <gen_scalar_indices+0x2a8>
lea    0xc15(%rip),%rsi
lea    0xbcd(%rip),%rcx
lea    0xe0(%rsp),%rdi
mov    %r12,%rdx
xor    %eax,%eax
call   10c0 <sprintf@plt>
lea    0xbfb(%rip),%rsi
lea    0xe0(%rsp),%rdi
call   10b0 <fopen@plt>
test   %rax,%rax
je     1596 <gen_scalar_indices+0x3e6>
mov    %rax,%rbx
lea    0xe0(%rsp),%rbp
mov    %rax,%rdi
mov    %rbp,%rsi
call   1050 <print_warning@plt>
mov    %rbx,%rdi
call   1070 <gen_scalar_tables@plt>
mov    %rbx,%rdi
call   1090 <close_the_file@plt>
lea    0xb83(%rip),%rsi
mov    %rbp,%rdi
call   1030 <strcpy@plt>
mov    %r12,%rdi
call   1040 <strlen@plt>
test   %rax,%rax
jle    14d7 <gen_scalar_indices+0x327>
lea    0xb96(%rip),%rsi
lea    0xb60(%rip),%rcx
lea    0xe0(%rsp),%rdi
mov    %r12,%rdx
xor    %eax,%eax
call   10c0 <sprintf@plt>
lea    0xb7c(%rip),%rsi
lea    0xe0(%rsp),%rdi
call   10b0 <fopen@plt>
test   %rax,%rax
je     1596 <gen_scalar_indices+0x3e6>
mov    %rax,%rbx
lea    0xe0(%rsp),%rbp
mov    %rax,%rdi
mov    %rbp,%rsi
call   1050 <print_warning@plt>
mov    %rbx,%rdi
call   1060 <gen_scalar_tables_init@plt>
mov    %rbx,%rdi
call   1090 <close_the_file@plt>
lea    0xb1b(%rip),%rsi
mov    %rbp,%rdi
call   1030 <strcpy@plt>
mov    %r12,%rdi
call   1040 <strlen@plt>
test   %rax,%rax
jle    1556 <gen_scalar_indices+0x3a6>
lea    0xb17(%rip),%rsi
lea    0xaf8(%rip),%rcx
lea    0xe0(%rsp),%rdi
mov    %r12,%rdx
xor    %eax,%eax
call   10c0 <sprintf@plt>
lea    0xafd(%rip),%rsi
lea    0xe0(%rsp),%rdi
call   10b0 <fopen@plt>
test   %rax,%rax
je     1596 <gen_scalar_indices+0x3e6>
mov    %rax,%rbx
lea    0xe0(%rsp),%rsi
mov    %rax,%rdi
call   1050 <print_warning@plt>
mov    %rbx,%rdi
call   10d0 <gen_scalar_indices_init@plt>
mov    %rbx,%rdi
call   1090 <close_the_file@plt>
xor    %eax,%eax
jmp    15b0 <gen_scalar_indices+0x400>
mov    0x2a43(%rip),%rax
mov    (%rax),%edi
lea    0xacf(%rip),%rsi
call   10a0 <fprintf@plt>
mov    $0x1,%eax
add    $0x38e8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"scalar_indices.inc\00"
@.str.1 = [18 x i8] c"scalar_tables.inc\00"
@.str.2 = [23 x i8] c"scalar_tables_init.inc\00"
@.str.3 = [24 x i8] c"scalar_indices_init.inc\00"
@.str.4 = [6 x i8] c"%s/%s\00"
@.str.5 = [2 x i8] c"w\00"
@.str.6 = [25 x i8] c"in_use_for_config_%c.inc\00"
@stderr = global i32 0
@.str.7 = [11 x i8] c"returning\0A\00"
define i32 @gen_scalar_indices(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca [26 x i32*]
%6 = alloca [512 x i8]
%7 = alloca [512 x i8]
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32
%13 = alloca [26 x [512 x i8]]
store i8* %0, i8** %3
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8** %8
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8** %9
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8** %10
store i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i8** %11
%14 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%15 = load i8*, i8** %8
%16 = call i32 @strcpy(i8* %14, i8* %15)
%17 = load i8*, i8** %3
%18 = call i64 @strlen(i8* %17)
%19 = icmp sgt i64 %18, 0
br i1 %19, label %20, label %25
20: ; preds = %1
%21 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%22 = load i8*, i8** %3
%23 = load i8*, i8** %8
%24 = call i32 (i8*, i8*, ...) @sprintf(i8* %21, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* %22, i8* %23)
br label %25
25: ; preds = %20, %1
%26 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%27 = call i32* @fopen(i8* %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
store i32* %27, i32** %4
%28 = icmp eq i32* %27, null
br i1 %28, label %29, label %30
29: ; preds = %25
store i32 1, i32* %2
br label %177
30: ; preds = %25
%31 = load i32*, i32** %4
%32 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%33 = call i32 @print_warning(i32* %31, i8* %32)
store i32 0, i32* %12
br label %34
34: ; preds = %77, %30
%35 = load i32, i32* %12
%36 = icmp slt i32 %35, 26
br i1 %36, label %37, label %80
37: ; preds = %34
%38 = load i32, i32* %12
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [26 x [512 x i8]], [26 x [512 x i8]]* %13, i64 0, i64 %39
%41 = getelementptr inbounds [512 x i8], [512 x i8]* %40, i64 0, i64 0
%42 = load i32, i32* %12
%43 = add nsw i32 97, %42
%44 = call i32 (i8*, i8*, ...) @sprintf(i8* %41, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0), i32 %43)
%45 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%46 = load i32, i32* %12
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [26 x [512 x i8]], [26 x [512 x i8]]* %13, i64 0, i64 %47
%49 = getelementptr inbounds [512 x i8], [512 x i8]* %48, i64 0, i64 0
%50 = call i32 @strcpy(i8* %45, i8* %49)
%51 = load i8*, i8** %3
%52 = call i64 @strlen(i8* %51)
%53 = icmp sgt i64 %52, 0
br i1 %53, label %54, label %62
54: ; preds = %37
%55 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%56 = load i8*, i8** %3
%57 = load i32, i32* %12
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds [26 x [512 x i8]], [26 x [512 x i8]]* %13, i64 0, i64 %58
%60 = getelementptr inbounds [512 x i8], [512 x i8]* %59, i64 0, i64 0
%61 = call i32 (i8*, i8*, ...) @sprintf(i8* %55, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* %56, i8* %60)
br label %62
62: ; preds = %54, %37
%63 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%64 = call i32* @fopen(i8* %63, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%65 = load i32, i32* %12
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds [26 x i32*], [26 x i32*]* %5, i64 0, i64 %66
store i32* %64, i32** %67
%68 = icmp eq i32* %64, null
br i1 %68, label %69, label %70
69: ; preds = %62
store i32 1, i32* %2
br label %177
70: ; preds = %62
%71 = load i32, i32* %12
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds [26 x i32*], [26 x i32*]* %5, i64 0, i64 %72
%74 = load i32*, i32** %73
%75 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%76 = call i32 @print_warning(i32* %74, i8* %75)
br label %77
77: ; preds = %70
%78 = load i32, i32* %12
%79 = add nsw i32 %78, 1
store i32 %79, i32* %12
br label %34
80: ; preds = %34
%81 = load i32*, i32** %4
%82 = getelementptr inbounds [26 x i32*], [26 x i32*]* %5, i64 0, i64 0
%83 = call i32 @gen_scalar_indices1(i32* %81, i32** %82)
%84 = load i32*, i32** %4
%85 = call i32 @close_the_file(i32* %84)
store i32 0, i32* %12
br label %86
86: ; preds = %95, %80
%87 = load i32, i32* %12
%88 = icmp slt i32 %87, 26
br i1 %88, label %89, label %98
89: ; preds = %86
%90 = load i32, i32* %12
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds [26 x i32*], [26 x i32*]* %5, i64 0, i64 %91
%93 = load i32*, i32** %92
%94 = call i32 @close_the_file(i32* %93)
br label %95
95: ; preds = %89
%96 = load i32, i32* %12
%97 = add nsw i32 %96, 1
store i32 %97, i32* %12
br label %86
98: ; preds = %86
%99 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%100 = load i8*, i8** %9
%101 = call i32 @strcpy(i8* %99, i8* %100)
%102 = load i8*, i8** %3
%103 = call i64 @strlen(i8* %102)
%104 = icmp sgt i64 %103, 0
br i1 %104, label %105, label %110
105: ; preds = %98
%106 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%107 = load i8*, i8** %3
%108 = load i8*, i8** %9
%109 = call i32 (i8*, i8*, ...) @sprintf(i8* %106, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* %107, i8* %108)
br label %110
110: ; preds = %105, %98
%111 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%112 = call i32* @fopen(i8* %111, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
store i32* %112, i32** %4
%113 = icmp eq i32* %112, null
br i1 %113, label %114, label %117
114: ; preds = %110
%115 = load i32, i32* @stderr
%116 = call i32 @fprintf(i32 %115, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
store i32 1, i32* %2
br label %177
117: ; preds = %110
%118 = load i32*, i32** %4
%119 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%120 = call i32 @print_warning(i32* %118, i8* %119)
%121 = load i32*, i32** %4
%122 = call i32 @gen_scalar_tables(i32* %121)
%123 = load i32*, i32** %4
%124 = call i32 @close_the_file(i32* %123)
%125 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%126 = load i8*, i8** %10
%127 = call i32 @strcpy(i8* %125, i8* %126)
%128 = load i8*, i8** %3
%129 = call i64 @strlen(i8* %128)
%130 = icmp sgt i64 %129, 0
br i1 %130, label %131, label %136
131: ; preds = %117
%132 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%133 = load i8*, i8** %3
%134 = load i8*, i8** %10
%135 = call i32 (i8*, i8*, ...) @sprintf(i8* %132, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* %133, i8* %134)
br label %136
136: ; preds = %131, %117
%137 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%138 = call i32* @fopen(i8* %137, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
store i32* %138, i32** %4
%139 = icmp eq i32* %138, null
br i1 %139, label %140, label %143
140: ; preds = %136
%141 = load i32, i32* @stderr
%142 = call i32 @fprintf(i32 %141, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
store i32 1, i32* %2
br label %177
143: ; preds = %136
%144 = load i32*, i32** %4
%145 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%146 = call i32 @print_warning(i32* %144, i8* %145)
%147 = load i32*, i32** %4
%148 = call i32 @gen_scalar_tables_init(i32* %147)
%149 = load i32*, i32** %4
%150 = call i32 @close_the_file(i32* %149)
%151 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%152 = load i8*, i8** %11
%153 = call i32 @strcpy(i8* %151, i8* %152)
%154 = load i8*, i8** %3
%155 = call i64 @strlen(i8* %154)
%156 = icmp sgt i64 %155, 0
br i1 %156, label %157, label %162
157: ; preds = %143
%158 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%159 = load i8*, i8** %3
%160 = load i8*, i8** %11
%161 = call i32 (i8*, i8*, ...) @sprintf(i8* %158, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* %159, i8* %160)
br label %162
162: ; preds = %157, %143
%163 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%164 = call i32* @fopen(i8* %163, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
store i32* %164, i32** %4
%165 = icmp eq i32* %164, null
br i1 %165, label %166, label %169
166: ; preds = %162
%167 = load i32, i32* @stderr
%168 = call i32 @fprintf(i32 %167, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
store i32 1, i32* %2
br label %177
169: ; preds = %162
%170 = load i32*, i32** %4
%171 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%172 = call i32 @print_warning(i32* %170, i8* %171)
%173 = load i32*, i32** %4
%174 = call i32 @gen_scalar_indices_init(i32* %173)
%175 = load i32*, i32** %4
%176 = call i32 @close_the_file(i32* %175)
store i32 0, i32* %2
br label %177
177: ; preds = %169, %166, %140, %114, %69, %29
%178 = load i32, i32* %2
ret i32 %178
}

LLVM IR (-O2):
@.str = [19 x i8] c"scalar_indices.inc\00"
@.str.1 = [18 x i8] c"scalar_tables.inc\00"
@.str.2 = [23 x i8] c"scalar_tables_init.inc\00"
@.str.3 = [24 x i8] c"scalar_indices_init.inc\00"
@.str.4 = [6 x i8] c"%s/%s\00"
@.str.5 = [2 x i8] c"w\00"
@.str.6 = [25 x i8] c"in_use_for_config_%c.inc\00"
@stderr = global i32 0
@.str.7 = [11 x i8] c"returning\0A\00"
define i32 @gen_scalar_indices(i8* %0) {
%2 = alloca [26 x i32*]
%3 = alloca [512 x i8]
%4 = alloca [512 x i8]
%5 = alloca [26 x [512 x i8]]
%6 = bitcast [26 x i32*]* %2 to i8*
%7 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%9 = getelementptr inbounds [26 x [512 x i8]], [26 x [512 x i8]]* %5, i64 0, i64 0, i64 0
%10 = call i32 @strcpy(i8* %7, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%11 = call i64 @strlen(i8* dereferenceable(1) %0)
%12 = icmp sgt i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %1
%14 = call i32 (i8*, i8*, ...) @sprintf(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %1
%16 = call i32* @fopen(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%17 = icmp eq i32* %16, null
br i1 %17, label %165, label %18
18: ; preds = %15
%19 = call i32 @print_warning(i32* %16, i8* %7)
br label %20
20: ; preds = %18, %35
%21 = phi i64 [ 0, %18 ], [ %37, %35 ]
%22 = getelementptr inbounds [26 x [512 x i8]], [26 x [512 x i8]]* %5, i64 0, i64 %21, i64 0
%23 = trunc i64 %21 to i32
%24 = add i32 %23, 97
%25 = call i32 (i8*, i8*, ...) @sprintf(i8* %22, i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0), i32 %24)
%26 = call i32 @strcpy(i8* %8, i8* %22)
%27 = call i64 @strlen(i8* dereferenceable(1) %0)
%28 = icmp sgt i64 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %20
%30 = call i32 (i8*, i8*, ...) @sprintf(i8* %8, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* %0, i8* %22)
br label %31
31: ; preds = %29, %20
%32 = call i32* @fopen(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%33 = getelementptr inbounds [26 x i32*], [26 x i32*]* %2, i64 0, i64 %21
store i32* %32, i32** %33
%34 = icmp eq i32* %32, null
br i1 %34, label %165, label %35
35: ; preds = %31
%36 = call i32 @print_warning(i32* %32, i8* %8)
%37 = add nuw nsw i64 %21, 1
%38 = icmp eq i64 %37, 26
br i1 %38, label %39, label %20
39: ; preds = %35
%40 = getelementptr inbounds [26 x i32*], [26 x i32*]* %2, i64 0, i64 0
%41 = call i32 @gen_scalar_indices1(i32* %16, i32** %40)
%42 = call i32 @close_the_file(i32* %16)
%43 = load i32*, i32** %40
%44 = call i32 @close_the_file(i32* %43)
%45 = getelementptr inbounds [26 x i32*], [26 x i32*]* %2, i64 0, i64 1
%46 = load i32*, i32** %45
%47 = call i32 @close_the_file(i32* %46)
%48 = getelementptr inbounds [26 x i32*], [26 x i32*]* %2, i64 0, i64 2
%49 = load i32*, i32** %48
%50 = call i32 @close_the_file(i32* %49)
%51 = getelementptr inbounds [26 x i32*], [26 x i32*]* %2, i64 0, i64 3
%52 = load i32*, i32** %51
%53 = call i32 @close_the_file(i32* %52)
%54 = getelementptr inbounds [26 x i32*], [26 x i32*]* %2, i64 0, i64 4
%55 = load i32*, i32** %54
%56 = call i32 @close_the_file(i32* %55)
%57 = getelementptr inbounds [26 x i32*], [26 x i32*]* %2, i64 0, i64 5
%58 = load i32*, i32** %57
%59 = call i32 @close_the_file(i32* %58)
%60 = getelementptr inbounds [26 x i32*], [26 x i32*]* %2, i64 0, i64 6
%61 = load i32*, i32** %60
%62 = call i32 @close_the_file(i32* %61)
%63 = getelementptr inbounds [26 x i32*], [26 x i32*]* %2, i64 0, i64 7
%64 = load i32*, i32** %63
%65 = call i32 @close_the_file(i32* %64)
%66 = getelementptr inbounds [26 x i32*], [26 x i32*]* %2, i64 0, i64 8
%67 = load i32*, i32** %66
%68 = call i32 @close_the_file(i32* %67)
%69 = getelementptr inbounds [26 x i32*], [26 x i32*]* %2, i64 0, i64 9
%70 = load i32*, i32** %69
%71 = call i32 @close_the_file(i32* %70)
%72 = getelementptr inbounds [26 x i32*], [26 x i32*]* %2, i64 0, i64 10
%73 = load i32*, i32** %72
%74 = call i32 @close_the_file(i32* %73)
%75 = getelementptr inbounds [26 x i32*], [26 x i32*]* %2, i64 0, i64 11
%76 = load i32*, i32** %75
%77 = call i32 @close_the_file(i32* %76)
%78 = getelementptr inbounds [26 x i32*], [26 x i32*]* %2, i64 0, i64 12
%79 = load i32*, i32** %78
%80 = call i32 @close_the_file(i32* %79)
%81 = getelementptr inbounds [26 x i32*], [26 x i32*]* %2, i64 0, i64 13
%82 = load i32*, i32** %81
%83 = call i32 @close_the_file(i32* %82)
%84 = getelementptr inbounds [26 x i32*], [26 x i32*]* %2, i64 0, i64 14
%85 = load i32*, i32** %84
%86 = call i32 @close_the_file(i32* %85)
%87 = getelementptr inbounds [26 x i32*], [26 x i32*]* %2, i64 0, i64 15
%88 = load i32*, i32** %87
%89 = call i32 @close_the_file(i32* %88)
%90 = getelementptr inbounds [26 x i32*], [26 x i32*]* %2, i64 0, i64 16
%91 = load i32*, i32** %90
%92 = call i32 @close_the_file(i32* %91)
%93 = getelementptr inbounds [26 x i32*], [26 x i32*]* %2, i64 0, i64 17
%94 = load i32*, i32** %93
%95 = call i32 @close_the_file(i32* %94)
%96 = getelementptr inbounds [26 x i32*], [26 x i32*]* %2, i64 0, i64 18
%97 = load i32*, i32** %96
%98 = call i32 @close_the_file(i32* %97)
%99 = getelementptr inbounds [26 x i32*], [26 x i32*]* %2, i64 0, i64 19
%100 = load i32*, i32** %99
%101 = call i32 @close_the_file(i32* %100)
%102 = getelementptr inbounds [26 x i32*], [26 x i32*]* %2, i64 0, i64 20
%103 = load i32*, i32** %102
%104 = call i32 @close_the_file(i32* %103)
%105 = getelementptr inbounds [26 x i32*], [26 x i32*]* %2, i64 0, i64 21
%106 = load i32*, i32** %105
%107 = call i32 @close_the_file(i32* %106)
%108 = getelementptr inbounds [26 x i32*], [26 x i32*]* %2, i64 0, i64 22
%109 = load i32*, i32** %108
%110 = call i32 @close_the_file(i32* %109)
%111 = getelementptr inbounds [26 x i32*], [26 x i32*]* %2, i64 0, i64 23
%112 = load i32*, i32** %111
%113 = call i32 @close_the_file(i32* %112)
%114 = getelementptr inbounds [26 x i32*], [26 x i32*]* %2, i64 0, i64 24
%115 = load i32*, i32** %114
%116 = call i32 @close_the_file(i32* %115)
%117 = getelementptr inbounds [26 x i32*], [26 x i32*]* %2, i64 0, i64 25
%118 = load i32*, i32** %117
%119 = call i32 @close_the_file(i32* %118)
%120 = call i32 @strcpy(i8* %7, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%121 = call i64 @strlen(i8* dereferenceable(1) %0)
%122 = icmp sgt i64 %121, 0
br i1 %122, label %123, label %125
123: ; preds = %39
%124 = call i32 (i8*, i8*, ...) @sprintf(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %125
125: ; preds = %123, %39
%126 = call i32* @fopen(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%127 = icmp eq i32* %126, null
br i1 %127, label %128, label %131
128: ; preds = %125
%129 = load i32, i32* @stderr
%130 = call i32 @fprintf(i32 %129, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
br label %165
131: ; preds = %125
%132 = call i32 @print_warning(i32* %126, i8* %7)
%133 = call i32 @gen_scalar_tables(i32* %126)
%134 = call i32 @close_the_file(i32* %126)
%135 = call i32 @strcpy(i8* %7, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%136 = call i64 @strlen(i8* dereferenceable(1) %0)
%137 = icmp sgt i64 %136, 0
br i1 %137, label %138, label %140
138: ; preds = %131
%139 = call i32 (i8*, i8*, ...) @sprintf(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
br label %140
140: ; preds = %138, %131
%141 = call i32* @fopen(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%142 = icmp eq i32* %141, null
br i1 %142, label %143, label %146
143: ; preds = %140
%144 = load i32, i32* @stderr
%145 = call i32 @fprintf(i32 %144, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
br label %165
146: ; preds = %140
%147 = call i32 @print_warning(i32* %141, i8* %7)
%148 = call i32 @gen_scalar_tables_init(i32* %141)
%149 = call i32 @close_the_file(i32* %141)
%150 = call i32 @strcpy(i8* %7, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
%151 = call i64 @strlen(i8* dereferenceable(1) %0)
%152 = icmp sgt i64 %151, 0
br i1 %152, label %153, label %155
153: ; preds = %146
%154 = call i32 (i8*, i8*, ...) @sprintf(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
br label %155
155: ; preds = %153, %146
%156 = call i32* @fopen(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%157 = icmp eq i32* %156, null
br i1 %157, label %158, label %161
158: ; preds = %155
%159 = load i32, i32* @stderr
%160 = call i32 @fprintf(i32 %159, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
br label %165
161: ; preds = %155
%162 = call i32 @print_warning(i32* %156, i8* %7)
%163 = call i32 @gen_scalar_indices_init(i32* %156)
%164 = call i32 @close_the_file(i32* %156)
br label %165
165: ; preds = %31, %15, %161, %158, %143, %128
%166 = phi i32 [ 1, %128 ], [ 1, %143 ], [ 1, %158 ], [ 0, %161 ], [ 1, %15 ], [ 1, %31 ]
ret i32 %166
}