#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 /*<<< orphan*/ vis5d_color_table_init_params(float *, int, int);
int /*<<< orphan*/ vis5d_color_table_recompute(unsigned int *, int, float *,
                                               int, int);
int /*<<< orphan*/ vis5d_color_table_set_alpha(float *, int);
int /*<<< orphan*/ vis5d_get_color_table_address(int, int, int, int,
                                                 unsigned int **);
int /*<<< orphan*/ vis5d_get_color_table_params(int, int, int, int, float **);
int init_irregular_var_clrtable(int dindex, int iindex, int var) {
  float *p;
  unsigned int *table;
  vis5d_get_color_table_params(dindex, 10, iindex, var, &p);
  vis5d_get_color_table_address(dindex, 10, iindex, var, &table);
  vis5d_color_table_init_params(p, 1, 1);
  vis5d_color_table_set_alpha(p, -2);
  vis5d_color_table_set_alpha(p, 255);
  vis5d_color_table_recompute(table, 256, p, 1, 1);
  return 0;
}


x86 assembly (clang, -O0):
<init_irregular_var_clrtable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0xa,%esi
lea    -0x18(%rbp),%r8
call   1030 <vis5d_get_color_table_params@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0xa,%esi
lea    -0x20(%rbp),%r8
call   1070 <vis5d_get_color_table_address@plt>
mov    -0x18(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1050 <vis5d_color_table_init_params@plt>
mov    -0x18(%rbp),%rdi
mov    $0xfffffffe,%esi
call   1060 <vis5d_color_table_set_alpha@plt>
mov    -0x18(%rbp),%rdi
mov    $0xff,%esi
call   1060 <vis5d_color_table_set_alpha@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x100,%esi
mov    $0x1,%r8d
mov    %r8d,%ecx
call   1040 <vis5d_color_table_recompute@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_irregular_var_clrtable>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
mov    %rsp,%r8
mov    $0xa,%esi
mov    %ebp,%edx
mov    %r14d,%ecx
call   1030 <vis5d_get_color_table_params@plt>
lea    0x8(%rsp),%r8
mov    %ebx,%edi
mov    $0xa,%esi
mov    %ebp,%edx
mov    %r14d,%ecx
call   1070 <vis5d_get_color_table_address@plt>
mov    (%rsp),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1050 <vis5d_color_table_init_params@plt>
mov    (%rsp),%rdi
mov    $0xfffffffe,%esi
call   1060 <vis5d_color_table_set_alpha@plt>
mov    (%rsp),%rdi
mov    $0xff,%esi
call   1060 <vis5d_color_table_set_alpha@plt>
mov    0x8(%rsp),%rdi
mov    (%rsp),%rdx
mov    $0x100,%esi
mov    $0x1,%ecx
mov    $0x1,%r8d
call   1040 <vis5d_color_table_recompute@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @init_irregular_var_clrtable(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca float*
%8 = alloca i32*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = call i32 @vis5d_get_color_table_params(i32 %9, i32 10, i32 %10, i32 %11, float** %7)
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = call i32 @vis5d_get_color_table_address(i32 %13, i32 10, i32 %14, i32 %15, i32** %8)
%17 = load float*, float** %7
%18 = call i32 @vis5d_color_table_init_params(float* %17, i32 1, i32 1)
%19 = load float*, float** %7
%20 = call i32 @vis5d_color_table_set_alpha(float* %19, i32 -2)
%21 = load float*, float** %7
%22 = call i32 @vis5d_color_table_set_alpha(float* %21, i32 255)
%23 = load i32*, i32** %8
%24 = load float*, float** %7
%25 = call i32 @vis5d_color_table_recompute(i32* %23, i32 256, float* %24, i32 1, i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @init_irregular_var_clrtable(i32 %0, i32 %1, i32 %2) {
%4 = alloca float*
%5 = alloca i32*
%6 = bitcast float** %4 to i8*
%7 = bitcast i32** %5 to i8*
%8 = call i32 @vis5d_get_color_table_params(i32 %0, i32 10, i32 %1, i32 %2, float** %4)
%9 = call i32 @vis5d_get_color_table_address(i32 %0, i32 10, i32 %1, i32 %2, i32** %5)
%10 = load float*, float** %4
%11 = call i32 @vis5d_color_table_init_params(float* %10, i32 1, i32 1)
%12 = load float*, float** %4
%13 = call i32 @vis5d_color_table_set_alpha(float* %12, i32 -2)
%14 = load float*, float** %4
%15 = call i32 @vis5d_color_table_set_alpha(float* %14, i32 255)
%16 = load i32*, i32** %5
%17 = load float*, float** %4
%18 = call i32 @vis5d_color_table_recompute(i32* %16, i32 256, float* %17, i32 1, i32 1)
ret i32 0
}