#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*/ eci_cleanup();
int /*<<< orphan*/ eci_command(char *);
int /*<<< orphan*/ eci_init();
int /*<<< orphan*/ eci_last_string();
int eci_last_string_list_count();
scalar_t__ memcmp(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ printf(char *, char *, int, ...);
int eci_test_3(void) {
  int count;
  do {
    printf("\n%s:%d - Test started\n",
           "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/jeremysalwen/Ecasound-LV2/refs/heads/LV2/"
           "libecasoundc/libecasoundc_tester.c",
           158);
  } while (0);
  eci_init();
  eci_command("cs-add default");
  eci_command("cs-selected");
  if (memcmp(eci_last_string(), "default", 7) != 0) {
    do {
      printf("\n%s:%d - Test failed: \"%s\"\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/jeremysalwen/Ecasound-LV2/refs/heads/"
             "LV2/libecasoundc/libecasoundc_tester.c",
             164, "chainsetup addition or selection failed");
      return 1;
    } while (0);
  }
  eci_command("cs-set-length 5");
  eci_command("c-add 1,2");
  eci_command("c-select-all");
  eci_command("c-selected");
  count = eci_last_string_list_count();
  if (count != 2) {
    do {
      printf("\n%s:%d - Test failed: \"%s\"\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/jeremysalwen/Ecasound-LV2/refs/heads/"
             "LV2/libecasoundc/libecasoundc_tester.c",
             174, "chain count mismatch");
      return 2;
    } while (0);
  }
  eci_command("-i:null");
  eci_command("-o:null");
  eci_command("cs-connect");
  eci_command("cs-connected");
  if (memcmp(eci_last_string(), "default", 7) != 0) {
    do {
      printf("\n%s:%d - Test failed: \"%s\"\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/jeremysalwen/Ecasound-LV2/refs/heads/"
             "LV2/libecasoundc/libecasoundc_tester.c",
             182, "can't connect chainsetup");
      return 3;
    } while (0);
  }
  eci_command("run");
  eci_cleanup();
  do {
    printf("%s:%d - Test passed\n",
           "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/jeremysalwen/Ecasound-LV2/refs/heads/LV2/"
           "libecasoundc/libecasoundc_tester.c",
           188);
    return 0;
  } while (0);
}


x86 assembly (clang, -O0):
<eci_test_3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xe81(%rip),%rdi
lea    0xe91(%rip),%rsi
mov    $0x9e,%edx
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x0,%al
call   1030 <eci_init@plt>
lea    0xf1d(%rip),%rdi
call   1090 <eci_command@plt>
lea    0xf20(%rip),%rdi
call   1090 <eci_command@plt>
mov    $0x0,%al
call   1040 <eci_last_string@plt>
mov    %eax,%edi
lea    0xf03(%rip),%rsi
mov    $0x7,%edx
call   1070 <memcmp@plt>
cmp    $0x0,%rax
je     1207 <eci_test_3+0x97>
jmp    11da <eci_test_3+0x6a>
lea    0xef7(%rip),%rdi
lea    0xe2f(%rip),%rsi
mov    $0xa4,%edx
lea    0xf00(%rip),%rcx
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1337 <eci_test_3+0x1c7>
lea    0xf0e(%rip),%rdi
call   1090 <eci_command@plt>
lea    0xf12(%rip),%rdi
call   1090 <eci_command@plt>
lea    0xf10(%rip),%rdi
call   1090 <eci_command@plt>
lea    0xf11(%rip),%rdi
call   1090 <eci_command@plt>
mov    $0x0,%al
call   1080 <eci_last_string_list_count@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     127d <eci_test_3+0x10d>
jmp    1250 <eci_test_3+0xe0>
lea    0xe81(%rip),%rdi
lea    0xdb9(%rip),%rsi
mov    $0xae,%edx
lea    0xee4(%rip),%rcx
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x2,-0x4(%rbp)
jmp    1337 <eci_test_3+0x1c7>
lea    0xedf(%rip),%rdi
call   1090 <eci_command@plt>
lea    0xedb(%rip),%rdi
call   1090 <eci_command@plt>
lea    0xed7(%rip),%rdi
call   1090 <eci_command@plt>
lea    0xed6(%rip),%rdi
call   1090 <eci_command@plt>
mov    $0x0,%al
call   1040 <eci_last_string@plt>
mov    %eax,%edi
lea    0xe07(%rip),%rsi
mov    $0x7,%edx
call   1070 <memcmp@plt>
cmp    $0x0,%rax
je     1303 <eci_test_3+0x193>
jmp    12d6 <eci_test_3+0x166>
lea    0xdfb(%rip),%rdi
lea    0xd33(%rip),%rsi
mov    $0xb6,%edx
lea    0xe9b(%rip),%rcx
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x3,-0x4(%rbp)
jmp    1337 <eci_test_3+0x1c7>
lea    0xe9a(%rip),%rdi
call   1090 <eci_command@plt>
mov    $0x0,%al
call   1050 <eci_cleanup@plt>
lea    0xe8b(%rip),%rdi
lea    0xcf3(%rip),%rsi
mov    $0xbc,%edx
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eci_test_3>:
push   %rbx
lea    0xe88(%rip),%rdi
lea    0xe98(%rip),%rsi
mov    $0x9e,%edx
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
call   1030 <eci_init@plt>
lea    0xf24(%rip),%rdi
call   1090 <eci_command@plt>
lea    0xf27(%rip),%rdi
call   1090 <eci_command@plt>
xor    %eax,%eax
call   1040 <eci_last_string@plt>
lea    0xf0c(%rip),%rsi
mov    %eax,%edi
mov    $0x7,%edx
call   1070 <memcmp@plt>
test   %rax,%rax
je     11f4 <eci_test_3+0x84>
lea    0xf08(%rip),%rdi
lea    0xe40(%rip),%rsi
lea    0xf16(%rip),%rcx
mov    $0xa4,%edx
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x1,%ebx
jmp    12fe <eci_test_3+0x18e>
lea    0xf21(%rip),%rdi
call   1090 <eci_command@plt>
lea    0xf25(%rip),%rdi
call   1090 <eci_command@plt>
lea    0xf23(%rip),%rdi
call   1090 <eci_command@plt>
lea    0xf24(%rip),%rdi
call   1090 <eci_command@plt>
xor    %eax,%eax
call   1080 <eci_last_string_list_count@plt>
cmp    $0x2,%eax
jne    12a9 <eci_test_3+0x139>
lea    0xf2c(%rip),%rdi
call   1090 <eci_command@plt>
lea    0xf28(%rip),%rdi
call   1090 <eci_command@plt>
lea    0xf24(%rip),%rdi
call   1090 <eci_command@plt>
lea    0xf23(%rip),%rdi
call   1090 <eci_command@plt>
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <eci_last_string@plt>
lea    0xe54(%rip),%rsi
mov    %eax,%edi
mov    $0x7,%edx
call   1070 <memcmp@plt>
test   %rax,%rax
je     12d1 <eci_test_3+0x161>
lea    0xe50(%rip),%rdi
lea    0xd88(%rip),%rsi
lea    0xef5(%rip),%rcx
mov    $0xb6,%edx
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x3,%ebx
jmp    12fe <eci_test_3+0x18e>
lea    0xe28(%rip),%rdi
lea    0xd60(%rip),%rsi
lea    0xe90(%rip),%rcx
mov    $0xae,%edx
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x2,%ebx
jmp    12fe <eci_test_3+0x18e>
lea    0xecc(%rip),%rdi
call   1090 <eci_command@plt>
xor    %eax,%eax
call   1050 <eci_cleanup@plt>
lea    0xebd(%rip),%rdi
lea    0xd25(%rip),%rsi
mov    $0xbc,%edx
xor    %eax,%eax
call   1060 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"\0A%s:%d - Test started\0A\00"
@.str.1 = [166 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/jeremysalwen/Ecasound-LV2/refs/heads/LV2/libecasoundc/libecasoundc_tester.c\00"
@.str.2 = [15 x i8] c"cs-add default\00"
@.str.3 = [12 x i8] c"cs-selected\00"
@.str.4 = [8 x i8] c"default\00"
@.str.5 = [28 x i8] c"\0A%s:%d - Test failed: \22%s\22\0A\00"
@.str.6 = [40 x i8] c"chainsetup addition or selection failed\00"
@.str.7 = [16 x i8] c"cs-set-length 5\00"
@.str.8 = [10 x i8] c"c-add 1,2\00"
@.str.9 = [13 x i8] c"c-select-all\00"
@.str.10 = [11 x i8] c"c-selected\00"
@.str.11 = [21 x i8] c"chain count mismatch\00"
@.str.12 = [8 x i8] c"-i:null\00"
@.str.13 = [8 x i8] c"-o:null\00"
@.str.14 = [11 x i8] c"cs-connect\00"
@.str.15 = [13 x i8] c"cs-connected\00"
@.str.16 = [25 x i8] c"can't connect chainsetup\00"
@.str.17 = [4 x i8] c"run\00"
@.str.18 = [21 x i8] c"%s:%d - Test passed\0A\00"
define i32 @eci_test_3() {
%1 = alloca i32
%2 = alloca i32
br label %3
3: ; preds = %0
%4 = call i32 (i8*, i8*, i32, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([166 x i8], [166 x i8]* @.str.1, i64 0, i64 0), i32 158)
br label %5
5: ; preds = %3
%6 = call i32 (...) @eci_init()
%7 = call i32 @eci_command(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @eci_command(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 (...) @eci_last_string()
%10 = call i64 @memcmp(i32 %9, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32 7)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %5
br label %13
13: ; preds = %12
%14 = call i32 (i8*, i8*, i32, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([166 x i8], [166 x i8]* @.str.1, i64 0, i64 0), i32 164, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.6, i64 0, i64 0))
store i32 1, i32* %1
br label %45
15: ; No predecessors!
br label %16
16: ; preds = %15, %5
%17 = call i32 @eci_command(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0))
%18 = call i32 @eci_command(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0))
%19 = call i32 @eci_command(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0))
%20 = call i32 @eci_command(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0))
%21 = call i32 (...) @eci_last_string_list_count()
store i32 %21, i32* %2
%22 = load i32, i32* %2
%23 = icmp ne i32 %22, 2
br i1 %23, label %24, label %28
24: ; preds = %16
br label %25
25: ; preds = %24
%26 = call i32 (i8*, i8*, i32, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([166 x i8], [166 x i8]* @.str.1, i64 0, i64 0), i32 174, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0))
store i32 2, i32* %1
br label %45
27: ; No predecessors!
br label %28
28: ; preds = %27, %16
%29 = call i32 @eci_command(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.12, i64 0, i64 0))
%30 = call i32 @eci_command(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.13, i64 0, i64 0))
%31 = call i32 @eci_command(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i64 0, i64 0))
%32 = call i32 @eci_command(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.15, i64 0, i64 0))
%33 = call i32 (...) @eci_last_string()
%34 = call i64 @memcmp(i32 %33, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32 7)
%35 = icmp ne i64 %34, 0
br i1 %35, label %36, label %40
36: ; preds = %28
br label %37
37: ; preds = %36
%38 = call i32 (i8*, i8*, i32, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([166 x i8], [166 x i8]* @.str.1, i64 0, i64 0), i32 182, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.16, i64 0, i64 0))
store i32 3, i32* %1
br label %45
39: ; No predecessors!
br label %40
40: ; preds = %39, %28
%41 = call i32 @eci_command(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0))
%42 = call i32 (...) @eci_cleanup()
br label %43
43: ; preds = %40
%44 = call i32 (i8*, i8*, i32, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([166 x i8], [166 x i8]* @.str.1, i64 0, i64 0), i32 188)
store i32 0, i32* %1
br label %45
45: ; preds = %13, %25, %37, %43
%46 = load i32, i32* %1
ret i32 %46
}

LLVM IR (-O2):
@.str = [23 x i8] c"\0A%s:%d - Test started\0A\00"
@.str.1 = [166 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/jeremysalwen/Ecasound-LV2/refs/heads/LV2/libecasoundc/libecasoundc_tester.c\00"
@.str.2 = [15 x i8] c"cs-add default\00"
@.str.3 = [12 x i8] c"cs-selected\00"
@.str.4 = [8 x i8] c"default\00"
@.str.5 = [28 x i8] c"\0A%s:%d - Test failed: \22%s\22\0A\00"
@.str.6 = [40 x i8] c"chainsetup addition or selection failed\00"
@.str.7 = [16 x i8] c"cs-set-length 5\00"
@.str.8 = [10 x i8] c"c-add 1,2\00"
@.str.9 = [13 x i8] c"c-select-all\00"
@.str.10 = [11 x i8] c"c-selected\00"
@.str.11 = [21 x i8] c"chain count mismatch\00"
@.str.12 = [8 x i8] c"-i:null\00"
@.str.13 = [8 x i8] c"-o:null\00"
@.str.14 = [11 x i8] c"cs-connect\00"
@.str.15 = [13 x i8] c"cs-connected\00"
@.str.16 = [25 x i8] c"can't connect chainsetup\00"
@.str.17 = [4 x i8] c"run\00"
@.str.18 = [21 x i8] c"%s:%d - Test passed\0A\00"
define i32 @eci_test_3() {
%1 = tail call i32 (i8*, i8*, i32, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([166 x i8], [166 x i8]* @.str.1, i64 0, i64 0), i32 158)
%2 = tail call i32 (...) @eci_init()
%3 = tail call i32 @eci_command(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @eci_command(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 (...) @eci_last_string()
%6 = tail call i64 @memcmp(i32 %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32 7)
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %0
%9 = tail call i32 (i8*, i8*, i32, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([166 x i8], [166 x i8]* @.str.1, i64 0, i64 0), i32 164, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.6, i64 0, i64 0))
br label %33
10: ; preds = %0
%11 = tail call i32 @eci_command(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0))
%12 = tail call i32 @eci_command(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0))
%13 = tail call i32 @eci_command(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0))
%14 = tail call i32 @eci_command(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0))
%15 = tail call i32 (...) @eci_last_string_list_count()
%16 = icmp eq i32 %15, 2
br i1 %16, label %19, label %17
17: ; preds = %10
%18 = tail call i32 (i8*, i8*, i32, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([166 x i8], [166 x i8]* @.str.1, i64 0, i64 0), i32 174, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0))
br label %33
19: ; preds = %10
%20 = tail call i32 @eci_command(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.12, i64 0, i64 0))
%21 = tail call i32 @eci_command(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.13, i64 0, i64 0))
%22 = tail call i32 @eci_command(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i64 0, i64 0))
%23 = tail call i32 @eci_command(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.15, i64 0, i64 0))
%24 = tail call i32 (...) @eci_last_string()
%25 = tail call i64 @memcmp(i32 %24, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32 7)
%26 = icmp eq i64 %25, 0
br i1 %26, label %29, label %27
27: ; preds = %19
%28 = tail call i32 (i8*, i8*, i32, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([166 x i8], [166 x i8]* @.str.1, i64 0, i64 0), i32 182, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.16, i64 0, i64 0))
br label %33
29: ; preds = %19
%30 = tail call i32 @eci_command(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0))
%31 = tail call i32 (...) @eci_cleanup()
%32 = tail call i32 (i8*, i8*, i32, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([166 x i8], [166 x i8]* @.str.1, i64 0, i64 0), i32 188)
br label %33
33: ; preds = %29, %27, %17, %8
%34 = phi i32 [ 1, %8 ], [ 2, %17 ], [ 3, %27 ], [ 0, %29 ]
ret i32 %34
}