#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 x5;
typedef uintptr_t x4;
typedef uintptr_t x3;
typedef uintptr_t x2;
typedef uintptr_t x1;
typedef uintptr_t x0;
typedef int /*<<< orphan*/ out0;
typedef int /*<<< orphan*/ in2;
typedef int /*<<< orphan*/ in1;

/* Variables and functions */
uintptr_t _br2_load(int /*<<< orphan*/, int);
int /*<<< orphan*/ _br2_store(int /*<<< orphan*/, uintptr_t, int);
void internal_fiat_poly1305_selectznz(uintptr_t out0, uintptr_t in0,
                                      uintptr_t in1, uintptr_t in2) {
  uintptr_t x3, x6, x0, x7, x4, x9, x1, x10, x5, x12, x2, x13, x8, x11, x14,
      x15, x16, x17;
  x0 = _br2_load((in1) + ((uintptr_t)0ULL), sizeof(uintptr_t));
  x1 = _br2_load((in1) + ((uintptr_t)8ULL), sizeof(uintptr_t));
  x2 = _br2_load((in1) + ((uintptr_t)16ULL), sizeof(uintptr_t));
  x3 = _br2_load((in2) + ((uintptr_t)0ULL), sizeof(uintptr_t));
  x4 = _br2_load((in2) + ((uintptr_t)8ULL), sizeof(uintptr_t));
  x5 = _br2_load((in2) + ((uintptr_t)16ULL), sizeof(uintptr_t));
  x6 = ((uintptr_t)-1ULL) + ((in0) == ((uintptr_t)0ULL));
  x7 = (x6) ^ ((uintptr_t)18446744073709551615ULL);
  x8 = ((x3) & (x6)) | ((x0) & (x7));
  x9 = ((uintptr_t)-1ULL) + ((in0) == ((uintptr_t)0ULL));
  x10 = (x9) ^ ((uintptr_t)18446744073709551615ULL);
  x11 = ((x4) & (x9)) | ((x1) & (x10));
  x12 = ((uintptr_t)-1ULL) + ((in0) == ((uintptr_t)0ULL));
  x13 = (x12) ^ ((uintptr_t)18446744073709551615ULL);
  x14 = ((x5) & (x12)) | ((x2) & (x13));
  x15 = x8;
  x16 = x11;
  x17 = x14;
  _br2_store((out0) + ((uintptr_t)0ULL), x15, sizeof(uintptr_t));
  _br2_store((out0) + ((uintptr_t)8ULL), x16, sizeof(uintptr_t));
  _br2_store((out0) + ((uintptr_t)16ULL), x17, sizeof(uintptr_t));
  return;
}


x86 assembly (clang, -O0):
<internal_fiat_poly1305_selectznz>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    $0x0,%rax
mov    %eax,%edi
mov    $0x8,%esi
call   1030 <_br2_load@plt>
mov    %rax,-0x38(%rbp)
mov    -0x18(%rbp),%rax
add    $0x8,%rax
mov    %eax,%edi
mov    $0x8,%esi
call   1030 <_br2_load@plt>
mov    %rax,-0x58(%rbp)
mov    -0x18(%rbp),%rax
add    $0x10,%rax
mov    %eax,%edi
mov    $0x8,%esi
call   1030 <_br2_load@plt>
mov    %rax,-0x78(%rbp)
mov    -0x20(%rbp),%rax
add    $0x0,%rax
mov    %eax,%edi
mov    $0x8,%esi
call   1030 <_br2_load@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
add    $0x8,%rax
mov    %eax,%edi
mov    $0x8,%esi
call   1030 <_br2_load@plt>
mov    %rax,-0x48(%rbp)
mov    -0x20(%rbp),%rax
add    $0x10,%rax
mov    %eax,%edi
mov    $0x8,%esi
call   1030 <_br2_load@plt>
mov    %rax,-0x68(%rbp)
cmpq   $0x0,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
cltq
add    $0xffffffffffffffff,%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
xor    $0xffffffffffffffff,%rax
mov    %rax,-0x40(%rbp)
mov    -0x28(%rbp),%rax
and    -0x30(%rbp),%rax
mov    -0x38(%rbp),%rcx
and    -0x40(%rbp),%rcx
or     %rcx,%rax
mov    %rax,-0x88(%rbp)
cmpq   $0x0,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
cltq
add    $0xffffffffffffffff,%rax
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rax
xor    $0xffffffffffffffff,%rax
mov    %rax,-0x60(%rbp)
mov    -0x48(%rbp),%rax
and    -0x50(%rbp),%rax
mov    -0x58(%rbp),%rcx
and    -0x60(%rbp),%rcx
or     %rcx,%rax
mov    %rax,-0x90(%rbp)
cmpq   $0x0,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
cltq
add    $0xffffffffffffffff,%rax
mov    %rax,-0x70(%rbp)
mov    -0x70(%rbp),%rax
xor    $0xffffffffffffffff,%rax
mov    %rax,-0x80(%rbp)
mov    -0x68(%rbp),%rax
and    -0x70(%rbp),%rax
mov    -0x78(%rbp),%rcx
and    -0x80(%rbp),%rcx
or     %rcx,%rax
mov    %rax,-0x98(%rbp)
mov    -0x88(%rbp),%rax
mov    %rax,-0xa0(%rbp)
mov    -0x90(%rbp),%rax
mov    %rax,-0xa8(%rbp)
mov    -0x98(%rbp),%rax
mov    %rax,-0xb0(%rbp)
mov    -0x8(%rbp),%rax
add    $0x0,%rax
mov    %eax,%edi
mov    -0xa0(%rbp),%rsi
mov    $0x8,%edx
call   1040 <_br2_store@plt>
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %eax,%edi
mov    -0xa8(%rbp),%rsi
mov    $0x8,%edx
call   1040 <_br2_store@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rax
mov    %eax,%edi
mov    -0xb0(%rbp),%rsi
mov    $0x8,%edx
call   1040 <_br2_store@plt>
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<internal_fiat_poly1305_selectznz>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rcx,%rbx
mov    %rdx,%rbp
mov    %rsi,0x10(%rsp)
mov    %rdi,%r12
mov    %ebp,%edi
mov    $0x8,%esi
call   1030 <_br2_load@plt>
mov    %rax,0x8(%rsp)
lea    0x8(%rbp),%edi
mov    $0x8,%esi
call   1030 <_br2_load@plt>
mov    %rax,%r14
add    $0x10,%ebp
mov    %ebp,%edi
mov    $0x8,%esi
call   1030 <_br2_load@plt>
mov    %rax,%r15
mov    %ebx,%edi
mov    $0x8,%esi
call   1030 <_br2_load@plt>
mov    %rax,%rbp
lea    0x8(%rbx),%edi
mov    $0x8,%esi
call   1030 <_br2_load@plt>
mov    %rax,%r13
add    $0x10,%ebx
mov    %ebx,%edi
mov    $0x8,%esi
call   1030 <_br2_load@plt>
cmpq   $0x0,0x10(%rsp)
cmove  0x8(%rsp),%rbp
cmove  %r14,%r13
cmovne %rax,%r15
mov    %r12d,%edi
mov    %rbp,%rsi
mov    $0x8,%edx
call   1040 <_br2_store@plt>
lea    0x8(%r12),%edi
mov    %r13,%rsi
mov    $0x8,%edx
call   1040 <_br2_store@plt>
add    $0x10,%r12d
mov    %r12d,%edi
mov    %r15,%rsi
mov    $0x8,%edx
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <_br2_store@plt>

LLVM IR (-O0):
define void @internal_fiat_poly1305_selectznz(i64 %0, i64 %1, i64 %2, i64 %3) {
%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
%19 = alloca i64
%20 = alloca i64
%21 = alloca i64
%22 = alloca i64
%23 = alloca i64
%24 = alloca i64
%25 = alloca i64
%26 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%27 = load i64, i64* %7
%28 = add i64 %27, 0
%29 = trunc i64 %28 to i32
%30 = call i64 @_br2_load(i32 %29, i32 8)
store i64 %30, i64* %11
%31 = load i64, i64* %7
%32 = add i64 %31, 8
%33 = trunc i64 %32 to i32
%34 = call i64 @_br2_load(i32 %33, i32 8)
store i64 %34, i64* %15
%35 = load i64, i64* %7
%36 = add i64 %35, 16
%37 = trunc i64 %36 to i32
%38 = call i64 @_br2_load(i32 %37, i32 8)
store i64 %38, i64* %19
%39 = load i64, i64* %8
%40 = add i64 %39, 0
%41 = trunc i64 %40 to i32
%42 = call i64 @_br2_load(i32 %41, i32 8)
store i64 %42, i64* %9
%43 = load i64, i64* %8
%44 = add i64 %43, 8
%45 = trunc i64 %44 to i32
%46 = call i64 @_br2_load(i32 %45, i32 8)
store i64 %46, i64* %13
%47 = load i64, i64* %8
%48 = add i64 %47, 16
%49 = trunc i64 %48 to i32
%50 = call i64 @_br2_load(i32 %49, i32 8)
store i64 %50, i64* %17
%51 = load i64, i64* %6
%52 = icmp eq i64 %51, 0
%53 = zext i1 %52 to i32
%54 = sext i32 %53 to i64
%55 = add i64 -1, %54
store i64 %55, i64* %10
%56 = load i64, i64* %10
%57 = xor i64 %56, -1
store i64 %57, i64* %12
%58 = load i64, i64* %9
%59 = load i64, i64* %10
%60 = and i64 %58, %59
%61 = load i64, i64* %11
%62 = load i64, i64* %12
%63 = and i64 %61, %62
%64 = or i64 %60, %63
store i64 %64, i64* %21
%65 = load i64, i64* %6
%66 = icmp eq i64 %65, 0
%67 = zext i1 %66 to i32
%68 = sext i32 %67 to i64
%69 = add i64 -1, %68
store i64 %69, i64* %14
%70 = load i64, i64* %14
%71 = xor i64 %70, -1
store i64 %71, i64* %16
%72 = load i64, i64* %13
%73 = load i64, i64* %14
%74 = and i64 %72, %73
%75 = load i64, i64* %15
%76 = load i64, i64* %16
%77 = and i64 %75, %76
%78 = or i64 %74, %77
store i64 %78, i64* %22
%79 = load i64, i64* %6
%80 = icmp eq i64 %79, 0
%81 = zext i1 %80 to i32
%82 = sext i32 %81 to i64
%83 = add i64 -1, %82
store i64 %83, i64* %18
%84 = load i64, i64* %18
%85 = xor i64 %84, -1
store i64 %85, i64* %20
%86 = load i64, i64* %17
%87 = load i64, i64* %18
%88 = and i64 %86, %87
%89 = load i64, i64* %19
%90 = load i64, i64* %20
%91 = and i64 %89, %90
%92 = or i64 %88, %91
store i64 %92, i64* %23
%93 = load i64, i64* %21
store i64 %93, i64* %24
%94 = load i64, i64* %22
store i64 %94, i64* %25
%95 = load i64, i64* %23
store i64 %95, i64* %26
%96 = load i64, i64* %5
%97 = add i64 %96, 0
%98 = trunc i64 %97 to i32
%99 = load i64, i64* %24
%100 = call i32 @_br2_store(i32 %98, i64 %99, i32 8)
%101 = load i64, i64* %5
%102 = add i64 %101, 8
%103 = trunc i64 %102 to i32
%104 = load i64, i64* %25
%105 = call i32 @_br2_store(i32 %103, i64 %104, i32 8)
%106 = load i64, i64* %5
%107 = add i64 %106, 16
%108 = trunc i64 %107 to i32
%109 = load i64, i64* %26
%110 = call i32 @_br2_store(i32 %108, i64 %109, i32 8)
ret void
}

LLVM IR (-O2):
define void @internal_fiat_poly1305_selectznz(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = trunc i64 %2 to i32
%6 = tail call i64 @_br2_load(i32 %5, i32 8)
%7 = add i32 %5, 8
%8 = tail call i64 @_br2_load(i32 %7, i32 8)
%9 = add i32 %5, 16
%10 = tail call i64 @_br2_load(i32 %9, i32 8)
%11 = trunc i64 %3 to i32
%12 = tail call i64 @_br2_load(i32 %11, i32 8)
%13 = add i32 %11, 8
%14 = tail call i64 @_br2_load(i32 %13, i32 8)
%15 = add i32 %11, 16
%16 = tail call i64 @_br2_load(i32 %15, i32 8)
%17 = icmp eq i64 %1, 0
%18 = select i1 %17, i64 %6, i64 %12
%19 = select i1 %17, i64 %8, i64 %14
%20 = select i1 %17, i64 %10, i64 %16
%21 = trunc i64 %0 to i32
%22 = tail call i32 @_br2_store(i32 %21, i64 %18, i32 8)
%23 = add i32 %21, 8
%24 = tail call i32 @_br2_store(i32 %23, i64 %19, i32 8)
%25 = add i32 %21, 16
%26 = tail call i32 @_br2_store(i32 %25, i64 %20, i32 8)
ret void
}