#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 */
typedef int uint8_t;

/* Variables and functions */
void sym_int2bits(int sym, uint8_t *ret) {
  switch (sym) {
  case -3:
    ret[0] = 1;
    ret[1] = 1;
    break;
  case 1:
    ret[0] = 0;
    ret[1] = 0;
    break;
  case 3:
    ret[0] = 0;
    ret[1] = 1;
    break;
  case -1:
    ret[0] = 1;
    ret[1] = 0;
    break;
  }
}


x86 assembly (clang, -O0):
<sym_int2bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x3,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x6,%eax
ja     1197 <sym_int2bits+0x97>
mov    -0x18(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x1,0x4(%rax)
jmp    1197 <sym_int2bits+0x97>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x0,0x4(%rax)
jmp    1197 <sym_int2bits+0x97>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x1,0x4(%rax)
jmp    1197 <sym_int2bits+0x97>
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x0,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<sym_int2bits>:
add    $0x3,%edi
cmp    $0x6,%edi
ja     112e <sym_int2bits+0x2e>
mov    $0x55,%eax
bt     %edi,%eax
jae    112e <sym_int2bits+0x2e>
movslq %edi,%rax
lea    0xee4(%rip),%rcx
mov    (%rcx,%rax,4),%ecx
lea    0xef6(%rip),%rdx
mov    (%rdx,%rax,4),%eax
mov    %ecx,(%rsi)
mov    %eax,0x4(%rsi)
ret

LLVM IR (-O0):
define void @sym_int2bits(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32, i32* %3
switch i32 %5, label %26 [
i32 -3, label %6
i32 1, label %11
i32 3, label %16
i32 -1, label %21
]
6: ; preds = %2
%7 = load i32*, i32** %4
%8 = getelementptr inbounds i32, i32* %7, i64 0
store i32 1, i32* %8
%9 = load i32*, i32** %4
%10 = getelementptr inbounds i32, i32* %9, i64 1
store i32 1, i32* %10
br label %26
11: ; preds = %2
%12 = load i32*, i32** %4
%13 = getelementptr inbounds i32, i32* %12, i64 0
store i32 0, i32* %13
%14 = load i32*, i32** %4
%15 = getelementptr inbounds i32, i32* %14, i64 1
store i32 0, i32* %15
br label %26
16: ; preds = %2
%17 = load i32*, i32** %4
%18 = getelementptr inbounds i32, i32* %17, i64 0
store i32 0, i32* %18
%19 = load i32*, i32** %4
%20 = getelementptr inbounds i32, i32* %19, i64 1
store i32 1, i32* %20
br label %26
21: ; preds = %2
%22 = load i32*, i32** %4
%23 = getelementptr inbounds i32, i32* %22, i64 0
store i32 1, i32* %23
%24 = load i32*, i32** %4
%25 = getelementptr inbounds i32, i32* %24, i64 1
store i32 0, i32* %25
br label %26
26: ; preds = %2, %21, %16, %11, %6
ret void
}

LLVM IR (-O2):
@switch.table.sym_int2bits = [7 x i32] [i32 1, i32 1, i32 1, i32 1, i32 0, i32 1, i32 0]
@switch.table.sym_int2bits.1 = [7 x i32] [i32 1, i32 1, i32 0, i32 1, i32 0, i32 1, i32 1]
define void @sym_int2bits(i32 %0, i32* nocapture writeonly %1) {
%3 = add i32 %0, 3
%4 = icmp ult i32 %3, 7
br i1 %4, label %5, label %18
5: ; preds = %2
%6 = trunc i32 %3 to i8
%7 = lshr i8 85, %6
%8 = and i8 %7, 1
%9 = icmp eq i8 %8, 0
br i1 %9, label %18, label %10
10: ; preds = %5
%11 = sext i32 %3 to i64
%12 = getelementptr inbounds [7 x i32], [7 x i32]* @switch.table.sym_int2bits, i64 0, i64 %11
%13 = load i32, i32* %12
%14 = sext i32 %3 to i64
%15 = getelementptr inbounds [7 x i32], [7 x i32]* @switch.table.sym_int2bits.1, i64 0, i64 %14
%16 = load i32, i32* %15
store i32 %13, i32* %1
%17 = getelementptr inbounds i32, i32* %1, i64 1
store i32 %16, i32* %17
br label %18
18: ; preds = %5, %2, %10
ret void
}