#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*/ cleanUp(int, char **, char **);
int /*<<< orphan*/ display_on_framebuffer();
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ getrand(int);
int /*<<< orphan*/ htmlBody();
int /*<<< orphan*/ htmlFooter();
int /*<<< orphan*/ htmlHeaderNocache(char *);
char *itostr(int /*<<< orphan*/, int, int, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stdout;
void capture(int form_method, char **getvars, char **postvars) {
  htmlHeaderNocache("AWG Demo	Web	Page");
  htmlBody();
  printf("\n<img border=\"0\"	src=\"/img.png?id=%s\" align=\"left\">\n",
         itostr(getrand(6), 6, 1, 1));
  htmlFooter();
  fflush(stdout);
  cleanUp(form_method, getvars, postvars);
  display_on_framebuffer();
  return;
}


x86 assembly (clang, -O0):
<capture>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xe56(%rip),%rdi
call   1070 <htmlHeaderNocache@plt>
mov    $0x0,%al
call   1050 <htmlBody@plt>
mov    $0x6,%edi
call   10b0 <getrand@plt>
mov    %eax,%edi
mov    $0x6,%esi
mov    $0x1,%ecx
mov    %ecx,%edx
call   1090 <itostr@plt>
mov    %rax,%rsi
lea    0xe35(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   10a0 <htmlFooter@plt>
mov    0x2df0(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1080 <cleanUp@plt>
mov    $0x0,%al
call   1040 <display_on_framebuffer@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<capture>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xe5d(%rip),%rdi
call   1070 <htmlHeaderNocache@plt>
xor    %eax,%eax
call   1050 <htmlBody@plt>
mov    $0x6,%edi
call   10b0 <getrand@plt>
mov    %eax,%edi
mov    $0x6,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
call   1090 <itostr@plt>
lea    0xe3c(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
call   10a0 <htmlFooter@plt>
mov    0x2df4(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1080 <cleanUp@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <display_on_framebuffer@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"AWG Demo\09Web\09Page\00"
@.str.1 = [53 x i8] c"\0A<img border=\220\22\09src=\22/img.png?id=%s\22 align=\22left\22>\0A\00"
@stdout = global i32 0
define void @capture(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8**
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8** %2, i8*** %6
%7 = call i32 @htmlHeaderNocache(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (...) @htmlBody()
%9 = call i32 @getrand(i32 6)
%10 = call i8* @itostr(i32 %9, i32 6, i32 1, i32 1)
%11 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%12 = call i32 (...) @htmlFooter()
%13 = load i32, i32* @stdout
%14 = call i32 @fflush(i32 %13)
%15 = load i32, i32* %4
%16 = load i8**, i8*** %5
%17 = load i8**, i8*** %6
%18 = call i32 @cleanUp(i32 %15, i8** %16, i8** %17)
%19 = call i32 (...) @display_on_framebuffer()
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"AWG Demo\09Web\09Page\00"
@.str.1 = [53 x i8] c"\0A<img border=\220\22\09src=\22/img.png?id=%s\22 align=\22left\22>\0A\00"
@stdout = global i32 0
define void @capture(i32 %0, i8** %1, i8** %2) {
%4 = tail call i32 @htmlHeaderNocache(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 (...) @htmlBody()
%6 = tail call i32 @getrand(i32 6)
%7 = tail call i8* @itostr(i32 %6, i32 6, i32 1, i32 1)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = tail call i32 (...) @htmlFooter()
%10 = load i32, i32* @stdout
%11 = tail call i32 @fflush(i32 %10)
%12 = tail call i32 @cleanUp(i32 %0, i8** %1, i8** %2)
%13 = tail call i32 (...) @display_on_framebuffer()
ret void
}