#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_elem_cmap(int, int, int *, int *, int *, int);
int ne_test_pecm(int fileid) {
  int i, iproc, error;
  int elem_map_ids[2], elem_ids[17], side_ids[17];
  int proc_ids[17];
  for (iproc = 0; iproc < 10; iproc++) {
    for (i = 0; i < 2; i++) {
      elem_map_ids[i] = 2 * (i + 1);
    }
    for (i = 0; i < 17; i++) {
      elem_ids[i] = 2 * (i + 1);
      side_ids[i] = 3 * (i + 1);
      proc_ids[i] = 4 * (i + 1);
    }
    for (i = 0; i < 2; i++) {
      error = ne_put_elem_cmap(fileid, elem_map_ids[i], elem_ids, side_ids,
                               proc_ids, iproc);
      if (error < 0)
        return error;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<ne_test_pecm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0xa,-0x10(%rbp)
jge    122c <ne_test_pecm+0x11c>
movl   $0x0,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jge    115f <ne_test_pecm+0x4f>
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
shl    $0x1,%ecx
movslq -0xc(%rbp),%rax
mov    %ecx,-0x1c(%rbp,%rax,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1136 <ne_test_pecm+0x26>
movl   $0x0,-0xc(%rbp)
cmpl   $0x11,-0xc(%rbp)
jge    11b7 <ne_test_pecm+0xa7>
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
shl    $0x1,%ecx
movslq -0xc(%rbp),%rax
mov    %ecx,-0x60(%rbp,%rax,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
imul   $0x3,%eax,%ecx
movslq -0xc(%rbp),%rax
mov    %ecx,-0xb0(%rbp,%rax,4)
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
shl    $0x2,%ecx
movslq -0xc(%rbp),%rax
mov    %ecx,-0x100(%rbp,%rax,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1166 <ne_test_pecm+0x56>
movl   $0x0,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jge    1219 <ne_test_pecm+0x109>
mov    -0x8(%rbp),%edi
movslq -0xc(%rbp),%rax
mov    -0x1c(%rbp,%rax,4),%esi
lea    -0x60(%rbp),%rdx
lea    -0xb0(%rbp),%rcx
lea    -0x100(%rbp),%r8
mov    -0x10(%rbp),%r9d
call   1030 <ne_put_elem_cmap@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1206 <ne_test_pecm+0xf6>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1233 <ne_test_pecm+0x123>
jmp    120b <ne_test_pecm+0xfb>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11be <ne_test_pecm+0xae>
jmp    121e <ne_test_pecm+0x10e>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1125 <ne_test_pecm+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ne_test_pecm>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0xf0,%rsp
mov    %edi,%ebx
xor    %ebp,%ebp
lea    0xa0(%rsp),%r14
lea    0x50(%rsp),%r15
mov    %rsp,%r12
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movaps 0xeb9(%rip),%xmm0
movaps %xmm0,0xa0(%rsp)
movaps 0xeba(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xebe(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps 0xec3(%rip),%xmm0
movaps %xmm0,0xb0(%rsp)
movaps 0xec4(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecc(%rip),%xmm0
movaps %xmm0,0xc0(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xed1(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xed5(%rip),%xmm0
movaps %xmm0,0xd0(%rsp)
movaps 0xed6(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps 0xed7(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movl   $0x22,0xe0(%rsp)
movl   $0x33,0x90(%rsp)
movl   $0x44,0x40(%rsp)
mov    %ebx,%edi
mov    $0x2,%esi
mov    %r14,%rdx
mov    %r15,%rcx
mov    %r12,%r8
mov    %ebp,%r9d
call   1030 <ne_put_elem_cmap@plt>
test   %eax,%eax
js     1242 <ne_test_pecm+0x132>
mov    %ebx,%edi
mov    $0x4,%esi
mov    %r14,%rdx
mov    %r15,%rcx
mov    %r12,%r8
mov    %ebp,%r9d
call   1030 <ne_put_elem_cmap@plt>
test   %eax,%eax
js     1242 <ne_test_pecm+0x132>
add    $0x1,%ebp
cmp    $0xa,%ebp
jne    1140 <ne_test_pecm+0x30>
xor    %eax,%eax
add    $0xf0,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

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