#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 Send(int, void *, int /*<<< orphan*/, void *, int /*<<< orphan*/);
int /*<<< orphan*/ _assert(int, char *, int, char *);
void test_send_tid_impossible(void) {
  int rc;
  rc = Send(128, ((void *)0), 0, ((void *)0), 0);
  _assert((rc == -1),
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/mthiffau/HeatheRTOS/refs/heads/master/"
          "test/test_ipc.c",
          63, "rc == -1");
  rc = Send(255, ((void *)0), 0, ((void *)0), 0);
  _assert((rc == -1),
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/mthiffau/HeatheRTOS/refs/heads/master/"
          "test/test_ipc.c",
          65, "rc == -1");
  rc = Send(256 + 128, ((void *)0), 0, ((void *)0), 0);
  _assert((rc == -1),
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/mthiffau/HeatheRTOS/refs/heads/master/"
          "test/test_ipc.c",
          67, "rc == -1");
  rc = Send(256 + 255, ((void *)0), 0, ((void *)0), 0);
  _assert((rc == -1),
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/mthiffau/HeatheRTOS/refs/heads/master/"
          "test/test_ipc.c",
          69, "rc == -1");
  rc = Send(1 << 16, ((void *)0), 0, ((void *)0), 0);
  _assert((rc == -1),
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/mthiffau/HeatheRTOS/refs/heads/master/"
          "test/test_ipc.c",
          71, "rc == -1");
  rc = Send(-1, ((void *)0), 0, ((void *)0), 0);
  _assert((rc == -1),
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/mthiffau/HeatheRTOS/refs/heads/master/"
          "test/test_ipc.c",
          73, "rc == -1");
}


x86 assembly (clang, -O0):
<test_send_tid_impossible>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x80,%edi
xor    %eax,%eax
mov    %eax,%ecx
xor    %r8d,%r8d
mov    %rcx,%rsi
mov    %r8d,%edx
call   1030 <Send@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xeab(%rip),%rsi
mov    $0x3f,%edx
lea    0xf2f(%rip),%rcx
call   1040 <_assert@plt>
mov    $0xff,%edi
xor    %eax,%eax
mov    %eax,%ecx
xor    %r8d,%r8d
mov    %rcx,%rsi
mov    %r8d,%edx
call   1030 <Send@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xe6d(%rip),%rsi
mov    $0x41,%edx
lea    0xef1(%rip),%rcx
call   1040 <_assert@plt>
mov    $0x180,%edi
xor    %eax,%eax
mov    %eax,%ecx
xor    %r8d,%r8d
mov    %rcx,%rsi
mov    %r8d,%edx
call   1030 <Send@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xe2f(%rip),%rsi
mov    $0x43,%edx
lea    0xeb3(%rip),%rcx
call   1040 <_assert@plt>
mov    $0x1ff,%edi
xor    %eax,%eax
mov    %eax,%ecx
xor    %r8d,%r8d
mov    %rcx,%rsi
mov    %r8d,%edx
call   1030 <Send@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xdf1(%rip),%rsi
mov    $0x45,%edx
lea    0xe75(%rip),%rcx
call   1040 <_assert@plt>
mov    $0x10000,%edi
xor    %eax,%eax
mov    %eax,%ecx
xor    %r8d,%r8d
mov    %rcx,%rsi
mov    %r8d,%edx
call   1030 <Send@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xdb3(%rip),%rsi
mov    $0x47,%edx
lea    0xe37(%rip),%rcx
call   1040 <_assert@plt>
mov    $0xffffffff,%edi
xor    %eax,%eax
mov    %eax,%ecx
xor    %r8d,%r8d
mov    %rcx,%rsi
mov    %r8d,%edx
call   1030 <Send@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xd75(%rip),%rsi
mov    $0x49,%edx
lea    0xdf9(%rip),%rcx
call   1040 <_assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_send_tid_impossible>:
push   %r14
push   %rbx
push   %rax
mov    $0x80,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <Send@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
lea    0xeb9(%rip),%rbx
lea    0xf42(%rip),%r14
mov    %rbx,%rsi
mov    $0x3f,%edx
mov    %r14,%rcx
call   1040 <_assert@plt>
mov    $0xff,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <Send@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
mov    %rbx,%rsi
mov    $0x41,%edx
mov    %r14,%rcx
call   1040 <_assert@plt>
mov    $0x180,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <Send@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
mov    %rbx,%rsi
mov    $0x43,%edx
mov    %r14,%rcx
call   1040 <_assert@plt>
mov    $0x1ff,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <Send@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
mov    %rbx,%rsi
mov    $0x45,%edx
mov    %r14,%rcx
call   1040 <_assert@plt>
mov    $0x10000,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <Send@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
mov    %rbx,%rsi
mov    $0x47,%edx
mov    %r14,%rcx
call   1040 <_assert@plt>
mov    $0xffffffff,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <Send@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
mov    %rbx,%rsi
mov    $0x49,%edx
mov    %r14,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <_assert@plt>

LLVM IR (-O0):
@.str = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/mthiffau/HeatheRTOS/refs/heads/master/test/test_ipc.c\00"
@.str.1 = [9 x i8] c"rc == -1\00"
define void @test_send_tid_impossible() {
%1 = alloca i32
%2 = call i32 @Send(i32 128, i8* null, i32 0, i8* null, i32 0)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, -1
%5 = zext i1 %4 to i32
%6 = call i32 @_assert(i32 %5, i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 63, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @Send(i32 255, i8* null, i32 0, i8* null, i32 0)
store i32 %7, i32* %1
%8 = load i32, i32* %1
%9 = icmp eq i32 %8, -1
%10 = zext i1 %9 to i32
%11 = call i32 @_assert(i32 %10, i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 65, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 @Send(i32 384, i8* null, i32 0, i8* null, i32 0)
store i32 %12, i32* %1
%13 = load i32, i32* %1
%14 = icmp eq i32 %13, -1
%15 = zext i1 %14 to i32
%16 = call i32 @_assert(i32 %15, i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 67, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%17 = call i32 @Send(i32 511, i8* null, i32 0, i8* null, i32 0)
store i32 %17, i32* %1
%18 = load i32, i32* %1
%19 = icmp eq i32 %18, -1
%20 = zext i1 %19 to i32
%21 = call i32 @_assert(i32 %20, i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 69, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%22 = call i32 @Send(i32 65536, i8* null, i32 0, i8* null, i32 0)
store i32 %22, i32* %1
%23 = load i32, i32* %1
%24 = icmp eq i32 %23, -1
%25 = zext i1 %24 to i32
%26 = call i32 @_assert(i32 %25, i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 71, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%27 = call i32 @Send(i32 -1, i8* null, i32 0, i8* null, i32 0)
store i32 %27, i32* %1
%28 = load i32, i32* %1
%29 = icmp eq i32 %28, -1
%30 = zext i1 %29 to i32
%31 = call i32 @_assert(i32 %30, i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 73, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/mthiffau/HeatheRTOS/refs/heads/master/test/test_ipc.c\00"
@.str.1 = [9 x i8] c"rc == -1\00"
define void @test_send_tid_impossible() {
%1 = tail call i32 @Send(i32 128, i8* null, i32 0, i8* null, i32 0)
%2 = icmp eq i32 %1, -1
%3 = zext i1 %2 to i32
%4 = tail call i32 @_assert(i32 %3, i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 63, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @Send(i32 255, i8* null, i32 0, i8* null, i32 0)
%6 = icmp eq i32 %5, -1
%7 = zext i1 %6 to i32
%8 = tail call i32 @_assert(i32 %7, i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 65, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%9 = tail call i32 @Send(i32 384, i8* null, i32 0, i8* null, i32 0)
%10 = icmp eq i32 %9, -1
%11 = zext i1 %10 to i32
%12 = tail call i32 @_assert(i32 %11, i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 67, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%13 = tail call i32 @Send(i32 511, i8* null, i32 0, i8* null, i32 0)
%14 = icmp eq i32 %13, -1
%15 = zext i1 %14 to i32
%16 = tail call i32 @_assert(i32 %15, i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 69, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%17 = tail call i32 @Send(i32 65536, i8* null, i32 0, i8* null, i32 0)
%18 = icmp eq i32 %17, -1
%19 = zext i1 %18 to i32
%20 = tail call i32 @_assert(i32 %19, i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 71, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%21 = tail call i32 @Send(i32 -1, i8* null, i32 0, i8* null, i32 0)
%22 = icmp eq i32 %21, -1
%23 = zext i1 %22 to i32
%24 = tail call i32 @_assert(i32 %23, i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 73, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret void
}