#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__ class;
  int red_mask;
  int green_mask;
  int blue_mask;
  int colormap_size;
};
typedef TYPE_1__ XVisualInfo;

/* Variables and functions */
scalar_t__ DirectColor;
scalar_t__ TrueColor;
int EffectiveSize(XVisualInfo *vinfo) {
  if ((vinfo->class == DirectColor) || (vinfo->class == TrueColor))
    return (vinfo->red_mask | vinfo->green_mask | vinfo->blue_mask) + 1;
  else
    return vinfo->colormap_size;
}


x86 assembly (clang, -O0):
<EffectiveSize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    0x2eda(%rip),%rcx
cmp    (%rcx),%rax
je     1136 <EffectiveSize+0x36>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    0x2eb3(%rip),%rcx
cmp    (%rcx),%rax
jne    1156 <EffectiveSize+0x56>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%eax
mov    -0x10(%rbp),%rcx
or     0xc(%rcx),%eax
mov    -0x10(%rbp),%rcx
or     0x10(%rcx),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1160 <EffectiveSize+0x60>
mov    -0x10(%rbp),%rax
mov    0x14(%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<EffectiveSize>:
mov    (%rdi),%rax
mov    0x2ee6(%rip),%rcx
cmp    (%rcx),%rax
je     111f <EffectiveSize+0x1f>
mov    0x2eca(%rip),%rcx
cmp    (%rcx),%rax
je     111f <EffectiveSize+0x1f>
mov    0x14(%rdi),%eax
ret
mov    0xc(%rdi),%eax
or     0x8(%rdi),%eax
or     0x10(%rdi),%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64, i32, i32, i32, i32 }
@DirectColor = global i64 0
@TrueColor = global i64 0
define i32 @EffectiveSize(%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* @DirectColor
%8 = icmp eq i64 %6, %7
br i1 %8, label %15, label %9
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 0
%12 = load i64, i64* %11
%13 = load i64, i64* @TrueColor
%14 = icmp eq i64 %12, %13
br i1 %14, label %15, label %28
15: ; preds = %9, %1
%16 = load %struct.TYPE_3__*, %struct.TYPE_3__** %3
%17 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %16, i32 0, i32 1
%18 = load i32, i32* %17
%19 = load %struct.TYPE_3__*, %struct.TYPE_3__** %3
%20 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %19, i32 0, i32 2
%21 = load i32, i32* %20
%22 = or i32 %18, %21
%23 = load %struct.TYPE_3__*, %struct.TYPE_3__** %3
%24 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %23, i32 0, i32 3
%25 = load i32, i32* %24
%26 = or i32 %22, %25
%27 = add nsw i32 %26, 1
store i32 %27, i32* %2
br label %32
28: ; preds = %9
%29 = load %struct.TYPE_3__*, %struct.TYPE_3__** %3
%30 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %29, i32 0, i32 4
%31 = load i32, i32* %30
store i32 %31, i32* %2
br label %32
32: ; preds = %28, %15
%33 = load i32, i32* %2
ret i32 %33
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i64, i32, i32, i32, i32 }
@DirectColor = global i64 0
@TrueColor = global i64 0
define i32 @EffectiveSize(%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* @DirectColor
%5 = icmp eq i64 %3, %4
%6 = load i64, i64* @TrueColor
%7 = icmp eq i64 %3, %6
%8 = select i1 %5, i1 true, i1 %7
br i1 %8, label %9, label %19
9: ; preds = %1
%10 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 1
%11 = load i32, i32* %10
%12 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 2
%13 = load i32, i32* %12
%14 = or i32 %13, %11
%15 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 3
%16 = load i32, i32* %15
%17 = or i32 %14, %16
%18 = add nsw i32 %17, 1
br label %22
19: ; preds = %1
%20 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 4
%21 = load i32, i32* %20
br label %22
22: ; preds = %19, %9
%23 = phi i32 [ %18, %9 ], [ %21, %19 ]
ret i32 %23
}