#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 */
struct dlx {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mkrow(struct dlx *, int *, int);
void mkrows(struct dlx *solver) {
  int r, c, d;
  int nextnode = 0;
  int colnums[4];
  for (r = 1; r <= 9; r++) {
    for (c = 1; c <= 9; c++) {
      for (d = 1; d <= 9; d++) {
        colnums[0] = (9 * (r - 1) + (c - 1));
        colnums[1] = (9 * (r - 1) + (d - 1) + 2 * 81);
        colnums[2] = (9 * (c - 1) + (d - 1) + 81);
        colnums[3] = (9 * ((1 + 3 * ((r - 1) / 3) + ((c - 1) / 3)) - 1) +
                      (d - 1) + 3 * 81);
        mkrow(solver, colnums, nextnode);
        nextnode += 4;
      }
    }
  }
}


x86 assembly (clang, -O0):
<mkrows>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x9,-0xc(%rbp)
jg     1229 <mkrows+0x119>
movl   $0x1,-0x10(%rbp)
cmpl   $0x9,-0x10(%rbp)
jg     1216 <mkrows+0x106>
movl   $0x1,-0x14(%rbp)
cmpl   $0x9,-0x14(%rbp)
jg     1203 <mkrows+0xf3>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
imul   $0x9,%eax,%eax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
add    %ecx,%eax
mov    %eax,-0x30(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
imul   $0x9,%eax,%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
add    %ecx,%eax
add    $0xa2,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
imul   $0x9,%eax,%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
add    %ecx,%eax
add    $0x51,%eax
mov    %eax,-0x28(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
imul   $0x3,%eax,%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x34(%rbp),%eax
add    %ecx,%eax
sub    $0x1,%eax
imul   $0x9,%eax,%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
add    %ecx,%eax
add    $0xf3,%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    -0x18(%rbp),%edx
call   1030 <mkrow@plt>
mov    -0x18(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114c <mkrows+0x3c>
jmp    1208 <mkrows+0xf8>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113b <mkrows+0x2b>
jmp    121b <mkrows+0x10b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112a <mkrows+0x1a>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkrows>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %rdi,%r12
mov    $0x1,%eax
xor    %ecx,%ecx
mov    $0xaaaaaaab,%edx
mov    %rsp,%r15
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rax,0x48(%rsp)
add    $0xffffffff,%eax
lea    0xa2(%rax,%rax,8),%esi
mov    %esi,0x3c(%rsp)
lea    0xa3(%rax,%rax,8),%esi
mov    %esi,0x38(%rsp)
lea    0xa4(%rax,%rax,8),%esi
mov    %esi,0x34(%rsp)
lea    0xa5(%rax,%rax,8),%esi
mov    %esi,0x30(%rsp)
lea    0xa6(%rax,%rax,8),%esi
mov    %esi,0x2c(%rsp)
lea    0xa7(%rax,%rax,8),%esi
mov    %esi,0x28(%rsp)
lea    0xa8(%rax,%rax,8),%esi
mov    %esi,0x24(%rsp)
lea    0xa9(%rax,%rax,8),%esi
mov    %esi,0x20(%rsp)
lea    (%rax,%rax,8),%esi
add    $0xaa,%esi
mov    %esi,0x1c(%rsp)
imul   %rdx,%rax
shr    $0x21,%rax
lea    (%rax,%rax,2),%eax
mov    %eax,0x18(%rsp)
mov    $0x59,%ebp
xor    %eax,%eax
mov    %rcx,0x50(%rsp)
nopl   0x0(%rax,%rax,1)
mov    %rax,0x40(%rsp)
lea    (%rcx,%rax,1),%r13d
lea    -0x8(%rbp),%eax
mov    0x40(%rsp),%r14d
imul   %rdx,%r14
shr    $0x21,%r14
add    0x18(%rsp),%r14d
lea    (%r14,%r14,8),%ecx
add    $0xf3,%ecx
mov    %r13d,(%rsp)
mov    0x3c(%rsp),%edx
mov    %edx,0x4(%rsp)
mov    %eax,0x8(%rsp)
mov    %ecx,0xc(%rsp)
mov    %r12,%rdi
mov    %r15,%rsi
mov    %ebx,%edx
call   1030 <mkrow@plt>
mov    %r13d,(%rsp)
mov    0x38(%rsp),%eax
mov    %eax,0x4(%rsp)
lea    -0x7(%rbp),%eax
mov    %eax,0x8(%rsp)
lea    0xf4(%r14,%r14,8),%eax
mov    %eax,0xc(%rsp)
lea    0x4(%rbx),%edx
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <mkrow@plt>
mov    %r13d,(%rsp)
mov    0x34(%rsp),%eax
mov    %eax,0x4(%rsp)
lea    -0x6(%rbp),%eax
mov    %eax,0x8(%rsp)
lea    0xf5(%r14,%r14,8),%eax
mov    %eax,0xc(%rsp)
lea    0x8(%rbx),%edx
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <mkrow@plt>
mov    %r13d,(%rsp)
mov    0x30(%rsp),%eax
mov    %eax,0x4(%rsp)
lea    -0x5(%rbp),%eax
mov    %eax,0x8(%rsp)
lea    0xf6(%r14,%r14,8),%eax
mov    %eax,0xc(%rsp)
lea    0xc(%rbx),%edx
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <mkrow@plt>
mov    %r13d,(%rsp)
mov    0x2c(%rsp),%eax
mov    %eax,0x4(%rsp)
lea    -0x4(%rbp),%eax
mov    %eax,0x8(%rsp)
lea    0xf7(%r14,%r14,8),%eax
mov    %eax,0xc(%rsp)
lea    0x10(%rbx),%edx
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <mkrow@plt>
mov    %r13d,(%rsp)
mov    0x28(%rsp),%eax
mov    %eax,0x4(%rsp)
lea    -0x3(%rbp),%eax
mov    %eax,0x8(%rsp)
lea    0xf8(%r14,%r14,8),%eax
mov    %eax,0xc(%rsp)
lea    0x14(%rbx),%edx
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <mkrow@plt>
mov    %r13d,(%rsp)
mov    0x24(%rsp),%eax
mov    %eax,0x4(%rsp)
lea    -0x2(%rbp),%eax
mov    %eax,0x8(%rsp)
lea    0xf9(%r14,%r14,8),%eax
mov    %eax,0xc(%rsp)
lea    0x18(%rbx),%edx
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <mkrow@plt>
mov    %r13d,(%rsp)
mov    0x20(%rsp),%eax
mov    %eax,0x4(%rsp)
lea    -0x1(%rbp),%eax
mov    %eax,0x8(%rsp)
lea    0xfa(%r14,%r14,8),%eax
mov    %eax,0xc(%rsp)
lea    0x1c(%rbx),%edx
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <mkrow@plt>
mov    %r13d,(%rsp)
mov    0x1c(%rsp),%eax
mov    %eax,0x4(%rsp)
mov    %ebp,0x8(%rsp)
lea    0xfb(%r14,%r14,8),%eax
mov    %eax,0xc(%rsp)
lea    0x20(%rbx),%edx
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <mkrow@plt>
mov    0x40(%rsp),%rax
mov    $0xaaaaaaab,%edx
mov    0x50(%rsp),%rcx
add    $0x24,%ebx
add    $0x9,%ebp
add    $0x1,%eax
cmp    $0xaa,%ebp
jne    11d0 <mkrows+0xc0>
mov    0x48(%rsp),%rax
add    $0x1,%eax
add    $0x9,%ecx
cmp    $0xa,%eax
jne    1140 <mkrows+0x30>
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.dlx = type { i32 }
define void @mkrows(%struct.dlx* %0) {
%2 = alloca %struct.dlx*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [4 x i32]
store %struct.dlx* %0, %struct.dlx** %2
store i32 0, i32* %6
store i32 1, i32* %3
br label %8
8: ; preds = %73, %1
%9 = load i32, i32* %3
%10 = icmp sle i32 %9, 9
br i1 %10, label %11, label %76
11: ; preds = %8
store i32 1, i32* %4
br label %12
12: ; preds = %69, %11
%13 = load i32, i32* %4
%14 = icmp sle i32 %13, 9
br i1 %14, label %15, label %72
15: ; preds = %12
store i32 1, i32* %5
br label %16
16: ; preds = %65, %15
%17 = load i32, i32* %5
%18 = icmp sle i32 %17, 9
br i1 %18, label %19, label %68
19: ; preds = %16
%20 = load i32, i32* %3
%21 = sub nsw i32 %20, 1
%22 = mul nsw i32 9, %21
%23 = load i32, i32* %4
%24 = sub nsw i32 %23, 1
%25 = add nsw i32 %22, %24
%26 = getelementptr inbounds [4 x i32], [4 x i32]* %7, i64 0, i64 0
store i32 %25, i32* %26
%27 = load i32, i32* %3
%28 = sub nsw i32 %27, 1
%29 = mul nsw i32 9, %28
%30 = load i32, i32* %5
%31 = sub nsw i32 %30, 1
%32 = add nsw i32 %29, %31
%33 = add nsw i32 %32, 162
%34 = getelementptr inbounds [4 x i32], [4 x i32]* %7, i64 0, i64 1
store i32 %33, i32* %34
%35 = load i32, i32* %4
%36 = sub nsw i32 %35, 1
%37 = mul nsw i32 9, %36
%38 = load i32, i32* %5
%39 = sub nsw i32 %38, 1
%40 = add nsw i32 %37, %39
%41 = add nsw i32 %40, 81
%42 = getelementptr inbounds [4 x i32], [4 x i32]* %7, i64 0, i64 2
store i32 %41, i32* %42
%43 = load i32, i32* %3
%44 = sub nsw i32 %43, 1
%45 = sdiv i32 %44, 3
%46 = mul nsw i32 3, %45
%47 = add nsw i32 1, %46
%48 = load i32, i32* %4
%49 = sub nsw i32 %48, 1
%50 = sdiv i32 %49, 3
%51 = add nsw i32 %47, %50
%52 = sub nsw i32 %51, 1
%53 = mul nsw i32 9, %52
%54 = load i32, i32* %5
%55 = sub nsw i32 %54, 1
%56 = add nsw i32 %53, %55
%57 = add nsw i32 %56, 243
%58 = getelementptr inbounds [4 x i32], [4 x i32]* %7, i64 0, i64 3
store i32 %57, i32* %58
%59 = load %struct.dlx*, %struct.dlx** %2
%60 = getelementptr inbounds [4 x i32], [4 x i32]* %7, i64 0, i64 0
%61 = load i32, i32* %6
%62 = call i32 @mkrow(%struct.dlx* %59, i32* %60, i32 %61)
%63 = load i32, i32* %6
%64 = add nsw i32 %63, 4
store i32 %64, i32* %6
br label %65
65: ; preds = %19
%66 = load i32, i32* %5
%67 = add nsw i32 %66, 1
store i32 %67, i32* %5
br label %16
68: ; preds = %16
br label %69
69: ; preds = %68
%70 = load i32, i32* %4
%71 = add nsw i32 %70, 1
store i32 %71, i32* %4
br label %12
72: ; preds = %12
br label %73
73: ; preds = %72
%74 = load i32, i32* %3
%75 = add nsw i32 %74, 1
store i32 %75, i32* %3
br label %8
76: ; preds = %8
ret void
}

LLVM IR (-O2):
%struct.dlx = type { i32 }
define void @mkrows(%struct.dlx* %0) {
%2 = alloca [4 x i32]
%3 = bitcast [4 x i32]* %2 to i8*
%4 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 1
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 2
%7 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 3
br label %8
8: ; preds = %1, %71
%9 = phi i32 [ 0, %1 ], [ %68, %71 ]
%10 = phi i32 [ 1, %1 ], [ %72, %71 ]
%11 = add nsw i32 %10, -1
%12 = mul nuw nsw i32 %11, 9
%13 = add nuw nsw i32 %12, 162
%14 = urem i32 %11, 3
%15 = sub nuw i32 %11, %14
%16 = add nuw nsw i32 %12, 163
%17 = add nuw nsw i32 %12, 164
%18 = add nuw nsw i32 %12, 165
%19 = add nuw nsw i32 %12, 166
%20 = add nuw nsw i32 %12, 167
%21 = add nuw nsw i32 %12, 168
%22 = add nuw nsw i32 %12, 169
%23 = add nuw nsw i32 %12, 170
br label %24
24: ; preds = %8, %24
%25 = phi i32 [ %9, %8 ], [ %68, %24 ]
%26 = phi i32 [ 1, %8 ], [ %69, %24 ]
%27 = add nsw i32 %26, -1
%28 = add nuw nsw i32 %27, %12
%29 = mul nuw nsw i32 %27, 9
%30 = add nuw nsw i32 %29, 81
%31 = udiv i32 %27, 3
%32 = add i32 %15, %31
%33 = mul nsw i32 %32, 9
%34 = add i32 %33, 243
store i32 %28, i32* %4
store i32 %13, i32* %5
store i32 %30, i32* %6
store i32 %34, i32* %7
%35 = call i32 @mkrow(%struct.dlx* %0, i32* %4, i32 %25)
%36 = add nsw i32 %25, 4
store i32 %28, i32* %4
store i32 %16, i32* %5
%37 = add nuw nsw i32 %29, 82
store i32 %37, i32* %6
%38 = add i32 %33, 244
store i32 %38, i32* %7
%39 = call i32 @mkrow(%struct.dlx* %0, i32* %4, i32 %36)
%40 = add nsw i32 %25, 8
store i32 %28, i32* %4
store i32 %17, i32* %5
%41 = add nuw nsw i32 %29, 83
store i32 %41, i32* %6
%42 = add i32 %33, 245
store i32 %42, i32* %7
%43 = call i32 @mkrow(%struct.dlx* %0, i32* %4, i32 %40)
%44 = add nsw i32 %25, 12
store i32 %28, i32* %4
store i32 %18, i32* %5
%45 = add nuw nsw i32 %29, 84
store i32 %45, i32* %6
%46 = add i32 %33, 246
store i32 %46, i32* %7
%47 = call i32 @mkrow(%struct.dlx* %0, i32* %4, i32 %44)
%48 = add nsw i32 %25, 16
store i32 %28, i32* %4
store i32 %19, i32* %5
%49 = add nuw nsw i32 %29, 85
store i32 %49, i32* %6
%50 = add i32 %33, 247
store i32 %50, i32* %7
%51 = call i32 @mkrow(%struct.dlx* %0, i32* %4, i32 %48)
%52 = add nsw i32 %25, 20
store i32 %28, i32* %4
store i32 %20, i32* %5
%53 = add nuw nsw i32 %29, 86
store i32 %53, i32* %6
%54 = add i32 %33, 248
store i32 %54, i32* %7
%55 = call i32 @mkrow(%struct.dlx* %0, i32* %4, i32 %52)
%56 = add nsw i32 %25, 24
store i32 %28, i32* %4
store i32 %21, i32* %5
%57 = add nuw nsw i32 %29, 87
store i32 %57, i32* %6
%58 = add i32 %33, 249
store i32 %58, i32* %7
%59 = call i32 @mkrow(%struct.dlx* %0, i32* %4, i32 %56)
%60 = add nsw i32 %25, 28
store i32 %28, i32* %4
store i32 %22, i32* %5
%61 = add nuw nsw i32 %29, 88
store i32 %61, i32* %6
%62 = add i32 %33, 250
store i32 %62, i32* %7
%63 = call i32 @mkrow(%struct.dlx* %0, i32* %4, i32 %60)
%64 = add nsw i32 %25, 32
store i32 %28, i32* %4
store i32 %23, i32* %5
%65 = add nuw nsw i32 %29, 89
store i32 %65, i32* %6
%66 = add i32 %33, 251
store i32 %66, i32* %7
%67 = call i32 @mkrow(%struct.dlx* %0, i32* %4, i32 %64)
%68 = add nsw i32 %25, 36
%69 = add nuw nsw i32 %26, 1
%70 = icmp eq i32 %69, 10
br i1 %70, label %71, label %24
71: ; preds = %24
%72 = add nuw nsw i32 %10, 1
%73 = icmp eq i32 %72, 10
br i1 %73, label %74, label %8
74: ; preds = %71
ret void
}