user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movsd  D18(%rip),%xmm0
  movsd  %xmm0,-0x20(%rbp)
  lea    D119(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
L16:
  mov    -0x20(%rbp),%rax
  movq   %rax,%xmm0
  lea    D6(%rip),%rax
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  lea    D16(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D143(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D108(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    -0x24(%rbp),%rax
  mov    %rax,%rsi
  lea    D107(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    -0x24(%rbp),%eax
  cmp    $0x1,%eax
  jne    L38
  lea    D44(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    -0x20(%rbp),%rax
  mov    %rax,%rsi
  lea    D25(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  jmp    L41
L38:
  mov    -0x24(%rbp),%eax
  cmp    $0x2,%eax
  jne    L60
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x10(%rbp)
L10:
  lea    D13(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    -0x18(%rbp),%rax
  mov    %rax,%rsi
  lea    D25(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  movsd  -0x18(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  comisd %xmm1,%xmm0
  jb     L106
  movsd  -0x18(%rbp),%xmm0
  movsd  -0x10(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  jmp    L61
L106:
  mov    -0x10(%rbp),%rax
  movq   %rax,%xmm0
  lea    D4(%rip),%rax
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  movsd  -0x20(%rbp),%xmm0
  mulsd  -0x10(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  lea    D105(%rip),%rax
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
L61:
  movsd  -0x18(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  comisd %xmm1,%xmm0
  jae    L10
  jmp    L41
L60:
  mov    -0x24(%rbp),%eax
  cmp    $0x3,%eax
  jne    L93
  lea    D149(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  jmp    L41
L93:
  lea    D140(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
L41:
  mov    -0x24(%rbp),%eax
  cmp    $0x3,%eax
  jne    L16
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L74
  call   <__stack_chk_fail@plt>
L74:
  leave
  ret
```

tool_calls: name: read_data
arguments: data_label: D18
data_type: f64
name: read_data
arguments: data_label: D119
data_type: string
name: read_data
arguments: data_label: D6
data_type: string
name: read_data
arguments: data_label: D16
data_type: string
name: read_data
arguments: data_label: D143
data_type: string
name: read_data
arguments: data_label: D108
data_type: string
name: read_data
arguments: data_label: D107
data_type: string
name: read_data
arguments: data_label: D44
data_type: string
name: read_data
arguments: data_label: D25
data_type: string
name: read_data
arguments: data_label: D13
data_type: string
name: read_data
arguments: data_label: D4
data_type: string
name: read_data
arguments: data_label: D105
data_type: string
name: read_data
arguments: data_label: D149
data_type: string
name: read_data
arguments: data_label: D140
data_type: string

tool: D18: 1

tool: D119: Your shopping assistant

tool: D6: 
1. Set exchange rate in SEK (current rate: %.2f)

tool: D16: 
2. Read prices in the foreign currency

tool: D143: 
3. End

tool: D108: 
Give your choice (1 - 3): 

tool: D107: %d

tool: D44: Give exchange rate: 

tool: D25: %lf

tool: D13: Give price (finish with < 0): 

tool: D4: 
Sum in foreign currency: %.2f

tool: D105: 
Sum in SEK: %.2f


tool: D149: End of program!


tool: D140: Not a valid choice!

assistant: ```c
int main() {
  int menuSelection;
  double currencyRate = 1.0;
  printf("Your shopping assistant\n");
  do {
    printf("\n1. Set exchange rate in SEK (current rate: %.2f)", currencyRate);
    printf("\n2. Read prices in the foreign currency");
    printf("\n3. End\n");
    printf("\nGive your choice (1 - 3): ");
    scanf("%d", &menuSelection);
    printf("\n");
    if (menuSelection == 1) {
      printf("Give exchange rate: ");
      scanf("%lf", &currencyRate);
    } else if (menuSelection == 2) {
      double priceSum = 0;
      double price;
      do {
        printf("Give price (finish with < 0): ");
        scanf("%lf", &price);
        if (price >= 0) {
          priceSum = priceSum + price;
        } else {
          printf("\nSum in foreign currency: %.2f", priceSum);
          printf("\nSum in SEK: %.2f\n", (priceSum * currencyRate));
        }
      } while (price >= 0);
    } else if (menuSelection == 3) {
      printf("End of program!\n\n");
    } else {
      printf("Not a valid choice!\n");
    }
  } while (menuSelection != 3);
}
```