#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 fail(int /*<<< orphan*/);
int mul_i16(int, int);
int mul_i32(int, int);
int mul_i64(int, int);
int mul_i8(int, int);
int test_mul(void) {
  if (mul_i8(-1, 1) != -1)
    return fail(0);
  if (mul_i8(-1, -1) != 1)
    return fail(0);
  if (mul_i8(1, 1) != 1)
    return fail(0);
  if (mul_i8(17, 35) != 83)
    return fail(0);
  if (mul_i16(-1, 1) != -1)
    return fail(0);
  if (mul_i16(-1, -1) != 1)
    return fail(0);
  if (mul_i16(1, 1) != 1)
    return fail(0);
  if (mul_i16(179, 871) != 24837)
    return fail(0);
  if (mul_i32(-1, 1) != -1)
    return fail(0);
  if (mul_i32(-1, -1) != 1)
    return fail(0);
  if (mul_i32(1, 1) != 1)
    return fail(0);
  if (mul_i32(179536, 871912) != 1920770176)
    return fail(0);
  if (mul_i64(-1, 1) != -1)
    return fail(0);
  if (mul_i64(-1, -1) != 1)
    return fail(0);
  if (mul_i64(1, 1) != 1)
    return fail(0);
  if (mul_i64(17953621789, 8719125119) != 8965922127819204963)
    return fail(0);
  return 0x10;
}


x86 assembly (clang, -O0):
<test_mul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xffffffff,%edi
mov    $0x1,%esi
call   1060 <mul_i8@plt>
cmp    $0xffffffff,%eax
je     117f <test_mul+0x2f>
xor    %edi,%edi
call   1030 <fail@plt>
mov    %eax,-0x4(%rbp)
jmp    13c7 <test_mul+0x277>
mov    $0xffffffff,%esi
mov    %esi,%edi
call   1060 <mul_i8@plt>
cmp    $0x1,%eax
je     11a3 <test_mul+0x53>
xor    %edi,%edi
call   1030 <fail@plt>
mov    %eax,-0x4(%rbp)
jmp    13c7 <test_mul+0x277>
mov    $0x1,%esi
mov    %esi,%edi
call   1060 <mul_i8@plt>
cmp    $0x1,%eax
je     11c7 <test_mul+0x77>
xor    %edi,%edi
call   1030 <fail@plt>
mov    %eax,-0x4(%rbp)
jmp    13c7 <test_mul+0x277>
mov    $0x11,%edi
mov    $0x23,%esi
call   1060 <mul_i8@plt>
cmp    $0x53,%eax
je     11ee <test_mul+0x9e>
xor    %edi,%edi
call   1030 <fail@plt>
mov    %eax,-0x4(%rbp)
jmp    13c7 <test_mul+0x277>
mov    $0xffffffff,%edi
mov    $0x1,%esi
call   1040 <mul_i16@plt>
cmp    $0xffffffff,%eax
je     1215 <test_mul+0xc5>
xor    %edi,%edi
call   1030 <fail@plt>
mov    %eax,-0x4(%rbp)
jmp    13c7 <test_mul+0x277>
mov    $0xffffffff,%esi
mov    %esi,%edi
call   1040 <mul_i16@plt>
cmp    $0x1,%eax
je     1239 <test_mul+0xe9>
xor    %edi,%edi
call   1030 <fail@plt>
mov    %eax,-0x4(%rbp)
jmp    13c7 <test_mul+0x277>
mov    $0x1,%esi
mov    %esi,%edi
call   1040 <mul_i16@plt>
cmp    $0x1,%eax
je     125d <test_mul+0x10d>
xor    %edi,%edi
call   1030 <fail@plt>
mov    %eax,-0x4(%rbp)
jmp    13c7 <test_mul+0x277>
mov    $0xb3,%edi
mov    $0x367,%esi
call   1040 <mul_i16@plt>
cmp    $0x6105,%eax
je     1286 <test_mul+0x136>
xor    %edi,%edi
call   1030 <fail@plt>
mov    %eax,-0x4(%rbp)
jmp    13c7 <test_mul+0x277>
mov    $0xffffffff,%edi
mov    $0x1,%esi
call   1070 <mul_i32@plt>
cmp    $0xffffffff,%eax
je     12ad <test_mul+0x15d>
xor    %edi,%edi
call   1030 <fail@plt>
mov    %eax,-0x4(%rbp)
jmp    13c7 <test_mul+0x277>
mov    $0xffffffff,%esi
mov    %esi,%edi
call   1070 <mul_i32@plt>
cmp    $0x1,%eax
je     12d1 <test_mul+0x181>
xor    %edi,%edi
call   1030 <fail@plt>
mov    %eax,-0x4(%rbp)
jmp    13c7 <test_mul+0x277>
mov    $0x1,%esi
mov    %esi,%edi
call   1070 <mul_i32@plt>
cmp    $0x1,%eax
je     12f5 <test_mul+0x1a5>
xor    %edi,%edi
call   1030 <fail@plt>
mov    %eax,-0x4(%rbp)
jmp    13c7 <test_mul+0x277>
mov    $0x2bd50,%edi
mov    $0xd4de8,%esi
call   1070 <mul_i32@plt>
cmp    $0x727ca080,%eax
je     131e <test_mul+0x1ce>
xor    %edi,%edi
call   1030 <fail@plt>
mov    %eax,-0x4(%rbp)
jmp    13c7 <test_mul+0x277>
mov    $0xffffffff,%edi
mov    $0x1,%esi
call   1050 <mul_i64@plt>
cmp    $0xffffffff,%eax
je     1345 <test_mul+0x1f5>
xor    %edi,%edi
call   1030 <fail@plt>
mov    %eax,-0x4(%rbp)
jmp    13c7 <test_mul+0x277>
mov    $0xffffffff,%esi
mov    %esi,%edi
call   1050 <mul_i64@plt>
cmp    $0x1,%eax
je     1369 <test_mul+0x219>
xor    %edi,%edi
call   1030 <fail@plt>
mov    %eax,-0x4(%rbp)
jmp    13c7 <test_mul+0x277>
mov    $0x1,%esi
mov    %esi,%edi
call   1050 <mul_i64@plt>
cmp    $0x1,%eax
je     138d <test_mul+0x23d>
xor    %edi,%edi
call   1030 <fail@plt>
mov    %eax,-0x4(%rbp)
jmp    13c7 <test_mul+0x277>
mov    $0x2e1e871d,%edi
mov    $0x7b34a7f,%esi
call   1050 <mul_i64@plt>
cltq
movabs $0x7c6d5aabf87a6963,%rcx
5a 6d 7c
cmp    %rcx,%rax
je     13c0 <test_mul+0x270>
xor    %edi,%edi
call   1030 <fail@plt>
mov    %eax,-0x4(%rbp)
jmp    13c7 <test_mul+0x277>
movl   $0x10,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mul>:
push   %rax
mov    $0xffffffff,%edi
mov    $0x1,%esi
call   1060 <mul_i8@plt>
cmp    $0xffffffff,%eax
jne    12b4 <test_mul+0x164>
mov    $0xffffffff,%edi
mov    $0xffffffff,%esi
call   1060 <mul_i8@plt>
cmp    $0x1,%eax
jne    12b4 <test_mul+0x164>
mov    $0x1,%edi
mov    $0x1,%esi
call   1060 <mul_i8@plt>
cmp    $0x1,%eax
jne    12b4 <test_mul+0x164>
mov    $0x11,%edi
mov    $0x23,%esi
call   1060 <mul_i8@plt>
cmp    $0x53,%eax
jne    12b4 <test_mul+0x164>
mov    $0xffffffff,%edi
mov    $0x1,%esi
call   1040 <mul_i16@plt>
cmp    $0xffffffff,%eax
jne    12b4 <test_mul+0x164>
mov    $0xffffffff,%edi
mov    $0xffffffff,%esi
call   1040 <mul_i16@plt>
cmp    $0x1,%eax
jne    12b4 <test_mul+0x164>
mov    $0x1,%edi
mov    $0x1,%esi
call   1040 <mul_i16@plt>
cmp    $0x1,%eax
jne    12b4 <test_mul+0x164>
mov    $0xb3,%edi
mov    $0x367,%esi
call   1040 <mul_i16@plt>
cmp    $0x6105,%eax
jne    12b4 <test_mul+0x164>
mov    $0xffffffff,%edi
mov    $0x1,%esi
call   1070 <mul_i32@plt>
cmp    $0xffffffff,%eax
jne    12b4 <test_mul+0x164>
mov    $0xffffffff,%edi
mov    $0xffffffff,%esi
call   1070 <mul_i32@plt>
cmp    $0x1,%eax
jne    12b4 <test_mul+0x164>
mov    $0x1,%edi
mov    $0x1,%esi
call   1070 <mul_i32@plt>
cmp    $0x1,%eax
jne    12b4 <test_mul+0x164>
mov    $0x2bd50,%edi
mov    $0xd4de8,%esi
call   1070 <mul_i32@plt>
cmp    $0x727ca080,%eax
jne    12b4 <test_mul+0x164>
mov    $0xffffffff,%edi
mov    $0x1,%esi
call   1050 <mul_i64@plt>
cmp    $0xffffffff,%eax
jne    12b4 <test_mul+0x164>
mov    $0xffffffff,%edi
mov    $0xffffffff,%esi
call   1050 <mul_i64@plt>
cmp    $0x1,%eax
jne    12b4 <test_mul+0x164>
mov    $0x1,%edi
mov    $0x1,%esi
call   1050 <mul_i64@plt>
cmp    $0x1,%eax
jne    12b4 <test_mul+0x164>
mov    $0x2e1e871d,%edi
mov    $0x7b34a7f,%esi
call   1050 <mul_i64@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <fail@plt>

LLVM IR (-O0):
define i32 @test_mul() {
%1 = alloca i32
%2 = call i32 @mul_i8(i32 -1, i32 1)
%3 = icmp ne i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @fail(i32 0)
store i32 %5, i32* %1
br label %83
6: ; preds = %0
%7 = call i32 @mul_i8(i32 -1, i32 -1)
%8 = icmp ne i32 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = call i32 @fail(i32 0)
store i32 %10, i32* %1
br label %83
11: ; preds = %6
%12 = call i32 @mul_i8(i32 1, i32 1)
%13 = icmp ne i32 %12, 1
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 @fail(i32 0)
store i32 %15, i32* %1
br label %83
16: ; preds = %11
%17 = call i32 @mul_i8(i32 17, i32 35)
%18 = icmp ne i32 %17, 83
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = call i32 @fail(i32 0)
store i32 %20, i32* %1
br label %83
21: ; preds = %16
%22 = call i32 @mul_i16(i32 -1, i32 1)
%23 = icmp ne i32 %22, -1
br i1 %23, label %24, label %26
24: ; preds = %21
%25 = call i32 @fail(i32 0)
store i32 %25, i32* %1
br label %83
26: ; preds = %21
%27 = call i32 @mul_i16(i32 -1, i32 -1)
%28 = icmp ne i32 %27, 1
br i1 %28, label %29, label %31
29: ; preds = %26
%30 = call i32 @fail(i32 0)
store i32 %30, i32* %1
br label %83
31: ; preds = %26
%32 = call i32 @mul_i16(i32 1, i32 1)
%33 = icmp ne i32 %32, 1
br i1 %33, label %34, label %36
34: ; preds = %31
%35 = call i32 @fail(i32 0)
store i32 %35, i32* %1
br label %83
36: ; preds = %31
%37 = call i32 @mul_i16(i32 179, i32 871)
%38 = icmp ne i32 %37, 24837
br i1 %38, label %39, label %41
39: ; preds = %36
%40 = call i32 @fail(i32 0)
store i32 %40, i32* %1
br label %83
41: ; preds = %36
%42 = call i32 @mul_i32(i32 -1, i32 1)
%43 = icmp ne i32 %42, -1
br i1 %43, label %44, label %46
44: ; preds = %41
%45 = call i32 @fail(i32 0)
store i32 %45, i32* %1
br label %83
46: ; preds = %41
%47 = call i32 @mul_i32(i32 -1, i32 -1)
%48 = icmp ne i32 %47, 1
br i1 %48, label %49, label %51
49: ; preds = %46
%50 = call i32 @fail(i32 0)
store i32 %50, i32* %1
br label %83
51: ; preds = %46
%52 = call i32 @mul_i32(i32 1, i32 1)
%53 = icmp ne i32 %52, 1
br i1 %53, label %54, label %56
54: ; preds = %51
%55 = call i32 @fail(i32 0)
store i32 %55, i32* %1
br label %83
56: ; preds = %51
%57 = call i32 @mul_i32(i32 179536, i32 871912)
%58 = icmp ne i32 %57, 1920770176
br i1 %58, label %59, label %61
59: ; preds = %56
%60 = call i32 @fail(i32 0)
store i32 %60, i32* %1
br label %83
61: ; preds = %56
%62 = call i32 @mul_i64(i32 -1, i32 1)
%63 = icmp ne i32 %62, -1
br i1 %63, label %64, label %66
64: ; preds = %61
%65 = call i32 @fail(i32 0)
store i32 %65, i32* %1
br label %83
66: ; preds = %61
%67 = call i32 @mul_i64(i32 -1, i32 -1)
%68 = icmp ne i32 %67, 1
br i1 %68, label %69, label %71
69: ; preds = %66
%70 = call i32 @fail(i32 0)
store i32 %70, i32* %1
br label %83
71: ; preds = %66
%72 = call i32 @mul_i64(i32 1, i32 1)
%73 = icmp ne i32 %72, 1
br i1 %73, label %74, label %76
74: ; preds = %71
%75 = call i32 @fail(i32 0)
store i32 %75, i32* %1
br label %83
76: ; preds = %71
%77 = call i32 @mul_i64(i32 773752605, i32 129190527)
%78 = sext i32 %77 to i64
%79 = icmp ne i64 %78, 8965922127819204963
br i1 %79, label %80, label %82
80: ; preds = %76
%81 = call i32 @fail(i32 0)
store i32 %81, i32* %1
br label %83
82: ; preds = %76
store i32 16, i32* %1
br label %83
83: ; preds = %82, %80, %74, %69, %64, %59, %54, %49, %44, %39, %34, %29, %24, %19, %14, %9, %4
%84 = load i32, i32* %1
ret i32 %84
}

LLVM IR (-O2):
define i32 @test_mul() {
%1 = tail call i32 @mul_i8(i32 -1, i32 1)
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %47
3: ; preds = %0
%4 = tail call i32 @mul_i8(i32 -1, i32 -1)
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %47
6: ; preds = %3
%7 = tail call i32 @mul_i8(i32 1, i32 1)
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %47
9: ; preds = %6
%10 = tail call i32 @mul_i8(i32 17, i32 35)
%11 = icmp eq i32 %10, 83
br i1 %11, label %12, label %47
12: ; preds = %9
%13 = tail call i32 @mul_i16(i32 -1, i32 1)
%14 = icmp eq i32 %13, -1
br i1 %14, label %15, label %47
15: ; preds = %12
%16 = tail call i32 @mul_i16(i32 -1, i32 -1)
%17 = icmp eq i32 %16, 1
br i1 %17, label %18, label %47
18: ; preds = %15
%19 = tail call i32 @mul_i16(i32 1, i32 1)
%20 = icmp eq i32 %19, 1
br i1 %20, label %21, label %47
21: ; preds = %18
%22 = tail call i32 @mul_i16(i32 179, i32 871)
%23 = icmp eq i32 %22, 24837
br i1 %23, label %24, label %47
24: ; preds = %21
%25 = tail call i32 @mul_i32(i32 -1, i32 1)
%26 = icmp eq i32 %25, -1
br i1 %26, label %27, label %47
27: ; preds = %24
%28 = tail call i32 @mul_i32(i32 -1, i32 -1)
%29 = icmp eq i32 %28, 1
br i1 %29, label %30, label %47
30: ; preds = %27
%31 = tail call i32 @mul_i32(i32 1, i32 1)
%32 = icmp eq i32 %31, 1
br i1 %32, label %33, label %47
33: ; preds = %30
%34 = tail call i32 @mul_i32(i32 179536, i32 871912)
%35 = icmp eq i32 %34, 1920770176
br i1 %35, label %36, label %47
36: ; preds = %33
%37 = tail call i32 @mul_i64(i32 -1, i32 1)
%38 = icmp eq i32 %37, -1
br i1 %38, label %39, label %47
39: ; preds = %36
%40 = tail call i32 @mul_i64(i32 -1, i32 -1)
%41 = icmp eq i32 %40, 1
br i1 %41, label %42, label %47
42: ; preds = %39
%43 = tail call i32 @mul_i64(i32 1, i32 1)
%44 = icmp eq i32 %43, 1
br i1 %44, label %45, label %47
45: ; preds = %42
%46 = tail call i32 @mul_i64(i32 773752605, i32 129190527)
br label %47
47: ; preds = %42, %39, %36, %33, %30, %27, %24, %21, %18, %15, %12, %9, %6, %3, %0, %45
%48 = tail call i32 @fail(i32 0)
ret i32 %48
}