#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 *calloc(int, int);
int floor(double);
int ipow(int, int);
double log_poisson_d(int, int);
int /*<<< orphan*/ printf(char *, ...);
double random_maker();
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ seed(int);
int main() {
  int random_seed, i, j, which_box, dimensions, points, number, box_num,
      side_num, box_count, poisson_boxes;
  double box_size, rn;
  int *histogram, *boxes;
  printf("What is the number of dimensions?\n");
  scanf("%d", &dimensions);
  printf("What is the number of points?\n");
  scanf("%d", &points);
  printf("How many minihypercubes per side length?\n");
  scanf("%d", &side_num);
  box_size = 1 / side_num;
  printf("What is the random seed? Provide a 32 bit integer\n");
  scanf("%d", &random_seed);
  seed(random_seed);
  number = ipow(side_num, dimensions);
  printf("\nThis is how many mini-hypercubes you have: %d \n", number);
  printf("This is how many dimensions: %d \n", dimensions);
  printf("This is how many points: %d \n", points);
  boxes = calloc(number, sizeof(int));
  histogram = calloc(points + 1, sizeof(int));
  for (i = 0; i < 10; i++) {
    rn = random_maker();
  }
  for (i = 0; i < points; i++) {
    which_box = 0;
    rn = random_maker();
    which_box = floor(rn * number);
    boxes[which_box]++;
  }
  for (i = 0; i < number; i++) {
    box_count = boxes[i];
    histogram[box_count]++;
  }
  for (i = 0; i < points + 1; i++) {
    if (histogram[i] != 0) {
      printf("Points in box = %d, boxes with that number of points = %d \n", i,
             histogram[i]);
    }
  }
  int num_points_in_box, num_boxes_same_points, k, lambda;
  double result;
  for (i = 0; i < points + 1; i++) {
    if (histogram[i] != 0) {
      num_points_in_box = i;
      num_boxes_same_points = histogram[i];
      k = num_points_in_box;
      lambda = num_boxes_same_points;
      result = log_poisson_d(k, lambda);
      printf("Result = %f, points in box = %d, boxes with that number of "
             "points = %d \n",
             result, i, histogram[i]);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe6a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe7f(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1070 <scanf@plt>
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe61(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   1070 <scanf@plt>
lea    0xe73(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe43(%rip),%rdi
lea    -0x28(%rbp),%rsi
call   1070 <scanf@plt>
mov    $0x1,%eax
cltd
idivl  -0x28(%rbp)
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x38(%rbp)
lea    0xe6d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe13(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1070 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1050 <seed@plt>
mov    -0x28(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1080 <ipow@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%esi
lea    0xe69(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%edi
mov    $0x4,%esi
call   1060 <calloc@plt>
mov    %rax,-0x50(%rbp)
mov    -0x1c(%rbp),%edi
add    $0x1,%edi
mov    $0x4,%esi
call   1060 <calloc@plt>
mov    %rax,-0x48(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    12b2 <main+0x132>
mov    $0x0,%al
call   1090 <random_maker@plt>
movsd  %xmm0,-0x40(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    128e <main+0x10e>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    130d <main+0x18d>
movl   $0x0,-0x14(%rbp)
mov    $0x0,%al
call   1090 <random_maker@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
cvtsi2sdl -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   10a0 <floor@plt>
mov    %eax,-0x14(%rbp)
mov    -0x50(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
add    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    12b9 <main+0x139>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    134d <main+0x1cd>
mov    -0x50(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x48(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
add    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1314 <main+0x194>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x1c(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    13a6 <main+0x226>
mov    -0x48(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     1393 <main+0x213>
mov    -0xc(%rbp),%esi
mov    -0x48(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xd87(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1398 <main+0x218>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1354 <main+0x1d4>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x1c(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    1434 <main+0x2b4>
mov    -0x48(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     1421 <main+0x2a1>
mov    -0xc(%rbp),%eax
mov    %eax,-0x54(%rbp)
mov    -0x48(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x58(%rbp)
mov    -0x54(%rbp),%eax
mov    %eax,-0x5c(%rbp)
mov    -0x58(%rbp),%eax
mov    %eax,-0x60(%rbp)
mov    -0x5c(%rbp),%edi
mov    -0x60(%rbp),%esi
call   1030 <log_poisson_d@plt>
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
mov    -0xc(%rbp),%esi
mov    -0x48(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xd35(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
jmp    1426 <main+0x2a6>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    13ad <main+0x22d>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xf58(%rip),%rdi
call   1040 <puts@plt>
lea    0xe53(%rip),%rbx
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1080 <scanf@plt>
lea    0xf5a(%rip),%rdi
call   1040 <puts@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1080 <scanf@plt>
lea    0xf61(%rip),%rdi
call   1040 <puts@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1080 <scanf@plt>
lea    0xf71(%rip),%rdi
call   1040 <puts@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1080 <scanf@plt>
mov    0xc(%rsp),%edi
call   1060 <seed@plt>
mov    0x8(%rsp),%edi
mov    0x4(%rsp),%esi
call   1090 <ipow@plt>
mov    %eax,%r15d
lea    0xde0(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x4(%rsp),%esi
lea    0xdfd(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%rsp),%esi
lea    0xe0e(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r15d,%edi
mov    $0x4,%esi
call   1070 <calloc@plt>
mov    %rax,%rbx
mov    (%rsp),%edi
add    $0x1,%edi
mov    $0x4,%esi
call   1070 <calloc@plt>
mov    %rax,%r14
xor    %eax,%eax
call   10a0 <random_maker@plt>
xor    %eax,%eax
call   10a0 <random_maker@plt>
xor    %eax,%eax
call   10a0 <random_maker@plt>
xor    %eax,%eax
call   10a0 <random_maker@plt>
xor    %eax,%eax
call   10a0 <random_maker@plt>
xor    %eax,%eax
call   10a0 <random_maker@plt>
xor    %eax,%eax
call   10a0 <random_maker@plt>
xor    %eax,%eax
call   10a0 <random_maker@plt>
xor    %eax,%eax
call   10a0 <random_maker@plt>
xor    %eax,%eax
call   10a0 <random_maker@plt>
mov    (%rsp),%eax
test   %eax,%eax
jle    12f2 <main+0x162>
xorps  %xmm0,%xmm0
cvtsi2sd %r15d,%xmm0
movsd  %xmm0,0x10(%rsp)
xor    %ebp,%ebp
nop
xor    %eax,%eax
call   10a0 <random_maker@plt>
mulsd  0x10(%rsp),%xmm0
call   10b0 <floor@plt>
cltq
addl   $0x1,(%rbx,%rax,4)
add    $0x1,%ebp
mov    (%rsp),%eax
cmp    %eax,%ebp
jl     12d0 <main+0x140>
test   %r15d,%r15d
jle    1372 <main+0x1e2>
mov    %r15d,%edx
lea    -0x1(%rdx),%rsi
mov    %edx,%ecx
and    $0x3,%ecx
cmp    $0x3,%rsi
jae    130d <main+0x17d>
xor    %esi,%esi
jmp    1350 <main+0x1c0>
and    $0xfffffffc,%edx
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movslq (%rbx,%rsi,4),%rdi
addl   $0x1,(%r14,%rdi,4)
movslq 0x4(%rbx,%rsi,4),%rdi
addl   $0x1,(%r14,%rdi,4)
movslq 0x8(%rbx,%rsi,4),%rdi
addl   $0x1,(%r14,%rdi,4)
movslq 0xc(%rbx,%rsi,4),%rdi
addl   $0x1,(%r14,%rdi,4)
add    $0x4,%rsi
cmp    %rsi,%rdx
jne    1320 <main+0x190>
test   %rcx,%rcx
je     1372 <main+0x1e2>
lea    (%rbx,%rsi,4),%rdx
xor    %esi,%esi
nopl   0x0(%rax,%rax,1)
movslq (%rdx,%rsi,4),%rdi
addl   $0x1,(%r14,%rdi,4)
add    $0x1,%rsi
cmp    %rsi,%rcx
jne    1360 <main+0x1d0>
test   %eax,%eax
js     1403 <main+0x273>
lea    0xcf3(%rip),%rbx
xor    %ebp,%ebp
jmp    139f <main+0x20f>
cs nopw 0x0(%rax,%rax,1)
nop
lea    0x1(%rbp),%rcx
movslq %eax,%rdx
cmp    %rdx,%rbp
mov    %rcx,%rbp
jge    13b8 <main+0x228>
mov    (%r14,%rbp,4),%edx
test   %edx,%edx
je     1390 <main+0x200>
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%rsp),%eax
jmp    1390 <main+0x200>
test   %eax,%eax
js     1403 <main+0x273>
xor    %ebp,%ebp
lea    0xceb(%rip),%r15
jmp    13df <main+0x24f>
nopw   0x0(%rax,%rax,1)
lea    0x1(%rbp),%rcx
movslq %eax,%rdx
cmp    %rdx,%rbp
mov    %rcx,%rbp
jge    1403 <main+0x273>
mov    (%r14,%rbp,4),%ebx
test   %ebx,%ebx
je     13d0 <main+0x240>
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <log_poisson_d@plt>
mov    %r15,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
mov    $0x1,%al
call   1050 <printf@plt>
mov    (%rsp),%eax
jmp    13d0 <main+0x240>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [35 x i8] c"What is the number of dimensions?\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [31 x i8] c"What is the number of points?\0A\00"
@.str.3 = [42 x i8] c"How many minihypercubes per side length?\0A\00"
@.str.4 = [51 x i8] c"What is the random seed? Provide a 32 bit integer\0A\00"
@.str.5 = [49 x i8] c"\0AThis is how many mini-hypercubes you have: %d \0A\00"
@.str.6 = [34 x i8] c"This is how many dimensions: %d \0A\00"
@.str.7 = [30 x i8] c"This is how many points: %d \0A\00"
@.str.8 = [60 x i8] c"Points in box = %d, boxes with that number of points = %d \0A\00"
@.str.9 = [73 x i8] c"Result = %f, points in box = %d, boxes with that number of points = %d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca double
%14 = alloca double
%15 = alloca i32*
%16 = alloca i32*
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca double
store i32 0, i32* %1
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%23 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%25 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0))
%27 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %10)
%28 = load i32, i32* %10
%29 = sdiv i32 1, %28
%30 = sitofp i32 %29 to double
store double %30, double* %13
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.4, i64 0, i64 0))
%32 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%33 = load i32, i32* %2
%34 = call i32 @seed(i32 %33)
%35 = load i32, i32* %10
%36 = load i32, i32* %6
%37 = call i32 @ipow(i32 %35, i32 %36)
store i32 %37, i32* %8
%38 = load i32, i32* %8
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.5, i64 0, i64 0), i32 %38)
%40 = load i32, i32* %6
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.6, i64 0, i64 0), i32 %40)
%42 = load i32, i32* %7
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.7, i64 0, i64 0), i32 %42)
%44 = load i32, i32* %8
%45 = call i32* @calloc(i32 %44, i32 4)
store i32* %45, i32** %16
%46 = load i32, i32* %7
%47 = add nsw i32 %46, 1
%48 = call i32* @calloc(i32 %47, i32 4)
store i32* %48, i32** %15
store i32 0, i32* %3
br label %49
49: ; preds = %54, %0
%50 = load i32, i32* %3
%51 = icmp slt i32 %50, 10
br i1 %51, label %52, label %57
52: ; preds = %49
%53 = call double (...) @random_maker()
store double %53, double* %14
br label %54
54: ; preds = %52
%55 = load i32, i32* %3
%56 = add nsw i32 %55, 1
store i32 %56, i32* %3
br label %49
57: ; preds = %49
store i32 0, i32* %3
br label %58
58: ; preds = %75, %57
%59 = load i32, i32* %3
%60 = load i32, i32* %7
%61 = icmp slt i32 %59, %60
br i1 %61, label %62, label %78
62: ; preds = %58
store i32 0, i32* %5
%63 = call double (...) @random_maker()
store double %63, double* %14
%64 = load double, double* %14
%65 = load i32, i32* %8
%66 = sitofp i32 %65 to double
%67 = fmul double %64, %66
%68 = call i32 @floor(double %67)
store i32 %68, i32* %5
%69 = load i32*, i32** %16
%70 = load i32, i32* %5
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds i32, i32* %69, i64 %71
%73 = load i32, i32* %72
%74 = add nsw i32 %73, 1
store i32 %74, i32* %72
br label %75
75: ; preds = %62
%76 = load i32, i32* %3
%77 = add nsw i32 %76, 1
store i32 %77, i32* %3
br label %58
78: ; preds = %58
store i32 0, i32* %3
br label %79
79: ; preds = %95, %78
%80 = load i32, i32* %3
%81 = load i32, i32* %8
%82 = icmp slt i32 %80, %81
br i1 %82, label %83, label %98
83: ; preds = %79
%84 = load i32*, i32** %16
%85 = load i32, i32* %3
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds i32, i32* %84, i64 %86
%88 = load i32, i32* %87
store i32 %88, i32* %11
%89 = load i32*, i32** %15
%90 = load i32, i32* %11
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds i32, i32* %89, i64 %91
%93 = load i32, i32* %92
%94 = add nsw i32 %93, 1
store i32 %94, i32* %92
br label %95
95: ; preds = %83
%96 = load i32, i32* %3
%97 = add nsw i32 %96, 1
store i32 %97, i32* %3
br label %79
98: ; preds = %79
store i32 0, i32* %3
br label %99
99: ; preds = %120, %98
%100 = load i32, i32* %3
%101 = load i32, i32* %7
%102 = add nsw i32 %101, 1
%103 = icmp slt i32 %100, %102
br i1 %103, label %104, label %123
104: ; preds = %99
%105 = load i32*, i32** %15
%106 = load i32, i32* %3
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds i32, i32* %105, i64 %107
%109 = load i32, i32* %108
%110 = icmp ne i32 %109, 0
br i1 %110, label %111, label %119
111: ; preds = %104
%112 = load i32, i32* %3
%113 = load i32*, i32** %15
%114 = load i32, i32* %3
%115 = sext i32 %114 to i64
%116 = getelementptr inbounds i32, i32* %113, i64 %115
%117 = load i32, i32* %116
%118 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.8, i64 0, i64 0), i32 %112, i32 %117)
br label %119
119: ; preds = %111, %104
br label %120
120: ; preds = %119
%121 = load i32, i32* %3
%122 = add nsw i32 %121, 1
store i32 %122, i32* %3
br label %99
123: ; preds = %99
store i32 0, i32* %3
br label %124
124: ; preds = %157, %123
%125 = load i32, i32* %3
%126 = load i32, i32* %7
%127 = add nsw i32 %126, 1
%128 = icmp slt i32 %125, %127
br i1 %128, label %129, label %160
129: ; preds = %124
%130 = load i32*, i32** %15
%131 = load i32, i32* %3
%132 = sext i32 %131 to i64
%133 = getelementptr inbounds i32, i32* %130, i64 %132
%134 = load i32, i32* %133
%135 = icmp ne i32 %134, 0
br i1 %135, label %136, label %156
136: ; preds = %129
%137 = load i32, i32* %3
store i32 %137, i32* %17
%138 = load i32*, i32** %15
%139 = load i32, i32* %3
%140 = sext i32 %139 to i64
%141 = getelementptr inbounds i32, i32* %138, i64 %140
%142 = load i32, i32* %141
store i32 %142, i32* %18
%143 = load i32, i32* %17
store i32 %143, i32* %19
%144 = load i32, i32* %18
store i32 %144, i32* %20
%145 = load i32, i32* %19
%146 = load i32, i32* %20
%147 = call double @log_poisson_d(i32 %145, i32 %146)
store double %147, double* %21
%148 = load double, double* %21
%149 = load i32, i32* %3
%150 = load i32*, i32** %15
%151 = load i32, i32* %3
%152 = sext i32 %151 to i64
%153 = getelementptr inbounds i32, i32* %150, i64 %152
%154 = load i32, i32* %153
%155 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.9, i64 0, i64 0), double %148, i32 %149, i32 %154)
br label %156
156: ; preds = %136, %129
br label %157
157: ; preds = %156
%158 = load i32, i32* %3
%159 = add nsw i32 %158, 1
store i32 %159, i32* %3
br label %124
160: ; preds = %124
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.5 = [49 x i8] c"\0AThis is how many mini-hypercubes you have: %d \0A\00"
@.str.6 = [34 x i8] c"This is how many dimensions: %d \0A\00"
@.str.7 = [30 x i8] c"This is how many points: %d \0A\00"
@.str.8 = [60 x i8] c"Points in box = %d, boxes with that number of points = %d \0A\00"
@.str.9 = [73 x i8] c"Result = %f, points in box = %d, boxes with that number of points = %d \0A\00"
@str = [34 x i8] c"What is the number of dimensions?\00"
@str.10 = [30 x i8] c"What is the number of points?\00"
@str.11 = [41 x i8] c"How many minihypercubes per side length?\00"
@str.12 = [50 x i8] c"What is the random seed? Provide a 32 bit integer\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.10, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.11, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.12, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%17 = load i32, i32* %1
%18 = call i32 @seed(i32 %17)
%19 = load i32, i32* %4
%20 = load i32, i32* %2
%21 = call i32 @ipow(i32 %19, i32 %20)
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.5, i64 0, i64 0), i32 %21)
%23 = load i32, i32* %2
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.6, i64 0, i64 0), i32 %23)
%25 = load i32, i32* %3
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.7, i64 0, i64 0), i32 %25)
%27 = call i32* @calloc(i32 %21, i32 4)
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 1
%30 = call i32* @calloc(i32 %29, i32 4)
%31 = call double (...) @random_maker()
%32 = call double (...) @random_maker()
%33 = call double (...) @random_maker()
%34 = call double (...) @random_maker()
%35 = call double (...) @random_maker()
%36 = call double (...) @random_maker()
%37 = call double (...) @random_maker()
%38 = call double (...) @random_maker()
%39 = call double (...) @random_maker()
%40 = call double (...) @random_maker()
%41 = load i32, i32* %3
%42 = icmp sgt i32 %41, 0
br i1 %42, label %43, label %45
43: ; preds = %0
%44 = sitofp i32 %21 to double
br label %55
45: ; preds = %55, %0
%46 = phi i32 [ %41, %0 ], [ %65, %55 ]
%47 = icmp sgt i32 %21, 0
br i1 %47, label %48, label %82
48: ; preds = %45
%49 = zext i32 %21 to i64
%50 = add nsw i64 %49, -1
%51 = and i64 %49, 3
%52 = icmp ult i64 %50, 3
br i1 %52, label %67, label %53
53: ; preds = %48
%54 = and i64 %49, 4294967292
br label %84
55: ; preds = %43, %55
%56 = phi i32 [ 0, %43 ], [ %64, %55 ]
%57 = call double (...) @random_maker()
%58 = fmul double %57, %44
%59 = call i32 @floor(double %58)
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds i32, i32* %27, i64 %60
%62 = load i32, i32* %61
%63 = add nsw i32 %62, 1
store i32 %63, i32* %61
%64 = add nuw nsw i32 %56, 1
%65 = load i32, i32* %3
%66 = icmp slt i32 %64, %65
br i1 %66, label %55, label %45
67: ; preds = %84, %48
%68 = phi i64 [ 0, %48 ], [ %114, %84 ]
%69 = icmp eq i64 %51, 0
br i1 %69, label %82, label %70
70: ; preds = %67, %70
%71 = phi i64 [ %79, %70 ], [ %68, %67 ]
%72 = phi i64 [ %80, %70 ], [ 0, %67 ]
%73 = getelementptr inbounds i32, i32* %27, i64 %71
%74 = load i32, i32* %73
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds i32, i32* %30, i64 %75
%77 = load i32, i32* %76
%78 = add nsw i32 %77, 1
store i32 %78, i32* %76
%79 = add nuw nsw i64 %71, 1
%80 = add i64 %72, 1
%81 = icmp eq i64 %80, %51
br i1 %81, label %82, label %70
82: ; preds = %67, %70, %45
%83 = icmp slt i32 %46, 0
br i1 %83, label %150, label %119
84: ; preds = %84, %53
%85 = phi i64 [ 0, %53 ], [ %114, %84 ]
%86 = phi i64 [ 0, %53 ], [ %115, %84 ]
%87 = getelementptr inbounds i32, i32* %27, i64 %85
%88 = load i32, i32* %87
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds i32, i32* %30, i64 %89
%91 = load i32, i32* %90
%92 = add nsw i32 %91, 1
store i32 %92, i32* %90
%93 = or i64 %85, 1
%94 = getelementptr inbounds i32, i32* %27, i64 %93
%95 = load i32, i32* %94
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds i32, i32* %30, i64 %96
%98 = load i32, i32* %97
%99 = add nsw i32 %98, 1
store i32 %99, i32* %97
%100 = or i64 %85, 2
%101 = getelementptr inbounds i32, i32* %27, i64 %100
%102 = load i32, i32* %101
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds i32, i32* %30, i64 %103
%105 = load i32, i32* %104
%106 = add nsw i32 %105, 1
store i32 %106, i32* %104
%107 = or i64 %85, 3
%108 = getelementptr inbounds i32, i32* %27, i64 %107
%109 = load i32, i32* %108
%110 = sext i32 %109 to i64
%111 = getelementptr inbounds i32, i32* %30, i64 %110
%112 = load i32, i32* %111
%113 = add nsw i32 %112, 1
store i32 %113, i32* %111
%114 = add nuw nsw i64 %85, 4
%115 = add i64 %86, 4
%116 = icmp eq i64 %115, %54
br i1 %116, label %67, label %84
117: ; preds = %129
%118 = icmp slt i32 %130, 0
br i1 %118, label %150, label %134
119: ; preds = %82, %129
%120 = phi i32 [ %130, %129 ], [ %46, %82 ]
%121 = phi i64 [ %131, %129 ], [ 0, %82 ]
%122 = getelementptr inbounds i32, i32* %30, i64 %121
%123 = load i32, i32* %122
%124 = icmp eq i32 %123, 0
br i1 %124, label %129, label %125
125: ; preds = %119
%126 = trunc i64 %121 to i32
%127 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @.str.8, i64 0, i64 0), i32 %126, i32 %123)
%128 = load i32, i32* %3
br label %129
129: ; preds = %119, %125
%130 = phi i32 [ %120, %119 ], [ %128, %125 ]
%131 = add nuw nsw i64 %121, 1
%132 = sext i32 %130 to i64
%133 = icmp slt i64 %121, %132
br i1 %133, label %119, label %117
134: ; preds = %117, %145
%135 = phi i32 [ %146, %145 ], [ %130, %117 ]
%136 = phi i64 [ %147, %145 ], [ 0, %117 ]
%137 = getelementptr inbounds i32, i32* %30, i64 %136
%138 = load i32, i32* %137
%139 = icmp eq i32 %138, 0
br i1 %139, label %145, label %140
140: ; preds = %134
%141 = trunc i64 %136 to i32
%142 = call double @log_poisson_d(i32 %141, i32 %138)
%143 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @.str.9, i64 0, i64 0), double %142, i32 %141, i32 %138)
%144 = load i32, i32* %3
br label %145
145: ; preds = %134, %140
%146 = phi i32 [ %135, %134 ], [ %144, %140 ]
%147 = add nuw nsw i64 %136, 1
%148 = sext i32 %146 to i64
%149 = icmp slt i64 %136, %148
br i1 %149, label %134, label %150
150: ; preds = %145, %82, %117
ret i32 0
}