void init(int *row, int *diag1, int *diag2) {
  int i;
  for (i = 0; i < 8; i++) {
    row[i] = 0;
  }
  for (i = 0; i < 8 * 2 - 1; i++) {
    diag1[i] = 0;
    diag2[i] = 0;
  }
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x8,-0x1c(%rbp)
jge    113e <init+0x3e>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1117 <init+0x17>
movl   $0x0,-0x1c(%rbp)
cmpl   $0xf,-0x1c(%rbp)
jge    117b <init+0x7b>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1145 <init+0x45>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
xorps  %xmm0,%xmm0
movups %xmm0,0x10(%rdi)
movups %xmm0,(%rdi)
movl   $0x0,(%rsi)
movl   $0x0,(%rdx)
movl   $0x0,0x4(%rsi)
movl   $0x0,0x4(%rdx)
movl   $0x0,0x8(%rsi)
movl   $0x0,0x8(%rdx)
movl   $0x0,0xc(%rsi)
movl   $0x0,0xc(%rdx)
movl   $0x0,0x10(%rsi)
movl   $0x0,0x10(%rdx)
movl   $0x0,0x14(%rsi)
movl   $0x0,0x14(%rdx)
movl   $0x0,0x18(%rsi)
movl   $0x0,0x18(%rdx)
movl   $0x0,0x1c(%rsi)
movl   $0x0,0x1c(%rdx)
movl   $0x0,0x20(%rsi)
movl   $0x0,0x20(%rdx)
movl   $0x0,0x24(%rsi)
movl   $0x0,0x24(%rdx)
movl   $0x0,0x28(%rsi)
movl   $0x0,0x28(%rdx)
movl   $0x0,0x2c(%rsi)
movl   $0x0,0x2c(%rdx)
movl   $0x0,0x30(%rsi)
movl   $0x0,0x30(%rdx)
movl   $0x0,0x34(%rsi)
movl   $0x0,0x34(%rdx)
movl   $0x0,0x38(%rsi)
movl   $0x0,0x38(%rdx)
ret

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

LLVM IR (-O2):
define void @init(i32* nocapture writeonly %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = bitcast i32* %0 to i8*
store i32 0, i32* %1
store i32 0, i32* %2
%5 = getelementptr inbounds i32, i32* %1, i64 1
store i32 0, i32* %5
%6 = getelementptr inbounds i32, i32* %2, i64 1
store i32 0, i32* %6
%7 = getelementptr inbounds i32, i32* %1, i64 2
store i32 0, i32* %7
%8 = getelementptr inbounds i32, i32* %2, i64 2
store i32 0, i32* %8
%9 = getelementptr inbounds i32, i32* %1, i64 3
store i32 0, i32* %9
%10 = getelementptr inbounds i32, i32* %2, i64 3
store i32 0, i32* %10
%11 = getelementptr inbounds i32, i32* %1, i64 4
store i32 0, i32* %11
%12 = getelementptr inbounds i32, i32* %2, i64 4
store i32 0, i32* %12
%13 = getelementptr inbounds i32, i32* %1, i64 5
store i32 0, i32* %13
%14 = getelementptr inbounds i32, i32* %2, i64 5
store i32 0, i32* %14
%15 = getelementptr inbounds i32, i32* %1, i64 6
store i32 0, i32* %15
%16 = getelementptr inbounds i32, i32* %2, i64 6
store i32 0, i32* %16
%17 = getelementptr inbounds i32, i32* %1, i64 7
store i32 0, i32* %17
%18 = getelementptr inbounds i32, i32* %2, i64 7
store i32 0, i32* %18
%19 = getelementptr inbounds i32, i32* %1, i64 8
store i32 0, i32* %19
%20 = getelementptr inbounds i32, i32* %2, i64 8
store i32 0, i32* %20
%21 = getelementptr inbounds i32, i32* %1, i64 9
store i32 0, i32* %21
%22 = getelementptr inbounds i32, i32* %2, i64 9
store i32 0, i32* %22
%23 = getelementptr inbounds i32, i32* %1, i64 10
store i32 0, i32* %23
%24 = getelementptr inbounds i32, i32* %2, i64 10
store i32 0, i32* %24
%25 = getelementptr inbounds i32, i32* %1, i64 11
store i32 0, i32* %25
%26 = getelementptr inbounds i32, i32* %2, i64 11
store i32 0, i32* %26
%27 = getelementptr inbounds i32, i32* %1, i64 12
store i32 0, i32* %27
%28 = getelementptr inbounds i32, i32* %2, i64 12
store i32 0, i32* %28
%29 = getelementptr inbounds i32, i32* %1, i64 13
store i32 0, i32* %29
%30 = getelementptr inbounds i32, i32* %2, i64 13
store i32 0, i32* %30
%31 = getelementptr inbounds i32, i32* %1, i64 14
store i32 0, i32* %31
%32 = getelementptr inbounds i32, i32* %2, i64 14
store i32 0, i32* %32
ret void
}