#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 ne_put_node_cmap(int, int, int *, int *, int);
int ne_test_pncm(int fileid) {
  int i, iproc, error;
  int node_map_ids[4], node_ids[20], proc_ids[20];
  for (iproc = 0; iproc < 10; iproc++) {
    for (i = 0; i < 4; i++) {
      node_map_ids[i] = (i + 1);
    }
    for (i = 0; i < 20; i++) {
      node_ids[i] = 2 * (i + 1);
      proc_ids[i] = 3 * (i + 1);
    }
    for (i = 0; i < 4; i++) {
      error =
          ne_put_node_cmap(fileid, node_map_ids[i], node_ids, proc_ids, iproc);
      if (error < 0)
        return error;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<ne_test_pncm>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0xa,-0x10(%rbp)
jge    120e <ne_test_pncm+0xfe>
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    115c <ne_test_pncm+0x4c>
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq -0xc(%rbp),%rax
mov    %ecx,-0x30(%rbp,%rax,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1136 <ne_test_pncm+0x26>
movl   $0x0,-0xc(%rbp)
cmpl   $0x14,-0xc(%rbp)
jge    11a0 <ne_test_pncm+0x90>
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
shl    $0x1,%ecx
movslq -0xc(%rbp),%rax
mov    %ecx,-0x80(%rbp,%rax,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
imul   $0x3,%eax,%ecx
movslq -0xc(%rbp),%rax
mov    %ecx,-0xd0(%rbp,%rax,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1163 <ne_test_pncm+0x53>
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    11fb <ne_test_pncm+0xeb>
mov    -0x8(%rbp),%edi
movslq -0xc(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%esi
lea    -0x80(%rbp),%rdx
lea    -0xd0(%rbp),%rcx
mov    -0x10(%rbp),%r8d
call   1030 <ne_put_node_cmap@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    11e8 <ne_test_pncm+0xd8>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1215 <ne_test_pncm+0x105>
jmp    11ed <ne_test_pncm+0xdd>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11a7 <ne_test_pncm+0x97>
jmp    1200 <ne_test_pncm+0xf0>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1125 <ne_test_pncm+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ne_test_pncm>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0xa8,%rsp
mov    %edi,%ebx
xor    %ebp,%ebp
lea    0x50(%rsp),%r14
mov    %rsp,%r15
nopl   0x0(%rax)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps 0xed2(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xed6(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeda(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xede(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xee2(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps 0xee3(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xee7(%rip),%xmm0
movaps %xmm0,0x90(%rsp)
movaps 0xee8(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
mov    %ebx,%edi
mov    $0x1,%esi
mov    %r14,%rdx
mov    %r15,%rcx
mov    %ebp,%r8d
call   1030 <ne_put_node_cmap@plt>
test   %eax,%eax
js     121f <ne_test_pncm+0x10f>
mov    %ebx,%edi
mov    $0x2,%esi
mov    %r14,%rdx
mov    %r15,%rcx
mov    %ebp,%r8d
call   1030 <ne_put_node_cmap@plt>
test   %eax,%eax
js     121f <ne_test_pncm+0x10f>
mov    %ebx,%edi
mov    $0x3,%esi
mov    %r14,%rdx
mov    %r15,%rcx
mov    %ebp,%r8d
call   1030 <ne_put_node_cmap@plt>
test   %eax,%eax
js     121f <ne_test_pncm+0x10f>
mov    %ebx,%edi
mov    $0x4,%esi
mov    %r14,%rdx
mov    %r15,%rcx
mov    %ebp,%r8d
call   1030 <ne_put_node_cmap@plt>
test   %eax,%eax
js     121f <ne_test_pncm+0x10f>
add    $0x1,%ebp
cmp    $0xa,%ebp
jne    1130 <ne_test_pncm+0x20>
xor    %eax,%eax
add    $0xa8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @ne_test_pncm(i32 %0) {
%2 = alloca [20 x i32]
%3 = alloca [20 x i32]
%4 = bitcast [20 x i32]* %2 to i8*
%5 = bitcast [20 x i32]* %3 to i8*
%6 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%7 = getelementptr inbounds [20 x i32], [20 x i32]* %3, i64 0, i64 0
%8 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 4
%9 = getelementptr inbounds [20 x i32], [20 x i32]* %3, i64 0, i64 4
%10 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 8
%11 = getelementptr inbounds [20 x i32], [20 x i32]* %3, i64 0, i64 8
%12 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 12
%13 = getelementptr inbounds [20 x i32], [20 x i32]* %3, i64 0, i64 12
%14 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 16
%15 = getelementptr inbounds [20 x i32], [20 x i32]* %3, i64 0, i64 16
%16 = bitcast [20 x i32]* %2 to <4 x i32>*
%17 = bitcast [20 x i32]* %3 to <4 x i32>*
%18 = bitcast i32* %8 to <4 x i32>*
%19 = bitcast i32* %9 to <4 x i32>*
%20 = bitcast i32* %10 to <4 x i32>*
%21 = bitcast i32* %11 to <4 x i32>*
%22 = bitcast i32* %12 to <4 x i32>*
%23 = bitcast i32* %13 to <4 x i32>*
%24 = bitcast i32* %14 to <4 x i32>*
%25 = bitcast i32* %15 to <4 x i32>*
br label %26
26: ; preds = %1, %39
%27 = phi i32 [ 0, %1 ], [ %40, %39 ]
store <4 x i32> <i32 2, i32 4, i32 6, i32 8>, <4 x i32>* %16
store <4 x i32> <i32 3, i32 6, i32 9, i32 12>, <4 x i32>* %17
store <4 x i32> <i32 10, i32 12, i32 14, i32 16>, <4 x i32>* %18
store <4 x i32> <i32 15, i32 18, i32 21, i32 24>, <4 x i32>* %19
store <4 x i32> <i32 18, i32 20, i32 22, i32 24>, <4 x i32>* %20
store <4 x i32> <i32 27, i32 30, i32 33, i32 36>, <4 x i32>* %21
store <4 x i32> <i32 26, i32 28, i32 30, i32 32>, <4 x i32>* %22
store <4 x i32> <i32 39, i32 42, i32 45, i32 48>, <4 x i32>* %23
store <4 x i32> <i32 34, i32 36, i32 38, i32 40>, <4 x i32>* %24
store <4 x i32> <i32 51, i32 54, i32 57, i32 60>, <4 x i32>* %25
%28 = call i32 @ne_put_node_cmap(i32 %0, i32 1, i32* %6, i32* %7, i32 %27)
%29 = icmp slt i32 %28, 0
br i1 %29, label %42, label %30
30: ; preds = %26
%31 = call i32 @ne_put_node_cmap(i32 %0, i32 2, i32* %6, i32* %7, i32 %27)
%32 = icmp slt i32 %31, 0
br i1 %32, label %42, label %33
33: ; preds = %30
%34 = call i32 @ne_put_node_cmap(i32 %0, i32 3, i32* %6, i32* %7, i32 %27)
%35 = icmp slt i32 %34, 0
br i1 %35, label %42, label %36
36: ; preds = %33
%37 = call i32 @ne_put_node_cmap(i32 %0, i32 4, i32* %6, i32* %7, i32 %27)
%38 = icmp slt i32 %37, 0
br i1 %38, label %42, label %39
39: ; preds = %36
%40 = add nuw nsw i32 %27, 1
%41 = icmp eq i32 %40, 10
br i1 %41, label %42, label %26
42: ; preds = %39, %26, %30, %33, %36
%43 = phi i32 [ %28, %26 ], [ %31, %30 ], [ %34, %33 ], [ %37, %36 ], [ 0, %39 ]
ret i32 %43
}