#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(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 %s select(%s %s) throws SQLException {\n",
          entity_name_pascalcase, type_primary_key, primary_key);
  fprintf(file_out, "\t\tString sql = 'SELECT * FROM %s WHERE %s = ?';\n",
          entity_name_pascalcase, primary_key);
  fprintf(file_out, "\t\t%s %s = new %s();\n", entity_name_pascalcase,
          lowercase_entity_name, entity_name_pascalcase);
  fprintf(file_out,
          "\t\tPreparedStatement statement = conn.preparedStatement(sql);\n");
  fprintf(file_out, "\t\tstatement.set%s(1, %s);\n", capital_type_primary_key,
          primary_key);
  fprintf(file_out, "\t\tResultSet result = statement.executeQuery(sql);\n");
  fprintf(file_out, "\t\twhile (result.next()) {\n");
  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}\n");
  fprintf(file_out, "\t\treturn %s;\n", lowercase_entity_name);
  fprintf(file_out, "\t}");
}


x86 assembly (clang, -O0):
<mount_method_select>:
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+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+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+0xf9>
mov    -0x624(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x624(%rbp)
jmp    11ff <mount_method_select+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    -0x830(%rbp),%rcx
mov    -0x28(%rbp),%r8
lea    0xd57(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x220(%rbp),%rdx
mov    -0x28(%rbp),%rcx
lea    0xd6a(%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    0xd74(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xd77(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0xa30(%rbp),%rdx
mov    -0x28(%rbp),%rcx
lea    0xd98(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xda1(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xdc2(%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    141c <mount_method_select+0x2bc>
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    0xd2b(%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    1365 <mount_method_select+0x205>
mov    -0x8(%rbp),%rdi
lea    0xd16(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x420(%rbp),%rdx
lea    0xd02(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xcfe(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
add    $0xe30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mount_method_select>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xe18,%rsp
mov    %r8,%r13
mov    %ecx,%ebp
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,0x8(%rsp)
lea    0x620(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
call   1070 <capitalize_name@plt>
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
call   1080 <uncapitalize_name@plt>
lea    0xc20(%rsp),%rbx
mov    %rbx,%rdi
mov    %r13,%rsi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
call   1070 <capitalize_name@plt>
mov    %ebp,%edi
xor    %esi,%esi
mov    %r15,%rdx
call   1030 <write_array_type@plt>
mov    %rax,0x18(%rsp)
mov    %ebp,%r15d
mov    %ebp,0x14(%rsp)
test   %ebp,%ebp
jle    1243 <mount_method_select+0xd3>
xor    %r12d,%r12d
lea    0x420(%rsp),%rbp
mov    %r14,%rbx
jmp    1220 <mount_method_select+0xb0>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r12
add    $0x1f4,%rbx
cmp    %r12,%r15
je     1243 <mount_method_select+0xd3>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    1210 <mount_method_select+0xa0>
mov    0x18(%rsp),%rax
mov    (%rax,%r12,8),%rsi
mov    %rbp,%rdi
call   1040 <strcpy@plt>
jmp    1210 <mount_method_select+0xa0>
lea    0x220(%rsp),%rbx
lea    0x420(%rsp),%r12
mov    %rbx,%rdi
mov    %r12,%rsi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
call   1070 <capitalize_name@plt>
lea    0xd93(%rip),%rsi
lea    0x620(%rsp),%rbp
mov    0x8(%rsp),%rbx
mov    %rbx,%rdi
mov    %rbp,%rdx
mov    %r12,%rcx
mov    %r13,%r8
xor    %eax,%eax
call   1060 <fprintf@plt>
lea    0xd9c(%rip),%rsi
mov    %rbx,%rdi
mov    %rbp,%rdx
mov    %r13,%rcx
xor    %eax,%eax
call   1060 <fprintf@plt>
lea    0xdb6(%rip),%rsi
lea    0x20(%rsp),%rcx
mov    %rbx,%rdi
mov    %rbp,%rdx
mov    %rbp,%r8
xor    %eax,%eax
call   1060 <fprintf@plt>
lea    0xdaf(%rip),%rdi
mov    $0x1,%ebp
mov    $0x3d,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1090 <fwrite@plt>
lea    0xdcf(%rip),%rsi
mov    %rbx,%rdi
lea    0x220(%rsp),%rdx
mov    %r13,%rcx
xor    %eax,%eax
call   1060 <fprintf@plt>
lea    0xdce(%rip),%rdi
mov    $0x32,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1090 <fwrite@plt>
lea    0xde8(%rip),%rdi
mov    $0x1a,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1090 <fwrite@plt>
cmpl   $0x2,0x14(%rsp)
mov    0x18(%rsp),%rbx
jl     13a8 <mount_method_select+0x238>
add    $0x1f4,%r14
lea    0xa20(%rsp),%r12
lea    0x820(%rsp),%r13
nop
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    0xd9a(%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+0x1e0>
lea    0xd8e(%rip),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    0x8(%rsp),%r15
mov    %r15,%rcx
call   1090 <fwrite@plt>
lea    0xd75(%rip),%rsi
lea    0x20(%rsp),%rdx
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <fprintf@plt>
lea    0xd6d(%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 = [48 x i8] c"\09public %s select(%s %s) throws SQLException {\0A\00"
@.str.1 = [49 x i8] c"\09\09String sql = 'SELECT * FROM %s WHERE %s = ?';\0A\00"
@.str.2 = [21 x i8] c"\09\09%s %s = new %s();\0A\00"
@.str.3 = [62 x i8] c"\09\09PreparedStatement statement = conn.preparedStatement(sql);\0A\00"
@.str.4 = [27 x i8] c"\09\09statement.set%s(1, %s);\0A\00"
@.str.5 = [51 x i8] c"\09\09ResultSet result = statement.executeQuery(sql);\0A\00"
@.str.6 = [27 x i8] c"\09\09while (result.next()) {\0A\00"
@.str.7 = [32 x i8] c"\09\09\09%s.set%s(result.get%s(%d));\0A\00"
@.str.8 = [5 x i8] c"\09\09}\0A\00"
@.str.9 = [14 x i8] c"\09\09return %s;\0A\00"
@.str.10 = [3 x i8] c"\09}\00"
define void @mount_method_select(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 = getelementptr inbounds [500 x i8], [500 x i8]* %16, i64 0, i64 0
%80 = load i8*, i8** %10
%81 = call i32 (i32*, i8*, ...) @fprintf(i32* %77, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %78, i8* %79, i8* %80)
%82 = load i32*, i32** %6
%83 = getelementptr inbounds [500 x i8], [500 x i8]* %11, i64 0, i64 0
%84 = load i8*, i8** %10
%85 = call i32 (i32*, i8*, ...) @fprintf(i32* %82, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0), i8* %83, i8* %84)
%86 = load i32*, i32** %6
%87 = getelementptr inbounds [500 x i8], [500 x i8]* %11, i64 0, i64 0
%88 = getelementptr inbounds [500 x i8], [500 x i8]* %12, i64 0, i64 0
%89 = getelementptr inbounds [500 x i8], [500 x i8]* %11, i64 0, i64 0
%90 = call i32 (i32*, i8*, ...) @fprintf(i32* %86, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i8* %87, i8* %88, i8* %89)
%91 = load i32*, i32** %6
%92 = call i32 (i32*, i8*, ...) @fprintf(i32* %91, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.3, i64 0, i64 0))
%93 = load i32*, i32** %6
%94 = getelementptr inbounds [500 x i8], [500 x i8]* %17, i64 0, i64 0
%95 = load i8*, i8** %10
%96 = call i32 (i32*, i8*, ...) @fprintf(i32* %93, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i8* %94, i8* %95)
%97 = load i32*, i32** %6
%98 = call i32 (i32*, i8*, ...) @fprintf(i32* %97, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.5, i64 0, i64 0))
%99 = load i32*, i32** %6
%100 = call i32 (i32*, i8*, ...) @fprintf(i32* %99, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %18
store i32 1, i32* %19
store i32 1, i32* %18
br label %101
101: ; preds = %132, %71
%102 = load i32, i32* %18
%103 = load i32, i32* %9
%104 = icmp slt i32 %102, %103
br i1 %104, label %105, label %135
105: ; preds = %101
%106 = getelementptr inbounds [500 x i8], [500 x i8]* %20, i64 0, i64 0
%107 = load [500 x i8]*, [500 x i8]** %7
%108 = load i32, i32* %18
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds [500 x i8], [500 x i8]* %107, i64 %109
%111 = getelementptr inbounds [500 x i8], [500 x i8]* %110, i64 0, i64 0
%112 = call i32 @strcpy(i8* %106, i8* %111)
%113 = getelementptr inbounds [500 x i8], [500 x i8]* %20, i64 0, i64 0
%114 = call i32 @capitalize_name(i8* %113)
%115 = getelementptr inbounds [500 x i8], [500 x i8]* %21, i64 0, i64 0
%116 = load i8**, i8*** %15
%117 = load i32, i32* %18
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds i8*, i8** %116, i64 %118
%120 = load i8*, i8** %119
%121 = call i32 @strcpy(i8* %115, i8* %120)
%122 = getelementptr inbounds [500 x i8], [500 x i8]* %21, i64 0, i64 0
%123 = call i32 @capitalize_name(i8* %122)
%124 = load i32*, i32** %6
%125 = getelementptr inbounds [500 x i8], [500 x i8]* %12, i64 0, i64 0
%126 = getelementptr inbounds [500 x i8], [500 x i8]* %20, i64 0, i64 0
%127 = getelementptr inbounds [500 x i8], [500 x i8]* %21, i64 0, i64 0
%128 = load i32, i32* %18
%129 = call i32 (i32*, i8*, ...) @fprintf(i32* %124, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.7, i64 0, i64 0), i8* %125, i8* %126, i8* %127, i32 %128)
%130 = load i32, i32* %19
%131 = add nsw i32 %130, 1
store i32 %131, i32* %19
br label %132
132: ; preds = %105
%133 = load i32, i32* %18
%134 = add nsw i32 %133, 1
store i32 %134, i32* %18
br label %101
135: ; preds = %101
%136 = load i32*, i32** %6
%137 = call i32 (i32*, i8*, ...) @fprintf(i32* %136, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%138 = load i32*, i32** %6
%139 = getelementptr inbounds [500 x i8], [500 x i8]* %12, i64 0, i64 0
%140 = call i32 (i32*, i8*, ...) @fprintf(i32* %138, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0), i8* %139)
%141 = load i32*, i32** %6
%142 = call i32 (i32*, i8*, ...) @fprintf(i32* %141, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [48 x i8] c"\09public %s select(%s %s) throws SQLException {\0A\00"
@.str.1 = [49 x i8] c"\09\09String sql = 'SELECT * FROM %s WHERE %s = ?';\0A\00"
@.str.2 = [21 x i8] c"\09\09%s %s = new %s();\0A\00"
@.str.3 = [62 x i8] c"\09\09PreparedStatement statement = conn.preparedStatement(sql);\0A\00"
@.str.4 = [27 x i8] c"\09\09statement.set%s(1, %s);\0A\00"
@.str.5 = [51 x i8] c"\09\09ResultSet result = statement.executeQuery(sql);\0A\00"
@.str.6 = [27 x i8] c"\09\09while (result.next()) {\0A\00"
@.str.7 = [32 x i8] c"\09\09\09%s.set%s(result.get%s(%d));\0A\00"
@.str.8 = [5 x i8] c"\09\09}\0A\00"
@.str.9 = [14 x i8] c"\09\09return %s;\0A\00"
@.str.10 = [3 x i8] c"\09}\00"
define void @mount_method_select(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 ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %13, i8* %25, i8* %4)
%46 = call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0), i8* %13, i8* %4)
%47 = call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i8* %13, i8* %17, i8* %13)
%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 i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i8* %42, i8* %4)
%50 = call i64 @fwrite(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.5, i64 0, i64 0), i64 50, i64 1, i32* %0)
%51 = call i64 @fwrite(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0), i64 26, i64 1, i32* %0)
%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 i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i64 4, i64 1, i32* %0)
%72 = call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0), i8* %17)
%73 = call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i64 2, i64 1, i32* %0)
ret void
}