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


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

x86 assembly (clang, -O2):
<t128_1mul>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %rcx,%r15
mov    %rdx,%rbp
mov    %rsi,%r13
sar    $0x3f,%r13
sar    $0x3f,%rcx
mov    %r13,%rax
mul    %rdx
mov    %rax,(%rsp)
mov    %rax,%r9
mov    %rdx,%r11
mov    %rdx,0x50(%rsp)
add    %rdx,%r9
adc    $0x0,%r11
mov    %r13,%rax
mul    %r15
add    %rax,%r9
adc    %rdx,%r11
mov    %rdi,%r8
setb   %bl
movzbl %bl,%r10d
add    %rax,%r11
adc    %rdx,%r10
mov    %rdi,%rax
mov    %rbp,0x8(%rsp)
mul    %rbp
mov    %rdx,%r14
mov    %rax,0x60(%rsp)
mov    %rsi,%rax
mul    %rbp
mov    %rdx,%rbp
mov    %rax,%rdi
add    %r14,%rdi
adc    $0x0,%rbp
mov    %r8,%rax
mov    %r8,0x28(%rsp)
mul    %r15
mov    %rdx,%r14
add    %rdi,%rax
mov    %rax,0x58(%rsp)
adc    %rbp,%r14
setb   %bl
mov    %rsi,0x30(%rsp)
mov    %rsi,%rax
mul    %r15
mov    %rdx,%rbp
mov    %rax,%r12
add    %r14,%r12
movzbl %bl,%eax
adc    %rax,%rbp
add    (%rsp),%r12
adc    %r9,%rbp
adc    $0x0,%r11
adc    $0x0,%r10
mov    %r8,%rax
mul    %rcx
mov    %rdx,%r8
mov    %rdx,0x40(%rsp)
mov    %rax,%r9
mov    %rax,0x38(%rsp)
mov    %rsi,%rax
mul    %rcx
mov    %rax,%rsi
add    %r8,%rsi
mov    %rdx,%rdi
adc    $0x0,%rdi
add    %r9,%rsi
mov    %rsi,%rbx
adc    %r8,%rdi
setb   %sil
add    %rax,%rdi
movzbl %sil,%esi
adc    %rdx,%rsi
add    %r9,%r12
adc    %rbp,%rbx
mov    %rbx,0x48(%rsp)
adc    $0x0,%rdi
adc    $0x0,%rsi
add    %r11,%rdi
adc    %r10,%rsi
setb   %r8b
mov    %r13,%rax
mul    %rcx
mov    %rax,%rbp
add    %rdx,%rbp
mov    %rdx,%r9
adc    $0x0,%r9
add    %rax,%rbp
adc    %rdx,%r9
setb   %bl
add    %rax,%r9
movzbl %bl,%ebx
adc    %rdx,%rbx
add    %rax,%rdi
adc    %rsi,%rbp
mov    %rbp,0x20(%rsp)
movzbl %r8b,%eax
adc    %rax,%r9
adc    $0x0,%rbx
mov    %rbx,0x18(%rsp)
mov    0x8(%rsp),%rsi
mov    %rsi,%rax
mul    %r13
mov    %rdx,%r8
mov    %rax,%rbp
mov    %rax,0x10(%rsp)
mov    %r15,%rax
mul    %r13
mov    %rax,%r14
add    %r8,%r14
mov    %rdx,%rbx
adc    $0x0,%rbx
add    %rbp,%r14
adc    %r8,%rbx
setb   %r8b
add    %rax,%rbx
movzbl %r8b,%ebp
adc    %rdx,%rbp
imul   %r13,%r15
add    0x50(%rsp),%r15
imul   %r13,%rsi
mov    %rsi,%r10
mov    %r13,%rax
imul   %rcx
mov    %rax,%rsi
mov    %rdx,%r13
mov    %r10,%rdx
add    %r15,%rdx
mov    (%rsp),%rax
add    %rsi,%rax
adc    %r13,%rdx
add    %rbx,%rax
mov    %rax,(%rsp)
adc    %rbp,%rdx
mov    %rdx,0x8(%rsp)
mov    %rcx,%rax
mov    0x28(%rsp),%r11
mul    %r11
mov    %rdx,%rbp
mov    %rax,%r8
mov    %rax,%rbx
add    %rdx,%rbx
adc    $0x0,%rbp
mov    %rcx,%rax
mov    0x30(%rsp),%r10
mul    %r10
add    %rax,%rbx
adc    %rdx,%rbp
setb   %r15b
add    %rax,%rbp
movzbl %r15b,%eax
adc    %rdx,%rax
imul   %rcx,%r11
add    0x40(%rsp),%r11
imul   %r10,%rcx
add    %r11,%rcx
add    0x38(%rsp),%rsi
adc    %r13,%rcx
add    %rbp,%rsi
adc    %rax,%rcx
add    0x10(%rsp),%r8
adc    %r14,%rbx
adc    (%rsp),%rsi
adc    0x8(%rsp),%rcx
add    %rdi,%r8
adc    0x20(%rsp),%rbx
adc    %r9,%rsi
adc    0x18(%rsp),%rcx
mov    0x48(%rsp),%rdi
mov    %rdi,%rdx
sar    $0x3f,%rdx
xor    %rdx,%rcx
xor    %rdx,%rbx
or     %rcx,%rbx
xor    %rdx,%rsi
xor    %r8,%rdx
or     %rsi,%rdx
or     %rbx,%rdx
mov    %r12d,%eax
and    $0x1,%eax
neg    %rax
mov    %rdi,%rcx
xor    %rax,%rcx
xor    %rax,%r12
or     %rcx,%r12
or     %rdx,%r12
jne    13a0 <t128_1mul+0x290>
test   %rax,%rax
jns    13a7 <t128_1mul+0x297>
xor    %eax,%eax
call   1030 <bar@plt>
mov    0x60(%rsp),%rax
mov    0x58(%rsp),%rdx
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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