// File: AshOlogn[P]ash-language-interpreter/src/bitlogicaleval.cpp
// Function: ParseData bitHelper<unsigned char, unsigned char>(unsigned char, unsigned char, ParseDataType, ParseOperatorType)
ParseData bitHelper(T1 n1, T2 n2, ParseDataType finalType, ParseOperatorType op) {

  T1 arg1 = n1;
  T2 arg2 = n2;
  
  ParseData d;
  d.type = finalType;
  
  switch(op) {
    
    case BIT_AND_OP: {
      switch(finalType) {
        case CHAR_T: d.value.integer = (unsigned char) (n1 & n2); break;
        case INT32_T: d.value.integer = (int32_t) (n1 & n2); break;
        case INT64_T: d.value.integer = (int64_t) (n1 & n2); break;
        case UINT32_T: d.value.integer = (uint32_t) (n1 & n2); break;
        case UINT64_T: d.value.integer = (uint64_t) (n1 & n2); break;
      }
      break;
    }

    case BIT_XOR_OP: {
      switch(finalType) {
        case CHAR_T: d.value.integer = (unsigned char) (n1 ^ n2); break;
        case INT32_T: d.value.integer = (int32_t) (n1 ^ n2); break;
        case INT64_T: d.value.integer = (int64_t) (n1 ^ n2); break;
        case UINT32_T: d.value.integer = (uint32_t) (n1 ^ n2); break;
        case UINT64_T: d.value.integer = (uint64_t) (n1 ^ n2); break;
      }
      break;
    }
    
    case BIT_OR_OP: {
      switch(finalType) {
        case CHAR_T: d.value.integer = (unsigned char) (n1 | n2); break;
        case INT32_T: d.value.integer = (int32_t) (n1 | n2); break;
        case INT64_T: d.value.integer = (int64_t) (n1 | n2); break;
        case UINT32_T: d.value.integer = (uint32_t) (n1 | n2); break;
        case UINT64_T: d.value.integer = (uint64_t) (n1 | n2); break;
      }
      break;
    }

		case BIT_LEFT_OP: {
			switch(finalType) {
        case CHAR_T: d.value.integer = (unsigned char) (n1 << n2); break;
        case INT32_T: d.value.integer = (int32_t) (n1 << n2); break;
        case INT64_T: d.value.integer = (int64_t) (n1 << n2); break;
        case UINT32_T: d.value.integer = (uint32_t) (n1 << n2); break;
        case UINT64_T: d.value.integer = (uint64_t) (n1 << n2); break;
      }
      break;
		}

		case BIT_RIGHT_OP: {
			switch(finalType) {
        case CHAR_T: d.value.integer = (unsigned char) (n1 >> n2); break;
        case INT32_T: d.value.integer = (int32_t) (n1 >> n2); break;
        case INT64_T: d.value.integer = (int64_t) (n1 >> n2); break;
        case UINT32_T: d.value.integer = (uint32_t) (n1 >> n2); break;
        case UINT64_T: d.value.integer = (uint64_t) (n1 >> n2); break;
      }
      break;
		}
  }

  return d;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb %sil, %al
movb %dil, %sil
movb %sil, -0x11(%rbp)
movb %al, -0x12(%rbp)
movl %edx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movb -0x11(%rbp), %al
movb %al, -0x1d(%rbp)
movb -0x12(%rbp), %al
movb %al, -0x1e(%rbp)
movl -0x18(%rbp), %eax
movl %eax, -0x10(%rbp)
movl -0x1c(%rbp), %eax
addl $-0x11, %eax
movl %eax, %ecx
movq %rcx, -0x28(%rbp)
subl $0xa, %eax
ja 0x1ef8e
movq -0x28(%rbp), %rax
leaq 0x2392f(%rip), %rcx     # 0x42628
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl -0x18(%rbp), %eax
addl $-0x2, %eax
movl %eax, %ecx
movq %rcx, -0x30(%rbp)
subl $0x6, %eax
ja 0x1ed80
movq -0x30(%rbp), %rax
leaq 0x239a6(%rip), %rcx     # 0x426c4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movzbl -0x11(%rbp), %eax
movzbl -0x12(%rbp), %ecx
andl %ecx, %eax
movzbl %al, %eax
movq %rax, -0x8(%rbp)
jmp 0x1ed80
movzbl -0x11(%rbp), %eax
movzbl -0x12(%rbp), %ecx
andl %ecx, %eax
cltq
movq %rax, -0x8(%rbp)
jmp 0x1ed80
movzbl -0x11(%rbp), %eax
movzbl -0x12(%rbp), %ecx
andl %ecx, %eax
cltq
movq %rax, -0x8(%rbp)
jmp 0x1ed80
movzbl -0x11(%rbp), %eax
movzbl -0x12(%rbp), %ecx
andl %ecx, %eax
movl %eax, %eax
movq %rax, -0x8(%rbp)
jmp 0x1ed80
movzbl -0x11(%rbp), %eax
movzbl -0x12(%rbp), %ecx
andl %ecx, %eax
cltq
movq %rax, -0x8(%rbp)
jmp 0x1ef8e
movl -0x18(%rbp), %eax
addl $-0x2, %eax
movl %eax, %ecx
movq %rcx, -0x38(%rbp)
subl $0x6, %eax
ja 0x1ee03
movq -0x38(%rbp), %rax
leaq 0x23907(%rip), %rcx     # 0x426a8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movzbl -0x11(%rbp), %eax
movzbl -0x12(%rbp), %ecx
xorl %ecx, %eax
movzbl %al, %eax
movq %rax, -0x8(%rbp)
jmp 0x1ee03
movzbl -0x11(%rbp), %eax
movzbl -0x12(%rbp), %ecx
xorl %ecx, %eax
cltq
movq %rax, -0x8(%rbp)
jmp 0x1ee03
movzbl -0x11(%rbp), %eax
movzbl -0x12(%rbp), %ecx
xorl %ecx, %eax
cltq
movq %rax, -0x8(%rbp)
jmp 0x1ee03
movzbl -0x11(%rbp), %eax
movzbl -0x12(%rbp), %ecx
xorl %ecx, %eax
movl %eax, %eax
movq %rax, -0x8(%rbp)
jmp 0x1ee03
movzbl -0x11(%rbp), %eax
movzbl -0x12(%rbp), %ecx
xorl %ecx, %eax
cltq
movq %rax, -0x8(%rbp)
jmp 0x1ef8e
movl -0x18(%rbp), %eax
addl $-0x2, %eax
movl %eax, %ecx
movq %rcx, -0x40(%rbp)
subl $0x6, %eax
ja 0x1ee86
movq -0x40(%rbp), %rax
leaq 0x23868(%rip), %rcx     # 0x4268c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movzbl -0x11(%rbp), %eax
movzbl -0x12(%rbp), %ecx
orl %ecx, %eax
movzbl %al, %eax
movq %rax, -0x8(%rbp)
jmp 0x1ee86
movzbl -0x11(%rbp), %eax
movzbl -0x12(%rbp), %ecx
orl %ecx, %eax
cltq
movq %rax, -0x8(%rbp)
jmp 0x1ee86
movzbl -0x11(%rbp), %eax
movzbl -0x12(%rbp), %ecx
orl %ecx, %eax
cltq
movq %rax, -0x8(%rbp)
jmp 0x1ee86
movzbl -0x11(%rbp), %eax
movzbl -0x12(%rbp), %ecx
orl %ecx, %eax
movl %eax, %eax
movq %rax, -0x8(%rbp)
jmp 0x1ee86
movzbl -0x11(%rbp), %eax
movzbl -0x12(%rbp), %ecx
orl %ecx, %eax
cltq
movq %rax, -0x8(%rbp)
jmp 0x1ef8e
movl -0x18(%rbp), %eax
addl $-0x2, %eax
movl %eax, %ecx
movq %rcx, -0x48(%rbp)
subl $0x6, %eax
ja 0x1ef09
movq -0x48(%rbp), %rax
leaq 0x237c9(%rip), %rcx     # 0x42670
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movzbl -0x11(%rbp), %eax
movzbl -0x12(%rbp), %ecx
shll %cl, %eax
movzbl %al, %eax
movq %rax, -0x8(%rbp)
jmp 0x1ef09
movzbl -0x11(%rbp), %eax
movzbl -0x12(%rbp), %ecx
shll %cl, %eax
cltq
movq %rax, -0x8(%rbp)
jmp 0x1ef09
movzbl -0x11(%rbp), %eax
movzbl -0x12(%rbp), %ecx
shll %cl, %eax
cltq
movq %rax, -0x8(%rbp)
jmp 0x1ef09
movzbl -0x11(%rbp), %eax
movzbl -0x12(%rbp), %ecx
shll %cl, %eax
movl %eax, %eax
movq %rax, -0x8(%rbp)
jmp 0x1ef09
movzbl -0x11(%rbp), %eax
movzbl -0x12(%rbp), %ecx
shll %cl, %eax
cltq
movq %rax, -0x8(%rbp)
jmp 0x1ef8e
movl -0x18(%rbp), %eax
addl $-0x2, %eax
movl %eax, %ecx
movq %rcx, -0x50(%rbp)
subl $0x6, %eax
ja 0x1ef8c
movq -0x50(%rbp), %rax
leaq 0x2372a(%rip), %rcx     # 0x42654
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movzbl -0x11(%rbp), %eax
movzbl -0x12(%rbp), %ecx
sarl %cl, %eax
movzbl %al, %eax
movq %rax, -0x8(%rbp)
jmp 0x1ef8c
movzbl -0x11(%rbp), %eax
movzbl -0x12(%rbp), %ecx
sarl %cl, %eax
cltq
movq %rax, -0x8(%rbp)
jmp 0x1ef8c
movzbl -0x11(%rbp), %eax
movzbl -0x12(%rbp), %ecx
sarl %cl, %eax
cltq
movq %rax, -0x8(%rbp)
jmp 0x1ef8c
movzbl -0x11(%rbp), %eax
movzbl -0x12(%rbp), %ecx
sarl %cl, %eax
movl %eax, %eax
movq %rax, -0x8(%rbp)
jmp 0x1ef8c
movzbl -0x11(%rbp), %eax
movzbl -0x12(%rbp), %ecx
sarl %cl, %eax
cltq
movq %rax, -0x8(%rbp)
jmp 0x1ef8e
movl -0x10(%rbp), %eax
movq -0x8(%rbp), %rdx
popq %rbp
retq
nopw (%rax,%rax)