#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 */
scalar_t__ divisible(size_t);
int /*<<< orphan*/ printf(char *, size_t, ...);
int main(int argc, char **argv) {
  size_t i;
  for (i = 20;; i += 2) {
    if (divisible(i)) {
      printf("Found number: %zu\n", i);
      size_t found = i;
      for (i = 1; i <= 20; ++i)
        printf("\t%zu / %02zu = %lf\n", found, i, found / (double)i);
      break;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x14,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <divisible@plt>
cmp    $0x0,%rax
je     11ed <main+0xcd>
mov    -0x18(%rbp),%rsi
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
movq   $0x1,-0x18(%rbp)
cmpq   $0x14,-0x18(%rbp)
ja     11e8 <main+0xc8>
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
movq   %rsi,%xmm0
movaps 0xe6e(%rip),%xmm3
punpckldq %xmm3,%xmm0
movapd 0xe72(%rip),%xmm2
subpd  %xmm2,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movq   %rdx,%xmm1
punpckldq %xmm3,%xmm1
subpd  %xmm2,%xmm1
movaps %xmm1,%xmm2
unpckhpd %xmm1,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
lea    0xe63(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1173 <main+0x53>
jmp    1203 <main+0xe3>
jmp    11f2 <main+0xd2>
mov    -0x18(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x18(%rbp)
jmp    113e <main+0x1e>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    $0x12,%r14d
nop
add    $0x2,%r14
mov    %r14,%rdi
call   1040 <divisible@plt>
test   %rax,%rax
je     1130 <main+0x10>
lea    0xed8(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
movq   %r14,%xmm0
punpckldq 0xea1(%rip),%xmm0
subpd  0xea9(%rip),%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
addsd  %xmm0,%xmm1
movapd %xmm1,(%rsp)
mov    $0x1,%ebx
lea    0xeaf(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movq   %rbx,%xmm0
punpckldq 0xe63(%rip),%xmm0
subpd  0xe6b(%rip),%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
addsd  %xmm0,%xmm1
movapd (%rsp),%xmm0
divsd  %xmm1,%xmm0
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    $0x15,%rbx
jne    1190 <main+0x70>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Found number: %zu\0A\00"
@.str.1 = [20 x i8] c"\09%zu / %02zu = %lf\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 20, i64* %6
br label %8
8: ; preds = %33, %2
%9 = load i64, i64* %6
%10 = call i64 @divisible(i64 %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %32
12: ; preds = %8
%13 = load i64, i64* %6
%14 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i64 %13)
%15 = load i64, i64* %6
store i64 %15, i64* %7
store i64 1, i64* %6
br label %16
16: ; preds = %28, %12
%17 = load i64, i64* %6
%18 = icmp ule i64 %17, 20
br i1 %18, label %19, label %31
19: ; preds = %16
%20 = load i64, i64* %7
%21 = load i64, i64* %6
%22 = load i64, i64* %7
%23 = uitofp i64 %22 to double
%24 = load i64, i64* %6
%25 = uitofp i64 %24 to double
%26 = fdiv double %23, %25
%27 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i64 %20, i64 %21, double %26)
br label %28
28: ; preds = %19
%29 = load i64, i64* %6
%30 = add i64 %29, 1
store i64 %30, i64* %6
br label %16
31: ; preds = %16
br label %36
32: ; preds = %8
br label %33
33: ; preds = %32
%34 = load i64, i64* %6
%35 = add i64 %34, 2
store i64 %35, i64* %6
br label %8
36: ; preds = %31
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"Found number: %zu\0A\00"
@.str.1 = [20 x i8] c"\09%zu / %02zu = %lf\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ 20, %2 ], [ %7, %3 ]
%5 = tail call i64 @divisible(i64 %4)
%6 = icmp eq i64 %5, 0
%7 = add i64 %4, 2
br i1 %6, label %3, label %8
8: ; preds = %3
%9 = tail call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i64 %4)
%10 = uitofp i64 %4 to double
br label %11
11: ; preds = %8, %11
%12 = phi i64 [ 1, %8 ], [ %16, %11 ]
%13 = uitofp i64 %12 to double
%14 = fdiv double %10, %13
%15 = tail call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i64 %4, i64 %12, double %14)
%16 = add nuw nsw i64 %12, 1
%17 = icmp eq i64 %16, 21
br i1 %17, label %18, label %11
18: ; preds = %11
ret i32 0
}