int divides(int number) {
  int divisor = 20;
  int i = 2;
  while (i < divisor && number % i == 0) {
    i++;
  }
  if (i == divisor && i % divisor == 0)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<divides>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
movl   $0x2,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
xor    %eax,%eax
cmp    -0xc(%rbp),%ecx
mov    %al,-0x11(%rbp)
jge    1136 <divides+0x36>
mov    -0x8(%rbp),%eax
cltd
idivl  -0x10(%rbp)
cmp    $0x0,%edx
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1146 <divides+0x46>
jmp    1154 <divides+0x54>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1115 <divides+0x15>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    117c <divides+0x7c>
mov    -0x10(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    117c <divides+0x7c>
movl   $0x0,-0x4(%rbp)
jmp    1183 <divides+0x83>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<divides>:
push   %rbp
push   %r15
push   %r14
push   %rbx
movslq %edi,%rcx
and    $0x1,%edi
imul   $0x55555556,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rax
add    %edx,%eax
lea    (%rax,%rax,2),%eax
mov    %ecx,%edx
sub    %eax,%edx
mov    %ecx,%eax
and    $0x3,%eax
or     %edi,%eax
or     %edx,%eax
imul   $0x66666667,%rcx,%r11
mov    %r11,%rdi
shr    $0x20,%rdi
mov    %edi,%edx
sar    %edx
shr    $0x3f,%r11
add    %r11d,%edx
lea    (%rdx,%rdx,4),%edx
mov    %ecx,%esi
sub    %edx,%esi
or     %eax,%esi
imul   $0x2aaaaaab,%rcx,%r14
mov    %r14,%r10
shr    $0x3f,%r10
mov    %r14,%rax
shr    $0x20,%rax
add    %r10d,%eax
add    %eax,%eax
lea    (%rax,%rax,2),%ebx
mov    %ecx,%eax
sub    %ebx,%eax
or     %esi,%eax
imul   $0xffffffff92492493,%rcx,%rsi
shr    $0x20,%rsi
add    %ecx,%esi
mov    %esi,%ebx
sar    $0x2,%ebx
mov    %esi,%r9d
shr    $0x1f,%r9d
add    %r9d,%ebx
lea    0x0(,%rbx,8),%edx
sub    %edx,%ebx
add    %ecx,%ebx
or     %eax,%ebx
mov    %ecx,%edx
and    $0x7,%edx
imul   $0x38e38e39,%rcx,%r15
mov    %r15,%rax
shr    $0x20,%rax
sar    %eax
mov    %r15,%r8
shr    $0x3f,%r8
add    %r8d,%eax
lea    (%rax,%rax,8),%eax
mov    %ecx,%ebp
sub    %eax,%ebp
or     %edx,%ebp
sar    $0x2,%edi
add    %r11d,%edi
add    %edi,%edi
lea    (%rdi,%rdi,4),%eax
mov    %ecx,%edx
sub    %eax,%edx
or     %ebp,%edx
imul   $0x2e8ba2e9,%rcx,%rax
mov    %rax,%rdi
shr    $0x3f,%rdi
shr    $0x20,%rax
sar    %eax
add    %edi,%eax
lea    (%rax,%rax,4),%edi
lea    (%rax,%rdi,2),%eax
mov    %ecx,%edi
sub    %eax,%edi
or     %edx,%edi
or     %ebx,%edi
shr    $0x21,%r14
add    %r10d,%r14d
shl    $0x2,%r14d
lea    (%r14,%r14,2),%eax
mov    %ecx,%edx
sub    %eax,%edx
imul   $0x4ec4ec4f,%rcx,%rax
mov    %rax,%rbp
shr    $0x3f,%rbp
shr    $0x20,%rax
sar    $0x2,%eax
add    %ebp,%eax
lea    (%rax,%rax,2),%ebp
lea    (%rax,%rbp,4),%eax
mov    %ecx,%ebp
sub    %eax,%ebp
or     %edx,%ebp
sar    $0x3,%esi
add    %r9d,%esi
mov    %esi,%eax
shl    $0x4,%eax
mov    %esi,%edx
sub    %eax,%edx
add    %esi,%edx
add    %ecx,%edx
or     %ebp,%edx
or     %edi,%edx
imul   $0xffffffff88888889,%rcx,%rax
shr    $0x20,%rax
add    %ecx,%eax
mov    %eax,%esi
shr    $0x1f,%esi
sar    $0x3,%eax
add    %esi,%eax
lea    (%rax,%rax,4),%eax
lea    (%rax,%rax,2),%eax
mov    %ecx,%esi
sub    %eax,%esi
mov    %ecx,%eax
and    $0xf,%eax
or     %esi,%eax
imul   $0x78787879,%rcx,%rsi
mov    %rsi,%rdi
shr    $0x3f,%rdi
sar    $0x23,%rsi
add    %edi,%esi
mov    %esi,%edi
shl    $0x4,%edi
add    %esi,%edi
mov    %ecx,%esi
sub    %edi,%esi
or     %eax,%esi
sar    $0x22,%r15
add    %r8d,%r15d
add    %r15d,%r15d
lea    (%r15,%r15,8),%eax
mov    %ecx,%edi
sub    %eax,%edi
or     %esi,%edi
or     %edx,%edi
imul   $0x6bca1af3,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rax
add    %edx,%eax
lea    (%rax,%rax,8),%edx
lea    (%rax,%rdx,2),%eax
sub    %eax,%ecx
xor    %eax,%eax
or     %edi,%ecx
setne  %al
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @divides(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 20, i32* %4
store i32 2, i32* %5
br label %6
6: ; preds = %17, %1
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load i32, i32* %3
%12 = load i32, i32* %5
%13 = srem i32 %11, %12
%14 = icmp eq i32 %13, 0
br label %15
15: ; preds = %10, %6
%16 = phi i1 [ false, %6 ], [ %14, %10 ]
br i1 %16, label %17, label %20
17: ; preds = %15
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %15
%21 = load i32, i32* %5
%22 = load i32, i32* %4
%23 = icmp eq i32 %21, %22
br i1 %23, label %24, label %30
24: ; preds = %20
%25 = load i32, i32* %5
%26 = load i32, i32* %4
%27 = srem i32 %25, %26
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %30
29: ; preds = %24
store i32 0, i32* %2
br label %31
30: ; preds = %24, %20
store i32 1, i32* %2
br label %31
31: ; preds = %30, %29
%32 = load i32, i32* %2
ret i32 %32
}

LLVM IR (-O2):
define i32 @divides(i32 %0) {
%2 = and i32 %0, 1
%3 = srem i32 %0, 3
%4 = or i32 %2, %3
%5 = and i32 %0, 3
%6 = or i32 %4, %5
%7 = srem i32 %0, 5
%8 = or i32 %6, %7
%9 = srem i32 %0, 6
%10 = or i32 %8, %9
%11 = srem i32 %0, 7
%12 = or i32 %10, %11
%13 = and i32 %0, 7
%14 = or i32 %12, %13
%15 = srem i32 %0, 9
%16 = or i32 %14, %15
%17 = srem i32 %0, 10
%18 = or i32 %16, %17
%19 = srem i32 %0, 11
%20 = or i32 %18, %19
%21 = srem i32 %0, 12
%22 = or i32 %20, %21
%23 = srem i32 %0, 13
%24 = or i32 %22, %23
%25 = srem i32 %0, 14
%26 = or i32 %24, %25
%27 = srem i32 %0, 15
%28 = or i32 %26, %27
%29 = and i32 %0, 15
%30 = or i32 %28, %29
%31 = srem i32 %0, 17
%32 = or i32 %30, %31
%33 = srem i32 %0, 18
%34 = or i32 %32, %33
%35 = srem i32 %0, 19
%36 = or i32 %34, %35
%37 = icmp ne i32 %36, 0
%38 = zext i1 %37 to i32
ret i32 %38
}