__attribute__((no, noclone)) unsigned __int128 t104_1mul(signed char x,
                                                         signed char y) {
  unsigned __int128 r;
  if (__builtin_mul_overflow(x, y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t104_1mul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x11(%rbp)
mov    %al,-0x12(%rbp)
movsbq -0x11(%rbp),%r8
mov    %r8,%rax
sar    $0x3f,%rax
mov    %rax,-0x40(%rbp)
movsbq -0x12(%rbp),%rdi
mov    %rdi,%rsi
sar    $0x3f,%rsi
mul    %rdi
mov    %rax,%r11
mov    %edx,%r10d
mov    %r8,%rax
mul    %rdi
mov    %rax,-0x38(%rbp)
add    %rdx,%r11
adc    $0x0,%r10d
mov    %r8,%rax
mul    %rsi
mov    %rax,%rcx
mov    -0x40(%rbp),%rax
mov    %rdx,%r9
mov    -0x38(%rbp),%rdx
add    %r11,%rcx
adc    %r9d,%r10d
mov    %eax,%r9d
mov    %r9d,%eax
imul   %esi,%eax
add    %r10d,%eax
imul   %r9d,%edi
imul   %r8d,%esi
add    %edi,%esi
add    %esi,%eax
and    $0x1,%al
mov    %rdx,-0x30(%rbp)
mov    %rcx,-0x28(%rbp)
test   $0x1,%al
jne    11a3 <t104_1mul+0x93>
jmp    11aa <t104_1mul+0x9a>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x30(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t104_1mul>:
push   %r15
push   %r14
push   %rbx
movslq %edi,%rdi
mov    %rdi,%r10
movslq %esi,%rcx
mov    %rcx,%rsi
sar    $0x3f,%rsi
mov    %rsi,%rax
mul    %rdi
mov    %rax,%r8
mov    %rdx,%r9
sar    $0x3f,%r10
mov    %rcx,%rax
mul    %rdi
mov    %rax,%r14
mov    %rdx,%rbx
add    %r8,%rbx
adc    $0x0,%r9d
mov    %rcx,%rax
mul    %r10
mov    %rax,%r15
add    %rbx,%r15
adc    %r9d,%edx
imul   %esi,%edi
mov    %esi,%eax
imul   %r10d,%eax
add    %edx,%eax
imul   %r10d,%ecx
add    %edi,%ecx
add    %eax,%ecx
and    $0x1,%ecx
neg    %rcx
jns    1179 <t104_1mul+0x69>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %r14,%rax
mov    %r15,%rdx
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define { i64, i64 } @t104_1mul(i8 signext %0, i8 signext %1) {
%3 = alloca i128
%4 = alloca i8
%5 = alloca i8
%6 = alloca i128
store i8 %0, i8* %4
store i8 %1, i8* %5
%7 = load i8, i8* %4
%8 = load i8, i8* %5
%9 = sext i8 %7 to i129
%10 = sext i8 %8 to i129
%11 = call { i129, i1 } @llvm.smul.with.overflow.i129(i129 %9, i129 %10)
%12 = extractvalue { i129, i1 } %11, 1
%13 = extractvalue { i129, i1 } %11, 0
%14 = trunc i129 %13 to i128
%15 = zext i128 %14 to i129
%16 = icmp ne i129 %13, %15
%17 = or i1 %12, %16
store i128 %14, i128* %6
br i1 %17, label %18, label %20
18: ; preds = %2
%19 = call i32 (...) @bar()
br label %20
20: ; preds = %18, %2
%21 = load i128, i128* %6
store i128 %21, i128* %3
%22 = bitcast i128* %3 to { i64, i64 }*
%23 = load { i64, i64 }, { i64, i64 }* %22
ret { i64, i64 } %23
}

LLVM IR (-O2):
define { i64, i64 } @t104_1mul(i8 signext %0, i8 signext %1) {
%3 = sext i8 %0 to i129
%4 = sext i8 %1 to i129
%5 = mul nsw i129 %4, %3
%6 = icmp slt i129 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 (...) @bar()
br label %9
9: ; preds = %7, %2
%10 = trunc i129 %5 to i64
%11 = lshr i129 %5, 64
%12 = trunc i129 %11 to i64
%13 = insertvalue { i64, i64 } poison, i64 %10, 0
%14 = insertvalue { i64, i64 } %13, i64 %12, 1
ret { i64, i64 } %14
}