#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*/ avifCodecVersions(char *);
unsigned int avifLibYUVVersion();
char *avifVersion();
int /*<<< orphan*/ printf(char *, ...);
void avifPrintVersions(void) {
  char codecVersions[256];
  avifCodecVersions(codecVersions);
  printf("Version: %s (%s)\n", avifVersion(), codecVersions);
  unsigned int libyuvVersion = avifLibYUVVersion();
  if (libyuvVersion == 0) {
    printf("libyuv : unavailable\n");
  } else {
    printf("libyuv : available (%u)\n", libyuvVersion);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<avifPrintVersions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
lea    -0x100(%rbp),%rdi
call   1050 <avifCodecVersions@plt>
mov    $0x0,%al
call   1030 <avifVersion@plt>
mov    %rax,%rsi
lea    -0x100(%rbp),%rdx
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <avifLibYUVVersion@plt>
mov    %eax,-0x104(%rbp)
cmpl   $0x0,-0x104(%rbp)
jne    11a3 <avifPrintVersions+0x63>
lea    0xe7b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11b7 <avifPrintVersions+0x77>
mov    -0x104(%rbp),%esi
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe52(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<avifPrintVersions>:
push   %rbx
sub    $0x100,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1070 <avifCodecVersions@plt>
xor    %eax,%eax
call   1050 <avifVersion@plt>
lea    0xe7f(%rip),%rdi
mov    %rax,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
call   1080 <avifLibYUVVersion@plt>
test   %eax,%eax
je     11ab <avifPrintVersions+0x4b>
lea    0xe72(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    11b7 <avifPrintVersions+0x57>
lea    0xe79(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Version: %s (%s)\0A\00"
@.str.1 = [22 x i8] c"libyuv : unavailable\0A\00"
@.str.2 = [25 x i8] c"libyuv : available (%u)\0A\00"
@.str.3 = [2 x i8] c"\0A\00"
define void @avifPrintVersions() {
%1 = alloca [256 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%4 = call i32 @avifCodecVersions(i8* %3)
%5 = call i8* (...) @avifVersion()
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
%8 = call i32 (...) @avifLibYUVVersion()
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %0
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
br label %16
13: ; preds = %0
%14 = load i32, i32* %2
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %14)
br label %16
16: ; preds = %13, %11
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"Version: %s (%s)\0A\00"
@.str.2 = [25 x i8] c"libyuv : available (%u)\0A\00"
@str = [21 x i8] c"libyuv : unavailable\00"
define void @avifPrintVersions() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @avifCodecVersions(i8* %2)
%4 = call i8* (...) @avifVersion()
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %2)
%6 = call i32 (...) @avifLibYUVVersion()
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
br label %12
10: ; preds = %0
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %6)
br label %12
12: ; preds = %10, %8
%13 = call i32 @putchar(i32 10)
ret void
}