#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*/ ecc200placementbit(int *, int, int, int, int, int, int);
void ecc200placementblock(int *array, int NR, int NC, int r, int c, int p) {
  ecc200placementbit(array, NR, NC, r - 2, c - 2, p, 7);
  ecc200placementbit(array, NR, NC, r - 2, c - 1, p, 6);
  ecc200placementbit(array, NR, NC, r - 1, c - 2, p, 5);
  ecc200placementbit(array, NR, NC, r - 1, c - 1, p, 4);
  ecc200placementbit(array, NR, NC, r - 1, c - 0, p, 3);
  ecc200placementbit(array, NR, NC, r - 0, c - 2, p, 2);
  ecc200placementbit(array, NR, NC, r - 0, c - 1, p, 1);
  ecc200placementbit(array, NR, NC, r - 0, c - 0, p, 0);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
sub    $0x2,%ecx
mov    -0x18(%rbp),%r8d
sub    $0x2,%r8d
mov    -0x1c(%rbp),%r9d
movl   $0x7,(%rsp)
call   1030 <ecc200placementbit@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
sub    $0x2,%ecx
mov    -0x18(%rbp),%r8d
sub    $0x1,%r8d
mov    -0x1c(%rbp),%r9d
movl   $0x6,(%rsp)
call   1030 <ecc200placementbit@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x18(%rbp),%r8d
sub    $0x2,%r8d
mov    -0x1c(%rbp),%r9d
movl   $0x5,(%rsp)
call   1030 <ecc200placementbit@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x18(%rbp),%r8d
sub    $0x1,%r8d
mov    -0x1c(%rbp),%r9d
movl   $0x4,(%rsp)
call   1030 <ecc200placementbit@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x18(%rbp),%r8d
sub    $0x0,%r8d
mov    -0x1c(%rbp),%r9d
movl   $0x3,(%rsp)
call   1030 <ecc200placementbit@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
sub    $0x0,%ecx
mov    -0x18(%rbp),%r8d
sub    $0x2,%r8d
mov    -0x1c(%rbp),%r9d
movl   $0x2,(%rsp)
call   1030 <ecc200placementbit@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
sub    $0x0,%ecx
mov    -0x18(%rbp),%r8d
sub    $0x1,%r8d
mov    -0x1c(%rbp),%r9d
movl   $0x1,(%rsp)
call   1030 <ecc200placementbit@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
sub    $0x0,%ecx
mov    -0x18(%rbp),%r8d
sub    $0x0,%r8d
mov    -0x1c(%rbp),%r9d
xor    %eax,%eax
movl   $0x0,(%rsp)
call   1030 <ecc200placementbit@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r9d,%r12d
mov    %r8d,%ebx
mov    %rcx,0x10(%rsp)
mov    %edx,%r13d
mov    %esi,%r15d
mov    %rdi,%rbp
lea    -0x2(%rcx),%r14d
lea    -0x2(%rbx),%eax
mov    %eax,0x8(%rsp)
movl   $0x7,(%rsp)
mov    %r14d,%ecx
mov    %eax,%r8d
call   1030 <ecc200placementbit@plt>
lea    -0x1(%rbx),%r8d
mov    %r8d,0xc(%rsp)
movl   $0x6,(%rsp)
mov    %rbp,%rdi
mov    %r15d,%esi
mov    %r13d,%edx
mov    %r14d,%ecx
mov    %r12d,%r9d
call   1030 <ecc200placementbit@plt>
mov    0x10(%rsp),%rax
lea    -0x1(%rax),%r14d
movl   $0x5,(%rsp)
mov    %rbp,%rdi
mov    %r15d,%esi
mov    %r13d,%edx
mov    %r14d,%ecx
mov    0x8(%rsp),%r8d
mov    %r12d,%r9d
call   1030 <ecc200placementbit@plt>
movl   $0x4,(%rsp)
mov    %rbp,%rdi
mov    %r15d,%esi
mov    %r13d,%edx
mov    %r14d,%ecx
mov    0xc(%rsp),%r8d
mov    %r12d,%r9d
call   1030 <ecc200placementbit@plt>
movl   $0x3,(%rsp)
mov    %rbp,%rdi
mov    %r15d,%esi
mov    %r13d,%edx
mov    %r14d,%ecx
mov    %rbx,%r14
mov    %r14d,%r8d
mov    %r12d,%r9d
call   1030 <ecc200placementbit@plt>
movl   $0x2,(%rsp)
mov    %rbp,%rdi
mov    %r15d,%esi
mov    %r13d,%edx
mov    0x10(%rsp),%rbx
mov    %ebx,%ecx
mov    0x8(%rsp),%r8d
mov    %r12d,%r9d
call   1030 <ecc200placementbit@plt>
movl   $0x1,(%rsp)
mov    %rbp,%rdi
mov    %r15d,%esi
mov    %r13d,%edx
mov    %ebx,%ecx
mov    0xc(%rsp),%r8d
mov    %r12d,%r9d
call   1030 <ecc200placementbit@plt>
movl   $0x0,(%rsp)
mov    %rbp,%rdi
mov    %r15d,%esi
mov    %r13d,%edx
mov    %ebx,%ecx
mov    %r14d,%r8d
mov    %r12d,%r9d
call   1030 <ecc200placementbit@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @ecc200placementblock(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32* %0, i32** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i32*, i32** %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load i32, i32* %10
%17 = sub nsw i32 %16, 2
%18 = load i32, i32* %11
%19 = sub nsw i32 %18, 2
%20 = load i32, i32* %12
%21 = call i32 @ecc200placementbit(i32* %13, i32 %14, i32 %15, i32 %17, i32 %19, i32 %20, i32 7)
%22 = load i32*, i32** %7
%23 = load i32, i32* %8
%24 = load i32, i32* %9
%25 = load i32, i32* %10
%26 = sub nsw i32 %25, 2
%27 = load i32, i32* %11
%28 = sub nsw i32 %27, 1
%29 = load i32, i32* %12
%30 = call i32 @ecc200placementbit(i32* %22, i32 %23, i32 %24, i32 %26, i32 %28, i32 %29, i32 6)
%31 = load i32*, i32** %7
%32 = load i32, i32* %8
%33 = load i32, i32* %9
%34 = load i32, i32* %10
%35 = sub nsw i32 %34, 1
%36 = load i32, i32* %11
%37 = sub nsw i32 %36, 2
%38 = load i32, i32* %12
%39 = call i32 @ecc200placementbit(i32* %31, i32 %32, i32 %33, i32 %35, i32 %37, i32 %38, i32 5)
%40 = load i32*, i32** %7
%41 = load i32, i32* %8
%42 = load i32, i32* %9
%43 = load i32, i32* %10
%44 = sub nsw i32 %43, 1
%45 = load i32, i32* %11
%46 = sub nsw i32 %45, 1
%47 = load i32, i32* %12
%48 = call i32 @ecc200placementbit(i32* %40, i32 %41, i32 %42, i32 %44, i32 %46, i32 %47, i32 4)
%49 = load i32*, i32** %7
%50 = load i32, i32* %8
%51 = load i32, i32* %9
%52 = load i32, i32* %10
%53 = sub nsw i32 %52, 1
%54 = load i32, i32* %11
%55 = sub nsw i32 %54, 0
%56 = load i32, i32* %12
%57 = call i32 @ecc200placementbit(i32* %49, i32 %50, i32 %51, i32 %53, i32 %55, i32 %56, i32 3)
%58 = load i32*, i32** %7
%59 = load i32, i32* %8
%60 = load i32, i32* %9
%61 = load i32, i32* %10
%62 = sub nsw i32 %61, 0
%63 = load i32, i32* %11
%64 = sub nsw i32 %63, 2
%65 = load i32, i32* %12
%66 = call i32 @ecc200placementbit(i32* %58, i32 %59, i32 %60, i32 %62, i32 %64, i32 %65, i32 2)
%67 = load i32*, i32** %7
%68 = load i32, i32* %8
%69 = load i32, i32* %9
%70 = load i32, i32* %10
%71 = sub nsw i32 %70, 0
%72 = load i32, i32* %11
%73 = sub nsw i32 %72, 1
%74 = load i32, i32* %12
%75 = call i32 @ecc200placementbit(i32* %67, i32 %68, i32 %69, i32 %71, i32 %73, i32 %74, i32 1)
%76 = load i32*, i32** %7
%77 = load i32, i32* %8
%78 = load i32, i32* %9
%79 = load i32, i32* %10
%80 = sub nsw i32 %79, 0
%81 = load i32, i32* %11
%82 = sub nsw i32 %81, 0
%83 = load i32, i32* %12
%84 = call i32 @ecc200placementbit(i32* %76, i32 %77, i32 %78, i32 %80, i32 %82, i32 %83, i32 0)
ret void
}

LLVM IR (-O2):
define void @ecc200placementblock(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = add nsw i32 %3, -2
%8 = add nsw i32 %4, -2
%9 = tail call i32 @ecc200placementbit(i32* %0, i32 %1, i32 %2, i32 %7, i32 %8, i32 %5, i32 7)
%10 = add nsw i32 %4, -1
%11 = tail call i32 @ecc200placementbit(i32* %0, i32 %1, i32 %2, i32 %7, i32 %10, i32 %5, i32 6)
%12 = add nsw i32 %3, -1
%13 = tail call i32 @ecc200placementbit(i32* %0, i32 %1, i32 %2, i32 %12, i32 %8, i32 %5, i32 5)
%14 = tail call i32 @ecc200placementbit(i32* %0, i32 %1, i32 %2, i32 %12, i32 %10, i32 %5, i32 4)
%15 = tail call i32 @ecc200placementbit(i32* %0, i32 %1, i32 %2, i32 %12, i32 %4, i32 %5, i32 3)
%16 = tail call i32 @ecc200placementbit(i32* %0, i32 %1, i32 %2, i32 %3, i32 %8, i32 %5, i32 2)
%17 = tail call i32 @ecc200placementbit(i32* %0, i32 %1, i32 %2, i32 %3, i32 %10, i32 %5, i32 1)
%18 = tail call i32 @ecc200placementbit(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 0)
ret void
}