#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*/ _assert(int, char *, int);
int /*<<< orphan*/ puts(char *);
void test_bit_operations(void) {
  long i;
  unsigned long u, v;
  puts("--- testing bit operations\n");
  i = 0;
  _assert(((~i) == -1),
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/BSVC/bsvc/refs/heads/master/samples/"
          "m68360/gdb7/test7.c",
          336);
  u = 0xFF;
  _assert(((~u) == 0xFFFFFF00),
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/BSVC/bsvc/refs/heads/master/samples/"
          "m68360/gdb7/test7.c",
          339);
  i = -1;
  _assert((((unsigned long)i) == 0xFFFFFFFF),
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/BSVC/bsvc/refs/heads/master/samples/"
          "m68360/gdb7/test7.c",
          342);
  u = 2;
  _assert(((u >> 1) == 1),
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/BSVC/bsvc/refs/heads/master/samples/"
          "m68360/gdb7/test7.c",
          345);
  _assert(((u >> 2) == 0),
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/BSVC/bsvc/refs/heads/master/samples/"
          "m68360/gdb7/test7.c",
          346);
  _assert(((u << 1) == 4),
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/BSVC/bsvc/refs/heads/master/samples/"
          "m68360/gdb7/test7.c",
          347);
  _assert(((u << 2) == 8),
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/BSVC/bsvc/refs/heads/master/samples/"
          "m68360/gdb7/test7.c",
          348);
  u = 0xFF;
  _assert(((u << 8) == 0xFF00),
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/BSVC/bsvc/refs/heads/master/samples/"
          "m68360/gdb7/test7.c",
          351);
  u = 0xFF;
  v = 0xFF0;
  _assert(((u ^ v) == 0xF0F),
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/BSVC/bsvc/refs/heads/master/samples/"
          "m68360/gdb7/test7.c",
          355);
}


x86 assembly (clang, -O0):
<test_bit_operations>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xor    $0xffffffffffffffff,%rax
cmp    $0xffffffffffffffff,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec5(%rip),%rsi
mov    $0x150,%edx
call   1040 <_assert@plt>
movq   $0xff,-0x10(%rbp)
mov    -0x10(%rbp),%rax
xor    $0xffffffffffffffff,%rax
mov    $0xffffff00,%ecx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xe94(%rip),%rsi
mov    $0x153,%edx
call   1040 <_assert@plt>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
mov    $0xffffffff,%eax
cmp    %rax,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xe6a(%rip),%rsi
mov    $0x156,%edx
call   1040 <_assert@plt>
movq   $0x2,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x1,%rax
cmp    $0x1,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xe3d(%rip),%rsi
mov    $0x159,%edx
call   1040 <_assert@plt>
mov    -0x10(%rbp),%rax
shr    $0x2,%rax
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xe18(%rip),%rsi
mov    $0x15a,%edx
call   1040 <_assert@plt>
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
cmp    $0x4,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xdf3(%rip),%rsi
mov    $0x15b,%edx
call   1040 <_assert@plt>
mov    -0x10(%rbp),%rax
shl    $0x2,%rax
cmp    $0x8,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xdce(%rip),%rsi
mov    $0x15c,%edx
call   1040 <_assert@plt>
movq   $0xff,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x8,%rax
cmp    $0xff00,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xd9f(%rip),%rsi
mov    $0x15f,%edx
call   1040 <_assert@plt>
movq   $0xff,-0x10(%rbp)
movq   $0xff0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
xor    -0x18(%rbp),%rax
cmp    $0xf0f,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xd68(%rip),%rsi
mov    $0x163,%edx
call   1040 <_assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_bit_operations>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee8(%rip),%rbx
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x150,%edx
call   1040 <_assert@plt>
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0x153,%edx
call   1040 <_assert@plt>
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0x156,%edx
call   1040 <_assert@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x159,%edx
call   1040 <_assert@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x15a,%edx
call   1040 <_assert@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x15b,%edx
call   1040 <_assert@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x15c,%edx
call   1040 <_assert@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x15f,%edx
call   1040 <_assert@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x163,%edx
pop    %rbx
jmp    1040 <_assert@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"--- testing bit operations\0A\00"
@.str.1 = [146 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/BSVC/bsvc/refs/heads/master/samples/m68360/gdb7/test7.c\00"
define void @test_bit_operations() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i64
%4 = call i32 @puts(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
store i64 0, i64* %1
%5 = load i64, i64* %1
%6 = xor i64 %5, -1
%7 = icmp eq i64 %6, -1
%8 = zext i1 %7 to i32
%9 = call i32 @_assert(i32 %8, i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0), i32 336)
store i64 255, i64* %2
%10 = load i64, i64* %2
%11 = xor i64 %10, -1
%12 = icmp eq i64 %11, 4294967040
%13 = zext i1 %12 to i32
%14 = call i32 @_assert(i32 %13, i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0), i32 339)
store i64 -1, i64* %1
%15 = load i64, i64* %1
%16 = icmp eq i64 %15, 4294967295
%17 = zext i1 %16 to i32
%18 = call i32 @_assert(i32 %17, i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0), i32 342)
store i64 2, i64* %2
%19 = load i64, i64* %2
%20 = lshr i64 %19, 1
%21 = icmp eq i64 %20, 1
%22 = zext i1 %21 to i32
%23 = call i32 @_assert(i32 %22, i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0), i32 345)
%24 = load i64, i64* %2
%25 = lshr i64 %24, 2
%26 = icmp eq i64 %25, 0
%27 = zext i1 %26 to i32
%28 = call i32 @_assert(i32 %27, i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0), i32 346)
%29 = load i64, i64* %2
%30 = shl i64 %29, 1
%31 = icmp eq i64 %30, 4
%32 = zext i1 %31 to i32
%33 = call i32 @_assert(i32 %32, i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0), i32 347)
%34 = load i64, i64* %2
%35 = shl i64 %34, 2
%36 = icmp eq i64 %35, 8
%37 = zext i1 %36 to i32
%38 = call i32 @_assert(i32 %37, i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0), i32 348)
store i64 255, i64* %2
%39 = load i64, i64* %2
%40 = shl i64 %39, 8
%41 = icmp eq i64 %40, 65280
%42 = zext i1 %41 to i32
%43 = call i32 @_assert(i32 %42, i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0), i32 351)
store i64 255, i64* %2
store i64 4080, i64* %3
%44 = load i64, i64* %2
%45 = load i64, i64* %3
%46 = xor i64 %44, %45
%47 = icmp eq i64 %46, 3855
%48 = zext i1 %47 to i32
%49 = call i32 @_assert(i32 %48, i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0), i32 355)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"--- testing bit operations\0A\00"
@.str.1 = [146 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/BSVC/bsvc/refs/heads/master/samples/m68360/gdb7/test7.c\00"
define void @test_bit_operations() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @_assert(i32 1, i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0), i32 336)
%3 = tail call i32 @_assert(i32 0, i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0), i32 339)
%4 = tail call i32 @_assert(i32 0, i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0), i32 342)
%5 = tail call i32 @_assert(i32 1, i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0), i32 345)
%6 = tail call i32 @_assert(i32 1, i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0), i32 346)
%7 = tail call i32 @_assert(i32 1, i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0), i32 347)
%8 = tail call i32 @_assert(i32 1, i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0), i32 348)
%9 = tail call i32 @_assert(i32 1, i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0), i32 351)
%10 = tail call i32 @_assert(i32 1, i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0), i32 355)
ret void
}