#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 /*<<< orphan*/ F_GETFD;
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ coe_disable(int);
int /*<<< orphan*/ coe_enable(int);
scalar_t__ fcntl(int, int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *,
                           unsigned long long, char *);
int pipe(int *);
int /*<<< orphan*/ stderr;
int main(void) {
  int pi[2];
  long long i;
  if (pipe(pi) == -1)
    do {
      fprintf(stderr, "%s:%llu: %s\n",
              ("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/janmojzis/tinyssh/refs/heads/"
               "master/tinyssh-tests/coetest.c"),
              (unsigned long long)(18), (("failure")));
      fflush(stderr);
      _exit(111);
    } while (0);
  ;
  for (i = 0; i < 2; ++i) {
    if (fcntl(pi[i], F_GETFD) != 0)
      do {
        fprintf(stderr, "%s:%llu: %s\n",
                ("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                 "outputs/2022-01-22/02-19-57/repos/janmojzis/tinyssh/refs/"
                 "heads/master/tinyssh-tests/coetest.c"),
                (unsigned long long)(20), (("failure")));
        fflush(stderr);
        _exit(111);
      } while (0);
    ;
    coe_enable(pi[i]);
    if (fcntl(pi[i], F_GETFD) == 0)
      do {
        fprintf(stderr, "%s:%llu: %s\n",
                ("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                 "outputs/2022-01-22/02-19-57/repos/janmojzis/tinyssh/refs/"
                 "heads/master/tinyssh-tests/coetest.c"),
                (unsigned long long)(22), (("failure")));
        fflush(stderr);
        _exit(111);
      } while (0);
    ;
    coe_disable(pi[i]);
    if (fcntl(pi[i], F_GETFD) != 0)
      do {
        fprintf(stderr, "%s:%llu: %s\n",
                ("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                 "outputs/2022-01-22/02-19-57/repos/janmojzis/tinyssh/refs/"
                 "heads/master/tinyssh-tests/coetest.c"),
                (unsigned long long)(24), (("failure")));
        fflush(stderr);
        _exit(111);
      } while (0);
    ;
  }
  _exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xc(%rbp),%rdi
call   1060 <pipe@plt>
cmp    $0xffffffff,%eax
jne    11d6 <main+0x66>
jmp    1196 <main+0x26>
mov    0x2e43(%rip),%rax
mov    (%rax),%edi
lea    0xe5a(%rip),%rsi
lea    0xe60(%rip),%rdx
mov    $0x12,%ecx
lea    0xeea(%rip),%r8
call   1070 <fprintf@plt>
mov    0x2e1b(%rip),%rax
mov    (%rax),%edi
call   1080 <fflush@plt>
mov    $0x6f,%edi
call   1030 <_exit@plt>
movq   $0x0,-0x18(%rbp)
cmpq   $0x2,-0x18(%rbp)
jge    1348 <main+0x1d8>
mov    -0x18(%rbp),%rax
mov    -0xc(%rbp,%rax,4),%edi
mov    0x2de0(%rip),%rax
mov    (%rax),%esi
call   1040 <fcntl@plt>
cmp    $0x0,%rax
je     124e <main+0xde>
jmp    120e <main+0x9e>
mov    0x2dcb(%rip),%rax
mov    (%rax),%edi
lea    0xde2(%rip),%rsi
lea    0xde8(%rip),%rdx
mov    $0x14,%ecx
lea    0xe72(%rip),%r8
call   1070 <fprintf@plt>
mov    0x2da3(%rip),%rax
mov    (%rax),%edi
call   1080 <fflush@plt>
mov    $0x6f,%edi
call   1030 <_exit@plt>
mov    -0x18(%rbp),%rax
mov    -0xc(%rbp,%rax,4),%edi
call   1050 <coe_enable@plt>
mov    -0x18(%rbp),%rax
mov    -0xc(%rbp,%rax,4),%edi
mov    0x2d6e(%rip),%rax
mov    (%rax),%esi
call   1040 <fcntl@plt>
cmp    $0x0,%rax
jne    12c0 <main+0x150>
jmp    1280 <main+0x110>
mov    0x2d59(%rip),%rax
mov    (%rax),%edi
lea    0xd70(%rip),%rsi
lea    0xd76(%rip),%rdx
mov    $0x16,%ecx
lea    0xe00(%rip),%r8
call   1070 <fprintf@plt>
mov    0x2d31(%rip),%rax
mov    (%rax),%edi
call   1080 <fflush@plt>
mov    $0x6f,%edi
call   1030 <_exit@plt>
mov    -0x18(%rbp),%rax
mov    -0xc(%rbp,%rax,4),%edi
call   1090 <coe_disable@plt>
mov    -0x18(%rbp),%rax
mov    -0xc(%rbp,%rax,4),%edi
mov    0x2cfc(%rip),%rax
mov    (%rax),%esi
call   1040 <fcntl@plt>
cmp    $0x0,%rax
je     1332 <main+0x1c2>
jmp    12f2 <main+0x182>
mov    0x2ce7(%rip),%rax
mov    (%rax),%edi
lea    0xcfe(%rip),%rsi
lea    0xd04(%rip),%rdx
mov    $0x18,%ecx
lea    0xd8e(%rip),%r8
call   1070 <fprintf@plt>
mov    0x2cbf(%rip),%rax
mov    (%rax),%edi
call   1080 <fflush@plt>
mov    $0x6f,%edi
call   1030 <_exit@plt>
jmp    1337 <main+0x1c7>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    11de <main+0x6e>
xor    %edi,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rdi
call   1060 <pipe@plt>
cmp    $0xffffffff,%eax
jne    11ac <main+0x3c>
mov    0x2e55(%rip),%rbx
mov    (%rbx),%edi
lea    0xe6c(%rip),%rsi
lea    0xe72(%rip),%rdx
lea    0xf01(%rip),%r8
mov    $0x12,%ecx
jmp    1291 <main+0x121>
mov    0x8(%rsp),%edi
mov    0x2e21(%rip),%rbx
mov    (%rbx),%esi
call   1040 <fcntl@plt>
test   %rax,%rax
jne    126e <main+0xfe>
mov    0x8(%rsp),%edi
call   1050 <coe_enable@plt>
mov    0x8(%rsp),%edi
mov    (%rbx),%esi
call   1040 <fcntl@plt>
test   %rax,%rax
jne    1208 <main+0x98>
mov    0x2df9(%rip),%rbx
mov    (%rbx),%edi
lea    0xe10(%rip),%rsi
lea    0xe16(%rip),%rdx
lea    0xea5(%rip),%r8
mov    $0x16,%ecx
jmp    1291 <main+0x121>
mov    0x8(%rsp),%edi
call   1090 <coe_disable@plt>
mov    0x8(%rsp),%edi
mov    (%rbx),%esi
call   1040 <fcntl@plt>
test   %rax,%rax
jne    12a7 <main+0x137>
mov    0xc(%rsp),%edi
mov    (%rbx),%esi
call   1040 <fcntl@plt>
test   %rax,%rax
jne    126e <main+0xfe>
mov    0xc(%rsp),%edi
call   1050 <coe_enable@plt>
mov    0xc(%rsp),%edi
mov    (%rbx),%esi
call   1040 <fcntl@plt>
test   %rax,%rax
je     11e0 <main+0x70>
mov    0xc(%rsp),%edi
call   1090 <coe_disable@plt>
mov    0xc(%rsp),%edi
mov    (%rbx),%esi
call   1040 <fcntl@plt>
test   %rax,%rax
jne    12a7 <main+0x137>
xor    %edi,%edi
call   1030 <_exit@plt>
mov    0x2d6b(%rip),%rbx
mov    (%rbx),%edi
lea    0xd82(%rip),%rsi
lea    0xd88(%rip),%rdx
lea    0xe17(%rip),%r8
mov    $0x14,%ecx
call   1070 <fprintf@plt>
mov    (%rbx),%edi
call   1080 <fflush@plt>
mov    $0x6f,%edi
call   1030 <_exit@plt>
mov    0x2d32(%rip),%rbx
mov    (%rbx),%edi
lea    0xd49(%rip),%rsi
lea    0xd4f(%rip),%rdx
lea    0xdde(%rip),%r8
mov    $0x18,%ecx
jmp    1291 <main+0x121>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [13 x i8] c"%s:%llu: %s\0A\00"
@.str.1 = [150 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/janmojzis/tinyssh/refs/heads/master/tinyssh-tests/coetest.c\00"
@.str.2 = [8 x i8] c"failure\00"
@F_GETFD = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i32]
%3 = alloca i64
store i32 0, i32* %1
%4 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%5 = call i32 @pipe(i32* %4)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %15
7: ; preds = %0
br label %8
8: ; preds = %7
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.1, i64 0, i64 0), i64 18, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%11 = load i32, i32* @stderr
%12 = call i32 @fflush(i32 %11)
%13 = call i32 @_exit(i32 111)
unreachable
14: ; No predecessors!
br label %15
15: ; preds = %14, %0
store i64 0, i64* %3
br label %16
16: ; preds = %73, %15
%17 = load i64, i64* %3
%18 = icmp slt i64 %17, 2
br i1 %18, label %19, label %76
19: ; preds = %16
%20 = load i64, i64* %3
%21 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 %20
%22 = load i32, i32* %21
%23 = load i32, i32* @F_GETFD
%24 = call i64 @fcntl(i32 %22, i32 %23)
%25 = icmp ne i64 %24, 0
br i1 %25, label %26, label %34
26: ; preds = %19
br label %27
27: ; preds = %26
%28 = load i32, i32* @stderr
%29 = call i32 @fprintf(i32 %28, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.1, i64 0, i64 0), i64 20, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%30 = load i32, i32* @stderr
%31 = call i32 @fflush(i32 %30)
%32 = call i32 @_exit(i32 111)
unreachable
33: ; No predecessors!
br label %34
34: ; preds = %33, %19
%35 = load i64, i64* %3
%36 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 %35
%37 = load i32, i32* %36
%38 = call i32 @coe_enable(i32 %37)
%39 = load i64, i64* %3
%40 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 %39
%41 = load i32, i32* %40
%42 = load i32, i32* @F_GETFD
%43 = call i64 @fcntl(i32 %41, i32 %42)
%44 = icmp eq i64 %43, 0
br i1 %44, label %45, label %53
45: ; preds = %34
br label %46
46: ; preds = %45
%47 = load i32, i32* @stderr
%48 = call i32 @fprintf(i32 %47, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.1, i64 0, i64 0), i64 22, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%49 = load i32, i32* @stderr
%50 = call i32 @fflush(i32 %49)
%51 = call i32 @_exit(i32 111)
unreachable
52: ; No predecessors!
br label %53
53: ; preds = %52, %34
%54 = load i64, i64* %3
%55 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 %54
%56 = load i32, i32* %55
%57 = call i32 @coe_disable(i32 %56)
%58 = load i64, i64* %3
%59 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 %58
%60 = load i32, i32* %59
%61 = load i32, i32* @F_GETFD
%62 = call i64 @fcntl(i32 %60, i32 %61)
%63 = icmp ne i64 %62, 0
br i1 %63, label %64, label %72
64: ; preds = %53
br label %65
65: ; preds = %64
%66 = load i32, i32* @stderr
%67 = call i32 @fprintf(i32 %66, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.1, i64 0, i64 0), i64 24, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%68 = load i32, i32* @stderr
%69 = call i32 @fflush(i32 %68)
%70 = call i32 @_exit(i32 111)
unreachable
71: ; No predecessors!
br label %72
72: ; preds = %71, %53
br label %73
73: ; preds = %72
%74 = load i64, i64* %3
%75 = add nsw i64 %74, 1
store i64 %75, i64* %3
br label %16
76: ; preds = %16
%77 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [13 x i8] c"%s:%llu: %s\0A\00"
@.str.1 = [150 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/janmojzis/tinyssh/refs/heads/master/tinyssh-tests/coetest.c\00"
@.str.2 = [8 x i8] c"failure\00"
@F_GETFD = global i32 0
define i32 @main() {
%1 = alloca [2 x i32]
%2 = bitcast [2 x i32]* %1 to i8*
%3 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%4 = call i32 @pipe(i32* %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %11, label %6
6: ; preds = %0
%7 = load i32, i32* %3
%8 = load i32, i32* @F_GETFD
%9 = call i64 @fcntl(i32 %7, i32 %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %45, label %39
11: ; preds = %0
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.1, i64 0, i64 0), i64 18, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%14 = load i32, i32* @stderr
%15 = call i32 @fflush(i32 %14)
%16 = call i32 @_exit(i32 111)
unreachable
17: ; preds = %58
%18 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 1
%19 = load i32, i32* %18
%20 = load i32, i32* @F_GETFD
%21 = call i64 @fcntl(i32 %19, i32 %20)
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %39
23: ; preds = %17
%24 = load i32, i32* %18
%25 = call i32 @coe_enable(i32 %24)
%26 = load i32, i32* %18
%27 = load i32, i32* @F_GETFD
%28 = call i64 @fcntl(i32 %26, i32 %27)
%29 = icmp eq i64 %28, 0
br i1 %29, label %52, label %30
30: ; preds = %23
%31 = load i32, i32* %18
%32 = call i32 @coe_disable(i32 %31)
%33 = load i32, i32* %18
%34 = load i32, i32* @F_GETFD
%35 = call i64 @fcntl(i32 %33, i32 %34)
%36 = icmp eq i64 %35, 0
br i1 %36, label %37, label %65
37: ; preds = %30
%38 = call i32 @_exit(i32 0)
unreachable
39: ; preds = %17, %6
%40 = load i32, i32* @stderr
%41 = call i32 @fprintf(i32 %40, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.1, i64 0, i64 0), i64 20, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%42 = load i32, i32* @stderr
%43 = call i32 @fflush(i32 %42)
%44 = call i32 @_exit(i32 111)
unreachable
45: ; preds = %6
%46 = load i32, i32* %3
%47 = call i32 @coe_enable(i32 %46)
%48 = load i32, i32* %3
%49 = load i32, i32* @F_GETFD
%50 = call i64 @fcntl(i32 %48, i32 %49)
%51 = icmp eq i64 %50, 0
br i1 %51, label %52, label %58
52: ; preds = %23, %45
%53 = load i32, i32* @stderr
%54 = call i32 @fprintf(i32 %53, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.1, i64 0, i64 0), i64 22, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%55 = load i32, i32* @stderr
%56 = call i32 @fflush(i32 %55)
%57 = call i32 @_exit(i32 111)
unreachable
58: ; preds = %45
%59 = load i32, i32* %3
%60 = call i32 @coe_disable(i32 %59)
%61 = load i32, i32* %3
%62 = load i32, i32* @F_GETFD
%63 = call i64 @fcntl(i32 %61, i32 %62)
%64 = icmp eq i64 %63, 0
br i1 %64, label %17, label %65
65: ; preds = %30, %58
%66 = load i32, i32* @stderr
%67 = call i32 @fprintf(i32 %66, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.1, i64 0, i64 0), i64 24, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%68 = load i32, i32* @stderr
%69 = call i32 @fflush(i32 %68)
%70 = call i32 @_exit(i32 111)
unreachable
}