user: 请从给定的汇编指令推导出C源代码：

```asm
<checkconvnet>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x108,%rsp
  mov    0x148(%rsp),%rax
  mov    0x180(%rsp),%rbx
  mov    %rcx,0x28(%rsp)
  mov    0x140(%rsp),%r11
  mov    0x188(%rsp),%r14
  mov    %rax,0x18(%rsp)
  mov    0x150(%rsp),%rax
  mov    %rbx,0x30(%rsp)
  mov    0x198(%rsp),%rbx
  mov    %rax,0x8(%rsp)
  mov    0x158(%rsp),%rax
  mov    %rbx,0x38(%rsp)
  mov    0x1a0(%rsp),%rbx
  mov    %rax,0x10(%rsp)
  mov    0x160(%rsp),%rax
  mov    %rbx,0x98(%rsp)
  mov    0x1a8(%rsp),%rbx
  mov    %rax,0x20(%rsp)
  mov    0x168(%rsp),%rax
  mov    %rbx,0xa0(%rsp)
  mov    0x190(%rsp),%r10
  mov    %rax,0x88(%rsp)
  mov    0x170(%rsp),%rax
  mov    %rax,0x58(%rsp)
  mov    0x178(%rsp),%rax
  mov    0x1b0(%rsp),%rsi
  mov    0x1b8(%rsp),%rbx
  movsd  0x108(%rax),%xmm5
  movsd  0x110(%rax),%xmm6
  mov    %rsi,0xb0(%rsp)
  mov    0x1c0(%rsp),%rsi
  mov    %rbx,0x90(%rsp)
  mov    0x1c8(%rsp),%rbx
  movsd  0x38(%rax),%xmm7
  mov    %rsi,0x68(%rsp)
  mov    0x1d0(%rsp),%rsi
  mov    %rbx,0xc8(%rsp)
  mov    0x1d8(%rsp),%rbx
  movsd  0x50(%rax),%xmm14
  movsd  %xmm5,0xc0(%rsp)
  mov    %rsi,0x48(%rsp)
  mov    0x1e8(%rsp),%rsi
  mov    0x1e0(%rsp),%rcx
  mov    %rbx,0x70(%rsp)
  mov    %rsi,0x80(%rsp)
  cvttsd2si 0x18(%rax),%esi
  mov    0x1f0(%rsp),%rbx
  mov    %rcx,0x78(%rsp)
  movsd  0x100(%rax),%xmm10
  cvttsd2si (%rax),%ecx
  movsd  %xmm6,0xe0(%rsp)
  movsd  0x118(%rax),%xmm1
  mov    %rbx,0x40(%rsp)
  movsd  0x120(%rax),%xmm13
  mov    %esi,0x50(%rsp)
  movsd  0x128(%rax),%xmm12
  movsd  %xmm7,0x60(%rsp)
  movsd  0x130(%rax),%xmm7
  movsd  0x140(%rax),%xmm5
  movsd  0x148(%rax),%xmm6
  movsd  0x168(%rax),%xmm4
  movq   D29(%rip),%xmm0
  movsd  %xmm7,0xa8(%rsp)
  movsd  0x158(%rax),%xmm11
  movsd  0x150(%rax),%xmm7
  movsd  %xmm5,0xb8(%rsp)
  movsd  %xmm6,0xd8(%rsp)
  movsd  0x160(%rax),%xmm5
  movsd  0x170(%rax),%xmm6
  movsd  %xmm7,0xe8(%rsp)
  movslq (%r12),%rax
  movsd  %xmm5,0xd0(%rsp)
  movsd  %xmm4,0xf0(%rsp)
  mov    %rax,%rsi
  imul   $0x51eb851f,%rax,%rax
  movsd  %xmm6,0xf8(%rsp)
  mov    %esi,%edi
  sar    $0x1f,%edi
  sar    $0x24,%rax
  sub    %edi,%eax
  imul   $0x32,%eax,%edi
  mov    %esi,%eax
  sub    %edi,%eax
  jne    L492
  mov    0x8(%rsp),%rbx
  movsd  (%rdx),%xmm2
  pxor   %xmm0,%xmm0
  movsd  (%rbx),%xmm6
  movapd %xmm6,%xmm3
  mulsd  %xmm2,%xmm3
  comisd %xmm0,%xmm3
  jb     L654
  movsd  (%r9),%xmm3
  mulsd  %xmm6,%xmm3
  comisd %xmm0,%xmm3
  sbb    %r15d,%r15d
  not    %r15d
  add    $0x4,%r15d
  comisd %xmm0,%xmm3
  sbb    %edi,%edi
  not    %edi
  add    $0x3,%edi
  comisd %xmm0,%xmm3
  sbb    %ebx,%ebx
  xor    %r13d,%r13d
  not    %ebx
  add    $0x2,%ebx
  comisd %xmm0,%xmm3
  setb   %r13b
  mov    %r13d,0x54(%rsp)
L466:
  mov    0x10(%rsp),%r13
  movsd  0x0(%r13),%xmm5
  mov    0x28(%rsp),%r13
  movsd  0x0(%r13),%xmm9
  movapd %xmm5,%xmm3
  mulsd  %xmm9,%xmm3
  comisd %xmm0,%xmm3
  jb     L698
  movsd  (%r11),%xmm3
  mulsd  %xmm5,%xmm3
  comisd %xmm0,%xmm3
  jb     L698
  mov    %edi,%r15d
  mov    %ebx,%edi
  mov    0x54(%rsp),%ebx
L698:
  mov    0x20(%rsp),%r13
  movsd  (%r8),%xmm8
  movsd  0x0(%r13),%xmm4
  movapd %xmm4,%xmm3
  mulsd  %xmm8,%xmm3
  comisd %xmm0,%xmm3
  jb     L509
  mov    0x18(%rsp),%r13
  movsd  0x0(%r13),%xmm3
  mulsd  %xmm4,%xmm3
  comisd %xmm0,%xmm3
  jb     L509
  mov    %edi,%r15d
  mov    %ebx,%edi
L509:
  mov    0x30(%rsp),%rbx
  movsd  (%r10),%xmm3
  movsd  (%rbx),%xmm7
  movapd %xmm3,%xmm15
  mulsd  %xmm7,%xmm15
  comisd %xmm0,%xmm15
  jb     L696
  movsd  (%r14),%xmm15
  mulsd  %xmm3,%xmm15
  ucomisd %xmm0,%xmm15
  cmovae %edi,%r15d
L696:
  movq   D29(%rip),%xmm0
  andpd  %xmm0,%xmm2
  andpd  %xmm0,%xmm6
  comisd %xmm6,%xmm2
  jb     L310
  movsd  (%r9),%xmm6
  andpd  %xmm0,%xmm6
  comisd %xmm2,%xmm6
  sbb    %edi,%edi
  not    %edi
  add    $0x4,%edi
  comisd %xmm2,%xmm6
  mov    %edi,0x54(%rsp)
  sbb    %edi,%edi
  not    %edi
  add    $0x3,%edi
  comisd %xmm2,%xmm6
  sbb    %ebx,%ebx
  xor    %r13d,%r13d
  not    %ebx
  add    $0x2,%ebx
  comisd %xmm2,%xmm6
  setb   %r13b
L190:
  andpd  %xmm0,%xmm9
  andpd  %xmm0,%xmm5
  comisd %xmm5,%xmm9
  jb     L562
  movsd  (%r11),%xmm2
  andpd  %xmm0,%xmm2
  comisd %xmm9,%xmm2
  jae    L560
L562:
  andpd  %xmm0,%xmm8
  andpd  %xmm0,%xmm4
  comisd %xmm4,%xmm8
  jb     L219
  mov    0x18(%rsp),%r13
  movsd  0x0(%r13),%xmm2
  andpd  %xmm0,%xmm2
  comisd %xmm8,%xmm2
  jae    L329
L219:
  andpd  %xmm0,%xmm7
  andpd  %xmm0,%xmm3
  comisd %xmm3,%xmm7
  jb     L492
  movsd  (%r14),%xmm2
  andpd  %xmm0,%xmm2
  ucomisd %xmm7,%xmm2
  cmovb  0x54(%rsp),%edi
  mov    %edi,0x54(%rsp)
L492:
  mov    0x40(%rsp),%rbx
  cmpl   $0x1,(%rbx)
  jne    L440
  mov    0x48(%rsp),%rdi
  mov    0x70(%rsp),%rbx
  movq   $0x0,(%rdi)
  mov    0x78(%rsp),%rdi
  movq   $0x0,(%rbx)
  movq   $0x0,(%rdi)
L440:
  mov    0x38(%rsp),%rdi
  mov    0x8(%rsp),%rbx
  mulsd  (%rdi),%xmm1
  movsd  (%rbx),%xmm2
  andpd  %xmm0,%xmm2
  comisd %xmm2,%xmm1
  jb     L204
  mov    0x48(%rsp),%rbx
  movsd  (%rbx),%xmm3
  mov    0x68(%rsp),%rbx
  mulsd  (%rbx),%xmm10
  comisd %xmm3,%xmm10
  jbe    L204
  comisd %xmm2,%xmm11
  jb     L204
  movsd  0xb8(%rsp),%xmm7
  comisd %xmm3,%xmm7
  jbe    L204
  mov    0x98(%rsp),%rdi
  mov    0x10(%rsp),%rbx
  movsd  (%rdi),%xmm4
  movsd  (%rbx),%xmm3
  mulsd  %xmm13,%xmm4
  andpd  %xmm0,%xmm3
  comisd %xmm3,%xmm4
  jb     L204
  mov    0xc8(%rsp),%rdi
  mov    0x70(%rsp),%rbx
  movsd  0xc0(%rsp),%xmm5
  mulsd  (%rdi),%xmm5
  movsd  (%rbx),%xmm4
  comisd %xmm4,%xmm5
  jbe    L204
  movsd  0xd0(%rsp),%xmm7
  comisd %xmm3,%xmm7
  jb     L204
  movsd  0xd8(%rsp),%xmm7
  comisd %xmm4,%xmm7
  jbe    L204
  mov    0xa0(%rsp),%rdi
  mov    0x20(%rsp),%rbx
  movsd  (%rdi),%xmm4
  movsd  (%rbx),%xmm3
  mulsd  %xmm12,%xmm4
  andpd  %xmm0,%xmm3
  comisd %xmm3,%xmm4
  jb     L204
  movsd  0xe0(%rsp),%xmm7
  mov    0x78(%rsp),%rbx
  movsd  (%rbx),%xmm4
  comisd %xmm4,%xmm7
  jbe    L204
  movsd  0xf0(%rsp),%xmm7
  comisd %xmm3,%xmm7
  jbe    L204
  movsd  0xe8(%rsp),%xmm7
  comisd %xmm4,%xmm7
  jbe    L204
  mov    0xb0(%rsp),%rbx
  movsd  (%r10),%xmm3
  movsd  0xa8(%rsp),%xmm4
  mulsd  (%rbx),%xmm4
  andpd  %xmm0,%xmm3
  comisd %xmm3,%xmm4
  jb     L204
  movsd  0xf8(%rsp),%xmm7
  comisd %xmm3,%xmm7
  jb     L204
  mov    0x80(%rsp),%rdi
  cmpl   $0x1,(%rdi)
  jne    L204
  cmp    $0x3,%esi
  jle    L204
  lea    D108(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x88(%rsp),%rax
  movl   $0x1,(%rax)
  movl   $0x0,0x0(%rbp)
  jmp    L253
  nopl   (%rax)
L204:
  lea    (%rcx,%rcx,4),%ecx
  shl    $0x2,%ecx
  cmp    %ecx,%esi
  jl     L587
  movsd  (%r9),%xmm3
  movsd  (%rdx),%xmm4
  andpd  %xmm0,%xmm3
  andpd  %xmm0,%xmm4
  comisd %xmm3,%xmm4
  jb     L55
  comisd %xmm3,%xmm2
  jae    L110
L55:
  xor    %edx,%edx
L602:
  mov    0x28(%rsp),%rdi
  movsd  (%r11),%xmm2
  movsd  (%rdi),%xmm1
  andpd  %xmm0,%xmm2
  andpd  %xmm0,%xmm1
  comisd %xmm2,%xmm1
  jb     L339
  mov    0x10(%rsp),%rbx
  movsd  (%rbx),%xmm1
  andpd  %xmm0,%xmm1
  comisd %xmm2,%xmm1
  jae    L235
L339:
  mov    0x18(%rsp),%rdi
  movsd  (%r8),%xmm2
  movsd  (%rdi),%xmm1
  andpd  %xmm0,%xmm2
  andpd  %xmm0,%xmm1
  comisd %xmm1,%xmm2
  jb     L171
  mov    0x20(%rsp),%rdi
  movsd  (%rdi),%xmm2
  andpd  %xmm0,%xmm2
L432:
  comisd %xmm1,%xmm2
  jb     L543
  mov    0xa0(%rsp),%rdi
  movsd  (%rdi),%xmm1
  mov    $0x1,%edi
  mulsd  %xmm12,%xmm1
  ucomisd %xmm1,%xmm2
  cmova  %edi,%edx
L543:
  cmp    %ecx,%esi
  jge    L171
  movsd  D74(%rip),%xmm3
L200:
  movsd  (%r10),%xmm1
  andpd  %xmm0,%xmm1
  comisd %xmm3,%xmm1
  jbe    L634
L171:
  mov    0x30(%rsp),%rcx
  movsd  (%r14),%xmm1
  movsd  (%rcx),%xmm2
  andpd  %xmm0,%xmm1
  andpd  %xmm0,%xmm2
  comisd %xmm1,%xmm2
  jb     L634
  movsd  (%r10),%xmm2
  andpd  %xmm2,%xmm0
  comisd %xmm1,%xmm0
  jae    L348
L634:
  mov    0x50(%rsp),%ecx
  lea    (%rcx,%rcx,4),%ecx
  shl    $0x2,%ecx
  cmp    %ecx,%esi
  setg   %cl
  test   %esi,%esi
  sete   %dil
  or     %dil,%cl
  jne    L676
  and    $0x1,%edx
  je     L462
L676:
  mov    0x58(%rsp),%rax
  lea    D37(%rip),%rdi
  movsd  (%rax),%xmm0
  mulsd  %xmm14,%xmm0
  movsd  %xmm0,(%rax)
  mov    $0x1,%eax
  call   <printf@plt>
  lea    D91(%rip),%rdi
  call   <puts@plt>
  cvttsd2si 0x60(%rsp),%edx
  movl   $0x0,(%r12)
  mov    0x0(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,0x0(%rbp)
  cmp    %edx,%eax
  jle    L253
  mov    0x90(%rsp),%rax
  mov    D109(%rip),%rdx
  mov    %rdx,0x10(%rax)
  mov    0x88(%rsp),%rax
  movl   $0x1,(%rax)
L253:
  add    $0x108,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L587:
  movsd  D74(%rip),%xmm3
  comisd %xmm3,%xmm2
  jbe    L287
  movsd  (%r9),%xmm4
  movsd  (%rdx),%xmm5
  andpd  %xmm0,%xmm4
  andpd  %xmm0,%xmm5
  comisd %xmm4,%xmm5
  jae    L464
L287:
  xor    %edx,%edx
L365:
  mov    0x10(%rsp),%rbx
  movsd  (%rbx),%xmm1
  andpd  %xmm0,%xmm1
  comisd %xmm3,%xmm1
  jbe    L239
  mov    0x28(%rsp),%rdi
  movsd  (%r11),%xmm2
  movsd  (%rdi),%xmm4
  andpd  %xmm0,%xmm2
  andpd  %xmm0,%xmm4
  comisd %xmm2,%xmm4
  jae    L694
L239:
  mov    0x20(%rsp),%rbx
  movsd  (%rbx),%xmm2
  andpd  %xmm0,%xmm2
  comisd %xmm3,%xmm2
  jbe    L200
  mov    0x18(%rsp),%rbx
  movsd  (%r8),%xmm4
  movsd  (%rbx),%xmm1
  andpd  %xmm0,%xmm4
  andpd  %xmm0,%xmm1
  comisd %xmm1,%xmm4
  jb     L200
  jmp    L432
  nopw   0x0(%rax,%rax,1)
L654:
  mov    $0x4,%r15d
  mov    $0x3,%edi
  mov    $0x2,%ebx
  movl   $0x1,0x54(%rsp)
  jmp    L466
  nopl   (%rax)
L462:
  test   %eax,%eax
  jne    L455
  mov    0x54(%rsp),%eax
  or     %r15d,%eax
  je     L628
  test   %r15d,%r15d
  je     L455
  mov    0x54(%rsp),%eax
  test   %eax,%eax
  je     L455
  mov    0x80(%rsp),%rax
  cmpl   $0x1,(%rax)
  je     L455
  lea    D46(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x58(%rsp),%rax
  movsd  D52(%rip),%xmm0
  mulsd  (%rax),%xmm0
  movsd  %xmm0,(%rax)
  jmp    L253
  nop
L628:
  mov    0x80(%rsp),%rax
  cmpl   $0x1,(%rax)
  je     L191
L455:
  add    $0x108,%rsp
  lea    D20(%rip),%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1060 <puts@plt>
  xchg   %ax,%ax
L310:
  mov    $0x3,%edi
  movl   $0x4,0x54(%rsp)
  mov    $0x2,%ebx
  mov    $0x1,%r13d
  jmp    L190
  nopl   (%rax)
L348:
  mov    0xb0(%rsp),%rcx
  movsd  0xa8(%rsp),%xmm1
  mulsd  (%rcx),%xmm1
  comisd %xmm1,%xmm0
  ja     L676
  jmp    L634
  nopl   0x0(%rax)
L694:
  comisd %xmm2,%xmm1
  jb     L239
L235:
  mov    0x98(%rsp),%rbx
  mov    $0x1,%edi
  movsd  D74(%rip),%xmm3
  movsd  (%rbx),%xmm2
  mulsd  %xmm13,%xmm2
  ucomisd %xmm2,%xmm1
  cmova  %edi,%edx
  cmp    %ecx,%esi
  jge    L339
  jmp    L239
  nopl   0x0(%rax)
L110:
  xor    %edx,%edx
  comisd %xmm1,%xmm2
  seta   %dl
  jmp    L602
  cs nopw 0x0(%rax,%rax,1)
L464:
  comisd %xmm4,%xmm2
  jb     L287
  xor    %edx,%edx
  comisd %xmm1,%xmm2
  seta   %dl
  jmp    L365
  nopl   0x0(%rax,%rax,1)
L329:
  mov    %edi,0x54(%rsp)
  mov    %ebx,%edi
  jmp    L219
  nopl   0x0(%rax,%rax,1)
L560:
  mov    %edi,0x54(%rsp)
  mov    %ebx,%edi
  mov    %r13d,%ebx
  jmp    L562
  xchg   %ax,%ax
L191:
  lea    D33(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x58(%rsp),%rax
  movsd  D135(%rip),%xmm2
  movsd  D48(%rip),%xmm1
  mulsd  (%rax),%xmm2
  movapd %xmm1,%xmm0
  cmplesd %xmm2,%xmm0
  andpd  %xmm0,%xmm1
  andnpd %xmm2,%xmm0
  orpd   %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  jmp    L253
```

tool_calls: name: disassemble_data
arguments: data_tag: D29
type: qword
name: disassemble_data
arguments: data_tag: D108
type: string
name: disassemble_data
arguments: data_tag: D74
type: f64
name: disassemble_data
arguments: data_tag: D37
type: string
name: disassemble_data
arguments: data_tag: D91
type: string
name: disassemble_data
arguments: data_tag: D109
type: f64
name: disassemble_data
arguments: data_tag: D46
type: string
name: disassemble_data
arguments: data_tag: D52
type: f64
name: disassemble_data
arguments: data_tag: D20
type: string
name: disassemble_data
arguments: data_tag: D33
type: string
name: disassemble_data
arguments: data_tag: D135
type: f64
name: disassemble_data
arguments: data_tag: D48
type: f64

tool: D29: 9223372036854775807

tool: D108:       flow network: convergence in gas iteration %d 



tool: D74: 1e+20

tool: D37: 
 network divergence; the under-relaxation parameter is decreased to %e


tool: D91:  the network iteration for the increment is reattempted


tool: D109: 0.25

tool: D46:       bad convergence progression --> *dtheta is decreased %d


tool: D52: 0.8

tool: D20:       no convergence


tool: D33:       good convergence --> *dtheta is increased %d


tool: D135: 1.2

tool: D48: 1

assistant: ```c
void checkconvnet(int *icutb, int *iin, double *cam1t, double *cam1f, double *cam1p, double *cam2t, double *cam2f, double *cam2p, double *camt, double *camf, double *camp, int *icntrl, double *dtheta, double *ctrl, double *cam1a, double *cam2a, double *cama, double *vamt, double *vamf, double *vamp, double *vama, double *qa, double *qamt, double *qamf, double *ramt, double *ramf, double *ramp, int *iplausi, int *ichannel) {
  int i0, ir, ip, ic, il, ig, ia, idivergence, iin_dyn, dyna_flag_1, dyna_flag_2;
  double c2t, c2f, c2p, c2a, c1t, c1f, c1p, a2t, a2f, a2p, a2a, a1t, a1f, a1p, qamp = 1., df, dc, db, dd, ran, can, rap, ea, cae, ral;
  i0 = ctrl[0];
  ir = ctrl[1];
  ip = ctrl[2];
  ic = ctrl[3];
  il = ctrl[4];
  ig = ctrl[5];
  ia = ctrl[7];
  df = ctrl[10];
  dc = ctrl[11];
  db = ctrl[12];
  dd = ctrl[16];
  ran = ctrl[18];
  can = ctrl[19];
  rap = ctrl[22];
  ea = ctrl[23];
  cae = ctrl[24];
  ral = ctrl[25];
  c1t = ctrl[32];
  c1f = ctrl[33];
  c1p = ctrl[34];
  c2t = ctrl[35];
  c2f = ctrl[36];
  c2p = ctrl[37];
  c2a = ctrl[38];
  a1t = ctrl[40];
  a1f = ctrl[41];
  a1p = ctrl[42];
  a2t = ctrl[43];
  a2f = ctrl[44], a2p = ctrl[45];
  a2a = ctrl[46];
  iin_dyn = 50;
  if (*iin % iin_dyn == 0) {
    dyna_flag_1 = 0;
    if (*camt * *cam1t >= 0 && *camt * *cam2t >= 0) {
      dyna_flag_1 = dyna_flag_1;
    } else {
      dyna_flag_1 = dyna_flag_1 + 1;
    }
    if (*camf * *cam1f >= 0 && *camf * *cam2f >= 0) {
      dyna_flag_1 = dyna_flag_1;
    } else {
      dyna_flag_1 = dyna_flag_1 + 1;
    }
    if (*camp * *cam1p >= 0 && *camp * *cam2p >= 0) {
      dyna_flag_1 = dyna_flag_1;
    } else {
      dyna_flag_1 = dyna_flag_1 + 1;
    }
    if (*cama * *cam1a >= 0 && *cama * *cam2a >= 0) {
      dyna_flag_1 = dyna_flag_1;
    } else {
      dyna_flag_1 = dyna_flag_1 + 1;
    }
    dyna_flag_2 = 0;
    if (fabs(*camt) <= fabs(*cam1t) && fabs(*cam1t) <= fabs(*cam2t)) {
      dyna_flag_2 = dyna_flag_2;
    } else {
      dyna_flag_2 = dyna_flag_2 + 1;
    }
    if (fabs(*camf) <= fabs(*cam1f) && fabs(*cam1f) <= fabs(*cam2f)) {
      dyna_flag_2 = dyna_flag_2;
    } else {
      dyna_flag_2 = dyna_flag_2 + 1;
    }
    if (fabs(*camp) <= fabs(*cam1p) && fabs(*cam1p) <= fabs(*cam2p)) {
      dyna_flag_2 = dyna_flag_2;
    } else {
      dyna_flag_2 = dyna_flag_2 + 1;
    }
    if (fabs(*cama) <= fabs(*cam1a) && fabs(*cam1a) <= fabs(*cam2a)) {
      dyna_flag_2 = dyna_flag_2;
    } else {
      dyna_flag_2 = dyna_flag_2 + 1;
    }
  }
  if (*ichannel == 1) {
    *ramt = 0.;
    *ramf = 0.;
    *ramp = 0.;
  }
  if ((fabs(*camt) <= c2t * *vamt) && (*ramt < c1t * *qamt) && (fabs(*camt) <= a2t) && (*ramt < a1t) && (fabs(*camf) <= c2f * *vamf) && (*ramf < c1f * *qamf) && (fabs(*camf) <= a2f) && (*ramf < a1f) && (fabs(*camp) <= c2p * *vamp) && (*ramp < c1p * qamp) && (fabs(*camp) < a2p) && (*ramp < a1p) && (fabs(*cama) <= c2a * *vama) && (fabs(*cama) <= a2a) && (*iplausi == 1) && (*iin > 3)) {
    printf("      flow network: convergence in gas iteration %"
           "d"
           " \n\n",
           *iin);
    *icntrl = 1;
    *icutb = 0;
  } else {
    idivergence = 0;
    if ((*iin >= 20 * i0) || (fabs(*camt) > 1.e20)) {
      if ((fabs(*cam1t) >= fabs(*cam2t)) && (fabs(*camt) >= fabs(*cam2t)) && (fabs(*camt) > c2t * *vamt)) {
        idivergence = 1;
      }
    }
    if ((*iin >= 20 * i0) || (fabs(*camf) > 1.e20)) {
      if ((fabs(*cam1f) >= fabs(*cam2f)) && (fabs(*camf) >= fabs(*cam2f)) && (fabs(*camf) > c2f * *vamf)) {
        idivergence = 1;
      }
    }
    if ((*iin >= 20 * i0) || (fabs(*camp) > 1.e20)) {
      if ((fabs(*cam1p) >= fabs(*cam2p)) && (fabs(*camp) >= fabs(*cam2p)) && (fabs(*camp) > c2p * *vamp)) {
        idivergence = 1;
      }
    }
    if ((*iin >= 20 * i0) || (fabs(*cama) > 1.e20)) {
      if ((fabs(*cam1a) >= fabs(*cam2a)) && (fabs(*cama) >= fabs(*cam2a)) && (fabs(*cama) > c2a * *vama)) {
        idivergence = 1;
      }
    }
    if (*iin > 20 * ic)
      idivergence = 1;
    if (*iin == 0)
      idivergence = 1;
    if (idivergence == 1) {
      *dtheta = *dtheta * df;
      printf("\n network divergence; the under-relaxation parameter is decreased to %e\n", *dtheta);
      printf(" the network iteration for the increment is reattempted\n\n");
      *iin = 0;
      (*icutb)++;
      if (*icutb > ia) {
        qa[2] = 0.25;
        *icntrl = 1;
      }
    } else {
      if (*iin % iin_dyn == 0) {
        if (dyna_flag_1 == 0 && dyna_flag_2 == 0 && *iplausi == 1) {
          printf("      good convergence --> *dtheta is increased %"
                 "d"
                 "\n",
                 *iin);
          *dtheta = *dtheta * (1.2);
          if (*dtheta >= 1) {
            *dtheta = 1.;
          }
        } else if (dyna_flag_1 != 0 && dyna_flag_2 != 0 && *iplausi != 1) {
          printf("      bad convergence progression --> *dtheta is decreased %"
                 "d"
                 "\n",
                 *iin);
          *dtheta = *dtheta * (0.8);
        } else {
          printf("      no convergence\n\n");
        }
      } else {
        printf("      no convergence\n\n");
      }
    }
  }
  return;
}
```