#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*/ float_reps;

/* Variables and functions */
scalar_t__ memcmp(double *, char **, int);
int get_native() {
  static char float_reps[3][8] = {
      {0x41, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
      {0x3f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
      {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3f}};
  static double one = 1.0;
  int i, j;
  j = sizeof(float_reps) / 8;
  for (i = 0; i < j; i++) {
    if (memcmp(&one, float_reps + i, 8) == 0) {
      return (i + 1);
    }
  }
  return (-1);
}


x86 assembly (clang, -O0):
<get_native>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1180 <get_native+0x70>
movslq -0x8(%rbp),%rax
lea    0x2ef3(%rip),%rsi
shl    $0x3,%rax
add    %rax,%rsi
lea    0x2efd(%rip),%rdi
mov    $0x8,%edx
call   1030 <memcmp@plt>
cmp    $0x0,%rax
jne    116d <get_native+0x5d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1187 <get_native+0x77>
jmp    1172 <get_native+0x62>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <get_native+0x16>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_native>:
push   %rax
lea    0x2f30(%rip),%rdi
lea    0x2f11(%rip),%rsi
mov    $0x8,%edx
call   1030 <memcmp@plt>
test   %rax,%rax
je     116d <get_native+0x5d>
lea    0x2f13(%rip),%rdi
lea    0x2efc(%rip),%rsi
mov    $0x8,%edx
call   1030 <memcmp@plt>
test   %rax,%rax
je     1174 <get_native+0x64>
lea    0x2ef6(%rip),%rdi
lea    0x2ee7(%rip),%rsi
mov    $0x8,%edx
call   1030 <memcmp@plt>
neg    %rax
sbb    %eax,%eax
or     $0x3,%eax
pop    %rcx
ret
mov    $0x1,%eax
pop    %rcx
ret
mov    $0x2,%eax
pop    %rcx
ret

LLVM IR (-O0):
@get_native.float_reps = internal global [3 x [8 x i8]] [[8 x i8] c"A\10\00\00\00\00\00\00", [8 x i8] c"?\F0\00\00\00\00\00\00", [8 x i8] c"\00\00\00\00\00\00\F0?"]
@get_native.one = internal global double 1.000000e+00
define i32 @get_native() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 3, i32* %3
store i32 0, i32* %2
br label %4
4: ; preds = %19, %0
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %22
8: ; preds = %4
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [8 x i8], [8 x i8]* getelementptr inbounds ([3 x [8 x i8]], [3 x [8 x i8]]* @get_native.float_reps, i64 0, i64 0), i64 %10
%12 = bitcast [8 x i8]* %11 to i8**
%13 = call i64 @memcmp(double* @get_native.one, i8** %12, i32 8)
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %8
%16 = load i32, i32* %2
%17 = add nsw i32 %16, 1
store i32 %17, i32* %1
br label %23
18: ; preds = %8
br label %19
19: ; preds = %18
%20 = load i32, i32* %2
%21 = add nsw i32 %20, 1
store i32 %21, i32* %2
br label %4
22: ; preds = %4
store i32 -1, i32* %1
br label %23
23: ; preds = %22, %15
%24 = load i32, i32* %1
ret i32 %24
}

LLVM IR (-O2):
@get_native.float_reps = internal global [3 x [8 x i8]] [[8 x i8] c"A\10\00\00\00\00\00\00", [8 x i8] c"?\F0\00\00\00\00\00\00", [8 x i8] c"\00\00\00\00\00\00\F0?"]
@get_native.one = internal global double 1.000000e+00
define i32 @get_native() {
%1 = tail call i64 @memcmp(double* @get_native.one, i8** bitcast ([3 x [8 x i8]]* @get_native.float_reps to i8**), i32 8)
%2 = icmp eq i64 %1, 0
br i1 %2, label %10, label %3
3: ; preds = %0
%4 = tail call i64 @memcmp(double* @get_native.one, i8** bitcast ([8 x i8]* getelementptr inbounds ([3 x [8 x i8]], [3 x [8 x i8]]* @get_native.float_reps, i64 0, i64 1) to i8**), i32 8)
%5 = icmp eq i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i64 @memcmp(double* @get_native.one, i8** bitcast ([8 x i8]* getelementptr inbounds ([3 x [8 x i8]], [3 x [8 x i8]]* @get_native.float_reps, i64 0, i64 2) to i8**), i32 8)
%8 = icmp eq i64 %7, 0
%9 = select i1 %8, i32 3, i32 -1
br label %10
10: ; preds = %6, %0, %3
%11 = phi i32 [ 1, %0 ], [ 2, %3 ], [ %9, %6 ]
ret i32 %11
}