#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*/ endxlate();
int /*<<< orphan*/ gothic_arch(double, double, double);
int irandomn(int);
int /*<<< orphan*/ xlate(int /*<<< orphan*/, double, double);
void keep_block_windows(double width, double length, double height) {
  int nwindows;
  int i;
  nwindows = 7;
  for (i = 0; i < nwindows; i++) {
    int dix, diz;
    double dz, dx, w, h;
    dix = irandomn(4) - 2;
    diz = irandomn(2) - 1;
    dx = dix * length / 4.0 + length / 8.0;
    dz = diz * height / 2.0 + height / 4.0;
    h = height * 0.2;
    w = height / 2.5;
    xlate(0, dx, dz);
    gothic_arch(w, h, width * 2);
    endxlate();
  }
}


x86 assembly (clang, -O0):
<keep_block_windows>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movl   $0x7,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    125b <keep_block_windows+0x11b>
mov    $0x4,%edi
call   1060 <irandomn@plt>
sub    $0x2,%eax
mov    %eax,-0x24(%rbp)
mov    $0x2,%edi
call   1060 <irandomn@plt>
sub    $0x1,%eax
mov    %eax,-0x28(%rbp)
cvtsi2sdl -0x24(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xe75(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xe6c(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
cvtsi2sdl -0x28(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  0xe2d(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xe34(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe17(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xdf8(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
xor    %edi,%edi
call   1030 <xlate@plt>
movsd  -0x40(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
movsd  0xdc4(%rip),%xmm2
mulsd  -0x8(%rbp),%xmm2
call   1040 <gothic_arch@plt>
mov    $0x0,%al
call   1050 <endxlate@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1165 <keep_block_windows+0x25>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keep_block_windows>:
push   %rbp
push   %rbx
sub    $0x38,%rsp
movsd  0xeb2(%rip),%xmm3
movsd  %xmm1,0x28(%rsp)
mulsd  %xmm1,%xmm3
movsd  %xmm3,0x18(%rsp)
movsd  0xea2(%rip),%xmm1
mulsd  %xmm2,%xmm1
movsd  %xmm1,0x10(%rsp)
movsd  0xe98(%rip),%xmm1
mulsd  %xmm2,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  %xmm2,0x30(%rsp)
divsd  0xe88(%rip),%xmm2
movsd  %xmm2,(%rsp)
addsd  %xmm0,%xmm0
movsd  %xmm0,0x20(%rsp)
mov    $0x7,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x4,%edi
call   1060 <irandomn@plt>
mov    %eax,%ebx
add    $0xfffffffe,%ebx
mov    $0x2,%edi
call   1060 <irandomn@plt>
add    $0xffffffff,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
mulsd  0x28(%rsp),%xmm0
mulsd  0xe27(%rip),%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
addsd  0x18(%rsp),%xmm0
mulsd  0x30(%rsp),%xmm1
mulsd  0xe24(%rip),%xmm1
addsd  0x10(%rsp),%xmm1
xor    %edi,%edi
call   1030 <xlate@plt>
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  0x20(%rsp),%xmm2
call   1040 <gothic_arch@plt>
xor    %eax,%eax
call   1050 <endxlate@plt>
add    $0xffffffff,%ebp
jne    11b0 <keep_block_windows+0x70>
add    $0x38,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @keep_block_windows(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
store i32 7, i32* %7
store i32 0, i32* %8
br label %15
15: ; preds = %53, %3
%16 = load i32, i32* %8
%17 = load i32, i32* %7
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %56
19: ; preds = %15
%20 = call i32 @irandomn(i32 4)
%21 = sub nsw i32 %20, 2
store i32 %21, i32* %9
%22 = call i32 @irandomn(i32 2)
%23 = sub nsw i32 %22, 1
store i32 %23, i32* %10
%24 = load i32, i32* %9
%25 = sitofp i32 %24 to double
%26 = load double, double* %5
%27 = fmul double %25, %26
%28 = fdiv double %27, 4.000000e+00
%29 = load double, double* %5
%30 = fdiv double %29, 8.000000e+00
%31 = fadd double %28, %30
store double %31, double* %12
%32 = load i32, i32* %10
%33 = sitofp i32 %32 to double
%34 = load double, double* %6
%35 = fmul double %33, %34
%36 = fdiv double %35, 2.000000e+00
%37 = load double, double* %6
%38 = fdiv double %37, 4.000000e+00
%39 = fadd double %36, %38
store double %39, double* %11
%40 = load double, double* %6
%41 = fmul double %40, 2.000000e-01
store double %41, double* %14
%42 = load double, double* %6
%43 = fdiv double %42, 2.500000e+00
store double %43, double* %13
%44 = load double, double* %12
%45 = load double, double* %11
%46 = call i32 @xlate(i32 0, double %44, double %45)
%47 = load double, double* %13
%48 = load double, double* %14
%49 = load double, double* %4
%50 = fmul double %49, 2.000000e+00
%51 = call i32 @gothic_arch(double %47, double %48, double %50)
%52 = call i32 (...) @endxlate()
br label %53
53: ; preds = %19
%54 = load i32, i32* %8
%55 = add nsw i32 %54, 1
store i32 %55, i32* %8
br label %15
56: ; preds = %15
ret void
}

LLVM IR (-O2):
define void @keep_block_windows(double %0, double %1, double %2) {
%4 = fmul double %1, 1.250000e-01
%5 = fmul double %2, 2.500000e-01
%6 = fmul double %2, 2.000000e-01
%7 = fdiv double %2, 2.500000e+00
%8 = fmul double %0, 2.000000e+00
br label %9
9: ; preds = %3, %9
%10 = phi i32 [ 0, %3 ], [ %26, %9 ]
%11 = tail call i32 @irandomn(i32 4)
%12 = add nsw i32 %11, -2
%13 = tail call i32 @irandomn(i32 2)
%14 = add nsw i32 %13, -1
%15 = sitofp i32 %12 to double
%16 = fmul double %15, %1
%17 = fmul double %16, 2.500000e-01
%18 = fadd double %4, %17
%19 = sitofp i32 %14 to double
%20 = fmul double %19, %2
%21 = fmul double %20, 5.000000e-01
%22 = fadd double %5, %21
%23 = tail call i32 @xlate(i32 0, double %18, double %22)
%24 = tail call i32 @gothic_arch(double %7, double %6, double %8)
%25 = tail call i32 (...) @endxlate()
%26 = add nuw nsw i32 %10, 1
%27 = icmp eq i32 %26, 7
br i1 %27, label %28, label %9
28: ; preds = %9
ret void
}