#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*/ gen_bit(int, int, char *, int);
int /*<<< orphan*/ gen_enum(char *, int);
int /*<<< orphan*/ gen_mask(int, char *, char *, int);
int /*<<< orphan*/ gen_struct();
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ usage(int);
int main(int argc, char *argv[]) {
  int bitsize;
  int msb;
  char *ms;
  int big_endian;
  if (argc != 4)
    usage(1);
  if (strcmp(argv[1], "32") == 0)
    bitsize = 32;
  else if (strcmp(argv[1], "64") == 0)
    bitsize = 64;
  else
    usage(2);
  if (strcmp(argv[2], "0") == 0)
    msb = 0;
  else if (strcmp(argv[2], "31") == 0 && bitsize == 32)
    msb = 31;
  else if (strcmp(argv[2], "63") == 0 && bitsize == 64)
    msb = 63;
  else
    usage(3);
  if (msb == 0)
    ms = "MS";
  else
    ms = "LS";
  if (strcmp(argv[3], "big") == 0)
    big_endian = 1;
  else if (strcmp(argv[3], "little") == 0)
    big_endian = 0;
  else
    usage(4);
  printf("#define WITH_TARGET_WORD_BITSIZE %d\n", bitsize);
  printf("#define WITH_TARGET_WORD_MSB %d\n", msb);
  printf("#define WITH_HOST_WORD_BITSIZE %d\n", sizeof(int) * 8);
  printf("#define WITH_TARGET_BYTE_ORDER %s\n",
         big_endian ? "BFD_ENDIAN_BIG" : "BFD_ENDIAN_LITTLE");
  printf("\n");
  printf("#define SIM_BITS_INLINE (ALL_H_INLINE)\n");
  printf("\n");
  printf("#define ASSERT(X) do { if (!(X)) abort(); } while (0)\n");
  printf("\n");
  printf("#include \"sim-basics.h\"\n");
  gen_struct();
  printf("#define DO_BIT_TESTS\n");
  gen_bit(4, msb, "BIT4", 4);
  gen_bit(5, msb, "BIT5", 5);
  gen_bit(8, msb, "BIT8", 8);
  gen_bit(10, msb, "BIT10", 10);
  gen_bit(16, msb, "BIT16", 16);
  gen_bit(32, msb, "BIT32", 32);
  gen_bit(64, msb, "BIT64", 64);
  gen_bit(bitsize, msb, "BIT", 64);
  gen_bit(8, 8 - 1, "LSBIT8", 8);
  gen_bit(16, 16 - 1, "LSBIT16", 16);
  gen_bit(32, 32 - 1, "LSBIT32", 32);
  gen_bit(64, 64 - 1, "LSBIT64", 64);
  gen_bit(bitsize, bitsize - 1, "LSBIT", 64);
  gen_bit(8, 0, "MSBIT8", 8);
  gen_bit(16, 0, "MSBIT16", 16);
  gen_bit(32, 0, "MSBIT32", 32);
  gen_bit(64, 0, "MSBIT64", 64);
  gen_bit(bitsize, 0, "MSBIT", 64);
  printf("test_spec *(bit_tests[]) = {\n");
  printf("  &BIT4_test,\n");
  printf("  &BIT5_test,\n");
  printf("  &BIT8_test,\n");
  printf("  &BIT10_test,\n");
  printf("  &BIT16_test,\n");
  printf("  &BIT32_test,\n");
  printf("  &BIT64_test,\n");
  printf("  &BIT_test,\n");
  printf("  &LSBIT8_test,\n");
  printf("  &LSBIT16_test,\n");
  printf("  &LSBIT32_test,\n");
  printf("  &LSBIT64_test,\n");
  printf("  &LSBIT_test,\n");
  printf("  &MSBIT8_test,\n");
  printf("  &MSBIT16_test,\n");
  printf("  &MSBIT32_test,\n");
  printf("  &MSBIT64_test,\n");
  printf("  &MSBIT_test,\n");
  printf("  0,\n");
  printf("};\n\n");
  gen_enum("BIT", 64);
  gen_enum("LSBIT", 64);
  gen_enum("MSBIT", 64);
  gen_enum("BIT32", 32);
  gen_enum("LSBIT32", 32);
  gen_enum("MSBIT32", 32);
  printf("#define DO_MASK_TESTS\n");
  gen_mask(8, ms, "MASK8", 8);
  gen_mask(16, ms, "MASK16", 16);
  gen_mask(32, ms, "MASK32", 32);
  gen_mask(64, ms, "MASK64", 64);
  gen_mask(bitsize, ms, "MASK", 64);
  printf("test_spec *(mask_tests[]) = {\n");
  printf("  &MASK8_test,\n");
  printf("  &MASK16_test,\n");
  printf("  &MASK32_test,\n");
  printf("  &MASK64_test,\n");
  printf("  &MASK_test,\n");
  printf("  0,\n");
  printf("};\n\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x4,-0x8(%rbp)
je     119a <main+0x2a>
mov    $0x1,%edi
call   1090 <usage@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0x117d(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    11c4 <main+0x54>
movl   $0x20,-0x14(%rbp)
jmp    11fd <main+0x8d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0x115a(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    11ee <main+0x7e>
movl   $0x40,-0x14(%rbp)
jmp    11f8 <main+0x88>
mov    $0x2,%edi
call   1090 <usage@plt>
jmp    11fd <main+0x8d>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xf54(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    1227 <main+0xb7>
movl   $0x0,-0x18(%rbp)
jmp    12a3 <main+0x133>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xdca(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    125b <main+0xeb>
cmpl   $0x20,-0x14(%rbp)
jne    125b <main+0xeb>
movl   $0x1f,-0x18(%rbp)
jmp    129e <main+0x12e>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xd99(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    128f <main+0x11f>
cmpl   $0x40,-0x14(%rbp)
jne    128f <main+0x11f>
movl   $0x3f,-0x18(%rbp)
jmp    1299 <main+0x129>
mov    $0x3,%edi
call   1090 <usage@plt>
jmp    129e <main+0x12e>
jmp    12a3 <main+0x133>
cmpl   $0x0,-0x18(%rbp)
jne    12bd <main+0x14d>
lea    0xd52(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    12c8 <main+0x158>
lea    0xd45(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xd35(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    12f2 <main+0x182>
movl   $0x1,-0x24(%rbp)
jmp    132b <main+0x1bb>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xd0f(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    131c <main+0x1ac>
movl   $0x0,-0x24(%rbp)
jmp    1326 <main+0x1b6>
mov    $0x4,%edi
call   1090 <usage@plt>
jmp    132b <main+0x1bb>
mov    -0x14(%rbp),%esi
lea    0xce2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xcf6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd09(%rip),%rdi
mov    $0x20,%esi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x24(%rbp),%ecx
lea    0xd48(%rip),%rsi
lea    0xd32(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0xd01(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf6f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd29(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf53(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd35(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf37(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd50(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1080 <gen_struct@plt>
lea    0xd54(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%esi
mov    $0x4,%ecx
lea    0xd54(%rip),%rdx
mov    %ecx,%edi
call   1050 <gen_bit@plt>
mov    -0x18(%rbp),%esi
mov    $0x5,%ecx
lea    0xd43(%rip),%rdx
mov    %ecx,%edi
call   1050 <gen_bit@plt>
mov    -0x18(%rbp),%esi
mov    $0x8,%ecx
lea    0xd3a(%rip),%rdx
mov    %ecx,%edi
call   1050 <gen_bit@plt>
mov    -0x18(%rbp),%esi
mov    $0xa,%ecx
lea    0xd1c(%rip),%rdx
mov    %ecx,%edi
call   1050 <gen_bit@plt>
mov    -0x18(%rbp),%esi
mov    $0x10,%ecx
lea    0xd15(%rip),%rdx
mov    %ecx,%edi
call   1050 <gen_bit@plt>
mov    -0x18(%rbp),%esi
mov    $0x20,%ecx
lea    0xd07(%rip),%rdx
mov    %ecx,%edi
call   1050 <gen_bit@plt>
mov    -0x18(%rbp),%esi
mov    $0x40,%ecx
lea    0xcf9(%rip),%rdx
mov    %ecx,%edi
call   1050 <gen_bit@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
lea    0xced(%rip),%rdx
mov    $0x40,%ecx
call   1050 <gen_bit@plt>
mov    $0x8,%ecx
mov    $0x7,%esi
lea    0xcb1(%rip),%rdx
mov    %ecx,%edi
call   1050 <gen_bit@plt>
mov    $0x10,%ecx
mov    $0xf,%esi
lea    0xca0(%rip),%rdx
mov    %ecx,%edi
call   1050 <gen_bit@plt>
mov    $0x20,%ecx
mov    $0x1f,%esi
lea    0xc90(%rip),%rdx
mov    %ecx,%edi
call   1050 <gen_bit@plt>
mov    $0x40,%ecx
mov    $0x3f,%esi
lea    0xc80(%rip),%rdx
mov    %ecx,%edi
call   1050 <gen_bit@plt>
mov    -0x14(%rbp),%edi
mov    -0x14(%rbp),%esi
sub    $0x1,%esi
lea    0xc71(%rip),%rdx
mov    $0x40,%ecx
call   1050 <gen_bit@plt>
mov    $0x8,%ecx
xor    %esi,%esi
lea    0xc5f(%rip),%rdx
mov    %ecx,%edi
call   1050 <gen_bit@plt>
mov    $0x10,%ecx
xor    %esi,%esi
lea    0xc51(%rip),%rdx
mov    %ecx,%edi
call   1050 <gen_bit@plt>
mov    $0x20,%ecx
xor    %esi,%esi
lea    0xc44(%rip),%rdx
mov    %ecx,%edi
call   1050 <gen_bit@plt>
mov    $0x40,%ecx
xor    %esi,%esi
lea    0xc37(%rip),%rdx
mov    %ecx,%edi
call   1050 <gen_bit@plt>
mov    -0x14(%rbp),%edi
xor    %esi,%esi
lea    0xc2c(%rip),%rdx
mov    $0x40,%ecx
call   1050 <gen_bit@plt>
lea    0xc21(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xc31(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xc32(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xc33(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xc34(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xc36(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xc38(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xc3a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xc3c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xc3c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xc3f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xc43(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xc47(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xc4b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xc4d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xc50(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xc54(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xc58(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xc5c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xc5e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xc56(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xad2(%rip),%rdi
mov    $0x40,%esi
call   1030 <gen_enum@plt>
lea    0xabf(%rip),%rdi
mov    $0x40,%esi
call   1030 <gen_enum@plt>
lea    0xad3(%rip),%rdi
mov    $0x40,%esi
call   1030 <gen_enum@plt>
lea    0xa8f(%rip),%rdi
mov    $0x20,%esi
call   1030 <gen_enum@plt>
lea    0xa7c(%rip),%rdi
mov    $0x20,%esi
call   1030 <gen_enum@plt>
lea    0xa90(%rip),%rdi
mov    $0x20,%esi
call   1030 <gen_enum@plt>
lea    0xbe7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%rsi
mov    $0x8,%ecx
lea    0xbe7(%rip),%rdx
mov    %ecx,%edi
call   1070 <gen_mask@plt>
mov    -0x20(%rbp),%rsi
mov    $0x10,%ecx
lea    0xbd6(%rip),%rdx
mov    %ecx,%edi
call   1070 <gen_mask@plt>
mov    -0x20(%rbp),%rsi
mov    $0x20,%ecx
lea    0xbc6(%rip),%rdx
mov    %ecx,%edi
call   1070 <gen_mask@plt>
mov    -0x20(%rbp),%rsi
mov    $0x40,%ecx
lea    0xbb6(%rip),%rdx
mov    %ecx,%edi
call   1070 <gen_mask@plt>
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rsi
lea    0xba8(%rip),%rdx
mov    $0x40,%ecx
call   1070 <gen_mask@plt>
lea    0xb9c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xbad(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xbaf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xbb2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xbb5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xbb8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xb06(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xafe(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
cmp    $0x4,%edi
je     11ad <main+0x1d>
mov    $0x1,%edi
call   10b0 <usage@plt>
mov    0x8(%rbx),%rdi
lea    0xf77(%rip),%rsi
call   1080 <strcmp@plt>
xor    %ebp,%ebp
test   %rax,%rax
je     11e5 <main+0x55>
mov    0x8(%rbx),%rdi
lea    0xf67(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     11f3 <main+0x63>
mov    $0x2,%edi
call   10b0 <usage@plt>
jmp    11ff <main+0x6f>
mov    $0x20,%r14d
mov    $0x1,%r13b
xor    %r15d,%r15d
jmp    11ff <main+0x6f>
mov    $0x40,%r14d
mov    $0x1,%r15b
xor    %r13d,%r13d
mov    0x10(%rbx),%rdi
lea    0xec8(%rip),%rsi
call   1080 <strcmp@plt>
lea    0xdf0(%rip),%r12
test   %rax,%rax
je     1273 <main+0xe3>
mov    0x10(%rbx),%rdi
lea    0xdda(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
sete   %al
lea    0xdd1(%rip),%r12
mov    $0x1f,%ebp
test   %r13b,%al
jne    1273 <main+0xe3>
mov    0x10(%rbx),%rdi
lea    0xdb6(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
sete   %al
mov    $0x3f,%ebp
test   %r15b,%al
jne    1273 <main+0xe3>
mov    $0x3,%edi
call   10b0 <usage@plt>
lea    0xd93(%rip),%r12
mov    0x18(%rbx),%rdi
lea    0xd8e(%rip),%rsi
call   1080 <strcmp@plt>
lea    0xe19(%rip),%r15
test   %rax,%rax
je     12b7 <main+0x127>
mov    0x18(%rbx),%rdi
lea    0xd76(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     12b0 <main+0x120>
mov    $0x4,%edi
call   10b0 <usage@plt>
jmp    12b7 <main+0x127>
lea    0xdfb(%rip),%r15
lea    0xd59(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xd6d(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xd7e(%rip),%rdi
mov    $0x20,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xd8e(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe31(%rip),%rdi
call   1050 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe42(%rip),%rdi
call   1050 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe62(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
call   10a0 <gen_struct@plt>
lea    0xe67(%rip),%rdi
call   1050 <puts@plt>
lea    0xd6c(%rip),%rdx
mov    $0x4,%edi
mov    %ebp,%esi
mov    $0x4,%ecx
call   1070 <gen_bit@plt>
lea    0xd59(%rip),%rdx
mov    $0x5,%edi
mov    %ebp,%esi
mov    $0x5,%ecx
call   1070 <gen_bit@plt>
lea    0xd4e(%rip),%rdx
mov    $0x8,%edi
mov    %ebp,%esi
mov    $0x8,%ecx
call   1070 <gen_bit@plt>
lea    0xd2e(%rip),%rdx
mov    $0xa,%edi
mov    %ebp,%esi
mov    $0xa,%ecx
call   1070 <gen_bit@plt>
lea    0xd25(%rip),%rdx
mov    $0x10,%edi
mov    %ebp,%esi
mov    $0x10,%ecx
call   1070 <gen_bit@plt>
lea    0xd15(%rip),%rdx
mov    $0x20,%edi
mov    %ebp,%esi
mov    $0x20,%ecx
call   1070 <gen_bit@plt>
lea    0xd05(%rip),%rdx
mov    $0x40,%edi
mov    %ebp,%esi
mov    $0x40,%ecx
call   1070 <gen_bit@plt>
lea    0xcf5(%rip),%rdx
mov    %r14d,%edi
mov    %ebp,%esi
mov    $0x40,%ecx
call   1070 <gen_bit@plt>
lea    0xcbe(%rip),%rdx
mov    $0x8,%edi
mov    $0x7,%esi
mov    $0x8,%ecx
call   1070 <gen_bit@plt>
lea    0xcaa(%rip),%rdx
mov    $0x10,%edi
mov    $0xf,%esi
mov    $0x10,%ecx
call   1070 <gen_bit@plt>
lea    0xc97(%rip),%rdx
mov    $0x20,%edi
mov    $0x1f,%esi
mov    $0x20,%ecx
call   1070 <gen_bit@plt>
lea    0xc84(%rip),%rdx
mov    $0x40,%edi
mov    $0x3f,%esi
mov    $0x40,%ecx
call   1070 <gen_bit@plt>
lea    -0x1(%r14),%esi
lea    0xc6d(%rip),%rdx
mov    %r14d,%edi
mov    $0x40,%ecx
call   1070 <gen_bit@plt>
lea    0xc5f(%rip),%rdx
mov    $0x8,%edi
xor    %esi,%esi
mov    $0x8,%ecx
call   1070 <gen_bit@plt>
lea    0xc4e(%rip),%rdx
mov    $0x10,%edi
xor    %esi,%esi
mov    $0x10,%ecx
call   1070 <gen_bit@plt>
lea    0xc3e(%rip),%r15
mov    $0x20,%edi
xor    %esi,%esi
mov    %r15,%rdx
mov    $0x20,%ecx
call   1070 <gen_bit@plt>
lea    0xc2b(%rip),%rdx
mov    $0x40,%edi
xor    %esi,%esi
mov    $0x40,%ecx
call   1070 <gen_bit@plt>
lea    0xc1b(%rip),%rbx
mov    %r14d,%edi
xor    %esi,%esi
mov    %rbx,%rdx
mov    $0x40,%ecx
call   1070 <gen_bit@plt>
lea    0xcb2(%rip),%rdi
call   1050 <puts@plt>
lea    0xcc3(%rip),%rdi
call   1050 <puts@plt>
lea    0xcc5(%rip),%rdi
call   1050 <puts@plt>
lea    0xcc7(%rip),%rdi
call   1050 <puts@plt>
lea    0xcc9(%rip),%rdi
call   1050 <puts@plt>
lea    0xccc(%rip),%rdi
call   1050 <puts@plt>
lea    0xccf(%rip),%rdi
call   1050 <puts@plt>
lea    0xcd2(%rip),%rdi
call   1050 <puts@plt>
lea    0xcd5(%rip),%rdi
call   1050 <puts@plt>
lea    0xcd6(%rip),%rdi
call   1050 <puts@plt>
lea    0xcda(%rip),%rdi
call   1050 <puts@plt>
lea    0xcdf(%rip),%rdi
call   1050 <puts@plt>
lea    0xce4(%rip),%rdi
call   1050 <puts@plt>
lea    0xce9(%rip),%rdi
call   1050 <puts@plt>
lea    0xcec(%rip),%rdi
call   1050 <puts@plt>
lea    0xcf0(%rip),%rdi
call   1050 <puts@plt>
lea    0xcf5(%rip),%rdi
call   1050 <puts@plt>
lea    0xcfa(%rip),%rdi
call   1050 <puts@plt>
lea    0xcff(%rip),%rdi
call   1050 <puts@plt>
lea    0xd83(%rip),%r13
mov    %r13,%rdi
call   1050 <puts@plt>
lea    0xd79(%rip),%rbp
mov    %rbp,%rdi
call   1050 <puts@plt>
lea    0xadd(%rip),%rdi
mov    $0x40,%esi
call   1040 <gen_enum@plt>
lea    0xaca(%rip),%rdi
mov    $0x40,%esi
call   1040 <gen_enum@plt>
mov    %rbx,%rdi
mov    $0x40,%esi
call   1040 <gen_enum@plt>
lea    0xa9e(%rip),%rdi
mov    $0x20,%esi
call   1040 <gen_enum@plt>
lea    0xa8b(%rip),%rdi
mov    $0x20,%esi
call   1040 <gen_enum@plt>
mov    %r15,%rdi
mov    $0x20,%esi
call   1040 <gen_enum@plt>
lea    0xc86(%rip),%rdi
call   1050 <puts@plt>
lea    0xa9c(%rip),%rdx
mov    $0x8,%edi
mov    %r12,%rsi
mov    $0x8,%ecx
call   1090 <gen_mask@plt>
lea    0xa89(%rip),%rdx
mov    $0x10,%edi
mov    %r12,%rsi
mov    $0x10,%ecx
call   1090 <gen_mask@plt>
lea    0xa77(%rip),%rdx
mov    $0x20,%edi
mov    %r12,%rsi
mov    $0x20,%ecx
call   1090 <gen_mask@plt>
lea    0xa65(%rip),%rdx
mov    $0x40,%edi
mov    %r12,%rsi
mov    $0x40,%ecx
call   1090 <gen_mask@plt>
lea    0xa53(%rip),%rdx
mov    %r14d,%edi
mov    %r12,%rsi
mov    $0x40,%ecx
call   1090 <gen_mask@plt>
lea    0xc15(%rip),%rdi
call   1050 <puts@plt>
lea    0xc27(%rip),%rdi
call   1050 <puts@plt>
lea    0xc2a(%rip),%rdi
call   1050 <puts@plt>
lea    0xc2e(%rip),%rdi
call   1050 <puts@plt>
lea    0xc32(%rip),%rdi
call   1050 <puts@plt>
lea    0xc36(%rip),%rdi
call   1050 <puts@plt>
mov    %r13,%rdi
call   1050 <puts@plt>
mov    %rbp,%rdi
call   1050 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"32\00"
@.str.1 = [3 x i8] c"64\00"
@.str.2 = [2 x i8] c"0\00"
@.str.3 = [3 x i8] c"31\00"
@.str.4 = [3 x i8] c"63\00"
@.str.5 = [3 x i8] c"MS\00"
@.str.6 = [3 x i8] c"LS\00"
@.str.7 = [4 x i8] c"big\00"
@.str.8 = [7 x i8] c"little\00"
@.str.9 = [37 x i8] c"#define WITH_TARGET_WORD_BITSIZE %d\0A\00"
@.str.10 = [33 x i8] c"#define WITH_TARGET_WORD_MSB %d\0A\00"
@.str.11 = [35 x i8] c"#define WITH_HOST_WORD_BITSIZE %d\0A\00"
@.str.12 = [35 x i8] c"#define WITH_TARGET_BYTE_ORDER %s\0A\00"
@.str.13 = [15 x i8] c"BFD_ENDIAN_BIG\00"
@.str.14 = [18 x i8] c"BFD_ENDIAN_LITTLE\00"
@.str.15 = [2 x i8] c"\0A\00"
@.str.16 = [40 x i8] c"#define SIM_BITS_INLINE (ALL_H_INLINE)\0A\00"
@.str.17 = [55 x i8] c"#define ASSERT(X) do { if (!(X)) abort(); } while (0)\0A\00"
@.str.18 = [25 x i8] c"#include \22sim-basics.h\22\0A\00"
@.str.19 = [22 x i8] c"#define DO_BIT_TESTS\0A\00"
@.str.20 = [5 x i8] c"BIT4\00"
@.str.21 = [5 x i8] c"BIT5\00"
@.str.22 = [5 x i8] c"BIT8\00"
@.str.23 = [6 x i8] c"BIT10\00"
@.str.24 = [6 x i8] c"BIT16\00"
@.str.25 = [6 x i8] c"BIT32\00"
@.str.26 = [6 x i8] c"BIT64\00"
@.str.27 = [4 x i8] c"BIT\00"
@.str.28 = [7 x i8] c"LSBIT8\00"
@.str.29 = [8 x i8] c"LSBIT16\00"
@.str.30 = [8 x i8] c"LSBIT32\00"
@.str.31 = [8 x i8] c"LSBIT64\00"
@.str.32 = [6 x i8] c"LSBIT\00"
@.str.33 = [7 x i8] c"MSBIT8\00"
@.str.34 = [8 x i8] c"MSBIT16\00"
@.str.35 = [8 x i8] c"MSBIT32\00"
@.str.36 = [8 x i8] c"MSBIT64\00"
@.str.37 = [6 x i8] c"MSBIT\00"
@.str.38 = [30 x i8] c"test_spec *(bit_tests[]) = {\0A\00"
@.str.39 = [15 x i8] c" &BIT4_test,\0A\00"
@.str.40 = [15 x i8] c" &BIT5_test,\0A\00"
@.str.41 = [15 x i8] c" &BIT8_test,\0A\00"
@.str.42 = [16 x i8] c" &BIT10_test,\0A\00"
@.str.43 = [16 x i8] c" &BIT16_test,\0A\00"
@.str.44 = [16 x i8] c" &BIT32_test,\0A\00"
@.str.45 = [16 x i8] c" &BIT64_test,\0A\00"
@.str.46 = [14 x i8] c" &BIT_test,\0A\00"
@.str.47 = [17 x i8] c" &LSBIT8_test,\0A\00"
@.str.48 = [18 x i8] c" &LSBIT16_test,\0A\00"
@.str.49 = [18 x i8] c" &LSBIT32_test,\0A\00"
@.str.50 = [18 x i8] c" &LSBIT64_test,\0A\00"
@.str.51 = [16 x i8] c" &LSBIT_test,\0A\00"
@.str.52 = [17 x i8] c" &MSBIT8_test,\0A\00"
@.str.53 = [18 x i8] c" &MSBIT16_test,\0A\00"
@.str.54 = [18 x i8] c" &MSBIT32_test,\0A\00"
@.str.55 = [18 x i8] c" &MSBIT64_test,\0A\00"
@.str.56 = [16 x i8] c" &MSBIT_test,\0A\00"
@.str.57 = [6 x i8] c" 0,\0A\00"
@.str.58 = [5 x i8] c"};\0A\0A\00"
@.str.59 = [23 x i8] c"#define DO_MASK_TESTS\0A\00"
@.str.60 = [6 x i8] c"MASK8\00"
@.str.61 = [7 x i8] c"MASK16\00"
@.str.62 = [7 x i8] c"MASK32\00"
@.str.63 = [7 x i8] c"MASK64\00"
@.str.64 = [5 x i8] c"MASK\00"
@.str.65 = [31 x i8] c"test_spec *(mask_tests[]) = {\0A\00"
@.str.66 = [16 x i8] c" &MASK8_test,\0A\00"
@.str.67 = [17 x i8] c" &MASK16_test,\0A\00"
@.str.68 = [17 x i8] c" &MASK32_test,\0A\00"
@.str.69 = [17 x i8] c" &MASK64_test,\0A\00"
@.str.70 = [15 x i8] c" &MASK_test,\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 4
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 @usage(i32 1)
br label %14
14: ; preds = %12, %2
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = call i64 @strcmp(i8* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %14
store i32 32, i32* %6
br label %31
21: ; preds = %14
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 1
%24 = load i8*, i8** %23
%25 = call i64 @strcmp(i8* %24, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%26 = icmp eq i64 %25, 0
br i1 %26, label %27, label %28
27: ; preds = %21
store i32 64, i32* %6
br label %30
28: ; preds = %21
%29 = call i32 @usage(i32 2)
br label %30
30: ; preds = %28, %27
br label %31
31: ; preds = %30, %20
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 2
%34 = load i8*, i8** %33
%35 = call i64 @strcmp(i8* %34, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%36 = icmp eq i64 %35, 0
br i1 %36, label %37, label %38
37: ; preds = %31
store i32 0, i32* %7
br label %62
38: ; preds = %31
%39 = load i8**, i8*** %5
%40 = getelementptr inbounds i8*, i8** %39, i64 2
%41 = load i8*, i8** %40
%42 = call i64 @strcmp(i8* %41, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%43 = icmp eq i64 %42, 0
br i1 %43, label %44, label %48
44: ; preds = %38
%45 = load i32, i32* %6
%46 = icmp eq i32 %45, 32
br i1 %46, label %47, label %48
47: ; preds = %44
store i32 31, i32* %7
br label %61
48: ; preds = %44, %38
%49 = load i8**, i8*** %5
%50 = getelementptr inbounds i8*, i8** %49, i64 2
%51 = load i8*, i8** %50
%52 = call i64 @strcmp(i8* %51, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%53 = icmp eq i64 %52, 0
br i1 %53, label %54, label %58
54: ; preds = %48
%55 = load i32, i32* %6
%56 = icmp eq i32 %55, 64
br i1 %56, label %57, label %58
57: ; preds = %54
store i32 63, i32* %7
br label %60
58: ; preds = %54, %48
%59 = call i32 @usage(i32 3)
br label %60
60: ; preds = %58, %57
br label %61
61: ; preds = %60, %47
br label %62
62: ; preds = %61, %37
%63 = load i32, i32* %7
%64 = icmp eq i32 %63, 0
br i1 %64, label %65, label %66
65: ; preds = %62
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8** %8
br label %67
66: ; preds = %62
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8** %8
br label %67
67: ; preds = %66, %65
%68 = load i8**, i8*** %5
%69 = getelementptr inbounds i8*, i8** %68, i64 3
%70 = load i8*, i8** %69
%71 = call i64 @strcmp(i8* %70, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%72 = icmp eq i64 %71, 0
br i1 %72, label %73, label %74
73: ; preds = %67
store i32 1, i32* %9
br label %84
74: ; preds = %67
%75 = load i8**, i8*** %5
%76 = getelementptr inbounds i8*, i8** %75, i64 3
%77 = load i8*, i8** %76
%78 = call i64 @strcmp(i8* %77, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
%79 = icmp eq i64 %78, 0
br i1 %79, label %80, label %81
80: ; preds = %74
store i32 0, i32* %9
br label %83
81: ; preds = %74
%82 = call i32 @usage(i32 4)
br label %83
83: ; preds = %81, %80
br label %84
84: ; preds = %83, %73
%85 = load i32, i32* %6
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.9, i64 0, i64 0), i32 %85)
%87 = load i32, i32* %7
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.10, i64 0, i64 0), i32 %87)
%89 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.11, i64 0, i64 0), i64 32)
%90 = load i32, i32* %9
%91 = icmp ne i32 %90, 0
%92 = zext i1 %91 to i64
%93 = select i1 %91, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.14, i64 0, i64 0)
%94 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.12, i64 0, i64 0), i8* %93)
%95 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.15, i64 0, i64 0))
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.16, i64 0, i64 0))
%97 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.15, i64 0, i64 0))
%98 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.17, i64 0, i64 0))
%99 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.15, i64 0, i64 0))
%100 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.18, i64 0, i64 0))
%101 = call i32 (...) @gen_struct()
%102 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.19, i64 0, i64 0))
%103 = load i32, i32* %7
%104 = call i32 @gen_bit(i32 4, i32 %103, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.20, i64 0, i64 0), i32 4)
%105 = load i32, i32* %7
%106 = call i32 @gen_bit(i32 5, i32 %105, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i64 0, i64 0), i32 5)
%107 = load i32, i32* %7
%108 = call i32 @gen_bit(i32 8, i32 %107, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.22, i64 0, i64 0), i32 8)
%109 = load i32, i32* %7
%110 = call i32 @gen_bit(i32 10, i32 %109, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.23, i64 0, i64 0), i32 10)
%111 = load i32, i32* %7
%112 = call i32 @gen_bit(i32 16, i32 %111, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.24, i64 0, i64 0), i32 16)
%113 = load i32, i32* %7
%114 = call i32 @gen_bit(i32 32, i32 %113, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.25, i64 0, i64 0), i32 32)
%115 = load i32, i32* %7
%116 = call i32 @gen_bit(i32 64, i32 %115, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.26, i64 0, i64 0), i32 64)
%117 = load i32, i32* %6
%118 = load i32, i32* %7
%119 = call i32 @gen_bit(i32 %117, i32 %118, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.27, i64 0, i64 0), i32 64)
%120 = call i32 @gen_bit(i32 8, i32 7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.28, i64 0, i64 0), i32 8)
%121 = call i32 @gen_bit(i32 16, i32 15, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.29, i64 0, i64 0), i32 16)
%122 = call i32 @gen_bit(i32 32, i32 31, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.30, i64 0, i64 0), i32 32)
%123 = call i32 @gen_bit(i32 64, i32 63, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.31, i64 0, i64 0), i32 64)
%124 = load i32, i32* %6
%125 = load i32, i32* %6
%126 = sub nsw i32 %125, 1
%127 = call i32 @gen_bit(i32 %124, i32 %126, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.32, i64 0, i64 0), i32 64)
%128 = call i32 @gen_bit(i32 8, i32 0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.33, i64 0, i64 0), i32 8)
%129 = call i32 @gen_bit(i32 16, i32 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.34, i64 0, i64 0), i32 16)
%130 = call i32 @gen_bit(i32 32, i32 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.35, i64 0, i64 0), i32 32)
%131 = call i32 @gen_bit(i32 64, i32 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.36, i64 0, i64 0), i32 64)
%132 = load i32, i32* %6
%133 = call i32 @gen_bit(i32 %132, i32 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.37, i64 0, i64 0), i32 64)
%134 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.38, i64 0, i64 0))
%135 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.39, i64 0, i64 0))
%136 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.40, i64 0, i64 0))
%137 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.41, i64 0, i64 0))
%138 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.42, i64 0, i64 0))
%139 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.43, i64 0, i64 0))
%140 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.44, i64 0, i64 0))
%141 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.45, i64 0, i64 0))
%142 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.46, i64 0, i64 0))
%143 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.47, i64 0, i64 0))
%144 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.48, i64 0, i64 0))
%145 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.49, i64 0, i64 0))
%146 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.50, i64 0, i64 0))
%147 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.51, i64 0, i64 0))
%148 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.52, i64 0, i64 0))
%149 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.53, i64 0, i64 0))
%150 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.54, i64 0, i64 0))
%151 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.55, i64 0, i64 0))
%152 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.56, i64 0, i64 0))
%153 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.57, i64 0, i64 0))
%154 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.58, i64 0, i64 0))
%155 = call i32 @gen_enum(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.27, i64 0, i64 0), i32 64)
%156 = call i32 @gen_enum(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.32, i64 0, i64 0), i32 64)
%157 = call i32 @gen_enum(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.37, i64 0, i64 0), i32 64)
%158 = call i32 @gen_enum(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.25, i64 0, i64 0), i32 32)
%159 = call i32 @gen_enum(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.30, i64 0, i64 0), i32 32)
%160 = call i32 @gen_enum(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.35, i64 0, i64 0), i32 32)
%161 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.59, i64 0, i64 0))
%162 = load i8*, i8** %8
%163 = call i32 @gen_mask(i32 8, i8* %162, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.60, i64 0, i64 0), i32 8)
%164 = load i8*, i8** %8
%165 = call i32 @gen_mask(i32 16, i8* %164, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.61, i64 0, i64 0), i32 16)
%166 = load i8*, i8** %8
%167 = call i32 @gen_mask(i32 32, i8* %166, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.62, i64 0, i64 0), i32 32)
%168 = load i8*, i8** %8
%169 = call i32 @gen_mask(i32 64, i8* %168, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.63, i64 0, i64 0), i32 64)
%170 = load i32, i32* %6
%171 = load i8*, i8** %8
%172 = call i32 @gen_mask(i32 %170, i8* %171, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.64, i64 0, i64 0), i32 64)
%173 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.65, i64 0, i64 0))
%174 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.66, i64 0, i64 0))
%175 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.67, i64 0, i64 0))
%176 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.68, i64 0, i64 0))
%177 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.69, i64 0, i64 0))
%178 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.70, i64 0, i64 0))
%179 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.57, i64 0, i64 0))
%180 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.58, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"32\00"
@.str.1 = [3 x i8] c"64\00"
@.str.2 = [2 x i8] c"0\00"
@.str.3 = [3 x i8] c"31\00"
@.str.4 = [3 x i8] c"63\00"
@.str.5 = [3 x i8] c"MS\00"
@.str.6 = [3 x i8] c"LS\00"
@.str.7 = [4 x i8] c"big\00"
@.str.8 = [7 x i8] c"little\00"
@.str.9 = [37 x i8] c"#define WITH_TARGET_WORD_BITSIZE %d\0A\00"
@.str.10 = [33 x i8] c"#define WITH_TARGET_WORD_MSB %d\0A\00"
@.str.11 = [35 x i8] c"#define WITH_HOST_WORD_BITSIZE %d\0A\00"
@.str.12 = [35 x i8] c"#define WITH_TARGET_BYTE_ORDER %s\0A\00"
@.str.13 = [15 x i8] c"BFD_ENDIAN_BIG\00"
@.str.14 = [18 x i8] c"BFD_ENDIAN_LITTLE\00"
@.str.20 = [5 x i8] c"BIT4\00"
@.str.21 = [5 x i8] c"BIT5\00"
@.str.22 = [5 x i8] c"BIT8\00"
@.str.23 = [6 x i8] c"BIT10\00"
@.str.24 = [6 x i8] c"BIT16\00"
@.str.25 = [6 x i8] c"BIT32\00"
@.str.26 = [6 x i8] c"BIT64\00"
@.str.27 = [4 x i8] c"BIT\00"
@.str.28 = [7 x i8] c"LSBIT8\00"
@.str.29 = [8 x i8] c"LSBIT16\00"
@.str.30 = [8 x i8] c"LSBIT32\00"
@.str.31 = [8 x i8] c"LSBIT64\00"
@.str.32 = [6 x i8] c"LSBIT\00"
@.str.33 = [7 x i8] c"MSBIT8\00"
@.str.34 = [8 x i8] c"MSBIT16\00"
@.str.35 = [8 x i8] c"MSBIT32\00"
@.str.36 = [8 x i8] c"MSBIT64\00"
@.str.37 = [6 x i8] c"MSBIT\00"
@.str.60 = [6 x i8] c"MASK8\00"
@.str.61 = [7 x i8] c"MASK16\00"
@.str.62 = [7 x i8] c"MASK32\00"
@.str.63 = [7 x i8] c"MASK64\00"
@.str.64 = [5 x i8] c"MASK\00"
@str = [39 x i8] c"#define SIM_BITS_INLINE (ALL_H_INLINE)\00"
@str.71 = [54 x i8] c"#define ASSERT(X) do { if (!(X)) abort(); } while (0)\00"
@str.72 = [24 x i8] c"#include \22sim-basics.h\22\00"
@str.73 = [21 x i8] c"#define DO_BIT_TESTS\00"
@str.74 = [29 x i8] c"test_spec *(bit_tests[]) = {\00"
@str.75 = [14 x i8] c" &BIT4_test,\00"
@str.76 = [14 x i8] c" &BIT5_test,\00"
@str.77 = [14 x i8] c" &BIT8_test,\00"
@str.78 = [15 x i8] c" &BIT10_test,\00"
@str.79 = [15 x i8] c" &BIT16_test,\00"
@str.80 = [15 x i8] c" &BIT32_test,\00"
@str.81 = [15 x i8] c" &BIT64_test,\00"
@str.82 = [13 x i8] c" &BIT_test,\00"
@str.83 = [16 x i8] c" &LSBIT8_test,\00"
@str.84 = [17 x i8] c" &LSBIT16_test,\00"
@str.85 = [17 x i8] c" &LSBIT32_test,\00"
@str.86 = [17 x i8] c" &LSBIT64_test,\00"
@str.87 = [15 x i8] c" &LSBIT_test,\00"
@str.88 = [16 x i8] c" &MSBIT8_test,\00"
@str.89 = [17 x i8] c" &MSBIT16_test,\00"
@str.90 = [17 x i8] c" &MSBIT32_test,\00"
@str.91 = [17 x i8] c" &MSBIT64_test,\00"
@str.92 = [15 x i8] c" &MSBIT_test,\00"
@str.95 = [22 x i8] c"#define DO_MASK_TESTS\00"
@str.96 = [30 x i8] c"test_spec *(mask_tests[]) = {\00"
@str.97 = [15 x i8] c" &MASK8_test,\00"
@str.98 = [16 x i8] c" &MASK16_test,\00"
@str.99 = [16 x i8] c" &MASK32_test,\00"
@str.100 = [16 x i8] c" &MASK64_test,\00"
@str.101 = [14 x i8] c" &MASK_test,\00"
@str.102 = [5 x i8] c" 0,\00"
@str.103 = [4 x i8] c"};\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 4
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @usage(i32 1)
br label %6
6: ; preds = %4, %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %17, label %11
11: ; preds = %6
%12 = load i8*, i8** %7
%13 = tail call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %17, label %15
15: ; preds = %11
%16 = tail call i32 @usage(i32 2)
br label %17
17: ; preds = %11, %6, %15
%18 = phi i1 [ undef, %15 ], [ true, %6 ], [ false, %11 ]
%19 = phi i1 [ undef, %15 ], [ false, %6 ], [ true, %11 ]
%20 = phi i32 [ undef, %15 ], [ 32, %6 ], [ 64, %11 ]
%21 = getelementptr inbounds i8*, i8** %1, i64 2
%22 = load i8*, i8** %21
%23 = tail call i64 @strcmp(i8* %22, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %37, label %25
25: ; preds = %17
%26 = load i8*, i8** %21
%27 = tail call i64 @strcmp(i8* %26, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%28 = icmp eq i64 %27, 0
%29 = select i1 %28, i1 %18, i1 false
br i1 %29, label %37, label %30
30: ; preds = %25
%31 = load i8*, i8** %21
%32 = tail call i64 @strcmp(i8* %31, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%33 = icmp eq i64 %32, 0
%34 = select i1 %33, i1 %19, i1 false
br i1 %34, label %37, label %35
35: ; preds = %30
%36 = tail call i32 @usage(i32 3)
br label %37
37: ; preds = %30, %25, %17, %35
%38 = phi i32 [ undef, %35 ], [ 0, %17 ], [ 63, %30 ], [ 31, %25 ]
%39 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), %35 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), %17 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), %30 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), %25 ]
%40 = getelementptr inbounds i8*, i8** %1, i64 3
%41 = load i8*, i8** %40
%42 = tail call i64 @strcmp(i8* %41, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%43 = icmp eq i64 %42, 0
br i1 %43, label %50, label %44
44: ; preds = %37
%45 = load i8*, i8** %40
%46 = tail call i64 @strcmp(i8* %45, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
%47 = icmp eq i64 %46, 0
br i1 %47, label %50, label %48
48: ; preds = %44
%49 = tail call i32 @usage(i32 4)
br label %50
50: ; preds = %44, %37, %48
%51 = phi i8* [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.13, i64 0, i64 0), %48 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.13, i64 0, i64 0), %37 ], [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str.14, i64 0, i64 0), %44 ]
%52 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.9, i64 0, i64 0), i32 %20)
%53 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.10, i64 0, i64 0), i32 %38)
%54 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.11, i64 0, i64 0), i64 32)
%55 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.12, i64 0, i64 0), i8* %51)
%56 = tail call i32 @putchar(i32 10)
%57 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%58 = tail call i32 @putchar(i32 10)
%59 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.71, i64 0, i64 0))
%60 = tail call i32 @putchar(i32 10)
%61 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.72, i64 0, i64 0))
%62 = tail call i32 (...) @gen_struct()
%63 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.73, i64 0, i64 0))
%64 = tail call i32 @gen_bit(i32 4, i32 %38, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.20, i64 0, i64 0), i32 4)
%65 = tail call i32 @gen_bit(i32 5, i32 %38, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i64 0, i64 0), i32 5)
%66 = tail call i32 @gen_bit(i32 8, i32 %38, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.22, i64 0, i64 0), i32 8)
%67 = tail call i32 @gen_bit(i32 10, i32 %38, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.23, i64 0, i64 0), i32 10)
%68 = tail call i32 @gen_bit(i32 16, i32 %38, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.24, i64 0, i64 0), i32 16)
%69 = tail call i32 @gen_bit(i32 32, i32 %38, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.25, i64 0, i64 0), i32 32)
%70 = tail call i32 @gen_bit(i32 64, i32 %38, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.26, i64 0, i64 0), i32 64)
%71 = tail call i32 @gen_bit(i32 %20, i32 %38, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.27, i64 0, i64 0), i32 64)
%72 = tail call i32 @gen_bit(i32 8, i32 7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.28, i64 0, i64 0), i32 8)
%73 = tail call i32 @gen_bit(i32 16, i32 15, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.29, i64 0, i64 0), i32 16)
%74 = tail call i32 @gen_bit(i32 32, i32 31, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.30, i64 0, i64 0), i32 32)
%75 = tail call i32 @gen_bit(i32 64, i32 63, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.31, i64 0, i64 0), i32 64)
%76 = add nsw i32 %20, -1
%77 = tail call i32 @gen_bit(i32 %20, i32 %76, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.32, i64 0, i64 0), i32 64)
%78 = tail call i32 @gen_bit(i32 8, i32 0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.33, i64 0, i64 0), i32 8)
%79 = tail call i32 @gen_bit(i32 16, i32 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.34, i64 0, i64 0), i32 16)
%80 = tail call i32 @gen_bit(i32 32, i32 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.35, i64 0, i64 0), i32 32)
%81 = tail call i32 @gen_bit(i32 64, i32 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.36, i64 0, i64 0), i32 64)
%82 = tail call i32 @gen_bit(i32 %20, i32 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.37, i64 0, i64 0), i32 64)
%83 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.74, i64 0, i64 0))
%84 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.75, i64 0, i64 0))
%85 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.76, i64 0, i64 0))
%86 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.77, i64 0, i64 0))
%87 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.78, i64 0, i64 0))
%88 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.79, i64 0, i64 0))
%89 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.80, i64 0, i64 0))
%90 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.81, i64 0, i64 0))
%91 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.82, i64 0, i64 0))
%92 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.83, i64 0, i64 0))
%93 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.84, i64 0, i64 0))
%94 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.85, i64 0, i64 0))
%95 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.86, i64 0, i64 0))
%96 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.87, i64 0, i64 0))
%97 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.88, i64 0, i64 0))
%98 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.89, i64 0, i64 0))
%99 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.90, i64 0, i64 0))
%100 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.91, i64 0, i64 0))
%101 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.92, i64 0, i64 0))
%102 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.102, i64 0, i64 0))
%103 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.103, i64 0, i64 0))
%104 = tail call i32 @gen_enum(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.27, i64 0, i64 0), i32 64)
%105 = tail call i32 @gen_enum(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.32, i64 0, i64 0), i32 64)
%106 = tail call i32 @gen_enum(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.37, i64 0, i64 0), i32 64)
%107 = tail call i32 @gen_enum(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.25, i64 0, i64 0), i32 32)
%108 = tail call i32 @gen_enum(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.30, i64 0, i64 0), i32 32)
%109 = tail call i32 @gen_enum(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.35, i64 0, i64 0), i32 32)
%110 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.95, i64 0, i64 0))
%111 = tail call i32 @gen_mask(i32 8, i8* %39, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.60, i64 0, i64 0), i32 8)
%112 = tail call i32 @gen_mask(i32 16, i8* %39, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.61, i64 0, i64 0), i32 16)
%113 = tail call i32 @gen_mask(i32 32, i8* %39, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.62, i64 0, i64 0), i32 32)
%114 = tail call i32 @gen_mask(i32 64, i8* %39, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.63, i64 0, i64 0), i32 64)
%115 = tail call i32 @gen_mask(i32 %20, i8* %39, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.64, i64 0, i64 0), i32 64)
%116 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.96, i64 0, i64 0))
%117 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.97, i64 0, i64 0))
%118 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.98, i64 0, i64 0))
%119 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.99, i64 0, i64 0))
%120 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.100, i64 0, i64 0))
%121 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.101, i64 0, i64 0))
%122 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.102, i64 0, i64 0))
%123 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.103, i64 0, i64 0))
ret i32 0
}