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

  uint64_t i, large_most_sig, small_most_sig;
  int8_t carry = 0;
  obint *result;
  const obint *larger, *smaller;

  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);

  /* reserve enough space for the result, +2 required for actual size of larger
   * and possible extra digit needed to catch any addition overflow */
  result = obint_create_default(large_most_sig+2);

  for(i=0; i<= small_most_sig; i++){
    result->digits[i] = (larger->digits[i] + smaller->digits[i] + carry)%10;
    carry = (larger->digits[i] + smaller->digits[i] + carry)/10;
  }

  for( ; i<= large_most_sig; i++){
    result->digits[i] = (larger->digits[i] + carry)%10;
    carry = (larger->digits[i] + carry)/10;
  }

  result->digits[i] = carry;

  return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb $0x0, -0x29(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2690
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2690
movq %rax, %rcx
movq -0x50(%rbp), %rax
cmpq %rcx, %rax
jbe 0x2c60
movq -0x8(%rbp), %rax
movq %rax, -0x58(%rbp)
jmp 0x2c68
movq -0x10(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2690
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2690
movq %rax, %rcx
movq -0x60(%rbp), %rax
cmpq %rcx, %rax
ja 0x2c9c
movq -0x8(%rbp), %rax
movq %rax, -0x68(%rbp)
jmp 0x2ca4
movq -0x10(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rdi
callq 0x2690
movq %rax, -0x20(%rbp)
movq -0x48(%rbp), %rdi
callq 0x2690
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
addq $0x2, %rdi
callq 0x24f0
movq %rax, -0x38(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpq -0x28(%rbp), %rax
ja 0x2d70
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movq -0x48(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq -0x18(%rbp), %rdx
movsbl (%rcx,%rdx), %ecx
addl %ecx, %eax
movsbl -0x29(%rbp), %ecx
addl %ecx, %eax
movl $0xa, %ecx
cltd
idivl %ecx
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movq -0x48(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq -0x18(%rbp), %rdx
movsbl (%rcx,%rdx), %ecx
addl %ecx, %eax
movsbl -0x29(%rbp), %ecx
addl %ecx, %eax
movl $0xa, %ecx
cltd
idivl %ecx
movb %al, -0x29(%rbp)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x2cdf
jmp 0x2d72
movq -0x18(%rbp), %rax
cmpq -0x20(%rbp), %rax
ja 0x2dd8
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movsbl -0x29(%rbp), %ecx
addl %ecx, %eax
movl $0xa, %ecx
cltd
idivl %ecx
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movsbl -0x29(%rbp), %ecx
addl %ecx, %eax
movl $0xa, %ecx
cltd
idivl %ecx
movb %al, -0x29(%rbp)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x2d72
movb -0x29(%rbp), %dl
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x38(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)