#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 */

/* Variables and functions */
int /*<<< orphan*/ curve25519_mult(unsigned int *, unsigned int *,
                                   unsigned int const *);
int /*<<< orphan*/ curve25519_square(unsigned int *, unsigned int const *);
void curve25519_recip(unsigned int out[32], const unsigned int z[32]) {
  unsigned int z2[32];
  unsigned int z9[32];
  unsigned int z11[32];
  unsigned int z2_5_0[32];
  unsigned int z2_10_0[32];
  unsigned int z2_20_0[32];
  unsigned int z2_50_0[32];
  unsigned int z2_100_0[32];
  unsigned int t0[32];
  unsigned int t1[32];
  int i;
  curve25519_square(z2, z);
  curve25519_square(t1, z2);
  curve25519_square(t0, t1);
  curve25519_mult(z9, t0, z);
  curve25519_mult(z11, z9, z2);
  curve25519_square(t0, z11);
  curve25519_mult(z2_5_0, t0, z9);
  curve25519_square(t0, z2_5_0);
  curve25519_square(t1, t0);
  curve25519_square(t0, t1);
  curve25519_square(t1, t0);
  curve25519_square(t0, t1);
  curve25519_mult(z2_10_0, t0, z2_5_0);
  curve25519_square(t0, z2_10_0);
  curve25519_square(t1, t0);
  for (i = 2; i < 10; i += 2) {
    curve25519_square(t0, t1);
    curve25519_square(t1, t0);
  }
  curve25519_mult(z2_20_0, t1, z2_10_0);
  curve25519_square(t0, z2_20_0);
  curve25519_square(t1, t0);
  for (i = 2; i < 20; i += 2) {
    curve25519_square(t0, t1);
    curve25519_square(t1, t0);
  }
  curve25519_mult(t0, t1, z2_20_0);
  curve25519_square(t1, t0);
  curve25519_square(t0, t1);
  for (i = 2; i < 10; i += 2) {
    curve25519_square(t1, t0);
    curve25519_square(t0, t1);
  }
  curve25519_mult(z2_50_0, t0, z2_10_0);
  curve25519_square(t0, z2_50_0);
  curve25519_square(t1, t0);
  for (i = 2; i < 50; i += 2) {
    curve25519_square(t0, t1);
    curve25519_square(t1, t0);
  }
  curve25519_mult(z2_100_0, t1, z2_50_0);
  curve25519_square(t1, z2_100_0);
  curve25519_square(t0, t1);
  for (i = 2; i < 100; i += 2) {
    curve25519_square(t1, t0);
    curve25519_square(t0, t1);
  }
  curve25519_mult(t1, t0, z2_100_0);
  curve25519_square(t0, t1);
  curve25519_square(t1, t0);
  for (i = 2; i < 50; i += 2) {
    curve25519_square(t0, t1);
    curve25519_square(t1, t0);
  }
  curve25519_mult(t0, t1, z2_50_0);
  curve25519_square(t1, t0);
  curve25519_square(t0, t1);
  curve25519_square(t1, t0);
  curve25519_square(t0, t1);
  curve25519_square(t1, t0);
  curve25519_mult(out, t1, z11);
}


x86 assembly (clang, -O0):
<curve25519_recip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x520,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <curve25519_square@plt>
lea    -0x510(%rbp),%rdi
lea    -0x90(%rbp),%rsi
call   1030 <curve25519_square@plt>
lea    -0x490(%rbp),%rdi
lea    -0x510(%rbp),%rsi
call   1030 <curve25519_square@plt>
lea    -0x110(%rbp),%rdi
lea    -0x490(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <curve25519_mult@plt>
lea    -0x190(%rbp),%rdi
lea    -0x110(%rbp),%rsi
lea    -0x90(%rbp),%rdx
call   1040 <curve25519_mult@plt>
lea    -0x490(%rbp),%rdi
lea    -0x190(%rbp),%rsi
call   1030 <curve25519_square@plt>
lea    -0x210(%rbp),%rdi
lea    -0x490(%rbp),%rsi
lea    -0x110(%rbp),%rdx
call   1040 <curve25519_mult@plt>
lea    -0x490(%rbp),%rdi
lea    -0x210(%rbp),%rsi
call   1030 <curve25519_square@plt>
lea    -0x510(%rbp),%rdi
lea    -0x490(%rbp),%rsi
call   1030 <curve25519_square@plt>
lea    -0x490(%rbp),%rdi
lea    -0x510(%rbp),%rsi
call   1030 <curve25519_square@plt>
lea    -0x510(%rbp),%rdi
lea    -0x490(%rbp),%rsi
call   1030 <curve25519_square@plt>
lea    -0x490(%rbp),%rdi
lea    -0x510(%rbp),%rsi
call   1030 <curve25519_square@plt>
lea    -0x290(%rbp),%rdi
lea    -0x490(%rbp),%rsi
lea    -0x210(%rbp),%rdx
call   1040 <curve25519_mult@plt>
lea    -0x490(%rbp),%rdi
lea    -0x290(%rbp),%rsi
call   1030 <curve25519_square@plt>
lea    -0x510(%rbp),%rdi
lea    -0x490(%rbp),%rsi
call   1030 <curve25519_square@plt>
movl   $0x2,-0x514(%rbp)
cmpl   $0xa,-0x514(%rbp)
jge    12b7 <curve25519_recip+0x197>
lea    -0x490(%rbp),%rdi
lea    -0x510(%rbp),%rsi
call   1030 <curve25519_square@plt>
lea    -0x510(%rbp),%rdi
lea    -0x490(%rbp),%rsi
call   1030 <curve25519_square@plt>
mov    -0x514(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x514(%rbp)
jmp    1270 <curve25519_recip+0x150>
lea    -0x310(%rbp),%rdi
lea    -0x510(%rbp),%rsi
lea    -0x290(%rbp),%rdx
call   1040 <curve25519_mult@plt>
lea    -0x490(%rbp),%rdi
lea    -0x310(%rbp),%rsi
call   1030 <curve25519_square@plt>
lea    -0x510(%rbp),%rdi
lea    -0x490(%rbp),%rsi
call   1030 <curve25519_square@plt>
movl   $0x2,-0x514(%rbp)
cmpl   $0x14,-0x514(%rbp)
jge    1348 <curve25519_recip+0x228>
lea    -0x490(%rbp),%rdi
lea    -0x510(%rbp),%rsi
call   1030 <curve25519_square@plt>
lea    -0x510(%rbp),%rdi
lea    -0x490(%rbp),%rsi
call   1030 <curve25519_square@plt>
mov    -0x514(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x514(%rbp)
jmp    1301 <curve25519_recip+0x1e1>
lea    -0x490(%rbp),%rdi
lea    -0x510(%rbp),%rsi
lea    -0x310(%rbp),%rdx
call   1040 <curve25519_mult@plt>
lea    -0x510(%rbp),%rdi
lea    -0x490(%rbp),%rsi
call   1030 <curve25519_square@plt>
lea    -0x490(%rbp),%rdi
lea    -0x510(%rbp),%rsi
call   1030 <curve25519_square@plt>
movl   $0x2,-0x514(%rbp)
cmpl   $0xa,-0x514(%rbp)
jge    13d9 <curve25519_recip+0x2b9>
lea    -0x510(%rbp),%rdi
lea    -0x490(%rbp),%rsi
call   1030 <curve25519_square@plt>
lea    -0x490(%rbp),%rdi
lea    -0x510(%rbp),%rsi
call   1030 <curve25519_square@plt>
mov    -0x514(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x514(%rbp)
jmp    1392 <curve25519_recip+0x272>
lea    -0x390(%rbp),%rdi
lea    -0x490(%rbp),%rsi
lea    -0x290(%rbp),%rdx
call   1040 <curve25519_mult@plt>
lea    -0x490(%rbp),%rdi
lea    -0x390(%rbp),%rsi
call   1030 <curve25519_square@plt>
lea    -0x510(%rbp),%rdi
lea    -0x490(%rbp),%rsi
call   1030 <curve25519_square@plt>
movl   $0x2,-0x514(%rbp)
cmpl   $0x32,-0x514(%rbp)
jge    146a <curve25519_recip+0x34a>
lea    -0x490(%rbp),%rdi
lea    -0x510(%rbp),%rsi
call   1030 <curve25519_square@plt>
lea    -0x510(%rbp),%rdi
lea    -0x490(%rbp),%rsi
call   1030 <curve25519_square@plt>
mov    -0x514(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x514(%rbp)
jmp    1423 <curve25519_recip+0x303>
lea    -0x410(%rbp),%rdi
lea    -0x510(%rbp),%rsi
lea    -0x390(%rbp),%rdx
call   1040 <curve25519_mult@plt>
lea    -0x510(%rbp),%rdi
lea    -0x410(%rbp),%rsi
call   1030 <curve25519_square@plt>
lea    -0x490(%rbp),%rdi
lea    -0x510(%rbp),%rsi
call   1030 <curve25519_square@plt>
movl   $0x2,-0x514(%rbp)
cmpl   $0x64,-0x514(%rbp)
jge    14fb <curve25519_recip+0x3db>
lea    -0x510(%rbp),%rdi
lea    -0x490(%rbp),%rsi
call   1030 <curve25519_square@plt>
lea    -0x490(%rbp),%rdi
lea    -0x510(%rbp),%rsi
call   1030 <curve25519_square@plt>
mov    -0x514(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x514(%rbp)
jmp    14b4 <curve25519_recip+0x394>
lea    -0x510(%rbp),%rdi
lea    -0x490(%rbp),%rsi
lea    -0x410(%rbp),%rdx
call   1040 <curve25519_mult@plt>
lea    -0x490(%rbp),%rdi
lea    -0x510(%rbp),%rsi
call   1030 <curve25519_square@plt>
lea    -0x510(%rbp),%rdi
lea    -0x490(%rbp),%rsi
call   1030 <curve25519_square@plt>
movl   $0x2,-0x514(%rbp)
cmpl   $0x32,-0x514(%rbp)
jge    158c <curve25519_recip+0x46c>
lea    -0x490(%rbp),%rdi
lea    -0x510(%rbp),%rsi
call   1030 <curve25519_square@plt>
lea    -0x510(%rbp),%rdi
lea    -0x490(%rbp),%rsi
call   1030 <curve25519_square@plt>
mov    -0x514(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x514(%rbp)
jmp    1545 <curve25519_recip+0x425>
lea    -0x490(%rbp),%rdi
lea    -0x510(%rbp),%rsi
lea    -0x390(%rbp),%rdx
call   1040 <curve25519_mult@plt>
lea    -0x510(%rbp),%rdi
lea    -0x490(%rbp),%rsi
call   1030 <curve25519_square@plt>
lea    -0x490(%rbp),%rdi
lea    -0x510(%rbp),%rsi
call   1030 <curve25519_square@plt>
lea    -0x510(%rbp),%rdi
lea    -0x490(%rbp),%rsi
call   1030 <curve25519_square@plt>
lea    -0x490(%rbp),%rdi
lea    -0x510(%rbp),%rsi
call   1030 <curve25519_square@plt>
lea    -0x510(%rbp),%rdi
lea    -0x490(%rbp),%rsi
call   1030 <curve25519_square@plt>
mov    -0x8(%rbp),%rdi
lea    -0x510(%rbp),%rsi
lea    -0x190(%rbp),%rdx
call   1040 <curve25519_mult@plt>
add    $0x520,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<curve25519_recip>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x518,%rsp
mov    %rsi,%r12
mov    %rdi,0x8(%rsp)
lea    0x490(%rsp),%r13
mov    %r13,%rdi
call   1030 <curve25519_square@plt>
lea    0x10(%rsp),%r15
mov    %r15,%rdi
mov    %r13,%rsi
call   1030 <curve25519_square@plt>
lea    0x90(%rsp),%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <curve25519_square@plt>
lea    0x410(%rsp),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r12,%rdx
call   1040 <curve25519_mult@plt>
lea    0x210(%rsp),%rbp
mov    %rbp,%rdi
mov    %r14,%rsi
mov    %r13,%rdx
call   1040 <curve25519_mult@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1030 <curve25519_square@plt>
lea    0x390(%rsp),%r13
mov    %r13,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <curve25519_mult@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1030 <curve25519_square@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <curve25519_square@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <curve25519_square@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <curve25519_square@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <curve25519_square@plt>
lea    0x310(%rsp),%r12
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %r13,%rdx
call   1040 <curve25519_mult@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1030 <curve25519_square@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <curve25519_square@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <curve25519_square@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <curve25519_square@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <curve25519_square@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <curve25519_square@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <curve25519_square@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <curve25519_square@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <curve25519_square@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <curve25519_square@plt>
lea    0x290(%rsp),%r13
mov    %r13,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1040 <curve25519_mult@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1030 <curve25519_square@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <curve25519_square@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <curve25519_square@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <curve25519_square@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <curve25519_square@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <curve25519_square@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <curve25519_square@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <curve25519_square@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <curve25519_square@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <curve25519_square@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <curve25519_square@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <curve25519_square@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <curve25519_square@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <curve25519_square@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <curve25519_square@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <curve25519_square@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <curve25519_square@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <curve25519_square@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <curve25519_square@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <curve25519_square@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r13,%rdx
call   1040 <curve25519_mult@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <curve25519_square@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <curve25519_square@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <curve25519_square@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <curve25519_square@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <curve25519_square@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <curve25519_square@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <curve25519_square@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <curve25519_square@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <curve25519_square@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <curve25519_square@plt>
lea    0x110(%rsp),%rbp
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r12,%rdx
call   1040 <curve25519_mult@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1030 <curve25519_square@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <curve25519_square@plt>
xor    %ebp,%ebp
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <curve25519_square@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <curve25519_square@plt>
add    $0x2,%ebp
cmp    $0x30,%ebp
jb     1410 <curve25519_recip+0x2f0>
lea    0x190(%rsp),%rbx
lea    0x10(%rsp),%r15
lea    0x110(%rsp),%rdx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <curve25519_mult@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <curve25519_square@plt>
lea    0x90(%rsp),%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <curve25519_square@plt>
xor    %ebp,%ebp
xchg   %ax,%ax
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <curve25519_square@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <curve25519_square@plt>
add    $0x2,%ebp
cmp    $0x62,%ebp
jb     1470 <curve25519_recip+0x350>
lea    0x10(%rsp),%r15
lea    0x90(%rsp),%rbx
lea    0x190(%rsp),%rdx
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <curve25519_mult@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <curve25519_square@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <curve25519_square@plt>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <curve25519_square@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <curve25519_square@plt>
add    $0x2,%ebp
cmp    $0x30,%ebp
jb     14d0 <curve25519_recip+0x3b0>
lea    0x90(%rsp),%rbp
lea    0x10(%rsp),%rbx
lea    0x110(%rsp),%rdx
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1040 <curve25519_mult@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1030 <curve25519_square@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1030 <curve25519_square@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1030 <curve25519_square@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1030 <curve25519_square@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1030 <curve25519_square@plt>
lea    0x210(%rsp),%rdx
mov    0x8(%rsp),%rdi
mov    %rbx,%rsi
call   1040 <curve25519_mult@plt>
add    $0x518,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @curve25519_recip(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [32 x i32]
%6 = alloca [32 x i32]
%7 = alloca [32 x i32]
%8 = alloca [32 x i32]
%9 = alloca [32 x i32]
%10 = alloca [32 x i32]
%11 = alloca [32 x i32]
%12 = alloca [32 x i32]
%13 = alloca [32 x i32]
%14 = alloca [32 x i32]
%15 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%16 = getelementptr inbounds [32 x i32], [32 x i32]* %5, i64 0, i64 0
%17 = load i32*, i32** %4
%18 = call i32 @curve25519_square(i32* %16, i32* %17)
%19 = getelementptr inbounds [32 x i32], [32 x i32]* %14, i64 0, i64 0
%20 = getelementptr inbounds [32 x i32], [32 x i32]* %5, i64 0, i64 0
%21 = call i32 @curve25519_square(i32* %19, i32* %20)
%22 = getelementptr inbounds [32 x i32], [32 x i32]* %13, i64 0, i64 0
%23 = getelementptr inbounds [32 x i32], [32 x i32]* %14, i64 0, i64 0
%24 = call i32 @curve25519_square(i32* %22, i32* %23)
%25 = getelementptr inbounds [32 x i32], [32 x i32]* %6, i64 0, i64 0
%26 = getelementptr inbounds [32 x i32], [32 x i32]* %13, i64 0, i64 0
%27 = load i32*, i32** %4
%28 = call i32 @curve25519_mult(i32* %25, i32* %26, i32* %27)
%29 = getelementptr inbounds [32 x i32], [32 x i32]* %7, i64 0, i64 0
%30 = getelementptr inbounds [32 x i32], [32 x i32]* %6, i64 0, i64 0
%31 = getelementptr inbounds [32 x i32], [32 x i32]* %5, i64 0, i64 0
%32 = call i32 @curve25519_mult(i32* %29, i32* %30, i32* %31)
%33 = getelementptr inbounds [32 x i32], [32 x i32]* %13, i64 0, i64 0
%34 = getelementptr inbounds [32 x i32], [32 x i32]* %7, i64 0, i64 0
%35 = call i32 @curve25519_square(i32* %33, i32* %34)
%36 = getelementptr inbounds [32 x i32], [32 x i32]* %8, i64 0, i64 0
%37 = getelementptr inbounds [32 x i32], [32 x i32]* %13, i64 0, i64 0
%38 = getelementptr inbounds [32 x i32], [32 x i32]* %6, i64 0, i64 0
%39 = call i32 @curve25519_mult(i32* %36, i32* %37, i32* %38)
%40 = getelementptr inbounds [32 x i32], [32 x i32]* %13, i64 0, i64 0
%41 = getelementptr inbounds [32 x i32], [32 x i32]* %8, i64 0, i64 0
%42 = call i32 @curve25519_square(i32* %40, i32* %41)
%43 = getelementptr inbounds [32 x i32], [32 x i32]* %14, i64 0, i64 0
%44 = getelementptr inbounds [32 x i32], [32 x i32]* %13, i64 0, i64 0
%45 = call i32 @curve25519_square(i32* %43, i32* %44)
%46 = getelementptr inbounds [32 x i32], [32 x i32]* %13, i64 0, i64 0
%47 = getelementptr inbounds [32 x i32], [32 x i32]* %14, i64 0, i64 0
%48 = call i32 @curve25519_square(i32* %46, i32* %47)
%49 = getelementptr inbounds [32 x i32], [32 x i32]* %14, i64 0, i64 0
%50 = getelementptr inbounds [32 x i32], [32 x i32]* %13, i64 0, i64 0
%51 = call i32 @curve25519_square(i32* %49, i32* %50)
%52 = getelementptr inbounds [32 x i32], [32 x i32]* %13, i64 0, i64 0
%53 = getelementptr inbounds [32 x i32], [32 x i32]* %14, i64 0, i64 0
%54 = call i32 @curve25519_square(i32* %52, i32* %53)
%55 = getelementptr inbounds [32 x i32], [32 x i32]* %9, i64 0, i64 0
%56 = getelementptr inbounds [32 x i32], [32 x i32]* %13, i64 0, i64 0
%57 = getelementptr inbounds [32 x i32], [32 x i32]* %8, i64 0, i64 0
%58 = call i32 @curve25519_mult(i32* %55, i32* %56, i32* %57)
%59 = getelementptr inbounds [32 x i32], [32 x i32]* %13, i64 0, i64 0
%60 = getelementptr inbounds [32 x i32], [32 x i32]* %9, i64 0, i64 0
%61 = call i32 @curve25519_square(i32* %59, i32* %60)
%62 = getelementptr inbounds [32 x i32], [32 x i32]* %14, i64 0, i64 0
%63 = getelementptr inbounds [32 x i32], [32 x i32]* %13, i64 0, i64 0
%64 = call i32 @curve25519_square(i32* %62, i32* %63)
store i32 2, i32* %15
br label %65
65: ; preds = %75, %2
%66 = load i32, i32* %15
%67 = icmp slt i32 %66, 10
br i1 %67, label %68, label %78
68: ; preds = %65
%69 = getelementptr inbounds [32 x i32], [32 x i32]* %13, i64 0, i64 0
%70 = getelementptr inbounds [32 x i32], [32 x i32]* %14, i64 0, i64 0
%71 = call i32 @curve25519_square(i32* %69, i32* %70)
%72 = getelementptr inbounds [32 x i32], [32 x i32]* %14, i64 0, i64 0
%73 = getelementptr inbounds [32 x i32], [32 x i32]* %13, i64 0, i64 0
%74 = call i32 @curve25519_square(i32* %72, i32* %73)
br label %75
75: ; preds = %68
%76 = load i32, i32* %15
%77 = add nsw i32 %76, 2
store i32 %77, i32* %15
br label %65
78: ; preds = %65
%79 = getelementptr inbounds [32 x i32], [32 x i32]* %10, i64 0, i64 0
%80 = getelementptr inbounds [32 x i32], [32 x i32]* %14, i64 0, i64 0
%81 = getelementptr inbounds [32 x i32], [32 x i32]* %9, i64 0, i64 0
%82 = call i32 @curve25519_mult(i32* %79, i32* %80, i32* %81)
%83 = getelementptr inbounds [32 x i32], [32 x i32]* %13, i64 0, i64 0
%84 = getelementptr inbounds [32 x i32], [32 x i32]* %10, i64 0, i64 0
%85 = call i32 @curve25519_square(i32* %83, i32* %84)
%86 = getelementptr inbounds [32 x i32], [32 x i32]* %14, i64 0, i64 0
%87 = getelementptr inbounds [32 x i32], [32 x i32]* %13, i64 0, i64 0
%88 = call i32 @curve25519_square(i32* %86, i32* %87)
store i32 2, i32* %15
br label %89
89: ; preds = %99, %78
%90 = load i32, i32* %15
%91 = icmp slt i32 %90, 20
br i1 %91, label %92, label %102
92: ; preds = %89
%93 = getelementptr inbounds [32 x i32], [32 x i32]* %13, i64 0, i64 0
%94 = getelementptr inbounds [32 x i32], [32 x i32]* %14, i64 0, i64 0
%95 = call i32 @curve25519_square(i32* %93, i32* %94)
%96 = getelementptr inbounds [32 x i32], [32 x i32]* %14, i64 0, i64 0
%97 = getelementptr inbounds [32 x i32], [32 x i32]* %13, i64 0, i64 0
%98 = call i32 @curve25519_square(i32* %96, i32* %97)
br label %99
99: ; preds = %92
%100 = load i32, i32* %15
%101 = add nsw i32 %100, 2
store i32 %101, i32* %15
br label %89
102: ; preds = %89
%103 = getelementptr inbounds [32 x i32], [32 x i32]* %13, i64 0, i64 0
%104 = getelementptr inbounds [32 x i32], [32 x i32]* %14, i64 0, i64 0
%105 = getelementptr inbounds [32 x i32], [32 x i32]* %10, i64 0, i64 0
%106 = call i32 @curve25519_mult(i32* %103, i32* %104, i32* %105)
%107 = getelementptr inbounds [32 x i32], [32 x i32]* %14, i64 0, i64 0
%108 = getelementptr inbounds [32 x i32], [32 x i32]* %13, i64 0, i64 0
%109 = call i32 @curve25519_square(i32* %107, i32* %108)
%110 = getelementptr inbounds [32 x i32], [32 x i32]* %13, i64 0, i64 0
%111 = getelementptr inbounds [32 x i32], [32 x i32]* %14, i64 0, i64 0
%112 = call i32 @curve25519_square(i32* %110, i32* %111)
store i32 2, i32* %15
br label %113
113: ; preds = %123, %102
%114 = load i32, i32* %15
%115 = icmp slt i32 %114, 10
br i1 %115, label %116, label %126
116: ; preds = %113
%117 = getelementptr inbounds [32 x i32], [32 x i32]* %14, i64 0, i64 0
%118 = getelementptr inbounds [32 x i32], [32 x i32]* %13, i64 0, i64 0
%119 = call i32 @curve25519_square(i32* %117, i32* %118)
%120 = getelementptr inbounds [32 x i32], [32 x i32]* %13, i64 0, i64 0
%121 = getelementptr inbounds [32 x i32], [32 x i32]* %14, i64 0, i64 0
%122 = call i32 @curve25519_square(i32* %120, i32* %121)
br label %123
123: ; preds = %116
%124 = load i32, i32* %15
%125 = add nsw i32 %124, 2
store i32 %125, i32* %15
br label %113
126: ; preds = %113
%127 = getelementptr inbounds [32 x i32], [32 x i32]* %11, i64 0, i64 0
%128 = getelementptr inbounds [32 x i32], [32 x i32]* %13, i64 0, i64 0
%129 = getelementptr inbounds [32 x i32], [32 x i32]* %9, i64 0, i64 0
%130 = call i32 @curve25519_mult(i32* %127, i32* %128, i32* %129)
%131 = getelementptr inbounds [32 x i32], [32 x i32]* %13, i64 0, i64 0
%132 = getelementptr inbounds [32 x i32], [32 x i32]* %11, i64 0, i64 0
%133 = call i32 @curve25519_square(i32* %131, i32* %132)
%134 = getelementptr inbounds [32 x i32], [32 x i32]* %14, i64 0, i64 0
%135 = getelementptr inbounds [32 x i32], [32 x i32]* %13, i64 0, i64 0
%136 = call i32 @curve25519_square(i32* %134, i32* %135)
store i32 2, i32* %15
br label %137
137: ; preds = %147, %126
%138 = load i32, i32* %15
%139 = icmp slt i32 %138, 50
br i1 %139, label %140, label %150
140: ; preds = %137
%141 = getelementptr inbounds [32 x i32], [32 x i32]* %13, i64 0, i64 0
%142 = getelementptr inbounds [32 x i32], [32 x i32]* %14, i64 0, i64 0
%143 = call i32 @curve25519_square(i32* %141, i32* %142)
%144 = getelementptr inbounds [32 x i32], [32 x i32]* %14, i64 0, i64 0
%145 = getelementptr inbounds [32 x i32], [32 x i32]* %13, i64 0, i64 0
%146 = call i32 @curve25519_square(i32* %144, i32* %145)
br label %147
147: ; preds = %140
%148 = load i32, i32* %15
%149 = add nsw i32 %148, 2
store i32 %149, i32* %15
br label %137
150: ; preds = %137
%151 = getelementptr inbounds [32 x i32], [32 x i32]* %12, i64 0, i64 0
%152 = getelementptr inbounds [32 x i32], [32 x i32]* %14, i64 0, i64 0
%153 = getelementptr inbounds [32 x i32], [32 x i32]* %11, i64 0, i64 0
%154 = call i32 @curve25519_mult(i32* %151, i32* %152, i32* %153)
%155 = getelementptr inbounds [32 x i32], [32 x i32]* %14, i64 0, i64 0
%156 = getelementptr inbounds [32 x i32], [32 x i32]* %12, i64 0, i64 0
%157 = call i32 @curve25519_square(i32* %155, i32* %156)
%158 = getelementptr inbounds [32 x i32], [32 x i32]* %13, i64 0, i64 0
%159 = getelementptr inbounds [32 x i32], [32 x i32]* %14, i64 0, i64 0
%160 = call i32 @curve25519_square(i32* %158, i32* %159)
store i32 2, i32* %15
br label %161
161: ; preds = %171, %150
%162 = load i32, i32* %15
%163 = icmp slt i32 %162, 100
br i1 %163, label %164, label %174
164: ; preds = %161
%165 = getelementptr inbounds [32 x i32], [32 x i32]* %14, i64 0, i64 0
%166 = getelementptr inbounds [32 x i32], [32 x i32]* %13, i64 0, i64 0
%167 = call i32 @curve25519_square(i32* %165, i32* %166)
%168 = getelementptr inbounds [32 x i32], [32 x i32]* %13, i64 0, i64 0
%169 = getelementptr inbounds [32 x i32], [32 x i32]* %14, i64 0, i64 0
%170 = call i32 @curve25519_square(i32* %168, i32* %169)
br label %171
171: ; preds = %164
%172 = load i32, i32* %15
%173 = add nsw i32 %172, 2
store i32 %173, i32* %15
br label %161
174: ; preds = %161
%175 = getelementptr inbounds [32 x i32], [32 x i32]* %14, i64 0, i64 0
%176 = getelementptr inbounds [32 x i32], [32 x i32]* %13, i64 0, i64 0
%177 = getelementptr inbounds [32 x i32], [32 x i32]* %12, i64 0, i64 0
%178 = call i32 @curve25519_mult(i32* %175, i32* %176, i32* %177)
%179 = getelementptr inbounds [32 x i32], [32 x i32]* %13, i64 0, i64 0
%180 = getelementptr inbounds [32 x i32], [32 x i32]* %14, i64 0, i64 0
%181 = call i32 @curve25519_square(i32* %179, i32* %180)
%182 = getelementptr inbounds [32 x i32], [32 x i32]* %14, i64 0, i64 0
%183 = getelementptr inbounds [32 x i32], [32 x i32]* %13, i64 0, i64 0
%184 = call i32 @curve25519_square(i32* %182, i32* %183)
store i32 2, i32* %15
br label %185
185: ; preds = %195, %174
%186 = load i32, i32* %15
%187 = icmp slt i32 %186, 50
br i1 %187, label %188, label %198
188: ; preds = %185
%189 = getelementptr inbounds [32 x i32], [32 x i32]* %13, i64 0, i64 0
%190 = getelementptr inbounds [32 x i32], [32 x i32]* %14, i64 0, i64 0
%191 = call i32 @curve25519_square(i32* %189, i32* %190)
%192 = getelementptr inbounds [32 x i32], [32 x i32]* %14, i64 0, i64 0
%193 = getelementptr inbounds [32 x i32], [32 x i32]* %13, i64 0, i64 0
%194 = call i32 @curve25519_square(i32* %192, i32* %193)
br label %195
195: ; preds = %188
%196 = load i32, i32* %15
%197 = add nsw i32 %196, 2
store i32 %197, i32* %15
br label %185
198: ; preds = %185
%199 = getelementptr inbounds [32 x i32], [32 x i32]* %13, i64 0, i64 0
%200 = getelementptr inbounds [32 x i32], [32 x i32]* %14, i64 0, i64 0
%201 = getelementptr inbounds [32 x i32], [32 x i32]* %11, i64 0, i64 0
%202 = call i32 @curve25519_mult(i32* %199, i32* %200, i32* %201)
%203 = getelementptr inbounds [32 x i32], [32 x i32]* %14, i64 0, i64 0
%204 = getelementptr inbounds [32 x i32], [32 x i32]* %13, i64 0, i64 0
%205 = call i32 @curve25519_square(i32* %203, i32* %204)
%206 = getelementptr inbounds [32 x i32], [32 x i32]* %13, i64 0, i64 0
%207 = getelementptr inbounds [32 x i32], [32 x i32]* %14, i64 0, i64 0
%208 = call i32 @curve25519_square(i32* %206, i32* %207)
%209 = getelementptr inbounds [32 x i32], [32 x i32]* %14, i64 0, i64 0
%210 = getelementptr inbounds [32 x i32], [32 x i32]* %13, i64 0, i64 0
%211 = call i32 @curve25519_square(i32* %209, i32* %210)
%212 = getelementptr inbounds [32 x i32], [32 x i32]* %13, i64 0, i64 0
%213 = getelementptr inbounds [32 x i32], [32 x i32]* %14, i64 0, i64 0
%214 = call i32 @curve25519_square(i32* %212, i32* %213)
%215 = getelementptr inbounds [32 x i32], [32 x i32]* %14, i64 0, i64 0
%216 = getelementptr inbounds [32 x i32], [32 x i32]* %13, i64 0, i64 0
%217 = call i32 @curve25519_square(i32* %215, i32* %216)
%218 = load i32*, i32** %3
%219 = getelementptr inbounds [32 x i32], [32 x i32]* %14, i64 0, i64 0
%220 = getelementptr inbounds [32 x i32], [32 x i32]* %7, i64 0, i64 0
%221 = call i32 @curve25519_mult(i32* %218, i32* %219, i32* %220)
ret void
}

LLVM IR (-O2):
define void @curve25519_recip(i32* %0, i32* %1) {
%3 = alloca [32 x i32]
%4 = alloca [32 x i32]
%5 = alloca [32 x i32]
%6 = alloca [32 x i32]
%7 = alloca [32 x i32]
%8 = alloca [32 x i32]
%9 = alloca [32 x i32]
%10 = alloca [32 x i32]
%11 = alloca [32 x i32]
%12 = alloca [32 x i32]
%13 = bitcast [32 x i32]* %3 to i8*
%14 = bitcast [32 x i32]* %4 to i8*
%15 = bitcast [32 x i32]* %5 to i8*
%16 = bitcast [32 x i32]* %6 to i8*
%17 = bitcast [32 x i32]* %7 to i8*
%18 = bitcast [32 x i32]* %8 to i8*
%19 = bitcast [32 x i32]* %9 to i8*
%20 = bitcast [32 x i32]* %10 to i8*
%21 = bitcast [32 x i32]* %11 to i8*
%22 = bitcast [32 x i32]* %12 to i8*
%23 = getelementptr inbounds [32 x i32], [32 x i32]* %3, i64 0, i64 0
%24 = call i32 @curve25519_square(i32* %23, i32* %1)
%25 = getelementptr inbounds [32 x i32], [32 x i32]* %12, i64 0, i64 0
%26 = call i32 @curve25519_square(i32* %25, i32* %23)
%27 = getelementptr inbounds [32 x i32], [32 x i32]* %11, i64 0, i64 0
%28 = call i32 @curve25519_square(i32* %27, i32* %25)
%29 = getelementptr inbounds [32 x i32], [32 x i32]* %4, i64 0, i64 0
%30 = call i32 @curve25519_mult(i32* %29, i32* %27, i32* %1)
%31 = getelementptr inbounds [32 x i32], [32 x i32]* %5, i64 0, i64 0
%32 = call i32 @curve25519_mult(i32* %31, i32* %29, i32* %23)
%33 = call i32 @curve25519_square(i32* %27, i32* %31)
%34 = getelementptr inbounds [32 x i32], [32 x i32]* %6, i64 0, i64 0
%35 = call i32 @curve25519_mult(i32* %34, i32* %27, i32* %29)
%36 = call i32 @curve25519_square(i32* %27, i32* %34)
%37 = call i32 @curve25519_square(i32* %25, i32* %27)
%38 = call i32 @curve25519_square(i32* %27, i32* %25)
%39 = call i32 @curve25519_square(i32* %25, i32* %27)
%40 = call i32 @curve25519_square(i32* %27, i32* %25)
%41 = getelementptr inbounds [32 x i32], [32 x i32]* %7, i64 0, i64 0
%42 = call i32 @curve25519_mult(i32* %41, i32* %27, i32* %34)
%43 = call i32 @curve25519_square(i32* %27, i32* %41)
%44 = call i32 @curve25519_square(i32* %25, i32* %27)
%45 = call i32 @curve25519_square(i32* %27, i32* %25)
%46 = call i32 @curve25519_square(i32* %25, i32* %27)
%47 = call i32 @curve25519_square(i32* %27, i32* %25)
%48 = call i32 @curve25519_square(i32* %25, i32* %27)
%49 = call i32 @curve25519_square(i32* %27, i32* %25)
%50 = call i32 @curve25519_square(i32* %25, i32* %27)
%51 = call i32 @curve25519_square(i32* %27, i32* %25)
%52 = call i32 @curve25519_square(i32* %25, i32* %27)
%53 = getelementptr inbounds [32 x i32], [32 x i32]* %8, i64 0, i64 0
%54 = call i32 @curve25519_mult(i32* %53, i32* %25, i32* %41)
%55 = call i32 @curve25519_square(i32* %27, i32* %53)
%56 = call i32 @curve25519_square(i32* %25, i32* %27)
%57 = call i32 @curve25519_square(i32* %27, i32* %25)
%58 = call i32 @curve25519_square(i32* %25, i32* %27)
%59 = call i32 @curve25519_square(i32* %27, i32* %25)
%60 = call i32 @curve25519_square(i32* %25, i32* %27)
%61 = call i32 @curve25519_square(i32* %27, i32* %25)
%62 = call i32 @curve25519_square(i32* %25, i32* %27)
%63 = call i32 @curve25519_square(i32* %27, i32* %25)
%64 = call i32 @curve25519_square(i32* %25, i32* %27)
%65 = call i32 @curve25519_square(i32* %27, i32* %25)
%66 = call i32 @curve25519_square(i32* %25, i32* %27)
%67 = call i32 @curve25519_square(i32* %27, i32* %25)
%68 = call i32 @curve25519_square(i32* %25, i32* %27)
%69 = call i32 @curve25519_square(i32* %27, i32* %25)
%70 = call i32 @curve25519_square(i32* %25, i32* %27)
%71 = call i32 @curve25519_square(i32* %27, i32* %25)
%72 = call i32 @curve25519_square(i32* %25, i32* %27)
%73 = call i32 @curve25519_square(i32* %27, i32* %25)
%74 = call i32 @curve25519_square(i32* %25, i32* %27)
%75 = call i32 @curve25519_mult(i32* %27, i32* %25, i32* %53)
%76 = call i32 @curve25519_square(i32* %25, i32* %27)
%77 = call i32 @curve25519_square(i32* %27, i32* %25)
%78 = call i32 @curve25519_square(i32* %25, i32* %27)
%79 = call i32 @curve25519_square(i32* %27, i32* %25)
%80 = call i32 @curve25519_square(i32* %25, i32* %27)
%81 = call i32 @curve25519_square(i32* %27, i32* %25)
%82 = call i32 @curve25519_square(i32* %25, i32* %27)
%83 = call i32 @curve25519_square(i32* %27, i32* %25)
%84 = call i32 @curve25519_square(i32* %25, i32* %27)
%85 = call i32 @curve25519_square(i32* %27, i32* %25)
%86 = getelementptr inbounds [32 x i32], [32 x i32]* %9, i64 0, i64 0
%87 = call i32 @curve25519_mult(i32* %86, i32* %27, i32* %41)
%88 = call i32 @curve25519_square(i32* %27, i32* %86)
%89 = call i32 @curve25519_square(i32* %25, i32* %27)
br label %90
90: ; preds = %2, %90
%91 = phi i32 [ 2, %2 ], [ %94, %90 ]
%92 = call i32 @curve25519_square(i32* %27, i32* %25)
%93 = call i32 @curve25519_square(i32* %25, i32* %27)
%94 = add nuw nsw i32 %91, 2
%95 = icmp ult i32 %91, 48
br i1 %95, label %90, label %96
96: ; preds = %90
%97 = getelementptr inbounds [32 x i32], [32 x i32]* %10, i64 0, i64 0
%98 = call i32 @curve25519_mult(i32* %97, i32* %25, i32* %86)
%99 = call i32 @curve25519_square(i32* %25, i32* %97)
%100 = call i32 @curve25519_square(i32* %27, i32* %25)
br label %101
101: ; preds = %96, %101
%102 = phi i32 [ 2, %96 ], [ %105, %101 ]
%103 = call i32 @curve25519_square(i32* %25, i32* %27)
%104 = call i32 @curve25519_square(i32* %27, i32* %25)
%105 = add nuw nsw i32 %102, 2
%106 = icmp ult i32 %102, 98
br i1 %106, label %101, label %107
107: ; preds = %101
%108 = call i32 @curve25519_mult(i32* %25, i32* %27, i32* %97)
%109 = call i32 @curve25519_square(i32* %27, i32* %25)
%110 = call i32 @curve25519_square(i32* %25, i32* %27)
br label %111
111: ; preds = %107, %111
%112 = phi i32 [ 2, %107 ], [ %115, %111 ]
%113 = call i32 @curve25519_square(i32* %27, i32* %25)
%114 = call i32 @curve25519_square(i32* %25, i32* %27)
%115 = add nuw nsw i32 %112, 2
%116 = icmp ult i32 %112, 48
br i1 %116, label %111, label %117
117: ; preds = %111
%118 = call i32 @curve25519_mult(i32* %27, i32* %25, i32* %86)
%119 = call i32 @curve25519_square(i32* %25, i32* %27)
%120 = call i32 @curve25519_square(i32* %27, i32* %25)
%121 = call i32 @curve25519_square(i32* %25, i32* %27)
%122 = call i32 @curve25519_square(i32* %27, i32* %25)
%123 = call i32 @curve25519_square(i32* %25, i32* %27)
%124 = call i32 @curve25519_mult(i32* %0, i32* %25, i32* %31)
ret void
}