#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 int /*<<< orphan*/ GLubyte;

/* Variables and functions */
int /*<<< orphan*/ GL_VERSION;
int /*<<< orphan*/ *glGetString(int /*<<< orphan*/);
int sscanf(int /*<<< orphan*/ const *, char *, int *, int *);
int supportsOneDotOne(void) {
  const GLubyte *version;
  int major, minor;
  version = glGetString(GL_VERSION);
  if (sscanf(version, "%d.%d", &major, &minor) == 2)
    return major > 1 || minor >= 1;
  return 0;
}


x86 assembly (clang, -O0):
<supportsOneDotOne>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
call   1030 <glGetString@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xebb(%rip),%rsi
lea    -0x14(%rbp),%rdx
lea    -0x18(%rbp),%rcx
call   1040 <sscanf@plt>
cmp    $0x2,%eax
jne    1184 <supportsOneDotOne+0x64>
mov    $0x1,%al
cmpl   $0x1,-0x14(%rbp)
mov    %al,-0x19(%rbp)
jg     1174 <supportsOneDotOne+0x54>
cmpl   $0x1,-0x18(%rbp)
setge  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    118b <supportsOneDotOne+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<supportsOneDotOne>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
call   1030 <glGetString@plt>
lea    0xeca(%rip),%rsi
lea    0x4(%rsp),%rdx
mov    %rsp,%rcx
mov    %rax,%rdi
call   1040 <sscanf@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x2,%ecx
jne    1163 <supportsOneDotOne+0x43>
cmpl   $0x2,0x4(%rsp)
setge  %al
cmpl   $0x0,(%rsp)
setg   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rcx
ret

LLVM IR (-O0):
@GL_VERSION = global i32 0
@.str = [6 x i8] c"%d.%d\00"
define i32 @supportsOneDotOne() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = load i32, i32* @GL_VERSION
%6 = call i32* @glGetString(i32 %5)
store i32* %6, i32** %2
%7 = load i32*, i32** %2
%8 = call i32 @sscanf(i32* %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4)
%9 = icmp eq i32 %8, 2
br i1 %9, label %10, label %19
10: ; preds = %0
%11 = load i32, i32* %3
%12 = icmp sgt i32 %11, 1
br i1 %12, label %16, label %13
13: ; preds = %10
%14 = load i32, i32* %4
%15 = icmp sge i32 %14, 1
br label %16
16: ; preds = %13, %10
%17 = phi i1 [ true, %10 ], [ %15, %13 ]
%18 = zext i1 %17 to i32
store i32 %18, i32* %1
br label %20
19: ; preds = %0
store i32 0, i32* %1
br label %20
20: ; preds = %19, %16
%21 = load i32, i32* %1
ret i32 %21
}

LLVM IR (-O2):
@GL_VERSION = global i32 0
@.str = [6 x i8] c"%d.%d\00"
define i32 @supportsOneDotOne() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = load i32, i32* @GL_VERSION
%6 = tail call i32* @glGetString(i32 %5)
%7 = call i32 @sscanf(i32* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%8 = icmp eq i32 %7, 2
br i1 %8, label %9, label %16
9: ; preds = %0
%10 = load i32, i32* %1
%11 = icmp sgt i32 %10, 1
%12 = load i32, i32* %2
%13 = icmp sgt i32 %12, 0
%14 = select i1 %11, i1 true, i1 %13
%15 = zext i1 %14 to i32
br label %16
16: ; preds = %0, %9
%17 = phi i32 [ %15, %9 ], [ 0, %0 ]
ret i32 %17
}