#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 */
char *application_background_color(char *);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdout;
scalar_t__ system(int /*<<< orphan*/);
int /*<<< orphan*/ timlib_system_date_string();
void google_chart_output_prompt(char *application_name, char *prompt_filename,
                                char *target_window, char *where_clause) {
  if (application_name) {
    printf("<body bgcolor=\"%s\" onload=\"window.open('%s','%s');\">\n",
           application_background_color(application_name), prompt_filename,
           target_window);
  }
  printf("<h1>Google Chart Viewer ");
  fflush(stdout);
  if (system(timlib_system_date_string())) {
  };
  printf("</h1>\n");
  if (where_clause && *where_clause)
    printf("<br>Search criteria: %s\n", where_clause);
  printf("<br><hr><a href=\"%s\" target=%s>Press to view chart.</a>\n",
         prompt_filename, target_window);
}


x86 assembly (clang, -O0):
<google_chart_output_prompt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1195 <google_chart_output_prompt+0x45>
mov    -0x8(%rbp),%rdi
call   1030 <application_background_color@plt>
mov    %rax,%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x2e36(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
mov    $0x0,%al
call   1070 <timlib_system_date_string@plt>
mov    %eax,%edi
call   1040 <system@plt>
cmp    $0x0,%rax
je     11ce <google_chart_output_prompt+0x7e>
jmp    11ce <google_chart_output_prompt+0x7e>
lea    0xe7a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
cmpq   $0x0,-0x20(%rbp)
je     1209 <google_chart_output_prompt+0xb9>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1209 <google_chart_output_prompt+0xb9>
mov    -0x20(%rbp),%rsi
lea    0xe54(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<google_chart_output_prompt>:
push   %r15
push   %r14
push   %rbx
mov    %rcx,%rbx
mov    %rdx,%r14
mov    %rsi,%r15
test   %rdi,%rdi
je     118f <google_chart_output_prompt+0x2f>
call   1030 <application_background_color@plt>
lea    0xe81(%rip),%rdi
mov    %rax,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xea0(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2e3c(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
xor    %eax,%eax
call   1080 <timlib_system_date_string@plt>
mov    %eax,%edi
call   1050 <system@plt>
lea    0xee1(%rip),%rdi
call   1040 <puts@plt>
test   %rbx,%rbx
je     11e0 <google_chart_output_prompt+0x80>
cmpb   $0x0,(%rbx)
je     11e0 <google_chart_output_prompt+0x80>
lea    0xe79(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe81(%rip),%rdi
mov    %r15,%rsi
mov    %r14,%rdx
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    1060 <printf@plt>

LLVM IR (-O0):
@.str = [54 x i8] c"<body bgcolor=\22%s\22 onload=\22window.open('%s','%s');\22>\0A\00"
@.str.1 = [25 x i8] c"<h1>Google Chart Viewer \00"
@stdout = global i32 0
@.str.2 = [7 x i8] c"</h1>\0A\00"
@.str.3 = [25 x i8] c"<br>Search criteria: %s\0A\00"
@.str.4 = [57 x i8] c"<br><hr><a href=\22%s\22 target=%s>Press to view chart.</a>\0A\00"
define void @google_chart_output_prompt(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %17
11: ; preds = %4
%12 = load i8*, i8** %5
%13 = call i8* @application_background_color(i8* %12)
%14 = load i8*, i8** %6
%15 = load i8*, i8** %7
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8* %13, i8* %14, i8* %15)
br label %17
17: ; preds = %11, %4
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%19 = load i32, i32* @stdout
%20 = call i32 @fflush(i32 %19)
%21 = call i32 (...) @timlib_system_date_string()
%22 = call i64 @system(i32 %21)
%23 = icmp ne i64 %22, 0
br i1 %23, label %24, label %25
24: ; preds = %17
br label %25
25: ; preds = %24, %17
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%27 = load i8*, i8** %8
%28 = icmp ne i8* %27, null
br i1 %28, label %29, label %37
29: ; preds = %25
%30 = load i8*, i8** %8
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = icmp ne i32 %32, 0
br i1 %33, label %34, label %37
34: ; preds = %29
%35 = load i8*, i8** %8
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i8* %35)
br label %37
37: ; preds = %34, %29, %25
%38 = load i8*, i8** %6
%39 = load i8*, i8** %7
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.4, i64 0, i64 0), i8* %38, i8* %39)
ret void
}

LLVM IR (-O2):
@.str = [54 x i8] c"<body bgcolor=\22%s\22 onload=\22window.open('%s','%s');\22>\0A\00"
@.str.1 = [25 x i8] c"<h1>Google Chart Viewer \00"
@stdout = global i32 0
@.str.3 = [25 x i8] c"<br>Search criteria: %s\0A\00"
@.str.4 = [57 x i8] c"<br><hr><a href=\22%s\22 target=%s>Press to view chart.</a>\0A\00"
@str = [6 x i8] c"</h1>\00"
define void @google_chart_output_prompt(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = icmp eq i8* %0, null
br i1 %5, label %9, label %6
6: ; preds = %4
%7 = tail call i8* @application_background_color(i8* %0)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %1, i8* %2)
br label %9
9: ; preds = %6, %4
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%11 = load i32, i32* @stdout
%12 = tail call i32 @fflush(i32 %11)
%13 = tail call i32 (...) @timlib_system_date_string()
%14 = tail call i64 @system(i32 %13)
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%16 = icmp eq i8* %3, null
br i1 %16, label %22, label %17
17: ; preds = %9
%18 = load i8, i8* %3
%19 = icmp eq i8 %18, 0
br i1 %19, label %22, label %20
20: ; preds = %17
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i8* %3)
br label %22
22: ; preds = %20, %17, %9
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.4, i64 0, i64 0), i8* %1, i8* %2)
ret void
}