#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*/ english_house(double, double, double, double);
int /*<<< orphan*/ gothic_hall(double, double, double, int, int, double, int);
int irandomn(int);
void keep_topper(double width, double length, double height) {
  if (irandomn(100) < 30) {
    english_house(width, length, height,
                  ((width) < (length) ? (width) : (length)) * 0.75);
    return;
  }
  if (irandomn(100) < 30) {
    gothic_hall(length, width, height, (int)(length / height * 5.0),
                (int)(width / height * 5.0), length * 0.1, 1);
    return;
  }
}


x86 assembly (clang, -O0):
<keep_topper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    $0x64,%edi
call   1050 <irandomn@plt>
cmp    $0x1e,%eax
jge    11cf <keep_topper+0x9f>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    119b <keep_topper+0x6b>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    11a5 <keep_topper+0x75>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x20(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm3
movsd  0xe4f(%rip),%xmm4
mulsd  %xmm4,%xmm3
call   1040 <english_house@plt>
jmp    123c <keep_topper+0x10c>
mov    $0x64,%edi
call   1050 <irandomn@plt>
cmp    $0x1e,%eax
jge    123c <keep_topper+0x10c>
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm3
divsd  -0x18(%rbp),%xmm3
movsd  0xe05(%rip),%xmm4
mulsd  %xmm4,%xmm3
cvttsd2si %xmm3,%edi
movsd  -0x8(%rbp),%xmm3
divsd  -0x18(%rbp),%xmm3
movsd  0xdeb(%rip),%xmm4
mulsd  %xmm4,%xmm3
cvttsd2si %xmm3,%esi
movsd  0xdd3(%rip),%xmm3
mulsd  -0x10(%rbp),%xmm3
mov    $0x1,%edx
call   1030 <gothic_hall@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keep_topper>:
sub    $0x18,%rsp
movsd  %xmm2,0x10(%rsp)
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,(%rsp)
mov    $0x64,%edi
call   1050 <irandomn@plt>
cmp    $0x1d,%eax
jg     117e <keep_topper+0x4e>
movsd  (%rsp),%xmm0
movapd %xmm0,%xmm3
movsd  0x8(%rsp),%xmm1
minsd  %xmm1,%xmm3
mulsd  0xea1(%rip),%xmm3
movsd  0x10(%rsp),%xmm2
add    $0x18,%rsp
jmp    1040 <english_house@plt>
mov    $0x64,%edi
call   1050 <irandomn@plt>
cmp    $0x1d,%eax
jg     11e0 <keep_topper+0xb0>
movsd  0x8(%rsp),%xmm0
movapd %xmm0,%xmm3
movsd  0x10(%rsp),%xmm2
divsd  %xmm2,%xmm3
movsd  0xe57(%rip),%xmm4
mulsd  %xmm4,%xmm3
cvttsd2si %xmm3,%edi
movsd  (%rsp),%xmm1
movapd %xmm1,%xmm3
divsd  %xmm2,%xmm3
mulsd  %xmm4,%xmm3
cvttsd2si %xmm3,%esi
movsd  0xe3a(%rip),%xmm3
mulsd  %xmm0,%xmm3
mov    $0x1,%edx
add    $0x18,%rsp
jmp    1030 <gothic_hall@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @keep_topper(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = call i32 @irandomn(i32 100)
%8 = icmp slt i32 %7, 30
br i1 %8, label %9, label %24
9: ; preds = %3
%10 = load double, double* %4
%11 = load double, double* %5
%12 = load double, double* %6
%13 = load double, double* %4
%14 = load double, double* %5
%15 = fcmp olt double %13, %14
br i1 %15, label %16, label %18
16: ; preds = %9
%17 = load double, double* %4
br label %20
18: ; preds = %9
%19 = load double, double* %5
br label %20
20: ; preds = %18, %16
%21 = phi double [ %17, %16 ], [ %19, %18 ]
%22 = fmul double %21, 7.500000e-01
%23 = call i32 @english_house(double %10, double %11, double %12, double %22)
br label %44
24: ; preds = %3
%25 = call i32 @irandomn(i32 100)
%26 = icmp slt i32 %25, 30
br i1 %26, label %27, label %44
27: ; preds = %24
%28 = load double, double* %5
%29 = load double, double* %4
%30 = load double, double* %6
%31 = load double, double* %5
%32 = load double, double* %6
%33 = fdiv double %31, %32
%34 = fmul double %33, 5.000000e+00
%35 = fptosi double %34 to i32
%36 = load double, double* %4
%37 = load double, double* %6
%38 = fdiv double %36, %37
%39 = fmul double %38, 5.000000e+00
%40 = fptosi double %39 to i32
%41 = load double, double* %5
%42 = fmul double %41, 1.000000e-01
%43 = call i32 @gothic_hall(double %28, double %29, double %30, i32 %35, i32 %40, double %42, i32 1)
br label %44
44: ; preds = %20, %27, %24
ret void
}

LLVM IR (-O2):
define void @keep_topper(double %0, double %1, double %2) {
%4 = tail call i32 @irandomn(i32 100)
%5 = icmp slt i32 %4, 30
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = fcmp olt double %0, %1
%8 = select i1 %7, double %0, double %1
%9 = fmul double %8, 7.500000e-01
%10 = tail call i32 @english_house(double %0, double %1, double %2, double %9)
br label %23
11: ; preds = %3
%12 = tail call i32 @irandomn(i32 100)
%13 = icmp slt i32 %12, 30
br i1 %13, label %14, label %23
14: ; preds = %11
%15 = fdiv double %1, %2
%16 = fmul double %15, 5.000000e+00
%17 = fptosi double %16 to i32
%18 = fdiv double %0, %2
%19 = fmul double %18, 5.000000e+00
%20 = fptosi double %19 to i32
%21 = fmul double %1, 1.000000e-01
%22 = tail call i32 @gothic_hall(double %1, double %0, double %2, i32 %17, i32 %20, double %21, i32 1)
br label %23
23: ; preds = %6, %14, %11
ret void
}