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

```asm
<izracun>:
  endbr64
  push   %r15
  mov    %edx,%r15d
  push   %r14
  mov    %ecx,%r14d
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x38,%rsp
  mov    %r8,0x8(%rsp)
  cmp    $0x56,%dil
  je     L46
  cmp    $0x4f,%dil
  je     L117
L27:
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L117:
  test   %ecx,%ecx
  jle    L27
  mov    %r9d,%eax
  movslq %ecx,%r10
  xor    %r13d,%r13d
  xor    %r8d,%r8d
  shr    $0x1f,%eax
  xor    %r14d,%r14d
  lea    D0(%rip),%rdi
  xor    %r12d,%r12d
  add    %eax,%r9d
  mov    0x70(%rsp),%eax
  sar    %r9d
  shr    $0x1f,%eax
  add    0x70(%rsp),%eax
  sar    %eax
  mov    %eax,%r11d
  mov    0x78(%rsp),%eax
  shr    $0x1f,%eax
  add    0x78(%rsp),%eax
  sar    %eax
  mov    %eax,0x18(%rsp)
  lea    -0x1(%rdx),%eax
  lea    (%rax,%rax,4),%rax
  lea    (%rax,%rax,4),%rax
  lea    0x64(%rsi,%rax,4),%rbp
  cs nopw 0x0(%rax,%rax,1)
L219:
  lea    (%rbx,%r13,1),%rax
  test   %r15d,%r15d
  jg     L43
  jmp    L173
  nopl   0x0(%rax,%rax,1)
L73:
  cmp    $0x50,%dl
  je     L221
  cmp    $0x47,%dl
  jne    L241
  add    $0x1,%r8d
L241:
  add    $0x64,%rax
  cmp    %rbp,%rax
  je     L173
L43:
  movzbl (%rax),%edx
  cmp    $0x4d,%dl
  jne    L73
  add    $0x64,%rax
  add    $0x1,%r12d
  cmp    %rbp,%rax
  jne    L43
L173:
  lea    0x1(%r13),%edx
  cmp    %r12d,%r9d
  je     L115
L295:
  add    $0x1,%r13
  add    $0x1,%rbp
  cmp    %r10,%r13
  jne    L219
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L46:
  test   %edx,%edx
  jle    L27
  mov    %r9d,%r8d
  mov    0x70(%rsp),%r10d
  mov    0x78(%rsp),%r11d
  xor    %r13d,%r13d
  shr    $0x1f,%r8d
  xor    %r12d,%r12d
  lea    D17(%rip),%rdi
  xor    %ebp,%ebp
  shr    $0x1f,%r10d
  add    %r9d,%r8d
  add    0x70(%rsp),%r10d
  shr    $0x1f,%r11d
  lea    -0x1(%rcx),%r9d
  add    0x78(%rsp),%r11d
  sar    %r8d
  xor    %ecx,%ecx
  sar    %r10d
  sar    %r11d
  lea    0x1(%rsi,%r9,1),%rbx
  nopl   0x0(%rax)
L239:
  mov    %rbx,%rax
  sub    %r9,%rax
  sub    $0x1,%rax
  test   %r14d,%r14d
  jg     L169
  jmp    L165
  nopl   0x0(%rax)
L90:
  cmp    $0x47,%dl
  jne    L12
  add    $0x1,%r13d
L12:
  add    $0x1,%rax
  cmp    %rax,%rbx
  je     L165
L169:
  movzbl (%rax),%edx
  cmp    $0x4d,%dl
  je     L70
  cmp    $0x50,%dl
  jne    L90
  add    $0x1,%rax
  add    $0x1,%r12d
  cmp    %rax,%rbx
  jne    L169
L165:
  lea    0x1(%rcx),%edx
  cmp    %ebp,%r8d
  je     L150
L182:
  add    $0x64,%rbx
  cmp    %edx,%r15d
  je     L27
  mov    %edx,%ecx
  jmp    L239
  nopl   (%rax)
L70:
  add    $0x1,%ebp
  jmp    L12
  nopl   (%rax)
L150:
  cmp    %r12d,%r10d
  jne    L182
  cmp    %r13d,%r11d
  jne    L182
  mov    0x8(%rsp),%rax
  add    $0x2,%ecx
  mov    %r11d,0x28(%rsp)
  mov    %r10d,0x20(%rsp)
  mov    (%rax),%esi
  mov    %r8d,0x1c(%rsp)
  mov    %r9,0x10(%rsp)
  add    $0x1,%esi
  mov    %edx,0x18(%rsp)
  mov    %esi,(%rax)
  call   <printf@plt>
  mov    0x28(%rsp),%r11d
  mov    0x20(%rsp),%r10d
  lea    D17(%rip),%rdi
  mov    0x1c(%rsp),%r8d
  mov    0x10(%rsp),%r9
  mov    0x18(%rsp),%edx
  jmp    L182
  nopw   0x0(%rax,%rax,1)
L221:
  add    $0x1,%r14d
  jmp    L241
  nopl   0x0(%rax)
L115:
  cmp    %r14d,%r11d
  jne    L295
  cmp    %r8d,0x18(%rsp)
  jne    L295
  mov    0x8(%rsp),%rcx
  mov    %r11d,0x2c(%rsp)
  mov    %r9d,0x28(%rsp)
  mov    (%rcx),%esi
  mov    %r10,0x20(%rsp)
  mov    %r8d,0x1c(%rsp)
  mov    %esi,0x10(%rsp)
  add    $0x1,%esi
  mov    %esi,(%rcx)
  lea    0x2(%r13),%ecx
  call   <printf@plt>
  mov    0x2c(%rsp),%r11d
  mov    0x28(%rsp),%r9d
  lea    D0(%rip),%rdi
  mov    0x20(%rsp),%r10
  mov    0x1c(%rsp),%r8d
  jmp    L295
```

tool_calls: name: read_data
arguments: data_tag: D0
data_type: string
name: read_data
arguments: data_tag: D17
data_type: string

tool: D0: %d. Okomito, izmedju stupca br. %d i br. %d


tool: D17: %d. Vodoravno, izmedju retka br. %d i br. %d


assistant: ```c
void izracun(char orijentacija, char imanje[][100], int visina, int sirina, int *br_podjela, int M, int P, int G) {
  int i, j, tmpM = 0, tmpP = 0, tmpG = 0, granica = 0;
  if (orijentacija == 'V') {
    for (i = 0; i < visina; i++) {
      for (j = 0; j < sirina; j++) {
        if (imanje[i][j] == 'M')
          tmpM++;
        if (imanje[i][j] == 'P')
          tmpP++;
        if (imanje[i][j] == 'G')
          tmpG++;
      }
      granica++;
      if (tmpM == M / 2 && tmpP == P / 2 && tmpG == G / 2) {
        (*br_podjela)++;
        printf("%d. Vodoravno, izmedju retka br. %d i br. %d\n", *br_podjela, granica, granica + 1);
      }
    }
  } else if (orijentacija == 'O') {
    for (i = 0; i < sirina; i++) {
      for (j = 0; j < visina; j++) {
        if (imanje[j][i] == 'M')
          tmpM++;
        if (imanje[j][i] == 'P')
          tmpP++;
        if (imanje[j][i] == 'G')
          tmpG++;
      }
      granica++;
      if (tmpM == M / 2 && tmpP == P / 2 && tmpG == G / 2) {
        (*br_podjela)++;
        printf("%d. Okomito, izmedju stupca br. %d i br. %d\n", *br_podjela, granica, granica + 1);
      }
    }
  }
}
```