#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 findProcess(char *);
char *getenv(char *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int r;
  char *endptr;
  long contentlength;
  char *user = NULL, *psswd = NULL;
  const char *len1 = getenv("CONTENT_LENGTH");
  long l_content_lenght = 0;
  printf("%s\r\n\r\n", "Content-Type:text/html");
  printf(
      "<html><title>NetAudio</title><LINK href=/mpd.css rel=stylesheet>\r\n");
  r = findProcess("smbmount_child");
  if (r != -1)
    printf("<center>Samba Mount found.</center>\r\n");
  else
    printf("<center>Samba Mount not found.</center>\r\n");
  printf("<center><br>Samba Status</center><br></body></html>\r\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
lea    0xeaa(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
lea    0xea1(%rip),%rdi
lea    0xea1(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xedf(%rip),%rdi
call   1050 <findProcess@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
je     11b6 <main+0x86>
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11c4 <main+0x94>
lea    0xee8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf04(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <getenv@plt>
lea    0xebb(%rip),%rdi
lea    0xebb(%rip),%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xed3(%rip),%rdi
call   1040 <puts@plt>
lea    0xeb8(%rip),%rdi
call   1060 <findProcess@plt>
cmp    $0xffffffff,%eax
lea    0xefa(%rip),%rax
lea    0xf51(%rip),%rdi
cmove  %rax,%rdi
call   1040 <puts@plt>
lea    0xf0c(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"CONTENT_LENGTH\00"
@.str.1 = [7 x i8] c"%s\0D\0A\0D\0A\00"
@.str.2 = [23 x i8] c"Content-Type:text/html\00"
@.str.3 = [67 x i8] c"<html><title>NetAudio</title><LINK href=/mpd.css rel=stylesheet>\0D\0A\00"
@.str.4 = [15 x i8] c"smbmount_child\00"
@.str.5 = [38 x i8] c"<center>Samba Mount found.</center>\0D\0A\00"
@.str.6 = [42 x i8] c"<center>Samba Mount not found.</center>\0D\0A\00"
@.str.7 = [54 x i8] c"<center><br>Samba Status</center><br></body></html>\0D\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
store i32 0, i32* %1
store i8* null, i8** %5
store i8* null, i8** %6
%9 = call i8* @getenv(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
store i8* %9, i8** %7
store i64 0, i64* %8
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 @findProcess(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = icmp ne i32 %13, -1
br i1 %14, label %15, label %17
15: ; preds = %0
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.5, i64 0, i64 0))
br label %19
17: ; preds = %0
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.6, i64 0, i64 0))
br label %19
19: ; preds = %17, %15
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.7, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"CONTENT_LENGTH\00"
@.str.1 = [7 x i8] c"%s\0D\0A\0D\0A\00"
@.str.2 = [23 x i8] c"Content-Type:text/html\00"
@.str.4 = [15 x i8] c"smbmount_child\00"
@str = [66 x i8] c"<html><title>NetAudio</title><LINK href=/mpd.css rel=stylesheet>\0D\00"
@str.8 = [41 x i8] c"<center>Samba Mount not found.</center>\0D\00"
@str.9 = [53 x i8] c"<center><br>Samba Status</center><br></body></html>\0D\00"
@str.10 = [37 x i8] c"<center>Samba Mount found.</center>\0D\00"
define i32 @main() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @findProcess(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
%5 = icmp eq i32 %4, -1
%6 = select i1 %5, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @str.8, i64 0, i64 0), i8* getelementptr inbounds ([37 x i8], [37 x i8]* @str.10, i64 0, i64 0)
%7 = tail call i32 @puts(i8* dereferenceable(1) %6)
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.9, i64 0, i64 0))
ret i32 0
}