#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 GifError();
char *GifErrorString();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void PrintGifError(void) {
  char *Err = GifErrorString();
  if (Err != NULL)
    fprintf(stderr, "\nGIF-LIB error: %s.\n", Err);
  else
    fprintf(stderr, "\nGIF-LIB undefined error %d.\n", GifError());
}


x86 assembly (clang, -O0):
<PrintGifError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <GifErrorString@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     116e <PrintGifError+0x3e>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe9e(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    1194 <PrintGifError+0x64>
mov    0x2e6b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1050 <GifError@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%edx
lea    0xe88(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintGifError>:
push   %rbx
xor    %eax,%eax
call   1030 <GifErrorString@plt>
mov    0x2ea1(%rip),%rcx
mov    (%rcx),%ebx
test   %rax,%rax
je     115a <PrintGifError+0x2a>
lea    0xeb3(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
xor    %eax,%eax
pop    %rbx
jmp    1040 <fprintf@plt>
xor    %eax,%eax
call   1050 <GifError@plt>
lea    0xead(%rip),%rsi
mov    %ebx,%edi
mov    %eax,%edx
xor    %eax,%eax
pop    %rbx
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"\0AGIF-LIB error: %s.\0A\00"
@.str.1 = [30 x i8] c"\0AGIF-LIB undefined error %d.\0A\00"
define void @PrintGifError() {
%1 = alloca i8*
%2 = call i8* (...) @GifErrorString()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %0
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %1
%8 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %7)
br label %13
9: ; preds = %0
%10 = load i32, i32* @stderr
%11 = call i32 (...) @GifError()
%12 = call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %9, %5
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"\0AGIF-LIB error: %s.\0A\00"
@.str.1 = [30 x i8] c"\0AGIF-LIB undefined error %d.\0A\00"
define void @PrintGifError() {
%1 = tail call i8* (...) @GifErrorString()
%2 = icmp eq i8* %1, null
%3 = load i32, i32* @stderr
br i1 %2, label %6, label %4
4: ; preds = %0
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %9
6: ; preds = %0
%7 = tail call i32 (...) @GifError()
%8 = tail call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %6, %4
ret void
}