#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 */
scalar_t__ isocket_pair_imp(int *, int, int);
int isocket_pair(int fds[2], int mode) {
  if (isocket_pair_imp(fds, mode, -1) == 0)
    return 0;
  if (isocket_pair_imp(fds, mode, -1) == 0)
    return 0;
  if (isocket_pair_imp(fds, mode, -1) == 0)
    return 0;
  return -1;
}


x86 assembly (clang, -O0):
<isocket_pair>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0xffffffff,%edx
call   1030 <isocket_pair_imp@plt>
cmp    $0x0,%rax
jne    1146 <isocket_pair+0x36>
movl   $0x0,-0x4(%rbp)
jmp    119b <isocket_pair+0x8b>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0xffffffff,%edx
call   1030 <isocket_pair_imp@plt>
cmp    $0x0,%rax
jne    116d <isocket_pair+0x5d>
movl   $0x0,-0x4(%rbp)
jmp    119b <isocket_pair+0x8b>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0xffffffff,%edx
call   1030 <isocket_pair_imp@plt>
cmp    $0x0,%rax
jne    1194 <isocket_pair+0x84>
movl   $0x0,-0x4(%rbp)
jmp    119b <isocket_pair+0x8b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isocket_pair>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0xffffffff,%edx
call   1030 <isocket_pair_imp@plt>
xor    %r14d,%r14d
test   %rax,%rax
je     1154 <isocket_pair+0x44>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0xffffffff,%edx
call   1030 <isocket_pair_imp@plt>
test   %rax,%rax
je     1154 <isocket_pair+0x44>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0xffffffff,%edx
call   1030 <isocket_pair_imp@plt>
neg    %rax
sbb    %r14d,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @isocket_pair(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
%6 = load i32*, i32** %4
%7 = load i32, i32* %5
%8 = call i64 @isocket_pair_imp(i32* %6, i32 %7, i32 -1)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 0, i32* %3
br label %24
11: ; preds = %2
%12 = load i32*, i32** %4
%13 = load i32, i32* %5
%14 = call i64 @isocket_pair_imp(i32* %12, i32 %13, i32 -1)
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %11
store i32 0, i32* %3
br label %24
17: ; preds = %11
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = call i64 @isocket_pair_imp(i32* %18, i32 %19, i32 -1)
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %17
store i32 0, i32* %3
br label %24
23: ; preds = %17
store i32 -1, i32* %3
br label %24
24: ; preds = %23, %22, %16, %10
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @isocket_pair(i32* %0, i32 %1) {
%3 = tail call i64 @isocket_pair_imp(i32* %0, i32 %1, i32 -1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2
%6 = tail call i64 @isocket_pair_imp(i32* %0, i32 %1, i32 -1)
%7 = icmp eq i64 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %5
%9 = tail call i64 @isocket_pair_imp(i32* %0, i32 %1, i32 -1)
%10 = icmp ne i64 %9, 0
%11 = sext i1 %10 to i32
br label %12
12: ; preds = %8, %5, %2
%13 = phi i32 [ 0, %2 ], [ 0, %5 ], [ %11, %8 ]
ret i32 %13
}