LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/utkukaratas[P]xkeylayers/./config.hpp
// Function: key_add_key(TKey*, unsigned char)
TKey *key_add_key(TKey *keys, KeyCode key)
{
    TKey *rval = keys;

    if (keys == NULL)
    {
        keys = new TKey;
        rval = keys;
    }
    else
    {
        while (keys->next != NULL) keys = keys->next;
        keys = (keys->next = new TKey);
    }

    keys->key = key;
    keys->next = NULL;

    return rval;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %ebx
testq %rdi, %rdi
je 0x25b3
movq %rdi, %r14
movq %rdi, %rax
movq %rax, %r15
movq 0x8(%rax), %rax
testq %rax, %rax
jne 0x2597
movl $0x10, %edi
callq 0x2140
movq %rax, 0x8(%r15)
jmp 0x25c0
movl $0x10, %edi
callq 0x2140
movq %rax, %r14
movb %bl, (%rax)
movq $0x0, 0x8(%rax)
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/utkukaratas[P]xkeylayers/xkeylayers.cpp
// Function: debug(char const*, ...)
void debug(const char *fmt, ...) {
    if (app.debug) {
        va_list args;
        va_start(args, fmt);
        vfprintf(stdout, fmt, args);
        va_end(args);
    }
}

// Assembly:
subq $0xd8, %rsp
testb %al, %al
je 0x2615
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsi, 0x28(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
cmpb $0x1, 0x3c13(%rip)      # 0x6248
jne 0x2671
movq %rdi, %r10
leaq 0x20(%rsp), %rax
movq %rsp, %rdx
movq %rax, 0x10(%rdx)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rdx)
movq 0x394a(%rip), %rax      # 0x5fb0
movq (%rax), %rdi
movq %r10, %rsi
callq 0x21c0
addq $0xd8, %rsp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/utkukaratas[P]xkeylayers/xkeylayers.cpp
// Function: TApplication::trigger_key(TModifierKey*)
void TApplication::trigger_key(TModifierKey* mod)
{
    for (auto keycode : mod->fake_keys)
    {
        ::debug("Generating %s!\n", XKeysymToString(sym_from_code(keycode)));

        XTestFakeKeyEvent(_ctrl_conn, keycode, True, 0);
        generated = key_add_key(generated, keycode);
    }
    for (auto keycode : mod->fake_keys)
    {
        XTestFakeKeyEvent(_ctrl_conn, keycode, False, 0);
        generated = key_add_key(generated, keycode);
    }
    XFlush(_ctrl_conn);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x10(%rsi), %r12
movq 0x18(%rsi), %r13
cmpq %r13, %r12
je 0x2738
movq %rsi, %r14
leaq 0x198d(%rip), %r15      # 0x4030
movzbl (%r12), %ebp
movq 0x3b01(%rip), %rdi      # 0x61b0
movl %ebp, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x20b0
movq %rax, %rdi
callq 0x22b0
movq %r15, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0x25d3
movq 0x8(%rbx), %rdi
movl %ebp, %esi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x21a0
movq 0xd8(%rbx), %rdi
movl %ebp, %esi
callq 0x2585
movq %rax, 0xd8(%rbx)
incq %r12
cmpq %r13, %r12
jne 0x26a3
movq 0x10(%r14), %r15
movq 0x18(%r14), %r14
cmpq %r14, %r15
je 0x2738
movzbl (%r15), %ebp
movq 0x8(%rbx), %rdi
movl %ebp, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x21a0
movq 0xd8(%rbx), %rdi
movl %ebp, %esi
callq 0x2585
movq %rax, 0xd8(%rbx)
incq %r15
jmp 0x2706
movq 0x8(%rbx), %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2200
nop
// File: /workspace/github_cpp_makefile_star2_O3/utkukaratas[P]xkeylayers/xkeylayers.cpp
// Function: TApplication::connect_x11()
void TApplication::connect_x11() {
    int dummy;
    _data_conn = XOpenDisplay(NULL);
    _ctrl_conn = XOpenDisplay(NULL);

    if (!_data_conn || !_ctrl_conn)
    {
        cerr << "Unable to connect to X11 display. Is $DISPLAY set?\n";
        exit(EXIT_FAILURE);
    }
    if (!XQueryExtension(_ctrl_conn,
                "XTEST", &dummy, &dummy, &dummy))
    {
        cerr << "Xtst extension missing\n";
        exit(EXIT_FAILURE);
    }
    if (!XRecordQueryVersion(_ctrl_conn, &dummy, &dummy))
    {
        cerr << "Failed to obtain xrecord version\n";
        exit(EXIT_FAILURE);
    }
    if (!XkbQueryExtension(_ctrl_conn, &dummy, &dummy,
            &dummy, &dummy, &dummy))
    {
        cerr << "Failed to obtain xkb version\n";
        exit(EXIT_FAILURE);
    }
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
xorl %edi, %edi
callq 0x21d0
movq %rax, (%rbx)
xorl %edi, %edi
callq 0x21d0
movq %rax, 0x8(%rbx)
cmpq $0x0, (%rbx)
je 0x27cf
testq %rax, %rax
je 0x27cf
leaq 0x18f5(%rip), %rsi      # 0x4074
leaq 0xc(%rsp), %rcx
movq %rax, %rdi
movq %rcx, %rdx
movq %rcx, %r8
callq 0x2060
testl %eax, %eax
je 0x27df
movq 0x8(%rbx), %rdi
leaq 0xc(%rsp), %rdx
movq %rdx, %rsi
callq 0x2280
testl %eax, %eax
je 0x27ef
movq 0x8(%rbx), %rdi
leaq 0xc(%rsp), %rcx
movq %rcx, %rsi
movq %rcx, %rdx
movq %rcx, %r8
movq %rcx, %r9
callq 0x2110
testl %eax, %eax
je 0x27ff
addq $0x10, %rsp
popq %rbx
retq
movq 0x381a(%rip), %rdi      # 0x5ff0
leaq 0x1863(%rip), %rsi      # 0x4040
jmp 0x280d
movq 0x380a(%rip), %rdi      # 0x5ff0
leaq 0x188d(%rip), %rsi      # 0x407a
jmp 0x280d
movq 0x37fa(%rip), %rdi      # 0x5ff0
leaq 0x1895(%rip), %rsi      # 0x4092
jmp 0x280d
movq 0x37ea(%rip), %rdi      # 0x5ff0
leaq 0x18a7(%rip), %rsi      # 0x40b4
callq 0x2130
movl $0x1, %edi
callq 0x2190
// File: /workspace/github_cpp_makefile_star2_O3/utkukaratas[P]xkeylayers/xkeylayers.cpp
// Function: TApplication::hook_x11()
void TApplication::hook_x11() {
    XRecordRange *rec_range = XRecordAllocRange();
    rec_range->device_events.first = KeyPress;
    rec_range->device_events.last = ButtonRelease;
    XRecordClientSpec client_spec = XRecordAllClients;

    _record_ctx = XRecordCreateContext(_ctrl_conn,
            0, &client_spec, 1, &rec_range, 1);

    if (_record_ctx == 0)
    {
        cerr << "Failed to create xrecord context\n";
        exit(EXIT_FAILURE);
    }

    XSync(_ctrl_conn, False);

    if (!XRecordEnableContext(_data_conn,
                _record_ctx, intercept, (XPointer)&app))
    {
        cerr << "Failed to enable xrecord context\n";
        exit(EXIT_FAILURE);
    }

    if (!XRecordFreeContext(_ctrl_conn, _record_ctx))
    {
        cerr << "Failed to free xrecord context\n";
    }
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
callq 0x22f0
leaq 0x8(%rsp), %r8
movq %rax, (%r8)
movw $0x502, 0x12(%rax)      # imm = 0x502
movq %rsp, %rdx
movq $0x3, (%rdx)
movq 0x8(%rbx), %rdi
xorl %esi, %esi
movl $0x1, %ecx
movl $0x1, %r9d
callq 0x2250
movq %rax, 0x10(%rbx)
testq %rax, %rax
je 0x28b8
movq 0x8(%rbx), %rdi
xorl %esi, %esi
callq 0x22d0
movq (%rbx), %rdi
movq 0x10(%rbx), %rsi
leaq 0x6c(%rip), %rdx        # 0x28e5
leaq 0x3928(%rip), %rcx      # 0x61a8
callq 0x2220
testl %eax, %eax
je 0x28c8
movq 0x8(%rbx), %rdi
movq 0x10(%rbx), %rsi
callq 0x20d0
testl %eax, %eax
jne 0x28b2
movq 0x374f(%rip), %rdi      # 0x5ff0
leaq 0x186e(%rip), %rsi      # 0x4116
movl $0x1f, %edx
callq 0x2160
addq $0x10, %rsp
popq %rbx
retq
movq 0x3731(%rip), %rdi      # 0x5ff0
leaq 0x180c(%rip), %rsi      # 0x40d2
jmp 0x28d6
movq 0x3721(%rip), %rdi      # 0x5ff0
leaq 0x181e(%rip), %rsi      # 0x40f4
callq 0x2130
movl $0x1, %edi
callq 0x2190
// File: /workspace/github_cpp_makefile_star2_O3/utkukaratas[P]xkeylayers/xkeylayers.cpp
// Function: handle_modifier(TModifierKey*, bool, int)
void handle_modifier(TModifierKey* mod, bool mouse_pressed, int key_event)
{
    if (key_event == KeyPress)
    {
        debug("Key pressed!\n");
        mod->is_down = True;

        if (app.timeout_valid)
            gettimeofday(&mod->down_at, NULL);

        if (mouse_pressed)
        {
            mod->used = True;
        }

        // testing heuristic 1
        if (heuristic_test1(mod)) {
            // if heuristic func returns true this means user probably wants
            // the key itself (space) not the modifier.
            app.trigger_key(mod);
            mod->used = true;
        }
    }
    else
    {
        debug("Key released!\n");
        if (!mod->used)
        {
            timeval down_time = app.timeout;
            if (app.timeout_valid)
            {
                gettimeofday(&down_time, NULL);
                timersub(&down_time, &mod->down_at, &down_time);
            }

            if (!app.timeout_valid ||
                timercmp(&down_time, &app.timeout, <))
            {
                // so a modifier key was pressed shortly.
                // generate fake keys (actually... press and release events).
                app.trigger_key(mod);
            }
        }
        mod->used = False;
        mod->is_down = False;
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
cmpl $0x2, %edx
jne 0x2af3
movl %esi, %ebp
leaq 0x16d2(%rip), %rdi      # 0x4178
xorl %eax, %eax
callq 0x25d3
movb $0x1, 0x29(%rbx)
cmpb $0x1, 0x37e0(%rip)      # 0x6298
jne 0x2ac5
leaq 0x30(%rbx), %rdi
xorl %esi, %esi
callq 0x2230
testb %bpl, %bpl
je 0x2ace
movb $0x1, 0x28(%rbx)
callq 0x2c69
testb %al, %al
je 0x2b96
leaq 0x36c6(%rip), %rdi      # 0x61a8
movq %rbx, %rsi
callq 0x267a
movb $0x1, 0x28(%rbx)
jmp 0x2b96
leaq 0x168c(%rip), %rdi      # 0x4186
xorl %eax, %eax
callq 0x25d3
cmpb $0x0, 0x28(%rbx)
jne 0x2b90
movdqu 0x3775(%rip), %xmm0     # 0x6288
movdqa %xmm0, (%rsp)
cmpb $0x1, 0x3779(%rip)      # 0x6298
jne 0x2b5d
movq %rsp, %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x2230
movdqa (%r14), %xmm0
movdqu 0x30(%rbx), %xmm1
psubq %xmm1, %xmm0
movdqa %xmm0, (%r14)
pshufd $0xee, %xmm0, %xmm1     # xmm1 = xmm0[2,3,2,3]
movq %xmm1, %rax
testq %rax, %rax
jns 0x2b5d
paddq 0x14c8(%rip), %xmm0     # 0x4020
movdqa %xmm0, (%rsp)
cmpb $0x1, 0x3734(%rip)      # 0x6298
jne 0x2b81
movq 0x371b(%rip), %rax      # 0x6288
cmpq %rax, (%rsp)
jne 0x2b7f
movq 0x8(%rsp), %rax
cmpq 0x3711(%rip), %rax      # 0x6290
jge 0x2b90
leaq 0x3620(%rip), %rdi      # 0x61a8
movq %rbx, %rsi
callq 0x267a
movw $0x0, 0x28(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/utkukaratas[P]xkeylayers/xkeylayers.cpp
// Function: sig_handler(void*)
void* sig_handler(void *user_data)
{
    TApplication *self = (TApplication*)user_data;
    int sig;

    debug("sig_handler running...\n");

    sigwait(&self->_sigset, &sig);

    debug("Caught signal %d!\n", sig);

    if (!XRecordDisableContext(self->_ctrl_conn, self->_record_ctx))
    {
        fprintf(stderr, "Failed to disable xrecord context\n");
        exit(EXIT_FAILURE);
    }

    XSync(self->_ctrl_conn, False);

    debug("sig_handler exiting...\n");

    return NULL;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x145d(%rip), %rdi      # 0x4195
xorl %eax, %eax
callq 0x25d3
leaq 0x20(%rbx), %rdi
leaq 0x4(%rsp), %r14
movq %r14, %rsi
callq 0x2070
movl (%r14), %esi
leaq 0x1453(%rip), %rdi      # 0x41ad
xorl %eax, %eax
callq 0x25d3
movq 0x8(%rbx), %rdi
movq 0x10(%rbx), %rsi
callq 0x2260
testl %eax, %eax
je 0x2d95
movq 0x8(%rbx), %rdi
xorl %esi, %esi
callq 0x22d0
leaq 0x145f(%rip), %rdi      # 0x41e3
xorl %eax, %eax
callq 0x25d3
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
callq 0x2310
// File: /workspace/github_cpp_makefile_star2_O3/DavieV[P]virtual-usb-printer/usbip.cc
// Function: create_usbip_ret_submit(_USBIP_CMD_SUBMIT const*)
USBIP_RET_SUBMIT create_usbip_ret_submit(const USBIP_CMD_SUBMIT *command) {
  USBIP_RET_SUBMIT usb_req;
  memset(&usb_req, 0, sizeof(usb_req));
  usb_req.seqnum = command->seqnum;
  usb_req.devid = command->devid;
  usb_req.direction = command->direction;
  usb_req.ep = command->ep;
  usb_req.setup = command->setup;
  return usb_req;
}

// Assembly:
movq %rdi, %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
movups %xmm0, (%rdi)
movq $0x0, 0x20(%rdi)
movups 0x4(%rsi), %xmm0
movups %xmm0, 0x4(%rdi)
movq 0x28(%rsi), %rcx
movq %rcx, 0x28(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O3/DavieV[P]virtual-usb-printer/usb_printer.cc
// Function: UsbPrinter::HandleUsbRequest(int, _USBIP_CMD_SUBMIT const&)
void UsbPrinter::HandleUsbRequest(int sockfd,
                                  const USBIP_CMD_SUBMIT& usb_request) {
  // Endpoint 0 is used for USB control requests.
  if (usb_request.ep == 0) {
    printf("# control requests\n");
    HandleUsbControl(sockfd, usb_request);
  } else {
    printf("# data requests\n");
  }
}

// Assembly:
cmpl $0x0, 0x10(%rdx)
je 0x1ec2
leaq 0x2455(%rip), %rdi      # 0x4312
jmp 0x11f0
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
leaq 0x244d(%rip), %rdi      # 0x4322
callq 0x11f0
movq %r14, %rdi
movl %ebp, %esi
movq %rbx, %rdx
popq %rbx
popq %r14
popq %rbp
jmp 0x1eec
nop
// File: /workspace/github_cpp_makefile_star2_O3/DavieV[P]virtual-usb-printer/usb_printer.cc
// Function: UsbPrinter::HandleUsbControl(int, _USBIP_CMD_SUBMIT const&)
void UsbPrinter::HandleUsbControl(int sockfd,
                                  const USBIP_CMD_SUBMIT& usb_request) {
  StandardDeviceRequest control_request =
      CreateStandardDeviceRequest(usb_request.setup);
  print_standard_device_request(control_request);
  int request_type = GetControlType(control_request.bmRequestType);
  switch (request_type) {
    case STANDARD_TYPE:
      HandleStandardControl(sockfd, usb_request, control_request);
      break;
    case CLASS_TYPE:
      HandlePrinterControl(sockfd, usb_request, control_request);
      break;
    case VENDOR_TYPE:
    case RESERVED_TYPE:
    default:
      printf("Unable to handle request of type %d\n", request_type);
      break;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
movq 0x28(%rdx), %rax
bswapq %rax
movq %rsp, %r15
movq %rax, (%r15)
movq %r15, %rdi
callq 0x1b61
movl (%r15), %esi
shrl $0x5, %esi
andl $0x3, %esi
cmpl $0x1, %esi
je 0x1f34
testl %esi, %esi
jne 0x1f46
movq %rsp, %rcx
movq %r14, %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x1f60
jmp 0x1f54
movq %rsp, %rcx
movq %r14, %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x2008
jmp 0x1f54
leaq 0x2293(%rip), %rdi      # 0x41e0
xorl %eax, %eax
callq 0x1050
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/DavieV[P]virtual-usb-printer/usb_printer.cc
// Function: UsbPrinter::HandleStandardControl(int, _USBIP_CMD_SUBMIT const&, _StandardDeviceRequest const&)
void UsbPrinter::HandleStandardControl(
    int sockfd, const USBIP_CMD_SUBMIT& usb_request,
    const StandardDeviceRequest& control_request) {
  switch (control_request.bRequest) {
    case GET_STATUS:
      break;
    case GET_DESCRIPTOR:
      HandleGetDescriptor(sockfd, usb_request, control_request);
      break;
    case SET_DESCRIPTOR:
      break;
    case GET_CONFIGURATION:
      HandleGetConfiguration(sockfd, usb_request, control_request);
      break;
    case SET_CONFIGURATION:
      HandleSetConfiguration(sockfd, usb_request, control_request);
      break;
    case GET_INTERFACE:
      // Support for this will be needed for interfaces with alt settings.
      break;
    case SET_INTERFACE:
      HandleSetInterface(sockfd, usb_request, control_request);
      break;
    default:
      break;
  }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movzbl 0x1(%rcx), %eax
addl $-0x6, %eax
cmpl $0x5, %eax
ja 0x2002
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
leaq 0x222d(%rip), %rdx      # 0x41b0
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
movq %r14, %rdi
movl %ebp, %esi
movq %rbx, %rdx
popq %rbx
popq %r14
popq %rbp
jmp 0x202c
movzbl 0x3(%rcx), %esi
movzbl 0x2(%rcx), %edx
leaq 0x2312(%rip), %rdi      # 0x42be
jmp 0x1fe6
movzbl 0x3(%rcx), %esi
movzbl 0x2(%rcx), %edx
leaq 0x22e2(%rip), %rdi      # 0x429f
xorl %eax, %eax
callq 0x1050
addq $0x17, %r14
movl %ebp, %edi
movq %rbx, %rsi
movq %r14, %rdx
movl $0x1, %ecx
jmp 0x1ff6
movzbl 0x3(%rcx), %esi
movzbl 0x2(%rcx), %edx
leaq 0x22f7(%rip), %rdi      # 0x42dd
xorl %eax, %eax
callq 0x1050
movl %ebp, %edi
movq %rbx, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
popq %rbx
popq %r14
popq %rbp
jmp 0x1c0a
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/DavieV[P]virtual-usb-printer/usb_printer.cc
// Function: UsbPrinter::HandleGetDescriptor(int, _USBIP_CMD_SUBMIT const&, _StandardDeviceRequest const&) const
void UsbPrinter::HandleGetDescriptor(
    int sockfd, const USBIP_CMD_SUBMIT& usb_request,
    const StandardDeviceRequest& control_request) const {
  printf("HandleGetDescriptor %u[%u]\n", control_request.wValue1,
         control_request.wValue0);

  switch (control_request.wValue1) {
    case USB_DESCRIPTOR_DEVICE:
      SendUsbRequest(sockfd, usb_request, (char*)&device_descriptor_,
                     device_descriptor_.bLength, 0);
      break;
    case USB_DESCRIPTOR_CONFIGURATION:
      HandleGetConfigurationDescriptor(sockfd, usb_request, control_request);
      break;
    case USB_DESCRIPTOR_STRING:
      HandleGetStringDescriptor(sockfd, usb_request, control_request);
      break;
    case USB_DESCRIPTOR_INTERFACE:
      break;
    case USB_DESCRIPTOR_ENDPOINT:
      break;
    case USB_DESCRIPTOR_DEVICE_QUALIFIER:
      break;
    default:
      printf("Unkown descriptor type requested: %d\n", control_request.wValue1);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r15
movzbl 0x3(%rcx), %esi
movzbl 0x2(%rcx), %edx
leaq 0x21b8(%rip), %rdi      # 0x4205
xorl %eax, %eax
callq 0x1050
movzbl 0x3(%r14), %esi
leal -0x1(%rsi), %eax
cmpl $0x5, %eax
ja 0x2096
leaq 0x2160(%rip), %rcx      # 0x41c8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
movl %ebp, %esi
movq %rbx, %rdx
movq %r14, %rcx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2378
leaq 0x2184(%rip), %rdi      # 0x4221
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1050
movzbl (%r15), %ecx
movl %ebp, %edi
movq %rbx, %rsi
movq %r15, %rdx
xorl %r8d, %r8d
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1c0a
movq %r15, %rdi
movl %ebp, %esi
movq %rbx, %rdx
movq %r14, %rcx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x21d0
// File: /workspace/github_cpp_makefile_star2_O3/DavieV[P]virtual-usb-printer/usb_printer.cc
// Function: UsbPrinter::HandleGetConfiguration(int, _USBIP_CMD_SUBMIT const&, _StandardDeviceRequest const&)
void UsbPrinter::HandleGetConfiguration(
    int sockfd, const USBIP_CMD_SUBMIT& usb_request,
    const StandardDeviceRequest& control_request) {
  printf("HandleGetConfiguration %u[%u]\n", control_request.wValue1,
         control_request.wValue0);

  // Note: For now we only have on configuration set, so we just respond with
  // with |configuration_descriptor_.bConfigurationValue|.
  SendUsbRequest(sockfd, usb_request,
                 (const char*)&configuration_descriptor_.bConfigurationValue, 1,
                 0);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
movzbl 0x3(%rcx), %esi
movzbl 0x2(%rcx), %edx
leaq 0x219e(%rip), %rdi      # 0x429f
xorl %eax, %eax
callq 0x1050
addq $0x17, %r14
movl %ebp, %edi
movq %rbx, %rsi
movq %r14, %rdx
movl $0x1, %ecx
xorl %r8d, %r8d
popq %rbx
popq %r14
popq %rbp
jmp 0x1c0a
nop
// File: /workspace/github_cpp_makefile_star2_O3/DavieV[P]virtual-usb-printer/usb_printer.cc
// Function: UsbPrinter::HandleSetConfiguration(int, _USBIP_CMD_SUBMIT const&, _StandardDeviceRequest const&)
void UsbPrinter::HandleSetConfiguration(
    int sockfd, const USBIP_CMD_SUBMIT& usb_request,
    const StandardDeviceRequest& control_request) {
  printf("HandleSetConfiguration %u[%u]\n", control_request.wValue1,
         control_request.wValue0);

  // NOTE: For now we have only one configuration to set, so we just respond
  // with an empty message as a confirmation.
  SendUsbRequest(sockfd, usb_request, 0, 0, 0);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %ebp
movzbl 0x3(%rcx), %esi
movzbl 0x2(%rcx), %edx
leaq 0x2181(%rip), %rdi      # 0x42be
xorl %eax, %eax
callq 0x1050
movl %ebp, %edi
movq %rbx, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x1c0a
nop
// File: /workspace/github_cpp_makefile_star2_O3/DavieV[P]virtual-usb-printer/usb_printer.cc
// Function: UsbPrinter::HandleSetInterface(int, _USBIP_CMD_SUBMIT const&, _StandardDeviceRequest const&)
void UsbPrinter::HandleSetInterface(
    int sockfd, const USBIP_CMD_SUBMIT& usb_request,
    const StandardDeviceRequest& control_request) {
  printf("HandleSetInterface %u[%u]\n", control_request.wValue1,
         control_request.wValue0);

  // NOTE: For now we have only one interface to set, so we just respond
  // with an empty message as a confirmation.
  SendUsbRequest(sockfd, usb_request, 0, 0, 0);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %ebp
movzbl 0x3(%rcx), %esi
movzbl 0x2(%rcx), %edx
leaq 0x216a(%rip), %rdi      # 0x42dd
xorl %eax, %eax
callq 0x1050
movl %ebp, %edi
movq %rbx, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x1c0a
nop
// File: /workspace/github_cpp_makefile_star2_O3/DavieV[P]virtual-usb-printer/usb_printer.cc
// Function: UsbPrinter::HandleGetStringDescriptor(int, _USBIP_CMD_SUBMIT const&, _StandardDeviceRequest const&) const
void UsbPrinter::HandleGetStringDescriptor(
    int sockfd, const USBIP_CMD_SUBMIT& usb_request,
    const StandardDeviceRequest& control_request) const {
  printf("HandleGetStringDescriptor %u[%u]\n", control_request.wValue1,
         control_request.wValue0);

  int index = control_request.wValue0;
  int string_length = (strings_[index][0] / 2) - 1;
  if (index != 0) {
    char str[255];
    memset(str, 0, 255);
    for (int i = 0; i < string_length; ++i) {
      str[i] = strings_[index][i * 2 + 2];
    }
    printf("String (%s)\n", str);
  }
  SendUsbRequest(sockfd, usb_request, strings_[index].data(),
                 strings_[index][0], 0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rcx, %r15
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
movzbl 0x3(%rcx), %esi
movzbl 0x2(%rcx), %edx
leaq 0x1ecd(%rip), %rdi      # 0x4270
xorl %eax, %eax
callq 0x1050
movzbl 0x2(%r15), %eax
movq 0x20(%r14), %rcx
leaq (%rax,%rax,2), %r12
movq (%rcx,%r12,8), %r15
movb (%r15), %r13b
testq %rax, %rax
je 0x2423
movq %rsp, %rdi
movl $0xff, %edx
xorl %esi, %esi
callq 0x1110
cmpb $0x4, %r13b
jl 0x2407
movl %r13d, %eax
shrb $0x7, %al
addb %r13b, %al
sarb %al
movzbl %al, %eax
cmpb $0x3, %al
movl $0x2, %ecx
cmovgel %eax, %ecx
decb %cl
movzbl %cl, %eax
xorl %ecx, %ecx
movb 0x2(%r15,%rcx,2), %dl
movb %dl, (%rsp,%rcx)
incq %rcx
cmpq %rcx, %rax
jne 0x23f7
leaq 0x1e84(%rip), %rdi      # 0x4292
movq %rsp, %rsi
xorl %eax, %eax
callq 0x1050
movq 0x20(%r14), %rax
movq (%rax,%r12,8), %r15
movb (%r15), %r13b
movsbl %r13b, %ecx
movl %ebp, %edi
movq %rbx, %rsi
movq %r15, %rdx
xorl %r8d, %r8d
callq 0x1c0a
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/DavieV[P]virtual-usb-printer/server.cc
// Function: bind_server_socket(int)
struct sockaddr_in bind_server_socket(int fd) {
  struct sockaddr_in server;
  memset(&server, 0, sizeof(server));
  server.sin_family = AF_INET;
  server.sin_addr.s_addr = htonl(INADDR_ANY);
  server.sin_port = htons(TCP_SERV_PORT);

  if (bind(fd, (sockaddr *)&server, sizeof(server)) < 0) {
    printf("bind error : %s \n", strerror(errno));
    exit(1);
  }

  return server;
}

// Assembly:
subq $0x18, %rsp
leaq 0x8(%rsp), %rsi
movq $0x0, 0x8(%rsi)
movl $0xa80c0002, %eax       # imm = 0xA80C0002
movq %rax, (%rsi)
movl $0x10, %edx
callq 0x1060
testl %eax, %eax
js 0x2809
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %rdx
addq $0x18, %rsp
retq
callq 0x1040
movl (%rax), %edi
callq 0x10b0
leaq 0x1b92(%rip), %rdi      # 0x43ae
movq %rax, %rsi
xorl %eax, %eax
callq 0x1050
movl $0x1, %edi
callq 0x11a0
// File: /workspace/github_cpp_makefile_star2_O3/DavieV[P]virtual-usb-printer/server.cc
// Function: accept_connection(int)
int accept_connection(int fd) {
  struct sockaddr_in client;
  socklen_t client_length = sizeof(client);
  int connection = accept(fd, (struct sockaddr *)&client, &client_length);
  if (connection < 0) {
    printf("accept error : %s\n", strerror(errno));
    exit(1);
  }
  printf("Connection address:%s\n", inet_ntoa(client.sin_addr));
  return connection;
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
leaq 0xc(%rsp), %rdx
movl $0x10, (%rdx)
leaq 0x10(%rsp), %rsi
callq 0x1090
testl %eax, %eax
js 0x2872
movl %eax, %ebx
movl 0x14(%rsp), %edi
callq 0x10e0
leaq 0x1b73(%rip), %rdi      # 0x43d3
movq %rax, %rsi
xorl %eax, %eax
callq 0x1050
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
retq
callq 0x1040
movl (%rax), %edi
callq 0x10b0
leaq 0x1b3b(%rip), %rdi      # 0x43c0
movq %rax, %rsi
xorl %eax, %eax
callq 0x1050
movl $0x1, %edi
callq 0x11a0
// File: /workspace/github_cpp_makefile_star2_O3/AMDmi3[P]dangling_ptr/include/dangling_ptr.hh
// Function: dangling::ptr<Object>::operator=(dangling::ptr<Object>&&)
ptr<T>& operator=(ptr<T>&& other) noexcept {
		if (this == &other)
			return *this;
		if (target_ && *target_)
			(*target_)->unregister_ptr(target_.get());
		target_ = std::move(other.target_);
		return *this;
	}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq %rsi, %rdi
je 0x735d
movq %rsi, %r14
movq (%rbx), %rsi
testq %rsi, %rsi
je 0x733e
movq (%rsi), %rdi
testq %rdi, %rdi
je 0x733e
callq 0x8834
movq (%r14), %rax
movq $0x0, (%r14)
movq (%rbx), %rdi
movq %rax, (%rbx)
testq %rdi, %rdi
je 0x735d
movl $0x8, %esi
callq 0x2160
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rdi
callq 0x73d5
// File: /workspace/github_cpp_makefile_star2_O3/AMDmi3[P]dangling_ptr/include/dangling_ptr.hh
// Function: dangling::ptr<Object>::reset(Object*)
void reset(T* target = nullptr) {
		if (get() == target)
			return;
		if (target) {
			if (!target_)
				target_.reset(new T*(nullptr));
			target->register_ptr(target_.get());
		}
		if (target_ && *target_)
			(*target_)->unregister_ptr(target_.get());
		*target_ = target;
	}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rsi
testq %rsi, %rsi
je 0x7387
movq (%rsi), %rax
jmp 0x7389
xorl %eax, %eax
cmpq %rbx, %rax
je 0x73cd
testq %rbx, %rbx
je 0x73ba
testq %rsi, %rsi
jne 0x73af
movl $0x8, %edi
callq 0x2150
movq %rax, %rsi
movq $0x0, (%rax)
movq %rax, (%r14)
movq %rbx, %rdi
callq 0x87ca
movq (%r14), %rsi
movq (%rsi), %rdi
testq %rdi, %rdi
je 0x73ca
callq 0x8834
movq (%r14), %rsi
movq %rbx, (%rsi)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/AMDmi3[P]dangling_ptr/tests/testing.h
// Function: Tester::PrintSummary()
void PrintSummary() {
		std::cerr << num_failures_ << " failure(s) out of " << num_tests_ << " tests";
		if (unexpected_exception_)
			std::cerr << ", and was terminated prematurely due to unexpected exception";
		std::cerr << "\n";
	}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x4(%rdi), %esi
movq 0x6bff(%rip), %rdi      # 0xdff0
callq 0x2220
movq %rax, %r14
leaq 0x3092(%rip), %rsi      # 0xa492
movl $0x13, %edx
movq %rax, %rdi
callq 0x2190
movl (%rbx), %esi
movq %r14, %rdi
callq 0x2220
leaq 0x3088(%rip), %rsi      # 0xa4a6
movl $0x6, %edx
movq %rax, %rdi
callq 0x2190
cmpb $0x1, 0x9(%rbx)
jne 0x7449
movq 0x6bb8(%rip), %rdi      # 0xdff0
leaq 0x306e(%rip), %rsi      # 0xa4ad
movl $0x3c, %edx
callq 0x2190
movq 0x6ba0(%rip), %rdi      # 0xdff0
leaq 0x3093(%rip), %rsi      # 0xa4ea
movl $0x1, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2190
// File: /workspace/github_cpp_makefile_star2_O3/AMDmi3[P]dangling_ptr/tests/testing.h
// Function: Tester::Stylify(Tester::Styles, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) const
std::string Stylify(Styles style, const std::string& str) const {
		if (!use_color_)
			return str;

		bool bright = false;
		int color = 0;

		switch (style) {
		case PASS_BANNER: bright = false; color = 2; break;
		case WARN_BANNER: bright =  true; color = 3; break;
		case FAIL_BANNER: bright =  true; color = 1; break;
		case LITERAL:     bright =  true; color = 5; break;
		case EXPRESSION:  bright =  true; color = 7; break;
		case DESCRIPTION: bright =  true; color = 4; break;
		default:
			return str;
		}

		std::ostringstream ss;
		ss << "\033[" << (bright ? '1' : '0') << ';' << (30 + color) << 'm' << str << "\033[0m";
		return ss.str();
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x180, %rsp            # imm = 0x180
movq %rcx, %r14
movq %rdi, %rbx
cmpb $0x0, 0x8(%rsi)
je 0x7bce
movl %edx, %r15d
cmpl $0x6, %edx
jae 0x7bce
movl %r15d, %eax
leaq 0x2c59(%rip), %rcx      # 0xa758
movl (%rcx,%rax,4), %ebp
leaq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0x21b0
leaq 0x294a(%rip), %rsi      # 0xa460
movl $0x2, %edx
movq %r12, %rdi
callq 0x2190
shll $0x3, %r15d
movabsq $0x313131313130, %rax   # imm = 0x313131313130
movl %r15d, %ecx
shrq %cl, %rax
leaq 0x7(%rsp), %rsi
movb %al, (%rsi)
leaq 0x8(%rsp), %rdi
movl $0x1, %edx
callq 0x2190
leaq 0x7(%rsp), %rsi
movb $0x3b, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x2190
movq %rax, %rdi
movl %ebp, %esi
callq 0x2220
leaq 0x7(%rsp), %rsi
movb $0x6d, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x2190
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %rax, %rdi
callq 0x2190
leaq 0x28cc(%rip), %rsi      # 0xa463
movl $0x4, %edx
movq %rax, %rdi
callq 0x2190
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x21e0
movq 0x6410(%rip), %rsi      # 0xdfc8
leaq 0x8(%rsp), %rdi
callq 0x20d0
leaq 0x78(%rsp), %rdi
callq 0x2070
jmp 0x7be7
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x7c20
movq %rbx, %rax
addq $0x180, %rsp            # imm = 0x180
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x63c4(%rip), %rsi      # 0xdfc8
leaq 0x8(%rsp), %rdi
callq 0x20d0
leaq 0x78(%rsp), %rdi
callq 0x2070
movq %rbx, %rdi
callq 0x2230
// File: /workspace/github_cpp_makefile_star2_O3/AMDmi3[P]dangling_ptr/include/dangling_ptr.hh
// Function: dangling::target<Object>::register_ptr(Object**)
void register_ptr(T** ptr) {
#if defined(DANGLINGPTR_USE_LIST)
		assert(std::find(dangling_ptrs_.begin(), dangling_ptrs_.end(), ptr) == dangling_ptrs_.end());
		dangling_ptrs_.push_back(ptr);
#else
		assert(dangling_ptrs_.find(ptr) == dangling_ptrs_.end());
		dangling_ptrs_.insert(ptr);
#endif
	}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x8(%rdi), %r14
movq 0x8(%rdi), %rax
cmpq %r14, %rax
je 0x87f2
cmpq %r15, 0x10(%rax)
je 0x87ed
movq (%rax), %rax
jmp 0x87dd
cmpq %r14, %rax
jne 0x8815
movl $0x18, %edi
callq 0x2150
movq %r15, 0x10(%rax)
movq %rax, %rdi
movq %r14, %rsi
callq 0x2040
incq 0x18(%rbx)
popq %rbx
popq %r14
popq %r15
retq
leaq 0x1ce8(%rip), %rdi      # 0xa504
leaq 0x1d36(%rip), %rsi      # 0xa559
leaq 0x1d47(%rip), %rcx      # 0xa571
movl $0x4d, %edx
callq 0x20e0
// File: /workspace/github_cpp_makefile_star2_O3/AMDmi3[P]dangling_ptr/include/dangling_ptr.hh
// Function: dangling::target<Object>::unregister_ptr(Object**)
void unregister_ptr(T** ptr) {
#if defined(DANGLINGPTR_USE_LIST)
		auto iter = std::find(dangling_ptrs_.begin(), dangling_ptrs_.end(), ptr);
		assert(iter != dangling_ptrs_.end());
		dangling_ptrs_.erase(iter);
#else
		auto iter = dangling_ptrs_.find(ptr);
		assert(iter != dangling_ptrs_.end());
		dangling_ptrs_.erase(iter);
#endif
	}

// Assembly:
pushq %rbx
leaq 0x8(%rdi), %rax
movq 0x8(%rdi), %rbx
cmpq %rax, %rbx
je 0x884d
cmpq %rsi, 0x10(%rbx)
je 0x884d
movq (%rbx), %rbx
jmp 0x883d
cmpq %rax, %rbx
je 0x886c
decq 0x18(%rdi)
movq %rbx, %rdi
callq 0x21f0
movl $0x18, %esi
movq %rbx, %rdi
popq %rbx
jmp 0x2160
leaq 0x1d3d(%rip), %rdi      # 0xa5b0
leaq 0x1cdf(%rip), %rsi      # 0xa559
leaq 0x1d4c(%rip), %rcx      # 0xa5cd
movl $0x58, %edx
callq 0x20e0
nop
// File: /workspace/github_cpp_makefile_star2_O3/TwilioDevEd[P]twilio_cpp_demo/include/type_conversion.hh
// Function: utf8_to_ucs2(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
inline std::u16string
utf8_to_ucs2(std::string const& input)
{
        std::wstring_convert<std::codecvt_utf8<char16_t>, char16_t> convert;
        try {
                return convert.from_bytes(input);
        } catch(const std::range_error& e) {
                throw std::range_error(
                        "Failed UCS-2 conversion of message body.  Check all "
                        "characters are valid GSM-7, GSM 8-bit text, or UCS-2 "
                        "characters."
                );
        }
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x68, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl $0x20, %edi
callq 0x20a0
xorl %ecx, %ecx
movl %ecx, 0x8(%rax)
movq $0x10ffff, 0x10(%rax)   # imm = 0x10FFFF
movl %ecx, 0x18(%rax)
leaq 0x384a(%rip), %rdx      # 0x6d18
movq %rdx, (%rax)
leaq 0x20(%rsp), %rdx
movq %rax, -0x18(%rdx)
movq %rdx, -0x10(%rdx)
movq %rcx, -0x8(%rdx)
movb $0x0, (%rdx)
leaq 0x40(%rsp), %rax
movq %rax, -0x10(%rax)
movq %rcx, -0x8(%rax)
movw %cx, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movw %cx, 0x20(%rax)
movq (%r14), %rdx
movq 0x8(%r14), %rcx
addq %rdx, %rcx
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x3610
leaq 0x8(%rsp), %rdi
callq 0x35a8
movq %rbx, %rax
addq $0x68, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x3583
movq %rbx, %rdi
callq 0x2050
movl $0x10, %edi
callq 0x20e0
movq %rax, %r14
leaq 0xebf(%rip), %rsi       # 0x440f
movq %rax, %rdi
callq 0x2250
movq 0x3a91(%rip), %rsi      # 0x6ff0
movq 0x3a42(%rip), %rdx      # 0x6fa8
movq %r14, %rdi
callq 0x21c0
movq %rax, %rbx
jmp 0x357e
movq %rax, %rbx
movq %r14, %rdi
callq 0x22a0
callq 0x2240
leaq 0x8(%rsp), %rdi
callq 0x35a8
movq %rbx, %rdi
callq 0x21d0
movq %rax, %rdi
callq 0x359d
// File: /workspace/github_cpp_makefile_star2_O3/wichtounet[P]articles/src/threads/part4/AtomicCounter.cpp
// Function: main
int main(){
    AtomicCounter counter;

    std::vector<std::thread> threads;
    for(int i = 0; i < 10; ++i){
        threads.push_back(std::thread([&counter](){
            for(int i = 0; i < 500; ++i){
                counter.increment();
            }
        }));
    }

    for(auto& thread : threads){
        thread.join();
    }

    std::cout << counter.get() << std::endl;

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
leaq 0x1c(%rsp), %r12
leaq 0x20(%rsp), %rbx
vxorps %xmm0, %xmm0, %xmm0
movl $0xa, %ebp
leaq 0x2af4(%rip), %r13      # 0x3d88
leaq 0x8(%rsp), %r14
leaq 0x10(%rsp), %r15
movl $0x0, (%r12)
vmovaps %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
movq $0x0, 0x8(%rsp)
movl $0x10, %edi
callq 0x10e0
movq %r13, (%rax)
movq %r12, 0x8(%rax)
movq %rax, 0x10(%rsp)
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x10b0
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x12ee
movq (%rdi), %rax
callq *0x8(%rax)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1410
cmpq $0x0, 0x8(%rsp)
jne 0x13b3
decl %ebp
jne 0x12b2
movq 0x20(%rsp), %rbx
movq 0x28(%rsp), %r14
cmpq %r14, %rbx
je 0x1326
movq %rbx, %rdi
callq 0x1100
addq $0x8, %rbx
jmp 0x1313
movl 0x1c(%rsp), %esi
movq 0x2ca7(%rip), %rdi      # 0x3fd8
callq 0x1110
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x10d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1080
leaq 0x20(%rsp), %rdi
callq 0x13dc
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x139e
jmp 0x139e
jmp 0x139e
movq 0x10(%rsp), %rdi
movq %rax, %rbx
testq %rdi, %rdi
je 0x13a1
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x13a1
cmpq $0x0, 0x8(%rsp)
jne 0x13b3
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x13dc
movq %rbx, %rdi
callq 0x1120
callq 0x1040
// File: /workspace/github_cpp_makefile_star2_O3/cloudinary[P]fuif/encoding/../maniac/compound.h
// Function: FinalPropertySymbolCoder<SimpleBitChance, RacInput24<FileIO>, 15>::read_int(std::vector<int, std::allocator<int>> const&, int, int)
int read_int(const Properties &properties, int min, int max) ATTRIBUTE_HOT {
        if (min == max) { return min; }
        assert(properties.size() == nb_properties);
        FinalCompoundSymbolChances<BitChance,bits> &chances = find_leaf(properties);
        return coder.read_int(chances, min, max);
    }

// Assembly:
movl %edx, %eax
cmpl %ecx, %edx
je 0x55ee
subq $0x18, %rsp
movq 0x4030(%rdi), %rdx
movq (%rdx), %rdx
movzwl (%rdx), %r9d
cmpw $-0x1, %r9w
je 0x55b0
movq (%rsi), %rsi
movq %rdx, %r8
movswq %r9w, %r9
movl (%rsi,%r9,4), %r9d
xorl %r10d, %r10d
cmpl 0x4(%r8), %r9d
setle %r10b
movzwl 0x2(%r8), %r8d
leaq (%rdx,%r8,8), %r8
leaq (%r8,%r10,8), %r8
movzwl (%r8), %r9d
cmpw $-0x1, %r9w
jne 0x5583
jmp 0x55b3
movq %rdx, %r8
movzwl 0x2(%r8), %esi
leaq (%rsi,%rsi), %rdx
shll $0x6, %esi
subq %rdx, %rsi
addq 0x4018(%rdi), %rsi
movq (%rdi), %r8
addq $0x8, %rdi
movq %rsp, %rdx
movq %rdi, (%rdx)
movq %r8, 0x8(%rdx)
movq %rsi, 0x10(%rdx)
movq %rdx, %rdi
movl %eax, %esi
movl %ecx, %edx
callq 0x5886
addq $0x18, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O3/cloudinary[P]fuif/image/image.cpp
// Function: colormodel_name(int, int)
const char * colormodel_name(int colormodel, int nb_channels) {
    if (nb_channels == 1) return "Grayscale";
    else if (nb_channels == 2) return "Grayscale+alpha";

    switch (colormodel>>4) {
        case 7: return "Custom other";
        case 6: return "Custom CIE";
        case 5: return "Custom CMYK";
        case 4: return "Custom RGB";
        case 3: return "[RESERVED]";
        case 2:
            if (nb_channels == 3) {
                if (colormodel & 1) return "CIEXYZ";
                else return "CIELAB";
            } else if (nb_channels == 4) {
                if (colormodel & 1) return "CIEXYZ+alpha";
                else return "CIELAB+alpha";
            }
        case 1:
            if (nb_channels == 3) return "CMY";
            else if (nb_channels == 4) return "CMYK";
            else if (nb_channels == 5) return "CMYK+alpha";
            else return "CMYK+";

        case 0:
        default:
            if (nb_channels == 3) return "RGB";
            else if (nb_channels == 4) return "RGBA";
            else return "RGB+";
    }
}

// Assembly:
cmpl $0x1, %esi
je 0x5f5e
cmpl $0x2, %esi
jne 0x5f66
leaq 0x1f0e9(%rip), %rax     # 0x25046
retq
leaq 0x1f0d7(%rip), %rax     # 0x2503c
retq
movl %edi, %eax
sarl $0x4, %eax
decl %eax
cmpl $0x6, %eax
ja 0x5fb7
leaq 0x1f08b(%rip), %rcx     # 0x25004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
addl $-0x3, %esi
cmpl $0x3, %esi
jae 0x600e
movl %esi, %eax
leaq 0x1f089(%rip), %rcx     # 0x25020
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
retq
leaq 0x1f0c8(%rip), %rax     # 0x2506e
retq
leaq 0x1f0d7(%rip), %rax     # 0x25085
retq
leaq 0x1f0c4(%rip), %rax     # 0x2507a
retq
cmpl $0x4, %esi
leaq 0x1f10c(%rip), %rax     # 0x250cd
leaq 0x1f10a(%rip), %rcx     # 0x250d2
cmoveq %rax, %rcx
cmpl $0x3, %esi
leaq 0x1f0ab(%rip), %rax     # 0x25081
cmovneq %rcx, %rax
retq
cmpl $0x5, %esi
je 0x602d
cmpl $0x4, %esi
je 0x6016
cmpl $0x3, %esi
jne 0x600e
testb $0x1, %dil
leaq 0x1f0a2(%rip), %rcx     # 0x25097
leaq 0x1f094(%rip), %rax     # 0x25090
jmp 0x6028
leaq 0x1f05e(%rip), %rax     # 0x25063
retq
leaq 0x1f049(%rip), %rax     # 0x25056
retq
leaq 0x1f0b2(%rip), %rax     # 0x250c7
retq
testb $0x1, %dil
leaq 0x1f08a(%rip), %rcx     # 0x250ab
leaq 0x1f076(%rip), %rax     # 0x2509e
cmoveq %rcx, %rax
retq
leaq 0x1f088(%rip), %rax     # 0x250bc
retq
// File: /workspace/github_cpp_makefile_star2_O3/cloudinary[P]fuif/image/image.cpp
// Function: Channel::actual_minmax(short*, short*) const
void Channel::actual_minmax(pixel_type *min, pixel_type *max) const {
    pixel_type realmin=LARGEST_VAL;
    pixel_type realmax=SMALLEST_VAL;
    for (int i=0; i<data.size(); i++) {
        if (data[i] < realmin) realmin = data[i];
        if (data[i] > realmax) realmax = data[i];
    }
    *min = realmin;
    *max = realmax;
}

// Assembly:
movq (%rdi), %rax
movq 0x8(%rdi), %rcx
subq %rax, %rcx
je 0x60a7
sarq %rcx
cmpq $0x1, %rcx
adcq $0x0, %rcx
movw $0x7fff, %di            # imm = 0x7FFF
movw $0x8001, %r10w          # imm = 0x8001
xorl %r8d, %r8d
movzwl (%rax,%r8,2), %r9d
cmpw %di, %r9w
cmovll %r9d, %edi
cmpw %r10w, %r9w
cmovlel %r10d, %r9d
incq %r8
movl %r9d, %r10d
cmpq %r8, %rcx
jne 0x6085
jmp 0x60b0
movw $0x8001, %r9w           # imm = 0x8001
movw $0x7fff, %di            # imm = 0x7FFF
movw %di, (%rsi)
movw %r9w, (%rdx)
retq
// File: /workspace/github_cpp_makefile_star2_O3/cloudinary[P]fuif/image/image.cpp
// Function: Image::undo_transforms(int)
void Image::undo_transforms(int keep) {
    while ( transform.size() > keep ) {
            Transform t = transform.back();
            v_printf(4,"Undoing transform %s\n",t.name());
            bool result = t.apply(*this, true);
            if (result == false) {
                e_printf("Error while undoing transform %s.\n",t.name());
                error = true;
                return;
            }
            v_printf(8,"Undoing transform %s: done\n",t.name());
            transform.pop_back();
    }
    if (!keep) { // clamp the values to the valid range (lossy compression can produce values outside the range)
        for (int i=0; i<channel.size(); i++) {
            for (int j=0; j<channel[i].data.size(); j++) {
                channel[i].data[j] = CLAMP(channel[i].data[j], minval, maxval);
            }
        }
    }
//    recompute_minmax();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movl %esi, 0x4(%rsp)
movslq %esi, %rbp
leaq 0x2a541(%rip), %r14     # 0x30618
leaq 0x1f035(%rip), %r15     # 0x25113
leaq 0x8(%rsp), %r12
movq 0x20(%rbx), %rsi
movq %rsi, %rax
subq 0x18(%rbx), %rax
sarq $0x5, %rax
cmpq %rbp, %rax
jbe 0x61c7
movl -0x20(%rsi), %eax
movl %eax, 0x8(%rsp)
addq $-0x18, %rsi
leaq 0x10(%rsp), %rdi
callq 0x63d8
movslq 0x8(%rsp), %rax
movq (%r14), %rcx
shlq $0x5, %rax
movq (%rcx,%rax), %rdx
movl $0x4, %edi
movq %r15, %rsi
xorl %eax, %eax
callq 0x1cede
movq %r12, %rdi
movq %rbx, %rsi
movl $0x1, %edx
callq 0xd8ea
movl %eax, %r13d
movslq 0x8(%rsp), %rax
movq (%r14), %rcx
shlq $0x5, %rax
movq (%rcx,%rax), %rdx
testb %r13b, %r13b
je 0x618d
movl $0x8, %edi
leaq 0x1efe9(%rip), %rsi     # 0x2514c
xorl %eax, %eax
callq 0x1cede
movq 0x20(%rbx), %rax
leaq -0x20(%rax), %rcx
movq %rcx, 0x20(%rbx)
movq -0x18(%rax), %rdi
testq %rdi, %rdi
je 0x61a5
movq -0x8(%rax), %rsi
subq %rdi, %rsi
callq 0x32c0
jmp 0x61a5
leaq 0x1ef95(%rip), %rdi     # 0x25129
movq %rdx, %rsi
xorl %eax, %eax
callq 0x379e
movb $0x1, 0xa8(%rbx)
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x61bc
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x32c0
testb %r13b, %r13b
jne 0x60e3
jmp 0x623a
cmpl $0x0, 0x4(%rsp)
jne 0x623a
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
subq %rax, %rcx
je 0x623a
sarq $0x6, %rcx
movl 0x5c(%rbx), %edx
cmpq $0x1, %rcx
adcq $0x0, %rcx
xorl %esi, %esi
movq %rsi, %r8
shlq $0x6, %r8
movq (%rax,%r8), %rdi
movq 0x8(%rax,%r8), %r8
subq %rdi, %r8
je 0x6232
sarq %r8
cmpq $0x1, %r8
adcq $0x0, %r8
xorl %r9d, %r9d
movswl (%rdi,%r9,2), %r10d
movl 0x60(%rbx), %r11d
cmpl %r10d, %r11d
cmovgel %r10d, %r11d
cmpl %r10d, %edx
cmovgl %edx, %r11d
movw %r11w, (%rdi,%r9,2)
incq %r9
cmpq %r9, %r8
jne 0x620e
incq %rsi
cmpq %rcx, %rsi
jne 0x61eb
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x624b
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x6265
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x32c0
movq %rbx, %rdi
callq 0x3590
nop
// File: /workspace/github_cpp_makefile_star2_O3/cloudinary[P]fuif/image/image.cpp
// Function: Image::do_transform(Transform const&)
bool Image::do_transform(const Transform &tr) {
    Transform t = tr;
    bool did_it = t.apply(*this, false);
    if (did_it) transform.push_back(t);
    return did_it;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r14
movl (%rsi), %eax
leaq 0x10(%rsp), %rdi
movl %eax, -0x8(%rdi)
addq $0x8, %rsi
callq 0x63d8
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0xd8ea
movl %eax, %ebx
testb %al, %al
je 0x62b1
addq $0x18, %r14
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x63a0
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x62c8
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x32c0
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x62ec
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x32c0
movq %rbx, %rdi
callq 0x3590
// File: /workspace/github_cpp_makefile_star2_O3/cloudinary[P]fuif/image/image.cpp
// Function: Image::recompute_downscales()
void Image::recompute_downscales() {
    downscales[0] = nb_meta_channels + nb_channels -1; // we have an LQIP when each component has had its first scan
    for (int s=1; s<6; s++) {
        downscales[s] = channel.size()-1;
        for (int k=downscales[s-1]; k<channel.size(); k++) {
            // has to be possible to decode downscaled image with a buffer the size of the final image, so once we need a larger buffer, we went too far
            if ((1<<channel[k].hcshift) < RESPONSIVE_SIZE(s) || (1<<channel[k].vcshift) < RESPONSIVE_SIZE(s)) break;

            // all channels should ideally be available in the required size (though chroma subsampling may cause this to be not true)
            if ((1<<channel[k].hcshift) == RESPONSIVE_SIZE(s) && (1<<channel[k].vcshift) == RESPONSIVE_SIZE(s)) downscales[s] = k;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl 0x6c(%rdi), %eax
movl 0x64(%rdi), %ecx
leal -0x1(%rax,%rcx), %r9d
movl %r9d, 0x90(%rdi)
movq (%rdi), %rdx
movq 0x8(%rdi), %rsi
subq %rdx, %rsi
sarq $0x6, %rsi
leal -0x1(%rsi), %r8d
addq $0x38, %rdx
movl $0x1, %eax
movl %r8d, 0x90(%rdi,%rax,4)
movslq %r9d, %r10
movl %r8d, %r9d
cmpq %r10, %rsi
jbe 0x6391
movl $0x20, %r11d
movl %eax, %ecx
shrl %cl, %r11d
movq %r10, %rbx
shlq $0x6, %rbx
addq %rdx, %rbx
movl %r8d, %r9d
movb -0x4(%rbx), %cl
movl $0x1, %ebp
shll %cl, %ebp
cmpl %r11d, %ebp
jl 0x6391
movb (%rbx), %cl
movl $0x1, %r14d
shll %cl, %r14d
cmpl %r11d, %r14d
jl 0x6391
xorl %r11d, %ebp
xorl %r11d, %r14d
orl %ebp, %r14d
jne 0x6385
movl %r10d, 0x90(%rdi,%rax,4)
movl %r10d, %r9d
incq %r10
addq $0x40, %rbx
cmpq %r10, %rsi
ja 0x6350
incq %rax
cmpq $0x6, %rax
jne 0x6325
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/cloudinary[P]fuif/transform/subsample.h
// Function: meta_subsample(Image&, std::vector<int, std::allocator<int>>)
void meta_subsample(Image &input, std::vector<int> parameters) {
    check_subsample_parameters(parameters);
    if (parameters.size())
    for (int i=0; i<parameters.size(); i+=4) {
        int c1 = parameters[i+0];
        int c2 = parameters[i+1];
        int srh = parameters[i+2];
        int srv = parameters[i+3];
        assert (srh == 1 || srh == 2);
        assert (srv == 1 || srv == 2);
        int srhshift = (srh==1?0:1);
        int srvshift = (srv==1?0:1);
        for (int c=c1; c<=c2; c++) {
          input.channel[c].w += srh-1;
          input.channel[c].w /= srh;
          input.channel[c].h += srv-1;
          input.channel[c].h /= srv;
          input.channel[c].hshift += srhshift;
          input.channel[c].vshift += srvshift;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x69f2
movq (%r14), %rcx
movq 0x8(%r14), %rsi
subq %rcx, %rsi
je 0x752c
sarq $0x2, %rsi
movq (%rbx), %rdi
addq $0x18, %rdi
xorl %r8d, %r8d
movdqa 0x1dd72(%rip), %xmm0    # 0x25220
movslq (%rcx,%r8,4), %rax
movl 0x4(%rcx,%r8,4), %r9d
cmpl %r9d, %eax
jg 0x7523
movq 0x8(%rcx,%r8,4), %xmm1
movd %xmm1, %r10d
pshufd $0x55, %xmm1, %xmm2     # xmm2 = xmm1[1,1,1,1]
pcmpeqd %xmm0, %xmm1
pandn %xmm0, %xmm1
leal -0x1(%r10), %r11d
movd %xmm2, %ebx
leal -0x1(%rbx), %ebp
movq %rax, %r14
shlq $0x6, %r14
addq %rdi, %r14
subl %eax, %r9d
incl %r9d
movl (%r14), %eax
addl %r11d, %eax
cltd
idivl %r10d
movl %eax, (%r14)
movl 0x4(%r14), %eax
addl %ebp, %eax
cltd
idivl %ebx
movl %eax, 0x4(%r14)
movq 0x14(%r14), %xmm2
paddd %xmm1, %xmm2
movq %xmm2, 0x14(%r14)
addq $0x40, %r14
decl %r9d
jne 0x74f0
addq $0x4, %r8
cmpq %r8, %rsi
ja 0x74ae
popq %rbx
popq %r14
popq %rbp
retq