user: What is the c source code of the assembly code below?

```asm
<Riemann>:
  endbr64
  push   %r15
  push   %r14
  push   %rbx
  mov    %rdx,%rbx
  sub    $0xa0,%rsp
  movsd  0x8(%rsi),%xmm0
  movsd  (%rsi),%xmm5
  movsd  %xmm5,0x88(%rsp)
  movapd %xmm0,%xmm6
  movsd  D232(%rip),%xmm0
  divsd  %xmm5,%xmm6
  mulsd  %xmm5,%xmm0
  mulsd  %xmm6,%xmm0
  movsd  %xmm6,0x48(%rsp)
  mulsd  %xmm6,%xmm0
  movsd  %xmm0,0x80(%rsp)
  movapd %xmm0,%xmm7
  movsd  0x10(%rsi),%xmm0
  subsd  %xmm7,%xmm0
  mulsd  D111(%rip),%xmm0
  movapd %xmm0,%xmm6
  movsd  %xmm0,0x50(%rsp)
  movsd  D243(%rip),%xmm0
  mulsd  %xmm6,%xmm0
  pxor   %xmm6,%xmm6
  divsd  %xmm5,%xmm0
  ucomisd %xmm0,%xmm6
  ja     L65
  sqrtsd %xmm0,%xmm0
  movsd  %xmm0,0x58(%rsp)
L107:
  movsd  0x8(%rdi),%xmm0
  movsd  (%rdi),%xmm4
  movapd %xmm0,%xmm3
  movsd  D232(%rip),%xmm0
  movsd  %xmm4,0x70(%rsp)
  divsd  %xmm4,%xmm3
  mulsd  %xmm4,%xmm0
  mulsd  %xmm3,%xmm0
  movsd  %xmm3,0x30(%rsp)
  mulsd  %xmm3,%xmm0
  movapd %xmm0,%xmm5
  movsd  %xmm0,0x68(%rsp)
  movsd  0x10(%rdi),%xmm0
  subsd  %xmm5,%xmm0
  mulsd  D111(%rip),%xmm0
  movapd %xmm0,%xmm3
  movsd  %xmm0,0x40(%rsp)
  movsd  D243(%rip),%xmm0
  mulsd  %xmm3,%xmm0
  pxor   %xmm3,%xmm3
  divsd  %xmm4,%xmm0
  ucomisd %xmm0,%xmm3
  ja     L8
  sqrtsd %xmm0,%xmm0
  movsd  %xmm0,0x38(%rsp)
L206:
  movsd  0x40(%rsp),%xmm5
  movsd  D98(%rip),%xmm3
  movsd  0x50(%rsp),%xmm4
  mov    D91(%rip),%rax
  mulsd  %xmm5,%xmm3
  movapd %xmm5,%xmm6
  divsd  %xmm4,%xmm6
  movq   %rax,%xmm1
  divsd  %xmm4,%xmm3
  movapd %xmm6,%xmm0
  movsd  %xmm6,0x8(%rsp)
  movsd  %xmm3,(%rsp)
  call   <pow@plt>
  movsd  (%rsp),%xmm3
  mov    D91(%rip),%rax
  movq   %xmm0,%r14
  movq   %rax,%xmm1
  movapd %xmm3,%xmm0
  call   <pow@plt>
  movsd  0x38(%rsp),%xmm6
  movsd  (%rsp),%xmm3
  movsd  D381(%rip),%xmm8
  movsd  0x58(%rsp),%xmm4
  movapd %xmm0,%xmm1
  divsd  D243(%rip),%xmm4
  movapd %xmm6,%xmm5
  movapd %xmm3,%xmm9
  movsd  %xmm4,0x20(%rsp)
  addsd  %xmm6,%xmm5
  movsd  D111(%rip),%xmm6
  divsd  %xmm5,%xmm6
  movsd  %xmm5,0x78(%rsp)
  movsd  0x30(%rsp),%xmm5
  subsd  0x48(%rsp),%xmm5
  movq   %xmm5,%r15
  movsd  D141(%rip),%xmm5
  subsd  %xmm5,%xmm9
  mulsd  %xmm9,%xmm8
  mulsd  %xmm9,%xmm4
  addsd  %xmm5,%xmm8
  movapd %xmm4,%xmm2
  movsd  %xmm6,0x18(%rsp)
  pxor   %xmm6,%xmm6
  ucomisd %xmm8,%xmm6
  movsd  0x8(%rsp),%xmm6
  ja     L64
  movapd %xmm8,%xmm0
  sqrtsd %xmm0,%xmm0
L1:
  divsd  %xmm0,%xmm2
  movq   %r15,%xmm0
  movq   %r14,%xmm7
  mov    D91(%rip),%rax
  movsd  %xmm8,0x60(%rsp)
  movsd  %xmm9,0x28(%rsp)
  movsd  %xmm3,0x10(%rsp)
  movsd  %xmm6,(%rsp)
  subsd  %xmm2,%xmm0
  mulsd  0x18(%rsp),%xmm0
  addsd  %xmm5,%xmm0
  mulsd  %xmm1,%xmm0
  movq   %rax,%xmm1
  subsd  %xmm0,%xmm7
  movapd %xmm6,%xmm0
  movsd  %xmm7,0x8(%rsp)
  call   <pow@plt>
  mov    D91(%rip),%rax
  movsd  (%rsp),%xmm6
  movq   %xmm0,%r14
  movq   %rax,%xmm1
  movapd %xmm6,%xmm0
  call   <pow@plt>
  movsd  (%rsp),%xmm6
  mov    D141(%rip),%rax
  pxor   %xmm3,%xmm3
  movapd %xmm0,%xmm1
  movsd  0x20(%rsp),%xmm2
  movsd  0x8(%rsp),%xmm7
  movq   %rax,%xmm5
  movapd %xmm6,%xmm0
  movsd  0x28(%rsp),%xmm9
  movsd  0x60(%rsp),%xmm8
  subsd  %xmm5,%xmm0
  mulsd  %xmm0,%xmm2
  mulsd  D381(%rip),%xmm0
  addsd  %xmm5,%xmm0
  ucomisd %xmm0,%xmm3
  movsd  0x10(%rsp),%xmm3
  ja     L189
  sqrtsd %xmm0,%xmm0
L113:
  divsd  %xmm0,%xmm2
  movq   %r15,%xmm0
  movq   %r14,%xmm4
  subsd  %xmm2,%xmm0
  mulsd  0x18(%rsp),%xmm0
  movapd %xmm6,%xmm2
  addsd  %xmm5,%xmm0
  mulsd  %xmm1,%xmm0
  subsd  %xmm0,%xmm4
  movapd %xmm3,%xmm0
  subsd  %xmm6,%xmm0
  andpd  D386(%rip),%xmm0
  comisd D8(%rip),%xmm0
  jbe    L210
  movsd  %xmm6,0x28(%rsp)
  jmp    L95
  nopl   0x0(%rax)
L246:
  movapd %xmm1,%xmm4
L95:
  movapd %xmm2,%xmm0
  movapd %xmm4,%xmm1
  mov    D91(%rip),%rax
  movsd  %xmm2,0x8(%rsp)
  subsd  %xmm3,%xmm0
  subsd  %xmm7,%xmm1
  movsd  %xmm4,0x10(%rsp)
  mulsd  %xmm4,%xmm0
  divsd  %xmm1,%xmm0
  movq   %rax,%xmm1
  subsd  %xmm0,%xmm2
  movsd  0x28(%rsp),%xmm0
  movsd  %xmm2,(%rsp)
  call   <pow@plt>
  mov    D91(%rip),%rax
  movsd  (%rsp),%xmm2
  movq   %xmm0,%r14
  movq   %rax,%xmm1
  movapd %xmm2,%xmm0
  call   <pow@plt>
  movsd  (%rsp),%xmm2
  mov    D141(%rip),%rax
  pxor   %xmm6,%xmm6
  movapd %xmm0,%xmm1
  movsd  0x20(%rsp),%xmm7
  movsd  0x8(%rsp),%xmm3
  movq   %rax,%xmm5
  movapd %xmm2,%xmm0
  movsd  0x10(%rsp),%xmm4
  subsd  %xmm5,%xmm0
  mulsd  %xmm0,%xmm7
  mulsd  D381(%rip),%xmm0
  addsd  %xmm5,%xmm0
  ucomisd %xmm0,%xmm6
  ja     L26
  sqrtsd %xmm0,%xmm0
L57:
  divsd  %xmm0,%xmm7
  movq   %r15,%xmm0
  subsd  %xmm7,%xmm0
  mulsd  0x18(%rsp),%xmm0
  movapd %xmm4,%xmm7
  addsd  %xmm5,%xmm0
  mulsd  %xmm1,%xmm0
  movq   %r14,%xmm1
  subsd  %xmm0,%xmm1
  movapd %xmm3,%xmm0
  subsd  %xmm2,%xmm0
  andpd  D386(%rip),%xmm0
  comisd D8(%rip),%xmm0
  ja     L246
  movsd  D381(%rip),%xmm8
  movapd %xmm3,%xmm9
  subsd  %xmm5,%xmm9
  mulsd  %xmm9,%xmm8
  addsd  %xmm5,%xmm8
L210:
  pxor   %xmm6,%xmm6
  ucomisd %xmm8,%xmm6
  ja     L181
  movapd %xmm8,%xmm4
  sqrtsd %xmm4,%xmm4
L77:
  movsd  D425(%rip),%xmm1
  movapd %xmm3,%xmm0
  addsd  %xmm1,%xmm0
  mulsd  %xmm3,%xmm1
  mulsd  %xmm3,%xmm0
  addsd  %xmm5,%xmm1
  pxor   %xmm5,%xmm5
  divsd  %xmm1,%xmm0
  ucomisd %xmm0,%xmm5
  ja     L222
  movapd %xmm0,%xmm2
  sqrtsd %xmm2,%xmm2
L155:
  pxor   %xmm7,%xmm7
  ucomisd %xmm8,%xmm7
  ja     L177
  sqrtsd %xmm8,%xmm8
L236:
  movsd  0x30(%rsp),%xmm6
  movsd  0x38(%rsp),%xmm7
  pxor   %xmm5,%xmm5
  movapd %xmm6,%xmm0
  subsd  %xmm7,%xmm0
  comisd %xmm5,%xmm0
  jbe    L131
  movsd  0x70(%rsp),%xmm5
  movsd  0x68(%rsp),%xmm1
  movapd %xmm6,%xmm3
  mulsd  %xmm6,%xmm1
  movapd %xmm5,%xmm2
  mulsd  %xmm7,%xmm5
  mulsd  %xmm6,%xmm2
  movapd %xmm5,%xmm0
  mulsd  %xmm7,%xmm0
  mulsd  %xmm2,%xmm3
  addsd  0x40(%rsp),%xmm3
  mulsd  %xmm6,%xmm0
  divsd  D111(%rip),%xmm0
  addsd  %xmm1,%xmm0
L176:
  movsd  %xmm2,(%rbx)
  movsd  %xmm3,0x8(%rbx)
  movsd  %xmm0,0x10(%rbx)
  add    $0xa0,%rsp
  pop    %rbx
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L131:
  divsd  %xmm4,%xmm9
  movsd  0x78(%rsp),%xmm6
  movsd  0x30(%rsp),%xmm7
  pxor   %xmm5,%xmm5
  movapd %xmm6,%xmm4
  divsd  D111(%rip),%xmm4
  addsd  %xmm7,%xmm4
  mulsd  0x20(%rsp),%xmm9
  addsd  0x48(%rsp),%xmm9
  subsd  %xmm9,%xmm4
  mulsd  D111(%rip),%xmm4
  movapd %xmm9,%xmm0
  mulsd  D232(%rip),%xmm4
  subsd  %xmm4,%xmm0
  comisd %xmm5,%xmm0
  ja     L79
  mulsd  0x50(%rsp),%xmm3
  pxor   %xmm6,%xmm6
  movsd  D243(%rip),%xmm1
  comisd %xmm6,%xmm9
  mulsd  %xmm3,%xmm1
  jbe    L266
  movapd %xmm4,%xmm0
  movapd %xmm9,%xmm2
  mulsd  %xmm4,%xmm0
  divsd  %xmm0,%xmm1
  movapd %xmm9,%xmm0
  mulsd  %xmm1,%xmm2
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm3
  movsd  D232(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  mulsd  %xmm4,%xmm1
  mulsd  %xmm9,%xmm0
  mulsd  %xmm4,%xmm1
  mulsd  %xmm9,%xmm0
  mulsd  %xmm9,%xmm1
  divsd  D111(%rip),%xmm1
  mulsd  %xmm9,%xmm0
  addsd  %xmm1,%xmm0
  jmp    L176
  nopl   0x0(%rax,%rax,1)
L266:
  movsd  0x58(%rsp),%xmm7
  pxor   %xmm6,%xmm6
  mulsd  %xmm7,%xmm8
  addsd  0x48(%rsp),%xmm8
  comisd %xmm6,%xmm8
  jbe    L188
  mulsd  %xmm2,%xmm7
  movapd %xmm9,%xmm4
  movapd %xmm7,%xmm2
  mulsd  %xmm7,%xmm2
  divsd  %xmm2,%xmm1
  movapd %xmm9,%xmm2
  mulsd  %xmm1,%xmm2
  mulsd  %xmm2,%xmm4
  addsd  %xmm4,%xmm3
  movsd  D232(%rip),%xmm4
  mulsd  %xmm1,%xmm4
  mulsd  %xmm7,%xmm1
  mulsd  %xmm9,%xmm4
  mulsd  %xmm7,%xmm1
  mulsd  %xmm9,%xmm4
  mulsd  %xmm9,%xmm1
  divsd  D111(%rip),%xmm1
  mulsd  %xmm9,%xmm4
  addsd  %xmm1,%xmm4
  movapd %xmm4,%xmm0
  jmp    L176
  nopl   0x0(%rax)
L79:
  movsd  D111(%rip),%xmm4
  mov    D91(%rip),%rax
  mulsd  %xmm7,%xmm4
  movq   %rax,%xmm1
  addsd  %xmm6,%xmm4
  divsd  D211(%rip),%xmm4
  movapd %xmm4,%xmm0
  movsd  %xmm4,(%rsp)
  divsd  0x38(%rsp),%xmm0
  call   <pow@plt>
  movsd  (%rsp),%xmm4
  pxor   %xmm5,%xmm5
  movsd  0x40(%rsp),%xmm3
  comisd %xmm4,%xmm5
  mulsd  %xmm0,%xmm3
  ja     L159
  comisd %xmm3,%xmm5
  ja     L159
L207:
  movsd  D243(%rip),%xmm1
  movapd %xmm4,%xmm0
  movapd %xmm4,%xmm2
  movapd %xmm4,%xmm5
  mulsd  %xmm4,%xmm0
  mulsd  %xmm3,%xmm1
  divsd  %xmm0,%xmm1
  movsd  D232(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  mulsd  %xmm1,%xmm2
  mulsd  %xmm4,%xmm0
  mulsd  %xmm2,%xmm5
  mulsd  %xmm4,%xmm0
  addsd  %xmm5,%xmm3
  mulsd  %xmm4,%xmm5
  divsd  D111(%rip),%xmm5
  mulsd  %xmm4,%xmm0
  addsd  %xmm5,%xmm0
  jmp    L176
L159:
  lea    D42(%rip),%rdi
  movsd  %xmm3,0x8(%rsp)
  movsd  %xmm4,(%rsp)
  call   <printf@plt>
  movsd  0x8(%rsp),%xmm3
  movsd  (%rsp),%xmm4
  jmp    L207
L188:
  movsd  0x88(%rsp),%xmm7
  movsd  0x58(%rsp),%xmm6
  movsd  0x80(%rsp),%xmm1
  movsd  0x48(%rsp),%xmm5
  movapd %xmm7,%xmm2
  mulsd  %xmm6,%xmm7
  movapd %xmm5,%xmm3
  mulsd  %xmm5,%xmm2
  mulsd  %xmm5,%xmm1
  movapd %xmm7,%xmm0
  mulsd  %xmm6,%xmm0
  mulsd  %xmm2,%xmm3
  addsd  0x50(%rsp),%xmm3
  mulsd  %xmm5,%xmm0
  divsd  D111(%rip),%xmm0
  addsd  %xmm1,%xmm0
  jmp    L176
L26:
  movsd  %xmm3,0x90(%rsp)
  movsd  %xmm2,0x60(%rsp)
  movsd  %xmm4,0x10(%rsp)
  movsd  %xmm7,0x8(%rsp)
  movsd  %xmm1,(%rsp)
  call   <sqrt@plt>
  movsd  0x60(%rsp),%xmm2
  movsd  (%rsp),%xmm1
  mov    D141(%rip),%rax
  movsd  0x10(%rsp),%xmm4
  movsd  0x90(%rsp),%xmm3
  movsd  0x8(%rsp),%xmm7
  movq   %rax,%xmm5
  jmp    L57
L65:
  mov    %rdi,(%rsp)
  call   <sqrt@plt>
  mov    (%rsp),%rdi
  movsd  %xmm0,0x58(%rsp)
  jmp    L107
L181:
  movapd %xmm8,%xmm0
  movsd  %xmm9,0x10(%rsp)
  movsd  %xmm3,0x8(%rsp)
  movsd  %xmm8,(%rsp)
  call   <sqrt@plt>
  mov    D141(%rip),%rax
  movsd  0x10(%rsp),%xmm9
  movsd  0x8(%rsp),%xmm3
  movsd  (%rsp),%xmm8
  movapd %xmm0,%xmm4
  movq   %rax,%xmm5
  jmp    L77
L177:
  movapd %xmm8,%xmm0
  movsd  %xmm9,0x18(%rsp)
  movsd  %xmm3,0x10(%rsp)
  movsd  %xmm2,0x8(%rsp)
  movsd  %xmm4,(%rsp)
  call   <sqrt@plt>
  movsd  0x10(%rsp),%xmm3
  movsd  0x8(%rsp),%xmm2
  movsd  0x18(%rsp),%xmm9
  movsd  (%rsp),%xmm4
  movapd %xmm0,%xmm8
  jmp    L236
L222:
  movsd  %xmm8,0x18(%rsp)
  movsd  %xmm9,0x10(%rsp)
  movsd  %xmm3,0x8(%rsp)
  movsd  %xmm4,(%rsp)
  call   <sqrt@plt>
  movsd  0x8(%rsp),%xmm3
  movsd  (%rsp),%xmm4
  movsd  0x18(%rsp),%xmm8
  movsd  0x10(%rsp),%xmm9
  movapd %xmm0,%xmm2
  jmp    L155
L189:
  movsd  %xmm8,0x98(%rsp)
  movsd  %xmm9,0x90(%rsp)
  movsd  %xmm7,0x60(%rsp)
  movsd  %xmm3,0x28(%rsp)
  movsd  %xmm6,0x10(%rsp)
  movsd  %xmm2,0x8(%rsp)
  movsd  %xmm1,(%rsp)
  call   <sqrt@plt>
  movsd  0x60(%rsp),%xmm7
  movsd  (%rsp),%xmm1
  mov    D141(%rip),%rax
  movsd  0x28(%rsp),%xmm3
  movsd  0x98(%rsp),%xmm8
  movsd  0x10(%rsp),%xmm6
  movsd  0x90(%rsp),%xmm9
  movsd  0x8(%rsp),%xmm2
  movq   %rax,%xmm5
  jmp    L113
L64:
  movsd  %xmm0,0x8(%rsp)
  movapd %xmm8,%xmm0
  movsd  %xmm9,0x90(%rsp)
  movsd  %xmm3,0x60(%rsp)
  movsd  %xmm6,0x28(%rsp)
  movsd  %xmm8,(%rsp)
  movsd  %xmm4,0x10(%rsp)
  call   <sqrt@plt>
  mov    D141(%rip),%rax
  movsd  0x90(%rsp),%xmm9
  movsd  0x60(%rsp),%xmm3
  movsd  0x28(%rsp),%xmm6
  movsd  0x10(%rsp),%xmm2
  movsd  0x8(%rsp),%xmm1
  movq   %rax,%xmm5
  movsd  (%rsp),%xmm8
  jmp    L1
L8:
  call   <sqrt@plt>
  movsd  %xmm0,0x38(%rsp)
  jmp    L206
```

tool_calls: name: parse_data
arguments: data_label: D232
type: f64
name: parse_data
arguments: data_label: D111
type: byte[8]
name: parse_data
arguments: data_label: D243
type: f64
name: parse_data
arguments: data_label: D98
type: f64
name: parse_data
arguments: data_label: D91
type: byte[8]
name: parse_data
arguments: data_label: D381
type: byte[8]
name: parse_data
arguments: data_label: D141
type: f64
name: parse_data
arguments: data_label: D386
type: qword[2]
name: parse_data
arguments: data_label: D8
type: byte[16]
name: parse_data
arguments: data_label: D425
type: byte[8]
name: parse_data
arguments: data_label: D211
type: byte[8]
name: parse_data
arguments: data_label: D42
type: string

tool: D232: 0.5

tool: {"D111": [0x98,0x99,0x99,0x99,0x99,0x99,0xd9,0x3f]}

tool: D243: 1.4

tool: D98: 0.001

tool: {"D91": [0x01,0x00,0x00,0x00,0x00,0x00,0x1c,0x40]}

tool: {"D381": [0xdc,0xb6,0x6d,0xdb,0xb6,0x6d,0xeb,0x3f]}

tool: D141: 1

tool: {"D386": [0x7fffffffffffffff,0x0000000000000000]}

tool: {"D8": [0xbb,0xbd,0xd7,0xd9,0xdf,0x7c,0xdb,0x3d,0x01,0x00,0x00,0x00,0x00,0x00,0x18,0x40]}

tool: {"D425": [0x01,0x00,0x00,0x00,0x00,0x00,0x18,0x40]}

tool: {"D211": [0x33,0x33,0x33,0x33,0x33,0x33,0x03,0x40]}

tool: D42: Negative a or p in Riemann

assistant: ```c
void Riemann(double *U4, double *U1, double *F) {
  const double gamma = 1.4;
  const double g1 = (2 * gamma) / (gamma - 1);
  const double g2 = (gamma + 1) / (2 * gamma);
  const double g3 = (gamma + 1) / (gamma - 1);
  const double tol = 1e-10;
  int i;
  double rho1, u1, p1, a1;
  rho1 = U1[0];
  u1 = U1[1] / rho1;
  p1 = (U1[2] - 0.5 * rho1 * u1 * u1) * (gamma - 1.0);
  a1 = sqrt(gamma * p1 / rho1);
  double rho4, u4, p4, a4;
  rho4 = U4[0];
  u4 = U4[1] / rho4;
  p4 = (U4[2] - 0.5 * rho4 * u4 * u4) * (gamma - 1.0);
  a4 = sqrt(gamma * p4 / rho4);
  double x, y, fx, fy, z, fz;
  x = 0.001 * p4 / p1;
  y = 1.0 * p4 / p1;
  fx = pow(p4 / p1, g1) - pow(x, g1) * (1 + ((gamma - 1) / (2 * a4)) * (u4 - u1 - (a1 / gamma) * (x - 1) / sqrt(g2 * (x - 1) + 1)));
  fy = pow(p4 / p1, g1) - pow(y, g1) * (1 + ((gamma - 1) / (2 * a4)) * (u4 - u1 - (a1 / gamma) * (y - 1) / sqrt(g2 * (y - 1) + 1)));
  while (fabs(x - y) > tol) {
    z = y - fy * (y - x) / (fy - fx);
    fz = pow(p4 / p1, g1) - pow(z, g1) * (1 + ((gamma - 1) / (2 * a4)) * (u4 - u1 - (a1 / gamma) * (z - 1) / sqrt(g2 * (z - 1) + 1)));
    x = y;
    fx = fy;
    y = z;
    fy = fz;
  }
  double rho2, u2, p2, a2;
  p2 = p1 * x;
  u2 = u1 + (a1 / gamma) * ((x - 1) / sqrt(g2 * (x - 1) + 1));
  a2 = a1 * sqrt(x * (g3 + x) / (1 + g3 * x));
  rho2 = gamma * p2 / (a2 * a2);
  double rho3, u3, p3, a3;
  p3 = p2;
  u3 = u2;
  a3 = (u4 + 2.0 * a4 / (gamma - 1) - u3) * (gamma - 1) / 2.0;
  rho3 = gamma * p3 / (a3 * a3);
  double s1, s2, s3, s4;
  s1 = u1 + a1 * sqrt(g2 * (x - 1) + 1);
  s2 = u2;
  s3 = u3 - a3;
  s4 = u4 - a4;
  double f1, f2, f3;
  double rho, a, u, p;
  if (s4 > 0) {
    f1 = rho4 * u4;
    f2 = rho4 * u4 * u4 + p4;
    f3 = 0.5 * rho4 * u4 * u4 * u4 + rho4 * a4 * a4 * u4 / (gamma - 1.0);
  } else if (s3 > 0) {
    u = ((gamma - 1.0) * u4 + 2.0 * a4) / (gamma + 1.0);
    a = u;
    p = p4 * pow(a / a4, 2.0 * gamma / (gamma - 1.0));
    if (a < 0 || p < 0) {
      printf("Negative a or p in Riemann");
    }
    rho = gamma * p / (a * a);
    f1 = rho * u;
    f2 = rho * u * u + p;
    f3 = 0.5 * rho * u * u * u + rho * a * a * u / (gamma - 1.0);
  } else if (s2 > 0) {
    f1 = rho3 * u3;
    f2 = rho3 * u3 * u3 + p3;
    f3 = 0.5 * rho3 * u3 * u3 * u3 + rho3 * a3 * a3 * u3 / (gamma - 1.0);
  } else if (s1 > 0) {
    f1 = rho2 * u2;
    f2 = rho2 * u2 * u2 + p2;
    f3 = 0.5 * rho2 * u2 * u2 * u2 + rho2 * a2 * a2 * u2 / (gamma - 1.0);
  } else {
    f1 = rho1 * u1;
    f2 = rho1 * u1 * u1 + p1;
    f3 = 0.5 * rho1 * u1 * u1 * u1 + rho1 * a1 * a1 * u1 / (gamma - 1.0);
  }
  F[0] = f1;
  F[1] = f2;
  F[2] = f3;
}
```