#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_get_init_global(int, int *, int *, int *, int *, int *);
int ne_test_ginig(int fileid) {
  int error;
  int num_nodes_g, num_elems_g, num_elem_blks_g, num_ns_g, num_ss_g;
  error = ex_get_init_global(fileid, &num_nodes_g, &num_elems_g,
                             &num_elem_blks_g, &num_ns_g, &num_ss_g);
  if (error < 0)
    return error;
  if (num_nodes_g != 100)
    return -1;
  if (num_elems_g != 50)
    return -1;
  if (num_elem_blks_g != 5)
    return -1;
  if (num_ns_g != 2)
    return -1;
  if (num_ss_g != 3)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<ne_test_ginig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
lea    -0x18(%rbp),%rcx
lea    -0x1c(%rbp),%r8
lea    -0x20(%rbp),%r9
call   1030 <ex_get_init_global@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    114f <ne_test_ginig+0x3f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    11c4 <ne_test_ginig+0xb4>
cmpl   $0x64,-0x10(%rbp)
je     1165 <ne_test_ginig+0x55>
movl   $0xffffffff,-0x4(%rbp)
jmp    11c4 <ne_test_ginig+0xb4>
cmpl   $0x32,-0x14(%rbp)
je     117b <ne_test_ginig+0x6b>
movl   $0xffffffff,-0x4(%rbp)
jmp    11c4 <ne_test_ginig+0xb4>
cmpl   $0x5,-0x18(%rbp)
je     1191 <ne_test_ginig+0x81>
movl   $0xffffffff,-0x4(%rbp)
jmp    11c4 <ne_test_ginig+0xb4>
cmpl   $0x2,-0x1c(%rbp)
je     11a7 <ne_test_ginig+0x97>
movl   $0xffffffff,-0x4(%rbp)
jmp    11c4 <ne_test_ginig+0xb4>
cmpl   $0x3,-0x20(%rbp)
je     11bd <ne_test_ginig+0xad>
movl   $0xffffffff,-0x4(%rbp)
jmp    11c4 <ne_test_ginig+0xb4>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ne_test_ginig>:
sub    $0x18,%rsp
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
lea    0x4(%rsp),%r9
call   1030 <ex_get_init_global@plt>
test   %eax,%eax
js     1163 <ne_test_ginig+0x53>
cmpl   $0x64,0x14(%rsp)
mov    $0xffffffff,%eax
jne    1163 <ne_test_ginig+0x53>
cmpl   $0x32,0x10(%rsp)
jne    1163 <ne_test_ginig+0x53>
cmpl   $0x5,0xc(%rsp)
jne    1163 <ne_test_ginig+0x53>
cmpl   $0x2,0x8(%rsp)
jne    1163 <ne_test_ginig+0x53>
xor    %eax,%eax
cmpl   $0x3,0x4(%rsp)
setne  %al
neg    %eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @ne_test_ginig(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %3
%10 = load i32, i32* %3
%11 = call i32 @ex_get_init_global(i32 %10, i32* %5, i32* %6, i32* %7, i32* %8, i32* %9)
store i32 %11, i32* %4
%12 = load i32, i32* %4
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %1
%15 = load i32, i32* %4
store i32 %15, i32* %2
br label %37
16: ; preds = %1
%17 = load i32, i32* %5
%18 = icmp ne i32 %17, 100
br i1 %18, label %19, label %20
19: ; preds = %16
store i32 -1, i32* %2
br label %37
20: ; preds = %16
%21 = load i32, i32* %6
%22 = icmp ne i32 %21, 50
br i1 %22, label %23, label %24
23: ; preds = %20
store i32 -1, i32* %2
br label %37
24: ; preds = %20
%25 = load i32, i32* %7
%26 = icmp ne i32 %25, 5
br i1 %26, label %27, label %28
27: ; preds = %24
store i32 -1, i32* %2
br label %37
28: ; preds = %24
%29 = load i32, i32* %8
%30 = icmp ne i32 %29, 2
br i1 %30, label %31, label %32
31: ; preds = %28
store i32 -1, i32* %2
br label %37
32: ; preds = %28
%33 = load i32, i32* %9
%34 = icmp ne i32 %33, 3
br i1 %34, label %35, label %36
35: ; preds = %32
store i32 -1, i32* %2
br label %37
36: ; preds = %32
store i32 0, i32* %2
br label %37
37: ; preds = %36, %35, %31, %27, %23, %19, %14
%38 = load i32, i32* %2
ret i32 %38
}

LLVM IR (-O2):
define i32 @ne_test_ginig(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = bitcast i32* %2 to i8*
%8 = bitcast i32* %3 to i8*
%9 = bitcast i32* %4 to i8*
%10 = bitcast i32* %5 to i8*
%11 = bitcast i32* %6 to i8*
%12 = call i32 @ex_get_init_global(i32 %0, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6)
%13 = icmp slt i32 %12, 0
br i1 %13, label %30, label %14
14: ; preds = %1
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 100
%17 = load i32, i32* %3
%18 = icmp eq i32 %17, 50
%19 = select i1 %16, i1 %18, i1 false
%20 = load i32, i32* %4
%21 = icmp eq i32 %20, 5
%22 = select i1 %19, i1 %21, i1 false
%23 = load i32, i32* %5
%24 = icmp eq i32 %23, 2
%25 = select i1 %22, i1 %24, i1 false
br i1 %25, label %26, label %30
26: ; preds = %14
%27 = load i32, i32* %6
%28 = icmp ne i32 %27, 3
%29 = sext i1 %28 to i32
br label %30
30: ; preds = %26, %14, %1
%31 = phi i32 [ %12, %1 ], [ -1, %14 ], [ %29, %26 ]
ret i32 %31
}