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


x86 assembly (clang, -O0):
<PrintGifError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <GifErrorString@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1162 <PrintGifError+0x42>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xeaa(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    117c <PrintGifError+0x5c>
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xe9f(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintGifError>:
push   %rbx
mov    %edi,%ebx
call   1030 <GifErrorString@plt>
mov    0x2eb1(%rip),%rcx
mov    (%rcx),%edi
test   %rax,%rax
je     1148 <PrintGifError+0x28>
lea    0xec3(%rip),%rsi
mov    %rax,%rdx
xor    %eax,%eax
pop    %rbx
jmp    1040 <fprintf@plt>
lea    0xec5(%rip),%rsi
mov    %ebx,%edx
xor    %eax,%eax
pop    %rbx
jmp    1040 <fprintf@plt>

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

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