#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 */
bool divisible(size_t num) {
  double res;
  size_t i;
  for (i = 1; i <= 20; ++i) {
    res = num / (double)i;
    if (res != (size_t)res) {
      return false;
    }
  }
  return true;
}


x86 assembly (clang, -O0):
<divisible>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movq   $0x1,-0x20(%rbp)
cmpq   $0x14,-0x20(%rbp)
ja     11e0 <divisible+0xe0>
movq   -0x10(%rbp),%xmm0
movaps 0xed9(%rip),%xmm3
punpckldq %xmm3,%xmm0
movapd 0xedd(%rip),%xmm2
subpd  %xmm2,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movq   -0x20(%rbp),%xmm1
punpckldq %xmm3,%xmm1
subpd  %xmm2,%xmm1
movaps %xmm1,%xmm4
unpckhpd %xmm1,%xmm1
addsd  %xmm4,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xeb0(%rip),%xmm4
movaps %xmm0,%xmm1
subsd  %xmm4,%xmm1
cvttsd2si %xmm1,%rcx
movaps %xmm0,%xmm1
cvttsd2si %xmm1,%rax
mov    %rax,%rdx
sar    $0x3f,%rdx
and    %rdx,%rcx
or     %rcx,%rax
movq   %rax,%xmm1
punpckldq %xmm3,%xmm1
subpd  %xmm2,%xmm1
movaps %xmm1,%xmm2
unpckhpd %xmm1,%xmm1
addsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jne    11be <divisible+0xbe>
jp     11be <divisible+0xbe>
jmp    11ca <divisible+0xca>
movl   $0x0,-0x4(%rbp)
jmp    11e7 <divisible+0xe7>
jmp    11cf <divisible+0xcf>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1110 <divisible+0x10>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<divisible>:
movq   %rdi,%xmm1
punpckldq 0xef3(%rip),%xmm1
subpd  0xefb(%rip),%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
addsd  %xmm1,%xmm0
mov    $0x1,%ecx
movdqa 0xed2(%rip),%xmm1
movapd 0xeda(%rip),%xmm2
movsd  0xee2(%rip),%xmm3
xchg   %ax,%ax
movq   %rcx,%xmm4
punpckldq %xmm1,%xmm4
subpd  %xmm2,%xmm4
movapd %xmm4,%xmm5
unpckhpd %xmm4,%xmm5
addsd  %xmm4,%xmm5
movapd %xmm0,%xmm4
divsd  %xmm5,%xmm4
cvttsd2si %xmm4,%rax
mov    %rax,%rdx
sar    $0x3f,%rdx
movapd %xmm4,%xmm5
subsd  %xmm3,%xmm5
cvttsd2si %xmm5,%rsi
and    %rdx,%rsi
or     %rax,%rsi
movq   %rsi,%xmm5
punpckldq %xmm1,%xmm5
subpd  %xmm2,%xmm5
movapd %xmm5,%xmm6
unpckhpd %xmm5,%xmm6
addsd  %xmm5,%xmm6
xor    %eax,%eax
ucomisd %xmm6,%xmm4
jne    121b <divisible+0x11b>
jp     121b <divisible+0x11b>
add    $0x1,%rcx
movq   %rcx,%xmm4
punpckldq %xmm1,%xmm4
subpd  %xmm2,%xmm4
movapd %xmm4,%xmm5
unpckhpd %xmm4,%xmm5
addsd  %xmm4,%xmm5
movapd %xmm0,%xmm4
divsd  %xmm5,%xmm4
cvttsd2si %xmm4,%rdx
mov    %rdx,%rsi
sar    $0x3f,%rsi
movapd %xmm4,%xmm5
subsd  %xmm3,%xmm5
cvttsd2si %xmm5,%rdi
and    %rsi,%rdi
or     %rdx,%rdi
movq   %rdi,%xmm5
punpckldq %xmm1,%xmm5
subpd  %xmm2,%xmm5
movapd %xmm5,%xmm6
unpckhpd %xmm5,%xmm6
addsd  %xmm5,%xmm6
ucomisd %xmm6,%xmm4
jne    121b <divisible+0x11b>
jp     121b <divisible+0x11b>
add    $0x1,%rcx
cmp    $0x15,%rcx
jne    1140 <divisible+0x40>
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @divisible(i64 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca double
%5 = alloca i64
store i64 %0, i64* %3
store i64 1, i64* %5
br label %6
6: ; preds = %22, %1
%7 = load i64, i64* %5
%8 = icmp ule i64 %7, 20
br i1 %8, label %9, label %25
9: ; preds = %6
%10 = load i64, i64* %3
%11 = uitofp i64 %10 to double
%12 = load i64, i64* %5
%13 = uitofp i64 %12 to double
%14 = fdiv double %11, %13
store double %14, double* %4
%15 = load double, double* %4
%16 = load double, double* %4
%17 = fptoui double %16 to i64
%18 = uitofp i64 %17 to double
%19 = fcmp une double %15, %18
br i1 %19, label %20, label %21
20: ; preds = %9
store i32 0, i32* %2
br label %26
21: ; preds = %9
br label %22
22: ; preds = %21
%23 = load i64, i64* %5
%24 = add i64 %23, 1
store i64 %24, i64* %5
br label %6
25: ; preds = %6
store i32 1, i32* %2
br label %26
26: ; preds = %25, %20
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @divisible(i64 %0) {
%2 = uitofp i64 %0 to double
br label %13
3: ; preds = %13
%4 = add nuw nsw i64 %14, 1
%5 = uitofp i64 %4 to double
%6 = fdiv double %2, %5
%7 = fptoui double %6 to i64
%8 = uitofp i64 %7 to double
%9 = fcmp une double %6, %8
br i1 %9, label %20, label %10
10: ; preds = %3
%11 = add nuw nsw i64 %14, 2
%12 = icmp eq i64 %11, 21
br i1 %12, label %20, label %13
13: ; preds = %10, %1
%14 = phi i64 [ 1, %1 ], [ %11, %10 ]
%15 = uitofp i64 %14 to double
%16 = fdiv double %2, %15
%17 = fptoui double %16 to i64
%18 = uitofp i64 %17 to double
%19 = fcmp une double %16, %18
br i1 %19, label %20, label %3
20: ; preds = %10, %3, %13
%21 = phi i32 [ 0, %13 ], [ 0, %3 ], [ 1, %10 ]
ret i32 %21
}