#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_get_init_info(int, int *, int *, char *);
scalar_t__ strcmp(char *, char *);
int ne_test_giinf(int fileid) {
  int error, nproc, nprocf;
  char ftype[2];
  error = ne_get_init_info(fileid, &nproc, &nprocf, ftype);
  if (error < 0)
    return error;
  if (nproc != 10)
    return -1;
  if (nprocf != 10)
    return -1;
  if (strcmp(ftype, "s") != 0)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<ne_test_giinf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x16(%rbp),%rcx
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1040 <ne_get_init_info@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1157 <ne_test_giinf+0x37>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    11b0 <ne_test_giinf+0x90>
cmpl   $0xa,-0x10(%rbp)
je     116d <ne_test_giinf+0x4d>
movl   $0xffffffff,-0x4(%rbp)
jmp    11b0 <ne_test_giinf+0x90>
cmpl   $0xa,-0x14(%rbp)
je     1183 <ne_test_giinf+0x63>
movl   $0xffffffff,-0x4(%rbp)
jmp    11b0 <ne_test_giinf+0x90>
lea    -0x16(%rbp),%rdi
lea    0xe72(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     11a9 <ne_test_giinf+0x89>
movl   $0xffffffff,-0x4(%rbp)
jmp    11b0 <ne_test_giinf+0x90>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ne_test_giinf>:
sub    $0x18,%rsp
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xe(%rsp),%rcx
call   1040 <ne_get_init_info@plt>
test   %eax,%eax
js     1165 <ne_test_giinf+0x45>
cmpl   $0xa,0x14(%rsp)
mov    $0xffffffff,%eax
jne    1165 <ne_test_giinf+0x45>
cmpl   $0xa,0x10(%rsp)
jne    1165 <ne_test_giinf+0x45>
lea    0xeaa(%rip),%rsi
lea    0xe(%rsp),%rdi
call   1030 <strcmp@plt>
neg    %rax
sbb    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"s\00"
define i32 @ne_test_giinf(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [2 x i8]
store i32 %0, i32* %3
%8 = load i32, i32* %3
%9 = getelementptr inbounds [2 x i8], [2 x i8]* %7, i64 0, i64 0
%10 = call i32 @ne_get_init_info(i32 %8, i32* %5, i32* %6, i8* %9)
store i32 %10, i32* %4
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %1
%14 = load i32, i32* %4
store i32 %14, i32* %2
br label %29
15: ; preds = %1
%16 = load i32, i32* %5
%17 = icmp ne i32 %16, 10
br i1 %17, label %18, label %19
18: ; preds = %15
store i32 -1, i32* %2
br label %29
19: ; preds = %15
%20 = load i32, i32* %6
%21 = icmp ne i32 %20, 10
br i1 %21, label %22, label %23
22: ; preds = %19
store i32 -1, i32* %2
br label %29
23: ; preds = %19
%24 = getelementptr inbounds [2 x i8], [2 x i8]* %7, i64 0, i64 0
%25 = call i64 @strcmp(i8* %24, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%26 = icmp ne i64 %25, 0
br i1 %26, label %27, label %28
27: ; preds = %23
store i32 -1, i32* %2
br label %29
28: ; preds = %23
store i32 0, i32* %2
br label %29
29: ; preds = %28, %27, %22, %18, %13
%30 = load i32, i32* %2
ret i32 %30
}

LLVM IR (-O2):
@.str = [2 x i8] c"s\00"
define i32 @ne_test_giinf(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [2 x i8]
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
%8 = call i32 @ne_get_init_info(i32 %0, i32* %2, i32* %3, i8* %7)
%9 = icmp slt i32 %8, 0
br i1 %9, label %20, label %10
10: ; preds = %1
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, 10
%13 = load i32, i32* %3
%14 = icmp eq i32 %13, 10
%15 = select i1 %12, i1 %14, i1 false
br i1 %15, label %16, label %20
16: ; preds = %10
%17 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%18 = icmp ne i64 %17, 0
%19 = sext i1 %18 to i32
br label %20
20: ; preds = %16, %10, %1
%21 = phi i32 [ %8, %1 ], [ -1, %10 ], [ %19, %16 ]
ret i32 %21
}