#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 GLUT_DOWN;
int GLUT_LEFT_BUTTON;
int /*<<< orphan*/ glipDisplayColorVal(int, int);
int /*<<< orphan*/ glipGetImageCoord(int, int, int, int *, int *);
int glutGetWindow();
void _glipDefaultMouse(int button, int state, int u, int v) {
  int ny;
  int x, y, win;
  if ((button == GLUT_LEFT_BUTTON) && (state == GLUT_DOWN)) {
    win = glutGetWindow();
    glipGetImageCoord(win, u, v, &x, &y);
    glipDisplayColorVal(x, y);
  }
}


x86 assembly (clang, -O0):
<_glipDefaultMouse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2e8a(%rip),%rcx
cmp    (%rcx),%eax
jne    1193 <_glipDefaultMouse+0x63>
mov    -0x8(%rbp),%eax
mov    0x2e88(%rip),%rcx
cmp    (%rcx),%eax
jne    1193 <_glipDefaultMouse+0x63>
mov    $0x0,%al
call   1030 <glutGetWindow@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    -0x18(%rbp),%rcx
lea    -0x1c(%rbp),%r8
call   1040 <glipGetImageCoord@plt>
mov    -0x18(%rbp),%edi
mov    -0x1c(%rbp),%esi
call   1050 <glipDisplayColorVal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_glipDefaultMouse>:
push   %rbp
push   %rbx
push   %rax
mov    0x2e9e(%rip),%rax
cmp    %edi,(%rax)
jne    1173 <_glipDefaultMouse+0x43>
mov    0x2ea3(%rip),%rax
cmp    %esi,(%rax)
jne    1173 <_glipDefaultMouse+0x43>
mov    %ecx,%ebx
mov    %edx,%ebp
xor    %eax,%eax
call   1030 <glutGetWindow@plt>
lea    0x4(%rsp),%rcx
mov    %rsp,%r8
mov    %eax,%edi
mov    %ebp,%esi
mov    %ebx,%edx
call   1040 <glipGetImageCoord@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1050 <glipDisplayColorVal@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@GLUT_LEFT_BUTTON = global i32 0
@GLUT_DOWN = global i32 0
define void @_glipDefaultMouse(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%13 = load i32, i32* %5
%14 = load i32, i32* @GLUT_LEFT_BUTTON
%15 = icmp eq i32 %13, %14
br i1 %15, label %16, label %29
16: ; preds = %4
%17 = load i32, i32* %6
%18 = load i32, i32* @GLUT_DOWN
%19 = icmp eq i32 %17, %18
br i1 %19, label %20, label %29
20: ; preds = %16
%21 = call i32 (...) @glutGetWindow()
store i32 %21, i32* %12
%22 = load i32, i32* %12
%23 = load i32, i32* %7
%24 = load i32, i32* %8
%25 = call i32 @glipGetImageCoord(i32 %22, i32 %23, i32 %24, i32* %10, i32* %11)
%26 = load i32, i32* %10
%27 = load i32, i32* %11
%28 = call i32 @glipDisplayColorVal(i32 %26, i32 %27)
br label %29
29: ; preds = %20, %16, %4
ret void
}

LLVM IR (-O2):
@GLUT_LEFT_BUTTON = global i32 0
@GLUT_DOWN = global i32 0
define void @_glipDefaultMouse(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = bitcast i32* %5 to i8*
%8 = bitcast i32* %6 to i8*
%9 = load i32, i32* @GLUT_LEFT_BUTTON
%10 = icmp eq i32 %9, %0
%11 = load i32, i32* @GLUT_DOWN
%12 = icmp eq i32 %11, %1
%13 = select i1 %10, i1 %12, i1 false
br i1 %13, label %14, label %20
14: ; preds = %4
%15 = tail call i32 (...) @glutGetWindow()
%16 = call i32 @glipGetImageCoord(i32 %15, i32 %2, i32 %3, i32* %5, i32* %6)
%17 = load i32, i32* %5
%18 = load i32, i32* %6
%19 = call i32 @glipDisplayColorVal(i32 %17, i32 %18)
br label %20
20: ; preds = %14, %4
ret void
}