// File: /workspace/github_c_makefile_star2_O0/theck01[P]offbrand_lib/src/classes/obint.c
// Function: obint_multiply_unsigned
obint * obint_multiply_unsigned(const obint *a, const obint *b){

  uint64_t large_most_sig, small_most_sig, split_point;
  const obint *larger, *smaller;
  obint *x0, *x1, *y0, *y1; /* split versions of a and b */
  obint *z0, *z1, *z1a, *z1b, *z1c, *z1d, *z2; /* partial results of Karatsuba
                                                  algorithm */
  obint *partial_result, *result;

  larger = obint_most_sig(a) > obint_most_sig(b) ? a : b;
  smaller = obint_most_sig(a) <= obint_most_sig(b) ? a : b;

  large_most_sig = obint_most_sig(larger);
  small_most_sig = obint_most_sig(smaller);

  /* base case, a and b are single digits */
  if(large_most_sig + small_most_sig < int64_max_digits)
    return obint_new(obint_magnitude(a) * obint_magnitude(b));

  split_point = large_most_sig/2+1;
  obint_split(a, split_point, &x1, &x0);
  obint_split(b, split_point, &y1, &y0);

  z2 = obint_multiply_unsigned(x1, y1);
  z0 = obint_multiply_unsigned(x0, y0);

  z1a = obint_add_unsigned(x1, x0);
  z1b = obint_add_unsigned(y1, y0);
  z1c = obint_multiply_unsigned(z1a, z1b);

  ob_release((obj *)x0);
  ob_release((obj *)x1);
  ob_release((obj *)y0);
  ob_release((obj *)y1);
  ob_release((obj *)z1a);
  ob_release((obj *)z1b);

  z1d = obint_subtract_unsigned(z1c, z2);
  ob_release((obj *)z1c);
  z1 = obint_subtract_unsigned(z1d, z0);
  ob_release((obj *)z1d);

  obint_shift(z2, 2*split_point);
  obint_shift(z1, split_point);
  partial_result = obint_add_unsigned(z2, z1);

  ob_release((obj *) z2);
  ob_release((obj *) z1);

  result = obint_add_unsigned(partial_result, z0);

  ob_release((obj *) partial_result);
  ob_release((obj *) z0);

  return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2690
movq %rax, -0xb0(%rbp)
movq -0x18(%rbp), %rdi
callq 0x2690
movq %rax, %rcx
movq -0xb0(%rbp), %rax
cmpq %rcx, %rax
jbe 0x3348
movq -0x10(%rbp), %rax
movq %rax, -0xb8(%rbp)
jmp 0x3353
movq -0x18(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2690
movq %rax, -0xc0(%rbp)
movq -0x18(%rbp), %rdi
callq 0x2690
movq %rax, %rcx
movq -0xc0(%rbp), %rax
cmpq %rcx, %rax
ja 0x3393
movq -0x10(%rbp), %rax
movq %rax, -0xc8(%rbp)
jmp 0x339e
movq -0x18(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0xc8(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rdi
callq 0x2690
movq %rax, -0x20(%rbp)
movq -0x40(%rbp), %rdi
callq 0x2690
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
addq -0x28(%rbp), %rax
movzbl 0x7cf6(%rip), %ecx      # 0xb0c8
cmpq %rcx, %rax
jae 0x3409
movq -0x10(%rbp), %rdi
callq 0x4140
movq %rax, -0xd0(%rbp)
movq -0x18(%rbp), %rdi
callq 0x4140
movq -0xd0(%rbp), %rdi
imulq %rax, %rdi
callq 0x2400
movq %rax, -0x8(%rbp)
jmp 0x359c
movq -0x20(%rbp), %rax
shrq %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
leaq -0x50(%rbp), %rdx
leaq -0x48(%rbp), %rcx
callq 0x41b0
movq -0x18(%rbp), %rdi
movq -0x30(%rbp), %rsi
leaq -0x60(%rbp), %rdx
leaq -0x58(%rbp), %rcx
callq 0x41b0
movq -0x50(%rbp), %rdi
movq -0x60(%rbp), %rsi
callq 0x3300
movq %rax, -0x98(%rbp)
movq -0x48(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0x3300
movq %rax, -0x68(%rbp)
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x2c20
movq %rax, -0x78(%rbp)
movq -0x60(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0x2c20
movq %rax, -0x80(%rbp)
movq -0x78(%rbp), %rdi
movq -0x80(%rbp), %rsi
callq 0x3300
movq %rax, -0x88(%rbp)
movq -0x48(%rbp), %rdi
callq 0x6480
movq -0x50(%rbp), %rdi
callq 0x6480
movq -0x58(%rbp), %rdi
callq 0x6480
movq -0x60(%rbp), %rdi
callq 0x6480
movq -0x78(%rbp), %rdi
callq 0x6480
movq -0x80(%rbp), %rdi
callq 0x6480
movq -0x88(%rbp), %rdi
movq -0x98(%rbp), %rsi
callq 0x2ed0
movq %rax, -0x90(%rbp)
movq -0x88(%rbp), %rdi
callq 0x6480
movq -0x90(%rbp), %rdi
movq -0x68(%rbp), %rsi
callq 0x2ed0
movq %rax, -0x70(%rbp)
movq -0x90(%rbp), %rdi
callq 0x6480
movq -0x98(%rbp), %rdi
movq -0x30(%rbp), %rsi
shlq %rsi
callq 0x42a0
movq -0x70(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x42a0
movq -0x98(%rbp), %rdi
movq -0x70(%rbp), %rsi
callq 0x2c20
movq %rax, -0xa0(%rbp)
movq -0x98(%rbp), %rdi
callq 0x6480
movq -0x70(%rbp), %rdi
callq 0x6480
movq -0xa0(%rbp), %rdi
movq -0x68(%rbp), %rsi
callq 0x2c20
movq %rax, -0xa8(%rbp)
movq -0xa0(%rbp), %rdi
callq 0x6480
movq -0x68(%rbp), %rdi
callq 0x6480
movq -0xa8(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0xd0, %rsp
popq %rbp
retq
nopl (%rax)