#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 x9;
typedef uintptr_t x8;
typedef uintptr_t x7;
typedef uintptr_t x6;
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_25519_selectznz(uintptr_t out0, uintptr_t in0, uintptr_t in1,
                                   uintptr_t in2) {
  uintptr_t x5, x10, x0, x11, x6, x13, x1, x14, x7, x16, x2, x17, x8, x19, x3,
      x20, x9, x22, x4, x23, x12, x15, x18, x21, x24, x25, x26, x27, x28, x29;
  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((in1) + ((uintptr_t)24ULL), sizeof(uintptr_t));
  x4 = _br2_load((in1) + ((uintptr_t)32ULL), sizeof(uintptr_t));
  x5 = _br2_load((in2) + ((uintptr_t)0ULL), sizeof(uintptr_t));
  x6 = _br2_load((in2) + ((uintptr_t)8ULL), sizeof(uintptr_t));
  x7 = _br2_load((in2) + ((uintptr_t)16ULL), sizeof(uintptr_t));
  x8 = _br2_load((in2) + ((uintptr_t)24ULL), sizeof(uintptr_t));
  x9 = _br2_load((in2) + ((uintptr_t)32ULL), sizeof(uintptr_t));
  x10 = ((uintptr_t)-1ULL) + ((in0) == ((uintptr_t)0ULL));
  x11 = (x10) ^ ((uintptr_t)18446744073709551615ULL);
  x12 = ((x5) & (x10)) | ((x0) & (x11));
  x13 = ((uintptr_t)-1ULL) + ((in0) == ((uintptr_t)0ULL));
  x14 = (x13) ^ ((uintptr_t)18446744073709551615ULL);
  x15 = ((x6) & (x13)) | ((x1) & (x14));
  x16 = ((uintptr_t)-1ULL) + ((in0) == ((uintptr_t)0ULL));
  x17 = (x16) ^ ((uintptr_t)18446744073709551615ULL);
  x18 = ((x7) & (x16)) | ((x2) & (x17));
  x19 = ((uintptr_t)-1ULL) + ((in0) == ((uintptr_t)0ULL));
  x20 = (x19) ^ ((uintptr_t)18446744073709551615ULL);
  x21 = ((x8) & (x19)) | ((x3) & (x20));
  x22 = ((uintptr_t)-1ULL) + ((in0) == ((uintptr_t)0ULL));
  x23 = (x22) ^ ((uintptr_t)18446744073709551615ULL);
  x24 = ((x9) & (x22)) | ((x4) & (x23));
  x25 = x12;
  x26 = x15;
  x27 = x18;
  x28 = x21;
  x29 = x24;
  _br2_store((out0) + ((uintptr_t)0ULL), x25, sizeof(uintptr_t));
  _br2_store((out0) + ((uintptr_t)8ULL), x26, sizeof(uintptr_t));
  _br2_store((out0) + ((uintptr_t)16ULL), x27, sizeof(uintptr_t));
  _br2_store((out0) + ((uintptr_t)24ULL), x28, sizeof(uintptr_t));
  _br2_store((out0) + ((uintptr_t)32ULL), x29, sizeof(uintptr_t));
  return;
}


x86 assembly (clang, -O0):
<internal_fiat_25519_selectznz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%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    -0x18(%rbp),%rax
add    $0x18,%rax
mov    %eax,%edi
mov    $0x8,%esi
call   1030 <_br2_load@plt>
mov    %rax,-0x98(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rax
mov    %eax,%edi
mov    $0x8,%esi
call   1030 <_br2_load@plt>
mov    %rax,-0xb8(%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)
mov    -0x20(%rbp),%rax
add    $0x18,%rax
mov    %eax,%edi
mov    $0x8,%esi
call   1030 <_br2_load@plt>
mov    %rax,-0x88(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rax
mov    %eax,%edi
mov    $0x8,%esi
call   1030 <_br2_load@plt>
mov    %rax,-0xa8(%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,-0xc8(%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,-0xd0(%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,-0xd8(%rbp)
cmpq   $0x0,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
cltq
add    $0xffffffffffffffff,%rax
mov    %rax,-0x90(%rbp)
mov    -0x90(%rbp),%rax
xor    $0xffffffffffffffff,%rax
mov    %rax,-0xa0(%rbp)
mov    -0x88(%rbp),%rax
and    -0x90(%rbp),%rax
mov    -0x98(%rbp),%rcx
and    -0xa0(%rbp),%rcx
or     %rcx,%rax
mov    %rax,-0xe0(%rbp)
cmpq   $0x0,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
cltq
add    $0xffffffffffffffff,%rax
mov    %rax,-0xb0(%rbp)
mov    -0xb0(%rbp),%rax
xor    $0xffffffffffffffff,%rax
mov    %rax,-0xc0(%rbp)
mov    -0xa8(%rbp),%rax
and    -0xb0(%rbp),%rax
mov    -0xb8(%rbp),%rcx
and    -0xc0(%rbp),%rcx
or     %rcx,%rax
mov    %rax,-0xe8(%rbp)
mov    -0xc8(%rbp),%rax
mov    %rax,-0xf0(%rbp)
mov    -0xd0(%rbp),%rax
mov    %rax,-0xf8(%rbp)
mov    -0xd8(%rbp),%rax
mov    %rax,-0x100(%rbp)
mov    -0xe0(%rbp),%rax
mov    %rax,-0x108(%rbp)
mov    -0xe8(%rbp),%rax
mov    %rax,-0x110(%rbp)
mov    -0x8(%rbp),%rax
add    $0x0,%rax
mov    %eax,%edi
mov    -0xf0(%rbp),%rsi
mov    $0x8,%edx
call   1040 <_br2_store@plt>
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %eax,%edi
mov    -0xf8(%rbp),%rsi
mov    $0x8,%edx
call   1040 <_br2_store@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rax
mov    %eax,%edi
mov    -0x100(%rbp),%rsi
mov    $0x8,%edx
call   1040 <_br2_store@plt>
mov    -0x8(%rbp),%rax
add    $0x18,%rax
mov    %eax,%edi
mov    -0x108(%rbp),%rsi
mov    $0x8,%edx
call   1040 <_br2_store@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rax
mov    %eax,%edi
mov    -0x110(%rbp),%rsi
mov    $0x8,%edx
call   1040 <_br2_store@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<internal_fiat_25519_selectznz>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rcx,%rbx
mov    %rdx,%rbp
mov    %rsi,0x30(%rsp)
mov    %rdi,%r12
mov    %ebp,%edi
mov    $0x8,%esi
call   1030 <_br2_load@plt>
mov    %rax,0x28(%rsp)
lea    0x8(%rbp),%edi
mov    $0x8,%esi
call   1030 <_br2_load@plt>
mov    %rax,0x20(%rsp)
lea    0x10(%rbp),%edi
mov    $0x8,%esi
call   1030 <_br2_load@plt>
mov    %rax,0x18(%rsp)
lea    0x18(%rbp),%edi
mov    $0x8,%esi
call   1030 <_br2_load@plt>
mov    %rax,0x10(%rsp)
add    $0x20,%ebp
mov    %ebp,%edi
mov    $0x8,%esi
call   1030 <_br2_load@plt>
mov    %rax,0x8(%rsp)
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,%r15
lea    0x10(%rbx),%edi
mov    $0x8,%esi
call   1030 <_br2_load@plt>
mov    %rax,%r13
lea    0x18(%rbx),%edi
mov    $0x8,%esi
call   1030 <_br2_load@plt>
mov    %rax,%r14
add    $0x20,%ebx
mov    %ebx,%edi
mov    $0x8,%esi
call   1030 <_br2_load@plt>
cmpq   $0x0,0x30(%rsp)
cmove  0x28(%rsp),%rbp
cmove  0x20(%rsp),%r15
cmove  0x18(%rsp),%r13
cmove  0x10(%rsp),%r14
mov    0x8(%rsp),%rbx
cmovne %rax,%rbx
mov    %r12d,%edi
mov    %rbp,%rsi
mov    $0x8,%edx
call   1040 <_br2_store@plt>
lea    0x8(%r12),%edi
mov    %r15,%rsi
mov    $0x8,%edx
call   1040 <_br2_store@plt>
lea    0x10(%r12),%edi
mov    %r13,%rsi
mov    $0x8,%edx
call   1040 <_br2_store@plt>
lea    0x18(%r12),%edi
mov    %r14,%rsi
mov    $0x8,%edx
call   1040 <_br2_store@plt>
add    $0x20,%r12d
mov    %r12d,%edi
mov    %rbx,%rsi
mov    $0x8,%edx
add    $0x38,%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_25519_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
%27 = alloca i64
%28 = alloca i64
%29 = alloca i64
%30 = alloca i64
%31 = alloca i64
%32 = alloca i64
%33 = alloca i64
%34 = alloca i64
%35 = alloca i64
%36 = alloca i64
%37 = alloca i64
%38 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%39 = load i64, i64* %7
%40 = add i64 %39, 0
%41 = trunc i64 %40 to i32
%42 = call i64 @_br2_load(i32 %41, i32 8)
store i64 %42, i64* %11
%43 = load i64, i64* %7
%44 = add i64 %43, 8
%45 = trunc i64 %44 to i32
%46 = call i64 @_br2_load(i32 %45, i32 8)
store i64 %46, i64* %15
%47 = load i64, i64* %7
%48 = add i64 %47, 16
%49 = trunc i64 %48 to i32
%50 = call i64 @_br2_load(i32 %49, i32 8)
store i64 %50, i64* %19
%51 = load i64, i64* %7
%52 = add i64 %51, 24
%53 = trunc i64 %52 to i32
%54 = call i64 @_br2_load(i32 %53, i32 8)
store i64 %54, i64* %23
%55 = load i64, i64* %7
%56 = add i64 %55, 32
%57 = trunc i64 %56 to i32
%58 = call i64 @_br2_load(i32 %57, i32 8)
store i64 %58, i64* %27
%59 = load i64, i64* %8
%60 = add i64 %59, 0
%61 = trunc i64 %60 to i32
%62 = call i64 @_br2_load(i32 %61, i32 8)
store i64 %62, i64* %9
%63 = load i64, i64* %8
%64 = add i64 %63, 8
%65 = trunc i64 %64 to i32
%66 = call i64 @_br2_load(i32 %65, i32 8)
store i64 %66, i64* %13
%67 = load i64, i64* %8
%68 = add i64 %67, 16
%69 = trunc i64 %68 to i32
%70 = call i64 @_br2_load(i32 %69, i32 8)
store i64 %70, i64* %17
%71 = load i64, i64* %8
%72 = add i64 %71, 24
%73 = trunc i64 %72 to i32
%74 = call i64 @_br2_load(i32 %73, i32 8)
store i64 %74, i64* %21
%75 = load i64, i64* %8
%76 = add i64 %75, 32
%77 = trunc i64 %76 to i32
%78 = call i64 @_br2_load(i32 %77, i32 8)
store i64 %78, i64* %25
%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* %10
%84 = load i64, i64* %10
%85 = xor i64 %84, -1
store i64 %85, i64* %12
%86 = load i64, i64* %9
%87 = load i64, i64* %10
%88 = and i64 %86, %87
%89 = load i64, i64* %11
%90 = load i64, i64* %12
%91 = and i64 %89, %90
%92 = or i64 %88, %91
store i64 %92, i64* %29
%93 = load i64, i64* %6
%94 = icmp eq i64 %93, 0
%95 = zext i1 %94 to i32
%96 = sext i32 %95 to i64
%97 = add i64 -1, %96
store i64 %97, i64* %14
%98 = load i64, i64* %14
%99 = xor i64 %98, -1
store i64 %99, i64* %16
%100 = load i64, i64* %13
%101 = load i64, i64* %14
%102 = and i64 %100, %101
%103 = load i64, i64* %15
%104 = load i64, i64* %16
%105 = and i64 %103, %104
%106 = or i64 %102, %105
store i64 %106, i64* %30
%107 = load i64, i64* %6
%108 = icmp eq i64 %107, 0
%109 = zext i1 %108 to i32
%110 = sext i32 %109 to i64
%111 = add i64 -1, %110
store i64 %111, i64* %18
%112 = load i64, i64* %18
%113 = xor i64 %112, -1
store i64 %113, i64* %20
%114 = load i64, i64* %17
%115 = load i64, i64* %18
%116 = and i64 %114, %115
%117 = load i64, i64* %19
%118 = load i64, i64* %20
%119 = and i64 %117, %118
%120 = or i64 %116, %119
store i64 %120, i64* %31
%121 = load i64, i64* %6
%122 = icmp eq i64 %121, 0
%123 = zext i1 %122 to i32
%124 = sext i32 %123 to i64
%125 = add i64 -1, %124
store i64 %125, i64* %22
%126 = load i64, i64* %22
%127 = xor i64 %126, -1
store i64 %127, i64* %24
%128 = load i64, i64* %21
%129 = load i64, i64* %22
%130 = and i64 %128, %129
%131 = load i64, i64* %23
%132 = load i64, i64* %24
%133 = and i64 %131, %132
%134 = or i64 %130, %133
store i64 %134, i64* %32
%135 = load i64, i64* %6
%136 = icmp eq i64 %135, 0
%137 = zext i1 %136 to i32
%138 = sext i32 %137 to i64
%139 = add i64 -1, %138
store i64 %139, i64* %26
%140 = load i64, i64* %26
%141 = xor i64 %140, -1
store i64 %141, i64* %28
%142 = load i64, i64* %25
%143 = load i64, i64* %26
%144 = and i64 %142, %143
%145 = load i64, i64* %27
%146 = load i64, i64* %28
%147 = and i64 %145, %146
%148 = or i64 %144, %147
store i64 %148, i64* %33
%149 = load i64, i64* %29
store i64 %149, i64* %34
%150 = load i64, i64* %30
store i64 %150, i64* %35
%151 = load i64, i64* %31
store i64 %151, i64* %36
%152 = load i64, i64* %32
store i64 %152, i64* %37
%153 = load i64, i64* %33
store i64 %153, i64* %38
%154 = load i64, i64* %5
%155 = add i64 %154, 0
%156 = trunc i64 %155 to i32
%157 = load i64, i64* %34
%158 = call i32 @_br2_store(i32 %156, i64 %157, i32 8)
%159 = load i64, i64* %5
%160 = add i64 %159, 8
%161 = trunc i64 %160 to i32
%162 = load i64, i64* %35
%163 = call i32 @_br2_store(i32 %161, i64 %162, i32 8)
%164 = load i64, i64* %5
%165 = add i64 %164, 16
%166 = trunc i64 %165 to i32
%167 = load i64, i64* %36
%168 = call i32 @_br2_store(i32 %166, i64 %167, i32 8)
%169 = load i64, i64* %5
%170 = add i64 %169, 24
%171 = trunc i64 %170 to i32
%172 = load i64, i64* %37
%173 = call i32 @_br2_store(i32 %171, i64 %172, i32 8)
%174 = load i64, i64* %5
%175 = add i64 %174, 32
%176 = trunc i64 %175 to i32
%177 = load i64, i64* %38
%178 = call i32 @_br2_store(i32 %176, i64 %177, i32 8)
ret void
}

LLVM IR (-O2):
define void @internal_fiat_25519_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 = add i32 %5, 24
%12 = tail call i64 @_br2_load(i32 %11, i32 8)
%13 = add i32 %5, 32
%14 = tail call i64 @_br2_load(i32 %13, i32 8)
%15 = trunc i64 %3 to i32
%16 = tail call i64 @_br2_load(i32 %15, i32 8)
%17 = add i32 %15, 8
%18 = tail call i64 @_br2_load(i32 %17, i32 8)
%19 = add i32 %15, 16
%20 = tail call i64 @_br2_load(i32 %19, i32 8)
%21 = add i32 %15, 24
%22 = tail call i64 @_br2_load(i32 %21, i32 8)
%23 = add i32 %15, 32
%24 = tail call i64 @_br2_load(i32 %23, i32 8)
%25 = icmp eq i64 %1, 0
%26 = select i1 %25, i64 %6, i64 %16
%27 = select i1 %25, i64 %8, i64 %18
%28 = select i1 %25, i64 %10, i64 %20
%29 = select i1 %25, i64 %12, i64 %22
%30 = select i1 %25, i64 %14, i64 %24
%31 = trunc i64 %0 to i32
%32 = tail call i32 @_br2_store(i32 %31, i64 %26, i32 8)
%33 = add i32 %31, 8
%34 = tail call i32 @_br2_store(i32 %33, i64 %27, i32 8)
%35 = add i32 %31, 16
%36 = tail call i32 @_br2_store(i32 %35, i64 %28, i32 8)
%37 = add i32 %31, 24
%38 = tail call i32 @_br2_store(i32 %37, i64 %29, i32 8)
%39 = add i32 %31, 32
%40 = tail call i32 @_br2_store(i32 %39, i64 %30, i32 8)
ret void
}