#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*/ HpmDisplayLine(char *, int);
int /*<<< orphan*/ printf(char *);
int HpmDisplayVersionHeader(int mode) {
  if (mode & (0x04)) {
    HpmDisplayLine("-", 71);
    printf("|ID | Name      |                     Versions                     "
           "   |\n");
    printf("|   |           |     Active      |     Backup      |      File    "
           "   |\n");
    HpmDisplayLine("-", 71);
  } else {
    HpmDisplayLine("-", 53);
    printf("|ID | Name      |             Versions              |\n");
    printf("|   |           |     Active      |     Backup      |\n");
    HpmDisplayLine("-", 53);
  }
  return 0;
}


x86 assembly (clang, -O0):
<HpmDisplayVersionHeader>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     1179 <HpmDisplayVersionHeader+0x59>
lea    0xebf(%rip),%rdi
mov    $0x47,%esi
call   1040 <HpmDisplayLine@plt>
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
lea    0xeed(%rip),%rdi
call   1030 <printf@plt>
lea    0xe96(%rip),%rdi
mov    $0x47,%esi
call   1040 <HpmDisplayLine@plt>
jmp    11b3 <HpmDisplayVersionHeader+0x93>
lea    0xe80(%rip),%rdi
mov    $0x35,%esi
call   1040 <HpmDisplayLine@plt>
lea    0xf03(%rip),%rdi
call   1030 <printf@plt>
lea    0xf2e(%rip),%rdi
call   1030 <printf@plt>
lea    0xe57(%rip),%rdi
mov    $0x35,%esi
call   1040 <HpmDisplayLine@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HpmDisplayVersionHeader>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   $0x4,%dil
mov    $0x35,%eax
mov    $0x47,%r14d
cmove  %eax,%r14d
lea    0xec1(%rip),%rax
lea    0xf26(%rip),%rbx
cmove  %rax,%rbx
lea    0xee5(%rip),%rax
lea    0xf5c(%rip),%rbp
cmove  %rax,%rbp
lea    0xe9b(%rip),%r15
mov    %r15,%rdi
mov    %r14d,%esi
call   1040 <HpmDisplayLine@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbp,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
mov    %r14d,%esi
call   1040 <HpmDisplayLine@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"-\00"
@.str.1 = [73 x i8] c"|ID | Name | Versions |\0A\00"
@.str.2 = [73 x i8] c"| | | Active | Backup | File |\0A\00"
@.str.3 = [55 x i8] c"|ID | Name | Versions |\0A\00"
@.str.4 = [55 x i8] c"| | | Active | Backup |\0A\00"
define i32 @HpmDisplayVersionHeader(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 4
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = call i32 @HpmDisplayLine(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 71)
%8 = call i32 @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @HpmDisplayLine(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 71)
br label %16
11: ; preds = %1
%12 = call i32 @HpmDisplayLine(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 53)
%13 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.4, i64 0, i64 0))
%15 = call i32 @HpmDisplayLine(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 53)
br label %16
16: ; preds = %11, %6
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"-\00"
@str = [54 x i8] c"|ID | Name | Versions |\00"
@str.5 = [54 x i8] c"| | | Active | Backup |\00"
@str.6 = [72 x i8] c"|ID | Name | Versions |\00"
@str.7 = [72 x i8] c"| | | Active | Backup | File |\00"
define i32 @HpmDisplayVersionHeader(i32 %0) {
%2 = and i32 %0, 4
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 53, i32 71
%5 = select i1 %3, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([72 x i8], [72 x i8]* @str.6, i64 0, i64 0)
%6 = select i1 %3, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @str.5, i64 0, i64 0), i8* getelementptr inbounds ([72 x i8], [72 x i8]* @str.7, i64 0, i64 0)
%7 = tail call i32 @HpmDisplayLine(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %4)
%8 = tail call i32 @puts(i8* dereferenceable(1) %5)
%9 = tail call i32 @puts(i8* dereferenceable(1) %6)
%10 = tail call i32 @HpmDisplayLine(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}