#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_update(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 i = 0;
  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 void update(%s %s) throws SQLException {\n",
          entity_name_pascalcase, lowercase_entity_name);
  fprintf(file_out, "\t\t\tString sql = 'UPDATE %s SET' +\n", name_array[0]);
  for (i = 1; i < real_dimension; i++) {
    if (strcmp(name_array[i], primary_key) != 0) {
      fprintf(file_out, "\t\t\t'%s=?' +\n", name_array[i]);
    }
  }
  fprintf(file_out, "\t\t\t'WHERE %s=?';\n", primary_key);
  fprintf(file_out,
          "\t\t\tPreparedStatement statement = conn.preparedStatement(sql);\n");
  int j = 1;
  for (i = 1; i < real_dimension; i++) {
    if (strcmp(name_array[i], primary_key) != 0) {
      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\tstatement.set%s(%d, %s.get%s());\n",
              capital_type_column, j, lowercase_entity_name,
              capital_column_name);
      j++;
    }
  }
  fprintf(file_out, "\t\t\tstatement.set%s(%d, %s.get%s());\n",
          capital_type_primary_key, real_dimension - 1, lowercase_entity_name,
          capital_primary_key);
  fprintf(file_out, "\t\t\tint rowsInserted = statement.executeUpdate();\n");
  fprintf(file_out, "\t\t\tif (rowsInserted > 0) {\n");
  fprintf(file_out,
          "\t\t\t\tSystem.out.println('An existing %s was updated "
          "successfully!');\n",
          lowercase_entity_name);
  fprintf(file_out, "\t\t\t}\n");
  fprintf(file_out, "\t\t}");
}


x86 assembly (clang, -O0):
<mount_method_update>:
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)
movl   $0x0,-0x628(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x628(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <write_array_type@plt>
mov    %rax,-0x630(%rbp)
movl   $0x0,-0x628(%rbp)
mov    -0x628(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1277 <mount_method_update+0x117>
mov    -0x10(%rbp),%rdi
movslq -0x628(%rbp),%rax
imul   $0x1f4,%rax,%rax
add    %rax,%rdi
mov    -0x28(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    125e <mount_method_update+0xfe>
lea    -0x830(%rbp),%rdi
mov    -0x630(%rbp),%rax
movslq -0x628(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
call   1040 <strcpy@plt>
jmp    1263 <mount_method_update+0x103>
mov    -0x628(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x628(%rbp)
jmp    1209 <mount_method_update+0xa9>
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    -0x420(%rbp),%rcx
lea    0xd51(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xd6d(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x1,-0x624(%rbp)
mov    -0x624(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    134d <mount_method_update+0x1ed>
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
je     1334 <mount_method_update+0x1d4>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
movslq -0x624(%rbp),%rax
imul   $0x1f4,%rax,%rax
add    %rax,%rdx
lea    0xd28(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
jmp    1339 <mount_method_update+0x1d9>
mov    -0x624(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x624(%rbp)
jmp    12d6 <mount_method_update+0x176>
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rdx
lea    0xd06(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xd06(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x1,-0xa34(%rbp)
movl   $0x1,-0x624(%rbp)
mov    -0x624(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    146c <mount_method_update+0x30c>
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
je     1453 <mount_method_update+0x2f3>
lea    -0xc30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movslq -0x624(%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 -0x624(%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    -0xe30(%rbp),%rdx
mov    -0xa34(%rbp),%ecx
lea    -0x420(%rbp),%r8
lea    -0xc30(%rbp),%r9
lea    0xc76(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0xa34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa34(%rbp)
jmp    1458 <mount_method_update+0x2f8>
mov    -0x624(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x624(%rbp)
jmp    1389 <mount_method_update+0x229>
mov    -0x8(%rbp),%rdi
lea    -0xa30(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
lea    -0x420(%rbp),%r8
lea    -0x620(%rbp),%r9
lea    0xc21(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xc34(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xc54(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x420(%rbp),%rdx
lea    0xc57(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xc8a(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xc7e(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
add    $0xe30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mount_method_update>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xe18,%rsp
mov    %r8,%r15
mov    %ecx,%ebp
mov    %rdx,%r14
mov    %rsi,%r12
mov    %rdi,0x10(%rsp)
lea    0xa20(%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    %r12,%rsi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
call   1080 <uncapitalize_name@plt>
lea    0x820(%rsp),%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
call   1070 <capitalize_name@plt>
mov    %ebp,%edi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <write_array_type@plt>
mov    %rax,0x18(%rsp)
mov    %ebp,%r14d
mov    %ebp,0xc(%rsp)
test   %ebp,%ebp
jle    1243 <mount_method_update+0xd3>
xor    %ebp,%ebp
lea    0x620(%rsp),%r13
mov    %r12,%rbx
jmp    1220 <mount_method_update+0xb0>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rbp
add    $0x1f4,%rbx
cmp    %rbp,%r14
je     1243 <mount_method_update+0xd3>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    1210 <mount_method_update+0xa0>
mov    0x18(%rsp),%rax
mov    (%rax,%rbp,8),%rsi
mov    %r13,%rdi
call   1040 <strcpy@plt>
jmp    1210 <mount_method_update+0xa0>
lea    0x420(%rsp),%rbx
lea    0x620(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
call   1070 <capitalize_name@plt>
lea    0xd96(%rip),%rsi
lea    0xa20(%rsp),%rdx
lea    0x20(%rsp),%rcx
mov    0x10(%rsp),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <fprintf@plt>
lea    0xda5(%rip),%rsi
mov    %rbx,%rdi
mov    %r12,%rdx
xor    %eax,%eax
call   1060 <fprintf@plt>
cmpl   $0x2,0xc(%rsp)
jl     12f1 <mount_method_update+0x181>
lea    0x1f4(%r12),%rbp
lea    -0x1(%r14),%rbx
lea    0xda1(%rip),%r13
jmp    12cd <mount_method_update+0x15d>
cs nopw 0x0(%rax,%rax,1)
add    $0x1f4,%rbp
add    $0xffffffffffffffff,%rbx
je     1323 <mount_method_update+0x1b3>
mov    %rbp,%rdi
mov    %r15,%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     12c0 <mount_method_update+0x150>
mov    0x10(%rsp),%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1060 <fprintf@plt>
jmp    12c0 <mount_method_update+0x150>
lea    0xd6a(%rip),%rsi
mov    %rbx,%rdi
mov    %r15,%rdx
xor    %eax,%eax
call   1060 <fprintf@plt>
lea    0xd68(%rip),%rdi
mov    $0x3e,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1090 <fwrite@plt>
jmp    1421 <mount_method_update+0x2b1>
lea    0xd38(%rip),%rsi
mov    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    %r15,%rdx
xor    %eax,%eax
call   1060 <fprintf@plt>
lea    0xd31(%rip),%rdi
mov    $0x1,%ebp
mov    $0x3e,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1090 <fwrite@plt>
cmpl   $0x2,0xc(%rsp)
jl     1421 <mount_method_update+0x2b1>
add    $0x1f4,%r12
mov    $0x1,%r13d
jmp    1394 <mount_method_update+0x224>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%rbp
add    $0x1f4,%r12
cmp    %rbp,%r14
je     1421 <mount_method_update+0x2b1>
mov    %r12,%rdi
mov    %r15,%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1380 <mount_method_update+0x210>
lea    0x220(%rsp),%rbx
mov    %rbx,%rdi
mov    %r12,%rsi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
call   1070 <capitalize_name@plt>
mov    0x18(%rsp),%rax
mov    (%rax,%rbp,8),%rsi
mov    %r15,%rbx
mov    %r13d,%r15d
mov    %r14,%r13
lea    0xc20(%rsp),%r14
mov    %r14,%rdi
call   1040 <strcpy@plt>
mov    %r14,%rdi
call   1070 <capitalize_name@plt>
mov    0x10(%rsp),%rdi
lea    0xcbe(%rip),%rsi
mov    %r14,%rdx
mov    %r13,%r14
mov    %r15d,%r13d
mov    %rbx,%r15
mov    %r13d,%ecx
lea    0x20(%rsp),%r8
lea    0x220(%rsp),%r9
xor    %eax,%eax
call   1060 <fprintf@plt>
add    $0x1,%r13d
jmp    1380 <mount_method_update+0x210>
mov    0xc(%rsp),%ecx
add    $0xffffffff,%ecx
lea    0xc84(%rip),%rsi
lea    0x420(%rsp),%rdx
lea    0x20(%rsp),%rbx
lea    0x820(%rsp),%r9
mov    0x10(%rsp),%rbp
mov    %rbp,%rdi
mov    %rbx,%r8
xor    %eax,%eax
call   1060 <fprintf@plt>
lea    0xc7b(%rip),%rdi
mov    $0x31,%esi
mov    $0x1,%edx
mov    %rbp,%rcx
call   1090 <fwrite@plt>
lea    0xc94(%rip),%rdi
mov    $0x1b,%esi
mov    $0x1,%edx
mov    %rbp,%rcx
call   1090 <fwrite@plt>
lea    0xc97(%rip),%rsi
mov    %rbp,%rdi
mov    %rbx,%rdx
xor    %eax,%eax
call   1060 <fprintf@plt>
lea    0xcc8(%rip),%rdi
mov    $0x5,%esi
mov    $0x1,%edx
mov    %rbp,%rcx
call   1090 <fwrite@plt>
lea    0xcb5(%rip),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
mov    %rbp,%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 = [50 x i8] c"\09public void update(%s %s) throws SQLException {\0A\00"
@.str.1 = [35 x i8] c"\09\09\09String sql = 'UPDATE %s SET' +\0A\00"
@.str.2 = [13 x i8] c"\09\09\09'%s=?' +\0A\00"
@.str.3 = [18 x i8] c"\09\09\09'WHERE %s=?';\0A\00"
@.str.4 = [63 x i8] c"\09\09\09PreparedStatement statement = conn.preparedStatement(sql);\0A\00"
@.str.5 = [37 x i8] c"\09\09\09statement.set%s(%d, %s.get%s());\0A\00"
@.str.6 = [50 x i8] c"\09\09\09int rowsInserted = statement.executeUpdate();\0A\00"
@.str.7 = [28 x i8] c"\09\09\09if (rowsInserted > 0) {\0A\00"
@.str.8 = [69 x i8] c"\09\09\09\09System.out.println('An existing %s was updated successfully!');\0A\00"
@.str.9 = [6 x i8] c"\09\09\09}\0A\00"
@.str.10 = [4 x i8] c"\09\09}\00"
define void @mount_method_update(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 i32
%16 = alloca i8**
%17 = alloca [500 x i8]
%18 = alloca [500 x i8]
%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
store i32 0, i32* %15
%41 = load i32, i32* %9
%42 = load i32, i32* %15
%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*** %16
store i32 0, i32* %15
br label %46
46: ; preds = %68, %5
%47 = load i32, i32* %15
%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* %15
%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]* %17, i64 0, i64 0
%61 = load i8**, i8*** %16
%62 = load i32, i32* %15
%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* %15
%70 = add nsw i32 %69, 1
store i32 %70, i32* %15
br label %46
71: ; preds = %46
%72 = getelementptr inbounds [500 x i8], [500 x i8]* %18, i64 0, i64 0
%73 = getelementptr inbounds [500 x i8], [500 x i8]* %17, i64 0, i64 0
%74 = call i32 @strcpy(i8* %72, i8* %73)
%75 = getelementptr inbounds [500 x i8], [500 x i8]* %18, 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]* %12, i64 0, i64 0
%80 = call i32 (i32*, i8*, ...) @fprintf(i32* %77, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* %78, i8* %79)
%81 = load i32*, i32** %6
%82 = load [500 x i8]*, [500 x i8]** %7
%83 = getelementptr inbounds [500 x i8], [500 x i8]* %82, i64 0
%84 = getelementptr inbounds [500 x i8], [500 x i8]* %83, i64 0, i64 0
%85 = call i32 (i32*, i8*, ...) @fprintf(i32* %81, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* %84)
store i32 1, i32* %14
br label %86
86: ; preds = %108, %71
%87 = load i32, i32* %14
%88 = load i32, i32* %9
%89 = icmp slt i32 %87, %88
br i1 %89, label %90, label %111
90: ; preds = %86
%91 = load [500 x i8]*, [500 x i8]** %7
%92 = load i32, i32* %14
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds [500 x i8], [500 x i8]* %91, i64 %93
%95 = getelementptr inbounds [500 x i8], [500 x i8]* %94, i64 0, i64 0
%96 = load i8*, i8** %10
%97 = call i64 @strcmp(i8* %95, i8* %96)
%98 = icmp ne i64 %97, 0
br i1 %98, label %99, label %107
99: ; preds = %90
%100 = load i32*, i32** %6
%101 = load [500 x i8]*, [500 x i8]** %7
%102 = load i32, i32* %14
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds [500 x i8], [500 x i8]* %101, i64 %103
%105 = getelementptr inbounds [500 x i8], [500 x i8]* %104, i64 0, i64 0
%106 = call i32 (i32*, i8*, ...) @fprintf(i32* %100, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* %105)
br label %107
107: ; preds = %99, %90
br label %108
108: ; preds = %107
%109 = load i32, i32* %14
%110 = add nsw i32 %109, 1
store i32 %110, i32* %14
br label %86
111: ; preds = %86
%112 = load i32*, i32** %6
%113 = load i8*, i8** %10
%114 = call i32 (i32*, i8*, ...) @fprintf(i32* %112, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8* %113)
%115 = load i32*, i32** %6
%116 = call i32 (i32*, i8*, ...) @fprintf(i32* %115, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %19
store i32 1, i32* %14
br label %117
117: ; preds = %158, %111
%118 = load i32, i32* %14
%119 = load i32, i32* %9
%120 = icmp slt i32 %118, %119
br i1 %120, label %121, label %161
121: ; preds = %117
%122 = load [500 x i8]*, [500 x i8]** %7
%123 = load i32, i32* %14
%124 = sext i32 %123 to i64
%125 = getelementptr inbounds [500 x i8], [500 x i8]* %122, i64 %124
%126 = getelementptr inbounds [500 x i8], [500 x i8]* %125, i64 0, i64 0
%127 = load i8*, i8** %10
%128 = call i64 @strcmp(i8* %126, i8* %127)
%129 = icmp ne i64 %128, 0
br i1 %129, label %130, label %157
130: ; preds = %121
%131 = getelementptr inbounds [500 x i8], [500 x i8]* %20, i64 0, i64 0
%132 = load [500 x i8]*, [500 x i8]** %7
%133 = load i32, i32* %14
%134 = sext i32 %133 to i64
%135 = getelementptr inbounds [500 x i8], [500 x i8]* %132, i64 %134
%136 = getelementptr inbounds [500 x i8], [500 x i8]* %135, i64 0, i64 0
%137 = call i32 @strcpy(i8* %131, i8* %136)
%138 = getelementptr inbounds [500 x i8], [500 x i8]* %20, i64 0, i64 0
%139 = call i32 @capitalize_name(i8* %138)
%140 = getelementptr inbounds [500 x i8], [500 x i8]* %21, i64 0, i64 0
%141 = load i8**, i8*** %16
%142 = load i32, i32* %14
%143 = sext i32 %142 to i64
%144 = getelementptr inbounds i8*, i8** %141, i64 %143
%145 = load i8*, i8** %144
%146 = call i32 @strcpy(i8* %140, i8* %145)
%147 = getelementptr inbounds [500 x i8], [500 x i8]* %21, i64 0, i64 0
%148 = call i32 @capitalize_name(i8* %147)
%149 = load i32*, i32** %6
%150 = getelementptr inbounds [500 x i8], [500 x i8]* %21, i64 0, i64 0
%151 = load i32, i32* %19
%152 = getelementptr inbounds [500 x i8], [500 x i8]* %12, i64 0, i64 0
%153 = getelementptr inbounds [500 x i8], [500 x i8]* %20, i64 0, i64 0
%154 = call i32 (i32*, i8*, ...) @fprintf(i32* %149, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0), i8* %150, i32 %151, i8* %152, i8* %153)
%155 = load i32, i32* %19
%156 = add nsw i32 %155, 1
store i32 %156, i32* %19
br label %157
157: ; preds = %130, %121
br label %158
158: ; preds = %157
%159 = load i32, i32* %14
%160 = add nsw i32 %159, 1
store i32 %160, i32* %14
br label %117
161: ; preds = %117
%162 = load i32*, i32** %6
%163 = getelementptr inbounds [500 x i8], [500 x i8]* %18, i64 0, i64 0
%164 = load i32, i32* %9
%165 = sub nsw i32 %164, 1
%166 = getelementptr inbounds [500 x i8], [500 x i8]* %12, i64 0, i64 0
%167 = getelementptr inbounds [500 x i8], [500 x i8]* %13, i64 0, i64 0
%168 = call i32 (i32*, i8*, ...) @fprintf(i32* %162, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0), i8* %163, i32 %165, i8* %166, i8* %167)
%169 = load i32*, i32** %6
%170 = call i32 (i32*, i8*, ...) @fprintf(i32* %169, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.6, i64 0, i64 0))
%171 = load i32*, i32** %6
%172 = call i32 (i32*, i8*, ...) @fprintf(i32* %171, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.7, i64 0, i64 0))
%173 = load i32*, i32** %6
%174 = getelementptr inbounds [500 x i8], [500 x i8]* %12, i64 0, i64 0
%175 = call i32 (i32*, i8*, ...) @fprintf(i32* %173, i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.8, i64 0, i64 0), i8* %174)
%176 = load i32*, i32** %6
%177 = call i32 (i32*, i8*, ...) @fprintf(i32* %176, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
%178 = load i32*, i32** %6
%179 = call i32 (i32*, i8*, ...) @fprintf(i32* %178, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [50 x i8] c"\09public void update(%s %s) throws SQLException {\0A\00"
@.str.1 = [35 x i8] c"\09\09\09String sql = 'UPDATE %s SET' +\0A\00"
@.str.2 = [13 x i8] c"\09\09\09'%s=?' +\0A\00"
@.str.3 = [18 x i8] c"\09\09\09'WHERE %s=?';\0A\00"
@.str.4 = [63 x i8] c"\09\09\09PreparedStatement statement = conn.preparedStatement(sql);\0A\00"
@.str.5 = [37 x i8] c"\09\09\09statement.set%s(%d, %s.get%s());\0A\00"
@.str.6 = [50 x i8] c"\09\09\09int rowsInserted = statement.executeUpdate();\0A\00"
@.str.7 = [28 x i8] c"\09\09\09if (rowsInserted > 0) {\0A\00"
@.str.8 = [69 x i8] c"\09\09\09\09System.out.println('An existing %s was updated successfully!');\0A\00"
@.str.9 = [6 x i8] c"\09\09\09}\0A\00"
@.str.10 = [4 x i8] c"\09\09}\00"
define void @mount_method_update(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 ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* %13, i8* %17)
%46 = call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* %14)
%47 = icmp sgt i32 %3, 1
br i1 %47, label %48, label %86
48: ; preds = %41
%49 = zext i32 %3 to i64
br label %50
50: ; preds = %48, %57
%51 = phi i64 [ 1, %48 ], [ %58, %57 ]
%52 = getelementptr inbounds [500 x i8], [500 x i8]* %1, i64 %51, i64 0
%53 = call i64 @strcmp(i8* %52, i8* %4)
%54 = icmp eq i64 %53, 0
br i1 %54, label %57, label %55
55: ; preds = %50
%56 = call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* %52)
br label %57
57: ; preds = %50, %55
%58 = add nuw nsw i64 %51, 1
%59 = icmp eq i64 %58, %49
br i1 %59, label %60, label %50
60: ; preds = %57
%61 = call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8* %4)
%62 = call i64 @fwrite(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.4, i64 0, i64 0), i64 62, i64 1, i32* %0)
br i1 %47, label %63, label %89
63: ; preds = %60
%64 = getelementptr inbounds [500 x i8], [500 x i8]* %11, i64 0, i64 0
%65 = getelementptr inbounds [500 x i8], [500 x i8]* %12, i64 0, i64 0
%66 = zext i32 %3 to i64
br label %67
67: ; preds = %63, %82
%68 = phi i64 [ 1, %63 ], [ %84, %82 ]
%69 = phi i32 [ 1, %63 ], [ %83, %82 ]
%70 = getelementptr inbounds [500 x i8], [500 x i8]* %1, i64 %68, i64 0
%71 = call i64 @strcmp(i8* %70, i8* %4)
%72 = icmp eq i64 %71, 0
br i1 %72, label %82, label %73
73: ; preds = %67
%74 = call i32 @strcpy(i8* %64, i8* %70)
%75 = call i32 @capitalize_name(i8* %64)
%76 = getelementptr inbounds i8*, i8** %24, i64 %68
%77 = load i8*, i8** %76
%78 = call i32 @strcpy(i8* %65, i8* %77)
%79 = call i32 @capitalize_name(i8* %65)
%80 = call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0), i8* %65, i32 %69, i8* %17, i8* %64)
%81 = add nsw i32 %69, 1
br label %82
82: ; preds = %67, %73
%83 = phi i32 [ %81, %73 ], [ %69, %67 ]
%84 = add nuw nsw i64 %68, 1
%85 = icmp eq i64 %84, %66
br i1 %85, label %89, label %67
86: ; preds = %41
%87 = call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8* %4)
%88 = call i64 @fwrite(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.4, i64 0, i64 0), i64 62, i64 1, i32* %0)
br label %89
89: ; preds = %82, %86, %60
%90 = add nsw i32 %3, -1
%91 = call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0), i8* %42, i32 %90, i8* %17, i8* %20)
%92 = call i64 @fwrite(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.6, i64 0, i64 0), i64 49, i64 1, i32* %0)
%93 = call i64 @fwrite(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.7, i64 0, i64 0), i64 27, i64 1, i32* %0)
%94 = call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.8, i64 0, i64 0), i8* %17)
%95 = call i64 @fwrite(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i64 5, i64 1, i32* %0)
%96 = call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i64 3, i64 1, i32* %0)
ret void
}