#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*/ mcdis_line(double, double, double, double, double, double);
int /*<<< orphan*/ mcdis_rectangle(char *, double, double, double, double,
                                   double);
void mcdis_box(double x, double y, double z, double width, double height,
               double length) {
  mcdis_rectangle("xy", x, y, z - length / 2, width, height);
  mcdis_rectangle("xy", x, y, z + length / 2, width, height);
  mcdis_line(x - width / 2, y - height / 2, z - length / 2, x - width / 2,
             y - height / 2, z + length / 2);
  mcdis_line(x - width / 2, y + height / 2, z - length / 2, x - width / 2,
             y + height / 2, z + length / 2);
  mcdis_line(x + width / 2, y - height / 2, z - length / 2, x + width / 2,
             y - height / 2, z + length / 2);
  mcdis_line(x + width / 2, y + height / 2, z - length / 2, x + width / 2,
             y + height / 2, z + length / 2);
}


x86 assembly (clang, -O0):
<mcdis_box>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm3
movsd  0xe9e(%rip),%xmm4
divsd  %xmm4,%xmm3
subsd  %xmm3,%xmm2
movsd  -0x20(%rbp),%xmm3
movsd  -0x28(%rbp),%xmm4
lea    0xe8d(%rip),%rdi
call   1030 <mcdis_rectangle@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm3
movsd  0xe64(%rip),%xmm4
divsd  %xmm4,%xmm3
addsd  %xmm3,%xmm2
movsd  -0x20(%rbp),%xmm3
movsd  -0x28(%rbp),%xmm4
lea    0xe53(%rip),%rdi
call   1030 <mcdis_rectangle@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  0xe34(%rip),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  0xe1a(%rip),%xmm3
divsd  %xmm3,%xmm2
subsd  %xmm2,%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm3
movsd  0xe00(%rip),%xmm4
divsd  %xmm4,%xmm3
subsd  %xmm3,%xmm2
movsd  -0x8(%rbp),%xmm3
movsd  -0x20(%rbp),%xmm4
movsd  0xde6(%rip),%xmm5
divsd  %xmm5,%xmm4
subsd  %xmm4,%xmm3
movsd  -0x10(%rbp),%xmm4
movsd  -0x28(%rbp),%xmm5
movsd  0xdcc(%rip),%xmm6
divsd  %xmm6,%xmm5
subsd  %xmm5,%xmm4
movsd  -0x18(%rbp),%xmm5
movsd  -0x30(%rbp),%xmm6
movsd  0xdb2(%rip),%xmm7
divsd  %xmm7,%xmm6
addsd  %xmm6,%xmm5
call   1040 <mcdis_line@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  0xd93(%rip),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  0xd79(%rip),%xmm3
divsd  %xmm3,%xmm2
addsd  %xmm2,%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm3
movsd  0xd5f(%rip),%xmm4
divsd  %xmm4,%xmm3
subsd  %xmm3,%xmm2
movsd  -0x8(%rbp),%xmm3
movsd  -0x20(%rbp),%xmm4
movsd  0xd45(%rip),%xmm5
divsd  %xmm5,%xmm4
subsd  %xmm4,%xmm3
movsd  -0x10(%rbp),%xmm4
movsd  -0x28(%rbp),%xmm5
movsd  0xd2b(%rip),%xmm6
divsd  %xmm6,%xmm5
addsd  %xmm5,%xmm4
movsd  -0x18(%rbp),%xmm5
movsd  -0x30(%rbp),%xmm6
movsd  0xd11(%rip),%xmm7
divsd  %xmm7,%xmm6
addsd  %xmm6,%xmm5
call   1040 <mcdis_line@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  0xcf2(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  0xcd8(%rip),%xmm3
divsd  %xmm3,%xmm2
subsd  %xmm2,%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm3
movsd  0xcbe(%rip),%xmm4
divsd  %xmm4,%xmm3
subsd  %xmm3,%xmm2
movsd  -0x8(%rbp),%xmm3
movsd  -0x20(%rbp),%xmm4
movsd  0xca4(%rip),%xmm5
divsd  %xmm5,%xmm4
addsd  %xmm4,%xmm3
movsd  -0x10(%rbp),%xmm4
movsd  -0x28(%rbp),%xmm5
movsd  0xc8a(%rip),%xmm6
divsd  %xmm6,%xmm5
subsd  %xmm5,%xmm4
movsd  -0x18(%rbp),%xmm5
movsd  -0x30(%rbp),%xmm6
movsd  0xc70(%rip),%xmm7
divsd  %xmm7,%xmm6
addsd  %xmm6,%xmm5
call   1040 <mcdis_line@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  0xc51(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  0xc37(%rip),%xmm3
divsd  %xmm3,%xmm2
addsd  %xmm2,%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm3
movsd  0xc1d(%rip),%xmm4
divsd  %xmm4,%xmm3
subsd  %xmm3,%xmm2
movsd  -0x8(%rbp),%xmm3
movsd  -0x20(%rbp),%xmm4
movsd  0xc03(%rip),%xmm5
divsd  %xmm5,%xmm4
addsd  %xmm4,%xmm3
movsd  -0x10(%rbp),%xmm4
movsd  -0x28(%rbp),%xmm5
movsd  0xbe9(%rip),%xmm6
divsd  %xmm6,%xmm5
addsd  %xmm5,%xmm4
movsd  -0x18(%rbp),%xmm5
movsd  -0x30(%rbp),%xmm6
movsd  0xbcf(%rip),%xmm7
divsd  %xmm7,%xmm6
addsd  %xmm6,%xmm5
call   1040 <mcdis_line@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mcdis_box>:
push   %rbx
sub    $0x40,%rsp
movsd  %xmm4,(%rsp)
movsd  %xmm3,0x8(%rsp)
movsd  %xmm2,0x20(%rsp)
movsd  %xmm1,0x28(%rsp)
movsd  %xmm0,0x30(%rsp)
mulsd  0xeb6(%rip),%xmm5
movsd  %xmm5,0x10(%rsp)
subsd  %xmm5,%xmm2
movsd  %xmm2,0x18(%rsp)
lea    0xea7(%rip),%rbx
mov    %rbx,%rdi
call   1030 <mcdis_rectangle@plt>
movsd  0x10(%rsp),%xmm2
addsd  0x20(%rsp),%xmm2
movsd  %xmm2,0x10(%rsp)
mov    %rbx,%rdi
movsd  0x30(%rsp),%xmm0
movsd  0x28(%rsp),%xmm1
movsd  0x8(%rsp),%xmm3
movsd  (%rsp),%xmm4
call   1030 <mcdis_rectangle@plt>
movsd  0x8(%rsp),%xmm0
movsd  0xe58(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x30(%rsp),%xmm3
subsd  %xmm0,%xmm3
movsd  %xmm3,0x38(%rsp)
movsd  (%rsp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
movsd  0x28(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x20(%rsp)
movapd %xmm3,%xmm0
movsd  0x18(%rsp),%xmm2
movapd %xmm1,%xmm4
movsd  0x10(%rsp),%xmm5
call   1040 <mcdis_line@plt>
movsd  (%rsp),%xmm1
addsd  0x28(%rsp),%xmm1
movsd  %xmm1,(%rsp)
movsd  0x38(%rsp),%xmm0
movsd  0x18(%rsp),%xmm2
movaps %xmm0,%xmm3
movapd %xmm1,%xmm4
movsd  0x10(%rsp),%xmm5
call   1040 <mcdis_line@plt>
movsd  0x8(%rsp),%xmm0
addsd  0x30(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x20(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
movapd %xmm0,%xmm3
movaps %xmm1,%xmm4
movsd  0x10(%rsp),%xmm5
call   1040 <mcdis_line@plt>
movsd  0x8(%rsp),%xmm0
movsd  (%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
movaps %xmm0,%xmm3
movaps %xmm1,%xmm4
movsd  0x10(%rsp),%xmm5
add    $0x40,%rsp
pop    %rbx
jmp    1040 <mcdis_line@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"xy\00"
define void @mcdis_box(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%13 = load double, double* %7
%14 = load double, double* %8
%15 = load double, double* %9
%16 = load double, double* %12
%17 = fdiv double %16, 2.000000e+00
%18 = fsub double %15, %17
%19 = load double, double* %10
%20 = load double, double* %11
%21 = call i32 @mcdis_rectangle(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %13, double %14, double %18, double %19, double %20)
%22 = load double, double* %7
%23 = load double, double* %8
%24 = load double, double* %9
%25 = load double, double* %12
%26 = fdiv double %25, 2.000000e+00
%27 = fadd double %24, %26
%28 = load double, double* %10
%29 = load double, double* %11
%30 = call i32 @mcdis_rectangle(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %22, double %23, double %27, double %28, double %29)
%31 = load double, double* %7
%32 = load double, double* %10
%33 = fdiv double %32, 2.000000e+00
%34 = fsub double %31, %33
%35 = load double, double* %8
%36 = load double, double* %11
%37 = fdiv double %36, 2.000000e+00
%38 = fsub double %35, %37
%39 = load double, double* %9
%40 = load double, double* %12
%41 = fdiv double %40, 2.000000e+00
%42 = fsub double %39, %41
%43 = load double, double* %7
%44 = load double, double* %10
%45 = fdiv double %44, 2.000000e+00
%46 = fsub double %43, %45
%47 = load double, double* %8
%48 = load double, double* %11
%49 = fdiv double %48, 2.000000e+00
%50 = fsub double %47, %49
%51 = load double, double* %9
%52 = load double, double* %12
%53 = fdiv double %52, 2.000000e+00
%54 = fadd double %51, %53
%55 = call i32 @mcdis_line(double %34, double %38, double %42, double %46, double %50, double %54)
%56 = load double, double* %7
%57 = load double, double* %10
%58 = fdiv double %57, 2.000000e+00
%59 = fsub double %56, %58
%60 = load double, double* %8
%61 = load double, double* %11
%62 = fdiv double %61, 2.000000e+00
%63 = fadd double %60, %62
%64 = load double, double* %9
%65 = load double, double* %12
%66 = fdiv double %65, 2.000000e+00
%67 = fsub double %64, %66
%68 = load double, double* %7
%69 = load double, double* %10
%70 = fdiv double %69, 2.000000e+00
%71 = fsub double %68, %70
%72 = load double, double* %8
%73 = load double, double* %11
%74 = fdiv double %73, 2.000000e+00
%75 = fadd double %72, %74
%76 = load double, double* %9
%77 = load double, double* %12
%78 = fdiv double %77, 2.000000e+00
%79 = fadd double %76, %78
%80 = call i32 @mcdis_line(double %59, double %63, double %67, double %71, double %75, double %79)
%81 = load double, double* %7
%82 = load double, double* %10
%83 = fdiv double %82, 2.000000e+00
%84 = fadd double %81, %83
%85 = load double, double* %8
%86 = load double, double* %11
%87 = fdiv double %86, 2.000000e+00
%88 = fsub double %85, %87
%89 = load double, double* %9
%90 = load double, double* %12
%91 = fdiv double %90, 2.000000e+00
%92 = fsub double %89, %91
%93 = load double, double* %7
%94 = load double, double* %10
%95 = fdiv double %94, 2.000000e+00
%96 = fadd double %93, %95
%97 = load double, double* %8
%98 = load double, double* %11
%99 = fdiv double %98, 2.000000e+00
%100 = fsub double %97, %99
%101 = load double, double* %9
%102 = load double, double* %12
%103 = fdiv double %102, 2.000000e+00
%104 = fadd double %101, %103
%105 = call i32 @mcdis_line(double %84, double %88, double %92, double %96, double %100, double %104)
%106 = load double, double* %7
%107 = load double, double* %10
%108 = fdiv double %107, 2.000000e+00
%109 = fadd double %106, %108
%110 = load double, double* %8
%111 = load double, double* %11
%112 = fdiv double %111, 2.000000e+00
%113 = fadd double %110, %112
%114 = load double, double* %9
%115 = load double, double* %12
%116 = fdiv double %115, 2.000000e+00
%117 = fsub double %114, %116
%118 = load double, double* %7
%119 = load double, double* %10
%120 = fdiv double %119, 2.000000e+00
%121 = fadd double %118, %120
%122 = load double, double* %8
%123 = load double, double* %11
%124 = fdiv double %123, 2.000000e+00
%125 = fadd double %122, %124
%126 = load double, double* %9
%127 = load double, double* %12
%128 = fdiv double %127, 2.000000e+00
%129 = fadd double %126, %128
%130 = call i32 @mcdis_line(double %109, double %113, double %117, double %121, double %125, double %129)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"xy\00"
define void @mcdis_box(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = fmul double %5, 5.000000e-01
%8 = fsub double %2, %7
%9 = tail call i32 @mcdis_rectangle(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %0, double %1, double %8, double %3, double %4)
%10 = fadd double %7, %2
%11 = tail call i32 @mcdis_rectangle(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %0, double %1, double %10, double %3, double %4)
%12 = fmul double %3, 5.000000e-01
%13 = fsub double %0, %12
%14 = fmul double %4, 5.000000e-01
%15 = fsub double %1, %14
%16 = tail call i32 @mcdis_line(double %13, double %15, double %8, double %13, double %15, double %10)
%17 = fadd double %14, %1
%18 = tail call i32 @mcdis_line(double %13, double %17, double %8, double %13, double %17, double %10)
%19 = fadd double %12, %0
%20 = tail call i32 @mcdis_line(double %19, double %15, double %8, double %19, double %15, double %10)
%21 = tail call i32 @mcdis_line(double %19, double %17, double %8, double %19, double %17, double %10)
ret void
}