#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 */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
int analyzefeed();
int /*<<< orphan*/ asctime(struct tm *);
int /*<<< orphan*/ fputs(int /*<<< orphan*/, int /*<<< orphan*/);
int get_page(char *, char *);
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int /*<<< orphan*/ trimfeed();
void start(char *url) {
  time_t currenttime;
  struct tm *loctime;
  currenttime = time(NULL);
  loctime = localtime(&currenttime);
  fputs(asctime(loctime), stdout);
  printf("Checking inbox now.... ");
  int pageStatus, analyzeStatus;
  pageStatus = get_page(url, ".downloaded_feed");
  if (pageStatus == 0) {
    printf("done\n");
    printf("Looking for any new message... ");
    trimfeed();
    analyzeStatus = analyzefeed();
    if (analyzeStatus != 0)
      printf("\nCould not analyze XML feed.\n");
  } else
    printf("Could not download page.\n");
}


x86 assembly (clang, -O0):
<start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1080 <time@plt>
mov    %eax,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <asctime@plt>
mov    %eax,%edi
mov    0x2e29(%rip),%rax
mov    (%rax),%esi
call   1070 <fputs@plt>
lea    0xe3b(%rip),%rdi
call   1050 <printf@plt>
mov    -0x8(%rbp),%rdi
lea    0xe43(%rip),%rsi
call   1060 <get_page@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    122b <start+0xab>
lea    0xe3b(%rip),%rdi
call   1050 <printf@plt>
lea    0xe35(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1090 <trimfeed@plt>
mov    $0x0,%al
call   10a0 <analyzefeed@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     1226 <start+0xa6>
lea    0xe2e(%rip),%rdi
call   1050 <printf@plt>
jmp    1237 <start+0xb7>
lea    0xe3b(%rip),%rdi
call   1050 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<start>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
xor    %edi,%edi
call   1090 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
mov    %rax,%rdi
call   1050 <asctime@plt>
mov    0x2e24(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
call   1080 <fputs@plt>
lea    0xe34(%rip),%rdi
call   1060 <printf@plt>
lea    0xe40(%rip),%rsi
mov    %rbx,%rdi
call   1070 <get_page@plt>
test   %eax,%eax
je     11ed <start+0x5d>
lea    0xe5e(%rip),%rdi
jmp    121e <start+0x8e>
lea    0xe6e(%rip),%rdi
call   1040 <puts@plt>
lea    0xe29(%rip),%rdi
call   1060 <printf@plt>
xor    %eax,%eax
call   10a0 <trimfeed@plt>
xor    %eax,%eax
call   10b0 <analyzefeed@plt>
test   %eax,%eax
je     1223 <start+0x93>
lea    0xe49(%rip),%rdi
call   1040 <puts@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@stdout = global i32 0
@.str = [24 x i8] c"Checking inbox now.... \00"
@.str.1 = [17 x i8] c".downloaded_feed\00"
@.str.2 = [6 x i8] c"done\0A\00"
@.str.3 = [32 x i8] c"Looking for any new message... \00"
@.str.4 = [30 x i8] c"\0ACould not analyze XML feed.\0A\00"
@.str.5 = [26 x i8] c"Could not download page.\0A\00"
define void @start(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca %struct.tm*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %2
%7 = call i32 @time(i32* null)
store i32 %7, i32* %3
%8 = call %struct.tm* @localtime(i32* %3)
store %struct.tm* %8, %struct.tm** %4
%9 = load %struct.tm*, %struct.tm** %4
%10 = call i32 @asctime(%struct.tm* %9)
%11 = load i32, i32* @stdout
%12 = call i32 @fputs(i32 %10, i32 %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%14 = load i8*, i8** %2
%15 = call i32 @get_page(i8* %14, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
store i32 %15, i32* %5
%16 = load i32, i32* %5
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %28
18: ; preds = %1
%19 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%20 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
%21 = call i32 (...) @trimfeed()
%22 = call i32 (...) @analyzefeed()
store i32 %22, i32* %6
%23 = load i32, i32* %6
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %18
%26 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0))
br label %27
27: ; preds = %25, %18
br label %30
28: ; preds = %1
%29 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0))
br label %30
30: ; preds = %28, %27
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@stdout = global i32 0
@.str = [24 x i8] c"Checking inbox now.... \00"
@.str.1 = [17 x i8] c".downloaded_feed\00"
@.str.3 = [32 x i8] c"Looking for any new message... \00"
@str = [25 x i8] c"Could not download page.\00"
@str.6 = [5 x i8] c"done\00"
@str.7 = [29 x i8] c"\0ACould not analyze XML feed.\00"
define void @start(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @time(i32* null)
store i32 %4, i32* %2
%5 = call %struct.tm* @localtime(i32* %2)
%6 = call i32 @asctime(%struct.tm* %5)
%7 = load i32, i32* @stdout
%8 = call i32 @fputs(i32 %6, i32 %7)
%9 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @get_page(i8* %0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %1
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.6, i64 0, i64 0))
%14 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
%15 = call i32 (...) @trimfeed()
%16 = call i32 (...) @analyzefeed()
%17 = icmp eq i32 %16, 0
br i1 %17, label %21, label %18
18: ; preds = %1, %12
%19 = phi i8* [ getelementptr inbounds ([29 x i8], [29 x i8]* @str.7, i64 0, i64 0), %12 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0), %1 ]
%20 = call i32 @puts(i8* dereferenceable(1) %19)
br label %21
21: ; preds = %18, %12
ret void
}