user: Please show me the C implementation that matches the assembly code listed below:

```asm
<printJpegStream>:
  endbr64
  push   %r15
  lea    D22(%rip),%r15
  push   %r14
  push   %r13
  lea    D48(%rip),%r13
  push   %r12
  lea    D36(%rip),%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x8,%rsp
L146:
  lea    D75(%rip),%r14
L43:
  mov    %rbp,%rdi
  call   <feof@plt>
  test   %eax,%eax
  jne    L165
L101:
  mov    %rbp,%rdi
  call   <fgetc@plt>
  cmp    $0xff,%eax
  jne    L16
  mov    %rbp,%rdi
  call   <fgetc@plt>
  mov    %eax,%ebx
  lea    -0xc0(%rax),%eax
  cmp    $0x20,%eax
  ja     L72
  movslq (%r12,%rax,4),%rax
  add    %r12,%rax
  notrack jmp *%rax
  nop
L72:
  mov    %ebx,%esi
  mov    %r13,%rdi
  xor    %eax,%eax
  sub    $0xd8,%ebx
  call   <printf@plt>
  cmp    $0x1,%ebx
  ja     L150
  mov    %rbp,%rdi
  call   <feof@plt>
  test   %eax,%eax
  je     L101
L165:
  pop    %rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nop
  lea    D116(%rip),%rdi
  call   <puts@plt>
  nopl   0x0(%rax)
L150:
  mov    %rbp,%rdi
  call   <fgetc@plt>
  mov    %rbp,%rdi
  mov    %eax,%ebx
  call   <fgetc@plt>
  shl    $0x8,%ebx
  lea    D46(%rip),%rdi
  add    %eax,%ebx
  xor    %eax,%eax
  mov    %ebx,%esi
  sub    $0x2,%ebx
  call   <printf@plt>
  test   %ebx,%ebx
  jle    L146
  nopw   0x0(%rax,%rax,1)
L51:
  mov    %rbp,%rdi
  call   <fgetc@plt>
  sub    $0x1,%ebx
  je     L146
  mov    %rbp,%rdi
  call   <fgetc@plt>
  sub    $0x1,%ebx
  jne    L51
  jmp    L146
  nopl   0x0(%rax,%rax,1)
  lea    D103(%rip),%rdi
  call   <puts@plt>
  jmp    L150
  xchg   %ax,%ax
  lea    D27(%rip),%rdi
L11:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1080 <puts@plt>
  nopw   0x0(%rax,%rax,1)
  mov    %r15,%rdi
  call   <puts@plt>
  jmp    L43
  nopl   (%rax)
  mov    %r14,%rdi
  call   <puts@plt>
  jmp    L43
  nopl   (%rax)
  lea    D32(%rip),%rdi
  call   <puts@plt>
  jmp    L150
  nopl   0x0(%rax)
  lea    D110(%rip),%rdi
  call   <puts@plt>
  jmp    L150
  nopl   0x0(%rax)
  lea    D100(%rip),%rdi
  call   <puts@plt>
  jmp    L150
  nopl   0x0(%rax)
  lea    D83(%rip),%rdi
  call   <puts@plt>
  jmp    L150
  nopl   0x0(%rax)
L16:
  lea    D30(%rip),%rdi
  jmp    L11
```

tool_calls: name: disassemble_data
arguments: tag: D22
type: string
name: disassemble_data
arguments: tag: D48
type: string
name: disassemble_data
arguments: tag: D75
type: string
name: disassemble_data
arguments: tag: D116
type: string
name: disassemble_data
arguments: tag: D46
type: string
name: disassemble_data
arguments: tag: D103
type: string
name: disassemble_data
arguments: tag: D27
type: string
name: disassemble_data
arguments: tag: D32
type: string
name: disassemble_data
arguments: tag: D110
type: string
name: disassemble_data
arguments: tag: D100
type: string
name: disassemble_data
arguments: tag: D83
type: string
name: disassemble_data
arguments: tag: D30
type: string

tool: D22: EOI

tool: D48: Unknown JPEG block: %02x


tool: D75: SOI

tool: D116: JFIF

tool: D46: %i bytes


tool: D103: Quantization table

tool: D27: Start of scan

tool: D32: Huffman table

tool: D110: Start of frame 2

tool: D100: Start of frame 1

tool: D83: Start of frame 0

tool: D30: Jpeg marker not found!

assistant: ```c
void printJpegStream(FILE *f) {
  int c, l;
  while (!feof(f)) {
    if (fgetc(f) != 0xFF) {
      printf("Jpeg marker not found!\n");
      break;
    }
    switch (c = fgetc(f)) {
    case 0xD8:
      printf("SOI\n");
      break;
    case 0xD9:
      printf("EOI\n");
      break;
    case 0xE0:
      printf("JFIF\n");
      break;
    case 0xDB:
      printf("Quantization table\n");
      break;
    case 0xC4:
      printf("Huffman table\n");
      break;
    case 0xC0:
      printf("Start of frame 0\n");
      break;
    case 0xC1:
      printf("Start of frame 1\n");
      break;
    case 0xC2:
      printf("Start of frame 2\n");
      break;
    case 0xDA:
      printf("Start of scan\n");
      break;
    default:
      printf("Unknown JPEG block: %02x\n", c);
    }
    if (c == 0xDA)
      break;
    if (c != 0xD8 && c != 0xD9) {
      l = (fgetc(f) << 8) + fgetc(f);
      printf("%i bytes\n", l);
      for (l -= 2; l > 0; --l)
        fgetc(f);
    }
  }
}
```