#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);
int multu_variants(int, int);
int main() {
  assert(multu_variants(17, 19) == 323);
  assert(multu_variants(77773, 99991) == 7776600043);
  assert(multu_variants(12207031, 305175781) == 3725290219116211);
  assert(multu_variants(0x80000000U, 0x7FFFFFFF) == 0x3FFFFFFF80000000);
  assert(multu_variants(0x80000000U, 0x80000000U) == 0x4000000000000000);
  assert(multu_variants(0xFFFFFFFFU, 0xFFFFFFFFU) == 0xFFFFFFFE00000001U);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x11,%edi
mov    $0x13,%esi
call   1040 <multu_variants@plt>
cmp    $0x143,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x12fcd,%edi
mov    $0x18697,%esi
call   1040 <multu_variants@plt>
cltq
movabs $0x1cf857feb,%rcx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0xba43b7,%edi
mov    $0x12309ce5,%esi
call   1040 <multu_variants@plt>
cltq
movabs $0xd3c21b83216b3,%rcx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x80000000,%edi
mov    $0x7fffffff,%esi
call   1040 <multu_variants@plt>
cltq
movabs $0x3fffffff80000000,%rcx
ff ff 3f
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x80000000,%esi
mov    %esi,%edi
call   1040 <multu_variants@plt>
cltq
movabs $0x4000000000000000,%rcx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0xffffffff,%esi
mov    %esi,%edi
call   1040 <multu_variants@plt>
cltq
movabs $0xfffffffe00000001,%rcx
ff ff ff
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x11,%edi
mov    $0x13,%esi
call   1040 <multu_variants@plt>
xor    %edi,%edi
cmp    $0x143,%eax
sete   %dil
call   1030 <assert@plt>
mov    $0x12fcd,%edi
mov    $0x18697,%esi
call   1040 <multu_variants@plt>
xor    %edi,%edi
call   1030 <assert@plt>
mov    $0xba43b7,%edi
mov    $0x12309ce5,%esi
call   1040 <multu_variants@plt>
xor    %edi,%edi
call   1030 <assert@plt>
mov    $0x80000000,%edi
mov    $0x7fffffff,%esi
call   1040 <multu_variants@plt>
xor    %edi,%edi
call   1030 <assert@plt>
mov    $0x80000000,%edi
mov    $0x80000000,%esi
call   1040 <multu_variants@plt>
xor    %edi,%edi
call   1030 <assert@plt>
mov    $0xffffffff,%edi
mov    $0xffffffff,%esi
call   1040 <multu_variants@plt>
xor    %edi,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @multu_variants(i32 17, i32 19)
%3 = icmp eq i32 %2, 323
%4 = zext i1 %3 to i32
%5 = call i32 @assert(i32 %4)
%6 = call i32 @multu_variants(i32 77773, i32 99991)
%7 = sext i32 %6 to i64
%8 = icmp eq i64 %7, 7776600043
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = call i32 @multu_variants(i32 12207031, i32 305175781)
%12 = sext i32 %11 to i64
%13 = icmp eq i64 %12, 3725290219116211
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = call i32 @multu_variants(i32 -2147483648, i32 2147483647)
%17 = sext i32 %16 to i64
%18 = icmp eq i64 %17, 4611686016279904256
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
%21 = call i32 @multu_variants(i32 -2147483648, i32 -2147483648)
%22 = sext i32 %21 to i64
%23 = icmp eq i64 %22, 4611686018427387904
%24 = zext i1 %23 to i32
%25 = call i32 @assert(i32 %24)
%26 = call i32 @multu_variants(i32 -1, i32 -1)
%27 = sext i32 %26 to i64
%28 = icmp eq i64 %27, -8589934591
%29 = zext i1 %28 to i32
%30 = call i32 @assert(i32 %29)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @multu_variants(i32 17, i32 19)
%2 = icmp eq i32 %1, 323
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @multu_variants(i32 77773, i32 99991)
%6 = tail call i32 @assert(i32 0)
%7 = tail call i32 @multu_variants(i32 12207031, i32 305175781)
%8 = tail call i32 @assert(i32 0)
%9 = tail call i32 @multu_variants(i32 -2147483648, i32 2147483647)
%10 = tail call i32 @assert(i32 0)
%11 = tail call i32 @multu_variants(i32 -2147483648, i32 -2147483648)
%12 = tail call i32 @assert(i32 0)
%13 = tail call i32 @multu_variants(i32 -1, i32 -1)
%14 = tail call i32 @assert(i32 0)
ret i32 0
}