#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 Reply(int, void *, int /*<<< orphan*/);
int /*<<< orphan*/ _assert(int, char *, int, char *);
void test_rply_tid_impossible(void) {
  int rc;
  rc = Reply(128, ((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",
          101, "rc == -1");
  rc = Reply(255, ((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",
          103, "rc == -1");
  rc = Reply(256 + 128, ((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",
          105, "rc == -1");
  rc = Reply(256 + 255, ((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",
          107, "rc == -1");
  rc = Reply(1 << 16, ((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",
          109, "rc == -1");
  rc = Reply(-1, ((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",
          111, "rc == -1");
}


x86 assembly (clang, -O0):
<test_rply_tid_impossible>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x80,%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1030 <Reply@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xeb2(%rip),%rsi
mov    $0x65,%edx
lea    0xf36(%rip),%rcx
call   1040 <_assert@plt>
mov    $0xff,%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1030 <Reply@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xe7b(%rip),%rsi
mov    $0x67,%edx
lea    0xeff(%rip),%rcx
call   1040 <_assert@plt>
mov    $0x180,%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1030 <Reply@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xe44(%rip),%rsi
mov    $0x69,%edx
lea    0xec8(%rip),%rcx
call   1040 <_assert@plt>
mov    $0x1ff,%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1030 <Reply@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xe0d(%rip),%rsi
mov    $0x6b,%edx
lea    0xe91(%rip),%rcx
call   1040 <_assert@plt>
mov    $0x10000,%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1030 <Reply@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xdd6(%rip),%rsi
mov    $0x6d,%edx
lea    0xe5a(%rip),%rcx
call   1040 <_assert@plt>
mov    $0xffffffff,%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1030 <Reply@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xd9f(%rip),%rsi
mov    $0x6f,%edx
lea    0xe23(%rip),%rcx
call   1040 <_assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_rply_tid_impossible>:
push   %r14
push   %rbx
push   %rax
mov    $0x80,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <Reply@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
lea    0xebe(%rip),%rbx
lea    0xf47(%rip),%r14
mov    %rbx,%rsi
mov    $0x65,%edx
mov    %r14,%rcx
call   1040 <_assert@plt>
mov    $0xff,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <Reply@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
mov    %rbx,%rsi
mov    $0x67,%edx
mov    %r14,%rcx
call   1040 <_assert@plt>
mov    $0x180,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <Reply@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
mov    %rbx,%rsi
mov    $0x69,%edx
mov    %r14,%rcx
call   1040 <_assert@plt>
mov    $0x1ff,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <Reply@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
mov    %rbx,%rsi
mov    $0x6b,%edx
mov    %r14,%rcx
call   1040 <_assert@plt>
mov    $0x10000,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <Reply@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
mov    %rbx,%rsi
mov    $0x6d,%edx
mov    %r14,%rcx
call   1040 <_assert@plt>
mov    $0xffffffff,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <Reply@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
mov    %rbx,%rsi
mov    $0x6f,%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_rply_tid_impossible() {
%1 = alloca i32
%2 = call i32 @Reply(i32 128, 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 101, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @Reply(i32 255, 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 103, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 @Reply(i32 384, 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 105, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%17 = call i32 @Reply(i32 511, 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 107, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%22 = call i32 @Reply(i32 65536, 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 109, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%27 = call i32 @Reply(i32 -1, 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 111, 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_rply_tid_impossible() {
%1 = tail call i32 @Reply(i32 128, 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 101, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @Reply(i32 255, 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 103, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%9 = tail call i32 @Reply(i32 384, 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 105, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%13 = tail call i32 @Reply(i32 511, 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 107, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%17 = tail call i32 @Reply(i32 65536, 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 109, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%21 = tail call i32 @Reply(i32 -1, 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 111, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret void
}