#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*/ border_print();
int /*<<< orphan*/ center_print(char *, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
void logo(int version) {
  border_print();
  printf(
      "                    _____   _____ ____                  _     \n"
      "                   |  __ \\ / ____|  _ \\                | |    \n"
      "                   | |__) | (___ | |_) | ___ _ __   ___| |__  \n"
      "                   |  _  / \\___ \\|  _ < / _ \\ '_ \\ / __| '_ \\ \n"
      "                   | | \\ \\ ____) | |_) |  __/ | | | (__| | | |\n"
      "                   |_|  \\_\\_____/|____/ \\___|_| |_|\\___|_| |_|\n");
  border_print();
  center_print("Developed at Argonne National Laboratory", 79);
  char v[100];
  sprintf(v, "Version: %d", version);
  center_print(v, 79);
  border_print();
}


x86 assembly (clang, -O0):
<logo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <border_print@plt>
lea    0xea7(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <border_print@plt>
lea    0x100f(%rip),%rdi
mov    $0x4f,%esi
call   1030 <center_print@plt>
lea    -0x70(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0x1020(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x70(%rbp),%rdi
mov    $0x4f,%esi
call   1030 <center_print@plt>
mov    $0x0,%al
call   1040 <border_print@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logo>:
push   %rbp
push   %rbx
sub    $0x68,%rsp
mov    %edi,%ebp
xor    %eax,%eax
call   1050 <border_print@plt>
lea    0xedf(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <border_print@plt>
lea    0xe97(%rip),%rdi
mov    $0x4f,%esi
call   1040 <center_print@plt>
lea    0xeaf(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %ebp,%edx
call   1060 <sprintf@plt>
mov    %rbx,%rdi
mov    $0x4f,%esi
call   1040 <center_print@plt>
xor    %eax,%eax
call   1050 <border_print@plt>
add    $0x68,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [379 x i8] c" _____ _____ ____ _ \0A | __ \\ / ____| _ \\ | | \0A | |__) | (___ | |_) | ___ _ __ ___| |__ \0A | _ / \\___ \\| _ < / _ \\ '_ \\ / __| '_ \\ \0A | | \\ \\ ____) | |_) | __/ | | | (__| | | |\0A |_| \\_\\_____/|____/ \\___|_| |_|\\___|_| |_|\0A\00"
@.str.1 = [41 x i8] c"Developed at Argonne National Laboratory\00"
@.str.2 = [12 x i8] c"Version: %d\00"
define void @logo(i32 %0) {
%2 = alloca i32
%3 = alloca [100 x i8]
store i32 %0, i32* %2
%4 = call i32 (...) @border_print()
%5 = call i32 @printf(i8* getelementptr inbounds ([379 x i8], [379 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (...) @border_print()
%7 = call i32 @center_print(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i32 79)
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%9 = load i32, i32* %2
%10 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %9)
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%12 = call i32 @center_print(i8* %11, i32 79)
%13 = call i32 (...) @border_print()
ret void
}

LLVM IR (-O2):
@.str.1 = [41 x i8] c"Developed at Argonne National Laboratory\00"
@.str.2 = [12 x i8] c"Version: %d\00"
@str = [378 x i8] c" _____ _____ ____ _ \0A | __ \\ / ____| _ \\ | | \0A | |__) | (___ | |_) | ___ _ __ ___| |__ \0A | _ / \\___ \\| _ < / _ \\ '_ \\ / __| '_ \\ \0A | | \\ \\ ____) | |_) | __/ | | | (__| | | |\0A |_| \\_\\_____/|____/ \\___|_| |_|\\___|_| |_|\00"
define void @logo(i32 %0) {
%2 = alloca [100 x i8]
%3 = tail call i32 (...) @border_print()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([378 x i8], [378 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 (...) @border_print()
%6 = tail call i32 @center_print(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i32 79)
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%8 = call i32 @sprintf(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %0)
%9 = call i32 @center_print(i8* %7, i32 79)
%10 = call i32 (...) @border_print()
ret void
}