__attribute__((no, noclone)) unsigned __int128 t128_3mul(signed __int128 y) {
  unsigned __int128 r;
  if (__builtin_mul_overflow((signed __int128)(15), y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t128_3mul>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0x70,%rsp
mov    %rdi,-0x30(%rbp)
mov    %rsi,-0x28(%rbp)
mov    -0x30(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    %rcx,-0x38(%rbp)
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x60(%rbp)
sar    $0x3f,%rax
mov    %rax,-0x78(%rbp)
mov    $0xf,%ecx
mul    %rcx
mov    %rax,%rdi
mov    -0x78(%rbp),%rax
mov    %rdx,%rbx
mov    %rbx,-0x68(%rbp)
mov    %rdi,%rdx
add    %rbx,%rdx
adc    $0x0,%rbx
imul   %rcx
mov    %rax,%r9
mov    -0x78(%rbp),%rax
mov    %rdx,%r8
xor    %edx,%edx
imul   %rdx
mov    %rax,%rsi
mov    -0x70(%rbp),%rax
mov    %rdx,%r11
mov    -0x68(%rbp),%rdx
add    %r9,%rsi
adc    %r8,%r11
mov    %rdi,%r8
add    %rdx,%r8
adc    %rdx,%rsi
adc    $0x0,%r11
mul    %rcx
mov    %rax,%r9
mov    -0x60(%rbp),%rax
mov    %r9,-0x58(%rbp)
mov    %rdx,%r9
mul    %rcx
mov    %rax,%rcx
mov    %rdx,%rax
mov    -0x58(%rbp),%rdx
add    %r9,%rcx
mov    %rdi,%r9
adc    %rax,%r9
mov    %r8,%r10
adc    $0x0,%r10
setb   %r14b
mov    %rbx,%rax
adc    $0x0,%rax
setb   %al
movzbl %al,%eax
add    $0xff,%r14b
adc    %rbx,%rdi
adc    %r8,%rax
adc    $0x0,%rsi
adc    $0x0,%r11
mov    %r10,%r8
sar    $0x3f,%r8
xor    %r8,%rax
xor    %r8,%r11
or     %r11,%rax
xor    %r8,%rsi
xor    %r8,%rdi
or     %rsi,%rdi
or     %rax,%rdi
mov    %r9d,%eax
and    $0x1,%eax
mov    %eax,%esi
mov    %rsi,%rax
neg    %rax
mov    %rax,%r8
xor    %r10,%r8
xor    %r9,%rax
or     %r8,%rax
or     %rdi,%rax
or     %rsi,%rax
setne  %al
mov    %rdx,-0x50(%rbp)
mov    %rcx,-0x48(%rbp)
test   $0x1,%al
jne    1243 <t128_3mul+0x133>
jmp    124a <t128_3mul+0x13a>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x50(%rbp),%rax
mov    -0x48(%rbp),%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rdx
add    $0x70,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

x86 assembly (clang, -O2):
<t128_3mul>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r8
mov    %rsi,%rcx
sar    $0x3f,%rcx
mov    $0xf,%r15d
mov    %rcx,%rax
mul    %r15
mov    %rdx,%rbx
mov    %rax,%r9
add    %rdx,%rax
mov    %rdx,%r12
adc    $0x0,%r12
mov    %rcx,%rax
imul   %r15
mov    %rax,%r10
mov    %rdx,%r11
xor    %edx,%edx
mov    %rcx,%rax
imul   %rdx
mov    %rdx,%rcx
mov    %rax,%rsi
add    %r10,%rsi
adc    %r11,%rcx
mov    %rdi,%rax
mov    %r9,%r10
add    %rbx,%r10
adc    %rbx,%rsi
adc    $0x0,%rcx
mul    %r15
mov    %rdx,%rbx
mov    %rax,%r14
mov    %r8,%rax
mul    %r15
mov    %rax,%r15
add    %rbx,%r15
adc    %r9,%rdx
mov    %r10,%r11
adc    $0x0,%r11
setb   %r8b
mov    %r12,%rdi
adc    $0x0,%rdi
setb   %bl
movzbl %bl,%edi
add    $0xff,%r8b
adc    %r9,%r12
adc    %r10,%rdi
adc    $0x0,%rsi
adc    $0x0,%rcx
mov    %r11,%rax
sar    $0x3f,%rax
xor    %rax,%rdi
xor    %rax,%rcx
or     %rdi,%rcx
xor    %rax,%rsi
xor    %r12,%rax
or     %rsi,%rax
or     %rcx,%rax
mov    %edx,%ecx
and    $0x1,%ecx
neg    %rcx
xor    %rcx,%r11
xor    %rcx,%rdx
or     %r11,%rdx
or     %rax,%rdx
jne    11e7 <t128_3mul+0xd7>
test   %rcx,%rcx
jns    11ee <t128_3mul+0xde>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %r14,%rax
mov    %r15,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define { i64, i64 } @t128_3mul(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = sext i128 %6 to i129
%8 = tail call { i129, i1 } @llvm.smul.with.overflow.i129(i129 %7, i129 15)
%9 = extractvalue { i129, i1 } %8, 1
%10 = extractvalue { i129, i1 } %8, 0
%11 = icmp slt i129 %10, 0
%12 = or i1 %9, %11
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = tail call i32 (...) @bar()
br label %15
15: ; preds = %13, %2
%16 = trunc i129 %10 to i64
%17 = lshr i129 %10, 64
%18 = trunc i129 %17 to i64
%19 = insertvalue { i64, i64 } poison, i64 %16, 0
%20 = insertvalue { i64, i64 } %19, i64 %18, 1
ret { i64, i64 } %20
}