#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 */
int /*<<< orphan*/ printf(char *, int, int);
int dump_arrays(int primes[], int divisor_cnt[]) {
  for (int i = 0; i < 16384; i++) {
    if (divisor_cnt[i] > 0)
      printf("%d %d\n", primes[i], divisor_cnt[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<dump_arrays>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x4000,-0x14(%rbp)
jge    117b <dump_arrays+0x6b>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jle    1168 <dump_arrays+0x58>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
jmp    116d <dump_arrays+0x5d>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <dump_arrays+0x17>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_arrays>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r12
mov    %rdi,%r14
xor    %ebx,%ebx
lea    0xed9(%rip),%r15
jmp    113d <dump_arrays+0x2d>
nopl   0x0(%rax)
add    $0x1,%rbx
cmp    $0x4000,%rbx
je     1153 <dump_arrays+0x43>
mov    (%r12,%rbx,4),%edx
test   %edx,%edx
jle    1130 <dump_arrays+0x20>
mov    (%r14,%rbx,4),%esi
mov    %r15,%rdi
call   1030 <printf@plt>
jmp    1130 <dump_arrays+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @dump_arrays(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
store i32 0, i32* %5
br label %6
6: ; preds = %29, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 16384
br i1 %8, label %9, label %32
9: ; preds = %6
%10 = load i32*, i32** %4
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %10, i64 %12
%14 = load i32, i32* %13
%15 = icmp sgt i32 %14, 0
br i1 %15, label %16, label %28
16: ; preds = %9
%17 = load i32*, i32** %3
%18 = load i32, i32* %5
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %17, i64 %19
%21 = load i32, i32* %20
%22 = load i32*, i32** %4
%23 = load i32, i32* %5
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i32, i32* %22, i64 %24
%26 = load i32, i32* %25
%27 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %21, i32 %26)
br label %28
28: ; preds = %16, %9
br label %29
29: ; preds = %28
%30 = load i32, i32* %5
%31 = add nsw i32 %30, 1
store i32 %31, i32* %5
br label %6
32: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @dump_arrays(i32* nocapture %0, i32* nocapture %1) {
br label %4
3: ; preds = %13
ret i32 0
4: ; preds = %2, %13
%5 = phi i64 [ 0, %2 ], [ %14, %13 ]
%6 = getelementptr inbounds i32, i32* %1, i64 %5
%7 = load i32, i32* %6
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %4
%10 = getelementptr inbounds i32, i32* %0, i64 %5
%11 = load i32, i32* %10
%12 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %7)
br label %13
13: ; preds = %4, %9
%14 = add nuw nsw i64 %5, 1
%15 = icmp eq i64 %14, 16384
br i1 %15, label %3, label %4
}