#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*/ capitalize_name(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ uncapitalize_name(char *);
char **write_array_type(int, int, char **);
void mount_method_select_all(FILE *file_out, char name_array[][500],
                             char type_array[][500], int real_dimension,
                             char primary_key[500]) {
  char entity_name_pascalcase[500];
  strcpy(entity_name_pascalcase, name_array[0]);
  capitalize_name(entity_name_pascalcase);
  char lowercase_entity_name[500];
  strcpy(lowercase_entity_name, name_array[0]);
  uncapitalize_name(lowercase_entity_name);
  char capital_primary_key[500];
  strcpy(capital_primary_key, primary_key);
  capitalize_name(capital_primary_key);
  int k = 0;
  char **type_out;
  type_out = write_array_type(real_dimension, k, type_array);
  char type_primary_key[500];
  for (k = 0; k < real_dimension; k++) {
    if (strcmp(name_array[k], primary_key) == 0) {
      strcpy(type_primary_key, type_out[k]);
    }
  }
  char capital_type_primary_key[500];
  strcpy(capital_type_primary_key, type_primary_key);
  capitalize_name(capital_type_primary_key);
  fprintf(file_out,
          "	public ArrayList<%s> selectAll() throws SQLException {\n",
          entity_name_pascalcase);
  fprintf(file_out, "\t\tString sql = 'SELECT * FROM %s';\n",
          entity_name_pascalcase);
  fprintf(file_out, "\t\tArrayList<%s> %ss = new ArrayList<>();\n",
          entity_name_pascalcase, lowercase_entity_name);
  fprintf(file_out,
          "\t\tPreparedStatement statement = conn.preparedStatement(sql);\n");
  fprintf(file_out, "\t\tResultSet result = statement.executeQuery(sql);\n");
  fprintf(file_out, "\t\twhile (result.next()) {\n");
  fprintf(file_out, "\t\t\t%s %s = new %s();\n", entity_name_pascalcase,
          lowercase_entity_name, entity_name_pascalcase);
  int i = 0, j = 1;
  for (i = 1; i < real_dimension; i++) {
    char capital_column_name[500];
    strcpy(capital_column_name, name_array[i]);
    capitalize_name(capital_column_name);
    char capital_type_column[500];
    strcpy(capital_type_column, type_out[i]);
    capitalize_name(capital_type_column);
    fprintf(file_out, "\t\t\t%s.set%s(result.get%s(%d));\n",
            lowercase_entity_name, capital_column_name, capital_type_column, i);
    j++;
  }
  fprintf(file_out, "\t\t\tif (%s != null) {\n", lowercase_entity_name);
  fprintf(file_out, "\t\t\t\t%ss.add(%s);\n", lowercase_entity_name,
          lowercase_entity_name);
  fprintf(file_out, "\t\t\t}\n");
  fprintf(file_out, "\t\t}\n");
  fprintf(file_out, "\t\treturn %ss;\n", lowercase_entity_name);
  fprintf(file_out, "\t}");
}


x86 assembly (clang, -O0):
<mount_method_select_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
lea    -0x220(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcpy@plt>
lea    -0x220(%rbp),%rdi
call   1070 <capitalize_name@plt>
lea    -0x420(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcpy@plt>
lea    -0x420(%rbp),%rdi
call   1080 <uncapitalize_name@plt>
lea    -0x620(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1040 <strcpy@plt>
lea    -0x620(%rbp),%rdi
call   1070 <capitalize_name@plt>
movl   $0x0,-0x624(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x624(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <write_array_type@plt>
mov    %rax,-0x630(%rbp)
movl   $0x0,-0x624(%rbp)
mov    -0x624(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    126d <mount_method_select_all+0x10d>
mov    -0x10(%rbp),%rdi
movslq -0x624(%rbp),%rax
imul   $0x1f4,%rax,%rax
add    %rax,%rdi
mov    -0x28(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1254 <mount_method_select_all+0xf4>
lea    -0x830(%rbp),%rdi
mov    -0x630(%rbp),%rax
movslq -0x624(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
call   1040 <strcpy@plt>
jmp    1259 <mount_method_select_all+0xf9>
mov    -0x624(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x624(%rbp)
jmp    11ff <mount_method_select_all+0x9f>
lea    -0xa30(%rbp),%rdi
lea    -0x830(%rbp),%rsi
call   1040 <strcpy@plt>
lea    -0xa30(%rbp),%rdi
call   1070 <capitalize_name@plt>
mov    -0x8(%rbp),%rdi
lea    -0x220(%rbp),%rdx
lea    0xd62(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x220(%rbp),%rdx
lea    0xd82(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x220(%rbp),%rdx
lea    -0x420(%rbp),%rcx
lea    0xd86(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xd9e(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xdca(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xdeb(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x220(%rbp),%rdx
lea    -0x420(%rbp),%rcx
lea    -0x220(%rbp),%r8
lea    0xddf(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x0,-0xa34(%rbp)
movl   $0x1,-0xa38(%rbp)
movl   $0x1,-0xa34(%rbp)
mov    -0xa34(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1410 <mount_method_select_all+0x2b0>
lea    -0xc30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movslq -0xa34(%rbp),%rax
imul   $0x1f4,%rax,%rax
add    %rax,%rsi
call   1040 <strcpy@plt>
lea    -0xc30(%rbp),%rdi
call   1070 <capitalize_name@plt>
lea    -0xe30(%rbp),%rdi
mov    -0x630(%rbp),%rax
movslq -0xa34(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
call   1040 <strcpy@plt>
lea    -0xe30(%rbp),%rdi
call   1070 <capitalize_name@plt>
mov    -0x8(%rbp),%rdi
lea    -0x420(%rbp),%rdx
lea    -0xc30(%rbp),%rcx
lea    -0xe30(%rbp),%r8
mov    -0xa34(%rbp),%r9d
lea    0xd43(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0xa38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa38(%rbp)
mov    -0xa34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa34(%rbp)
jmp    1359 <mount_method_select_all+0x1f9>
mov    -0x8(%rbp),%rdi
lea    -0x420(%rbp),%rdx
lea    0xd27(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x420(%rbp),%rdx
lea    -0x420(%rbp),%rcx
lea    0xd1d(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xd1d(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xd0c(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x420(%rbp),%rdx
lea    0xcf8(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xcf5(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
add    $0xe30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mount_method_select_all>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xe18,%rsp
mov    %r8,%rbp
mov    %ecx,%ebx
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,0x8(%rsp)
lea    0x420(%rsp),%r12
mov    %r12,%rdi
call   1040 <strcpy@plt>
mov    %r12,%rdi
call   1070 <capitalize_name@plt>
lea    0x20(%rsp),%r12
mov    %r12,%rdi
mov    %r14,%rsi
call   1040 <strcpy@plt>
mov    %r12,%rdi
call   1080 <uncapitalize_name@plt>
lea    0xc20(%rsp),%r12
mov    %r12,%rdi
mov    %rbp,%rsi
call   1040 <strcpy@plt>
mov    %r12,%rdi
call   1070 <capitalize_name@plt>
mov    %ebx,%edi
xor    %esi,%esi
mov    %r15,%rdx
call   1030 <write_array_type@plt>
mov    %rax,0x18(%rsp)
mov    %ebx,%r15d
mov    %ebx,0x14(%rsp)
test   %ebx,%ebx
jle    1243 <mount_method_select_all+0xd3>
xor    %r12d,%r12d
lea    0x220(%rsp),%r13
mov    %r14,%rbx
jmp    1220 <mount_method_select_all+0xb0>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r12
add    $0x1f4,%rbx
cmp    %r12,%r15
je     1243 <mount_method_select_all+0xd3>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    1210 <mount_method_select_all+0xa0>
mov    0x18(%rsp),%rax
mov    (%rax,%r12,8),%rsi
mov    %r13,%rdi
call   1040 <strcpy@plt>
jmp    1210 <mount_method_select_all+0xa0>
lea    0xa20(%rsp),%rbx
lea    0x220(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
call   1070 <capitalize_name@plt>
lea    0xd96(%rip),%rsi
lea    0x420(%rsp),%r13
mov    0x8(%rsp),%rbx
mov    %rbx,%rdi
mov    %r13,%rdx
xor    %eax,%eax
call   1060 <fprintf@plt>
lea    0xdae(%rip),%rsi
mov    %rbx,%rdi
mov    %r13,%rdx
xor    %eax,%eax
call   1060 <fprintf@plt>
lea    0xdbe(%rip),%rsi
lea    0x20(%rsp),%r12
mov    %rbx,%rdi
mov    %r13,%rdx
mov    %r12,%rcx
xor    %eax,%eax
call   1060 <fprintf@plt>
lea    0xdcc(%rip),%rdi
mov    $0x1,%ebp
mov    $0x3d,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1090 <fwrite@plt>
lea    0xdec(%rip),%rdi
mov    $0x32,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1090 <fwrite@plt>
lea    0xe06(%rip),%rdi
mov    $0x1a,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1090 <fwrite@plt>
lea    0xe08(%rip),%rsi
mov    %rbx,%rdi
mov    %r13,%rdx
mov    %r12,%rcx
mov    %r13,%r8
xor    %eax,%eax
call   1060 <fprintf@plt>
cmpl   $0x2,0x14(%rsp)
mov    0x18(%rsp),%rbx
jl     13a8 <mount_method_select_all+0x238>
add    $0x1f4,%r14
lea    0x820(%rsp),%r12
lea    0x620(%rsp),%r13
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %r14,%rsi
call   1040 <strcpy@plt>
mov    %r12,%rdi
call   1070 <capitalize_name@plt>
mov    (%rbx,%rbp,8),%rsi
mov    %r13,%rdi
call   1040 <strcpy@plt>
mov    %r13,%rdi
call   1070 <capitalize_name@plt>
mov    0x8(%rsp),%rdi
lea    0xda6(%rip),%rsi
lea    0x20(%rsp),%rdx
mov    %r12,%rcx
mov    %r13,%r8
mov    %ebp,%r9d
xor    %eax,%eax
call   1060 <fprintf@plt>
add    $0x1,%rbp
add    $0x1f4,%r14
cmp    %rbp,%r15
jne    1350 <mount_method_select_all+0x1e0>
lea    0xd9a(%rip),%rsi
lea    0x20(%rsp),%rbp
mov    0x8(%rsp),%r15
mov    %r15,%rdi
mov    %rbp,%rdx
xor    %eax,%eax
call   1060 <fprintf@plt>
lea    0xd92(%rip),%rsi
mov    %r15,%rdi
mov    %rbp,%rdx
mov    %rbp,%rcx
xor    %eax,%eax
call   1060 <fprintf@plt>
lea    0xd8d(%rip),%rdi
mov    $0x5,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   1090 <fwrite@plt>
lea    0xd75(%rip),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   1090 <fwrite@plt>
lea    0xd61(%rip),%rsi
mov    %r15,%rdi
mov    %rbp,%rdx
xor    %eax,%eax
call   1060 <fprintf@plt>
lea    0xd5c(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   1090 <fwrite@plt>
add    $0xe18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [57 x i8] c"\09public ArrayList<%s> selectAll() throws SQLException {\0A\00"
@.str.1 = [36 x i8] c"\09\09String sql = 'SELECT * FROM %s';\0A\00"
@.str.2 = [42 x i8] c"\09\09ArrayList<%s> %ss = new ArrayList<>();\0A\00"
@.str.3 = [62 x i8] c"\09\09PreparedStatement statement = conn.preparedStatement(sql);\0A\00"
@.str.4 = [51 x i8] c"\09\09ResultSet result = statement.executeQuery(sql);\0A\00"
@.str.5 = [27 x i8] c"\09\09while (result.next()) {\0A\00"
@.str.6 = [22 x i8] c"\09\09\09%s %s = new %s();\0A\00"
@.str.7 = [32 x i8] c"\09\09\09%s.set%s(result.get%s(%d));\0A\00"
@.str.8 = [22 x i8] c"\09\09\09if (%s != null) {\0A\00"
@.str.9 = [18 x i8] c"\09\09\09\09%ss.add(%s);\0A\00"
@.str.10 = [6 x i8] c"\09\09\09}\0A\00"
@.str.11 = [5 x i8] c"\09\09}\0A\00"
@.str.12 = [15 x i8] c"\09\09return %ss;\0A\00"
@.str.13 = [3 x i8] c"\09}\00"
define void @mount_method_select_all(i32* %0, [500 x i8]* %1, [500 x i8]* %2, i32 %3, i8* %4) {
%6 = alloca i32*
%7 = alloca [500 x i8]*
%8 = alloca [500 x i8]*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca [500 x i8]
%12 = alloca [500 x i8]
%13 = alloca [500 x i8]
%14 = alloca i32
%15 = alloca i8**
%16 = alloca [500 x i8]
%17 = alloca [500 x i8]
%18 = alloca i32
%19 = alloca i32
%20 = alloca [500 x i8]
%21 = alloca [500 x i8]
store i32* %0, i32** %6
store [500 x i8]* %1, [500 x i8]** %7
store [500 x i8]* %2, [500 x i8]** %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%22 = getelementptr inbounds [500 x i8], [500 x i8]* %11, i64 0, i64 0
%23 = load [500 x i8]*, [500 x i8]** %7
%24 = getelementptr inbounds [500 x i8], [500 x i8]* %23, i64 0
%25 = getelementptr inbounds [500 x i8], [500 x i8]* %24, i64 0, i64 0
%26 = call i32 @strcpy(i8* %22, i8* %25)
%27 = getelementptr inbounds [500 x i8], [500 x i8]* %11, i64 0, i64 0
%28 = call i32 @capitalize_name(i8* %27)
%29 = getelementptr inbounds [500 x i8], [500 x i8]* %12, i64 0, i64 0
%30 = load [500 x i8]*, [500 x i8]** %7
%31 = getelementptr inbounds [500 x i8], [500 x i8]* %30, i64 0
%32 = getelementptr inbounds [500 x i8], [500 x i8]* %31, i64 0, i64 0
%33 = call i32 @strcpy(i8* %29, i8* %32)
%34 = getelementptr inbounds [500 x i8], [500 x i8]* %12, i64 0, i64 0
%35 = call i32 @uncapitalize_name(i8* %34)
%36 = getelementptr inbounds [500 x i8], [500 x i8]* %13, i64 0, i64 0
%37 = load i8*, i8** %10
%38 = call i32 @strcpy(i8* %36, i8* %37)
%39 = getelementptr inbounds [500 x i8], [500 x i8]* %13, i64 0, i64 0
%40 = call i32 @capitalize_name(i8* %39)
store i32 0, i32* %14
%41 = load i32, i32* %9
%42 = load i32, i32* %14
%43 = load [500 x i8]*, [500 x i8]** %8
%44 = bitcast [500 x i8]* %43 to i8**
%45 = call i8** @write_array_type(i32 %41, i32 %42, i8** %44)
store i8** %45, i8*** %15
store i32 0, i32* %14
br label %46
46: ; preds = %68, %5
%47 = load i32, i32* %14
%48 = load i32, i32* %9
%49 = icmp slt i32 %47, %48
br i1 %49, label %50, label %71
50: ; preds = %46
%51 = load [500 x i8]*, [500 x i8]** %7
%52 = load i32, i32* %14
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds [500 x i8], [500 x i8]* %51, i64 %53
%55 = getelementptr inbounds [500 x i8], [500 x i8]* %54, i64 0, i64 0
%56 = load i8*, i8** %10
%57 = call i64 @strcmp(i8* %55, i8* %56)
%58 = icmp eq i64 %57, 0
br i1 %58, label %59, label %67
59: ; preds = %50
%60 = getelementptr inbounds [500 x i8], [500 x i8]* %16, i64 0, i64 0
%61 = load i8**, i8*** %15
%62 = load i32, i32* %14
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds i8*, i8** %61, i64 %63
%65 = load i8*, i8** %64
%66 = call i32 @strcpy(i8* %60, i8* %65)
br label %67
67: ; preds = %59, %50
br label %68
68: ; preds = %67
%69 = load i32, i32* %14
%70 = add nsw i32 %69, 1
store i32 %70, i32* %14
br label %46
71: ; preds = %46
%72 = getelementptr inbounds [500 x i8], [500 x i8]* %17, i64 0, i64 0
%73 = getelementptr inbounds [500 x i8], [500 x i8]* %16, i64 0, i64 0
%74 = call i32 @strcpy(i8* %72, i8* %73)
%75 = getelementptr inbounds [500 x i8], [500 x i8]* %17, i64 0, i64 0
%76 = call i32 @capitalize_name(i8* %75)
%77 = load i32*, i32** %6
%78 = getelementptr inbounds [500 x i8], [500 x i8]* %11, i64 0, i64 0
%79 = call i32 (i32*, i8*, ...) @fprintf(i32* %77, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i8* %78)
%80 = load i32*, i32** %6
%81 = getelementptr inbounds [500 x i8], [500 x i8]* %11, i64 0, i64 0
%82 = call i32 (i32*, i8*, ...) @fprintf(i32* %80, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i8* %81)
%83 = load i32*, i32** %6
%84 = getelementptr inbounds [500 x i8], [500 x i8]* %11, i64 0, i64 0
%85 = getelementptr inbounds [500 x i8], [500 x i8]* %12, i64 0, i64 0
%86 = call i32 (i32*, i8*, ...) @fprintf(i32* %83, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), i8* %84, i8* %85)
%87 = load i32*, i32** %6
%88 = call i32 (i32*, i8*, ...) @fprintf(i32* %87, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.3, i64 0, i64 0))
%89 = load i32*, i32** %6
%90 = call i32 (i32*, i8*, ...) @fprintf(i32* %89, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.4, i64 0, i64 0))
%91 = load i32*, i32** %6
%92 = call i32 (i32*, i8*, ...) @fprintf(i32* %91, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0))
%93 = load i32*, i32** %6
%94 = getelementptr inbounds [500 x i8], [500 x i8]* %11, i64 0, i64 0
%95 = getelementptr inbounds [500 x i8], [500 x i8]* %12, i64 0, i64 0
%96 = getelementptr inbounds [500 x i8], [500 x i8]* %11, i64 0, i64 0
%97 = call i32 (i32*, i8*, ...) @fprintf(i32* %93, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), i8* %94, i8* %95, i8* %96)
store i32 0, i32* %18
store i32 1, i32* %19
store i32 1, i32* %18
br label %98
98: ; preds = %129, %71
%99 = load i32, i32* %18
%100 = load i32, i32* %9
%101 = icmp slt i32 %99, %100
br i1 %101, label %102, label %132
102: ; preds = %98
%103 = getelementptr inbounds [500 x i8], [500 x i8]* %20, i64 0, i64 0
%104 = load [500 x i8]*, [500 x i8]** %7
%105 = load i32, i32* %18
%106 = sext i32 %105 to i64
%107 = getelementptr inbounds [500 x i8], [500 x i8]* %104, i64 %106
%108 = getelementptr inbounds [500 x i8], [500 x i8]* %107, i64 0, i64 0
%109 = call i32 @strcpy(i8* %103, i8* %108)
%110 = getelementptr inbounds [500 x i8], [500 x i8]* %20, i64 0, i64 0
%111 = call i32 @capitalize_name(i8* %110)
%112 = getelementptr inbounds [500 x i8], [500 x i8]* %21, i64 0, i64 0
%113 = load i8**, i8*** %15
%114 = load i32, i32* %18
%115 = sext i32 %114 to i64
%116 = getelementptr inbounds i8*, i8** %113, i64 %115
%117 = load i8*, i8** %116
%118 = call i32 @strcpy(i8* %112, i8* %117)
%119 = getelementptr inbounds [500 x i8], [500 x i8]* %21, i64 0, i64 0
%120 = call i32 @capitalize_name(i8* %119)
%121 = load i32*, i32** %6
%122 = getelementptr inbounds [500 x i8], [500 x i8]* %12, i64 0, i64 0
%123 = getelementptr inbounds [500 x i8], [500 x i8]* %20, i64 0, i64 0
%124 = getelementptr inbounds [500 x i8], [500 x i8]* %21, i64 0, i64 0
%125 = load i32, i32* %18
%126 = call i32 (i32*, i8*, ...) @fprintf(i32* %121, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.7, i64 0, i64 0), i8* %122, i8* %123, i8* %124, i32 %125)
%127 = load i32, i32* %19
%128 = add nsw i32 %127, 1
store i32 %128, i32* %19
br label %129
129: ; preds = %102
%130 = load i32, i32* %18
%131 = add nsw i32 %130, 1
store i32 %131, i32* %18
br label %98
132: ; preds = %98
%133 = load i32*, i32** %6
%134 = getelementptr inbounds [500 x i8], [500 x i8]* %12, i64 0, i64 0
%135 = call i32 (i32*, i8*, ...) @fprintf(i32* %133, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0), i8* %134)
%136 = load i32*, i32** %6
%137 = getelementptr inbounds [500 x i8], [500 x i8]* %12, i64 0, i64 0
%138 = getelementptr inbounds [500 x i8], [500 x i8]* %12, i64 0, i64 0
%139 = call i32 (i32*, i8*, ...) @fprintf(i32* %136, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0), i8* %137, i8* %138)
%140 = load i32*, i32** %6
%141 = call i32 (i32*, i8*, ...) @fprintf(i32* %140, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
%142 = load i32*, i32** %6
%143 = call i32 (i32*, i8*, ...) @fprintf(i32* %142, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
%144 = load i32*, i32** %6
%145 = getelementptr inbounds [500 x i8], [500 x i8]* %12, i64 0, i64 0
%146 = call i32 (i32*, i8*, ...) @fprintf(i32* %144, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.12, i64 0, i64 0), i8* %145)
%147 = load i32*, i32** %6
%148 = call i32 (i32*, i8*, ...) @fprintf(i32* %147, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [57 x i8] c"\09public ArrayList<%s> selectAll() throws SQLException {\0A\00"
@.str.1 = [36 x i8] c"\09\09String sql = 'SELECT * FROM %s';\0A\00"
@.str.2 = [42 x i8] c"\09\09ArrayList<%s> %ss = new ArrayList<>();\0A\00"
@.str.3 = [62 x i8] c"\09\09PreparedStatement statement = conn.preparedStatement(sql);\0A\00"
@.str.4 = [51 x i8] c"\09\09ResultSet result = statement.executeQuery(sql);\0A\00"
@.str.5 = [27 x i8] c"\09\09while (result.next()) {\0A\00"
@.str.6 = [22 x i8] c"\09\09\09%s %s = new %s();\0A\00"
@.str.7 = [32 x i8] c"\09\09\09%s.set%s(result.get%s(%d));\0A\00"
@.str.8 = [22 x i8] c"\09\09\09if (%s != null) {\0A\00"
@.str.9 = [18 x i8] c"\09\09\09\09%ss.add(%s);\0A\00"
@.str.10 = [6 x i8] c"\09\09\09}\0A\00"
@.str.11 = [5 x i8] c"\09\09}\0A\00"
@.str.12 = [15 x i8] c"\09\09return %ss;\0A\00"
@.str.13 = [3 x i8] c"\09}\00"
define void @mount_method_select_all(i32* nocapture %0, [500 x i8]* %1, [500 x i8]* %2, i32 %3, i8* %4) {
%6 = alloca [500 x i8]
%7 = alloca [500 x i8]
%8 = alloca [500 x i8]
%9 = alloca [500 x i8]
%10 = alloca [500 x i8]
%11 = alloca [500 x i8]
%12 = alloca [500 x i8]
%13 = getelementptr inbounds [500 x i8], [500 x i8]* %6, i64 0, i64 0
%14 = getelementptr inbounds [500 x i8], [500 x i8]* %1, i64 0, i64 0
%15 = call i32 @strcpy(i8* %13, i8* %14)
%16 = call i32 @capitalize_name(i8* %13)
%17 = getelementptr inbounds [500 x i8], [500 x i8]* %7, i64 0, i64 0
%18 = call i32 @strcpy(i8* %17, i8* %14)
%19 = call i32 @uncapitalize_name(i8* %17)
%20 = getelementptr inbounds [500 x i8], [500 x i8]* %8, i64 0, i64 0
%21 = call i32 @strcpy(i8* %20, i8* %4)
%22 = call i32 @capitalize_name(i8* %20)
%23 = bitcast [500 x i8]* %2 to i8**
%24 = call i8** @write_array_type(i32 %3, i32 0, i8** %23)
%25 = getelementptr inbounds [500 x i8], [500 x i8]* %9, i64 0, i64 0
%26 = icmp sgt i32 %3, 0
br i1 %26, label %27, label %41
27: ; preds = %5
%28 = zext i32 %3 to i64
br label %29
29: ; preds = %27, %38
%30 = phi i64 [ 0, %27 ], [ %39, %38 ]
%31 = getelementptr inbounds [500 x i8], [500 x i8]* %1, i64 %30, i64 0
%32 = call i64 @strcmp(i8* %31, i8* %4)
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %38
34: ; preds = %29
%35 = getelementptr inbounds i8*, i8** %24, i64 %30
%36 = load i8*, i8** %35
%37 = call i32 @strcpy(i8* %25, i8* %36)
br label %38
38: ; preds = %29, %34
%39 = add nuw nsw i64 %30, 1
%40 = icmp eq i64 %39, %28
br i1 %40, label %41, label %29
41: ; preds = %38, %5
%42 = getelementptr inbounds [500 x i8], [500 x i8]* %10, i64 0, i64 0
%43 = call i32 @strcpy(i8* %42, i8* %25)
%44 = call i32 @capitalize_name(i8* %42)
%45 = call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i8* %13)
%46 = call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i8* %13)
%47 = call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), i8* %13, i8* %17)
%48 = call i64 @fwrite(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.3, i64 0, i64 0), i64 61, i64 1, i32* %0)
%49 = call i64 @fwrite(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.4, i64 0, i64 0), i64 50, i64 1, i32* %0)
%50 = call i64 @fwrite(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), i64 26, i64 1, i32* %0)
%51 = call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), i8* %13, i8* %17, i8* %13)
%52 = icmp sgt i32 %3, 1
br i1 %52, label %53, label %70
53: ; preds = %41
%54 = getelementptr inbounds [500 x i8], [500 x i8]* %11, i64 0, i64 0
%55 = getelementptr inbounds [500 x i8], [500 x i8]* %12, i64 0, i64 0
%56 = zext i32 %3 to i64
br label %57
57: ; preds = %53, %57
%58 = phi i64 [ 1, %53 ], [ %68, %57 ]
%59 = getelementptr inbounds [500 x i8], [500 x i8]* %1, i64 %58, i64 0
%60 = call i32 @strcpy(i8* %54, i8* %59)
%61 = call i32 @capitalize_name(i8* %54)
%62 = getelementptr inbounds i8*, i8** %24, i64 %58
%63 = load i8*, i8** %62
%64 = call i32 @strcpy(i8* %55, i8* %63)
%65 = call i32 @capitalize_name(i8* %55)
%66 = trunc i64 %58 to i32
%67 = call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.7, i64 0, i64 0), i8* %17, i8* %54, i8* %55, i32 %66)
%68 = add nuw nsw i64 %58, 1
%69 = icmp eq i64 %68, %56
br i1 %69, label %70, label %57
70: ; preds = %57, %41
%71 = call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0), i8* %17)
%72 = call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0), i8* %17, i8* %17)
%73 = call i64 @fwrite(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0), i64 5, i64 1, i32* %0)
%74 = call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), i64 4, i64 1, i32* %0)
%75 = call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.12, i64 0, i64 0), i8* %17)
%76 = call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0), i64 2, i64 1, i32* %0)
ret void
}