#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 /*<<< orphan*/ sqlite3;

/* Variables and functions */
int query_has_result(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ sprintf(char *, char *, long, short);
bool position_and_count_exist_in_database(long position, short count,
                                          sqlite3 *db) {
  char sql_text[100];
  short a, b, c, d, e, f, g, h;
  {
    h = position & 31;
    g = (position >> 5) & 31;
    f = (position >> 10) & 31;
    e = (position >> 15) & 31;
    d = (position >> 20) & 31;
    c = (position >> 25) & 31;
    b = (position >> 30) & 31;
    a = (position >> 35) & 31;
  }
  {
    if ((a != 0 && a % 4 != 1 && a % 4 != 2) ||
        (a == 0 && b != 0 && b % 4 != 1 && b % 4 != 2) ||
        (a == 0 && b == 0 && c != 0 && c % 4 != 1 && c % 4 != 2) ||
        (a == 0 && b == 0 && c == 0 && d != 0 && d % 4 != 1 && d % 4 != 2)) {
      {
        a = a ? 4 * ((a - 1) / 4) + 4 - ((a - 1) % 4) : 0;
        b = b ? 4 * ((b - 1) / 4) + 4 - ((b - 1) % 4) : 0;
        c = c ? 4 * ((c - 1) / 4) + 4 - ((c - 1) % 4) : 0;
        d = d ? 4 * ((d - 1) / 4) + 4 - ((d - 1) % 4) : 0;
        e = e ? 4 * ((e - 1) / 4) + 4 - ((e - 1) % 4) : 0;
        f = f ? 4 * ((f - 1) / 4) + 4 - ((f - 1) % 4) : 0;
        g = g ? 4 * ((g - 1) / 4) + 4 - ((g - 1) % 4) : 0;
        h = h ? 4 * ((h - 1) / 4) + 4 - ((h - 1) % 4) : 0;
      }
      {
        position = 0;
        position |= a;
        position <<= 5;
        position |= b;
        position <<= 5;
        position |= c;
        position <<= 5;
        position |= d;
        position <<= 5;
        position |= e;
        position <<= 5;
        position |= f;
        position <<= 5;
        position |= g;
        position <<= 5;
        position |= h;
      }
    }
  }
  sprintf(
      sql_text,
      "SELECT position FROM positions WHERE position = %ld AND count = %hi;",
      position, count);
  return query_has_result(sql_text, db);
}


x86 assembly (clang, -O0):
<position_and_count_exist_in_database>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
and    $0x1f,%rax
mov    %ax,-0x90(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x5,%rax
and    $0x1f,%rax
mov    %ax,-0x8e(%rbp)
mov    -0x8(%rbp),%rax
sar    $0xa,%rax
and    $0x1f,%rax
mov    %ax,-0x8c(%rbp)
mov    -0x8(%rbp),%rax
sar    $0xf,%rax
and    $0x1f,%rax
mov    %ax,-0x8a(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x14,%rax
and    $0x1f,%rax
mov    %ax,-0x88(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x19,%rax
and    $0x1f,%rax
mov    %ax,-0x86(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x1e,%rax
and    $0x1f,%rax
mov    %ax,-0x84(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x23,%rax
and    $0x1f,%rax
mov    %ax,-0x82(%rbp)
movswl -0x82(%rbp),%eax
cmp    $0x0,%eax
je     120e <position_and_count_exist_in_database+0xee>
movswl -0x82(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
je     120e <position_and_count_exist_in_database+0xee>
movswl -0x82(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x2,%edx
jne    132e <position_and_count_exist_in_database+0x20e>
movswl -0x82(%rbp),%eax
cmp    $0x0,%eax
jne    125e <position_and_count_exist_in_database+0x13e>
movswl -0x84(%rbp),%eax
cmp    $0x0,%eax
je     125e <position_and_count_exist_in_database+0x13e>
movswl -0x84(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
je     125e <position_and_count_exist_in_database+0x13e>
movswl -0x84(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x2,%edx
jne    132e <position_and_count_exist_in_database+0x20e>
movswl -0x82(%rbp),%eax
cmp    $0x0,%eax
jne    12be <position_and_count_exist_in_database+0x19e>
movswl -0x84(%rbp),%eax
cmp    $0x0,%eax
jne    12be <position_and_count_exist_in_database+0x19e>
movswl -0x86(%rbp),%eax
cmp    $0x0,%eax
je     12be <position_and_count_exist_in_database+0x19e>
movswl -0x86(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
je     12be <position_and_count_exist_in_database+0x19e>
movswl -0x86(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x2,%edx
jne    132e <position_and_count_exist_in_database+0x20e>
movswl -0x82(%rbp),%eax
cmp    $0x0,%eax
jne    1772 <position_and_count_exist_in_database+0x652>
movswl -0x84(%rbp),%eax
cmp    $0x0,%eax
jne    1772 <position_and_count_exist_in_database+0x652>
movswl -0x86(%rbp),%eax
cmp    $0x0,%eax
jne    1772 <position_and_count_exist_in_database+0x652>
movswl -0x88(%rbp),%eax
cmp    $0x0,%eax
je     1772 <position_and_count_exist_in_database+0x652>
movswl -0x88(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
je     1772 <position_and_count_exist_in_database+0x652>
movswl -0x88(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x2,%edx
je     1772 <position_and_count_exist_in_database+0x652>
movswl -0x82(%rbp),%eax
cmp    $0x0,%eax
je     1381 <position_and_count_exist_in_database+0x261>
movswl -0x82(%rbp),%eax
sub    $0x1,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
shl    $0x2,%eax
add    $0x4,%eax
mov    %eax,-0x98(%rbp)
movswl -0x82(%rbp),%eax
sub    $0x1,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    -0x98(%rbp),%eax
sub    %edx,%eax
mov    %eax,-0x94(%rbp)
jmp    138e <position_and_count_exist_in_database+0x26e>
xor    %eax,%eax
mov    %eax,-0x94(%rbp)
jmp    138e <position_and_count_exist_in_database+0x26e>
mov    -0x94(%rbp),%eax
mov    %ax,-0x82(%rbp)
movswl -0x84(%rbp),%eax
cmp    $0x0,%eax
je     13ee <position_and_count_exist_in_database+0x2ce>
movswl -0x84(%rbp),%eax
sub    $0x1,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
shl    $0x2,%eax
add    $0x4,%eax
mov    %eax,-0xa0(%rbp)
movswl -0x84(%rbp),%eax
sub    $0x1,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    -0xa0(%rbp),%eax
sub    %edx,%eax
mov    %eax,-0x9c(%rbp)
jmp    13fb <position_and_count_exist_in_database+0x2db>
xor    %eax,%eax
mov    %eax,-0x9c(%rbp)
jmp    13fb <position_and_count_exist_in_database+0x2db>
mov    -0x9c(%rbp),%eax
mov    %ax,-0x84(%rbp)
movswl -0x86(%rbp),%eax
cmp    $0x0,%eax
je     145b <position_and_count_exist_in_database+0x33b>
movswl -0x86(%rbp),%eax
sub    $0x1,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
shl    $0x2,%eax
add    $0x4,%eax
mov    %eax,-0xa8(%rbp)
movswl -0x86(%rbp),%eax
sub    $0x1,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    -0xa8(%rbp),%eax
sub    %edx,%eax
mov    %eax,-0xa4(%rbp)
jmp    1468 <position_and_count_exist_in_database+0x348>
xor    %eax,%eax
mov    %eax,-0xa4(%rbp)
jmp    1468 <position_and_count_exist_in_database+0x348>
mov    -0xa4(%rbp),%eax
mov    %ax,-0x86(%rbp)
movswl -0x88(%rbp),%eax
cmp    $0x0,%eax
je     14c8 <position_and_count_exist_in_database+0x3a8>
movswl -0x88(%rbp),%eax
sub    $0x1,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
shl    $0x2,%eax
add    $0x4,%eax
mov    %eax,-0xb0(%rbp)
movswl -0x88(%rbp),%eax
sub    $0x1,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    -0xb0(%rbp),%eax
sub    %edx,%eax
mov    %eax,-0xac(%rbp)
jmp    14d5 <position_and_count_exist_in_database+0x3b5>
xor    %eax,%eax
mov    %eax,-0xac(%rbp)
jmp    14d5 <position_and_count_exist_in_database+0x3b5>
mov    -0xac(%rbp),%eax
mov    %ax,-0x88(%rbp)
movswl -0x8a(%rbp),%eax
cmp    $0x0,%eax
je     1535 <position_and_count_exist_in_database+0x415>
movswl -0x8a(%rbp),%eax
sub    $0x1,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
shl    $0x2,%eax
add    $0x4,%eax
mov    %eax,-0xb8(%rbp)
movswl -0x8a(%rbp),%eax
sub    $0x1,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    -0xb8(%rbp),%eax
sub    %edx,%eax
mov    %eax,-0xb4(%rbp)
jmp    1542 <position_and_count_exist_in_database+0x422>
xor    %eax,%eax
mov    %eax,-0xb4(%rbp)
jmp    1542 <position_and_count_exist_in_database+0x422>
mov    -0xb4(%rbp),%eax
mov    %ax,-0x8a(%rbp)
movswl -0x8c(%rbp),%eax
cmp    $0x0,%eax
je     15a2 <position_and_count_exist_in_database+0x482>
movswl -0x8c(%rbp),%eax
sub    $0x1,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
shl    $0x2,%eax
add    $0x4,%eax
mov    %eax,-0xc0(%rbp)
movswl -0x8c(%rbp),%eax
sub    $0x1,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    -0xc0(%rbp),%eax
sub    %edx,%eax
mov    %eax,-0xbc(%rbp)
jmp    15af <position_and_count_exist_in_database+0x48f>
xor    %eax,%eax
mov    %eax,-0xbc(%rbp)
jmp    15af <position_and_count_exist_in_database+0x48f>
mov    -0xbc(%rbp),%eax
mov    %ax,-0x8c(%rbp)
movswl -0x8e(%rbp),%eax
cmp    $0x0,%eax
je     160f <position_and_count_exist_in_database+0x4ef>
movswl -0x8e(%rbp),%eax
sub    $0x1,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
shl    $0x2,%eax
add    $0x4,%eax
mov    %eax,-0xc8(%rbp)
movswl -0x8e(%rbp),%eax
sub    $0x1,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    -0xc8(%rbp),%eax
sub    %edx,%eax
mov    %eax,-0xc4(%rbp)
jmp    161c <position_and_count_exist_in_database+0x4fc>
xor    %eax,%eax
mov    %eax,-0xc4(%rbp)
jmp    161c <position_and_count_exist_in_database+0x4fc>
mov    -0xc4(%rbp),%eax
mov    %ax,-0x8e(%rbp)
movswl -0x90(%rbp),%eax
cmp    $0x0,%eax
je     167c <position_and_count_exist_in_database+0x55c>
movswl -0x90(%rbp),%eax
sub    $0x1,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
shl    $0x2,%eax
add    $0x4,%eax
mov    %eax,-0xd0(%rbp)
movswl -0x90(%rbp),%eax
sub    $0x1,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    -0xd0(%rbp),%eax
sub    %edx,%eax
mov    %eax,-0xcc(%rbp)
jmp    1689 <position_and_count_exist_in_database+0x569>
xor    %eax,%eax
mov    %eax,-0xcc(%rbp)
jmp    1689 <position_and_count_exist_in_database+0x569>
mov    -0xcc(%rbp),%eax
mov    %ax,-0x90(%rbp)
movq   $0x0,-0x8(%rbp)
movswq -0x82(%rbp),%rax
ff
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x5,%rax
mov    %rax,-0x8(%rbp)
movswq -0x84(%rbp),%rax
ff
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x5,%rax
mov    %rax,-0x8(%rbp)
movswq -0x86(%rbp),%rax
ff
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x5,%rax
mov    %rax,-0x8(%rbp)
movswq -0x88(%rbp),%rax
ff
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x5,%rax
mov    %rax,-0x8(%rbp)
movswq -0x8a(%rbp),%rax
ff
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x5,%rax
mov    %rax,-0x8(%rbp)
movswq -0x8c(%rbp),%rax
ff
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x5,%rax
mov    %rax,-0x8(%rbp)
movswq -0x8e(%rbp),%rax
ff
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x5,%rax
mov    %rax,-0x8(%rbp)
movswq -0x90(%rbp),%rax
ff
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
lea    -0x80(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0x87f(%rip),%rsi
movswl -0xa(%rbp),%ecx
call   1040 <sprintf@plt>
lea    -0x80(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <query_has_result@plt>
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<position_and_count_exist_in_database>:
push   %r15
push   %r14
push   %rbx
sub    $0x70,%rsp
mov    %rdx,%r14
mov    %rdi,%r15
mov    %rdi,%rax
shr    $0x14,%rax
mov    %eax,%r9d
and    $0x1f,%r9d
mov    %rdi,%rdx
shr    $0x19,%rdx
mov    %edx,%r10d
and    $0x1f,%r10d
mov    %rdi,%rbx
shr    $0x1e,%rbx
mov    %ebx,%r8d
and    $0x1f,%r8d
shr    $0x23,%rdi
mov    %edi,%ecx
and    $0x1f,%ecx
je     11a5 <position_and_count_exist_in_database+0x85>
and    $0x3,%edi
add    $0xffffffff,%edi
cmp    $0x2,%edi
jb     11b6 <position_and_count_exist_in_database+0x96>
add    $0xffffffff,%ecx
mov    %ecx,%eax
and    $0xfc,%eax
and    $0x3,%ecx
sub    %ecx,%eax
shl    $0x5,%eax
sub    $0xffffff80,%eax
and    $0x1fffe0,%eax
test   %r8w,%r8w
jne    1223 <position_and_count_exist_in_database+0x103>
xor    %r8d,%r8d
test   %r10w,%r10w
jne    1244 <position_and_count_exist_in_database+0x124>
jmp    126c <position_and_count_exist_in_database+0x14c>
test   %r8w,%r8w
je     1201 <position_and_count_exist_in_database+0xe1>
and    $0x3,%ebx
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1221 <position_and_count_exist_in_database+0x101>
test   %ecx,%ecx
sete   %bl
test   %r8w,%r8w
sete   %dl
and    %bl,%dl
test   %r9w,%r9w
je     1363 <position_and_count_exist_in_database+0x243>
test   %r10w,%r10w
jne    1363 <position_and_count_exist_in_database+0x243>
test   %dl,%dl
je     1363 <position_and_count_exist_in_database+0x243>
and    $0x3,%eax
add    $0xffffffff,%eax
cmp    $0x2,%eax
jb     1363 <position_and_count_exist_in_database+0x243>
test   %ecx,%ecx
jne    116f <position_and_count_exist_in_database+0x4f>
xor    %eax,%eax
test   %r8w,%r8w
jne    1223 <position_and_count_exist_in_database+0x103>
jmp    1193 <position_and_count_exist_in_database+0x73>
test   %r10w,%r10w
je     1390 <position_and_count_exist_in_database+0x270>
and    $0x3,%edx
add    $0xffffffff,%edx
cmp    $0x2,%edx
jb     1363 <position_and_count_exist_in_database+0x243>
xor    %r8d,%r8d
xor    %eax,%eax
jmp    1244 <position_and_count_exist_in_database+0x124>
xor    %eax,%eax
movzwl %r8w,%ecx
add    $0xffffffff,%ecx
mov    %ecx,%r8d
and    $0xfc,%r8d
and    $0x3,%ecx
sub    %ecx,%r8d
add    $0x4,%r8d
test   %r10w,%r10w
je     126c <position_and_count_exist_in_database+0x14c>
movzwl %r10w,%ecx
add    $0xffffffff,%ecx
mov    %ecx,%r10d
and    $0xfc,%r10d
and    $0x3,%ecx
sub    %ecx,%r10d
shl    $0x5,%r10d
sub    $0xffffff80,%r10d
and    $0x1fffe0,%r10d
jmp    126f <position_and_count_exist_in_database+0x14f>
xor    %r10d,%r10d
mov    %r15d,%ebx
shr    $0xa,%ebx
mov    %r15d,%edx
shr    $0xf,%edx
and    $0x1f,%edx
test   %r9w,%r9w
je     12a1 <position_and_count_exist_in_database+0x181>
movzwl %r9w,%ecx
add    $0xffffffff,%ecx
mov    %ecx,%r9d
and    $0xfc,%r9d
and    $0x3,%ecx
sub    %ecx,%r9d
add    $0x4,%r9d
jmp    12a4 <position_and_count_exist_in_database+0x184>
xor    %r9d,%r9d
mov    %r15d,%ecx
shr    $0x5,%ecx
and    $0x1f,%ebx
test   %edx,%edx
je     12cf <position_and_count_exist_in_database+0x1af>
add    $0xffffffff,%edx
mov    %edx,%edi
and    $0xfc,%edi
and    $0x3,%edx
sub    %edx,%edi
shl    $0x5,%edi
sub    $0xffffff80,%edi
and    $0x1fffe0,%edi
jmp    12d1 <position_and_count_exist_in_database+0x1b1>
xor    %edi,%edi
and    $0x1f,%ecx
test   %ebx,%ebx
je     12f1 <position_and_count_exist_in_database+0x1d1>
add    $0xffffffff,%ebx
mov    %ebx,%r11d
and    $0xfc,%r11d
and    $0x3,%ebx
sub    %ebx,%r11d
add    $0x4,%r11d
jmp    12f4 <position_and_count_exist_in_database+0x1d4>
xor    %r11d,%r11d
and    $0x1f,%r15d
test   %ecx,%ecx
je     1336 <position_and_count_exist_in_database+0x216>
add    $0xffffffff,%ecx
mov    %ecx,%ebx
and    $0xfc,%ebx
and    $0x3,%ecx
sub    %ecx,%ebx
shl    $0x5,%ebx
sub    $0xffffff80,%ebx
and    $0x1fffe0,%ebx
test   %r15d,%r15d
je     133d <position_and_count_exist_in_database+0x21d>
add    $0xffffffff,%r15d
mov    %r15d,%ecx
and    $0xfc,%ecx
and    $0x3,%r15d
sub    %r15d,%ecx
add    $0x4,%ecx
jmp    133f <position_and_count_exist_in_database+0x21f>
xor    %ebx,%ebx
test   %r15d,%r15d
jne    131d <position_and_count_exist_in_database+0x1fd>
xor    %ecx,%ecx
or     %r8,%rax
shl    $0xa,%rax
or     %r10,%rax
or     %r9,%rax
shl    $0xa,%rax
or     %rax,%rdi
or     %r11,%rdi
shl    $0xa,%rdi
or     %rdi,%rbx
or     %rcx,%rbx
mov    %rbx,%r15
movswl %si,%ecx
lea    0xc93(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %r15,%rdx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <query_has_result@plt>
add    $0x70,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
mov    $0x1,%dl
test   %r9w,%r9w
jne    11ce <position_and_count_exist_in_database+0xae>
jmp    1363 <position_and_count_exist_in_database+0x243>

LLVM IR (-O0):
@.str = [69 x i8] c"SELECT position FROM positions WHERE position = %ld AND count = %hi;\00"
define i32 @position_and_count_exist_in_database(i64 %0, i16 signext %1, i32* %2) {
%4 = alloca i64
%5 = alloca i16
%6 = alloca i32*
%7 = alloca [100 x i8]
%8 = alloca i16
%9 = alloca i16
%10 = alloca i16
%11 = alloca i16
%12 = alloca i16
%13 = alloca i16
%14 = alloca i16
%15 = alloca i16
store i64 %0, i64* %4
store i16 %1, i16* %5
store i32* %2, i32** %6
%16 = load i64, i64* %4
%17 = and i64 %16, 31
%18 = trunc i64 %17 to i16
store i16 %18, i16* %15
%19 = load i64, i64* %4
%20 = ashr i64 %19, 5
%21 = and i64 %20, 31
%22 = trunc i64 %21 to i16
store i16 %22, i16* %14
%23 = load i64, i64* %4
%24 = ashr i64 %23, 10
%25 = and i64 %24, 31
%26 = trunc i64 %25 to i16
store i16 %26, i16* %13
%27 = load i64, i64* %4
%28 = ashr i64 %27, 15
%29 = and i64 %28, 31
%30 = trunc i64 %29 to i16
store i16 %30, i16* %12
%31 = load i64, i64* %4
%32 = ashr i64 %31, 20
%33 = and i64 %32, 31
%34 = trunc i64 %33 to i16
store i16 %34, i16* %11
%35 = load i64, i64* %4
%36 = ashr i64 %35, 25
%37 = and i64 %36, 31
%38 = trunc i64 %37 to i16
store i16 %38, i16* %10
%39 = load i64, i64* %4
%40 = ashr i64 %39, 30
%41 = and i64 %40, 31
%42 = trunc i64 %41 to i16
store i16 %42, i16* %9
%43 = load i64, i64* %4
%44 = ashr i64 %43, 35
%45 = and i64 %44, 31
%46 = trunc i64 %45 to i16
store i16 %46, i16* %8
%47 = load i16, i16* %8
%48 = sext i16 %47 to i32
%49 = icmp ne i32 %48, 0
br i1 %49, label %50, label %60
50: ; preds = %3
%51 = load i16, i16* %8
%52 = sext i16 %51 to i32
%53 = srem i32 %52, 4
%54 = icmp ne i32 %53, 1
br i1 %54, label %55, label %60
55: ; preds = %50
%56 = load i16, i16* %8
%57 = sext i16 %56 to i32
%58 = srem i32 %57, 4
%59 = icmp ne i32 %58, 2
br i1 %59, label %126, label %60
60: ; preds = %55, %50, %3
%61 = load i16, i16* %8
%62 = sext i16 %61 to i32
%63 = icmp eq i32 %62, 0
br i1 %63, label %64, label %78
64: ; preds = %60
%65 = load i16, i16* %9
%66 = sext i16 %65 to i32
%67 = icmp ne i32 %66, 0
br i1 %67, label %68, label %78
68: ; preds = %64
%69 = load i16, i16* %9
%70 = sext i16 %69 to i32
%71 = srem i32 %70, 4
%72 = icmp ne i32 %71, 1
br i1 %72, label %73, label %78
73: ; preds = %68
%74 = load i16, i16* %9
%75 = sext i16 %74 to i32
%76 = srem i32 %75, 4
%77 = icmp ne i32 %76, 2
br i1 %77, label %126, label %78
78: ; preds = %73, %68, %64, %60
%79 = load i16, i16* %8
%80 = sext i16 %79 to i32
%81 = icmp eq i32 %80, 0
br i1 %81, label %82, label %100
82: ; preds = %78
%83 = load i16, i16* %9
%84 = sext i16 %83 to i32
%85 = icmp eq i32 %84, 0
br i1 %85, label %86, label %100
86: ; preds = %82
%87 = load i16, i16* %10
%88 = sext i16 %87 to i32
%89 = icmp ne i32 %88, 0
br i1 %89, label %90, label %100
90: ; preds = %86
%91 = load i16, i16* %10
%92 = sext i16 %91 to i32
%93 = srem i32 %92, 4
%94 = icmp ne i32 %93, 1
br i1 %94, label %95, label %100
95: ; preds = %90
%96 = load i16, i16* %10
%97 = sext i16 %96 to i32
%98 = srem i32 %97, 4
%99 = icmp ne i32 %98, 2
br i1 %99, label %126, label %100
100: ; preds = %95, %90, %86, %82, %78
%101 = load i16, i16* %8
%102 = sext i16 %101 to i32
%103 = icmp eq i32 %102, 0
br i1 %103, label %104, label %325
104: ; preds = %100
%105 = load i16, i16* %9
%106 = sext i16 %105 to i32
%107 = icmp eq i32 %106, 0
br i1 %107, label %108, label %325
108: ; preds = %104
%109 = load i16, i16* %10
%110 = sext i16 %109 to i32
%111 = icmp eq i32 %110, 0
br i1 %111, label %112, label %325
112: ; preds = %108
%113 = load i16, i16* %11
%114 = sext i16 %113 to i32
%115 = icmp ne i32 %114, 0
br i1 %115, label %116, label %325
116: ; preds = %112
%117 = load i16, i16* %11
%118 = sext i16 %117 to i32
%119 = srem i32 %118, 4
%120 = icmp ne i32 %119, 1
br i1 %120, label %121, label %325
121: ; preds = %116
%122 = load i16, i16* %11
%123 = sext i16 %122 to i32
%124 = srem i32 %123, 4
%125 = icmp ne i32 %124, 2
br i1 %125, label %126, label %325
126: ; preds = %121, %95, %73, %55
%127 = load i16, i16* %8
%128 = sext i16 %127 to i32
%129 = icmp ne i32 %128, 0
br i1 %129, label %130, label %142
130: ; preds = %126
%131 = load i16, i16* %8
%132 = sext i16 %131 to i32
%133 = sub nsw i32 %132, 1
%134 = sdiv i32 %133, 4
%135 = mul nsw i32 4, %134
%136 = add nsw i32 %135, 4
%137 = load i16, i16* %8
%138 = sext i16 %137 to i32
%139 = sub nsw i32 %138, 1
%140 = srem i32 %139, 4
%141 = sub nsw i32 %136, %140
br label %143
142: ; preds = %126
br label %143
143: ; preds = %142, %130
%144 = phi i32 [ %141, %130 ], [ 0, %142 ]
%145 = trunc i32 %144 to i16
store i16 %145, i16* %8
%146 = load i16, i16* %9
%147 = sext i16 %146 to i32
%148 = icmp ne i32 %147, 0
br i1 %148, label %149, label %161
149: ; preds = %143
%150 = load i16, i16* %9
%151 = sext i16 %150 to i32
%152 = sub nsw i32 %151, 1
%153 = sdiv i32 %152, 4
%154 = mul nsw i32 4, %153
%155 = add nsw i32 %154, 4
%156 = load i16, i16* %9
%157 = sext i16 %156 to i32
%158 = sub nsw i32 %157, 1
%159 = srem i32 %158, 4
%160 = sub nsw i32 %155, %159
br label %162
161: ; preds = %143
br label %162
162: ; preds = %161, %149
%163 = phi i32 [ %160, %149 ], [ 0, %161 ]
%164 = trunc i32 %163 to i16
store i16 %164, i16* %9
%165 = load i16, i16* %10
%166 = sext i16 %165 to i32
%167 = icmp ne i32 %166, 0
br i1 %167, label %168, label %180
168: ; preds = %162
%169 = load i16, i16* %10
%170 = sext i16 %169 to i32
%171 = sub nsw i32 %170, 1
%172 = sdiv i32 %171, 4
%173 = mul nsw i32 4, %172
%174 = add nsw i32 %173, 4
%175 = load i16, i16* %10
%176 = sext i16 %175 to i32
%177 = sub nsw i32 %176, 1
%178 = srem i32 %177, 4
%179 = sub nsw i32 %174, %178
br label %181
180: ; preds = %162
br label %181
181: ; preds = %180, %168
%182 = phi i32 [ %179, %168 ], [ 0, %180 ]
%183 = trunc i32 %182 to i16
store i16 %183, i16* %10
%184 = load i16, i16* %11
%185 = sext i16 %184 to i32
%186 = icmp ne i32 %185, 0
br i1 %186, label %187, label %199
187: ; preds = %181
%188 = load i16, i16* %11
%189 = sext i16 %188 to i32
%190 = sub nsw i32 %189, 1
%191 = sdiv i32 %190, 4
%192 = mul nsw i32 4, %191
%193 = add nsw i32 %192, 4
%194 = load i16, i16* %11
%195 = sext i16 %194 to i32
%196 = sub nsw i32 %195, 1
%197 = srem i32 %196, 4
%198 = sub nsw i32 %193, %197
br label %200
199: ; preds = %181
br label %200
200: ; preds = %199, %187
%201 = phi i32 [ %198, %187 ], [ 0, %199 ]
%202 = trunc i32 %201 to i16
store i16 %202, i16* %11
%203 = load i16, i16* %12
%204 = sext i16 %203 to i32
%205 = icmp ne i32 %204, 0
br i1 %205, label %206, label %218
206: ; preds = %200
%207 = load i16, i16* %12
%208 = sext i16 %207 to i32
%209 = sub nsw i32 %208, 1
%210 = sdiv i32 %209, 4
%211 = mul nsw i32 4, %210
%212 = add nsw i32 %211, 4
%213 = load i16, i16* %12
%214 = sext i16 %213 to i32
%215 = sub nsw i32 %214, 1
%216 = srem i32 %215, 4
%217 = sub nsw i32 %212, %216
br label %219
218: ; preds = %200
br label %219
219: ; preds = %218, %206
%220 = phi i32 [ %217, %206 ], [ 0, %218 ]
%221 = trunc i32 %220 to i16
store i16 %221, i16* %12
%222 = load i16, i16* %13
%223 = sext i16 %222 to i32
%224 = icmp ne i32 %223, 0
br i1 %224, label %225, label %237
225: ; preds = %219
%226 = load i16, i16* %13
%227 = sext i16 %226 to i32
%228 = sub nsw i32 %227, 1
%229 = sdiv i32 %228, 4
%230 = mul nsw i32 4, %229
%231 = add nsw i32 %230, 4
%232 = load i16, i16* %13
%233 = sext i16 %232 to i32
%234 = sub nsw i32 %233, 1
%235 = srem i32 %234, 4
%236 = sub nsw i32 %231, %235
br label %238
237: ; preds = %219
br label %238
238: ; preds = %237, %225
%239 = phi i32 [ %236, %225 ], [ 0, %237 ]
%240 = trunc i32 %239 to i16
store i16 %240, i16* %13
%241 = load i16, i16* %14
%242 = sext i16 %241 to i32
%243 = icmp ne i32 %242, 0
br i1 %243, label %244, label %256
244: ; preds = %238
%245 = load i16, i16* %14
%246 = sext i16 %245 to i32
%247 = sub nsw i32 %246, 1
%248 = sdiv i32 %247, 4
%249 = mul nsw i32 4, %248
%250 = add nsw i32 %249, 4
%251 = load i16, i16* %14
%252 = sext i16 %251 to i32
%253 = sub nsw i32 %252, 1
%254 = srem i32 %253, 4
%255 = sub nsw i32 %250, %254
br label %257
256: ; preds = %238
br label %257
257: ; preds = %256, %244
%258 = phi i32 [ %255, %244 ], [ 0, %256 ]
%259 = trunc i32 %258 to i16
store i16 %259, i16* %14
%260 = load i16, i16* %15
%261 = sext i16 %260 to i32
%262 = icmp ne i32 %261, 0
br i1 %262, label %263, label %275
263: ; preds = %257
%264 = load i16, i16* %15
%265 = sext i16 %264 to i32
%266 = sub nsw i32 %265, 1
%267 = sdiv i32 %266, 4
%268 = mul nsw i32 4, %267
%269 = add nsw i32 %268, 4
%270 = load i16, i16* %15
%271 = sext i16 %270 to i32
%272 = sub nsw i32 %271, 1
%273 = srem i32 %272, 4
%274 = sub nsw i32 %269, %273
br label %276
275: ; preds = %257
br label %276
276: ; preds = %275, %263
%277 = phi i32 [ %274, %263 ], [ 0, %275 ]
%278 = trunc i32 %277 to i16
store i16 %278, i16* %15
store i64 0, i64* %4
%279 = load i16, i16* %8
%280 = sext i16 %279 to i64
%281 = load i64, i64* %4
%282 = or i64 %281, %280
store i64 %282, i64* %4
%283 = load i64, i64* %4
%284 = shl i64 %283, 5
store i64 %284, i64* %4
%285 = load i16, i16* %9
%286 = sext i16 %285 to i64
%287 = load i64, i64* %4
%288 = or i64 %287, %286
store i64 %288, i64* %4
%289 = load i64, i64* %4
%290 = shl i64 %289, 5
store i64 %290, i64* %4
%291 = load i16, i16* %10
%292 = sext i16 %291 to i64
%293 = load i64, i64* %4
%294 = or i64 %293, %292
store i64 %294, i64* %4
%295 = load i64, i64* %4
%296 = shl i64 %295, 5
store i64 %296, i64* %4
%297 = load i16, i16* %11
%298 = sext i16 %297 to i64
%299 = load i64, i64* %4
%300 = or i64 %299, %298
store i64 %300, i64* %4
%301 = load i64, i64* %4
%302 = shl i64 %301, 5
store i64 %302, i64* %4
%303 = load i16, i16* %12
%304 = sext i16 %303 to i64
%305 = load i64, i64* %4
%306 = or i64 %305, %304
store i64 %306, i64* %4
%307 = load i64, i64* %4
%308 = shl i64 %307, 5
store i64 %308, i64* %4
%309 = load i16, i16* %13
%310 = sext i16 %309 to i64
%311 = load i64, i64* %4
%312 = or i64 %311, %310
store i64 %312, i64* %4
%313 = load i64, i64* %4
%314 = shl i64 %313, 5
store i64 %314, i64* %4
%315 = load i16, i16* %14
%316 = sext i16 %315 to i64
%317 = load i64, i64* %4
%318 = or i64 %317, %316
store i64 %318, i64* %4
%319 = load i64, i64* %4
%320 = shl i64 %319, 5
store i64 %320, i64* %4
%321 = load i16, i16* %15
%322 = sext i16 %321 to i64
%323 = load i64, i64* %4
%324 = or i64 %323, %322
store i64 %324, i64* %4
br label %325
325: ; preds = %276, %121, %116, %112, %108, %104, %100
%326 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%327 = load i64, i64* %4
%328 = load i16, i16* %5
%329 = call i32 @sprintf(i8* %326, i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0), i64 %327, i16 signext %328)
%330 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%331 = load i32*, i32** %6
%332 = call i32 @query_has_result(i8* %330, i32* %331)
ret i32 %332
}

LLVM IR (-O2):
@.str = [69 x i8] c"SELECT position FROM positions WHERE position = %ld AND count = %hi;\00"
define i32 @position_and_count_exist_in_database(i64 %0, i16 signext %1, i32* %2) {
%4 = alloca [100 x i8]
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%6 = trunc i64 %0 to i32
%7 = and i32 %6, 31
%8 = lshr i32 %6, 5
%9 = and i32 %8, 31
%10 = lshr i32 %6, 10
%11 = and i32 %10, 31
%12 = lshr i32 %6, 15
%13 = and i32 %12, 31
%14 = lshr i64 %0, 20
%15 = trunc i64 %14 to i16
%16 = and i16 %15, 31
%17 = lshr i64 %0, 25
%18 = trunc i64 %17 to i16
%19 = and i16 %18, 31
%20 = lshr i64 %0, 30
%21 = trunc i64 %20 to i16
%22 = and i16 %21, 31
%23 = lshr i64 %0, 35
%24 = trunc i64 %23 to i32
%25 = and i32 %24, 31
%26 = icmp eq i32 %25, 0
br i1 %26, label %31, label %27
27: ; preds = %3
%28 = and i32 %24, 3
%29 = add nsw i32 %28, -1
%30 = icmp ult i32 %29, 2
br i1 %30, label %38, label %60
31: ; preds = %3
%32 = icmp eq i16 %22, 0
br i1 %32, label %41, label %33
33: ; preds = %31
%34 = trunc i64 %20 to i32
%35 = and i32 %34, 3
%36 = add nsw i32 %35, -1
%37 = icmp ult i32 %36, 2
br i1 %37, label %38, label %72
38: ; preds = %33, %27
%39 = icmp eq i16 %22, 0
%40 = and i1 %26, %39
br label %48
41: ; preds = %31
%42 = icmp eq i16 %19, 0
br i1 %42, label %48, label %43
43: ; preds = %41
%44 = trunc i64 %17 to i32
%45 = and i32 %44, 3
%46 = add nsw i32 %45, -1
%47 = icmp ult i32 %46, 2
br i1 %47, label %166, label %85
48: ; preds = %38, %41
%49 = phi i1 [ %40, %38 ], [ true, %41 ]
%50 = icmp eq i16 %19, 0
%51 = and i1 %50, %49
%52 = icmp ne i16 %16, 0
%53 = and i1 %52, %51
br i1 %53, label %54, label %166
54: ; preds = %48
%55 = trunc i64 %14 to i32
%56 = and i32 %55, 3
%57 = add nsw i32 %56, -1
%58 = icmp ult i32 %57, 2
br i1 %58, label %166, label %59
59: ; preds = %54
br i1 %26, label %69, label %60
60: ; preds = %27, %59
%61 = add nsw i32 %25, -1
%62 = and i32 %61, 252
%63 = add nuw nsw i32 %62, 4
%64 = and i32 %61, 3
%65 = sub nuw nsw i32 %63, %64
%66 = shl nuw nsw i32 %65, 5
%67 = and i32 %66, 2097120
%68 = zext i32 %67 to i64
br label %69
69: ; preds = %59, %60
%70 = phi i64 [ %68, %60 ], [ 0, %59 ]
%71 = icmp eq i16 %22, 0
br i1 %71, label %81, label %72
72: ; preds = %33, %69
%73 = phi i64 [ %70, %69 ], [ 0, %33 ]
%74 = zext i16 %22 to i32
%75 = add nsw i32 %74, -1
%76 = and i32 %75, 252
%77 = add nuw nsw i32 %76, 4
%78 = and i32 %75, 3
%79 = sub nuw nsw i32 %77, %78
%80 = zext i32 %79 to i64
br label %81
81: ; preds = %69, %72
%82 = phi i64 [ %73, %72 ], [ %70, %69 ]
%83 = phi i64 [ %80, %72 ], [ 0, %69 ]
%84 = icmp eq i16 %19, 0
br i1 %84, label %97, label %85
85: ; preds = %43, %81
%86 = phi i64 [ %83, %81 ], [ 0, %43 ]
%87 = phi i64 [ %82, %81 ], [ 0, %43 ]
%88 = zext i16 %19 to i32
%89 = add nsw i32 %88, -1
%90 = and i32 %89, 252
%91 = add nuw nsw i32 %90, 4
%92 = and i32 %89, 3
%93 = sub nuw nsw i32 %91, %92
%94 = shl nuw nsw i32 %93, 5
%95 = and i32 %94, 2097120
%96 = zext i32 %95 to i64
br label %97
97: ; preds = %81, %85
%98 = phi i64 [ %86, %85 ], [ %83, %81 ]
%99 = phi i64 [ %87, %85 ], [ %82, %81 ]
%100 = phi i64 [ %96, %85 ], [ 0, %81 ]
%101 = icmp eq i16 %16, 0
br i1 %101, label %110, label %102
102: ; preds = %97
%103 = zext i16 %16 to i32
%104 = add nsw i32 %103, -1
%105 = and i32 %104, 252
%106 = add nuw nsw i32 %105, 4
%107 = and i32 %104, 3
%108 = sub nuw nsw i32 %106, %107
%109 = zext i32 %108 to i64
br label %110
110: ; preds = %97, %102
%111 = phi i64 [ %109, %102 ], [ 0, %97 ]
%112 = icmp eq i32 %13, 0
br i1 %112, label %122, label %113
113: ; preds = %110
%114 = add nsw i32 %13, -1
%115 = and i32 %114, 252
%116 = add nuw nsw i32 %115, 4
%117 = and i32 %114, 3
%118 = sub nuw nsw i32 %116, %117
%119 = shl nuw nsw i32 %118, 5
%120 = and i32 %119, 2097120
%121 = zext i32 %120 to i64
br label %122
122: ; preds = %110, %113
%123 = phi i64 [ %121, %113 ], [ 0, %110 ]
%124 = icmp eq i32 %11, 0
br i1 %124, label %132, label %125
125: ; preds = %122
%126 = add nsw i32 %11, -1
%127 = and i32 %126, 252
%128 = add nuw nsw i32 %127, 4
%129 = and i32 %126, 3
%130 = sub nuw nsw i32 %128, %129
%131 = zext i32 %130 to i64
br label %132
132: ; preds = %122, %125
%133 = phi i64 [ %131, %125 ], [ 0, %122 ]
%134 = icmp eq i32 %9, 0
br i1 %134, label %144, label %135
135: ; preds = %132
%136 = add nsw i32 %9, -1
%137 = and i32 %136, 252
%138 = add nuw nsw i32 %137, 4
%139 = and i32 %136, 3
%140 = sub nuw nsw i32 %138, %139
%141 = shl nuw nsw i32 %140, 5
%142 = and i32 %141, 2097120
%143 = zext i32 %142 to i64
br label %144
144: ; preds = %132, %135
%145 = phi i64 [ %143, %135 ], [ 0, %132 ]
%146 = icmp eq i32 %7, 0
br i1 %146, label %154, label %147
147: ; preds = %144
%148 = add nsw i32 %7, -1
%149 = and i32 %148, 252
%150 = add nuw nsw i32 %149, 4
%151 = and i32 %148, 3
%152 = sub nuw nsw i32 %150, %151
%153 = zext i32 %152 to i64
br label %154
154: ; preds = %144, %147
%155 = phi i64 [ %153, %147 ], [ 0, %144 ]
%156 = or i64 %99, %98
%157 = shl nuw nsw i64 %156, 10
%158 = or i64 %157, %100
%159 = or i64 %158, %111
%160 = shl nuw nsw i64 %159, 10
%161 = or i64 %123, %160
%162 = or i64 %161, %133
%163 = shl i64 %162, 10
%164 = or i64 %145, %163
%165 = or i64 %164, %155
br label %166
166: ; preds = %43, %54, %154, %48
%167 = phi i64 [ %165, %154 ], [ %0, %48 ], [ %0, %54 ], [ %0, %43 ]
%168 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0), i64 %167, i16 signext %1)
%169 = call i32 @query_has_result(i8* %5, i32* %2)
ret i32 %169
}