#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*/ gothic_hall(double, double, double, int, int, double, int);
void auto_gothic_hall(double length, double width, double height,
                      int with_roof) {
  int larches, warches;
  double border_thickness;
  double bthick;
  larches = (length / height);
  warches = (width / height);
  border_thickness = (length * 0.4) / larches;
  bthick = (width * 0.4) / warches;
  if (border_thickness > bthick)
    border_thickness = bthick;
  gothic_hall(length, width, height, larches, warches, border_thickness,
              with_roof);
}


x86 assembly (clang, -O0):
<auto_gothic_hall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x24(%rbp)
movsd  0xeac(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
cvtsi2sdl -0x20(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe91(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x24(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
ucomisd -0x38(%rbp),%xmm0
jbe    119c <auto_gothic_hall+0x8c>
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
mov    -0x20(%rbp),%edi
mov    -0x24(%rbp),%esi
movsd  -0x30(%rbp),%xmm3
mov    -0x1c(%rbp),%edx
call   1030 <gothic_hall@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<auto_gothic_hall>:
mov    %edi,%edx
movapd %xmm0,%xmm4
unpcklpd %xmm1,%xmm4
movapd %xmm2,%xmm3
unpcklpd %xmm2,%xmm3
movapd %xmm4,%xmm5
divpd  %xmm3,%xmm5
cvttpd2dq %xmm5,%xmm5
mulpd  0xeca(%rip),%xmm4
cvtdq2pd %xmm5,%xmm3
divpd  %xmm3,%xmm4
movapd %xmm4,%xmm3
unpckhpd %xmm4,%xmm3
minsd  %xmm4,%xmm3
movd   %xmm5,%edi
pshufd $0x55,%xmm5,%xmm4
movd   %xmm4,%esi
jmp    1030 <gothic_hall@plt>

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

LLVM IR (-O2):
define void @auto_gothic_hall(double %0, double %1, double %2, i32 %3) {
%5 = insertelement <2 x double> poison, double %0, i64 0
%6 = insertelement <2 x double> %5, double %1, i64 1
%7 = insertelement <2 x double> poison, double %2, i64 0
%8 = shufflevector <2 x double> %7, <2 x double> poison, <2 x i32> zeroinitializer
%9 = fdiv <2 x double> %6, %8
%10 = fptosi <2 x double> %9 to <2 x i32>
%11 = fmul <2 x double> %6, <double 4.000000e-01, double 4.000000e-01>
%12 = sitofp <2 x i32> %10 to <2 x double>
%13 = fdiv <2 x double> %11, %12
%14 = extractelement <2 x double> %13, i64 0
%15 = extractelement <2 x double> %13, i64 1
%16 = fcmp ogt double %14, %15
%17 = select i1 %16, double %15, double %14
%18 = extractelement <2 x i32> %10, i64 0
%19 = extractelement <2 x i32> %10, i64 1
%20 = tail call i32 @gothic_hall(double %0, double %1, double %2, i32 %18, i32 %19, double %17, i32 %3)
ret void
}