#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*/ printf(char *, ...);
int strlen(char *);
void print_program_version(char *PROGRAM_NAME, char *PROGRAM_VERSION) {
  int count;
  printf("\n-----------------------------------\n");
  printf("%s", PROGRAM_NAME);
  for (count = 0; count < 25 - strlen(PROGRAM_NAME); count++)
    printf(" ");
  for (count = 0; count < 10 - strlen(PROGRAM_VERSION); count++)
    printf(" ");
  printf("%s\n\n", PROGRAM_VERSION);
  printf("(C) 2003 Miguelanxo Otero Salgueiro\n");
  printf("-----------------------------------\n\n");
}


x86 assembly (clang, -O0):
<print_program_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%edx
mov    -0x18(%rbp),%eax
mov    $0x19,%ecx
sub    %edx,%ecx
cmp    %ecx,%eax
jge    1196 <print_program_version+0x76>
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1157 <print_program_version+0x37>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%edx
mov    -0x1c(%rbp),%eax
mov    $0xa,%ecx
sub    %edx,%ecx
cmp    %ecx,%eax
jge    11dc <print_program_version+0xbc>
lea    0xe62(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    119d <print_program_version+0x7d>
mov    -0x10(%rbp),%rsi
lea    0xe44(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe3b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe52(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_program_version>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xeb7(%rip),%rdi
call   1040 <puts@plt>
lea    0xea3(%rip),%rdi
xor    %ebp,%ebp
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
cmp    $0x18,%eax
jg     11a0 <print_program_version+0x60>
cs nopw 0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    $0x19,%ecx
sub    %eax,%ecx
cmp    %ecx,%ebp
jl     1180 <print_program_version+0x40>
mov    %r14,%rdi
call   1050 <strlen@plt>
cmp    $0x9,%eax
jg     11d0 <print_program_version+0x90>
xor    %ebx,%ebx
nop
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
mov    %r14,%rdi
call   1050 <strlen@plt>
mov    $0xa,%ecx
sub    %eax,%ecx
cmp    %ecx,%ebx
jl     11b0 <print_program_version+0x70>
lea    0xe2c(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe45(%rip),%rdi
call   1040 <puts@plt>
lea    0xe5d(%rip),%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"\0A-----------------------------------\0A\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [2 x i8] c" \00"
@.str.3 = [5 x i8] c"%s\0A\0A\00"
@.str.4 = [37 x i8] c"(C) 2003 Miguelanxo Otero Salgueiro\0A\00"
@.str.5 = [38 x i8] c"-----------------------------------\0A\0A\00"
define void @print_program_version(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%7 = load i8*, i8** %3
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %7)
store i32 0, i32* %5
br label %9
9: ; preds = %17, %2
%10 = load i32, i32* %5
%11 = load i8*, i8** %3
%12 = call i32 @strlen(i8* %11)
%13 = sub nsw i32 25, %12
%14 = icmp slt i32 %10, %13
br i1 %14, label %15, label %20
15: ; preds = %9
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %17
17: ; preds = %15
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %9
20: ; preds = %9
store i32 0, i32* %5
br label %21
21: ; preds = %29, %20
%22 = load i32, i32* %5
%23 = load i8*, i8** %4
%24 = call i32 @strlen(i8* %23)
%25 = sub nsw i32 10, %24
%26 = icmp slt i32 %22, %25
br i1 %26, label %27, label %32
27: ; preds = %21
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %29
29: ; preds = %27
%30 = load i32, i32* %5
%31 = add nsw i32 %30, 1
store i32 %31, i32* %5
br label %21
32: ; preds = %21
%33 = load i8*, i8** %4
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %33)
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0))
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@.str.3 = [5 x i8] c"%s\0A\0A\00"
@str = [37 x i8] c"\0A-----------------------------------\00"
@str.6 = [36 x i8] c"(C) 2003 Miguelanxo Otero Salgueiro\00"
@str.7 = [37 x i8] c"-----------------------------------\0A\00"
define void @print_program_version(i8* %0, i8* %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%5 = tail call i32 @strlen(i8* %0)
%6 = icmp slt i32 %5, 25
br i1 %6, label %10, label %7
7: ; preds = %10, %2
%8 = tail call i32 @strlen(i8* %1)
%9 = icmp slt i32 %8, 10
br i1 %9, label %17, label %24
10: ; preds = %2, %10
%11 = phi i32 [ %13, %10 ], [ 0, %2 ]
%12 = tail call i32 @putchar(i32 32)
%13 = add nuw nsw i32 %11, 1
%14 = tail call i32 @strlen(i8* %0)
%15 = sub nsw i32 25, %14
%16 = icmp slt i32 %13, %15
br i1 %16, label %10, label %7
17: ; preds = %7, %17
%18 = phi i32 [ %20, %17 ], [ 0, %7 ]
%19 = tail call i32 @putchar(i32 32)
%20 = add nuw nsw i32 %18, 1
%21 = tail call i32 @strlen(i8* %1)
%22 = sub nsw i32 10, %21
%23 = icmp slt i32 %20, %22
br i1 %23, label %17, label %24
24: ; preds = %17, %7
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %1)
%26 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.6, i64 0, i64 0))
%27 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.7, i64 0, i64 0))
ret void
}