#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*/ gsl_float_decl_global(char *);
int /*<<< orphan*/ gsl_int_decl_global(char *);
int /*<<< orphan*/ gsl_ptr_decl_global(char *);
int /*<<< orphan*/ gsl_struct_decl_global_from_id(char *, int);
void gsl_declare_global_variable(int type, char *name) {
  switch (type) {
  case -1:
    break;
  case 264:
    gsl_float_decl_global(name);
    break;
  case 263:
    gsl_int_decl_global(name);
    break;
  case 262:
    gsl_ptr_decl_global(name);
    break;
  default: {
    int id = type - 1000;
    gsl_struct_decl_global_from_id(name, id);
  }
  }
}


x86 assembly (clang, -O0):
<gsl_declare_global_variable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
sub    $0xffffffff,%eax
je     119c <gsl_declare_global_variable+0x5c>
jmp    1163 <gsl_declare_global_variable+0x23>
mov    -0x18(%rbp),%eax
sub    $0x106,%eax
je     11bd <gsl_declare_global_variable+0x7d>
jmp    1176 <gsl_declare_global_variable+0x36>
mov    -0x18(%rbp),%eax
sub    $0x107,%eax
je     11af <gsl_declare_global_variable+0x6f>
jmp    1189 <gsl_declare_global_variable+0x49>
mov    -0x18(%rbp),%eax
sub    $0x108,%eax
je     11a1 <gsl_declare_global_variable+0x61>
jmp    11cb <gsl_declare_global_variable+0x8b>
jmp    11e2 <gsl_declare_global_variable+0xa2>
mov    -0x10(%rbp),%rdi
call   1040 <gsl_float_decl_global@plt>
jmp    11e2 <gsl_declare_global_variable+0xa2>
mov    -0x10(%rbp),%rdi
call   1060 <gsl_int_decl_global@plt>
jmp    11e2 <gsl_declare_global_variable+0xa2>
mov    -0x10(%rbp),%rdi
call   1050 <gsl_ptr_decl_global@plt>
jmp    11e2 <gsl_declare_global_variable+0xa2>
mov    -0x4(%rbp),%eax
sub    $0x3e8,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <gsl_struct_decl_global_from_id@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gsl_declare_global_variable>:
mov    %edi,%eax
cmp    $0x106,%edi
jg     115e <gsl_declare_global_variable+0x1e>
cmp    $0xffffffff,%eax
je     1183 <gsl_declare_global_variable+0x43>
cmp    $0x106,%eax
jne    1174 <gsl_declare_global_variable+0x34>
mov    %rsi,%rdi
jmp    1050 <gsl_ptr_decl_global@plt>
cmp    $0x107,%eax
je     1184 <gsl_declare_global_variable+0x44>
cmp    $0x108,%eax
jne    1174 <gsl_declare_global_variable+0x34>
mov    %rsi,%rdi
jmp    1040 <gsl_float_decl_global@plt>
add    $0xfffffc18,%eax
mov    %rsi,%rdi
mov    %eax,%esi
jmp    1030 <gsl_struct_decl_global_from_id@plt>
ret
mov    %rsi,%rdi
jmp    1060 <gsl_int_decl_global@plt>

LLVM IR (-O0):
define void @gsl_declare_global_variable(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
switch i32 %6, label %17 [
i32 -1, label %7
i32 264, label %8
i32 263, label %11
i32 262, label %14
]
7: ; preds = %2
br label %23
8: ; preds = %2
%9 = load i8*, i8** %4
%10 = call i32 @gsl_float_decl_global(i8* %9)
br label %23
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = call i32 @gsl_int_decl_global(i8* %12)
br label %23
14: ; preds = %2
%15 = load i8*, i8** %4
%16 = call i32 @gsl_ptr_decl_global(i8* %15)
br label %23
17: ; preds = %2
%18 = load i32, i32* %3
%19 = sub nsw i32 %18, 1000
store i32 %19, i32* %5
%20 = load i8*, i8** %4
%21 = load i32, i32* %5
%22 = call i32 @gsl_struct_decl_global_from_id(i8* %20, i32 %21)
br label %23
23: ; preds = %17, %14, %11, %8, %7
ret void
}

LLVM IR (-O2):
define void @gsl_declare_global_variable(i32 %0, i8* %1) {
switch i32 %0, label %9 [
i32 -1, label %12
i32 264, label %3
i32 263, label %5
i32 262, label %7
]
3: ; preds = %2
%4 = tail call i32 @gsl_float_decl_global(i8* %1)
br label %12
5: ; preds = %2
%6 = tail call i32 @gsl_int_decl_global(i8* %1)
br label %12
7: ; preds = %2
%8 = tail call i32 @gsl_ptr_decl_global(i8* %1)
br label %12
9: ; preds = %2
%10 = add nsw i32 %0, -1000
%11 = tail call i32 @gsl_struct_decl_global_from_id(i8* %1, i32 %10)
br label %12
12: ; preds = %9, %7, %5, %3, %2
ret void
}