// File: marxn[P]pupp/3rdparty/gmp/gen-fib.c
// Function: generate
void
generate (int numb_bits)
{
  mpz_t  limit, l;
  int    falloc, i;

  mpz_init2 (limit, numb_bits + 1);
  mpz_setbit (limit, numb_bits);

  /* fib(2n) > 2^n, so use 2n as a limit for the table size */
  falloc = 2 * numb_bits;
  f = (mpz_t*) xmalloc (falloc * sizeof (*f));

  mpz_init_set_ui (f[0], 1L);  /* F[-1] */
  mpz_init_set_ui (f[1], 0L);  /* F[0] */

  mpz_init (l);

  for (i = 2; ; i++)
    {
      assert (i < falloc);

      /* F[i] = F[i-1] + F[i-2] */
      mpz_init (f[i]);
      mpz_add (f[i], f[i-1], f[i-2]);
      if (mpz_cmp (f[i], limit) >= 0)
        break;

      fnum = i+1;
      fib_limit = i-1;

      /* L[i] = F[i]+2*F[i-1] */
      mpz_add (l, f[i], f[i-1]);
      mpz_add (l, l, f[i-1]);

      if (mpz_cmp (l, limit) < 0)
        luc_limit = i-1;
    }

  mpz_clear (limit);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0x4(%rbp)
leaq -0x20(%rbp), %rdi
movl -0x4(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0x3260
leaq -0x20(%rbp), %rdi
movslq -0x4(%rbp), %rsi
callq 0x7430
movl -0x4(%rbp), %eax
shll %eax
movl %eax, -0x34(%rbp)
movslq -0x34(%rbp), %rdi
shlq $0x4, %rdi
callq 0x12d0
movq %rax, 0x685a(%rip)      # 0x120b0
movq 0x6853(%rip), %rdi      # 0x120b0
movl $0x1, %esi
callq 0x3530
movq 0x6842(%rip), %rdi      # 0x120b0
addq $0x10, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x3530
leaq -0x30(%rbp), %rdi
callq 0x31f0
movl $0x2, -0x38(%rbp)
movl -0x38(%rbp), %eax
cmpl -0x34(%rbp), %eax
jge 0xb895
jmp 0xb8b4
leaq 0x22c8(%rip), %rdi      # 0xdb64
leaq 0x22cc(%rip), %rsi      # 0xdb6f
movl $0x39, %edx
leaq 0x22ca(%rip), %rcx      # 0xdb79
callq 0x1070
movq 0x67f5(%rip), %rdi      # 0x120b0
movslq -0x38(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rdi
callq 0x31f0
movq 0x67de(%rip), %rdi      # 0x120b0
movslq -0x38(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rdi
movq 0x67cc(%rip), %rsi      # 0x120b0
movl -0x38(%rbp), %eax
subl $0x1, %eax
cltq
shlq $0x4, %rax
addq %rax, %rsi
movq 0x67b6(%rip), %rdx      # 0x120b0
movl -0x38(%rbp), %eax
subl $0x2, %eax
cltq
shlq $0x4, %rax
addq %rax, %rdx
callq 0x48b0
movq 0x679b(%rip), %rdi      # 0x120b0
movslq -0x38(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rdi
leaq -0x20(%rbp), %rsi
callq 0x41c0
cmpl $0x0, %eax
jl 0xb933
jmp 0xb9cd
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, 0x6779(%rip)      # 0x120b8
movl -0x38(%rbp), %eax
subl $0x1, %eax
movl %eax, 0x6771(%rip)      # 0x120bc
leaq -0x30(%rbp), %rdi
movq 0x675a(%rip), %rsi      # 0x120b0
movslq -0x38(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rsi
movq 0x6748(%rip), %rdx      # 0x120b0
movl -0x38(%rbp), %eax
subl $0x1, %eax
cltq
shlq $0x4, %rax
addq %rax, %rdx
callq 0x48b0
leaq -0x30(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movq 0x6725(%rip), %rdx      # 0x120b0
movl -0x38(%rbp), %eax
subl $0x1, %eax
cltq
shlq $0x4, %rax
addq %rax, %rdx
callq 0x48b0
leaq -0x30(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x41c0
cmpl $0x0, %eax
jge 0xb9bd
movl -0x38(%rbp), %eax
subl $0x1, %eax
movl %eax, 0x6703(%rip)      # 0x120c0
jmp 0xb9bf
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0xb88b
leaq -0x20(%rbp), %rdi
callq 0x32d0
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)