#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 */

/* Variables and functions */
int /*<<< orphan*/ appaserver_error_starting_argv_append_file(int, char **,
                                                              char *);
char *appaserver_parameter_file_get_cgi_directory();
char *application_background_color(char *);
int atoi(char *);
int /*<<< orphan*/ document_output_html_stream(int /*<<< orphan*/);
char *environ_get_application_name(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
char *format_initial_capital(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ search_replace_string(char *, char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, ...);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ system(int /*<<< orphan*/);
int /*<<< orphan*/ timlib_system_date_string();
char *trim_quotes(char *, char *);
int main(int argc, char **argv) {
  char *application_name, *folder;
  char buffer[1024];
  char trim_buffer[128];
  int inserted;
  char message[1024];
  char *vertical_new_button_many_folder_name;
  char onload_function[65536];
  char *session;
  char *login_name;
  char *role_name;
  char *content_type_yn;
  char *dictionary_string;
  application_name = environ_get_application_name(argv[0]);
  appaserver_error_starting_argv_append_file(argc, argv, application_name);
  if (argc < 10) {
    fprintf(
        stderr,
        "Usage: %s ignored folder session login_name role inserted message "
        "vertical_new_button_many_folder_name content_type_yn [dictionary]\n",
        argv[0]);
    exit(1);
  }
  folder = argv[2];
  session = argv[3];
  login_name = argv[4];
  role_name = argv[5];
  inserted = atoi(argv[6]);
  strcpy(message, argv[7]);
  search_replace_string(message, "\\", "");
  vertical_new_button_many_folder_name = argv[8];
  content_type_yn = argv[9];
  if (argc == 11)
    dictionary_string = argv[10];
  else
    dictionary_string = "";
  vertical_new_button_many_folder_name =
      trim_quotes(trim_buffer, vertical_new_button_many_folder_name);
  if (*vertical_new_button_many_folder_name) {
    char replace_string[2];
    sprintf(replace_string, "%c", '~');
    search_replace_string(dictionary_string, "=", replace_string);
    sprintf(onload_function,
            "onload=\"window.open('%s/"
            "output_prompt_insert_form?%s+%s+%s+%s+%s+insert+n+%s', '%s', "
            "'menubar=yes,resizable=yes,scrollbars=yes,status=yes,toolbar=yes,"
            "location=yes', 'false' );\"",
            appaserver_parameter_file_get_cgi_directory(), login_name,
            application_name, session, vertical_new_button_many_folder_name,
            role_name, dictionary_string, "prompt_frame");
  } else {
    *onload_function = '\0';
  }
  if (*content_type_yn == 'y')
    printf("Content-type: text/html\n\n");
  document_output_html_stream(stdout);
  printf("	<head>							\n"
         "		<link rel=stylesheet type=\"text/css\"		\n"
         "			href=/appaserver/%s/style.css>		\n"
         "		<TITLE>Insert %s results</TITLE>		\n"
         "	</head>							\n",
         application_name, folder);
  printf("	<body bgcolor=%s %s>					\n"
         "	<h1>Insert %s results</h1>				\n",
         application_background_color(application_name), onload_function,
         format_initial_capital(buffer, folder));
  fflush(stdout);
  if (system(timlib_system_date_string())) {
  };
  fflush(stdout);
  if (inserted > -1) {
    printf("<p>Rows inserted: %d<br>\n", inserted);
    if (*message)
      printf("%s\n", message);
  }
  printf("	</body>							\n"
         "	</html>							\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x10938,%rsp
movl   $0x0,-0xc(%rbp)
mov    %edi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
call   10b0 <environ_get_application_name@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1120 <appaserver_error_starting_argv_append_file@plt>
cmpl   $0xa,-0x10(%rbp)
jge    127a <main+0x6a>
mov    0x2d85(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rax
mov    (%rax),%rdx
lea    0xd95(%rip),%rsi
call   10a0 <fprintf@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x108d8(%rbp)
mov    -0x18(%rbp),%rax
mov    0x20(%rax),%rax
mov    %rax,-0x108e0(%rbp)
mov    -0x18(%rbp),%rax
mov    0x28(%rax),%rax
mov    %rax,-0x108e8(%rbp)
mov    -0x18(%rbp),%rax
mov    0x30(%rax),%rdi
call   10f0 <atoi@plt>
mov    %eax,-0x4b4(%rbp)
lea    -0x8c0(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    0x38(%rax),%rsi
call   1040 <strcpy@plt>
lea    -0x8c0(%rbp),%rdi
lea    0xd9d(%rip),%rsi
lea    0xf06(%rip),%rdx
call   1060 <search_replace_string@plt>
mov    -0x18(%rbp),%rax
mov    0x40(%rax),%rax
mov    %rax,-0x8c8(%rbp)
mov    -0x18(%rbp),%rax
mov    0x48(%rax),%rax
mov    %rax,-0x108f0(%rbp)
cmpl   $0xb,-0x10(%rbp)
jne    1330 <main+0x120>
mov    -0x18(%rbp),%rax
mov    0x50(%rax),%rax
mov    %rax,-0x108f8(%rbp)
jmp    133e <main+0x12e>
lea    0xebe(%rip),%rax
mov    %rax,-0x108f8(%rbp)
lea    -0x4b0(%rbp),%rdi
mov    -0x8c8(%rbp),%rsi
call   10d0 <trim_quotes@plt>
mov    %rax,-0x8c8(%rbp)
mov    -0x8c8(%rbp),%rax
cmpb   $0x0,(%rax)
je     140f <main+0x1ff>
lea    -0x108fa(%rbp),%rdi
lea    0xd11(%rip),%rsi
mov    $0x7e,%edx
mov    $0x0,%al
call   1100 <sprintf@plt>
mov    -0x108f8(%rbp),%rdi
lea    -0x108fa(%rbp),%rdx
lea    0xcf3(%rip),%rsi
call   1060 <search_replace_string@plt>
lea    -0x108d0(%rbp),%rax
mov    %rax,-0x10908(%rbp)
mov    $0x0,%al
call   1050 <appaserver_parameter_file_get_cgi_directory@plt>
mov    -0x10908(%rbp),%rdi
mov    %rax,%rdx
mov    -0x108e0(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x108d8(%rbp),%r9
mov    -0x8c8(%rbp),%rbx
mov    -0x108e8(%rbp),%r11
mov    -0x108f8(%rbp),%r10
lea    0xca3(%rip),%rsi
lea    0xd4d(%rip),%rax
mov    %rbx,(%rsp)
mov    %r11,0x8(%rsp)
mov    %r10,0x10(%rsp)
mov    %rax,0x18(%rsp)
mov    $0x0,%al
call   1100 <sprintf@plt>
jmp    1416 <main+0x206>
movb   $0x0,-0x108d0(%rbp)
mov    -0x108f0(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x79,%eax
jne    1437 <main+0x227>
lea    0xd1a(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    0x2b9a(%rip),%rax
mov    (%rax),%edi
call   1130 <document_output_html_stream@plt>
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
lea    0xd10(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <application_background_color@plt>
mov    %rax,-0x10918(%rbp)
lea    -0x108d0(%rbp),%rax
mov    %rax,-0x10910(%rbp)
lea    -0x430(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1090 <format_initial_capital@plt>
mov    -0x10918(%rbp),%rsi
mov    -0x10910(%rbp),%rdx
mov    %rax,%rcx
lea    0xd55(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    0x2b29(%rip),%rax
mov    (%rax),%edi
call   10c0 <fflush@plt>
mov    $0x0,%al
call   10e0 <timlib_system_date_string@plt>
mov    %eax,%edi
call   1070 <system@plt>
cmp    $0x0,%rax
je     14d3 <main+0x2c3>
jmp    14d3 <main+0x2c3>
mov    0x2afe(%rip),%rax
mov    (%rax),%edi
call   10c0 <fflush@plt>
cmpl   $0xffffffff,-0x4b4(%rbp)
jle    1529 <main+0x319>
mov    -0x4b4(%rbp),%esi
lea    0xd37(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
cmpb   $0x0,-0x8c0(%rbp)
je     1524 <main+0x314>
lea    -0x8c0(%rbp),%rsi
lea    0xd2f(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    1529 <main+0x319>
lea    0xd20(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
xor    %eax,%eax
add    $0x10938,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x108a8,%rsp
mov    %rsi,%r14
mov    %edi,%r15d
mov    (%rsi),%rdi
call   10c0 <environ_get_application_name@plt>
mov    %rax,%r12
mov    %r15d,%edi
mov    %r14,%rsi
mov    %rax,%rdx
call   1130 <appaserver_error_starting_argv_append_file@plt>
cmp    $0x9,%r15d
jle    141e <main+0x1fe>
mov    0x10(%r14),%r13
mov    0x18(%r14),%rax
mov    %rax,0x10(%rsp)
mov    0x20(%r14),%rax
mov    %rax,0x8(%rsp)
mov    0x28(%r14),%rax
mov    %rax,0x18(%rsp)
mov    0x30(%r14),%rdi
call   1100 <atoi@plt>
mov    %eax,0x4(%rsp)
mov    0x38(%r14),%rsi
lea    0xa0(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <strcpy@plt>
lea    0xde4(%rip),%rsi
lea    0xfa6(%rip),%rbp
mov    %rbx,%rdi
mov    %rbp,%rdx
call   1070 <search_replace_string@plt>
mov    0x40(%r14),%rsi
cmp    $0xb,%r15d
jne    12c1 <main+0xa1>
mov    0x50(%r14),%rbp
mov    0x48(%r14),%r14
lea    0x20(%rsp),%rdi
call   10e0 <trim_quotes@plt>
cmpb   $0x0,(%rax)
je     133a <main+0x11a>
mov    %rax,%rbx
movw   $0x7e,0x4a0(%rsp)
lea    0xd9f(%rip),%rsi
lea    0x4a0(%rsp),%rdx
mov    %rbp,%rdi
call   1070 <search_replace_string@plt>
xor    %eax,%eax
call   1060 <appaserver_parameter_file_get_cgi_directory@plt>
lea    0xe34(%rip),%r10
lea    0xd7c(%rip),%rsi
lea    0x8a0(%rsp),%rdi
mov    %rax,%rdx
mov    0x8(%rsp),%rcx
mov    %r12,%r8
mov    0x10(%rsp),%r9
xor    %eax,%eax
push   %r10
push   %rbp
push   0x28(%rsp)
push   %rbx
call   1110 <sprintf@plt>
add    $0x20,%rsp
jmp    1342 <main+0x122>
movb   $0x0,0x8a0(%rsp)
mov    0x4(%rsp),%r15d
cmpb   $0x79,(%r14)
jne    1359 <main+0x139>
lea    0xefb(%rip),%rdi
call   1050 <puts@plt>
mov    0x2c78(%rip),%rbp
mov    0x0(%rbp),%edi
call   1140 <document_output_html_stream@plt>
lea    0xdd8(%rip),%rdi
mov    %r12,%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1090 <printf@plt>
mov    %r12,%rdi
call   1030 <application_background_color@plt>
mov    %rax,%rbx
lea    0x4a0(%rsp),%rdi
mov    %r13,%rsi
call   10a0 <format_initial_capital@plt>
lea    0xe3b(%rip),%rdi
lea    0x8a0(%rsp),%rdx
mov    %rbx,%rsi
mov    %rax,%rcx
xor    %eax,%eax
call   1090 <printf@plt>
mov    0x0(%rbp),%edi
call   10d0 <fflush@plt>
xor    %eax,%eax
call   10f0 <timlib_system_date_string@plt>
mov    %eax,%edi
call   1080 <system@plt>
mov    0x0(%rbp),%edi
call   10d0 <fflush@plt>
test   %r15d,%r15d
js     13fe <main+0x1de>
lea    0xe38(%rip),%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1090 <printf@plt>
cmpb   $0x0,0xa0(%rsp)
je     13fe <main+0x1de>
lea    0xa0(%rsp),%rdi
call   1050 <puts@plt>
lea    0xe2a(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
add    $0x108a8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2bbb(%rip),%rax
mov    (%rax),%edi
mov    (%r14),%rdx
lea    0xbcf(%rip),%rsi
call   10b0 <fprintf@plt>
mov    $0x1,%edi
call   1120 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [133 x i8] c"Usage: %s ignored folder session login_name role inserted message vertical_new_button_many_folder_name content_type_yn [dictionary]\0A\00"
@.str.1 = [2 x i8] c"\\\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [3 x i8] c"%c\00"
@.str.4 = [2 x i8] c"=\00"
@.str.5 = [177 x i8] c"onload=\22window.open('%s/output_prompt_insert_form?%s+%s+%s+%s+%s+insert+n+%s', '%s', 'menubar=yes,resizable=yes,scrollbars=yes,status=yes,toolbar=yes,location=yes', 'false' );\22\00"
@.str.6 = [13 x i8] c"prompt_frame\00"
@.str.7 = [26 x i8] c"Content-type: text/html\0A\0A\00"
@stdout = global i32 0
@.str.8 = [146 x i8] c"\09<head>\09\09\09\09\09\09\09\0A\09\09<link rel=stylesheet type=\22text/css\22\09\09\0A\09\09\09href=/appaserver/%s/style.css>\09\09\0A\09\09<TITLE>Insert %s results</TITLE>\09\09\0A\09</head>\09\09\09\09\09\09\09\0A\00"
@.str.9 = [60 x i8] c"\09<body bgcolor=%s %s>\09\09\09\09\09\0A\09<h1>Insert %s results</h1>\09\09\09\09\0A\00"
@.str.10 = [26 x i8] c"<p>Rows inserted: %d<br>\0A\00"
@.str.11 = [4 x i8] c"%s\0A\00"
@.str.12 = [33 x i8] c"\09</body>\09\09\09\09\09\09\09\0A\09</html>\09\09\09\09\09\09\09\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca [1024 x i8]
%9 = alloca [128 x i8]
%10 = alloca i32
%11 = alloca [1024 x i8]
%12 = alloca i8*
%13 = alloca [65536 x i8]
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i8*
%17 = alloca i8*
%18 = alloca i8*
%19 = alloca [2 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 0
%22 = load i8*, i8** %21
%23 = call i8* @environ_get_application_name(i8* %22)
store i8* %23, i8** %6
%24 = load i32, i32* %4
%25 = load i8**, i8*** %5
%26 = load i8*, i8** %6
%27 = call i32 @appaserver_error_starting_argv_append_file(i32 %24, i8** %25, i8* %26)
%28 = load i32, i32* %4
%29 = icmp slt i32 %28, 10
br i1 %29, label %30, label %37
30: ; preds = %2
%31 = load i32, i32* @stderr
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 0
%34 = load i8*, i8** %33
%35 = call i32 @fprintf(i32 %31, i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i8* %34)
%36 = call i32 @exit(i32 1)
unreachable
37: ; preds = %2
%38 = load i8**, i8*** %5
%39 = getelementptr inbounds i8*, i8** %38, i64 2
%40 = load i8*, i8** %39
store i8* %40, i8** %7
%41 = load i8**, i8*** %5
%42 = getelementptr inbounds i8*, i8** %41, i64 3
%43 = load i8*, i8** %42
store i8* %43, i8** %14
%44 = load i8**, i8*** %5
%45 = getelementptr inbounds i8*, i8** %44, i64 4
%46 = load i8*, i8** %45
store i8* %46, i8** %15
%47 = load i8**, i8*** %5
%48 = getelementptr inbounds i8*, i8** %47, i64 5
%49 = load i8*, i8** %48
store i8* %49, i8** %16
%50 = load i8**, i8*** %5
%51 = getelementptr inbounds i8*, i8** %50, i64 6
%52 = load i8*, i8** %51
%53 = call i32 @atoi(i8* %52)
store i32 %53, i32* %10
%54 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%55 = load i8**, i8*** %5
%56 = getelementptr inbounds i8*, i8** %55, i64 7
%57 = load i8*, i8** %56
%58 = call i32 @strcpy(i8* %54, i8* %57)
%59 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%60 = call i32 @search_replace_string(i8* %59, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%61 = load i8**, i8*** %5
%62 = getelementptr inbounds i8*, i8** %61, i64 8
%63 = load i8*, i8** %62
store i8* %63, i8** %12
%64 = load i8**, i8*** %5
%65 = getelementptr inbounds i8*, i8** %64, i64 9
%66 = load i8*, i8** %65
store i8* %66, i8** %17
%67 = load i32, i32* %4
%68 = icmp eq i32 %67, 11
br i1 %68, label %69, label %73
69: ; preds = %37
%70 = load i8**, i8*** %5
%71 = getelementptr inbounds i8*, i8** %70, i64 10
%72 = load i8*, i8** %71
store i8* %72, i8** %18
br label %74
73: ; preds = %37
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8** %18
br label %74
74: ; preds = %73, %69
%75 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%76 = load i8*, i8** %12
%77 = call i8* @trim_quotes(i8* %75, i8* %76)
store i8* %77, i8** %12
%78 = load i8*, i8** %12
%79 = load i8, i8* %78
%80 = icmp ne i8 %79, 0
br i1 %80, label %81, label %96
81: ; preds = %74
%82 = getelementptr inbounds [2 x i8], [2 x i8]* %19, i64 0, i64 0
%83 = call i32 (i8*, i8*, ...) @sprintf(i8* %82, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 126)
%84 = load i8*, i8** %18
%85 = getelementptr inbounds [2 x i8], [2 x i8]* %19, i64 0, i64 0
%86 = call i32 @search_replace_string(i8* %84, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i8* %85)
%87 = getelementptr inbounds [65536 x i8], [65536 x i8]* %13, i64 0, i64 0
%88 = call i8* (...) @appaserver_parameter_file_get_cgi_directory()
%89 = load i8*, i8** %15
%90 = load i8*, i8** %6
%91 = load i8*, i8** %14
%92 = load i8*, i8** %12
%93 = load i8*, i8** %16
%94 = load i8*, i8** %18
%95 = call i32 (i8*, i8*, ...) @sprintf(i8* %87, i8* getelementptr inbounds ([177 x i8], [177 x i8]* @.str.5, i64 0, i64 0), i8* %88, i8* %89, i8* %90, i8* %91, i8* %92, i8* %93, i8* %94, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
br label %98
96: ; preds = %74
%97 = getelementptr inbounds [65536 x i8], [65536 x i8]* %13, i64 0, i64 0
store i8 0, i8* %97
br label %98
98: ; preds = %96, %81
%99 = load i8*, i8** %17
%100 = load i8, i8* %99
%101 = sext i8 %100 to i32
%102 = icmp eq i32 %101, 121
br i1 %102, label %103, label %105
103: ; preds = %98
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0))
br label %105
105: ; preds = %103, %98
%106 = load i32, i32* @stdout
%107 = call i32 @document_output_html_stream(i32 %106)
%108 = load i8*, i8** %6
%109 = load i8*, i8** %7
%110 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.8, i64 0, i64 0), i8* %108, i8* %109)
%111 = load i8*, i8** %6
%112 = call i8* @application_background_color(i8* %111)
%113 = getelementptr inbounds [65536 x i8], [65536 x i8]* %13, i64 0, i64 0
%114 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%115 = load i8*, i8** %7
%116 = call i8* @format_initial_capital(i8* %114, i8* %115)
%117 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.9, i64 0, i64 0), i8* %112, i8* %113, i8* %116)
%118 = load i32, i32* @stdout
%119 = call i32 @fflush(i32 %118)
%120 = call i32 (...) @timlib_system_date_string()
%121 = call i64 @system(i32 %120)
%122 = icmp ne i64 %121, 0
br i1 %122, label %123, label %124
123: ; preds = %105
br label %124
124: ; preds = %123, %105
%125 = load i32, i32* @stdout
%126 = call i32 @fflush(i32 %125)
%127 = load i32, i32* %10
%128 = icmp sgt i32 %127, -1
br i1 %128, label %129, label %139
129: ; preds = %124
%130 = load i32, i32* %10
%131 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.10, i64 0, i64 0), i32 %130)
%132 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%133 = load i8, i8* %132
%134 = icmp ne i8 %133, 0
br i1 %134, label %135, label %138
135: ; preds = %129
%136 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%137 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i8* %136)
br label %138
138: ; preds = %135, %129
br label %139
139: ; preds = %138, %124
%140 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.12, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [133 x i8] c"Usage: %s ignored folder session login_name role inserted message vertical_new_button_many_folder_name content_type_yn [dictionary]\0A\00"
@.str.1 = [2 x i8] c"\\\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.4 = [2 x i8] c"=\00"
@.str.5 = [177 x i8] c"onload=\22window.open('%s/output_prompt_insert_form?%s+%s+%s+%s+%s+insert+n+%s', '%s', 'menubar=yes,resizable=yes,scrollbars=yes,status=yes,toolbar=yes,location=yes', 'false' );\22\00"
@.str.6 = [13 x i8] c"prompt_frame\00"
@stdout = global i32 0
@.str.8 = [146 x i8] c"\09<head>\09\09\09\09\09\09\09\0A\09\09<link rel=stylesheet type=\22text/css\22\09\09\0A\09\09\09href=/appaserver/%s/style.css>\09\09\0A\09\09<TITLE>Insert %s results</TITLE>\09\09\0A\09</head>\09\09\09\09\09\09\09\0A\00"
@.str.9 = [60 x i8] c"\09<body bgcolor=%s %s>\09\09\09\09\09\0A\09<h1>Insert %s results</h1>\09\09\09\09\0A\00"
@.str.10 = [26 x i8] c"<p>Rows inserted: %d<br>\0A\00"
@str = [32 x i8] c"\09</body>\09\09\09\09\09\09\09\0A\09</html>\09\09\09\09\09\09\09\00"
@str.13 = [25 x i8] c"Content-type: text/html\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca [1024 x i8]
%4 = alloca [128 x i8]
%5 = alloca [1024 x i8]
%6 = alloca [65536 x i8]
%7 = alloca [2 x i8]
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%9 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%11 = getelementptr inbounds [65536 x i8], [65536 x i8]* %6, i64 0, i64 0
%12 = load i8*, i8** %1
%13 = tail call i8* @environ_get_application_name(i8* %12)
%14 = tail call i32 @appaserver_error_starting_argv_append_file(i32 %0, i8** %1, i8* %13)
%15 = icmp slt i32 %0, 10
br i1 %15, label %16, label %21
16: ; preds = %2
%17 = load i32, i32* @stderr
%18 = load i8*, i8** %1
%19 = tail call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i8* %18)
%20 = tail call i32 @exit(i32 1)
unreachable
21: ; preds = %2
%22 = getelementptr inbounds i8*, i8** %1, i64 2
%23 = load i8*, i8** %22
%24 = getelementptr inbounds i8*, i8** %1, i64 3
%25 = load i8*, i8** %24
%26 = getelementptr inbounds i8*, i8** %1, i64 4
%27 = load i8*, i8** %26
%28 = getelementptr inbounds i8*, i8** %1, i64 5
%29 = load i8*, i8** %28
%30 = getelementptr inbounds i8*, i8** %1, i64 6
%31 = load i8*, i8** %30
%32 = tail call i32 @atoi(i8* %31)
%33 = getelementptr inbounds i8*, i8** %1, i64 7
%34 = load i8*, i8** %33
%35 = call i32 @strcpy(i8* %10, i8* %34)
%36 = call i32 @search_replace_string(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%37 = getelementptr inbounds i8*, i8** %1, i64 8
%38 = load i8*, i8** %37
%39 = getelementptr inbounds i8*, i8** %1, i64 9
%40 = load i8*, i8** %39
%41 = icmp eq i32 %0, 11
br i1 %41, label %42, label %45
42: ; preds = %21
%43 = getelementptr inbounds i8*, i8** %1, i64 10
%44 = load i8*, i8** %43
br label %45
45: ; preds = %21, %42
%46 = phi i8* [ %44, %42 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), %21 ]
%47 = call i8* @trim_quotes(i8* %9, i8* %38)
%48 = load i8, i8* %47
%49 = icmp eq i8 %48, 0
br i1 %49, label %56, label %50
50: ; preds = %45
%51 = getelementptr inbounds [2 x i8], [2 x i8]* %7, i64 0, i64 0
store i8 126, i8* %51
%52 = getelementptr inbounds [2 x i8], [2 x i8]* %7, i64 0, i64 1
store i8 0, i8* %52
%53 = call i32 @search_replace_string(i8* %46, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i8* %51)
%54 = call i8* (...) @appaserver_parameter_file_get_cgi_directory()
%55 = call i32 (i8*, i8*, ...) @sprintf(i8* %11, i8* dereferenceable(1) getelementptr inbounds ([177 x i8], [177 x i8]* @.str.5, i64 0, i64 0), i8* %54, i8* %27, i8* %13, i8* %25, i8* %47, i8* %29, i8* %46, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
br label %57
56: ; preds = %45
store i8 0, i8* %11
br label %57
57: ; preds = %56, %50
%58 = load i8, i8* %40
%59 = icmp eq i8 %58, 121
br i1 %59, label %60, label %62
60: ; preds = %57
%61 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.13, i64 0, i64 0))
br label %62
62: ; preds = %60, %57
%63 = load i32, i32* @stdout
%64 = call i32 @document_output_html_stream(i32 %63)
%65 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([146 x i8], [146 x i8]* @.str.8, i64 0, i64 0), i8* %13, i8* %23)
%66 = call i8* @application_background_color(i8* %13)
%67 = call i8* @format_initial_capital(i8* %8, i8* %23)
%68 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @.str.9, i64 0, i64 0), i8* %66, i8* %11, i8* %67)
%69 = load i32, i32* @stdout
%70 = call i32 @fflush(i32 %69)
%71 = call i32 (...) @timlib_system_date_string()
%72 = call i64 @system(i32 %71)
%73 = load i32, i32* @stdout
%74 = call i32 @fflush(i32 %73)
%75 = icmp sgt i32 %32, -1
br i1 %75, label %76, label %82
76: ; preds = %62
%77 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.10, i64 0, i64 0), i32 %32)
%78 = load i8, i8* %10
%79 = icmp eq i8 %78, 0
br i1 %79, label %82, label %80
80: ; preds = %76
%81 = call i32 @puts(i8* %10)
br label %82
82: ; preds = %76, %80, %62
%83 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
ret i32 0
}