#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*/ GL_VERSION;
scalar_t__ glGetString(int /*<<< orphan*/);
int sscanf(char const *, char *, int *, int *);
int supportsOneDotOne(void) {
  const char *version;
  int major, minor;
  version = (char *)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>
xor    %eax,%eax
cmpl   $0x1,-0x14(%rbp)
mov    %al,-0x19(%rbp)
jl     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   $0x0,0x4(%rsp)
setg   %al
cmpl   $0x0,(%rsp)
setg   %cl
and    %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 i8*
%3 = alloca i32
%4 = alloca i32
%5 = load i32, i32* @GL_VERSION
%6 = call i64 @glGetString(i32 %5)
%7 = inttoptr i64 %6 to i8*
store i8* %7, i8** %2
%8 = load i8*, i8** %2
%9 = call i32 @sscanf(i8* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4)
%10 = icmp eq i32 %9, 2
br i1 %10, label %11, label %20
11: ; preds = %0
%12 = load i32, i32* %3
%13 = icmp sge i32 %12, 1
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i32, i32* %4
%16 = icmp sge i32 %15, 1
br label %17
17: ; preds = %14, %11
%18 = phi i1 [ false, %11 ], [ %16, %14 ]
%19 = zext i1 %18 to i32
store i32 %19, i32* %1
br label %21
20: ; preds = %0
store i32 0, i32* %1
br label %21
21: ; preds = %20, %17
%22 = load i32, i32* %1
ret i32 %22
}

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 i64 @glGetString(i32 %5)
%7 = inttoptr i64 %6 to i8*
%8 = call i32 @sscanf(i8* %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%9 = icmp eq i32 %8, 2
br i1 %9, label %10, label %17
10: ; preds = %0
%11 = load i32, i32* %1
%12 = icmp sgt i32 %11, 0
%13 = load i32, i32* %2
%14 = icmp sgt i32 %13, 0
%15 = select i1 %12, i1 %14, i1 false
%16 = zext i1 %15 to i32
br label %17
17: ; preds = %0, %10
%18 = phi i32 [ %16, %10 ], [ 0, %0 ]
ret i32 %18
}