#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ areaConfHeader(int /*<<< orphan*/ *);
scalar_t__ ceilf(float);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ printf(char *, int, ...);
int areaConfGenerate(FILE *fp, int *areasX, int *areasY,
                     float letterBoxXPercent, float letterBoxYPercent) {
  int i, divshift = 0;
  *areasX = *areasY = 0;
  int areaArea = 1 * 8;
  while ((areaArea >>= 1))
    divshift++;
  printf("divshift calculated: %d\n", divshift);
  int cellMaxX = (int)ceilf((float)1916 / (float)32);
  int cellMaxY = (int)ceilf((float)1080 / (float)32);
  int cellMinX = 0;
  int cellMinY = 0;
  cellMinX += 0;
  cellMaxX += 0;
  cellMinY += 0;
  cellMaxY += 0;
  int letterBoxXAdjust, letterBoxYAdjust;
  if (letterBoxXPercent == 1.0)
    letterBoxXAdjust = 0;
  else
    letterBoxXAdjust = (int)((1.0 - letterBoxXPercent) *
                             (float)((cellMaxX - cellMinX) + 1) * 0.5);
  if (letterBoxYPercent == 1.0)
    letterBoxYAdjust = 0;
  else
    letterBoxYAdjust = (int)((1.0 - letterBoxYPercent) *
                             (float)((cellMaxY - cellMinY) + 1) * 0.5);
  int countAreas = 0;
  fprintf(fp, "# Top Row running left to right\n");
  areaConfHeader(fp);
  for (i = cellMinX; i <= cellMaxX; i += 1) {
    fprintf(fp, "  %-5d %-5d %-5d %-5d %-8d # %d\n", i, (i + 1) - 1,
            letterBoxYAdjust + cellMinY, letterBoxYAdjust + (cellMinY + 8) - 1,
            divshift, countAreas++);
    (*areasX)++;
  }
  fprintf(fp, "# Right Column running top to bottom\n");
  areaConfHeader(fp);
  for (i = cellMinY; i <= cellMaxY; i += 1) {
    fprintf(fp, "  %-5d %-5d %-5d %-5d %-8d # %d\n",
            -letterBoxXAdjust + (cellMaxX - 8) + 1,
            -letterBoxXAdjust + cellMaxX, i, (i + 1) - 1, divshift,
            countAreas++);
    (*areasY)++;
  }
  fprintf(fp, "# Bottom Row running left to right\n");
  areaConfHeader(fp);
  for (i = cellMinX; i <= cellMaxX; i += 1) {
    fprintf(fp, "  %-5d %-5d %-5d %-5d %-8d # %d\n", i, (i + 1) - 1,
            -letterBoxYAdjust + (cellMaxY - 8) + 1,
            -letterBoxYAdjust + cellMaxY, divshift, countAreas++);
  }
  fprintf(fp, "# Left Column running top to bottom\n");
  areaConfHeader(fp);
  for (i = cellMinY; i <= cellMaxY; i += 1) {
    fprintf(fp, "  %-5d %-5d %-5d %-5d %-8d # %d\n",
            letterBoxXAdjust + cellMinX, letterBoxXAdjust + (cellMinX + 8) - 1,
            i, (i + 1) - 1, divshift, countAreas++);
  }
  printf("Number of areas: %d XAreas: %d YAreas: %d\n", countAreas, *areasX,
         *areasY);
  return countAreas;
}


x86 assembly (clang, -O0):
<areaConfGenerate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movss  %xmm0,-0x1c(%rbp)
movss  %xmm1,-0x20(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
movl   $0x8,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x2c(%rbp)
cmp    $0x0,%eax
je     11a0 <areaConfGenerate+0x60>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1180 <areaConfGenerate+0x40>
mov    -0x28(%rbp),%esi
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  0xe5b(%rip),%xmm0
call   1060 <ceilf@plt>
mov    %eax,-0x30(%rbp)
movss  0xe47(%rip),%xmm0
call   1060 <ceilf@plt>
mov    %eax,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x38(%rbp),%eax
add    $0x0,%eax
mov    %eax,-0x38(%rbp)
mov    -0x30(%rbp),%eax
add    $0x0,%eax
mov    %eax,-0x30(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x0,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x34(%rbp),%eax
add    $0x0,%eax
mov    %eax,-0x34(%rbp)
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdec(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1230 <areaConfGenerate+0xf0>
jp     1230 <areaConfGenerate+0xf0>
movl   $0x0,-0x40(%rbp)
jmp    126d <areaConfGenerate+0x12d>
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xdbf(%rip),%xmm0
subsd  %xmm1,%xmm0
mov    -0x30(%rbp),%eax
sub    -0x38(%rbp),%eax
add    $0x1,%eax
cvtsi2ss %eax,%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xda6(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x40(%rbp)
movss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd82(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    129a <areaConfGenerate+0x15a>
jp     129a <areaConfGenerate+0x15a>
movl   $0x0,-0x44(%rbp)
jmp    12d7 <areaConfGenerate+0x197>
movss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xd55(%rip),%xmm0
subsd  %xmm1,%xmm0
mov    -0x34(%rbp),%eax
sub    -0x3c(%rbp),%eax
add    $0x1,%eax
cvtsi2ss %eax,%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd3c(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x44(%rbp)
movl   $0x0,-0x48(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xd48(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <areaConfHeader@plt>
mov    -0x38(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x30(%rbp),%eax
jg     1372 <areaConfGenerate+0x232>
mov    -0x8(%rbp),%rdi
mov    -0x24(%rbp),%edx
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
sub    $0x1,%ecx
mov    -0x44(%rbp),%r8d
add    -0x3c(%rbp),%r8d
mov    -0x44(%rbp),%r9d
mov    -0x3c(%rbp),%eax
add    $0x8,%eax
add    %eax,%r9d
sub    $0x1,%r9d
mov    -0x28(%rbp),%r10d
mov    -0x48(%rbp),%eax
mov    %eax,%esi
add    $0x1,%esi
mov    %esi,-0x48(%rbp)
lea    0xd08(%rip),%rsi
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    12ff <areaConfGenerate+0x1bf>
mov    -0x8(%rbp),%rdi
lea    0xcf6(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <areaConfHeader@plt>
mov    -0x3c(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x34(%rbp),%eax
jg     1409 <areaConfGenerate+0x2c9>
mov    -0x8(%rbp),%rdi
xor    %edx,%edx
sub    -0x40(%rbp),%edx
mov    -0x30(%rbp),%eax
sub    $0x8,%eax
add    %eax,%edx
add    $0x1,%edx
xor    %ecx,%ecx
sub    -0x40(%rbp),%ecx
add    -0x30(%rbp),%ecx
mov    -0x24(%rbp),%r8d
mov    -0x24(%rbp),%r9d
add    $0x1,%r9d
sub    $0x1,%r9d
mov    -0x28(%rbp),%r10d
mov    -0x48(%rbp),%eax
mov    %eax,%esi
add    $0x1,%esi
mov    %esi,-0x48(%rbp)
lea    0xc71(%rip),%rsi
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1393 <areaConfGenerate+0x253>
mov    -0x8(%rbp),%rdi
lea    0xc85(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <areaConfHeader@plt>
mov    -0x38(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x30(%rbp),%eax
jg     1498 <areaConfGenerate+0x358>
mov    -0x8(%rbp),%rdi
mov    -0x24(%rbp),%edx
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
sub    $0x1,%ecx
xor    %r8d,%r8d
sub    -0x44(%rbp),%r8d
mov    -0x34(%rbp),%eax
sub    $0x8,%eax
add    %eax,%r8d
add    $0x1,%r8d
xor    %r9d,%r9d
sub    -0x44(%rbp),%r9d
add    -0x34(%rbp),%r9d
mov    -0x28(%rbp),%r10d
mov    -0x48(%rbp),%eax
mov    %eax,%esi
add    $0x1,%esi
mov    %esi,-0x48(%rbp)
lea    0xbd7(%rip),%rsi
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    142a <areaConfGenerate+0x2ea>
mov    -0x8(%rbp),%rdi
lea    0xc1a(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <areaConfHeader@plt>
mov    -0x3c(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x34(%rbp),%eax
jg     1520 <areaConfGenerate+0x3e0>
mov    -0x8(%rbp),%rdi
mov    -0x40(%rbp),%edx
add    -0x38(%rbp),%edx
mov    -0x40(%rbp),%ecx
mov    -0x38(%rbp),%eax
add    $0x8,%eax
add    %eax,%ecx
sub    $0x1,%ecx
mov    -0x24(%rbp),%r8d
mov    -0x24(%rbp),%r9d
add    $0x1,%r9d
sub    $0x1,%r9d
mov    -0x28(%rbp),%r10d
mov    -0x48(%rbp),%eax
mov    %eax,%esi
add    $0x1,%esi
mov    %esi,-0x48(%rbp)
lea    0xb4f(%rip),%rsi
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    14b9 <areaConfGenerate+0x379>
mov    -0x48(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
lea    0xbac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x48(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<areaConfGenerate>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
movss  %xmm1,0x8(%rsp)
movss  %xmm0,(%rsp)
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r12
movl   $0x0,(%rdx)
movl   $0x0,(%rsi)
lea    0xe9b(%rip),%rdi
xor    %r15d,%r15d
mov    $0x3,%esi
xor    %eax,%eax
call   1030 <printf@plt>
movss  0xe64(%rip),%xmm0
call   1060 <ceilf@plt>
mov    %rax,%rbp
movss  0xe58(%rip),%xmm0
call   1060 <ceilf@plt>
movss  (%rsp),%xmm0
mov    %rax,%r13
ucomiss 0xe48(%rip),%xmm0
mov    $0x0,%eax
jne    11c9 <areaConfGenerate+0x79>
jnp    11fa <areaConfGenerate+0xaa>
cvtss2sd %xmm0,%xmm0
lea    0x1(%rbp),%eax
xorps  %xmm1,%xmm1
cvtsi2ss %eax,%xmm1
movsd  0xe31(%rip),%xmm2
subsd  %xmm0,%xmm2
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
mulsd  %xmm2,%xmm0
mulsd  0xe22(%rip),%xmm0
cvttsd2si %xmm0,%eax
mov    %rax,(%rsp)
movss  0x8(%rsp),%xmm0
ucomiss 0xdfd(%rip),%xmm0
jne    120f <areaConfGenerate+0xbf>
jnp    1242 <areaConfGenerate+0xf2>
cvtss2sd %xmm0,%xmm0
lea    0x1(%r13),%eax
xorps  %xmm1,%xmm1
cvtsi2ss %eax,%xmm1
movsd  0xdea(%rip),%xmm2
subsd  %xmm0,%xmm2
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
mulsd  %xmm2,%xmm0
mulsd  0xddb(%rip),%xmm0
cvttsd2si %xmm0,%r15d
mov    %rbx,0x28(%rsp)
lea    0xdeb(%rip),%rdi
mov    $0x20,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1070 <fwrite@plt>
mov    %r12,%rdi
call   1040 <areaConfHeader@plt>
test   %ebp,%ebp
mov    %r13,0x10(%rsp)
mov    %rbp,0x20(%rsp)
mov    %r15,0x30(%rsp)
js     12c9 <areaConfGenerate+0x179>
mov    %r15,%r13
add    $0x7,%r15d
lea    0x1(%rbp),%ebx
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rcx),%ebp
mov    %r12,%rdi
lea    0xdbd(%rip),%rsi
mov    %ecx,%edx
mov    %r13d,%r8d
mov    %r15d,%r9d
xor    %eax,%eax
push   %rcx
push   $0x3
call   1050 <fprintf@plt>
add    $0x10,%rsp
addl   $0x1,(%r14)
mov    %ebp,%ecx
cmp    %ebp,%ebx
jne    1290 <areaConfGenerate+0x140>
mov    0x20(%rsp),%rbp
mov    0x10(%rsp),%r13
jmp    12cb <areaConfGenerate+0x17b>
xor    %ebx,%ebx
lea    0xda9(%rip),%rdi
mov    $0x25,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1070 <fwrite@plt>
mov    %r12,%rdi
call   1040 <areaConfHeader@plt>
test   %r13d,%r13d
mov    %r14,0x18(%rsp)
js     136f <areaConfGenerate+0x21f>
mov    %ebp,%r14d
sub    (%rsp),%r14d
mov    %r12,0x8(%rsp)
lea    -0x7(%r14),%r12d
lea    0x1(%r13),%r15d
xor    %ebp,%ebp
mov    0x28(%rsp),%r13
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebp,%r8d
lea    (%rbx,%r8,1),%r10d
lea    0x1(%r8),%ebp
mov    0x8(%rsp),%rdi
lea    0xd23(%rip),%rsi
mov    %r12d,%edx
mov    %r14d,%ecx
mov    %r8d,%r9d
xor    %eax,%eax
push   %r10
push   $0x3
call   1050 <fprintf@plt>
add    $0x10,%rsp
addl   $0x1,0x0(%r13)
cmp    %ebp,%r15d
jne    1320 <areaConfGenerate+0x1d0>
add    %ebp,%ebx
mov    0x18(%rsp),%r14
mov    0x8(%rsp),%r12
mov    0x10(%rsp),%r13
mov    0x20(%rsp),%rbp
lea    0xd2b(%rip),%rdi
mov    $0x23,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1070 <fwrite@plt>
mov    %r12,%rdi
call   1040 <areaConfHeader@plt>
test   %ebp,%ebp
mov    0x30(%rsp),%rcx
js     13fe <areaConfGenerate+0x2ae>
mov    %r13,%rax
mov    %r12,%r13
mov    %eax,%r12d
sub    %ecx,%r12d
lea    -0x7(%r12),%r15d
add    $0x1,%ebp
mov    %rbp,%r14
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebp,%ecx
lea    (%rbx,%rcx,1),%r10d
lea    0x1(%rcx),%ebp
mov    %r13,%rdi
lea    0xc87(%rip),%rsi
mov    %ecx,%edx
mov    %r15d,%r8d
mov    %r12d,%r9d
xor    %eax,%eax
push   %r10
push   $0x3
call   1050 <fprintf@plt>
add    $0x10,%rsp
cmp    %ebp,%r14d
jne    13c0 <areaConfGenerate+0x270>
add    %ebp,%ebx
mov    %r13,%r12
mov    0x10(%rsp),%r13
mov    0x18(%rsp),%r14
lea    0xcc0(%rip),%rdi
mov    $0x24,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1070 <fwrite@plt>
mov    %r12,%rdi
call   1040 <areaConfHeader@plt>
test   %r13d,%r13d
js     1476 <areaConfGenerate+0x326>
mov    (%rsp),%rax
lea    0x7(%rax),%r15d
add    $0x1,%r13d
lea    0xc23(%rip),%r14
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    %ebp,%r8d
lea    (%rbx,%r8,1),%r10d
lea    0x1(%r8),%ebp
mov    %r12,%rdi
mov    %r14,%rsi
mov    (%rsp),%rdx
mov    %r15d,%ecx
mov    %r8d,%r9d
xor    %eax,%eax
push   %r10
push   $0x3
call   1050 <fprintf@plt>
add    $0x10,%rsp
cmp    %ebp,%r13d
jne    1440 <areaConfGenerate+0x2f0>
add    %ebp,%ebx
mov    0x18(%rsp),%r14
mov    (%r14),%edx
mov    0x28(%rsp),%rax
mov    (%rax),%ecx
lea    0xc63(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebx,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [25 x i8] c"divshift calculated: %d\0A\00"
@.str.1 = [33 x i8] c"# Top Row running left to right\0A\00"
@.str.2 = [33 x i8] c" %-5d %-5d %-5d %-5d %-8d # %d\0A\00"
@.str.3 = [38 x i8] c"# Right Column running top to bottom\0A\00"
@.str.4 = [36 x i8] c"# Bottom Row running left to right\0A\00"
@.str.5 = [37 x i8] c"# Left Column running top to bottom\0A\00"
@.str.6 = [43 x i8] c"Number of areas: %d XAreas: %d YAreas: %d\0A\00"
define i32 @areaConfGenerate(i32* %0, i32* %1, i32* %2, float %3, float %4) {
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca float
%10 = alloca float
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
store i32* %0, i32** %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store float %3, float* %9
store float %4, float* %10
store i32 0, i32* %12
%21 = load i32*, i32** %8
store i32 0, i32* %21
%22 = load i32*, i32** %7
store i32 0, i32* %22
store i32 8, i32* %13
br label %23
23: ; preds = %27, %5
%24 = load i32, i32* %13
%25 = ashr i32 %24, 1
store i32 %25, i32* %13
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %30
27: ; preds = %23
%28 = load i32, i32* %12
%29 = add nsw i32 %28, 1
store i32 %29, i32* %12
br label %23
30: ; preds = %23
%31 = load i32, i32* %12
%32 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %31)
%33 = call i64 @ceilf(float 5.987500e+01)
%34 = trunc i64 %33 to i32
store i32 %34, i32* %14
%35 = call i64 @ceilf(float 3.375000e+01)
%36 = trunc i64 %35 to i32
store i32 %36, i32* %15
store i32 0, i32* %16
store i32 0, i32* %17
%37 = load i32, i32* %16
%38 = add nsw i32 %37, 0
store i32 %38, i32* %16
%39 = load i32, i32* %14
%40 = add nsw i32 %39, 0
store i32 %40, i32* %14
%41 = load i32, i32* %17
%42 = add nsw i32 %41, 0
store i32 %42, i32* %17
%43 = load i32, i32* %15
%44 = add nsw i32 %43, 0
store i32 %44, i32* %15
%45 = load float, float* %9
%46 = fpext float %45 to double
%47 = fcmp oeq double %46, 1.000000e+00
br i1 %47, label %48, label %49
48: ; preds = %30
store i32 0, i32* %18
br label %62
49: ; preds = %30
%50 = load float, float* %9
%51 = fpext float %50 to double
%52 = fsub double 1.000000e+00, %51
%53 = load i32, i32* %14
%54 = load i32, i32* %16
%55 = sub nsw i32 %53, %54
%56 = add nsw i32 %55, 1
%57 = sitofp i32 %56 to float
%58 = fpext float %57 to double
%59 = fmul double %52, %58
%60 = fmul double %59, 5.000000e-01
%61 = fptosi double %60 to i32
store i32 %61, i32* %18
br label %62
62: ; preds = %49, %48
%63 = load float, float* %10
%64 = fpext float %63 to double
%65 = fcmp oeq double %64, 1.000000e+00
br i1 %65, label %66, label %67
66: ; preds = %62
store i32 0, i32* %19
br label %80
67: ; preds = %62
%68 = load float, float* %10
%69 = fpext float %68 to double
%70 = fsub double 1.000000e+00, %69
%71 = load i32, i32* %15
%72 = load i32, i32* %17
%73 = sub nsw i32 %71, %72
%74 = add nsw i32 %73, 1
%75 = sitofp i32 %74 to float
%76 = fpext float %75 to double
%77 = fmul double %70, %76
%78 = fmul double %77, 5.000000e-01
%79 = fptosi double %78 to i32
store i32 %79, i32* %19
br label %80
80: ; preds = %67, %66
store i32 0, i32* %20
%81 = load i32*, i32** %6
%82 = call i32 (i32*, i8*, ...) @fprintf(i32* %81, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%83 = load i32*, i32** %6
%84 = call i32 @areaConfHeader(i32* %83)
%85 = load i32, i32* %16
store i32 %85, i32* %11
br label %86
86: ; preds = %111, %80
%87 = load i32, i32* %11
%88 = load i32, i32* %14
%89 = icmp sle i32 %87, %88
br i1 %89, label %90, label %114
90: ; preds = %86
%91 = load i32*, i32** %6
%92 = load i32, i32* %11
%93 = load i32, i32* %11
%94 = add nsw i32 %93, 1
%95 = sub nsw i32 %94, 1
%96 = load i32, i32* %19
%97 = load i32, i32* %17
%98 = add nsw i32 %96, %97
%99 = load i32, i32* %19
%100 = load i32, i32* %17
%101 = add nsw i32 %100, 8
%102 = add nsw i32 %99, %101
%103 = sub nsw i32 %102, 1
%104 = load i32, i32* %12
%105 = load i32, i32* %20
%106 = add nsw i32 %105, 1
store i32 %106, i32* %20
%107 = call i32 (i32*, i8*, ...) @fprintf(i32* %91, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 %92, i32 %95, i32 %98, i32 %103, i32 %104, i32 %105)
%108 = load i32*, i32** %7
%109 = load i32, i32* %108
%110 = add nsw i32 %109, 1
store i32 %110, i32* %108
br label %111
111: ; preds = %90
%112 = load i32, i32* %11
%113 = add nsw i32 %112, 1
store i32 %113, i32* %11
br label %86
114: ; preds = %86
%115 = load i32*, i32** %6
%116 = call i32 (i32*, i8*, ...) @fprintf(i32* %115, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
%117 = load i32*, i32** %6
%118 = call i32 @areaConfHeader(i32* %117)
%119 = load i32, i32* %17
store i32 %119, i32* %11
br label %120
120: ; preds = %147, %114
%121 = load i32, i32* %11
%122 = load i32, i32* %15
%123 = icmp sle i32 %121, %122
br i1 %123, label %124, label %150
124: ; preds = %120
%125 = load i32*, i32** %6
%126 = load i32, i32* %18
%127 = sub nsw i32 0, %126
%128 = load i32, i32* %14
%129 = sub nsw i32 %128, 8
%130 = add nsw i32 %127, %129
%131 = add nsw i32 %130, 1
%132 = load i32, i32* %18
%133 = sub nsw i32 0, %132
%134 = load i32, i32* %14
%135 = add nsw i32 %133, %134
%136 = load i32, i32* %11
%137 = load i32, i32* %11
%138 = add nsw i32 %137, 1
%139 = sub nsw i32 %138, 1
%140 = load i32, i32* %12
%141 = load i32, i32* %20
%142 = add nsw i32 %141, 1
store i32 %142, i32* %20
%143 = call i32 (i32*, i8*, ...) @fprintf(i32* %125, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 %131, i32 %135, i32 %136, i32 %139, i32 %140, i32 %141)
%144 = load i32*, i32** %8
%145 = load i32, i32* %144
%146 = add nsw i32 %145, 1
store i32 %146, i32* %144
br label %147
147: ; preds = %124
%148 = load i32, i32* %11
%149 = add nsw i32 %148, 1
store i32 %149, i32* %11
br label %120
150: ; preds = %120
%151 = load i32*, i32** %6
%152 = call i32 (i32*, i8*, ...) @fprintf(i32* %151, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0))
%153 = load i32*, i32** %6
%154 = call i32 @areaConfHeader(i32* %153)
%155 = load i32, i32* %16
store i32 %155, i32* %11
br label %156
156: ; preds = %180, %150
%157 = load i32, i32* %11
%158 = load i32, i32* %14
%159 = icmp sle i32 %157, %158
br i1 %159, label %160, label %183
160: ; preds = %156
%161 = load i32*, i32** %6
%162 = load i32, i32* %11
%163 = load i32, i32* %11
%164 = add nsw i32 %163, 1
%165 = sub nsw i32 %164, 1
%166 = load i32, i32* %19
%167 = sub nsw i32 0, %166
%168 = load i32, i32* %15
%169 = sub nsw i32 %168, 8
%170 = add nsw i32 %167, %169
%171 = add nsw i32 %170, 1
%172 = load i32, i32* %19
%173 = sub nsw i32 0, %172
%174 = load i32, i32* %15
%175 = add nsw i32 %173, %174
%176 = load i32, i32* %12
%177 = load i32, i32* %20
%178 = add nsw i32 %177, 1
store i32 %178, i32* %20
%179 = call i32 (i32*, i8*, ...) @fprintf(i32* %161, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 %162, i32 %165, i32 %171, i32 %175, i32 %176, i32 %177)
br label %180
180: ; preds = %160
%181 = load i32, i32* %11
%182 = add nsw i32 %181, 1
store i32 %182, i32* %11
br label %156
183: ; preds = %156
%184 = load i32*, i32** %6
%185 = call i32 (i32*, i8*, ...) @fprintf(i32* %184, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0))
%186 = load i32*, i32** %6
%187 = call i32 @areaConfHeader(i32* %186)
%188 = load i32, i32* %17
store i32 %188, i32* %11
br label %189
189: ; preds = %211, %183
%190 = load i32, i32* %11
%191 = load i32, i32* %15
%192 = icmp sle i32 %190, %191
br i1 %192, label %193, label %214
193: ; preds = %189
%194 = load i32*, i32** %6
%195 = load i32, i32* %18
%196 = load i32, i32* %16
%197 = add nsw i32 %195, %196
%198 = load i32, i32* %18
%199 = load i32, i32* %16
%200 = add nsw i32 %199, 8
%201 = add nsw i32 %198, %200
%202 = sub nsw i32 %201, 1
%203 = load i32, i32* %11
%204 = load i32, i32* %11
%205 = add nsw i32 %204, 1
%206 = sub nsw i32 %205, 1
%207 = load i32, i32* %12
%208 = load i32, i32* %20
%209 = add nsw i32 %208, 1
store i32 %209, i32* %20
%210 = call i32 (i32*, i8*, ...) @fprintf(i32* %194, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 %197, i32 %202, i32 %203, i32 %206, i32 %207, i32 %208)
br label %211
211: ; preds = %193
%212 = load i32, i32* %11
%213 = add nsw i32 %212, 1
store i32 %213, i32* %11
br label %189
214: ; preds = %189
%215 = load i32, i32* %20
%216 = load i32*, i32** %7
%217 = load i32, i32* %216
%218 = load i32*, i32** %8
%219 = load i32, i32* %218
%220 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.6, i64 0, i64 0), i32 %215, i32 %217, i32 %219)
%221 = load i32, i32* %20
ret i32 %221
}

LLVM IR (-O2):
@.str = [25 x i8] c"divshift calculated: %d\0A\00"
@.str.1 = [33 x i8] c"# Top Row running left to right\0A\00"
@.str.2 = [33 x i8] c" %-5d %-5d %-5d %-5d %-8d # %d\0A\00"
@.str.3 = [38 x i8] c"# Right Column running top to bottom\0A\00"
@.str.4 = [36 x i8] c"# Bottom Row running left to right\0A\00"
@.str.5 = [37 x i8] c"# Left Column running top to bottom\0A\00"
@.str.6 = [43 x i8] c"Number of areas: %d XAreas: %d YAreas: %d\0A\00"
define i32 @areaConfGenerate(i32* %0, i32* nocapture %1, i32* nocapture %2, float %3, float %4) {
store i32 0, i32* %2
store i32 0, i32* %1
%6 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 3)
%7 = tail call i64 @ceilf(float 5.987500e+01)
%8 = trunc i64 %7 to i32
%9 = tail call i64 @ceilf(float 3.375000e+01)
%10 = trunc i64 %9 to i32
%11 = fcmp oeq float %3, 1.000000e+00
br i1 %11, label %21, label %12
12: ; preds = %5
%13 = fpext float %3 to double
%14 = fsub double 1.000000e+00, %13
%15 = add nsw i32 %8, 1
%16 = sitofp i32 %15 to float
%17 = fpext float %16 to double
%18 = fmul double %14, %17
%19 = fmul double %18, 5.000000e-01
%20 = fptosi double %19 to i32
br label %21
21: ; preds = %5, %12
%22 = phi i32 [ %20, %12 ], [ 0, %5 ]
%23 = fcmp oeq float %4, 1.000000e+00
br i1 %23, label %33, label %24
24: ; preds = %21
%25 = fpext float %4 to double
%26 = fsub double 1.000000e+00, %25
%27 = add nsw i32 %10, 1
%28 = sitofp i32 %27 to float
%29 = fpext float %28 to double
%30 = fmul double %26, %29
%31 = fmul double %30, 5.000000e-01
%32 = fptosi double %31 to i32
br label %33
33: ; preds = %21, %24
%34 = phi i32 [ %32, %24 ], [ 0, %21 ]
%35 = tail call i64 @fwrite(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i64 32, i64 1, i32* %0)
%36 = tail call i32 @areaConfHeader(i32* %0)
%37 = icmp slt i32 %8, 0
br i1 %37, label %48, label %38
38: ; preds = %33
%39 = add nsw i32 %34, 7
%40 = add nuw i32 %8, 1
br label %41
41: ; preds = %38, %41
%42 = phi i32 [ 0, %38 ], [ %43, %41 ]
%43 = add nuw i32 %42, 1
%44 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 %42, i32 %42, i32 %34, i32 %39, i32 3, i32 %42)
%45 = load i32, i32* %1
%46 = add nsw i32 %45, 1
store i32 %46, i32* %1
%47 = icmp eq i32 %42, %8
br i1 %47, label %48, label %41
48: ; preds = %41, %33
%49 = phi i32 [ 0, %33 ], [ %40, %41 ]
%50 = tail call i64 @fwrite(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i64 37, i64 1, i32* %0)
%51 = tail call i32 @areaConfHeader(i32* %0)
%52 = icmp slt i32 %10, 0
br i1 %52, label %66, label %53
53: ; preds = %48
%54 = add i32 %8, -7
%55 = sub i32 %54, %22
%56 = sub i32 %8, %22
br label %57
57: ; preds = %53, %57
%58 = phi i32 [ %49, %53 ], [ %61, %57 ]
%59 = phi i32 [ 0, %53 ], [ %60, %57 ]
%60 = add nuw i32 %59, 1
%61 = add nuw nsw i32 %58, 1
%62 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 %55, i32 %56, i32 %59, i32 %59, i32 3, i32 %58)
%63 = load i32, i32* %2
%64 = add nsw i32 %63, 1
store i32 %64, i32* %2
%65 = icmp eq i32 %59, %10
br i1 %65, label %66, label %57
66: ; preds = %57, %48
%67 = phi i32 [ %49, %48 ], [ %61, %57 ]
%68 = tail call i64 @fwrite(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0), i64 35, i64 1, i32* %0)
%69 = tail call i32 @areaConfHeader(i32* %0)
br i1 %37, label %81, label %70
70: ; preds = %66
%71 = add i32 %10, -7
%72 = sub i32 %71, %34
%73 = sub i32 %10, %34
br label %74
74: ; preds = %70, %74
%75 = phi i32 [ %67, %70 ], [ %78, %74 ]
%76 = phi i32 [ 0, %70 ], [ %77, %74 ]
%77 = add nuw i32 %76, 1
%78 = add nuw nsw i32 %75, 1
%79 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 %76, i32 %76, i32 %72, i32 %73, i32 3, i32 %75)
%80 = icmp eq i32 %76, %8
br i1 %80, label %81, label %74
81: ; preds = %74, %66
%82 = phi i32 [ %67, %66 ], [ %78, %74 ]
%83 = tail call i64 @fwrite(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0), i64 36, i64 1, i32* %0)
%84 = tail call i32 @areaConfHeader(i32* %0)
br i1 %52, label %94, label %85
85: ; preds = %81
%86 = add nsw i32 %22, 7
br label %87
87: ; preds = %85, %87
%88 = phi i32 [ %82, %85 ], [ %91, %87 ]
%89 = phi i32 [ 0, %85 ], [ %90, %87 ]
%90 = add nuw i32 %89, 1
%91 = add nuw nsw i32 %88, 1
%92 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 %22, i32 %86, i32 %89, i32 %89, i32 3, i32 %88)
%93 = icmp eq i32 %89, %10
br i1 %93, label %94, label %87
94: ; preds = %87, %81
%95 = phi i32 [ %82, %81 ], [ %91, %87 ]
%96 = load i32, i32* %1
%97 = load i32, i32* %2
%98 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.6, i64 0, i64 0), i32 %95, i32 %96, i32 %97)
ret i32 %95
}