#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 ex_put_cmap_params(int, int *, int *, int *, int *, int);
int ne_test_pcmp(int fileid) {
  int i, iproc, error;
  int node_map_ids[4], node_map_node_cnts[4];
  int elem_map_ids[2], elem_map_elem_cnts[2];
  for (iproc = 0; iproc < 10; iproc++) {
    for (i = 0; i < 4; i++) {
      node_map_ids[i] = (i + 1);
      node_map_node_cnts[i] = 20;
    }
    for (i = 0; i < 2; i++) {
      elem_map_ids[i] = 2 * (i + 1);
      elem_map_elem_cnts[i] = 17;
    }
    error = ex_put_cmap_params(fileid, node_map_node_cnts, node_map_ids,
                               elem_map_elem_cnts, elem_map_ids, iproc);
    if (error < 0)
      return error;
  }
  return 0;
}


x86 assembly (clang, -O0):
<ne_test_pcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0xa,-0x10(%rbp)
jge    11e8 <ne_test_pcmp+0xd8>
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    1165 <ne_test_pcmp+0x55>
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq -0xc(%rbp),%rax
mov    %ecx,-0x30(%rbp,%rax,4)
movslq -0xc(%rbp),%rax
movl   $0x14,-0x40(%rbp,%rax,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <ne_test_pcmp+0x23>
movl   $0x0,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jge    11a1 <ne_test_pcmp+0x91>
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
shl    $0x1,%ecx
movslq -0xc(%rbp),%rax
mov    %ecx,-0x48(%rbp,%rax,4)
movslq -0xc(%rbp),%rax
movl   $0x11,-0x50(%rbp,%rax,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    116c <ne_test_pcmp+0x5c>
mov    -0x8(%rbp),%edi
lea    -0x40(%rbp),%rsi
lea    -0x30(%rbp),%rdx
lea    -0x50(%rbp),%rcx
lea    -0x48(%rbp),%r8
mov    -0x10(%rbp),%r9d
call   1030 <ex_put_cmap_params@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    11d5 <ne_test_pcmp+0xc5>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    11ef <ne_test_pcmp+0xdf>
jmp    11da <ne_test_pcmp+0xca>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1122 <ne_test_pcmp+0x12>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ne_test_pcmp>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %edi,%ebx
xor    %ebp,%ebp
lea    0x10(%rsp),%r14
lea    0x20(%rsp),%r15
mov    %rsp,%r12
lea    0x8(%rsp),%r13
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movaps 0xeb9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movabs $0x400000002,%rax
mov    %rax,0x8(%rsp)
movabs $0x1100000011,%rax
mov    %rax,(%rsp)
mov    %ebx,%edi
mov    %r14,%rsi
mov    %r15,%rdx
mov    %r12,%rcx
mov    %r13,%r8
mov    %ebp,%r9d
call   1030 <ex_put_cmap_params@plt>
test   %eax,%eax
js     1199 <ne_test_pcmp+0x89>
add    $0x1,%ebp
cmp    $0xa,%ebp
jne    1140 <ne_test_pcmp+0x30>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @ne_test_pcmp(i32 %0) {
%2 = alloca <4 x i32>
%3 = alloca <4 x i32>
%4 = alloca [2 x i32]
%5 = alloca [2 x i32]
%6 = bitcast <4 x i32>* %2 to i8*
%7 = bitcast <4 x i32>* %3 to i8*
%8 = bitcast [2 x i32]* %4 to i8*
%9 = bitcast [2 x i32]* %5 to i8*
%10 = getelementptr inbounds <4 x i32>, <4 x i32>* %3, i64 0, i64 0
%11 = getelementptr inbounds <4 x i32>, <4 x i32>* %2, i64 0, i64 0
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%14 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%15 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
br label %19
16: ; preds = %19
%17 = add nuw nsw i32 %20, 1
%18 = icmp eq i32 %17, 10
br i1 %18, label %23, label %19
19: ; preds = %1, %16
%20 = phi i32 [ 0, %1 ], [ %17, %16 ]
store <4 x i32> <i32 1, i32 2, i32 3, i32 4>, <4 x i32>* %2
store <4 x i32> <i32 20, i32 20, i32 20, i32 20>, <4 x i32>* %3
store i32 2, i32* %13
store i32 17, i32* %12
store i32 4, i32* %14
store i32 17, i32* %15
%21 = call i32 @ex_put_cmap_params(i32 %0, i32* %10, i32* %11, i32* %12, i32* %13, i32 %20)
%22 = icmp slt i32 %21, 0
br i1 %22, label %23, label %16
23: ; preds = %16, %19
%24 = phi i32 [ %21, %19 ], [ 0, %16 ]
ret i32 %24
}