__attribute__((no, noclone)) unsigned __int128 t117_5mul(signed __int128 x) {
  unsigned __int128 r;
  if (__builtin_mul_overflow(x, (signed __int128)(-64), &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t117_5mul>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x118,%rsp
mov    %rdi,-0x50(%rbp)
mov    %rsi,-0x48(%rbp)
mov    -0x50(%rbp),%rax
mov    -0x48(%rbp),%rcx
mov    %rcx,-0x58(%rbp)
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rax
mov    %rax,-0xe8(%rbp)
mov    -0x58(%rbp),%rax
mov    %rax,-0xe0(%rbp)
sar    $0x3f,%rax
mov    %rax,-0xc0(%rbp)
mov    $0xffffffffffffffc0,%rcx
mov    %rcx,-0xd0(%rbp)
mul    %rcx
mov    %rax,%r10
mov    -0xc0(%rbp),%rax
mov    %r10,-0x90(%rbp)
mov    %rdx,%rsi
mov    %r10,%r8
add    %rsi,%r8
adc    $0x0,%rsi
mov    $0xffffffffffffffff,%rdx
mov    %rdx,-0xf8(%rbp)
mul    %rdx
mov    %rax,%rdi
mov    -0xe8(%rbp),%rax
mov    %rdx,%r11
mov    %rdi,%rdx
add    %r8,%rdx
mov    %rdx,-0x80(%rbp)
adc    %r11,%rsi
setb   %dl
movzbl %dl,%edx
mov    %rdi,%r13
add    %rsi,%r13
mov    %r11,%r12
adc    %rdx,%r12
mul    %rcx
mov    %rax,%rsi
mov    -0xe0(%rbp),%rax
mov    %rsi,-0x88(%rbp)
mov    %rdx,%rsi
mul    %rcx
mov    %rax,%r9
mov    -0xe8(%rbp),%rax
mov    %rdx,%rcx
mov    -0xf8(%rbp),%rdx
add    %rsi,%r9
adc    $0x0,%rcx
mul    %rdx
mov    %rax,%r15
mov    -0xe0(%rbp),%rax
mov    %rdx,%rsi
mov    -0xf8(%rbp),%rdx
mov    %rsi,-0x138(%rbp)
mov    %r15,%r8
add    %r9,%r8
mov    %r8,-0xa8(%rbp)
adc    %rsi,%rcx
setb   %sil
movzbl %sil,%esi
mov    %esi,%r9d
mul    %rdx
mov    %rax,%rbx
mov    -0x80(%rbp),%rax
mov    %rdx,%r8
mov    -0x138(%rbp),%rdx
mov    %rbx,%rsi
add    %rcx,%rsi
mov    %r8,%rcx
adc    %r9,%rcx
add    %rsi,%r10
adc    %rcx,%rax
mov    %rax,-0x130(%rbp)
mov    %r13,%rsi
adc    $0x0,%rsi
mov    %r12,%rcx
adc    $0x0,%rcx
mov    %rbx,%r9
add    %rdx,%r9
mov    %r8,%rax
adc    $0x0,%rax
mov    %r15,%r14
add    %r9,%r14
adc    %rdx,%rax
setb   %r9b
movzbl %r9b,%r9d
add    %rax,%rbx
mov    -0x130(%rbp),%rax
adc    %r9,%r8
mov    %r15,%r9
add    %r10,%r9
mov    %r14,%r10
adc    %rax,%r10
mov    %rbx,%rax
adc    $0x0,%rax
mov    %rax,-0x128(%rbp)
mov    %r8,%rax
adc    $0x0,%rax
mov    %rax,-0x120(%rbp)
mov    -0x128(%rbp),%rax
add    %rax,%rsi
mov    -0x120(%rbp),%rax
mov    %rsi,-0x108(%rbp)
adc    %rax,%rcx
setb   %al
movzbl %al,%eax
mov    %rax,-0xf0(%rbp)
mov    %rdi,%rax
add    %r11,%rax
mov    %r11,%rsi
adc    $0x0,%rsi
mov    %rsi,-0x118(%rbp)
mov    %rdi,%rsi
add    %rax,%rsi
mov    -0x118(%rbp),%rax
mov    %rsi,-0x100(%rbp)
adc    %r11,%rax
setb   %sil
movzbl %sil,%esi
mov    %rsi,-0x110(%rbp)
mov    %rdi,%rsi
add    %rax,%rsi
mov    -0x110(%rbp),%rax
adc    %rax,%r11
mov    -0x108(%rbp),%rax
add    %rax,%rdi
mov    -0x100(%rbp),%rax
adc    %rcx,%rax
mov    -0xf8(%rbp),%rcx
mov    %rax,-0x78(%rbp)
mov    -0xf0(%rbp),%rax
adc    %rax,%rsi
mov    -0xe8(%rbp),%rax
adc    $0x0,%r11
sub    %rax,%rdx
mov    -0xe0(%rbp),%rax
sub    %rax,%rdx
mov    -0xc0(%rbp),%rax
mov    %rdx,-0xd8(%rbp)
imul   %rcx
mov    %rax,%rcx
mov    %rcx,-0xb8(%rbp)
mov    %rdx,%rax
mov    -0xd8(%rbp),%rdx
mov    %rax,-0xb0(%rbp)
mov    %r15,%rax
add    %rcx,%rax
mov    -0xd0(%rbp),%rcx
mov    %rax,-0xc8(%rbp)
mov    -0xb0(%rbp),%rax
adc    %rax,%rdx
mov    -0xc8(%rbp),%rax
add    %rax,%rbx
mov    -0xc0(%rbp),%rax
adc    %rdx,%r8
imul   %rcx
mov    %rax,%rcx
mov    -0xb8(%rbp),%rax
mov    %rdx,-0xa0(%rbp)
mov    -0xb0(%rbp),%rdx
add    %rcx,%rax
mov    -0xa8(%rbp),%rcx
mov    %rax,-0x98(%rbp)
mov    -0xa0(%rbp),%rax
adc    %rax,%rdx
mov    -0x98(%rbp),%rax
add    %rax,%r13
mov    -0x90(%rbp),%rax
adc    %rdx,%r12
mov    -0x88(%rbp),%rdx
add    %rax,%r15
mov    -0x80(%rbp),%rax
adc    %rax,%r14
mov    -0x78(%rbp),%rax
adc    %r13,%rbx
adc    %r12,%r8
add    %r15,%rdi
adc    %r14,%rax
adc    %rbx,%rsi
adc    %r8,%r11
mov    %r10,%r8
sar    $0x3f,%r8
xor    %r8,%r11
xor    %r8,%rax
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,-0x70(%rbp)
mov    %rcx,-0x68(%rbp)
test   $0x1,%al
jne    149b <t117_5mul+0x38b>
jmp    14a2 <t117_5mul+0x392>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x70(%rbp),%rax
mov    -0x68(%rbp),%rcx
mov    %rcx,-0x38(%rbp)
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rdx
add    $0x118,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<t117_5mul>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %rsi,%r11
mov    %rsi,%rax
sar    $0x3f,%rax
mov    $0xffffffffffffffc0,%rcx
mov    %rax,%rsi
mov    %rax,0x40(%rsp)
mul    %rcx
mov    %rax,%rcx
mov    %rax,%r14
mov    %rax,0x38(%rsp)
add    %rdx,%rcx
adc    $0x0,%rdx
mov    %rdx,%rbp
mov    $0xffffffffffffffff,%rdx
mov    %rsi,%rax
mul    %rdx
mov    %rdx,%r9
mov    %rax,%r10
add    %rax,%rcx
mov    %rcx,%r15
mov    %rcx,0x30(%rsp)
adc    %rdx,%rbp
mov    %rdi,%rbx
setb   %al
movzbl %al,%eax
add    %r10,%rbp
mov    %rbp,%rsi
mov    %rbp,0x28(%rsp)
adc    %rdx,%rax
mov    %rax,%r12
mov    %rax,0x20(%rsp)
mov    %rdi,0x18(%rsp)
mov    %rdi,%rax
mov    $0xffffffffffffffc0,%rdi
mul    %rdi
mov    %rdx,%rcx
mov    %rax,0x50(%rsp)
mov    %r11,%rax
mul    %rdi
mov    %rdx,%r8
mov    %rax,%rdi
add    %rcx,%rdi
adc    $0x0,%r8
mov    %rbx,%rax
mov    $0xffffffffffffffff,%rbp
mul    %rbp
mov    %rdx,%rbx
add    %rax,%rdi
mov    %rax,%r13
mov    %rdi,0x48(%rsp)
adc    %rdx,%r8
setb   %cl
mov    %r11,%rax
mov    %r11,%rdi
mul    %rbp
add    %rax,%r8
movzbl %cl,%r11d
adc    %rdx,%r11
add    %r14,%r8
adc    %r15,%r11
mov    %rsi,%rbp
adc    $0x0,%rbp
mov    %r12,%r14
adc    $0x0,%r14
mov    %rax,%r15
add    %rbx,%r15
mov    %rdx,%rcx
adc    $0x0,%rcx
mov    %r13,0x8(%rsp)
add    %r13,%r15
adc    %rbx,%rcx
setb   %sil
add    %rax,%rcx
movzbl %sil,%eax
adc    %rdx,%rax
mov    %rax,0x10(%rsp)
add    %r13,%r8
adc    %r15,%r11
mov    %rcx,%rsi
adc    $0x0,%rsi
adc    $0x0,%rax
add    %rbp,%rsi
adc    %r14,%rax
setb   %bpl
mov    %r10,%r12
add    %r9,%r12
mov    %r9,%r13
adc    $0x0,%r13
add    %r10,%r12
adc    %r9,%r13
setb   %dl
add    %r10,%r13
movzbl %dl,%r14d
adc    %r9,%r14
add    %r10,%rsi
adc    %rax,%r12
movzbl %bpl,%eax
adc    %rax,%r13
adc    $0x0,%r14
sub    0x18(%rsp),%rbx
sub    %rdi,%rbx
mov    0x40(%rsp),%rdi
mov    %rdi,%rax
mov    $0xffffffffffffffff,%rdx
imul   %rdx
mov    %rax,%r10
mov    %rdx,%r9
mov    0x8(%rsp),%rbp
add    %rax,%rbp
adc    %rdx,%rbx
add    %rcx,%rbp
adc    0x10(%rsp),%rbx
mov    %rdi,%rax
mov    $0xffffffffffffffc0,%rcx
imul   %rcx
add    %r10,%rax
adc    %r9,%rdx
add    0x28(%rsp),%rax
adc    0x20(%rsp),%rdx
mov    0x8(%rsp),%rcx
add    0x38(%rsp),%rcx
adc    0x30(%rsp),%r15
adc    %rbp,%rax
adc    %rbx,%rdx
mov    0x50(%rsp),%rbx
add    %rsi,%rcx
mov    %rcx,%rsi
adc    %r12,%r15
adc    %r13,%rax
adc    %r14,%rdx
mov    0x48(%rsp),%rbp
mov    %r11,%rcx
sar    $0x3f,%rcx
xor    %rcx,%rdx
xor    %rcx,%r15
or     %rdx,%r15
xor    %rcx,%rax
xor    %rsi,%rcx
or     %rax,%rcx
or     %r15,%rcx
mov    %r8d,%eax
and    $0x1,%eax
mov    %rax,%rdx
neg    %rdx
xor    %rdx,%r11
xor    %r8,%rdx
or     %r11,%rdx
or     %rcx,%rdx
jne    1343 <t117_5mul+0x233>
mov    %rbp,%rcx
xor    %rbp,%rcx
mov    %rbx,%rdx
xor    %rbx,%rdx
or     %rax,%rdx
or     %rcx,%rdx
je     134a <t117_5mul+0x23a>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %rbx,%rax
mov    %rbp,%rdx
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define { i64, i64 } @t117_5mul(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 %12, i129 -64)
%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 } @t117_5mul(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 -64)
%9 = extractvalue { i129, i1 } %8, 1
%10 = extractvalue { i129, i1 } %8, 0
%11 = and i129 %10, 340282366920938463463374607431768211392
%12 = icmp ne i129 %10, %11
%13 = or i1 %9, %12
br i1 %13, label %14, label %16
14: ; preds = %2
%15 = tail call i32 (...) @bar()
br label %16
16: ; preds = %14, %2
%17 = trunc i129 %10 to i64
%18 = lshr i129 %10, 64
%19 = trunc i129 %18 to i64
%20 = insertvalue { i64, i64 } poison, i64 %17, 0
%21 = insertvalue { i64, i64 } %20, i64 %19, 1
ret { i64, i64 } %21
}