#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*/ bzero(int *, int);
int check_num_brc_loose(int, int *, int, int);
int /*<<< orphan*/ check_single();
int /*<<< orphan*/ fill_brc_double(int, int, int *, int);
int mtop(int);
void check_double_value_loose(void) {
  int i;
  int mask;
  int a_brc[3] = {0, 0, 0};
  int brc = 0;
  int ret = 0;
  for (mask = 0x001; mask <= 0x1ff; mask++) {
    for (i = 0; i < 9; i++) {
      for (brc = 0; brc < 3; brc++) {
        bzero(a_brc, sizeof(int) * 3);
        ret = check_num_brc_loose(brc, a_brc, i, mask);
        if ((ret < 10) && (ret == mtop(mask))) {
          fill_brc_double(brc, i, a_brc, mask);
          check_single();
        }
      }
    }
  }
}


x86 assembly (clang, -O0):
<check_double_value_loose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x14(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1040 <memset@plt>
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x1ff,-0x8(%rbp)
jg     1256 <check_double_value_loose+0xf6>
movl   $0x0,-0x4(%rbp)
cmpl   $0x9,-0x4(%rbp)
jge    1243 <check_double_value_loose+0xe3>
movl   $0x0,-0x18(%rbp)
cmpl   $0x3,-0x18(%rbp)
jge    1230 <check_double_value_loose+0xd0>
lea    -0x14(%rbp),%rdi
mov    $0xc,%esi
call   1060 <bzero@plt>
mov    -0x18(%rbp),%edi
lea    -0x14(%rbp),%rsi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
call   1080 <check_num_brc_loose@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xa,-0x1c(%rbp)
jge    121d <check_double_value_loose+0xbd>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%edi
call   1070 <mtop@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
cmp    %ecx,%eax
jne    121d <check_double_value_loose+0xbd>
mov    -0x18(%rbp),%edi
mov    -0x4(%rbp),%esi
lea    -0x14(%rbp),%rdx
mov    -0x8(%rbp),%ecx
call   1050 <fill_brc_double@plt>
mov    $0x0,%al
call   1030 <check_single@plt>
jmp    1222 <check_double_value_loose+0xc2>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11b2 <check_double_value_loose+0x52>
jmp    1235 <check_double_value_loose+0xd5>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    11a1 <check_double_value_loose+0x41>
jmp    1248 <check_double_value_loose+0xe8>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    118d <check_double_value_loose+0x2d>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_double_value_loose>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
movl   $0x0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
mov    $0x1,%r15d
lea    0x8(%rsp),%r14
jmp    1191 <check_double_value_loose+0x41>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r15d
cmp    $0x200,%r15d
je     1290 <check_double_value_loose+0x140>
xor    %ebp,%ebp
jmp    11a8 <check_double_value_loose+0x58>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%ebp
cmp    $0x9,%ebp
je     1180 <check_double_value_loose+0x30>
mov    %r14,%rdi
mov    $0xc,%esi
call   1050 <bzero@plt>
xor    %edi,%edi
mov    %r14,%rsi
mov    %ebp,%edx
mov    %r15d,%ecx
call   1070 <check_num_brc_loose@plt>
cmp    $0x9,%eax
jg     11ed <check_double_value_loose+0x9d>
mov    %eax,%ebx
mov    %r15d,%edi
call   1060 <mtop@plt>
cmp    %eax,%ebx
jne    11ed <check_double_value_loose+0x9d>
xor    %edi,%edi
mov    %ebp,%esi
mov    %r14,%rdx
mov    %r15d,%ecx
call   1040 <fill_brc_double@plt>
xor    %eax,%eax
call   1030 <check_single@plt>
mov    %r14,%rdi
mov    $0xc,%esi
call   1050 <bzero@plt>
mov    $0x1,%edi
mov    %r14,%rsi
mov    %ebp,%edx
mov    %r15d,%ecx
call   1070 <check_num_brc_loose@plt>
cmp    $0x9,%eax
jg     1238 <check_double_value_loose+0xe8>
mov    %eax,%ebx
mov    %r15d,%edi
call   1060 <mtop@plt>
cmp    %eax,%ebx
jne    1238 <check_double_value_loose+0xe8>
mov    $0x1,%edi
mov    %ebp,%esi
mov    %r14,%rdx
mov    %r15d,%ecx
call   1040 <fill_brc_double@plt>
xor    %eax,%eax
call   1030 <check_single@plt>
mov    %r14,%rdi
mov    $0xc,%esi
call   1050 <bzero@plt>
mov    $0x2,%edi
mov    %r14,%rsi
mov    %ebp,%edx
mov    %r15d,%ecx
call   1070 <check_num_brc_loose@plt>
cmp    $0x9,%eax
jg     11a0 <check_double_value_loose+0x50>
mov    %eax,%ebx
mov    %r15d,%edi
call   1060 <mtop@plt>
cmp    %eax,%ebx
jne    11a0 <check_double_value_loose+0x50>
mov    $0x2,%edi
mov    %ebp,%esi
mov    %r14,%rdx
mov    %r15d,%ecx
call   1040 <fill_brc_double@plt>
xor    %eax,%eax
call   1030 <check_single@plt>
jmp    11a0 <check_double_value_loose+0x50>
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @check_double_value_loose() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [3 x i32]
%4 = alloca i32
%5 = alloca i32
%6 = bitcast [3 x i32]* %3 to i8*
store i32 0, i32* %4
store i32 0, i32* %5
store i32 1, i32* %2
br label %7
7: ; preds = %49, %0
%8 = load i32, i32* %2
%9 = icmp sle i32 %8, 511
br i1 %9, label %10, label %52
10: ; preds = %7
store i32 0, i32* %1
br label %11
11: ; preds = %45, %10
%12 = load i32, i32* %1
%13 = icmp slt i32 %12, 9
br i1 %13, label %14, label %48
14: ; preds = %11
store i32 0, i32* %4
br label %15
15: ; preds = %41, %14
%16 = load i32, i32* %4
%17 = icmp slt i32 %16, 3
br i1 %17, label %18, label %44
18: ; preds = %15
%19 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
%20 = call i32 @bzero(i32* %19, i32 12)
%21 = load i32, i32* %4
%22 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
%23 = load i32, i32* %1
%24 = load i32, i32* %2
%25 = call i32 @check_num_brc_loose(i32 %21, i32* %22, i32 %23, i32 %24)
store i32 %25, i32* %5
%26 = load i32, i32* %5
%27 = icmp slt i32 %26, 10
br i1 %27, label %28, label %40
28: ; preds = %18
%29 = load i32, i32* %5
%30 = load i32, i32* %2
%31 = call i32 @mtop(i32 %30)
%32 = icmp eq i32 %29, %31
br i1 %32, label %33, label %40
33: ; preds = %28
%34 = load i32, i32* %4
%35 = load i32, i32* %1
%36 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
%37 = load i32, i32* %2
%38 = call i32 @fill_brc_double(i32 %34, i32 %35, i32* %36, i32 %37)
%39 = call i32 (...) @check_single()
br label %40
40: ; preds = %33, %28, %18
br label %41
41: ; preds = %40
%42 = load i32, i32* %4
%43 = add nsw i32 %42, 1
store i32 %43, i32* %4
br label %15
44: ; preds = %15
br label %45
45: ; preds = %44
%46 = load i32, i32* %1
%47 = add nsw i32 %46, 1
store i32 %47, i32* %1
br label %11
48: ; preds = %11
br label %49
49: ; preds = %48
%50 = load i32, i32* %2
%51 = add nsw i32 %50, 1
store i32 %51, i32* %2
br label %7
52: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @check_double_value_loose() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
br label %4
4: ; preds = %0, %40
%5 = phi i32 [ 1, %0 ], [ %41, %40 ]
br label %6
6: ; preds = %4, %37
%7 = phi i32 [ 0, %4 ], [ %38, %37 ]
%8 = call i32 @bzero(i32* %3, i32 12)
%9 = call i32 @check_num_brc_loose(i32 0, i32* %3, i32 %7, i32 %5)
%10 = icmp slt i32 %9, 10
br i1 %10, label %11, label %17
11: ; preds = %6
%12 = call i32 @mtop(i32 %5)
%13 = icmp eq i32 %9, %12
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = call i32 @fill_brc_double(i32 0, i32 %7, i32* %3, i32 %5)
%16 = call i32 (...) @check_single()
br label %17
17: ; preds = %6, %11, %14
%18 = call i32 @bzero(i32* %3, i32 12)
%19 = call i32 @check_num_brc_loose(i32 1, i32* %3, i32 %7, i32 %5)
%20 = icmp slt i32 %19, 10
br i1 %20, label %21, label %27
21: ; preds = %17
%22 = call i32 @mtop(i32 %5)
%23 = icmp eq i32 %19, %22
br i1 %23, label %24, label %27
24: ; preds = %21
%25 = call i32 @fill_brc_double(i32 1, i32 %7, i32* %3, i32 %5)
%26 = call i32 (...) @check_single()
br label %27
27: ; preds = %24, %21, %17
%28 = call i32 @bzero(i32* %3, i32 12)
%29 = call i32 @check_num_brc_loose(i32 2, i32* %3, i32 %7, i32 %5)
%30 = icmp slt i32 %29, 10
br i1 %30, label %31, label %37
31: ; preds = %27
%32 = call i32 @mtop(i32 %5)
%33 = icmp eq i32 %29, %32
br i1 %33, label %34, label %37
34: ; preds = %31
%35 = call i32 @fill_brc_double(i32 2, i32 %7, i32* %3, i32 %5)
%36 = call i32 (...) @check_single()
br label %37
37: ; preds = %34, %31, %27
%38 = add nuw nsw i32 %7, 1
%39 = icmp eq i32 %38, 9
br i1 %39, label %40, label %6
40: ; preds = %37
%41 = add nuw nsw i32 %5, 1
%42 = icmp eq i32 %41, 512
br i1 %42, label %43, label %4
43: ; preds = %40
ret void
}