#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 */
typedef int /*<<< orphan*/ data_bullet;

/* Variables and functions */
int DFGetImageDimensions(unsigned char *, int, char *, unsigned int *,
                         unsigned int *, char **);
int /*<<< orphan*/ utassert(int, char *);
void test_DFGetImageDimensions_gif(void) {
  static unsigned char data_bullet[] = {
      0x47, 0x49, 0x46, 0x38, 0x39, 0x61, 0x15, 0x00, 0x0F, 0x00, 0xB3, 0x00,
      0x00, 0xFB, 0xCF, 0x57, 0xFA, 0xD3, 0x5F, 0xFA, 0xD6, 0x66, 0xFC, 0xBE,
      0x38, 0xFD, 0xBA, 0x30, 0xFC, 0xC2, 0x3F, 0xFB, 0xCB, 0x50, 0xFD, 0xB7,
      0x29, 0xF9, 0xD9, 0x6C, 0xFE, 0xB1, 0x1E, 0xFE, 0xB4, 0x23, 0xFB, 0xC7,
      0x48, 0xFE, 0xAF, 0x1A, 0xF9, 0xDC, 0x71, 0xF3, 0x9A, 0x00, 0x00, 0x00,
      0x00, 0x21, 0xF9, 0x04, 0x01, 0x00, 0x00, 0x0E, 0x00, 0x2C, 0x00, 0x00,
      0x00, 0x00, 0x15, 0x00, 0x0F, 0x00, 0x00, 0x04, 0x30, 0xD0, 0xC9, 0x49,
      0xAB, 0xBD, 0x38, 0xEB, 0xCD, 0xBB, 0xFF, 0x20, 0x00, 0x52, 0x40, 0x30,
      0x4A, 0xA5, 0x90, 0x31, 0x89, 0x72, 0x10, 0x43, 0xB1, 0x18, 0x29, 0x82,
      0xB1, 0x2E, 0x2C, 0xD3, 0x81, 0x80, 0x34, 0x17, 0xDC, 0x2B, 0x36, 0xAB,
      0x8D, 0x52, 0xA7, 0xD2, 0xC9, 0x21, 0xCA, 0x44, 0x00, 0x00, 0x3B};
  static char ext_gif[] = "gif";
  int rc;
  unsigned int width, height;
  char *errmsg;
  rc = DFGetImageDimensions(data_bullet, sizeof(data_bullet), ext_gif, &width,
                            &height, &errmsg);
  utassert((rc == 1), "wrong rc");
  utassert((width == 21), "wrong width");
  utassert((height == 15), "wrong height");
}


x86 assembly (clang, -O0):
<test_DFGetImageDimensions_gif>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0x2f11(%rip),%rdi
mov    $0x83,%esi
lea    0x2f88(%rip),%rdx
lea    -0x8(%rbp),%rcx
lea    -0xc(%rbp),%r8
lea    -0x18(%rbp),%r9
call   1040 <DFGetImageDimensions@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xe9e(%rip),%rsi
call   1030 <utassert@plt>
cmpl   $0x15,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xe8f(%rip),%rsi
call   1030 <utassert@plt>
cmpl   $0xf,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xe83(%rip),%rsi
call   1030 <utassert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_DFGetImageDimensions_gif>:
sub    $0x18,%rsp
lea    0x2f15(%rip),%rdi
lea    0x2f91(%rip),%rdx
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
lea    0x10(%rsp),%r9
mov    $0x83,%esi
call   1040 <DFGetImageDimensions@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
lea    0xea5(%rip),%rsi
call   1030 <utassert@plt>
xor    %edi,%edi
cmpl   $0x15,0xc(%rsp)
sete   %dil
lea    0xe97(%rip),%rsi
call   1030 <utassert@plt>
xor    %edi,%edi
cmpl   $0xf,0x8(%rsp)
sete   %dil
lea    0xe8c(%rip),%rsi
call   1030 <utassert@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@test_DFGetImageDimensions_gif.data_bullet = internal global [131 x i8] c"GIF89a\15\00\0F\00\B3\00\00\FB\CFW\FA\D3_\FA\D6f\FC\BE8\FD\BA0\FC\C2?\FB\CBP\FD\B7)\F9\D9l\FE\B1\1E\FE\B4#\FB\C7H\FE\AF\1A\F9\DCq\F3\9A\00\00\00\00!\F9\04\01\00\00\0E\00,\00\00\00\00\15\00\0F\00\00\040\D0\C9I\AB\BD8\EB\CD\BB\FF \00R@0J\A5\901\89r\10C\B1\18)\82\B1.,\D3\81\804\17\DC+6\AB\8DR\A7\D2\C9!\CAD\00\00;"
@test_DFGetImageDimensions_gif.ext_gif = internal global [4 x i8] c"gif\00"
@.str = [9 x i8] c"wrong rc\00"
@.str.1 = [12 x i8] c"wrong width\00"
@.str.2 = [13 x i8] c"wrong height\00"
define void @test_DFGetImageDimensions_gif() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
%5 = call i32 @DFGetImageDimensions(i8* getelementptr inbounds ([131 x i8], [131 x i8]* @test_DFGetImageDimensions_gif.data_bullet, i64 0, i64 0), i32 131, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @test_DFGetImageDimensions_gif.ext_gif, i64 0, i64 0), i32* %2, i32* %3, i8** %4)
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = icmp eq i32 %6, 1
%8 = zext i1 %7 to i32
%9 = call i32 @utassert(i32 %8, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 21
%12 = zext i1 %11 to i32
%13 = call i32 @utassert(i32 %12, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%14 = load i32, i32* %3
%15 = icmp eq i32 %14, 15
%16 = zext i1 %15 to i32
%17 = call i32 @utassert(i32 %16, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@test_DFGetImageDimensions_gif.data_bullet = internal global [131 x i8] c"GIF89a\15\00\0F\00\B3\00\00\FB\CFW\FA\D3_\FA\D6f\FC\BE8\FD\BA0\FC\C2?\FB\CBP\FD\B7)\F9\D9l\FE\B1\1E\FE\B4#\FB\C7H\FE\AF\1A\F9\DCq\F3\9A\00\00\00\00!\F9\04\01\00\00\0E\00,\00\00\00\00\15\00\0F\00\00\040\D0\C9I\AB\BD8\EB\CD\BB\FF \00R@0J\A5\901\89r\10C\B1\18)\82\B1.,\D3\81\804\17\DC+6\AB\8DR\A7\D2\C9!\CAD\00\00;"
@test_DFGetImageDimensions_gif.ext_gif = internal global [4 x i8] c"gif\00"
@.str = [9 x i8] c"wrong rc\00"
@.str.1 = [12 x i8] c"wrong width\00"
@.str.2 = [13 x i8] c"wrong height\00"
define void @test_DFGetImageDimensions_gif() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i8** %3 to i8*
%7 = call i32 @DFGetImageDimensions(i8* getelementptr inbounds ([131 x i8], [131 x i8]* @test_DFGetImageDimensions_gif.data_bullet, i64 0, i64 0), i32 131, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @test_DFGetImageDimensions_gif.ext_gif, i64 0, i64 0), i32* %1, i32* %2, i8** %3)
%8 = icmp eq i32 %7, 1
%9 = zext i1 %8 to i32
%10 = call i32 @utassert(i32 %9, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* %1
%12 = icmp eq i32 %11, 21
%13 = zext i1 %12 to i32
%14 = call i32 @utassert(i32 %13, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 15
%17 = zext i1 %16 to i32
%18 = call i32 @utassert(i32 %17, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
ret void
}