#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 */
scalar_t__ minipack_is_int16(void *);
scalar_t__ minipack_is_int32(void *);
scalar_t__ minipack_is_int64(void *);
scalar_t__ minipack_is_int8(void *);
scalar_t__ minipack_is_neg_fixnum(void *);
scalar_t__ minipack_is_pos_fixnum(void *);
scalar_t__ minipack_is_uint16(void *);
scalar_t__ minipack_is_uint32(void *);
scalar_t__ minipack_is_uint64(void *);
scalar_t__ minipack_is_uint8(void *);
size_t minipack_sizeof_int_elem(void *ptr) {
  if (minipack_is_pos_fixnum(ptr)) {
    return 1;
  } else if (minipack_is_neg_fixnum(ptr)) {
    return 1;
  } else if (minipack_is_int8(ptr)) {
    return 2;
  } else if (minipack_is_int16(ptr)) {
    return 3;
  } else if (minipack_is_int32(ptr)) {
    return 5;
  } else if (minipack_is_int64(ptr)) {
    return 9;
  } else if (minipack_is_uint8(ptr)) {
    return 2;
  } else if (minipack_is_uint16(ptr)) {
    return 3;
  } else if (minipack_is_uint32(ptr)) {
    return 5;
  } else if (minipack_is_uint64(ptr)) {
    return 9;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<minipack_sizeof_int_elem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1070 <minipack_is_pos_fixnum@plt>
cmp    $0x0,%rax
je     11cc <minipack_sizeof_int_elem+0x2c>
movq   $0x1,-0x8(%rbp)
jmp    12f4 <minipack_sizeof_int_elem+0x154>
mov    -0x10(%rbp),%rdi
call   10c0 <minipack_is_neg_fixnum@plt>
cmp    $0x0,%rax
je     11ec <minipack_sizeof_int_elem+0x4c>
movq   $0x1,-0x8(%rbp)
jmp    12f4 <minipack_sizeof_int_elem+0x154>
mov    -0x10(%rbp),%rdi
call   1090 <minipack_is_int8@plt>
cmp    $0x0,%rax
je     120c <minipack_sizeof_int_elem+0x6c>
movq   $0x2,-0x8(%rbp)
jmp    12f4 <minipack_sizeof_int_elem+0x154>
mov    -0x10(%rbp),%rdi
call   10b0 <minipack_is_int16@plt>
cmp    $0x0,%rax
je     122c <minipack_sizeof_int_elem+0x8c>
movq   $0x3,-0x8(%rbp)
jmp    12f4 <minipack_sizeof_int_elem+0x154>
mov    -0x10(%rbp),%rdi
call   1030 <minipack_is_int32@plt>
cmp    $0x0,%rax
je     124c <minipack_sizeof_int_elem+0xac>
movq   $0x5,-0x8(%rbp)
jmp    12f4 <minipack_sizeof_int_elem+0x154>
mov    -0x10(%rbp),%rdi
call   10a0 <minipack_is_int64@plt>
cmp    $0x0,%rax
je     126c <minipack_sizeof_int_elem+0xcc>
movq   $0x9,-0x8(%rbp)
jmp    12f4 <minipack_sizeof_int_elem+0x154>
mov    -0x10(%rbp),%rdi
call   1050 <minipack_is_uint8@plt>
cmp    $0x0,%rax
je     128c <minipack_sizeof_int_elem+0xec>
movq   $0x2,-0x8(%rbp)
jmp    12f4 <minipack_sizeof_int_elem+0x154>
mov    -0x10(%rbp),%rdi
call   1080 <minipack_is_uint16@plt>
cmp    $0x0,%rax
je     12ac <minipack_sizeof_int_elem+0x10c>
movq   $0x3,-0x8(%rbp)
jmp    12f4 <minipack_sizeof_int_elem+0x154>
mov    -0x10(%rbp),%rdi
call   1060 <minipack_is_uint32@plt>
cmp    $0x0,%rax
je     12cc <minipack_sizeof_int_elem+0x12c>
movq   $0x5,-0x8(%rbp)
jmp    12f4 <minipack_sizeof_int_elem+0x154>
mov    -0x10(%rbp),%rdi
call   1040 <minipack_is_uint64@plt>
cmp    $0x0,%rax
je     12ec <minipack_sizeof_int_elem+0x14c>
movq   $0x9,-0x8(%rbp)
jmp    12f4 <minipack_sizeof_int_elem+0x154>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<minipack_sizeof_int_elem>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1070 <minipack_is_pos_fixnum@plt>
mov    $0x1,%ebx
test   %rax,%rax
jne    1261 <minipack_sizeof_int_elem+0xc1>
mov    %r14,%rdi
call   10c0 <minipack_is_neg_fixnum@plt>
test   %rax,%rax
jne    1261 <minipack_sizeof_int_elem+0xc1>
mov    %r14,%rdi
call   1090 <minipack_is_int8@plt>
mov    $0x2,%ebx
test   %rax,%rax
jne    1261 <minipack_sizeof_int_elem+0xc1>
mov    %r14,%rdi
call   10b0 <minipack_is_int16@plt>
mov    $0x3,%ebx
test   %rax,%rax
jne    1261 <minipack_sizeof_int_elem+0xc1>
mov    %r14,%rdi
call   1030 <minipack_is_int32@plt>
mov    $0x5,%ebx
test   %rax,%rax
jne    1261 <minipack_sizeof_int_elem+0xc1>
mov    %r14,%rdi
call   10a0 <minipack_is_int64@plt>
mov    $0x9,%ebx
test   %rax,%rax
jne    1261 <minipack_sizeof_int_elem+0xc1>
mov    %r14,%rdi
call   1050 <minipack_is_uint8@plt>
mov    $0x2,%ebx
test   %rax,%rax
jne    1261 <minipack_sizeof_int_elem+0xc1>
mov    %r14,%rdi
call   1080 <minipack_is_uint16@plt>
mov    $0x3,%ebx
test   %rax,%rax
jne    1261 <minipack_sizeof_int_elem+0xc1>
mov    %r14,%rdi
call   1060 <minipack_is_uint32@plt>
mov    $0x5,%ebx
test   %rax,%rax
jne    1261 <minipack_sizeof_int_elem+0xc1>
mov    %r14,%rdi
call   1040 <minipack_is_uint64@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
lea    (%rcx,%rcx,8),%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @minipack_sizeof_int_elem(i8* %0) {
%2 = alloca i64
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @minipack_is_pos_fixnum(i8* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i64 1, i64* %2
br label %54
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i64 @minipack_is_neg_fixnum(i8* %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i64 1, i64* %2
br label %54
13: ; preds = %8
%14 = load i8*, i8** %3
%15 = call i64 @minipack_is_int8(i8* %14)
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %13
store i64 2, i64* %2
br label %54
18: ; preds = %13
%19 = load i8*, i8** %3
%20 = call i64 @minipack_is_int16(i8* %19)
%21 = icmp ne i64 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %18
store i64 3, i64* %2
br label %54
23: ; preds = %18
%24 = load i8*, i8** %3
%25 = call i64 @minipack_is_int32(i8* %24)
%26 = icmp ne i64 %25, 0
br i1 %26, label %27, label %28
27: ; preds = %23
store i64 5, i64* %2
br label %54
28: ; preds = %23
%29 = load i8*, i8** %3
%30 = call i64 @minipack_is_int64(i8* %29)
%31 = icmp ne i64 %30, 0
br i1 %31, label %32, label %33
32: ; preds = %28
store i64 9, i64* %2
br label %54
33: ; preds = %28
%34 = load i8*, i8** %3
%35 = call i64 @minipack_is_uint8(i8* %34)
%36 = icmp ne i64 %35, 0
br i1 %36, label %37, label %38
37: ; preds = %33
store i64 2, i64* %2
br label %54
38: ; preds = %33
%39 = load i8*, i8** %3
%40 = call i64 @minipack_is_uint16(i8* %39)
%41 = icmp ne i64 %40, 0
br i1 %41, label %42, label %43
42: ; preds = %38
store i64 3, i64* %2
br label %54
43: ; preds = %38
%44 = load i8*, i8** %3
%45 = call i64 @minipack_is_uint32(i8* %44)
%46 = icmp ne i64 %45, 0
br i1 %46, label %47, label %48
47: ; preds = %43
store i64 5, i64* %2
br label %54
48: ; preds = %43
%49 = load i8*, i8** %3
%50 = call i64 @minipack_is_uint64(i8* %49)
%51 = icmp ne i64 %50, 0
br i1 %51, label %52, label %53
52: ; preds = %48
store i64 9, i64* %2
br label %54
53: ; preds = %48
store i64 0, i64* %2
br label %54
54: ; preds = %53, %52, %47, %42, %37, %32, %27, %22, %17, %12, %7
%55 = load i64, i64* %2
ret i64 %55
}

LLVM IR (-O2):
define i64 @minipack_sizeof_int_elem(i8* %0) {
%2 = tail call i64 @minipack_is_pos_fixnum(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %32
4: ; preds = %1
%5 = tail call i64 @minipack_is_neg_fixnum(i8* %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %32
7: ; preds = %4
%8 = tail call i64 @minipack_is_int8(i8* %0)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %32
10: ; preds = %7
%11 = tail call i64 @minipack_is_int16(i8* %0)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %32
13: ; preds = %10
%14 = tail call i64 @minipack_is_int32(i8* %0)
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %32
16: ; preds = %13
%17 = tail call i64 @minipack_is_int64(i8* %0)
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %32
19: ; preds = %16
%20 = tail call i64 @minipack_is_uint8(i8* %0)
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %32
22: ; preds = %19
%23 = tail call i64 @minipack_is_uint16(i8* %0)
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %32
25: ; preds = %22
%26 = tail call i64 @minipack_is_uint32(i8* %0)
%27 = icmp eq i64 %26, 0
br i1 %27, label %28, label %32
28: ; preds = %25
%29 = tail call i64 @minipack_is_uint64(i8* %0)
%30 = icmp eq i64 %29, 0
%31 = select i1 %30, i64 0, i64 9
br label %32
32: ; preds = %28, %25, %22, %19, %16, %13, %10, %7, %4, %1
%33 = phi i64 [ 1, %1 ], [ 1, %4 ], [ 2, %7 ], [ 3, %10 ], [ 5, %13 ], [ 9, %16 ], [ 2, %19 ], [ 3, %22 ], [ 5, %25 ], [ %31, %28 ]
ret i64 %33
}