#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 */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ format;
  unsigned int bytes_per_line;
  unsigned int height;
  unsigned int depth;
};
typedef TYPE_1__ XImage;

/* Variables and functions */
scalar_t__ ZPixmap;
unsigned int Image_Size(XImage *image) {
  if (image->format != ZPixmap)
    return (image->bytes_per_line * image->height * image->depth);
  return ((unsigned)image->bytes_per_line * image->height);
}


x86 assembly (clang, -O0):
<Image_Size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    0x2ed2(%rip),%rcx
cmp    (%rcx),%rax
je     113e <Image_Size+0x3e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%eax
mov    -0x10(%rbp),%rcx
imul   0xc(%rcx),%eax
mov    -0x10(%rbp),%rcx
imul   0x10(%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    1150 <Image_Size+0x50>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%eax
mov    -0x10(%rbp),%rcx
imul   0xc(%rcx),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Image_Size>:
mov    (%rdi),%rcx
mov    0x2ede(%rip),%rdx
mov    0xc(%rdi),%eax
imul   0x8(%rdi),%eax
cmp    (%rdx),%rcx
je     111a <Image_Size+0x1a>
imul   0x10(%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64, i32, i32, i32 }
@ZPixmap = global i64 0
define i32 @Image_Size(%struct.TYPE_3__* %0) {
%2 = alloca i32
%3 = alloca %struct.TYPE_3__*
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %3
%4 = load %struct.TYPE_3__*, %struct.TYPE_3__** %3
%5 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = load i64, i64* @ZPixmap
%8 = icmp ne i64 %6, %7
br i1 %8, label %9, label %21
9: ; preds = %1
%10 = load %struct.TYPE_3__*, %struct.TYPE_3__** %3
%11 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %10, i32 0, i32 1
%12 = load i32, i32* %11
%13 = load %struct.TYPE_3__*, %struct.TYPE_3__** %3
%14 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %13, i32 0, i32 2
%15 = load i32, i32* %14
%16 = mul i32 %12, %15
%17 = load %struct.TYPE_3__*, %struct.TYPE_3__** %3
%18 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %17, i32 0, i32 3
%19 = load i32, i32* %18
%20 = mul i32 %16, %19
store i32 %20, i32* %2
br label %29
21: ; preds = %1
%22 = load %struct.TYPE_3__*, %struct.TYPE_3__** %3
%23 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %22, i32 0, i32 1
%24 = load i32, i32* %23
%25 = load %struct.TYPE_3__*, %struct.TYPE_3__** %3
%26 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %25, i32 0, i32 2
%27 = load i32, i32* %26
%28 = mul i32 %24, %27
store i32 %28, i32* %2
br label %29
29: ; preds = %21, %9
%30 = load i32, i32* %2
ret i32 %30
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i64, i32, i32, i32 }
@ZPixmap = global i64 0
define i32 @Image_Size(%struct.TYPE_3__* nocapture %0) {
%2 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%3 = load i64, i64* %2
%4 = load i64, i64* @ZPixmap
%5 = icmp eq i64 %3, %4
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 1
%7 = load i32, i32* %6
%8 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 2
%9 = load i32, i32* %8
%10 = mul i32 %9, %7
br i1 %5, label %15, label %11
11: ; preds = %1
%12 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 3
%13 = load i32, i32* %12
%14 = mul i32 %10, %13
br label %15
15: ; preds = %1, %11
%16 = phi i32 [ %14, %11 ], [ %10, %1 ]
ret i32 %16
}