#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 double GLfloat;

/* Variables and functions */
int /*<<< orphan*/ draw_rectangle(double, double, double, double, double,
                                  double);
int /*<<< orphan*/ glColor3f(double, double, double);
void draw_bar(GLfloat x_offset, GLfloat z_offset, GLfloat height, GLfloat red,
              GLfloat green, GLfloat blue) {
  GLfloat width = 0.1;
  glColor3f(red, green, blue);
  draw_rectangle(x_offset, height, z_offset, x_offset + width, height,
                 z_offset + 0.1);
  draw_rectangle(x_offset, 0, z_offset, x_offset + width, 0, z_offset + 0.1);
  glColor3f(0.5 * red, 0.5 * green, 0.5 * blue);
  draw_rectangle(x_offset, 0.0, z_offset + 0.1, x_offset + width, height,
                 z_offset + 0.1);
  draw_rectangle(x_offset, 0.0, z_offset, x_offset + width, height, z_offset);
  glColor3f(0.25 * red, 0.25 * green, 0.25 * blue);
  draw_rectangle(x_offset, 0.0, z_offset, x_offset, height, z_offset + 0.1);
  draw_rectangle(x_offset + width, 0.0, z_offset, x_offset + width, height,
                 z_offset + 0.1);
}


x86 assembly (clang, -O0):
<draw_bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%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  0xeb2(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
call   1040 <glColor3f@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm3
addsd  -0x38(%rbp),%xmm3
movsd  -0x18(%rbp),%xmm4
movsd  0xe73(%rip),%xmm5
addsd  -0x10(%rbp),%xmm5
call   1030 <draw_rectangle@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm3
addsd  -0x38(%rbp),%xmm3
movsd  0xe4d(%rip),%xmm5
addsd  -0x10(%rbp),%xmm5
xorps  %xmm4,%xmm4
movaps %xmm4,%xmm1
call   1030 <draw_rectangle@plt>
movsd  0xe45(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  0xe38(%rip),%xmm1
mulsd  -0x28(%rbp),%xmm1
movsd  0xe2b(%rip),%xmm2
mulsd  -0x30(%rbp),%xmm2
call   1040 <glColor3f@plt>
movsd  -0x8(%rbp),%xmm0
movsd  0xe04(%rip),%xmm2
addsd  -0x10(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm3
addsd  -0x38(%rbp),%xmm3
movsd  -0x18(%rbp),%xmm4
movsd  0xde8(%rip),%xmm5
addsd  -0x10(%rbp),%xmm5
xorps  %xmm1,%xmm1
call   1030 <draw_rectangle@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm3
addsd  -0x38(%rbp),%xmm3
movsd  -0x18(%rbp),%xmm4
movsd  -0x10(%rbp),%xmm5
xorps  %xmm1,%xmm1
call   1030 <draw_rectangle@plt>
movsd  0xdb5(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  0xda8(%rip),%xmm1
mulsd  -0x28(%rbp),%xmm1
movsd  0xd9b(%rip),%xmm2
mulsd  -0x30(%rbp),%xmm2
call   1040 <glColor3f@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm3
movsd  -0x18(%rbp),%xmm4
movsd  0xd6d(%rip),%xmm5
addsd  -0x10(%rbp),%xmm5
xorps  %xmm1,%xmm1
call   1030 <draw_rectangle@plt>
movsd  -0x8(%rbp),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm3
addsd  -0x38(%rbp),%xmm3
movsd  -0x18(%rbp),%xmm4
movsd  0xd3a(%rip),%xmm5
addsd  -0x10(%rbp),%xmm5
xorps  %xmm1,%xmm1
call   1030 <draw_rectangle@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_bar>:
sub    $0x48,%rsp
movsd  %xmm5,0x40(%rsp)
movsd  %xmm4,0x38(%rsp)
movsd  %xmm3,0x30(%rsp)
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
movaps %xmm3,%xmm0
movaps %xmm4,%xmm1
movaps %xmm5,%xmm2
call   1040 <glColor3f@plt>
movsd  0xea2(%rip),%xmm5
movsd  0x10(%rsp),%xmm0
movapd %xmm0,%xmm3
addsd  %xmm5,%xmm3
movsd  %xmm3,0x28(%rsp)
movsd  0x8(%rsp),%xmm2
addsd  %xmm2,%xmm5
movsd  %xmm5,0x20(%rsp)
movsd  0x18(%rsp),%xmm1
movaps %xmm1,%xmm4
call   1030 <draw_rectangle@plt>
xorps  %xmm1,%xmm1
xorps  %xmm4,%xmm4
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm2
movsd  0x28(%rsp),%xmm3
movsd  0x20(%rsp),%xmm5
call   1030 <draw_rectangle@plt>
movsd  0xe4d(%rip),%xmm2
movsd  0x30(%rsp),%xmm0
mulsd  %xmm2,%xmm0
movsd  0x38(%rsp),%xmm1
mulsd  %xmm2,%xmm1
mulsd  0x40(%rsp),%xmm2
call   1040 <glColor3f@plt>
xorpd  %xmm1,%xmm1
movsd  0x10(%rsp),%xmm0
movsd  0x20(%rsp),%xmm2
movsd  0x28(%rsp),%xmm3
movsd  0x18(%rsp),%xmm4
movaps %xmm2,%xmm5
call   1030 <draw_rectangle@plt>
xorpd  %xmm1,%xmm1
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm2
movsd  0x28(%rsp),%xmm3
movsd  0x18(%rsp),%xmm4
movaps %xmm2,%xmm5
call   1030 <draw_rectangle@plt>
movsd  0xde6(%rip),%xmm3
movsd  0x30(%rsp),%xmm0
mulsd  %xmm3,%xmm0
movsd  0x38(%rsp),%xmm1
mulsd  %xmm3,%xmm1
movsd  0x40(%rsp),%xmm2
mulsd  %xmm3,%xmm2
call   1040 <glColor3f@plt>
xorpd  %xmm1,%xmm1
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm2
movaps %xmm0,%xmm3
movsd  0x18(%rsp),%xmm4
movsd  0x20(%rsp),%xmm5
call   1030 <draw_rectangle@plt>
xorpd  %xmm1,%xmm1
movsd  0x28(%rsp),%xmm0
movsd  0x8(%rsp),%xmm2
movaps %xmm0,%xmm3
movsd  0x18(%rsp),%xmm4
movsd  0x20(%rsp),%xmm5
add    $0x48,%rsp
jmp    1030 <draw_rectangle@plt>

LLVM IR (-O0):
define void @draw_bar(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
%13 = 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
store double 1.000000e-01, double* %13
%14 = load double, double* %10
%15 = load double, double* %11
%16 = load double, double* %12
%17 = call i32 @glColor3f(double %14, double %15, double %16)
%18 = load double, double* %7
%19 = load double, double* %9
%20 = load double, double* %8
%21 = load double, double* %7
%22 = load double, double* %13
%23 = fadd double %21, %22
%24 = load double, double* %9
%25 = load double, double* %8
%26 = fadd double %25, 1.000000e-01
%27 = call i32 @draw_rectangle(double %18, double %19, double %20, double %23, double %24, double %26)
%28 = load double, double* %7
%29 = load double, double* %8
%30 = load double, double* %7
%31 = load double, double* %13
%32 = fadd double %30, %31
%33 = load double, double* %8
%34 = fadd double %33, 1.000000e-01
%35 = call i32 @draw_rectangle(double %28, double 0.000000e+00, double %29, double %32, double 0.000000e+00, double %34)
%36 = load double, double* %10
%37 = fmul double 5.000000e-01, %36
%38 = load double, double* %11
%39 = fmul double 5.000000e-01, %38
%40 = load double, double* %12
%41 = fmul double 5.000000e-01, %40
%42 = call i32 @glColor3f(double %37, double %39, double %41)
%43 = load double, double* %7
%44 = load double, double* %8
%45 = fadd double %44, 1.000000e-01
%46 = load double, double* %7
%47 = load double, double* %13
%48 = fadd double %46, %47
%49 = load double, double* %9
%50 = load double, double* %8
%51 = fadd double %50, 1.000000e-01
%52 = call i32 @draw_rectangle(double %43, double 0.000000e+00, double %45, double %48, double %49, double %51)
%53 = load double, double* %7
%54 = load double, double* %8
%55 = load double, double* %7
%56 = load double, double* %13
%57 = fadd double %55, %56
%58 = load double, double* %9
%59 = load double, double* %8
%60 = call i32 @draw_rectangle(double %53, double 0.000000e+00, double %54, double %57, double %58, double %59)
%61 = load double, double* %10
%62 = fmul double 2.500000e-01, %61
%63 = load double, double* %11
%64 = fmul double 2.500000e-01, %63
%65 = load double, double* %12
%66 = fmul double 2.500000e-01, %65
%67 = call i32 @glColor3f(double %62, double %64, double %66)
%68 = load double, double* %7
%69 = load double, double* %8
%70 = load double, double* %7
%71 = load double, double* %9
%72 = load double, double* %8
%73 = fadd double %72, 1.000000e-01
%74 = call i32 @draw_rectangle(double %68, double 0.000000e+00, double %69, double %70, double %71, double %73)
%75 = load double, double* %7
%76 = load double, double* %13
%77 = fadd double %75, %76
%78 = load double, double* %8
%79 = load double, double* %7
%80 = load double, double* %13
%81 = fadd double %79, %80
%82 = load double, double* %9
%83 = load double, double* %8
%84 = fadd double %83, 1.000000e-01
%85 = call i32 @draw_rectangle(double %77, double 0.000000e+00, double %78, double %81, double %82, double %84)
ret void
}

LLVM IR (-O2):
define void @draw_bar(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = tail call i32 @glColor3f(double %3, double %4, double %5)
%8 = fadd double %0, 1.000000e-01
%9 = fadd double %1, 1.000000e-01
%10 = tail call i32 @draw_rectangle(double %0, double %2, double %1, double %8, double %2, double %9)
%11 = tail call i32 @draw_rectangle(double %0, double 0.000000e+00, double %1, double %8, double 0.000000e+00, double %9)
%12 = fmul double %3, 5.000000e-01
%13 = fmul double %4, 5.000000e-01
%14 = fmul double %5, 5.000000e-01
%15 = tail call i32 @glColor3f(double %12, double %13, double %14)
%16 = tail call i32 @draw_rectangle(double %0, double 0.000000e+00, double %9, double %8, double %2, double %9)
%17 = tail call i32 @draw_rectangle(double %0, double 0.000000e+00, double %1, double %8, double %2, double %1)
%18 = fmul double %3, 2.500000e-01
%19 = fmul double %4, 2.500000e-01
%20 = fmul double %5, 2.500000e-01
%21 = tail call i32 @glColor3f(double %18, double %19, double %20)
%22 = tail call i32 @draw_rectangle(double %0, double 0.000000e+00, double %1, double %0, double %2, double %9)
%23 = tail call i32 @draw_rectangle(double %8, double 0.000000e+00, double %1, double %8, double %2, double %9)
ret void
}