#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*/ exit(int /*<<< orphan*/);
char **getcgivars();
char *getenv(char *);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[], char *envp[]) {
  int i;
  char **cgivars;
  cgivars = getcgivars();
  printf("Content-Type:  text/html\n\n\n");
  printf("<HTML><HEAD><TITLE>CGI Sample Program</TITLE></HEAD><BODY>\n");
  printf("<H2>Sample Heading Goes Here</H2>\n");
  printf("<P>Number of arguments passed was %ld\n", argc);
  for (i = 0; i < argc; i++) {
    printf("<P>Argument number %ld is %s\n", i, argv[i]);
  }
  printf("<BR><BR>QUERY_STRING:  %s", getenv("QUERY_STRING"));
  printf("<BR>REQUEST_METHOD:  %s", getenv("REQUEST_METHOD"));
  printf("<BR>PATH_INFO:  %s", getenv("PAHT_INFO"));
  printf("<BR>PATH_TRANSLATED:  %s", getenv("PATH_TRANSLATED"));
  printf("<BR>REMOTE_USER:  %s", getenv("REMOTE_USER"));
  printf("<BR>REMOTE_ADDR:  %s", getenv("REMOTE_ADDR"));
  printf("<BR>REMOTE_HOST:  %s", getenv("REMOTE_HOST"));
  printf("<BR>SERVER_SOFTWARE:  %s", getenv("SERVER_SOFTWARE"));
  printf("<BR>SERVER_NAME:  %s", getenv("SERVER_NAME"));
  printf("<BR>GATEWAY_INTERFACE:  %s", getenv("GATEWAY_INTERFACE"));
  printf("<BR>SERVER_PROTOCOL:  %s", getenv("SERVER_PROTOCOL"));
  printf("<BR>SERVER_PORT:  %s", getenv("SERVER_PORT"));
  printf("<BR>REQUEST_METHOD:  %s", getenv("REQUEST_METHOD"));
  printf("<BR>HTTP_ACCEPT:  %s", getenv("HTTP_ACCEPT"));
  printf("<BR>HTTP_REFERER:  %s", getenv("HTTP_REFERER"));
  printf("<BR>SCRIPT_NAME:  %s", getenv("SCRIPT_NAME"));
  printf("<BR>AUTH_TYPE:  %s", getenv("AUTH_TYPE"));
  printf("<BR>CONTENT_TYPE:  %s", getenv("CONTENT_TYPE"));
  printf("<BR>CONTENT_LENGTH:  %s", getenv("CONTENT_LENGTH"));
  printf("<BR>Parmameters passed in:");
  printf("<ul>");
  for (i = 0; cgivars[i]; i += 2)
    printf("<li>%s = %s\n", cgivars[i], cgivars[i + 1]);
  printf("</ul>");
  printf("</BODY></HTML>\n");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1040 <getcgivars@plt>
mov    %rax,-0x28(%rbp)
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xed0(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xee2(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11de <main+0x9e>
mov    -0x1c(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11a7 <main+0x67>
lea    0xef5(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rsi
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xefd(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rsi
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xf02(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rsi
lea    0xee0(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xf08(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rsi
lea    0xee0(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xf10(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rsi
lea    0xeec(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xf14(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rsi
lea    0xef0(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xf18(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rsi
lea    0xef4(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xf20(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rsi
lea    0xef8(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xf28(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rsi
lea    0xf04(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xf32(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rsi
lea    0xf08(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xf40(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rsi
lea    0xf18(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xf48(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rsi
lea    0xf24(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xdbe(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rsi
lea    0xd97(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xf2f(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rsi
lea    0xf0b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xf34(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rsi
lea    0xf0f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xf39(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rsi
lea    0xf15(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xf3b(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rsi
lea    0xf19(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xf3e(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rsi
lea    0xf19(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xf46(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rsi
lea    0xf1f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xf38(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xf45(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x1c(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1474 <main+0x334>
mov    -0x28(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
mov    -0x28(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xf05(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x1c(%rbp)
jmp    1428 <main+0x2e8>
lea    0xef6(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xeee(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <getcgivars@plt>
mov    %rax,%rbx
lea    0x118e(%rip),%rdi
call   1050 <puts@plt>
lea    0x119d(%rip),%rdi
call   1050 <puts@plt>
lea    0x11cc(%rip),%rdi
call   1050 <puts@plt>
lea    0xe6e(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1060 <printf@plt>
test   %ebp,%ebp
jle    11c9 <main+0x79>
mov    %ebp,%r12d
lea    0xe7e(%rip),%r15
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbp,8),%rdx
mov    %r15,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%r12
jne    11b0 <main+0x60>
lea    0xe8f(%rip),%rdi
call   1030 <getenv@plt>
lea    0xe69(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe97(%rip),%r14
mov    %r14,%rdi
call   1030 <getenv@plt>
lea    0xe70(%rip),%r15
mov    %r15,%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe96(%rip),%rdi
call   1030 <getenv@plt>
lea    0xe77(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe9c(%rip),%rdi
call   1030 <getenv@plt>
lea    0xe77(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xea4(%rip),%rdi
call   1030 <getenv@plt>
lea    0xe83(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xea8(%rip),%rdi
call   1030 <getenv@plt>
lea    0xe87(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xeac(%rip),%rdi
call   1030 <getenv@plt>
lea    0xe8b(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xeb4(%rip),%rdi
call   1030 <getenv@plt>
lea    0xe8f(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xebc(%rip),%rdi
call   1030 <getenv@plt>
lea    0xe9b(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xec6(%rip),%rdi
call   1030 <getenv@plt>
lea    0xe9f(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xed4(%rip),%rdi
call   1030 <getenv@plt>
lea    0xeaf(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xedc(%rip),%rdi
call   1030 <getenv@plt>
lea    0xebb(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r14,%rdi
call   1030 <getenv@plt>
mov    %r15,%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xecb(%rip),%rdi
call   1030 <getenv@plt>
lea    0xeaa(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xed0(%rip),%rdi
call   1030 <getenv@plt>
lea    0xeae(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xed5(%rip),%rdi
call   1030 <getenv@plt>
lea    0xeb4(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xed7(%rip),%rdi
call   1030 <getenv@plt>
lea    0xeb8(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xeda(%rip),%rdi
call   1030 <getenv@plt>
lea    0xeb8(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xee2(%rip),%rdi
call   1030 <getenv@plt>
lea    0xebe(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xee1(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    (%rbx),%rsi
test   %rsi,%rsi
je     143a <main+0x2ea>
add    $0x10,%rbx
lea    0xecc(%rip),%rbp
nopl   (%rax)
mov    -0x8(%rbx),%rdx
mov    %rbp,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    (%rbx),%rsi
add    $0x10,%rbx
test   %rsi,%rsi
jne    1420 <main+0x2d0>
lea    0xeb5(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xf25(%rip),%rdi
call   1050 <puts@plt>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Content-Type: text/html\0A\0A\0A\00"
@.str.1 = [60 x i8] c"<HTML><HEAD><TITLE>CGI Sample Program</TITLE></HEAD><BODY>\0A\00"
@.str.2 = [35 x i8] c"<H2>Sample Heading Goes Here</H2>\0A\00"
@.str.3 = [39 x i8] c"<P>Number of arguments passed was %ld\0A\00"
@.str.4 = [30 x i8] c"<P>Argument number %ld is %s\0A\00"
@.str.5 = [26 x i8] c"<BR><BR>QUERY_STRING: %s\00"
@.str.6 = [13 x i8] c"QUERY_STRING\00"
@.str.7 = [24 x i8] c"<BR>REQUEST_METHOD: %s\00"
@.str.8 = [15 x i8] c"REQUEST_METHOD\00"
@.str.9 = [19 x i8] c"<BR>PATH_INFO: %s\00"
@.str.10 = [10 x i8] c"PAHT_INFO\00"
@.str.11 = [25 x i8] c"<BR>PATH_TRANSLATED: %s\00"
@.str.12 = [16 x i8] c"PATH_TRANSLATED\00"
@.str.13 = [21 x i8] c"<BR>REMOTE_USER: %s\00"
@.str.14 = [12 x i8] c"REMOTE_USER\00"
@.str.15 = [21 x i8] c"<BR>REMOTE_ADDR: %s\00"
@.str.16 = [12 x i8] c"REMOTE_ADDR\00"
@.str.17 = [21 x i8] c"<BR>REMOTE_HOST: %s\00"
@.str.18 = [12 x i8] c"REMOTE_HOST\00"
@.str.19 = [25 x i8] c"<BR>SERVER_SOFTWARE: %s\00"
@.str.20 = [16 x i8] c"SERVER_SOFTWARE\00"
@.str.21 = [21 x i8] c"<BR>SERVER_NAME: %s\00"
@.str.22 = [12 x i8] c"SERVER_NAME\00"
@.str.23 = [27 x i8] c"<BR>GATEWAY_INTERFACE: %s\00"
@.str.24 = [18 x i8] c"GATEWAY_INTERFACE\00"
@.str.25 = [25 x i8] c"<BR>SERVER_PROTOCOL: %s\00"
@.str.26 = [16 x i8] c"SERVER_PROTOCOL\00"
@.str.27 = [21 x i8] c"<BR>SERVER_PORT: %s\00"
@.str.28 = [12 x i8] c"SERVER_PORT\00"
@.str.29 = [21 x i8] c"<BR>HTTP_ACCEPT: %s\00"
@.str.30 = [12 x i8] c"HTTP_ACCEPT\00"
@.str.31 = [22 x i8] c"<BR>HTTP_REFERER: %s\00"
@.str.32 = [13 x i8] c"HTTP_REFERER\00"
@.str.33 = [21 x i8] c"<BR>SCRIPT_NAME: %s\00"
@.str.34 = [12 x i8] c"SCRIPT_NAME\00"
@.str.35 = [19 x i8] c"<BR>AUTH_TYPE: %s\00"
@.str.36 = [10 x i8] c"AUTH_TYPE\00"
@.str.37 = [22 x i8] c"<BR>CONTENT_TYPE: %s\00"
@.str.38 = [13 x i8] c"CONTENT_TYPE\00"
@.str.39 = [24 x i8] c"<BR>CONTENT_LENGTH: %s\00"
@.str.40 = [15 x i8] c"CONTENT_LENGTH\00"
@.str.41 = [27 x i8] c"<BR>Parmameters passed in:\00"
@.str.42 = [5 x i8] c"<ul>\00"
@.str.43 = [13 x i8] c"<li>%s = %s\0A\00"
@.str.44 = [6 x i8] c"</ul>\00"
@.str.45 = [16 x i8] c"</BODY></HTML>\0A\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca i32
%9 = alloca i8**
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%10 = call i8** (...) @getcgivars()
store i8** %10, i8*** %9
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
%14 = load i32, i32* %5
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0), i32 %14)
store i32 0, i32* %8
br label %16
16: ; preds = %28, %3
%17 = load i32, i32* %8
%18 = load i32, i32* %5
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %31
20: ; preds = %16
%21 = load i32, i32* %8
%22 = load i8**, i8*** %6
%23 = load i32, i32* %8
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8*, i8** %22, i64 %24
%26 = load i8*, i8** %25
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i32 %21, i8* %26)
br label %28
28: ; preds = %20
%29 = load i32, i32* %8
%30 = add nsw i32 %29, 1
store i32 %30, i32* %8
br label %16
31: ; preds = %16
%32 = call i8* @getenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i8* %32)
%34 = call i8* @getenv(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0))
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0), i8* %34)
%36 = call i8* @getenv(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0))
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0), i8* %36)
%38 = call i8* @getenv(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.12, i64 0, i64 0))
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.11, i64 0, i64 0), i8* %38)
%40 = call i8* @getenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.14, i64 0, i64 0))
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.13, i64 0, i64 0), i8* %40)
%42 = call i8* @getenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.16, i64 0, i64 0))
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.15, i64 0, i64 0), i8* %42)
%44 = call i8* @getenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.18, i64 0, i64 0))
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.17, i64 0, i64 0), i8* %44)
%46 = call i8* @getenv(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.20, i64 0, i64 0))
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.19, i64 0, i64 0), i8* %46)
%48 = call i8* @getenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.22, i64 0, i64 0))
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.21, i64 0, i64 0), i8* %48)
%50 = call i8* @getenv(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.24, i64 0, i64 0))
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.23, i64 0, i64 0), i8* %50)
%52 = call i8* @getenv(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.26, i64 0, i64 0))
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.25, i64 0, i64 0), i8* %52)
%54 = call i8* @getenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.28, i64 0, i64 0))
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.27, i64 0, i64 0), i8* %54)
%56 = call i8* @getenv(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0))
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0), i8* %56)
%58 = call i8* @getenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.30, i64 0, i64 0))
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.29, i64 0, i64 0), i8* %58)
%60 = call i8* @getenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.32, i64 0, i64 0))
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.31, i64 0, i64 0), i8* %60)
%62 = call i8* @getenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.34, i64 0, i64 0))
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.33, i64 0, i64 0), i8* %62)
%64 = call i8* @getenv(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.36, i64 0, i64 0))
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.35, i64 0, i64 0), i8* %64)
%66 = call i8* @getenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.38, i64 0, i64 0))
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.37, i64 0, i64 0), i8* %66)
%68 = call i8* @getenv(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.40, i64 0, i64 0))
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.39, i64 0, i64 0), i8* %68)
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.41, i64 0, i64 0))
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.42, i64 0, i64 0))
store i32 0, i32* %8
br label %72
72: ; preds = %92, %31
%73 = load i8**, i8*** %9
%74 = load i32, i32* %8
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds i8*, i8** %73, i64 %75
%77 = load i8*, i8** %76
%78 = icmp ne i8* %77, null
br i1 %78, label %79, label %95
79: ; preds = %72
%80 = load i8**, i8*** %9
%81 = load i32, i32* %8
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds i8*, i8** %80, i64 %82
%84 = load i8*, i8** %83
%85 = load i8**, i8*** %9
%86 = load i32, i32* %8
%87 = add nsw i32 %86, 1
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds i8*, i8** %85, i64 %88
%90 = load i8*, i8** %89
%91 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.43, i64 0, i64 0), i8* %84, i8* %90)
br label %92
92: ; preds = %79
%93 = load i32, i32* %8
%94 = add nsw i32 %93, 2
store i32 %94, i32* %8
br label %72
95: ; preds = %72
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.44, i64 0, i64 0))
%97 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.45, i64 0, i64 0))
%98 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str.3 = [39 x i8] c"<P>Number of arguments passed was %ld\0A\00"
@.str.4 = [30 x i8] c"<P>Argument number %ld is %s\0A\00"
@.str.5 = [26 x i8] c"<BR><BR>QUERY_STRING: %s\00"
@.str.6 = [13 x i8] c"QUERY_STRING\00"
@.str.7 = [24 x i8] c"<BR>REQUEST_METHOD: %s\00"
@.str.8 = [15 x i8] c"REQUEST_METHOD\00"
@.str.9 = [19 x i8] c"<BR>PATH_INFO: %s\00"
@.str.10 = [10 x i8] c"PAHT_INFO\00"
@.str.11 = [25 x i8] c"<BR>PATH_TRANSLATED: %s\00"
@.str.12 = [16 x i8] c"PATH_TRANSLATED\00"
@.str.13 = [21 x i8] c"<BR>REMOTE_USER: %s\00"
@.str.14 = [12 x i8] c"REMOTE_USER\00"
@.str.15 = [21 x i8] c"<BR>REMOTE_ADDR: %s\00"
@.str.16 = [12 x i8] c"REMOTE_ADDR\00"
@.str.17 = [21 x i8] c"<BR>REMOTE_HOST: %s\00"
@.str.18 = [12 x i8] c"REMOTE_HOST\00"
@.str.19 = [25 x i8] c"<BR>SERVER_SOFTWARE: %s\00"
@.str.20 = [16 x i8] c"SERVER_SOFTWARE\00"
@.str.21 = [21 x i8] c"<BR>SERVER_NAME: %s\00"
@.str.22 = [12 x i8] c"SERVER_NAME\00"
@.str.23 = [27 x i8] c"<BR>GATEWAY_INTERFACE: %s\00"
@.str.24 = [18 x i8] c"GATEWAY_INTERFACE\00"
@.str.25 = [25 x i8] c"<BR>SERVER_PROTOCOL: %s\00"
@.str.26 = [16 x i8] c"SERVER_PROTOCOL\00"
@.str.27 = [21 x i8] c"<BR>SERVER_PORT: %s\00"
@.str.28 = [12 x i8] c"SERVER_PORT\00"
@.str.29 = [21 x i8] c"<BR>HTTP_ACCEPT: %s\00"
@.str.30 = [12 x i8] c"HTTP_ACCEPT\00"
@.str.31 = [22 x i8] c"<BR>HTTP_REFERER: %s\00"
@.str.32 = [13 x i8] c"HTTP_REFERER\00"
@.str.33 = [21 x i8] c"<BR>SCRIPT_NAME: %s\00"
@.str.34 = [12 x i8] c"SCRIPT_NAME\00"
@.str.35 = [19 x i8] c"<BR>AUTH_TYPE: %s\00"
@.str.36 = [10 x i8] c"AUTH_TYPE\00"
@.str.37 = [22 x i8] c"<BR>CONTENT_TYPE: %s\00"
@.str.38 = [13 x i8] c"CONTENT_TYPE\00"
@.str.39 = [24 x i8] c"<BR>CONTENT_LENGTH: %s\00"
@.str.40 = [15 x i8] c"CONTENT_LENGTH\00"
@.str.41 = [27 x i8] c"<BR>Parmameters passed in:\00"
@.str.42 = [5 x i8] c"<ul>\00"
@.str.43 = [13 x i8] c"<li>%s = %s\0A\00"
@.str.44 = [6 x i8] c"</ul>\00"
@str = [27 x i8] c"Content-Type: text/html\0A\0A\00"
@str.46 = [59 x i8] c"<HTML><HEAD><TITLE>CGI Sample Program</TITLE></HEAD><BODY>\00"
@str.47 = [34 x i8] c"<H2>Sample Heading Goes Here</H2>\00"
@str.48 = [15 x i8] c"</BODY></HTML>\00"
define i32 @main(i32 %0, i8** nocapture %1, i8** nocapture readnone %2) {
%4 = tail call i8** (...) @getcgivars()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str.46, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.47, i64 0, i64 0))
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0), i32 %0)
%9 = icmp sgt i32 %0, 0
br i1 %9, label %10, label %20
10: ; preds = %3
%11 = zext i32 %0 to i64
br label %12
12: ; preds = %10, %12
%13 = phi i64 [ 0, %10 ], [ %18, %12 ]
%14 = getelementptr inbounds i8*, i8** %1, i64 %13
%15 = load i8*, i8** %14
%16 = trunc i64 %13 to i32
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i32 %16, i8* %15)
%18 = add nuw nsw i64 %13, 1
%19 = icmp eq i64 %18, %11
br i1 %19, label %20, label %12
20: ; preds = %12, %3
%21 = tail call i8* @getenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i8* %21)
%23 = tail call i8* @getenv(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0))
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0), i8* %23)
%25 = tail call i8* @getenv(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0))
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0), i8* %25)
%27 = tail call i8* @getenv(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.12, i64 0, i64 0))
%28 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.11, i64 0, i64 0), i8* %27)
%29 = tail call i8* @getenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.14, i64 0, i64 0))
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.13, i64 0, i64 0), i8* %29)
%31 = tail call i8* @getenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.16, i64 0, i64 0))
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.15, i64 0, i64 0), i8* %31)
%33 = tail call i8* @getenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.18, i64 0, i64 0))
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.17, i64 0, i64 0), i8* %33)
%35 = tail call i8* @getenv(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.20, i64 0, i64 0))
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.19, i64 0, i64 0), i8* %35)
%37 = tail call i8* @getenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.22, i64 0, i64 0))
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.21, i64 0, i64 0), i8* %37)
%39 = tail call i8* @getenv(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.24, i64 0, i64 0))
%40 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.23, i64 0, i64 0), i8* %39)
%41 = tail call i8* @getenv(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.26, i64 0, i64 0))
%42 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.25, i64 0, i64 0), i8* %41)
%43 = tail call i8* @getenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.28, i64 0, i64 0))
%44 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.27, i64 0, i64 0), i8* %43)
%45 = tail call i8* @getenv(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0))
%46 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0), i8* %45)
%47 = tail call i8* @getenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.30, i64 0, i64 0))
%48 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.29, i64 0, i64 0), i8* %47)
%49 = tail call i8* @getenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.32, i64 0, i64 0))
%50 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.31, i64 0, i64 0), i8* %49)
%51 = tail call i8* @getenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.34, i64 0, i64 0))
%52 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.33, i64 0, i64 0), i8* %51)
%53 = tail call i8* @getenv(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.36, i64 0, i64 0))
%54 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.35, i64 0, i64 0), i8* %53)
%55 = tail call i8* @getenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.38, i64 0, i64 0))
%56 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.37, i64 0, i64 0), i8* %55)
%57 = tail call i8* @getenv(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.40, i64 0, i64 0))
%58 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.39, i64 0, i64 0), i8* %57)
%59 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.41, i64 0, i64 0))
%60 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.42, i64 0, i64 0))
%61 = load i8*, i8** %4
%62 = icmp eq i8* %61, null
br i1 %62, label %74, label %63
63: ; preds = %20, %63
%64 = phi i64 [ %70, %63 ], [ 0, %20 ]
%65 = phi i8* [ %72, %63 ], [ %61, %20 ]
%66 = or i64 %64, 1
%67 = getelementptr inbounds i8*, i8** %4, i64 %66
%68 = load i8*, i8** %67
%69 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.43, i64 0, i64 0), i8* %65, i8* %68)
%70 = add nuw i64 %64, 2
%71 = getelementptr inbounds i8*, i8** %4, i64 %70
%72 = load i8*, i8** %71
%73 = icmp eq i8* %72, null
br i1 %73, label %74, label %63
74: ; preds = %63, %20
%75 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.44, i64 0, i64 0))
%76 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.48, i64 0, i64 0))
%77 = tail call i32 @exit(i32 0)
unreachable
}