// File: /workspace/github_c_makefile_star2_O0/ataradov[P]edbg/edbg.c
// Function: print_debugger_info
static void print_debugger_info(debugger_t *debugger)
{
  uint8_t buf[256];
  char str[512] = "Debugger: ";
  int size;

  size = dap_info(DAP_INFO_VENDOR, buf, sizeof(buf));
  strcat(str, size ? (char *)buf : debugger->manufacturer);
  strcat(str, " ");

  size = dap_info(DAP_INFO_PRODUCT, buf, sizeof(buf));
  strcat(str, size ? (char *)buf : debugger->product);
  strcat(str, " ");

  size = dap_info(DAP_INFO_SER_NUM, buf, sizeof(buf));
  strcat(str, size ? (char *)buf : debugger->serial);
  strcat(str, " ");

  size = dap_info(DAP_INFO_CMSIS_DAP_VER, buf, sizeof(buf));
  strcat(str, (char *)buf);
  strcat(str, " ");

  size = dap_info(DAP_INFO_CAPABILITIES, buf, sizeof(buf));
  check(size == 1 || size == 2, "incorrect DAP_INFO_CAPABILITIES size");

  strcat(str, "(");

  if (buf[0] & DAP_CAP_SWD)
    strcat(str, "S");

  if (buf[0] & DAP_CAP_JTAG)
    strcat(str, "J");

  strcat(str, ", ");

  if (debugger->versions & DBG_CMSIS_DAP_V1)
    strcat(str, "1");

  if (debugger->versions & DBG_CMSIS_DAP_V2)
    strcat(str, "2");

  strcat(str, ")\n");

  verbose(str);

  check(buf[0] & DAP_CAP_SWD, "SWD support required");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x350, %rsp            # imm = 0x350
movq %rdi, -0x8(%rbp)
leaq -0x310(%rbp), %rdi
leaq 0xac93(%rip), %rsi      # 0x143d0
movl $0x200, %edx            # imm = 0x200
callq 0x61a0
leaq -0x110(%rbp), %rsi
movl $0x1, %edi
movl $0x100, %edx            # imm = 0x100
callq 0x6740
movl %eax, -0x314(%rbp)
leaq -0x310(%rbp), %rax
movq %rax, -0x320(%rbp)
cmpl $0x0, -0x314(%rbp)
je 0x978a
leaq -0x110(%rbp), %rax
movq %rax, -0x328(%rbp)
jmp 0x9799
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x328(%rbp)
movq -0x320(%rbp), %rdi
movq -0x328(%rbp), %rsi
callq 0x6260
leaq -0x310(%rbp), %rdi
leaq 0xc197(%rip), %rsi      # 0x15951
callq 0x6260
leaq -0x110(%rbp), %rsi
movl $0x2, %edi
movl $0x100, %edx            # imm = 0x100
callq 0x6740
movl %eax, -0x314(%rbp)
leaq -0x310(%rbp), %rax
movq %rax, -0x330(%rbp)
cmpl $0x0, -0x314(%rbp)
je 0x9802
leaq -0x110(%rbp), %rax
movq %rax, -0x338(%rbp)
jmp 0x9811
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x338(%rbp)
movq -0x330(%rbp), %rdi
movq -0x338(%rbp), %rsi
callq 0x6260
leaq -0x310(%rbp), %rdi
leaq 0xc11f(%rip), %rsi      # 0x15951
callq 0x6260
leaq -0x110(%rbp), %rsi
movl $0x3, %edi
movl $0x100, %edx            # imm = 0x100
callq 0x6740
movl %eax, -0x314(%rbp)
leaq -0x310(%rbp), %rax
movq %rax, -0x340(%rbp)
cmpl $0x0, -0x314(%rbp)
je 0x987a
leaq -0x110(%rbp), %rax
movq %rax, -0x348(%rbp)
jmp 0x9889
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x348(%rbp)
movq -0x340(%rbp), %rdi
movq -0x348(%rbp), %rsi
callq 0x6260
leaq -0x310(%rbp), %rdi
leaq 0xc0a7(%rip), %rsi      # 0x15951
callq 0x6260
leaq -0x110(%rbp), %rsi
movl $0x4, %edi
movl $0x100, %edx            # imm = 0x100
callq 0x6740
movl %eax, -0x314(%rbp)
leaq -0x310(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x6260
leaq -0x310(%rbp), %rdi
leaq 0xc065(%rip), %rsi      # 0x15951
callq 0x6260
leaq -0x110(%rbp), %rsi
movl $0xf0, %edi
movl $0x100, %edx            # imm = 0x100
callq 0x6740
movl %eax, -0x314(%rbp)
movb $0x1, %al
cmpl $0x1, -0x314(%rbp)
movb %al, -0x349(%rbp)
je 0x992e
cmpl $0x2, -0x314(%rbp)
sete %al
movb %al, -0x349(%rbp)
movb -0x349(%rbp), %al
movzbl %al, %edi
andl $0x1, %edi
leaq 0xba2f(%rip), %rsi      # 0x15370
xorl %eax, %eax
callq 0x8880
leaq -0x310(%rbp), %rdi
leaq 0xba3f(%rip), %rsi      # 0x15395
callq 0x6260
movzbl -0x110(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x997d
leaq -0x310(%rbp), %rdi
leaq 0xc7bd(%rip), %rsi      # 0x16135
callq 0x6260
movzbl -0x110(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x999f
leaq -0x310(%rbp), %rdi
leaq 0xb9fd(%rip), %rsi      # 0x15397
callq 0x6260
leaq -0x310(%rbp), %rdi
leaq 0xb9ec(%rip), %rsi      # 0x15399
callq 0x6260
movq -0x8(%rbp), %rax
movl 0x30(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x99d4
leaq -0x310(%rbp), %rdi
leaq 0xc7a0(%rip), %rsi      # 0x1616f
callq 0x6260
movq -0x8(%rbp), %rax
movl 0x30(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x99f6
leaq -0x310(%rbp), %rdi
leaq 0xcc49(%rip), %rsi      # 0x1663a
callq 0x6260
leaq -0x310(%rbp), %rdi
leaq 0xc694(%rip), %rsi      # 0x16098
callq 0x6260
leaq -0x310(%rbp), %rdi
movb $0x0, %al
callq 0x8630
movzbl -0x110(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
setne %al
movzbl %al, %edi
andl $0x1, %edi
leaq 0xb968(%rip), %rsi      # 0x1539c
xorl %eax, %eax
callq 0x8880
addq $0x350, %rsp            # imm = 0x350
popq %rbp
retq
nopw %cs:(%rax,%rax)