#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 check_num(int, int, int /*<<< orphan*/);
int /*<<< orphan*/ set_num(int, int, int);
int /*<<< orphan*/ vtom(int);
void check_single(void) {
  int i, num;
  int brc;
  for (num = 1; num < 10; num++) {
    for (i = 0; i < 9; i++) {
      for (brc = 0; brc < 3; brc++) {
        if (check_num(brc, i, vtom(num)) == 1) {
          set_num(brc, i, num);
        }
      }
    }
  }
}


x86 assembly (clang, -O0):
<check_single>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x1,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    11dc <check_single+0xac>
movl   $0x0,-0x4(%rbp)
cmpl   $0x9,-0x4(%rbp)
jge    11c9 <check_single+0x99>
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    11b6 <check_single+0x86>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <vtom@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    %eax,%edx
call   1030 <check_num@plt>
cmp    $0x1,%eax
jne    11a3 <check_single+0x73>
mov    -0xc(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1040 <set_num@plt>
jmp    11a8 <check_single+0x78>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1161 <check_single+0x31>
jmp    11bb <check_single+0x8b>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1150 <check_single+0x20>
jmp    11ce <check_single+0x9e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113f <check_single+0xf>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_single>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebx
jmp    114c <check_single+0x1c>
nopw   0x0(%rax,%rax,1)
add    $0x1,%ebx
cmp    $0xa,%ebx
je     11cc <check_single+0x9c>
xor    %ebp,%ebp
jmp    1158 <check_single+0x28>
add    $0x1,%ebp
cmp    $0x9,%ebp
je     1140 <check_single+0x10>
mov    %ebx,%edi
call   1050 <vtom@plt>
xor    %edi,%edi
mov    %ebp,%esi
mov    %eax,%edx
call   1030 <check_num@plt>
cmp    $0x1,%eax
jne    117a <check_single+0x4a>
xor    %edi,%edi
mov    %ebp,%esi
mov    %ebx,%edx
call   1040 <set_num@plt>
mov    %ebx,%edi
call   1050 <vtom@plt>
mov    $0x1,%edi
mov    %ebp,%esi
mov    %eax,%edx
call   1030 <check_num@plt>
cmp    $0x1,%eax
jne    11a2 <check_single+0x72>
mov    $0x1,%edi
mov    %ebp,%esi
mov    %ebx,%edx
call   1040 <set_num@plt>
mov    %ebx,%edi
call   1050 <vtom@plt>
mov    $0x2,%edi
mov    %ebp,%esi
mov    %eax,%edx
call   1030 <check_num@plt>
cmp    $0x1,%eax
jne    1150 <check_single+0x20>
mov    $0x2,%edi
mov    %ebp,%esi
mov    %ebx,%edx
call   1040 <set_num@plt>
jmp    1150 <check_single+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @check_single() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 1, i32* %2
br label %4
4: ; preds = %36, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 10
br i1 %6, label %7, label %39
7: ; preds = %4
store i32 0, i32* %1
br label %8
8: ; preds = %32, %7
%9 = load i32, i32* %1
%10 = icmp slt i32 %9, 9
br i1 %10, label %11, label %35
11: ; preds = %8
store i32 0, i32* %3
br label %12
12: ; preds = %28, %11
%13 = load i32, i32* %3
%14 = icmp slt i32 %13, 3
br i1 %14, label %15, label %31
15: ; preds = %12
%16 = load i32, i32* %3
%17 = load i32, i32* %1
%18 = load i32, i32* %2
%19 = call i32 @vtom(i32 %18)
%20 = call i32 @check_num(i32 %16, i32 %17, i32 %19)
%21 = icmp eq i32 %20, 1
br i1 %21, label %22, label %27
22: ; preds = %15
%23 = load i32, i32* %3
%24 = load i32, i32* %1
%25 = load i32, i32* %2
%26 = call i32 @set_num(i32 %23, i32 %24, i32 %25)
br label %27
27: ; preds = %22, %15
br label %28
28: ; preds = %27
%29 = load i32, i32* %3
%30 = add nsw i32 %29, 1
store i32 %30, i32* %3
br label %12
31: ; preds = %12
br label %32
32: ; preds = %31
%33 = load i32, i32* %1
%34 = add nsw i32 %33, 1
store i32 %34, i32* %1
br label %8
35: ; preds = %8
br label %36
36: ; preds = %35
%37 = load i32, i32* %2
%38 = add nsw i32 %37, 1
store i32 %38, i32* %2
br label %4
39: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @check_single() {
br label %1
1: ; preds = %0, %25
%2 = phi i32 [ 1, %0 ], [ %26, %25 ]
br label %3
3: ; preds = %1, %22
%4 = phi i32 [ 0, %1 ], [ %23, %22 ]
%5 = tail call i32 @vtom(i32 %2)
%6 = tail call i32 @check_num(i32 0, i32 %4, i32 %5)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = tail call i32 @set_num(i32 0, i32 %4, i32 %2)
br label %10
10: ; preds = %3, %8
%11 = tail call i32 @vtom(i32 %2)
%12 = tail call i32 @check_num(i32 1, i32 %4, i32 %11)
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = tail call i32 @set_num(i32 1, i32 %4, i32 %2)
br label %16
16: ; preds = %14, %10
%17 = tail call i32 @vtom(i32 %2)
%18 = tail call i32 @check_num(i32 2, i32 %4, i32 %17)
%19 = icmp eq i32 %18, 1
br i1 %19, label %20, label %22
20: ; preds = %16
%21 = tail call i32 @set_num(i32 2, i32 %4, i32 %2)
br label %22
22: ; preds = %20, %16
%23 = add nuw nsw i32 %4, 1
%24 = icmp eq i32 %23, 9
br i1 %24, label %25, label %3
25: ; preds = %22
%26 = add nuw nsw i32 %2, 1
%27 = icmp eq i32 %26, 10
br i1 %27, label %28, label %1
28: ; preds = %25
ret void
}