#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 */
typedef uintptr_t x7;
typedef uintptr_t x6;
typedef uintptr_t x5;
typedef uintptr_t x4;
typedef uintptr_t x3;
typedef int /*<<< orphan*/ out0;
typedef int /*<<< orphan*/ in0;

/* Variables and functions */
uintptr_t _br2_load(int /*<<< orphan*/, int);
int /*<<< orphan*/ _br2_store(int /*<<< orphan*/, uintptr_t, int);
void internal_fiat_poly1305_carry(uintptr_t out0, uintptr_t in0) {
  uintptr_t x0, x1, x2, x3, x4, x6, x7, x5, x8, x9, x10, x11, x12, x13;
  x0 = _br2_load((in0) + ((uintptr_t)0ULL), sizeof(uintptr_t));
  x1 = _br2_load((in0) + ((uintptr_t)8ULL), sizeof(uintptr_t));
  x2 = _br2_load((in0) + ((uintptr_t)16ULL), sizeof(uintptr_t));
  x3 = x0;
  x4 = ((x3) >> ((uintptr_t)44ULL)) + (x1);
  x5 = ((x4) >> ((uintptr_t)43ULL)) + (x2);
  x6 = ((x3) & ((uintptr_t)17592186044415ULL)) +
       (((x5) >> ((uintptr_t)43ULL)) * ((uintptr_t)5ULL));
  x7 = ((x6) >> ((uintptr_t)44ULL)) + ((x4) & ((uintptr_t)8796093022207ULL));
  x8 = (x6) & ((uintptr_t)17592186044415ULL);
  x9 = (x7) & ((uintptr_t)8796093022207ULL);
  x10 = ((x7) >> ((uintptr_t)43ULL)) + ((x5) & ((uintptr_t)8796093022207ULL));
  x11 = x8;
  x12 = x9;
  x13 = x10;
  _br2_store((out0) + ((uintptr_t)0ULL), x11, sizeof(uintptr_t));
  _br2_store((out0) + ((uintptr_t)8ULL), x12, sizeof(uintptr_t));
  _br2_store((out0) + ((uintptr_t)16ULL), x13, sizeof(uintptr_t));
  return;
}


x86 assembly (clang, -O0):
<internal_fiat_poly1305_carry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x0,%rax
mov    %eax,%edi
mov    $0x8,%esi
call   1030 <_br2_load@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %eax,%edi
mov    $0x8,%esi
call   1030 <_br2_load@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rax
mov    %eax,%edi
mov    $0x8,%esi
call   1030 <_br2_load@plt>
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
shr    $0x2c,%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
shr    $0x2b,%rax
add    -0x28(%rbp),%rax
mov    %rax,-0x50(%rbp)
movabs $0xfffffffffff,%rax
and    -0x30(%rbp),%rax
mov    -0x50(%rbp),%rcx
shr    $0x2b,%rcx
imul   $0x5,%rcx,%rcx
add    %rcx,%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
shr    $0x2c,%rax
movabs $0x7ffffffffff,%rcx
and    -0x38(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x48(%rbp)
movabs $0xfffffffffff,%rax
and    -0x40(%rbp),%rax
mov    %rax,-0x58(%rbp)
movabs $0x7ffffffffff,%rax
and    -0x48(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x48(%rbp),%rax
shr    $0x2b,%rax
movabs $0x7ffffffffff,%rcx
and    -0x50(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x68(%rbp)
mov    -0x58(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    -0x60(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0x68(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    -0x8(%rbp),%rax
add    $0x0,%rax
mov    %eax,%edi
mov    -0x70(%rbp),%rsi
mov    $0x8,%edx
call   1040 <_br2_store@plt>
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %eax,%edi
mov    -0x78(%rbp),%rsi
mov    $0x8,%edx
call   1040 <_br2_store@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rax
mov    %eax,%edi
mov    -0x80(%rbp),%rsi
mov    $0x8,%edx
call   1040 <_br2_store@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<internal_fiat_poly1305_carry>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %ebx,%edi
mov    $0x8,%esi
call   1030 <_br2_load@plt>
mov    %rax,%r15
lea    0x8(%rbx),%edi
mov    $0x8,%esi
call   1030 <_br2_load@plt>
mov    %rax,%r12
add    $0x10,%ebx
mov    %ebx,%edi
mov    $0x8,%esi
call   1030 <_br2_load@plt>
mov    %r15,%rcx
shr    $0x2c,%rcx
add    %r12,%rcx
mov    %rcx,%rbx
shr    $0x2b,%rbx
add    %rax,%rbx
movabs $0xfffffffffff,%rax
and    %rax,%r15
mov    %rbx,%rdx
shr    $0x2b,%rdx
lea    (%rdx,%rdx,4),%rsi
add    %r15,%rsi
mov    %rsi,%rdx
shr    $0x2c,%rdx
movabs $0x7ffffffffff,%rdi
and    %rdi,%rcx
add    %rdx,%rcx
and    %rax,%rsi
mov    %rcx,%r15
and    %rdi,%r15
shr    $0x2b,%rcx
and    %rdi,%rbx
add    %rcx,%rbx
mov    %r14d,%edi
mov    $0x8,%edx
call   1040 <_br2_store@plt>
lea    0x8(%r14),%edi
mov    %r15,%rsi
mov    $0x8,%edx
call   1040 <_br2_store@plt>
add    $0x10,%r14d
mov    %r14d,%edi
mov    %rbx,%rsi
mov    $0x8,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <_br2_store@plt>

LLVM IR (-O0):
define void @internal_fiat_poly1305_carry(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
%15 = alloca i64
%16 = alloca i64
%17 = alloca i64
%18 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%19 = load i64, i64* %4
%20 = add i64 %19, 0
%21 = trunc i64 %20 to i32
%22 = call i64 @_br2_load(i32 %21, i32 8)
store i64 %22, i64* %5
%23 = load i64, i64* %4
%24 = add i64 %23, 8
%25 = trunc i64 %24 to i32
%26 = call i64 @_br2_load(i32 %25, i32 8)
store i64 %26, i64* %6
%27 = load i64, i64* %4
%28 = add i64 %27, 16
%29 = trunc i64 %28 to i32
%30 = call i64 @_br2_load(i32 %29, i32 8)
store i64 %30, i64* %7
%31 = load i64, i64* %5
store i64 %31, i64* %8
%32 = load i64, i64* %8
%33 = lshr i64 %32, 44
%34 = load i64, i64* %6
%35 = add i64 %33, %34
store i64 %35, i64* %9
%36 = load i64, i64* %9
%37 = lshr i64 %36, 43
%38 = load i64, i64* %7
%39 = add i64 %37, %38
store i64 %39, i64* %12
%40 = load i64, i64* %8
%41 = and i64 %40, 17592186044415
%42 = load i64, i64* %12
%43 = lshr i64 %42, 43
%44 = mul i64 %43, 5
%45 = add i64 %41, %44
store i64 %45, i64* %10
%46 = load i64, i64* %10
%47 = lshr i64 %46, 44
%48 = load i64, i64* %9
%49 = and i64 %48, 8796093022207
%50 = add i64 %47, %49
store i64 %50, i64* %11
%51 = load i64, i64* %10
%52 = and i64 %51, 17592186044415
store i64 %52, i64* %13
%53 = load i64, i64* %11
%54 = and i64 %53, 8796093022207
store i64 %54, i64* %14
%55 = load i64, i64* %11
%56 = lshr i64 %55, 43
%57 = load i64, i64* %12
%58 = and i64 %57, 8796093022207
%59 = add i64 %56, %58
store i64 %59, i64* %15
%60 = load i64, i64* %13
store i64 %60, i64* %16
%61 = load i64, i64* %14
store i64 %61, i64* %17
%62 = load i64, i64* %15
store i64 %62, i64* %18
%63 = load i64, i64* %3
%64 = add i64 %63, 0
%65 = trunc i64 %64 to i32
%66 = load i64, i64* %16
%67 = call i32 @_br2_store(i32 %65, i64 %66, i32 8)
%68 = load i64, i64* %3
%69 = add i64 %68, 8
%70 = trunc i64 %69 to i32
%71 = load i64, i64* %17
%72 = call i32 @_br2_store(i32 %70, i64 %71, i32 8)
%73 = load i64, i64* %3
%74 = add i64 %73, 16
%75 = trunc i64 %74 to i32
%76 = load i64, i64* %18
%77 = call i32 @_br2_store(i32 %75, i64 %76, i32 8)
ret void
}

LLVM IR (-O2):
define void @internal_fiat_poly1305_carry(i64 %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = tail call i64 @_br2_load(i32 %3, i32 8)
%5 = add i32 %3, 8
%6 = tail call i64 @_br2_load(i32 %5, i32 8)
%7 = add i32 %3, 16
%8 = tail call i64 @_br2_load(i32 %7, i32 8)
%9 = lshr i64 %4, 44
%10 = add i64 %9, %6
%11 = lshr i64 %10, 43
%12 = add i64 %11, %8
%13 = and i64 %4, 17592186044415
%14 = lshr i64 %12, 43
%15 = mul nuw nsw i64 %14, 5
%16 = add nuw nsw i64 %15, %13
%17 = lshr i64 %16, 44
%18 = and i64 %10, 8796093022207
%19 = add nuw nsw i64 %17, %18
%20 = and i64 %16, 17592186044415
%21 = and i64 %19, 8796093022207
%22 = lshr i64 %19, 43
%23 = and i64 %12, 8796093022207
%24 = add nuw nsw i64 %22, %23
%25 = trunc i64 %0 to i32
%26 = tail call i32 @_br2_store(i32 %25, i64 %20, i32 8)
%27 = add i32 %25, 8
%28 = tail call i32 @_br2_store(i32 %27, i64 %21, i32 8)
%29 = add i32 %25, 16
%30 = tail call i32 @_br2_store(i32 %29, i64 %24, i32 8)
ret void
}