#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*/ GLUT_HAS_DIAL_AND_BUTTON_BOX;
int /*<<< orphan*/ GLUT_HAS_KEYBOARD;
int /*<<< orphan*/ GLUT_HAS_MOUSE;
int /*<<< orphan*/ GLUT_HAS_SPACEBALL;
int /*<<< orphan*/ GLUT_HAS_TABLET;
int /*<<< orphan*/ GLUT_NUM_BUTTON_BOX_BUTTONS;
int /*<<< orphan*/ GLUT_NUM_DIALS;
int /*<<< orphan*/ GLUT_NUM_MOUSE_BUTTONS;
int /*<<< orphan*/ GLUT_NUM_SPACEBALL_BUTTONS;
int /*<<< orphan*/ GLUT_NUM_TABLET_BUTTONS;
int glutDeviceGet(int /*<<< orphan*/);
int /*<<< orphan*/ glutInit(int *, char **);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  glutInit(&argc, argv);
  printf("Keyboard:  %s\n", glutDeviceGet(GLUT_HAS_KEYBOARD) ? "YES" : "no");
  printf("Mouse:     %s\n", glutDeviceGet(GLUT_HAS_MOUSE) ? "YES" : "no");
  printf("Spaceball: %s\n", glutDeviceGet(GLUT_HAS_SPACEBALL) ? "YES" : "no");
  printf("Dials:     %s\n",
         glutDeviceGet(GLUT_HAS_DIAL_AND_BUTTON_BOX) ? "YES" : "no");
  printf("Tablet:    %s\n\n", glutDeviceGet(GLUT_HAS_TABLET) ? "YES" : "no");
  printf("Mouse buttons:      %d\n", glutDeviceGet(GLUT_NUM_MOUSE_BUTTONS));
  printf("Spaceball buttons:  %d\n", glutDeviceGet(GLUT_NUM_SPACEBALL_BUTTONS));
  printf("Button box buttons: %d\n",
         glutDeviceGet(GLUT_NUM_BUTTON_BOX_BUTTONS));
  printf("Dials:              %d\n", glutDeviceGet(GLUT_NUM_DIALS));
  printf("Tablet buttons:     %d\n\n", glutDeviceGet(GLUT_NUM_TABLET_BUTTONS));
  printf("PASS: test11\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    -0x8(%rbp),%rdi
call   1050 <glutInit@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
call   1040 <glutDeviceGet@plt>
mov    %eax,%ecx
lea    0xea9(%rip),%rsi
lea    0xe9e(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e3b(%rip),%rax
mov    (%rax),%edi
call   1040 <glutDeviceGet@plt>
mov    %eax,%ecx
lea    0xe76(%rip),%rsi
lea    0xe6b(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2df0(%rip),%rax
mov    (%rax),%edi
call   1040 <glutDeviceGet@plt>
mov    %eax,%ecx
lea    0xe43(%rip),%rsi
lea    0xe38(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0xe40(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2df5(%rip),%rax
mov    (%rax),%edi
call   1040 <glutDeviceGet@plt>
mov    %eax,%ecx
lea    0xe10(%rip),%rsi
lea    0xe05(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0xe1c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2d92(%rip),%rax
mov    (%rax),%edi
call   1040 <glutDeviceGet@plt>
mov    %eax,%ecx
lea    0xddd(%rip),%rsi
lea    0xdd2(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0xdf8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2d87(%rip),%rax
mov    (%rax),%edi
call   1040 <glutDeviceGet@plt>
mov    %eax,%esi
lea    0xdea(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2d19(%rip),%rax
mov    (%rax),%edi
call   1040 <glutDeviceGet@plt>
mov    %eax,%esi
lea    0xde4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2d13(%rip),%rax
mov    (%rax),%edi
call   1040 <glutDeviceGet@plt>
mov    %eax,%esi
lea    0xdde(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2d0d(%rip),%rax
mov    (%rax),%edi
call   1040 <glutDeviceGet@plt>
mov    %eax,%esi
lea    0xdd8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2cc7(%rip),%rax
mov    (%rax),%edi
call   1040 <glutDeviceGet@plt>
mov    %eax,%esi
lea    0xdd2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xddd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1060 <glutInit@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <glutDeviceGet@plt>
test   %eax,%eax
lea    0xeaa(%rip),%r14
lea    0xe9f(%rip),%rbx
mov    %rbx,%rsi
cmove  %r14,%rsi
lea    0xe82(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2e3c(%rip),%rax
mov    (%rax),%edi
call   1050 <glutDeviceGet@plt>
test   %eax,%eax
mov    %rbx,%rsi
cmove  %r14,%rsi
lea    0xe73(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2dff(%rip),%rax
mov    (%rax),%edi
call   1050 <glutDeviceGet@plt>
test   %eax,%eax
mov    %rbx,%rsi
cmove  %r14,%rsi
lea    0xe5d(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2e12(%rip),%rax
mov    (%rax),%edi
call   1050 <glutDeviceGet@plt>
test   %eax,%eax
mov    %rbx,%rsi
cmove  %r14,%rsi
lea    0xe47(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2dbd(%rip),%rax
mov    (%rax),%edi
call   1050 <glutDeviceGet@plt>
test   %eax,%eax
cmove  %r14,%rbx
lea    0xe34(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2dc0(%rip),%rax
mov    (%rax),%edi
call   1050 <glutDeviceGet@plt>
lea    0xe25(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2d52(%rip),%rax
mov    (%rax),%edi
call   1050 <glutDeviceGet@plt>
lea    0xe1f(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2d4c(%rip),%rax
mov    (%rax),%edi
call   1050 <glutDeviceGet@plt>
lea    0xe19(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2d46(%rip),%rax
mov    (%rax),%edi
call   1050 <glutDeviceGet@plt>
lea    0xe13(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2d00(%rip),%rax
mov    (%rax),%edi
call   1050 <glutDeviceGet@plt>
lea    0xe0d(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe16(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Keyboard: %s\0A\00"
@GLUT_HAS_KEYBOARD = global i32 0
@.str.1 = [4 x i8] c"YES\00"
@.str.2 = [3 x i8] c"no\00"
@.str.3 = [15 x i8] c"Mouse: %s\0A\00"
@GLUT_HAS_MOUSE = global i32 0
@.str.4 = [15 x i8] c"Spaceball: %s\0A\00"
@GLUT_HAS_SPACEBALL = global i32 0
@.str.5 = [15 x i8] c"Dials: %s\0A\00"
@GLUT_HAS_DIAL_AND_BUTTON_BOX = global i32 0
@.str.6 = [16 x i8] c"Tablet: %s\0A\0A\00"
@GLUT_HAS_TABLET = global i32 0
@.str.7 = [24 x i8] c"Mouse buttons: %d\0A\00"
@GLUT_NUM_MOUSE_BUTTONS = global i32 0
@.str.8 = [24 x i8] c"Spaceball buttons: %d\0A\00"
@GLUT_NUM_SPACEBALL_BUTTONS = global i32 0
@.str.9 = [24 x i8] c"Button box buttons: %d\0A\00"
@GLUT_NUM_BUTTON_BOX_BUTTONS = global i32 0
@.str.10 = [24 x i8] c"Dials: %d\0A\00"
@GLUT_NUM_DIALS = global i32 0
@.str.11 = [25 x i8] c"Tablet buttons: %d\0A\0A\00"
@GLUT_NUM_TABLET_BUTTONS = global i32 0
@.str.12 = [14 x i8] c"PASS: test11\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = call i32 @glutInit(i32* %4, i8** %6)
%8 = load i32, i32* @GLUT_HAS_KEYBOARD
%9 = call i32 @glutDeviceGet(i32 %8)
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i64
%12 = select i1 %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = load i32, i32* @GLUT_HAS_MOUSE
%15 = call i32 @glutDeviceGet(i32 %14)
%16 = icmp ne i32 %15, 0
%17 = zext i1 %16 to i64
%18 = select i1 %16, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8* %18)
%20 = load i32, i32* @GLUT_HAS_SPACEBALL
%21 = call i32 @glutDeviceGet(i32 %20)
%22 = icmp ne i32 %21, 0
%23 = zext i1 %22 to i64
%24 = select i1 %22, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* %24)
%26 = load i32, i32* @GLUT_HAS_DIAL_AND_BUTTON_BOX
%27 = call i32 @glutDeviceGet(i32 %26)
%28 = icmp ne i32 %27, 0
%29 = zext i1 %28 to i64
%30 = select i1 %28, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i8* %30)
%32 = load i32, i32* @GLUT_HAS_TABLET
%33 = call i32 @glutDeviceGet(i32 %32)
%34 = icmp ne i32 %33, 0
%35 = zext i1 %34 to i64
%36 = select i1 %34, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), i8* %36)
%38 = load i32, i32* @GLUT_NUM_MOUSE_BUTTONS
%39 = call i32 @glutDeviceGet(i32 %38)
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0), i32 %39)
%41 = load i32, i32* @GLUT_NUM_SPACEBALL_BUTTONS
%42 = call i32 @glutDeviceGet(i32 %41)
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.8, i64 0, i64 0), i32 %42)
%44 = load i32, i32* @GLUT_NUM_BUTTON_BOX_BUTTONS
%45 = call i32 @glutDeviceGet(i32 %44)
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.9, i64 0, i64 0), i32 %45)
%47 = load i32, i32* @GLUT_NUM_DIALS
%48 = call i32 @glutDeviceGet(i32 %47)
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.10, i64 0, i64 0), i32 %48)
%50 = load i32, i32* @GLUT_NUM_TABLET_BUTTONS
%51 = call i32 @glutDeviceGet(i32 %50)
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.11, i64 0, i64 0), i32 %51)
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.12, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Keyboard: %s\0A\00"
@GLUT_HAS_KEYBOARD = global i32 0
@.str.1 = [4 x i8] c"YES\00"
@.str.2 = [3 x i8] c"no\00"
@.str.3 = [15 x i8] c"Mouse: %s\0A\00"
@GLUT_HAS_MOUSE = global i32 0
@.str.4 = [15 x i8] c"Spaceball: %s\0A\00"
@GLUT_HAS_SPACEBALL = global i32 0
@.str.5 = [15 x i8] c"Dials: %s\0A\00"
@GLUT_HAS_DIAL_AND_BUTTON_BOX = global i32 0
@.str.6 = [16 x i8] c"Tablet: %s\0A\0A\00"
@GLUT_HAS_TABLET = global i32 0
@.str.7 = [24 x i8] c"Mouse buttons: %d\0A\00"
@GLUT_NUM_MOUSE_BUTTONS = global i32 0
@.str.8 = [24 x i8] c"Spaceball buttons: %d\0A\00"
@GLUT_NUM_SPACEBALL_BUTTONS = global i32 0
@.str.9 = [24 x i8] c"Button box buttons: %d\0A\00"
@GLUT_NUM_BUTTON_BOX_BUTTONS = global i32 0
@.str.10 = [24 x i8] c"Dials: %d\0A\00"
@GLUT_NUM_DIALS = global i32 0
@.str.11 = [25 x i8] c"Tablet buttons: %d\0A\0A\00"
@GLUT_NUM_TABLET_BUTTONS = global i32 0
@str = [13 x i8] c"PASS: test11\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @glutInit(i32* %3, i8** %1)
%5 = load i32, i32* @GLUT_HAS_KEYBOARD
%6 = call i32 @glutDeviceGet(i32 %5)
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i32, i32* @GLUT_HAS_MOUSE
%11 = call i32 @glutDeviceGet(i32 %10)
%12 = icmp eq i32 %11, 0
%13 = select i1 %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8* %13)
%15 = load i32, i32* @GLUT_HAS_SPACEBALL
%16 = call i32 @glutDeviceGet(i32 %15)
%17 = icmp eq i32 %16, 0
%18 = select i1 %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* %18)
%20 = load i32, i32* @GLUT_HAS_DIAL_AND_BUTTON_BOX
%21 = call i32 @glutDeviceGet(i32 %20)
%22 = icmp eq i32 %21, 0
%23 = select i1 %22, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i8* %23)
%25 = load i32, i32* @GLUT_HAS_TABLET
%26 = call i32 @glutDeviceGet(i32 %25)
%27 = icmp eq i32 %26, 0
%28 = select i1 %27, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), i8* %28)
%30 = load i32, i32* @GLUT_NUM_MOUSE_BUTTONS
%31 = call i32 @glutDeviceGet(i32 %30)
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0), i32 %31)
%33 = load i32, i32* @GLUT_NUM_SPACEBALL_BUTTONS
%34 = call i32 @glutDeviceGet(i32 %33)
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.8, i64 0, i64 0), i32 %34)
%36 = load i32, i32* @GLUT_NUM_BUTTON_BOX_BUTTONS
%37 = call i32 @glutDeviceGet(i32 %36)
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.9, i64 0, i64 0), i32 %37)
%39 = load i32, i32* @GLUT_NUM_DIALS
%40 = call i32 @glutDeviceGet(i32 %39)
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.10, i64 0, i64 0), i32 %40)
%42 = load i32, i32* @GLUT_NUM_TABLET_BUTTONS
%43 = call i32 @glutDeviceGet(i32 %42)
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.11, i64 0, i64 0), i32 %43)
%45 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}