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

```asm
<test1>:
  endbr64
  push   %r15
  lea    D41(%rip),%rsi
  xor    %edi,%edi
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x1000,%edi
  xor    %eax,%eax
  call   <shm_create@plt>
  mov    $0x1000,%edi
  mov    %eax,%ebp
  xor    %eax,%eax
  call   <shm_create@plt>
  mov    $0x1000,%edi
  mov    %eax,%r12d
  xor    %eax,%eax
  call   <shm_create@plt>
  mov    $0x1000,%edi
  mov    %eax,%r13d
  xor    %eax,%eax
  call   <shm_create@plt>
  mov    %eax,%r14d
  mov    %ebp,%eax
  or     %r12d,%eax
  or     %r13d,%eax
  or     %r14d,%eax
  jns    L204
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L143
  add    $0x38,%rsp
  lea    D27(%rip),%rsi
  mov    $0x1,%edi
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    10b0 <printf@plt>
  nopl   (%rax)
L204:
  lea    0x8(%rsp),%r15
  xor    %eax,%eax
  mov    %ebp,%edi
  mov    %r15,%rsi
  call   <shm_get@plt>
  test   %eax,%eax
  js     L56
  xor    %eax,%eax
  lea    0x10(%rsp),%rsi
  mov    %r12d,%edi
  call   <shm_get@plt>
  test   %eax,%eax
  js     L56
  lea    0x18(%rsp),%rbx
  xor    %eax,%eax
  mov    %r13d,%edi
  mov    %rbx,%rsi
  call   <shm_get@plt>
  test   %eax,%eax
  js     L56
  mov    %ebp,%edi
  xor    %eax,%eax
  call   <shm_close@plt>
  lea    0x20(%rsp),%rsi
  mov    %r14d,%edi
  xor    %eax,%eax
  call   <shm_get@plt>
  mov    0x20(%rsp),%rax
  mov    0x10(%rsp),%rdx
  cmp    %rdx,%rax
  jae    L133
  mov    0x18(%rsp),%rcx
  cmp    %rcx,%rax
  jae    L133
  cmp    %rcx,%rdx
  jae    L133
  mov    $0x1000,%edi
  xor    %eax,%eax
  call   <shm_create@plt>
  mov    %eax,%ebp
  test   %eax,%eax
  js     L197
  mov    %eax,%edi
  mov    %r15,%rsi
  xor    %eax,%eax
  call   <shm_get@plt>
  test   %eax,%eax
  js     L56
  mov    0x10(%rsp),%rax
  cmp    %rax,0x20(%rsp)
  jae    L133
  mov    0x18(%rsp),%rdx
  cmp    %rdx,%rax
  jae    L133
  cmp    0x8(%rsp),%rdx
  jae    L133
  mov    %r12d,%edi
  xor    %eax,%eax
  call   <shm_close@plt>
  mov    %r13d,%edi
  xor    %eax,%eax
  call   <shm_close@plt>
  mov    $0x1000,%edi
  xor    %eax,%eax
  call   <shm_create@plt>
  mov    %eax,%r12d
  test   %eax,%eax
  js     L197
  mov    %eax,%edi
  mov    %rbx,%rsi
  xor    %eax,%eax
  call   <shm_get@plt>
  test   %eax,%eax
  js     L56
  mov    0x18(%rsp),%rax
  cmp    %rax,0x20(%rsp)
  jae    L133
  cmp    0x8(%rsp),%rax
  jae    L133
  mov    %ebp,%edi
  xor    %eax,%eax
  call   <shm_close@plt>
  mov    %r12d,%edi
  xor    %eax,%eax
  call   <shm_close@plt>
  mov    %r14d,%edi
  xor    %eax,%eax
  call   <shm_close@plt>
  lea    D53(%rip),%rsi
  xor    %edi,%edi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L108
  nopl   0x0(%rax)
L56:
  lea    D54(%rip),%rsi
  xor    %edi,%edi
  xor    %eax,%eax
  call   <printf@plt>
L108:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L143
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nop
L133:
  lea    D33(%rip),%rsi
  mov    $0x1,%edi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L108
  nopl   (%rax)
L197:
  lea    D30(%rip),%rsi
  mov    $0x1,%edi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L108
L143:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_tag: D41
type_infered: string
name: parse_data
arguments: data_tag: D27
type_infered: string
name: parse_data
arguments: data_tag: D53
type_infered: string
name: parse_data
arguments: data_tag: D54
type_infered: string
name: parse_data
arguments: data_tag: D33
type_infered: string
name: parse_data
arguments: data_tag: D30
type_infered: string

tool: D41: Executing test1


tool: D27: ****Error creating shared memory blocks*****


tool: D53: End Executing test1


tool: D54: error getting block


tool: D33: ****Error when in alloc orden*****


tool: D30: ****Error recreating shared memory blocks*****


assistant: ```c
void test1() {
  int block1, block2, block3, block4;
  void *addr1;
  void *addr2;
  void *addr3;
  void *addr4;
  printf(0, "Executing test1\n");
  block1 = shm_create(4096);
  block2 = shm_create(4096);
  block3 = shm_create(4096);
  block4 = shm_create(4096);
  if (block1 < 0 || block2 < 0 || block3 < 0 || block4 < 0) {
    printf(1, "****Error creating shared memory blocks*****\n");
    return;
  }
  if (shm_get(block1, &addr1) < 0) {
    printf(0, "error getting block\n");
    return;
  }
  if (shm_get(block2, &addr2) < 0) {
    printf(0, "error getting block\n");
    return;
  }
  if (shm_get(block3, &addr3) < 0) {
    printf(0, "error getting block\n");
    return;
  }
  shm_close(block1);
  shm_get(block4, &addr4);
  if (addr4 >= addr2 || addr4 >= addr3) {
    printf(1, "****Error when in alloc orden*****\n");
    return;
  }
  if (!(addr4 < addr2 && addr2 < addr3)) {
    printf(1, "****Error when in alloc orden*****\n");
    return;
  }
  if ((block1 = shm_create(4096)) < 0) {
    printf(1, "****Error recreating shared memory blocks*****\n");
    return;
  }
  if (shm_get(block1, &addr1) < 0) {
    printf(0, "error getting block\n");
    return;
  }
  if (!(addr4 < addr2 && addr2 < addr3 && addr3 < addr1)) {
    printf(1, "****Error when in alloc orden*****\n");
    return;
  }
  shm_close(block2);
  shm_close(block3);
  if ((block3 = shm_create(4096)) < 0) {
    printf(1, "****Error recreating shared memory blocks*****\n");
    return;
  }
  if (shm_get(block3, &addr3) < 0) {
    printf(0, "error getting block\n");
    return;
  }
  if (!(addr4 < addr3 && addr3 < addr1)) {
    printf(1, "****Error when in alloc orden*****\n");
    return;
  }
  shm_close(block1);
  shm_close(block3);
  shm_close(block4);
  printf(0, "End Executing test1\n");
}
```