#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 digitConverter(char);
void test(int grid[9][9]) {
  char i[] = {'0', '0', '7', '1', '0', '0', '0', '0', '4', '0', '6', '0',
              '0', '2', '0', '1', '0', '0', '0', '0', '5', '0', '0', '0',
              '8', '6', '0', '5', '0', '0', '0', '4', '0', '9', '2', '0',
              '7', '0', '0', '0', '0', '0', '0', '0', '5', '0', '4', '9',
              '0', '8', '0', '0', '0', '3', '0', '9', '6', '0', '0', '0',
              '5', '0', '0', '0', '0', '1', '0', '3', '0', '0', '9', '0',
              '4', '0', '0', '0', '0', '6', '2', '0', '0'};
  int x, y, z = 0;
  for (y = 0; y < 9; ++y)
    for (x = 0; x < 9; ++x) {
      grid[x][y] = digitConverter(i[z]);
      ++z;
    }
  return;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x60(%rbp),%rdi
lea    0xec9(%rip),%rsi
mov    $0x51,%edx
call   1030 <memcpy@plt>
movl   $0x0,-0x6c(%rbp)
movl   $0x0,-0x68(%rbp)
cmpl   $0x9,-0x68(%rbp)
jge    11ba <test+0x9a>
movl   $0x0,-0x64(%rbp)
cmpl   $0x9,-0x64(%rbp)
jge    11a7 <test+0x87>
movslq -0x6c(%rbp),%rax
movsbl -0x60(%rbp,%rax,1),%edi
call   1040 <digitConverter@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
movslq -0x64(%rbp),%rcx
imul   $0x24,%rcx,%rcx
add    %rcx,%rax
movslq -0x68(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    1160 <test+0x40>
jmp    11ac <test+0x8c>
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
jmp    114f <test+0x2f>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
mov    $0xfffffffffffffff7,%r15
lea    0xee2(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
movsbl -0x8(%rbx),%edi
call   1030 <digitConverter@plt>
mov    %eax,0x24(%r14,%r15,4)
movsbl -0x7(%rbx),%edi
call   1030 <digitConverter@plt>
mov    %eax,0x48(%r14,%r15,4)
movsbl -0x6(%rbx),%edi
call   1030 <digitConverter@plt>
mov    %eax,0x6c(%r14,%r15,4)
movsbl -0x5(%rbx),%edi
call   1030 <digitConverter@plt>
mov    %eax,0x90(%r14,%r15,4)
movsbl -0x4(%rbx),%edi
call   1030 <digitConverter@plt>
mov    %eax,0xb4(%r14,%r15,4)
movsbl -0x3(%rbx),%edi
call   1030 <digitConverter@plt>
mov    %eax,0xd8(%r14,%r15,4)
movsbl -0x2(%rbx),%edi
call   1030 <digitConverter@plt>
mov    %eax,0xfc(%r14,%r15,4)
movsbl -0x1(%rbx),%edi
call   1030 <digitConverter@plt>
mov    %eax,0x120(%r14,%r15,4)
movsbl (%rbx),%edi
call   1030 <digitConverter@plt>
mov    %eax,0x144(%r14,%r15,4)
add    $0x9,%rbx
inc    %r15
jne    1130 <test+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.test.i = [81 x i8] c"007100004060020100005000860500040920700000005049080003096000500001030090400006200"
define void @test([9 x i32]* %0) {
%2 = alloca [9 x i32]*
%3 = alloca [81 x i8]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store [9 x i32]* %0, [9 x i32]** %2
%7 = bitcast [81 x i8]* %3 to i8*
store i32 0, i32* %6
store i32 0, i32* %5
br label %8
8: ; preds = %34, %1
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 9
br i1 %10, label %11, label %37
11: ; preds = %8
store i32 0, i32* %4
br label %12
12: ; preds = %30, %11
%13 = load i32, i32* %4
%14 = icmp slt i32 %13, 9
br i1 %14, label %15, label %33
15: ; preds = %12
%16 = load i32, i32* %6
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [81 x i8], [81 x i8]* %3, i64 0, i64 %17
%19 = load i8, i8* %18
%20 = call i32 @digitConverter(i8 signext %19)
%21 = load [9 x i32]*, [9 x i32]** %2
%22 = load i32, i32* %4
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [9 x i32], [9 x i32]* %21, i64 %23
%25 = load i32, i32* %5
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [9 x i32], [9 x i32]* %24, i64 0, i64 %26
store i32 %20, i32* %27
%28 = load i32, i32* %6
%29 = add nsw i32 %28, 1
store i32 %29, i32* %6
br label %30
30: ; preds = %15
%31 = load i32, i32* %4
%32 = add nsw i32 %31, 1
store i32 %32, i32* %4
br label %12
33: ; preds = %12
br label %34
34: ; preds = %33
%35 = load i32, i32* %5
%36 = add nsw i32 %35, 1
store i32 %36, i32* %5
br label %8
37: ; preds = %8
ret void
}

LLVM IR (-O2):
@__const.test.i = [81 x i8] c"007100004060020100005000860500040920700000005049080003096000500001030090400006200"
define void @test([9 x i32]* nocapture writeonly %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i64 [ 0, %1 ], [ %50, %2 ]
%4 = phi i64 [ 0, %1 ], [ %49, %2 ]
%5 = getelementptr inbounds [81 x i8], [81 x i8]* @__const.test.i, i64 0, i64 %4
%6 = load i8, i8* %5
%7 = tail call i32 @digitConverter(i8 signext %6)
%8 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 0, i64 %3
store i32 %7, i32* %8
%9 = add nuw nsw i64 %4, 1
%10 = getelementptr inbounds [81 x i8], [81 x i8]* @__const.test.i, i64 0, i64 %9
%11 = load i8, i8* %10
%12 = tail call i32 @digitConverter(i8 signext %11)
%13 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 1, i64 %3
store i32 %12, i32* %13
%14 = add nuw nsw i64 %4, 2
%15 = getelementptr inbounds [81 x i8], [81 x i8]* @__const.test.i, i64 0, i64 %14
%16 = load i8, i8* %15
%17 = tail call i32 @digitConverter(i8 signext %16)
%18 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 2, i64 %3
store i32 %17, i32* %18
%19 = add nuw nsw i64 %4, 3
%20 = getelementptr inbounds [81 x i8], [81 x i8]* @__const.test.i, i64 0, i64 %19
%21 = load i8, i8* %20
%22 = tail call i32 @digitConverter(i8 signext %21)
%23 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 3, i64 %3
store i32 %22, i32* %23
%24 = add nuw nsw i64 %4, 4
%25 = getelementptr inbounds [81 x i8], [81 x i8]* @__const.test.i, i64 0, i64 %24
%26 = load i8, i8* %25
%27 = tail call i32 @digitConverter(i8 signext %26)
%28 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 4, i64 %3
store i32 %27, i32* %28
%29 = add nuw nsw i64 %4, 5
%30 = getelementptr inbounds [81 x i8], [81 x i8]* @__const.test.i, i64 0, i64 %29
%31 = load i8, i8* %30
%32 = tail call i32 @digitConverter(i8 signext %31)
%33 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 5, i64 %3
store i32 %32, i32* %33
%34 = add nuw nsw i64 %4, 6
%35 = getelementptr inbounds [81 x i8], [81 x i8]* @__const.test.i, i64 0, i64 %34
%36 = load i8, i8* %35
%37 = tail call i32 @digitConverter(i8 signext %36)
%38 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 6, i64 %3
store i32 %37, i32* %38
%39 = add nuw nsw i64 %4, 7
%40 = getelementptr inbounds [81 x i8], [81 x i8]* @__const.test.i, i64 0, i64 %39
%41 = load i8, i8* %40
%42 = tail call i32 @digitConverter(i8 signext %41)
%43 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 7, i64 %3
store i32 %42, i32* %43
%44 = add nuw nsw i64 %4, 8
%45 = getelementptr inbounds [81 x i8], [81 x i8]* @__const.test.i, i64 0, i64 %44
%46 = load i8, i8* %45
%47 = tail call i32 @digitConverter(i8 signext %46)
%48 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 8, i64 %3
store i32 %47, i32* %48
%49 = add nuw nsw i64 %4, 9
%50 = add nuw nsw i64 %3, 1
%51 = icmp eq i64 %50, 9
br i1 %51, label %52, label %2
52: ; preds = %2
ret void
}