#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 disp_queue();
int get_file_count();
int get_revision();
int /*<<< orphan*/ printf(char *, ...);
void info_task() {
  int res;
  printf("Retrieving Prism information...\n");
  res = get_revision();
  if (res < 0) {
    printf("  ERR: no revision could be retrieved\n");
    return;
  } else
    printf("  current revision: %d\n", res);
  res = get_file_count();
  if (res < 0) {
    printf("  ERR: file count error\n");
    return;
  } else
    printf("  tracking %d files\n", res);
  res = disp_queue();
  if (res == -4)
    printf("  no files in queue\n");
}


x86 assembly (clang, -O0):
<info_task>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <get_revision@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    117d <info_task+0x3d>
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11e8 <info_task+0xa8>
mov    -0x4(%rbp),%esi
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <get_file_count@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    11b5 <info_task+0x75>
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11e8 <info_task+0xa8>
mov    -0x4(%rbp),%esi
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <disp_queue@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xfffffffc,-0x4(%rbp)
jne    11e8 <info_task+0xa8>
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<info_task>:
push   %rax
lea    0xed5(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1070 <get_revision@plt>
test   %eax,%eax
js     11ac <info_task+0x5c>
lea    0xe91(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1030 <get_file_count@plt>
test   %eax,%eax
js     11b9 <info_task+0x69>
lea    0xe8e(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1060 <disp_queue@plt>
cmp    $0xfffffffc,%eax
jne    11c6 <info_task+0x76>
lea    0xea7(%rip),%rdi
pop    %rax
jmp    1040 <puts@plt>
lea    0xec6(%rip),%rdi
pop    %rax
jmp    1040 <puts@plt>
lea    0xea1(%rip),%rdi
pop    %rax
jmp    1040 <puts@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Retrieving Prism information...\0A\00"
@.str.1 = [39 x i8] c" ERR: no revision could be retrieved\0A\00"
@.str.2 = [24 x i8] c" current revision: %d\0A\00"
@.str.3 = [25 x i8] c" ERR: file count error\0A\00"
@.str.4 = [21 x i8] c" tracking %d files\0A\00"
@.str.5 = [21 x i8] c" no files in queue\0A\00"
define void @info_task() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @get_revision()
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
br label %26
8: ; preds = %0
%9 = load i32, i32* %1
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %8
%12 = call i32 (...) @get_file_count()
store i32 %12, i32* %1
%13 = load i32, i32* %1
%14 = icmp slt i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
br label %26
17: ; preds = %11
%18 = load i32, i32* %1
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), i32 %18)
br label %20
20: ; preds = %17
%21 = call i32 (...) @disp_queue()
store i32 %21, i32* %1
%22 = load i32, i32* %1
%23 = icmp eq i32 %22, -4
br i1 %23, label %24, label %26
24: ; preds = %20
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0))
br label %26
26: ; preds = %6, %15, %24, %20
ret void
}

LLVM IR (-O2):
@.str.2 = [24 x i8] c" current revision: %d\0A\00"
@.str.4 = [21 x i8] c" tracking %d files\0A\00"
@str = [32 x i8] c"Retrieving Prism information...\00"
@str.6 = [20 x i8] c" no files in queue\00"
@str.7 = [24 x i8] c" ERR: file count error\00"
@str.8 = [38 x i8] c" ERR: no revision could be retrieved\00"
define void @info_task() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @get_revision()
%3 = icmp slt i32 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %0
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %2)
%6 = tail call i32 (...) @get_file_count()
%7 = icmp slt i32 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %4
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), i32 %6)
%10 = tail call i32 (...) @disp_queue()
%11 = icmp eq i32 %10, -4
br i1 %11, label %12, label %15
12: ; preds = %8, %4, %0
%13 = phi i8* [ getelementptr inbounds ([38 x i8], [38 x i8]* @str.8, i64 0, i64 0), %0 ], [ getelementptr inbounds ([24 x i8], [24 x i8]* @str.7, i64 0, i64 0), %4 ], [ getelementptr inbounds ([20 x i8], [20 x i8]* @str.6, i64 0, i64 0), %8 ]
%14 = tail call i32 @puts(i8* dereferenceable(1) %13)
br label %15
15: ; preds = %12, %8
ret void
}