undefined4 dhcp6_copy_options(int param_1,int param_2)

{
  int iVar1;
  undefined4 uVar2;
  void *pvVar3;
  undefined4 uVar4;
  undefined4 uVar5;
  undefined4 uVar6;
  undefined4 uVar7;
  
  iVar1 = duidcpy();
  if (iVar1 == 0) {
    iVar1 = duidcpy(param_1 + 8,param_2 + 8);
    if (iVar1 == 0) {
      *(undefined4 *)(param_1 + 0x10) = *(undefined4 *)(param_2 + 0x10);
      iVar1 = dhcp6_copy_list(param_1 + 0x28,param_2 + 0x28);
      if (iVar1 == 0) {
        iVar1 = dhcp6_copy_list(param_1 + 0x30,param_2 + 0x30);
        if (iVar1 == 0) {
          iVar1 = dhcp6_copy_list(param_1 + 0x38,param_2 + 0x38);
          if (iVar1 == 0) {
            iVar1 = dhcp6_copy_list(param_1 + 0x40,param_2 + 0x40);
            if (iVar1 == 0) {
              iVar1 = dhcp6_copy_list(param_1 + 0x48,param_2 + 0x48);
              if (iVar1 == 0) {
                iVar1 = dhcp6_copy_list(param_1 + 0x50,param_2 + 0x50);
                if (iVar1 == 0) {
                  iVar1 = dhcp6_copy_list(param_1 + 0x58,param_2 + 0x58);
                  if (iVar1 == 0) {
                    iVar1 = dhcp6_copy_list(param_1 + 0x60,param_2 + 0x60);
                    if (iVar1 == 0) {
                      iVar1 = dhcp6_copy_list(param_1 + 0x68,param_2 + 0x68);
                      if (iVar1 == 0) {
                        iVar1 = dhcp6_copy_list(param_1 + 0x70,param_2 + 0x70);
                        if (iVar1 == 0) {
                          iVar1 = dhcp6_copy_list(param_1 + 0x78,param_2 + 0x78);
                          if (iVar1 == 0) {
                            iVar1 = dhcp6_copy_list(param_1 + 0x80,param_2 + 0x80);
                            if (iVar1 == 0) {
                              iVar1 = dhcp6_copy_list(param_1 + 0x88,param_2 + 0x88);
                              if (iVar1 == 0) {
                                iVar1 = dhcp6_copy_list(param_1 + 0x90,param_2 + 0x90);
                                if (iVar1 == 0) {
                                  iVar1 = dhcp6_copy_list(param_1 + 0x98,param_2 + 0x98);
                                  if (iVar1 == 0) {
                                    iVar1 = dhcp6_copy_list(param_1 + 0xa0,param_2 + 0xa0);
                                    if (iVar1 == 0) {
                                      iVar1 = dhcp6_copy_list(param_1 + 0xa8,param_2 + 0xa8);
                                      if ((iVar1 == 0) &&
                                         (iVar1 = dhcp6_copy_list(param_1 + 0xb0,param_2 + 0xb0),
                                         iVar1 == 0)) {
                                        uVar2 = *(undefined4 *)(param_2 + 0x20);
                                        uVar4 = *(undefined4 *)(param_2 + 0x24);
                                        uVar5 = *(undefined4 *)(param_2 + 0x14);
                                        iVar1 = *(int *)(param_2 + 0xbc);
                                        *(undefined4 *)(param_1 + 0x1c) =
                                             *(undefined4 *)(param_2 + 0x1c);
                                        *(undefined4 *)(param_1 + 0x20) = uVar2;
                                        *(undefined4 *)(param_1 + 0x24) = uVar4;
                                        *(undefined4 *)(param_1 + 0x14) = uVar5;
                                        if (iVar1 != 0) {
                                          pvVar3 = malloc(*(size_t *)(param_2 + 0xb8))   //possible issue identified - semgrep
                                          *(void **)(param_1 + 0xbc) = pvVar3;
                                          if (pvVar3 == (void *)0x0) goto LAB_00409b70;
                                          *(undefined4 *)(param_1 + 0xb8) =
                                               *(undefined4 *)(param_2 + 0xb8);
                                          memcpy(pvVar3,*(void **)(param_2 + 0xbc),
                                                 *(size_t *)(param_2 + 0xb8))   //possible issue identified - semgrep
                                        }
                                        if (*(int *)(param_2 + 0xc4) != 0) {
                                          pvVar3 = malloc(*(size_t *)(param_2 + 0xc0))   //possible issue identified - semgrep
                                          *(void **)(param_1 + 0xc4) = pvVar3;
                                          if (pvVar3 == (void *)0x0) goto LAB_00409b70;
                                          *(undefined4 *)(param_1 + 0xc0) =
                                               *(undefined4 *)(param_2 + 0xc0);
                                          memcpy(pvVar3,*(void **)(param_2 + 0xc4),
                                                 *(size_t *)(param_2 + 0xc0))   //possible issue identified - semgrep
                                        }
                                        uVar4 = *(undefined4 *)(param_2 + 0xd8);
                                        *(undefined4 *)(param_1 + 0xcc) =
                                             *(undefined4 *)(param_2 + 0xcc);
                                        uVar5 = *(undefined4 *)(param_2 + 0xdc);
                                        uVar6 = *(undefined4 *)(param_2 + 200);
                                        uVar2 = *(undefined4 *)(param_2 + 0xd0);
                                        iVar1 = *(int *)(param_2 + 0xcc);
                                        *(undefined4 *)(param_1 + 0xd4) =
                                             *(undefined4 *)(param_2 + 0xd4);
                                        *(undefined4 *)(param_1 + 200) = uVar6;
                                        *(undefined4 *)(param_1 + 0xd0) = uVar2;
                                        *(undefined4 *)(param_1 + 0xd8) = uVar4;
                                        *(undefined4 *)(param_1 + 0xdc) = uVar5;
                                        if (iVar1 == 2) {
                                          uVar2 = *(undefined4 *)(param_2 + 0xec);
                                          uVar4 = *(undefined4 *)(param_2 + 0xe4);
                                          iVar1 = *(int *)(param_2 + 0xe8);
                                          *(undefined4 *)(param_1 + 0xe0) =
                                               *(undefined4 *)(param_2 + 0xe0);
                                          *(undefined4 *)(param_1 + 0xec) = uVar2;
                                          *(undefined4 *)(param_1 + 0xe4) = uVar4;
                                          if (iVar1 != 0) {
                                            pvVar3 = malloc(*(size_t *)(param_2 + 0xe4))   //possible issue identified - semgrep
                                            *(void **)(param_1 + 0xe8) = pvVar3;
                                            if (pvVar3 != (void *)0x0) {
                                              memcpy(pvVar3,*(void **)(param_2 + 0xe8),
                                                     *(size_t *)(param_2 + 0xe4))   //possible issue identified - semgrep
                                              return 0;
                                            }
                                            goto LAB_00409b70;
                                          }
                                        }
                                        else if (iVar1 == 3) {
                                          uVar5 = *(undefined4 *)(param_2 + 0xf4);
                                          uVar6 = *(undefined4 *)(param_2 + 0xec);
                                          uVar7 = *(undefined4 *)(param_2 + 0xf0);
                                          uVar2 = *(undefined4 *)(param_2 + 0xe0);
                                          uVar4 = *(undefined4 *)(param_2 + 0xe4);
                                          *(undefined4 *)(param_1 + 0xe8) =
                                               *(undefined4 *)(param_2 + 0xe8);
                                          *(undefined4 *)(param_1 + 0xe0) = uVar2;
                                          *(undefined4 *)(param_1 + 0xf4) = uVar5;
                                          *(undefined4 *)(param_1 + 0xec) = uVar6;
                                          *(undefined4 *)(param_1 + 0xf0) = uVar7;
                                          *(undefined4 *)(param_1 + 0xe4) = uVar4;
                                          return 0;
                                        }
                                        return 0;
                                      }
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
LAB_00409b70:
  dhcp6_clear_options(param_1);
  return 0xffffffff;
}