#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 UnsignedModulus(int, int);
int /*<<< orphan*/ _assert_int_equal(int /*<<< orphan*/, int /*<<< orphan*/,
                                     char *, int);
int /*<<< orphan*/ _cast_to_largest_integral_type(int, int);
void test_unsigned_modulus(void) {
  _assert_int_equal(_cast_to_largest_integral_type(
                        sizeof(UnsignedModulus(0, 3)), UnsignedModulus(0, 3)),
                    _cast_to_largest_integral_type(sizeof(0), 0),
                    "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/jooooooon/core/refs/"
                    "heads/master/tests/unit/misc_lib_test.c",
                    8);
  _assert_int_equal(_cast_to_largest_integral_type(
                        sizeof(UnsignedModulus(1, 3)), UnsignedModulus(1, 3)),
                    _cast_to_largest_integral_type(sizeof(1), 1),
                    "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/jooooooon/core/refs/"
                    "heads/master/tests/unit/misc_lib_test.c",
                    9);
  _assert_int_equal(_cast_to_largest_integral_type(
                        sizeof(UnsignedModulus(2, 3)), UnsignedModulus(2, 3)),
                    _cast_to_largest_integral_type(sizeof(2), 2),
                    "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/jooooooon/core/refs/"
                    "heads/master/tests/unit/misc_lib_test.c",
                    10);
  _assert_int_equal(_cast_to_largest_integral_type(
                        sizeof(UnsignedModulus(3, 3)), UnsignedModulus(3, 3)),
                    _cast_to_largest_integral_type(sizeof(0), 0),
                    "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/jooooooon/core/refs/"
                    "heads/master/tests/unit/misc_lib_test.c",
                    11);
  _assert_int_equal(_cast_to_largest_integral_type(
                        sizeof(UnsignedModulus(4, 3)), UnsignedModulus(4, 3)),
                    _cast_to_largest_integral_type(sizeof(1), 1),
                    "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/jooooooon/core/refs/"
                    "heads/master/tests/unit/misc_lib_test.c",
                    12);
  _assert_int_equal(_cast_to_largest_integral_type(
                        sizeof(UnsignedModulus(-1, 3)), UnsignedModulus(-1, 3)),
                    _cast_to_largest_integral_type(sizeof(2), 2),
                    "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/jooooooon/core/refs/"
                    "heads/master/tests/unit/misc_lib_test.c",
                    14);
  _assert_int_equal(_cast_to_largest_integral_type(
                        sizeof(UnsignedModulus(-2, 3)), UnsignedModulus(-2, 3)),
                    _cast_to_largest_integral_type(sizeof(1), 1),
                    "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/jooooooon/core/refs/"
                    "heads/master/tests/unit/misc_lib_test.c",
                    15);
  _assert_int_equal(_cast_to_largest_integral_type(
                        sizeof(UnsignedModulus(-3, 3)), UnsignedModulus(-3, 3)),
                    _cast_to_largest_integral_type(sizeof(0), 0),
                    "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/jooooooon/core/refs/"
                    "heads/master/tests/unit/misc_lib_test.c",
                    16);
  _assert_int_equal(_cast_to_largest_integral_type(
                        sizeof(UnsignedModulus(-4, 3)), UnsignedModulus(-4, 3)),
                    _cast_to_largest_integral_type(sizeof(2), 2),
                    "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/jooooooon/core/refs/"
                    "heads/master/tests/unit/misc_lib_test.c",
                    17);
}


x86 assembly (clang, -O0):
<test_unsigned_modulus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
xor    %edi,%edi
mov    $0x3,%esi
call   1040 <UnsignedModulus@plt>
mov    %eax,%esi
mov    $0x4,%edi
call   1030 <_cast_to_largest_integral_type@plt>
mov    %eax,-0x24(%rbp)
mov    $0x4,%edi
xor    %esi,%esi
call   1030 <_cast_to_largest_integral_type@plt>
mov    -0x24(%rbp),%edi
mov    %eax,%esi
lea    0xe95(%rip),%rdx
mov    $0x8,%ecx
call   1050 <_assert_int_equal@plt>
mov    $0x1,%edi
mov    $0x3,%esi
call   1040 <UnsignedModulus@plt>
mov    %eax,%esi
mov    $0x4,%edi
call   1030 <_cast_to_largest_integral_type@plt>
mov    %eax,-0x20(%rbp)
mov    $0x4,%edi
mov    $0x1,%esi
call   1030 <_cast_to_largest_integral_type@plt>
mov    -0x20(%rbp),%edi
mov    %eax,%esi
lea    0xe52(%rip),%rdx
mov    $0x9,%ecx
call   1050 <_assert_int_equal@plt>
mov    $0x2,%edi
mov    $0x3,%esi
call   1040 <UnsignedModulus@plt>
mov    %eax,%esi
mov    $0x4,%edi
call   1030 <_cast_to_largest_integral_type@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x4,%edi
mov    $0x2,%esi
call   1030 <_cast_to_largest_integral_type@plt>
mov    -0x1c(%rbp),%edi
mov    %eax,%esi
lea    0xe0f(%rip),%rdx
mov    $0xa,%ecx
call   1050 <_assert_int_equal@plt>
mov    $0x3,%esi
mov    %esi,%edi
call   1040 <UnsignedModulus@plt>
mov    %eax,%esi
mov    $0x4,%edi
call   1030 <_cast_to_largest_integral_type@plt>
mov    %eax,-0x18(%rbp)
mov    $0x4,%edi
xor    %esi,%esi
call   1030 <_cast_to_largest_integral_type@plt>
mov    -0x18(%rbp),%edi
mov    %eax,%esi
lea    0xdd2(%rip),%rdx
mov    $0xb,%ecx
call   1050 <_assert_int_equal@plt>
mov    $0x4,%edi
mov    $0x3,%esi
call   1040 <UnsignedModulus@plt>
mov    %eax,%esi
mov    $0x4,%edi
call   1030 <_cast_to_largest_integral_type@plt>
mov    %eax,-0x14(%rbp)
mov    $0x4,%edi
mov    $0x1,%esi
call   1030 <_cast_to_largest_integral_type@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
lea    0xd8f(%rip),%rdx
mov    $0xc,%ecx
call   1050 <_assert_int_equal@plt>
mov    $0xffffffff,%edi
mov    $0x3,%esi
call   1040 <UnsignedModulus@plt>
mov    %eax,%esi
mov    $0x4,%edi
call   1030 <_cast_to_largest_integral_type@plt>
mov    %eax,-0x10(%rbp)
mov    $0x4,%edi
mov    $0x2,%esi
call   1030 <_cast_to_largest_integral_type@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
lea    0xd4c(%rip),%rdx
mov    $0xe,%ecx
call   1050 <_assert_int_equal@plt>
mov    $0xfffffffe,%edi
mov    $0x3,%esi
call   1040 <UnsignedModulus@plt>
mov    %eax,%esi
mov    $0x4,%edi
call   1030 <_cast_to_largest_integral_type@plt>
mov    %eax,-0xc(%rbp)
mov    $0x4,%edi
mov    $0x1,%esi
call   1030 <_cast_to_largest_integral_type@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
lea    0xd09(%rip),%rdx
mov    $0xf,%ecx
call   1050 <_assert_int_equal@plt>
mov    $0xfffffffd,%edi
mov    $0x3,%esi
call   1040 <UnsignedModulus@plt>
mov    %eax,%esi
mov    $0x4,%edi
call   1030 <_cast_to_largest_integral_type@plt>
mov    %eax,-0x8(%rbp)
mov    $0x4,%edi
xor    %esi,%esi
call   1030 <_cast_to_largest_integral_type@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
lea    0xcc9(%rip),%rdx
mov    $0x10,%ecx
call   1050 <_assert_int_equal@plt>
mov    $0xfffffffc,%edi
mov    $0x3,%esi
call   1040 <UnsignedModulus@plt>
mov    %eax,%esi
mov    $0x4,%edi
call   1030 <_cast_to_largest_integral_type@plt>
mov    %eax,-0x4(%rbp)
mov    $0x4,%edi
mov    $0x2,%esi
call   1030 <_cast_to_largest_integral_type@plt>
mov    -0x4(%rbp),%edi
mov    %eax,%esi
lea    0xc86(%rip),%rdx
mov    $0x11,%ecx
call   1050 <_assert_int_equal@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_unsigned_modulus>:
push   %rbp
push   %rbx
push   %rax
xor    %edi,%edi
mov    $0x3,%esi
call   1040 <UnsignedModulus@plt>
mov    $0x4,%edi
mov    %eax,%esi
call   1030 <_cast_to_largest_integral_type@plt>
mov    %eax,%ebp
mov    $0x4,%edi
xor    %esi,%esi
call   1030 <_cast_to_largest_integral_type@plt>
lea    0xea0(%rip),%rbx
mov    %ebp,%edi
mov    %eax,%esi
mov    %rbx,%rdx
mov    $0x8,%ecx
call   1050 <_assert_int_equal@plt>
mov    $0x1,%edi
mov    $0x3,%esi
call   1040 <UnsignedModulus@plt>
mov    $0x4,%edi
mov    %eax,%esi
call   1030 <_cast_to_largest_integral_type@plt>
mov    %eax,%ebp
mov    $0x4,%edi
mov    $0x1,%esi
call   1030 <_cast_to_largest_integral_type@plt>
mov    %ebp,%edi
mov    %eax,%esi
mov    %rbx,%rdx
mov    $0x9,%ecx
call   1050 <_assert_int_equal@plt>
mov    $0x2,%edi
mov    $0x3,%esi
call   1040 <UnsignedModulus@plt>
mov    $0x4,%edi
mov    %eax,%esi
call   1030 <_cast_to_largest_integral_type@plt>
mov    %eax,%ebp
mov    $0x4,%edi
mov    $0x2,%esi
call   1030 <_cast_to_largest_integral_type@plt>
mov    %ebp,%edi
mov    %eax,%esi
mov    %rbx,%rdx
mov    $0xa,%ecx
call   1050 <_assert_int_equal@plt>
mov    $0x3,%edi
mov    $0x3,%esi
call   1040 <UnsignedModulus@plt>
mov    $0x4,%edi
mov    %eax,%esi
call   1030 <_cast_to_largest_integral_type@plt>
mov    %eax,%ebp
mov    $0x4,%edi
xor    %esi,%esi
call   1030 <_cast_to_largest_integral_type@plt>
mov    %ebp,%edi
mov    %eax,%esi
mov    %rbx,%rdx
mov    $0xb,%ecx
call   1050 <_assert_int_equal@plt>
mov    $0x4,%edi
mov    $0x3,%esi
call   1040 <UnsignedModulus@plt>
mov    $0x4,%edi
mov    %eax,%esi
call   1030 <_cast_to_largest_integral_type@plt>
mov    %eax,%ebp
mov    $0x4,%edi
mov    $0x1,%esi
call   1030 <_cast_to_largest_integral_type@plt>
mov    %ebp,%edi
mov    %eax,%esi
mov    %rbx,%rdx
mov    $0xc,%ecx
call   1050 <_assert_int_equal@plt>
mov    $0xffffffff,%edi
mov    $0x3,%esi
call   1040 <UnsignedModulus@plt>
mov    $0x4,%edi
mov    %eax,%esi
call   1030 <_cast_to_largest_integral_type@plt>
mov    %eax,%ebp
mov    $0x4,%edi
mov    $0x2,%esi
call   1030 <_cast_to_largest_integral_type@plt>
mov    %ebp,%edi
mov    %eax,%esi
mov    %rbx,%rdx
mov    $0xe,%ecx
call   1050 <_assert_int_equal@plt>
mov    $0xfffffffe,%edi
mov    $0x3,%esi
call   1040 <UnsignedModulus@plt>
mov    $0x4,%edi
mov    %eax,%esi
call   1030 <_cast_to_largest_integral_type@plt>
mov    %eax,%ebp
mov    $0x4,%edi
mov    $0x1,%esi
call   1030 <_cast_to_largest_integral_type@plt>
mov    %ebp,%edi
mov    %eax,%esi
mov    %rbx,%rdx
mov    $0xf,%ecx
call   1050 <_assert_int_equal@plt>
mov    $0xfffffffd,%edi
mov    $0x3,%esi
call   1040 <UnsignedModulus@plt>
mov    $0x4,%edi
mov    %eax,%esi
call   1030 <_cast_to_largest_integral_type@plt>
mov    %eax,%ebp
mov    $0x4,%edi
xor    %esi,%esi
call   1030 <_cast_to_largest_integral_type@plt>
mov    %ebp,%edi
mov    %eax,%esi
mov    %rbx,%rdx
mov    $0x10,%ecx
call   1050 <_assert_int_equal@plt>
mov    $0xfffffffc,%edi
mov    $0x3,%esi
call   1040 <UnsignedModulus@plt>
mov    $0x4,%edi
mov    %eax,%esi
call   1030 <_cast_to_largest_integral_type@plt>
mov    %eax,%ebp
mov    $0x4,%edi
mov    $0x2,%esi
call   1030 <_cast_to_largest_integral_type@plt>
mov    %ebp,%edi
mov    %eax,%esi
mov    %rbx,%rdx
mov    $0x11,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <_assert_int_equal@plt>

LLVM IR (-O0):
@.str = [150 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/jooooooon/core/refs/heads/master/tests/unit/misc_lib_test.c\00"
define void @test_unsigned_modulus() {
%1 = call i32 @UnsignedModulus(i32 0, i32 3)
%2 = call i32 @_cast_to_largest_integral_type(i32 4, i32 %1)
%3 = call i32 @_cast_to_largest_integral_type(i32 4, i32 0)
%4 = call i32 @_assert_int_equal(i32 %2, i32 %3, i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i32 8)
%5 = call i32 @UnsignedModulus(i32 1, i32 3)
%6 = call i32 @_cast_to_largest_integral_type(i32 4, i32 %5)
%7 = call i32 @_cast_to_largest_integral_type(i32 4, i32 1)
%8 = call i32 @_assert_int_equal(i32 %6, i32 %7, i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i32 9)
%9 = call i32 @UnsignedModulus(i32 2, i32 3)
%10 = call i32 @_cast_to_largest_integral_type(i32 4, i32 %9)
%11 = call i32 @_cast_to_largest_integral_type(i32 4, i32 2)
%12 = call i32 @_assert_int_equal(i32 %10, i32 %11, i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i32 10)
%13 = call i32 @UnsignedModulus(i32 3, i32 3)
%14 = call i32 @_cast_to_largest_integral_type(i32 4, i32 %13)
%15 = call i32 @_cast_to_largest_integral_type(i32 4, i32 0)
%16 = call i32 @_assert_int_equal(i32 %14, i32 %15, i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i32 11)
%17 = call i32 @UnsignedModulus(i32 4, i32 3)
%18 = call i32 @_cast_to_largest_integral_type(i32 4, i32 %17)
%19 = call i32 @_cast_to_largest_integral_type(i32 4, i32 1)
%20 = call i32 @_assert_int_equal(i32 %18, i32 %19, i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i32 12)
%21 = call i32 @UnsignedModulus(i32 -1, i32 3)
%22 = call i32 @_cast_to_largest_integral_type(i32 4, i32 %21)
%23 = call i32 @_cast_to_largest_integral_type(i32 4, i32 2)
%24 = call i32 @_assert_int_equal(i32 %22, i32 %23, i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i32 14)
%25 = call i32 @UnsignedModulus(i32 -2, i32 3)
%26 = call i32 @_cast_to_largest_integral_type(i32 4, i32 %25)
%27 = call i32 @_cast_to_largest_integral_type(i32 4, i32 1)
%28 = call i32 @_assert_int_equal(i32 %26, i32 %27, i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i32 15)
%29 = call i32 @UnsignedModulus(i32 -3, i32 3)
%30 = call i32 @_cast_to_largest_integral_type(i32 4, i32 %29)
%31 = call i32 @_cast_to_largest_integral_type(i32 4, i32 0)
%32 = call i32 @_assert_int_equal(i32 %30, i32 %31, i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i32 16)
%33 = call i32 @UnsignedModulus(i32 -4, i32 3)
%34 = call i32 @_cast_to_largest_integral_type(i32 4, i32 %33)
%35 = call i32 @_cast_to_largest_integral_type(i32 4, i32 2)
%36 = call i32 @_assert_int_equal(i32 %34, i32 %35, i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i32 17)
ret void
}

LLVM IR (-O2):
@.str = [150 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/jooooooon/core/refs/heads/master/tests/unit/misc_lib_test.c\00"
define void @test_unsigned_modulus() {
%1 = tail call i32 @UnsignedModulus(i32 0, i32 3)
%2 = tail call i32 @_cast_to_largest_integral_type(i32 4, i32 %1)
%3 = tail call i32 @_cast_to_largest_integral_type(i32 4, i32 0)
%4 = tail call i32 @_assert_int_equal(i32 %2, i32 %3, i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i32 8)
%5 = tail call i32 @UnsignedModulus(i32 1, i32 3)
%6 = tail call i32 @_cast_to_largest_integral_type(i32 4, i32 %5)
%7 = tail call i32 @_cast_to_largest_integral_type(i32 4, i32 1)
%8 = tail call i32 @_assert_int_equal(i32 %6, i32 %7, i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i32 9)
%9 = tail call i32 @UnsignedModulus(i32 2, i32 3)
%10 = tail call i32 @_cast_to_largest_integral_type(i32 4, i32 %9)
%11 = tail call i32 @_cast_to_largest_integral_type(i32 4, i32 2)
%12 = tail call i32 @_assert_int_equal(i32 %10, i32 %11, i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i32 10)
%13 = tail call i32 @UnsignedModulus(i32 3, i32 3)
%14 = tail call i32 @_cast_to_largest_integral_type(i32 4, i32 %13)
%15 = tail call i32 @_cast_to_largest_integral_type(i32 4, i32 0)
%16 = tail call i32 @_assert_int_equal(i32 %14, i32 %15, i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i32 11)
%17 = tail call i32 @UnsignedModulus(i32 4, i32 3)
%18 = tail call i32 @_cast_to_largest_integral_type(i32 4, i32 %17)
%19 = tail call i32 @_cast_to_largest_integral_type(i32 4, i32 1)
%20 = tail call i32 @_assert_int_equal(i32 %18, i32 %19, i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i32 12)
%21 = tail call i32 @UnsignedModulus(i32 -1, i32 3)
%22 = tail call i32 @_cast_to_largest_integral_type(i32 4, i32 %21)
%23 = tail call i32 @_cast_to_largest_integral_type(i32 4, i32 2)
%24 = tail call i32 @_assert_int_equal(i32 %22, i32 %23, i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i32 14)
%25 = tail call i32 @UnsignedModulus(i32 -2, i32 3)
%26 = tail call i32 @_cast_to_largest_integral_type(i32 4, i32 %25)
%27 = tail call i32 @_cast_to_largest_integral_type(i32 4, i32 1)
%28 = tail call i32 @_assert_int_equal(i32 %26, i32 %27, i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i32 15)
%29 = tail call i32 @UnsignedModulus(i32 -3, i32 3)
%30 = tail call i32 @_cast_to_largest_integral_type(i32 4, i32 %29)
%31 = tail call i32 @_cast_to_largest_integral_type(i32 4, i32 0)
%32 = tail call i32 @_assert_int_equal(i32 %30, i32 %31, i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i32 16)
%33 = tail call i32 @UnsignedModulus(i32 -4, i32 3)
%34 = tail call i32 @_cast_to_largest_integral_type(i32 4, i32 %33)
%35 = tail call i32 @_cast_to_largest_integral_type(i32 4, i32 2)
%36 = tail call i32 @_assert_int_equal(i32 %34, i32 %35, i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i32 17)
ret void
}