#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*/ draw_line_with_extras(int, int, float, float, float);
void draw_line(int line, int selected) {
  static float colors[4][3] = {
      {1, 0, 0},
      {0, 1, 0},
      {0, 0, 1},
      {0.5, 0, 1},
  };
  float r = colors[line][0];
  float g = colors[line][1];
  float b = colors[line][2];
  draw_line_with_extras(line, selected, r, g, b);
}


x86 assembly (clang, -O0):
<draw_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x4(%rbp),%rcx
lea    0x2f07(%rip),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movss  (%rax),%xmm0
movss  %xmm0,-0xc(%rbp)
movslq -0x4(%rbp),%rcx
lea    0x2eec(%rip),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movss  0x4(%rax),%xmm0
movss  %xmm0,-0x10(%rbp)
movslq -0x4(%rbp),%rcx
lea    0x2ed0(%rip),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movss  0x8(%rax),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
movss  -0x14(%rbp),%xmm2
call   1030 <draw_line_with_extras@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_line>:
movslq %edi,%rdi
lea    (%rdi,%rdi,2),%rax
lea    0xee2(%rip),%rcx
movss  (%rcx,%rax,4),%xmm0
movss  0x4(%rcx,%rax,4),%xmm1
movss  0x8(%rcx,%rax,4),%xmm2
jmp    1030 <draw_line_with_extras@plt>

LLVM IR (-O0):
@draw_line.colors = internal global [4 x [3 x float]] [[3 x float] [float 1.000000e+00, float 0.000000e+00, float 0.000000e+00], [3 x float] [float 0.000000e+00, float 1.000000e+00, float 0.000000e+00], [3 x float] [float 0.000000e+00, float 0.000000e+00, float 1.000000e+00], [3 x float] [float 5.000000e-01, float 0.000000e+00, float 1.000000e+00]]
define void @draw_line(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
%6 = alloca float
%7 = alloca float
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [4 x [3 x float]], [4 x [3 x float]]* @draw_line.colors, i64 0, i64 %9
%11 = getelementptr inbounds [3 x float], [3 x float]* %10, i64 0, i64 0
%12 = load float, float* %11
store float %12, float* %5
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [4 x [3 x float]], [4 x [3 x float]]* @draw_line.colors, i64 0, i64 %14
%16 = getelementptr inbounds [3 x float], [3 x float]* %15, i64 0, i64 1
%17 = load float, float* %16
store float %17, float* %6
%18 = load i32, i32* %3
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [4 x [3 x float]], [4 x [3 x float]]* @draw_line.colors, i64 0, i64 %19
%21 = getelementptr inbounds [3 x float], [3 x float]* %20, i64 0, i64 2
%22 = load float, float* %21
store float %22, float* %7
%23 = load i32, i32* %3
%24 = load i32, i32* %4
%25 = load float, float* %5
%26 = load float, float* %6
%27 = load float, float* %7
%28 = call i32 @draw_line_with_extras(i32 %23, i32 %24, float %25, float %26, float %27)
ret void
}

LLVM IR (-O2):
@draw_line.colors = internal unnamed_addr constant [4 x [3 x float]] [[3 x float] [float 1.000000e+00, float 0.000000e+00, float 0.000000e+00], [3 x float] [float 0.000000e+00, float 1.000000e+00, float 0.000000e+00], [3 x float] [float 0.000000e+00, float 0.000000e+00, float 1.000000e+00], [3 x float] [float 5.000000e-01, float 0.000000e+00, float 1.000000e+00]]
define void @draw_line(i32 %0, i32 %1) {
%3 = sext i32 %0 to i64
%4 = getelementptr inbounds [4 x [3 x float]], [4 x [3 x float]]* @draw_line.colors, i64 0, i64 %3, i64 0
%5 = load float, float* %4
%6 = getelementptr inbounds [4 x [3 x float]], [4 x [3 x float]]* @draw_line.colors, i64 0, i64 %3, i64 1
%7 = load float, float* %6
%8 = getelementptr inbounds [4 x [3 x float]], [4 x [3 x float]]* @draw_line.colors, i64 0, i64 %3, i64 2
%9 = load float, float* %8
%10 = tail call i32 @draw_line_with_extras(i32 %0, i32 %1, float %5, float %7, float %9)
ret void
}