LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/algorithm-archivists[P]GathVL/src/scene.cpp
// Function: scene::scene(vec, color)
scene::scene(vec scene_size, color bg_color)
    : size(scene_size), bg_clr(bg_color),
      surface(cairo_image_surface_create(CAIRO_FORMAT_ARGB32,
      static_cast<int>(size.x), static_cast<int>(size.y)),
      cairo_surface_destroy),
      context(cairo_create(surface.get()), cairo_destroy) {

    layers.emplace_back();
    cairo_set_line_width(context.get(), 3);
    cairo_set_font_size(context.get(), 50.0);
    cairo_set_line_join(context.get(), CAIRO_LINE_JOIN_BEVEL);
    cairo_set_line_cap(context.get(), CAIRO_LINE_CAP_ROUND);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
movsd %xmm0, (%rdi)
movsd %xmm1, 0x8(%rdi)
movaps 0x20(%rsp), %xmm2
movaps 0x30(%rsp), %xmm3
movups %xmm2, 0x10(%rdi)
movups %xmm3, 0x20(%rdi)
leaq 0x30(%rdi), %rbx
xorps %xmm2, %xmm2
movups %xmm2, 0x30(%rdi)
movq $0x0, 0x40(%rdi)
cvttsd2si %xmm0, %esi
cvttsd2si %xmm1, %edx
xorl %edi, %edi
callq 0x54f0
movq 0x251ec(%rip), %rcx     # 0x2cfc8
movq %rcx, 0x48(%r14)
movq %rax, 0x50(%r14)
movq %rax, %rdi
callq 0x5700
movq 0x251f5(%rip), %rcx     # 0x2cfe8
movq %rcx, 0x58(%r14)
movq %rax, 0x60(%r14)
movq 0x38(%r14), %rsi
cmpq 0x40(%r14), %rsi
je 0x7e1c
xorpd %xmm0, %xmm0
movupd %xmm0, (%rsi)
movq $0x0, 0x10(%rsi)
addq $0x18, 0x38(%r14)
jmp 0x7e24
movq %rbx, %rdi
callq 0x8166
movq 0x60(%r14), %rdi
movsd 0x1b4c0(%rip), %xmm0    # 0x232f0
callq 0x54b0
movq 0x60(%r14), %rdi
movsd 0x1b4b7(%rip), %xmm0    # 0x232f8
callq 0x5410
movq 0x60(%r14), %rdi
movl $0x2, %esi
callq 0x5420
movq 0x60(%r14), %rdi
movl $0x1, %esi
callq 0x5240
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %r15
jmp 0x7e8a
movq %rax, %r15
jmp 0x7e9f
movq %rax, %r15
movq 0x60(%r14), %rdi
testq %rdi, %rdi
je 0x7e82
callq *0x58(%r14)
movq $0x0, 0x60(%r14)
movq 0x50(%r14), %rdi
testq %rdi, %rdi
je 0x7e97
callq *0x48(%r14)
movq $0x0, 0x50(%r14)
movq %rbx, %rdi
callq 0x68fc
movq %r15, %rdi
callq 0x5510
jmp 0x7eb1
movq %rax, %rdi
callq 0x68f1
nop
// File: /workspace/github_c_makefile_star2_O1/algorithm-archivists[P]GathVL/src/scene.cpp
// Function: scene::draw()
void scene::draw() {
    cairo_set_source_rgba(context.get(), bg_clr.r, bg_clr.g, bg_clr.b,
                            bg_clr.a);
    cairo_set_operator(context.get(), CAIRO_OPERATOR_SOURCE);
    cairo_paint(context.get());

    for (const auto& l : layers) {
        l.draw(context.get());
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x60(%rdi), %rdi
movsd 0x10(%rbx), %xmm0
movsd 0x18(%rbx), %xmm1
movsd 0x20(%rbx), %xmm2
movsd 0x28(%rbx), %xmm3
callq 0x5330
movq 0x60(%rbx), %rdi
movl $0x1, %esi
callq 0x5050
movq 0x60(%rbx), %rdi
callq 0x51a0
movq 0x30(%rbx), %r14
movq 0x38(%rbx), %r15
cmpq %r15, %r14
je 0x7f15
movq 0x60(%rbx), %rsi
movq %r14, %rdi
callq 0x7c44
addq $0x18, %r14
jmp 0x7efe
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O1/algorithm-archivists[P]GathVL/src/objects/arc.cpp
// Function: arc::draw(_cairo*) const
void arc::draw(cairo_t *ctx) const {
    cairo_save(ctx);
    cairo_set_source_rgba(ctx, clr.r, clr.g, clr.b, clr.a);

    if (size.x < size.y && (size.x != 0 || size.y != 0)) {
        cairo_scale(ctx, size.x / size.y, 1.0);
        cairo_arc(ctx, location.x, location.y, size.y, angles.x, angles.y);
    } else if (size.x > size.y && (size.x != 0 || size.y != 0)) {
        cairo_scale(ctx, 1.0, size.y / size.x);
        cairo_arc(ctx, location.x, location.y, size.x, angles.x, angles.y);
    } else if (size.x == size.y && size.x != 0) {
        cairo_arc(ctx, location.x, location.y, size.x, angles.x, angles.y);
    }

    cairo_stroke(ctx);
    cairo_restore(ctx);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x54c0
movsd 0x20(%r14), %xmm0
movsd 0x28(%r14), %xmm1
movsd 0x30(%r14), %xmm2
movsd 0x38(%r14), %xmm3
movq %rbx, %rdi
callq 0x5330
movsd 0x50(%r14), %xmm2
movsd 0x58(%r14), %xmm1
ucomisd %xmm2, %xmm1
jbe 0x904c
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm2
jne 0x9088
jp 0x9088
ucomisd %xmm0, %xmm1
jne 0x9088
jp 0x9088
ucomisd %xmm1, %xmm2
jbe 0x9066
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm2
jne 0x90b4
jp 0x90b4
ucomisd %xmm0, %xmm1
jne 0x90b4
jp 0x90b4
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm2
jne 0x9072
jnp 0x90ee
ucomisd %xmm1, %xmm2
jne 0x90ee
jp 0x90ee
movsd 0x40(%r14), %xmm0
movsd 0x48(%r14), %xmm1
jmp 0x90da
divsd %xmm1, %xmm2
movsd 0x1a284(%rip), %xmm1    # 0x23318
movq %rbx, %rdi
movapd %xmm2, %xmm0
callq 0x5690
movsd 0x40(%r14), %xmm0
movsd 0x48(%r14), %xmm1
movsd 0x58(%r14), %xmm2
jmp 0x90da
divsd %xmm2, %xmm1
movsd 0x1a258(%rip), %xmm0    # 0x23318
movq %rbx, %rdi
callq 0x5690
movsd 0x40(%r14), %xmm0
movsd 0x48(%r14), %xmm1
movsd 0x50(%r14), %xmm2
movsd 0x60(%r14), %xmm3
movsd 0x68(%r14), %xmm4
movq %rbx, %rdi
callq 0x5340
movq %rbx, %rdi
callq 0x5500
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x5610
nop
// File: /workspace/github_c_makefile_star2_O1/algorithm-archivists[P]GathVL/src/objects/arrow.cpp
// Function: arrow::draw(_cairo*) const
void arrow::draw(cairo_t *ctx) const {
    cairo_save(ctx);
    cairo_set_source_rgba(ctx, clr.r, clr.g, clr.b, clr.a);
    cairo_translate(ctx, location.x, location.y);
    cairo_rotate(ctx, rotation);

    cairo_move_to(ctx, 0, 0);
    cairo_line_to(ctx, length, 0);
    cairo_rotate(ctx, -M_PI / 4);
    cairo_move_to(ctx, 0, 0);
    cairo_line_to(ctx, 0.25 * length, 0);
    cairo_move_to(ctx, 0, 0);
    cairo_rotate(ctx, M_PI / 2);
    cairo_line_to(ctx, 0.25 * length, 0);

    cairo_stroke(ctx);
    cairo_restore(ctx);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x54c0
movsd 0x20(%r14), %xmm0
movsd 0x28(%r14), %xmm1
movsd 0x30(%r14), %xmm2
movsd 0x38(%r14), %xmm3
movq %rbx, %rdi
callq 0x5330
movsd 0x40(%r14), %xmm0
movsd 0x48(%r14), %xmm1
movq %rbx, %rdi
callq 0x5180
movsd 0x58(%r14), %xmm0
movq %rbx, %rdi
callq 0x5490
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
movq %rbx, %rdi
callq 0x5570
movsd 0x50(%r14), %xmm0
xorps %xmm1, %xmm1
movq %rbx, %rdi
callq 0x5300
movsd 0x1a1a1(%rip), %xmm0    # 0x23348
movq %rbx, %rdi
callq 0x5490
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
movq %rbx, %rdi
callq 0x5570
movsd 0x50(%r14), %xmm0
mulsd 0x1a185(%rip), %xmm0    # 0x23350
xorps %xmm1, %xmm1
movq %rbx, %rdi
callq 0x5300
xorpd %xmm0, %xmm0
xorps %xmm1, %xmm1
movq %rbx, %rdi
callq 0x5570
movsd 0x1a16b(%rip), %xmm0    # 0x23358
movq %rbx, %rdi
callq 0x5490
movsd 0x1a153(%rip), %xmm0    # 0x23350
mulsd 0x50(%r14), %xmm0
xorps %xmm1, %xmm1
movq %rbx, %rdi
callq 0x5300
movq %rbx, %rdi
callq 0x5500
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x5610
nop
// File: /workspace/github_c_makefile_star2_O1/algorithm-archivists[P]GathVL/src/objects/curve.cpp
// Function: curve::draw(_cairo*) const
void curve::draw(cairo_t *ctx) const {
    cairo_save(ctx);
    cairo_set_source_rgba(ctx, clr.r, clr.g, clr.b, clr.a);
    cairo_translate(ctx, origin.x, origin.y);

    if (!points.empty()) {
        cairo_move_to(ctx, points[0].x, -points[0].y);
    }

    for (const auto& point : points) {
        cairo_line_to(ctx, point.x, -point.y);
        cairo_move_to(ctx, point.x, -point.y);
    }

    cairo_stroke(ctx);
    cairo_restore(ctx);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x54c0
movsd 0x20(%r14), %xmm0
movsd 0x28(%r14), %xmm1
movsd 0x30(%r14), %xmm2
movsd 0x38(%r14), %xmm3
movq %rbx, %rdi
callq 0x5330
movsd 0x40(%r14), %xmm0
movsd 0x48(%r14), %xmm1
movq %rbx, %rdi
callq 0x5180
movq 0x50(%r14), %rax
cmpq 0x58(%r14), %rax
je 0x92b5
movsd (%rax), %xmm0
movsd 0x8(%rax), %xmm1
xorps 0x1a033(%rip), %xmm1    # 0x232e0
movq %rbx, %rdi
callq 0x5570
movq 0x50(%r14), %r15
movq 0x58(%r14), %r14
cmpq %r14, %r15
je 0x92ff
movsd (%r15), %xmm0
movsd 0x8(%r15), %xmm1
movaps 0x1a00c(%rip), %xmm2    # 0x232e0
xorps %xmm2, %xmm1
movq %rbx, %rdi
callq 0x5300
movsd (%r15), %xmm0
movsd 0x8(%r15), %xmm1
xorps 0x19fef(%rip), %xmm1    # 0x232e0
movq %rbx, %rdi
callq 0x5570
addq $0x10, %r15
jmp 0x92bd
movq %rbx, %rdi
callq 0x5500
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x5610
// File: /workspace/github_c_makefile_star2_O1/algorithm-archivists[P]GathVL/src/objects/ellipse.cpp
// Function: ellipse::draw(_cairo*) const
void ellipse::draw(cairo_t *ctx) const {
    cairo_save(ctx);
    cairo_set_source_rgba(ctx, clr.r, clr.g, clr.b, clr.a);
    cairo_translate(ctx, location.x, location.y);
    cairo_rotate(ctx, rotation);

    if (size.x < size.y && (size.x != 0 || size.y != 0)) {
        cairo_scale(ctx, size.x / size.y, 1.0);
        cairo_arc(ctx, 0.0, 0.0, size.y, angles.x, angles.y);
    } else if (size.x > size.y && (size.x != 0 || size.y != 0)) {
        cairo_scale(ctx, 1.0, size.y / size.x);
        cairo_arc(ctx, 0.0, 0.0, size.x, angles.x, angles.y);
    } else if (size.x == size.y && size.x != 0) {
        cairo_arc(ctx, 0.0, 0.0, size.x, angles.x, angles.y);
    }

    if (fill) {
        cairo_fill(ctx);
    }

    cairo_stroke(ctx);
    cairo_restore(ctx);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x54c0
movsd 0x20(%r14), %xmm0
movsd 0x28(%r14), %xmm1
movsd 0x30(%r14), %xmm2
movsd 0x38(%r14), %xmm3
movq %rbx, %rdi
callq 0x5330
movsd 0x40(%r14), %xmm0
movsd 0x48(%r14), %xmm1
movq %rbx, %rdi
callq 0x5180
movsd 0x70(%r14), %xmm0
movq %rbx, %rdi
callq 0x5490
movsd 0x50(%r14), %xmm2
movsd 0x58(%r14), %xmm1
ucomisd %xmm2, %xmm1
jbe 0x940e
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm2
jne 0x943e
jp 0x943e
ucomisd %xmm0, %xmm1
jne 0x943e
jp 0x943e
ucomisd %xmm1, %xmm2
jbe 0x9428
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm2
jne 0x945e
jp 0x945e
ucomisd %xmm0, %xmm1
jne 0x945e
jp 0x945e
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm2
jne 0x9434
jnp 0x9494
ucomisd %xmm1, %xmm2
jne 0x9494
jnp 0x9478
jmp 0x9494
divsd %xmm1, %xmm2
movsd 0x19ece(%rip), %xmm1    # 0x23318
movq %rbx, %rdi
movapd %xmm2, %xmm0
callq 0x5690
movsd 0x58(%r14), %xmm2
jmp 0x9478
divsd %xmm2, %xmm1
movsd 0x19eae(%rip), %xmm0    # 0x23318
movq %rbx, %rdi
callq 0x5690
movsd 0x50(%r14), %xmm2
movsd 0x60(%r14), %xmm3
movsd 0x68(%r14), %xmm4
xorpd %xmm0, %xmm0
xorpd %xmm1, %xmm1
movq %rbx, %rdi
callq 0x5340
cmpb $0x1, 0x78(%r14)
jne 0x94a3
movq %rbx, %rdi
callq 0x5670
movq %rbx, %rdi
callq 0x5500
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x5610
// File: /workspace/github_c_makefile_star2_O1/algorithm-archivists[P]GathVL/src/objects/../../include/stb_image_resize.h
// Function: stbir_resize_subpixel
STBIRDEF int stbir_resize_subpixel(const void *input_pixels , int input_w , int input_h , int input_stride_in_bytes,
                                         void *output_pixels, int output_w, int output_h, int output_stride_in_bytes,
                                   stbir_datatype datatype,
                                   int num_channels, int alpha_channel, int flags,
                                   stbir_edge edge_mode_horizontal, stbir_edge edge_mode_vertical, 
                                   stbir_filter filter_horizontal,  stbir_filter filter_vertical,
                                   stbir_colorspace space, void *alloc_context,
                                   float x_scale, float y_scale,
                                   float x_offset, float y_offset)
{
    float transform[4];
    transform[0] = x_scale;
    transform[1] = y_scale;
    transform[2] = x_offset;
    transform[3] = y_offset;
    return stbir__resize_arbitrary(alloc_context, input_pixels, input_w, input_h, input_stride_in_bytes,
        output_pixels, output_w, output_h, output_stride_in_bytes,
        0,0,1,1,transform,num_channels,alpha_channel,flags, datatype, filter_horizontal, filter_vertical,
        edge_mode_horizontal, edge_mode_vertical, space);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl 0x70(%rsp), %ebx
movl 0x78(%rsp), %r15d
movl 0x60(%rsp), %r12d
movl 0x90(%rsp), %r13d
movl 0x98(%rsp), %ebp
movq %rsp, %r14
movss %xmm0, (%r14)
movss %xmm1, 0x4(%r14)
movss %xmm2, 0x8(%r14)
movss %xmm3, 0xc(%r14)
movl 0x80(%rsp), %r11d
movl 0x88(%rsp), %r10d
movl 0xa0(%rsp), %eax
movss 0x1690a(%rip), %xmm2    # 0x2337c
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
movaps %xmm2, %xmm3
pushq %rax
pushq %r10
pushq %r11
pushq %rbp
pushq %r13
pushq %r12
pushq %r15
pushq %rbx
movl 0xa8(%rsp), %eax
pushq %rax
pushq %r14
movl 0xa8(%rsp), %eax
pushq %rax
movl 0xa8(%rsp), %eax
pushq %rax
callq 0xb497
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/algorithm-archivists[P]GathVL/src/objects/../../include/stb_image_resize.h
// Function: stbir__get_filter_pixel_width(stbir_filter, float)
static int stbir__get_filter_pixel_width(stbir_filter filter, float scale)
{
    STBIR_ASSERT(filter != 0);
    STBIR_ASSERT(filter < STBIR__ARRAY_SIZE(stbir__filter_info_table));

    if (stbir__use_upsampling(scale))
        return (int)ceil(stbir__filter_info_table[filter].support(1/scale) * 2);
    else
        return (int)ceil(stbir__filter_info_table[filter].support(scale) * 2 / scale);
}

// Assembly:
pushq %rax
testl %edi, %edi
je 0x1cdb1
cmpl $0x6, %edi
jae 0x1cdd0
movaps %xmm0, %xmm1
movl %edi, %eax
shlq $0x4, %rax
ucomiss 0x660d(%rip), %xmm0     # 0x2337c
leaq 0xfd5a(%rip), %rcx      # 0x2cad0
movq 0x8(%rax,%rcx), %rax
ja 0x1cd94
movaps %xmm1, %xmm0
movss %xmm1, 0x4(%rsp)
callq *%rax
addss %xmm0, %xmm0
divss 0x4(%rsp), %xmm0
jmp 0x1cda6
movss 0x65e0(%rip), %xmm0     # 0x2337c
divss %xmm1, %xmm0
callq *%rax
addss %xmm0, %xmm0
callq 0x52b0
cvttss2si %xmm0, %eax
popq %rcx
retq
leaq 0x8167(%rip), %rdi      # 0x24f1f
leaq 0x808b(%rip), %rsi      # 0x24e4a
leaq 0x81c8(%rip), %rcx      # 0x24f8e
movl $0x372, %edx            # imm = 0x372
callq 0x5130
leaq 0x8163(%rip), %rdi      # 0x24f3a
leaq 0x806c(%rip), %rsi      # 0x24e4a
leaq 0x81a9(%rip), %rcx      # 0x24f8e
movl $0x373, %edx            # imm = 0x373
callq 0x5130
// File: /workspace/github_c_makefile_star2_O1/algorithm-archivists[P]GathVL/src/objects/../../include/stb_image_resize.h
// Function: stbir__filter_trapezoid(float, float)
static float stbir__filter_trapezoid(float x, float scale)
{
    float halfscale = scale / 2;
    float t = 0.5f + halfscale;
    STBIR_ASSERT(scale <= 1);

    x = (float)fabs(x);

    if (x >= t)
        return 0;
    else
    {
        float r = 0.5f - halfscale;
        if (x <= r)
            return 1;
        else
            return (t - x) / scale;
    }
}

// Assembly:
movss 0x6581(%rip), %xmm2     # 0x2337c
ucomiss %xmm1, %xmm2
jb 0x1ce4e
movss 0x6578(%rip), %xmm4     # 0x23380
movaps %xmm1, %xmm5
mulss %xmm4, %xmm5
movaps %xmm5, %xmm3
andps 0x6737(%rip), %xmm0     # 0x23550
addss %xmm4, %xmm3
xorps %xmm2, %xmm2
ucomiss %xmm3, %xmm0
jae 0x1ce4a
subss %xmm5, %xmm4
subss %xmm0, %xmm3
divss %xmm1, %xmm3
cmpnless %xmm4, %xmm0
andps %xmm0, %xmm3
movss 0x653b(%rip), %xmm1     # 0x2337c
andnps %xmm1, %xmm0
orps %xmm3, %xmm0
movaps %xmm0, %xmm2
movaps %xmm2, %xmm0
retq
pushq %rax
leaq 0x816f(%rip), %rdi      # 0x24fc5
leaq 0x7fed(%rip), %rsi      # 0x24e4a
leaq 0x816c(%rip), %rcx      # 0x24fd0
movl $0x2f8, %edx            # imm = 0x2F8
callq 0x5130
// File: /workspace/github_c_makefile_star2_O1/algorithm-archivists[P]GathVL/src/objects/../../include/stb_image_resize.h
// Function: stbir__filter_cubic(float, float)
static float stbir__filter_cubic(float x, float s)
{
    STBIR__UNUSED_PARAM(s);

    x = (float)fabs(x);

    if (x < 1.0f)
        return (4 + x*x*(3*x - 6))/6;
    else if (x < 2.0f)
        return (8 + x*(-12 + x*(6 - x)))/6;

    return (0.0f);
}

// Assembly:
movaps %xmm0, %xmm1
movaps 0x6672(%rip), %xmm2     # 0x23550
andps %xmm0, %xmm2
movss 0x6493(%rip), %xmm0     # 0x2337c
ucomiss %xmm2, %xmm0
jbe 0x1cf1b
mulss %xmm1, %xmm1
movss 0x648e(%rip), %xmm0     # 0x23388
mulss %xmm2, %xmm0
addss 0x6496(%rip), %xmm0     # 0x2339c
mulss %xmm1, %xmm0
addss 0x648e(%rip), %xmm0     # 0x233a0
divss 0x6476(%rip), %xmm0     # 0x23390
retq
xorps %xmm0, %xmm0
movss 0x6466(%rip), %xmm1     # 0x2338c
ucomiss %xmm2, %xmm1
jbe 0x1cf56
movss 0x645d(%rip), %xmm1     # 0x23390
movaps %xmm1, %xmm0
subss %xmm2, %xmm0
mulss %xmm2, %xmm0
addss 0x644e(%rip), %xmm0     # 0x23394
mulss %xmm2, %xmm0
addss 0x6446(%rip), %xmm0     # 0x23398
divss %xmm1, %xmm0
retq
// File: /workspace/github_c_makefile_star2_O1/algorithm-archivists[P]GathVL/src/objects/../../include/stb_image_resize.h
// Function: stbir__filter_mitchell(float, float)
static float stbir__filter_mitchell(float x, float s)
{
    STBIR__UNUSED_PARAM(s);

    x = (float)fabs(x);

    if (x < 1.0f)
        return (16 + x*x*(21 * x - 36))/18;
    else if (x < 2.0f)
        return (32 + x*(-60 + x*(36 - 7*x)))/18;

    return (0.0f);
}

// Assembly:
movaps %xmm0, %xmm1
movaps 0x6573(%rip), %xmm2     # 0x23550
andps %xmm0, %xmm2
movss 0x6394(%rip), %xmm0     # 0x2337c
ucomiss %xmm2, %xmm0
jbe 0x1d013
mulss %xmm1, %xmm1
movss 0x63cb(%rip), %xmm0     # 0x233c4
mulss %xmm2, %xmm0
addss 0x63c3(%rip), %xmm0     # 0x233c8
mulss %xmm1, %xmm0
addss 0x63bb(%rip), %xmm0     # 0x233cc
jmp 0x1d04f
xorps %xmm0, %xmm0
movss 0x636e(%rip), %xmm1     # 0x2338c
ucomiss %xmm2, %xmm1
jbe 0x1d057
movss 0x6385(%rip), %xmm0     # 0x233b0
mulss %xmm2, %xmm0
addss 0x637d(%rip), %xmm0     # 0x233b4
mulss %xmm2, %xmm0
addss 0x6375(%rip), %xmm0     # 0x233b8
mulss %xmm2, %xmm0
addss 0x636d(%rip), %xmm0     # 0x233bc
divss 0x6369(%rip), %xmm0     # 0x233c0
retq
// File: /workspace/github_c_makefile_star2_O1/algorithm-archivists[P]GathVL/src/objects/../../include/stb_image_resize.h
// Function: stbir__decode_and_resample_upsample(stbir__info*, int)
static void stbir__decode_and_resample_upsample(stbir__info* stbir_info, int n)
{
    // Decode the nth scanline from the source image into the decode buffer.
    stbir__decode_scanline(stbir_info, n);

    // Now resample it into the ring buffer.
    if (stbir__use_width_upsampling(stbir_info))
        stbir__resample_horizontal_upsample(stbir_info, stbir__add_empty_ring_buffer_entry(stbir_info, n));
    else
        stbir__resample_horizontal_downsample(stbir_info, stbir__add_empty_ring_buffer_entry(stbir_info, n));

    // Now it's sitting in the ring buffer ready to be used as source for the vertical sampling.
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
callq 0x1db45
movss 0x44(%rbx), %xmm0
movss %xmm0, 0x4(%rsp)
movq %rbx, %rdi
movl %ebp, %esi
callq 0x1efa6
movss 0x4(%rsp), %xmm0
movq %rbx, %rdi
movq %rax, %rsi
addq $0x8, %rsp
ucomiss 0x5847(%rip), %xmm0     # 0x2337c
ja 0x1db3e
popq %rbx
popq %rbp
jmp 0x1f027
popq %rbx
popq %rbp
jmp 0x1eb2f
// File: /workspace/github_c_makefile_star2_O1/algorithm-archivists[P]GathVL/src/objects/../../include/stb_image_resize.h
// Function: stbir__add_empty_ring_buffer_entry(stbir__info*, int)
static float* stbir__add_empty_ring_buffer_entry(stbir__info* stbir_info, int n)
{
    int ring_buffer_index;
    float* ring_buffer;

    stbir_info->ring_buffer_last_scanline = n;

    if (stbir_info->ring_buffer_begin_index < 0)
    {
        ring_buffer_index = stbir_info->ring_buffer_begin_index = 0;
        stbir_info->ring_buffer_first_scanline = n;
    }
    else
    {
        ring_buffer_index = (stbir_info->ring_buffer_begin_index + (stbir_info->ring_buffer_last_scanline - stbir_info->ring_buffer_first_scanline)) % stbir_info->ring_buffer_num_entries;
        STBIR_ASSERT(ring_buffer_index != stbir_info->ring_buffer_begin_index);
    }

    ring_buffer = stbir__get_ring_buffer_entry(stbir_info->ring_buffer, ring_buffer_index, stbir_info->ring_buffer_length_bytes / sizeof(float));
    memset(ring_buffer, 0, stbir_info->ring_buffer_length_bytes);

    return ring_buffer;
}

// Assembly:
movl %esi, 0xd4(%rdi)
movl 0xd8(%rdi), %ecx
testl %ecx, %ecx
js 0x1efeb
addl %ecx, %esi
subl 0xd0(%rdi), %esi
movl %esi, %eax
cltd
idivl 0xcc(%rdi)
cmpl %ecx, %edx
jne 0x1effd
pushq %rax
leaq 0x685d(%rip), %rdi      # 0x25830
leaq 0x5e70(%rip), %rsi      # 0x24e4a
leaq 0x6888(%rip), %rcx      # 0x25869
movl $0x595, %edx            # imm = 0x595
callq 0x5130
movl $0x0, 0xd8(%rdi)
movl %esi, 0xd0(%rdi)
xorl %edx, %edx
movslq 0xc8(%rdi), %rax
movl %eax, %ecx
sarl $0x2, %ecx
imull %edx, %ecx
movslq %ecx, %rcx
shlq $0x2, %rcx
addq 0xe0(%rdi), %rcx
movq %rax, %rdx
movq %rcx, %rdi
xorl %esi, %esi
jmp 0x5270
// File: /workspace/github_c_makefile_star2_O1/algorithm-archivists[P]GathVL/src/objects/line.cpp
// Function: line::draw(_cairo*) const
void line::draw(cairo_t * ctx) const {
    cairo_save(ctx);
    cairo_set_source_rgba(ctx, clr.r, clr.g, clr.b, clr.a);

    cairo_move_to(ctx, start.x, start.y);
    cairo_line_to(ctx, end.x, end.y);

    cairo_stroke(ctx);
    cairo_restore(ctx);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x54c0
movsd 0x20(%r14), %xmm0
movsd 0x28(%r14), %xmm1
movsd 0x30(%r14), %xmm2
movsd 0x38(%r14), %xmm3
movq %rbx, %rdi
callq 0x5330
movsd 0x40(%r14), %xmm0
movsd 0x48(%r14), %xmm1
movq %rbx, %rdi
callq 0x5570
movsd 0x50(%r14), %xmm0
movsd 0x58(%r14), %xmm1
movq %rbx, %rdi
callq 0x5300
movq %rbx, %rdi
callq 0x5500
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x5610
nop
// File: /workspace/github_c_makefile_star2_O1/algorithm-archivists[P]GathVL/src/objects/polygon.cpp
// Function: polygon::draw(_cairo*) const
void polygon::draw(cairo_t *ctx) const {
    cairo_save(ctx);
    cairo_set_source_rgba(ctx, clr.r, clr.g, clr.b, clr.a);
    cairo_translate(ctx, center.x, center.y);
    cairo_rotate(ctx, rotation);

    if (!points.empty()) {
        cairo_move_to(ctx, points.back().x - center.x,
                      points.back().y - center.y);
    }

    for (const auto& point : points) {
        cairo_line_to(ctx, point.x - center.x, point.y - center.y);
    }

    cairo_close_path(ctx);
    if (fill) {
        cairo_fill(ctx);
    }

    cairo_stroke(ctx);
    cairo_restore(ctx);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x54c0
movsd 0x20(%r14), %xmm0
movsd 0x28(%r14), %xmm1
movsd 0x30(%r14), %xmm2
movsd 0x38(%r14), %xmm3
movq %rbx, %rdi
callq 0x5330
movsd 0x40(%r14), %xmm0
movsd 0x48(%r14), %xmm1
movq %rbx, %rdi
callq 0x5180
movsd 0x68(%r14), %xmm0
movq %rbx, %rdi
callq 0x5490
movq 0x58(%r14), %rax
cmpq %rax, 0x50(%r14)
je 0x1fe68
movsd -0x10(%rax), %xmm0
movsd -0x8(%rax), %xmm1
subsd 0x40(%r14), %xmm0
subsd 0x48(%r14), %xmm1
movq %rbx, %rdi
callq 0x5570
movq 0x50(%r14), %r15
movq 0x58(%r14), %r12
cmpq %r12, %r15
je 0x1fe9a
movsd (%r15), %xmm0
movsd 0x8(%r15), %xmm1
subsd 0x40(%r14), %xmm0
subsd 0x48(%r14), %xmm1
movq %rbx, %rdi
callq 0x5300
addq $0x10, %r15
jmp 0x1fe70
movq %rbx, %rdi
callq 0x57c0
cmpb $0x0, 0x70(%r14)
je 0x1feb1
movq %rbx, %rdi
callq 0x5670
movq %rbx, %rdi
callq 0x5500
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x5610
// File: /workspace/github_c_makefile_star2_O1/algorithm-archivists[P]GathVL/src/objects/rectangle.cpp
// Function: rectangle::draw(_cairo*) const
void rectangle::draw(cairo_t *ctx) const {
    cairo_save(ctx);
    cairo_set_source_rgba(ctx, clr.r, clr.g, clr.b, clr.a);
    cairo_translate(ctx, location.x, location.y);
    cairo_rotate(ctx, rotation);

    cairo_rectangle(ctx, 0, 0, size.x, size.y);

    if (fill) {
        cairo_fill(ctx);
    }

    cairo_stroke(ctx);
    cairo_restore(ctx);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x54c0
movsd 0x20(%r14), %xmm0
movsd 0x28(%r14), %xmm1
movsd 0x30(%r14), %xmm2
movsd 0x38(%r14), %xmm3
movq %rbx, %rdi
callq 0x5330
movsd 0x40(%r14), %xmm0
movsd 0x48(%r14), %xmm1
movq %rbx, %rdi
callq 0x5180
movsd 0x60(%r14), %xmm0
movq %rbx, %rdi
callq 0x5490
movsd 0x50(%r14), %xmm2
movsd 0x58(%r14), %xmm3
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
movq %rbx, %rdi
callq 0x5370
cmpb $0x1, 0x68(%r14)
jne 0x1ffc9
movq %rbx, %rdi
callq 0x5670
movq %rbx, %rdi
callq 0x5500
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x5610
// File: /workspace/github_c_makefile_star2_O1/algorithm-archivists[P]GathVL/src/objects/text.cpp
// Function: text::draw(_cairo*) const
void text::draw(cairo_t *ctx) const {
    cairo_save(ctx);
    cairo_set_source_rgba(ctx, clr.r, clr.g, clr.b, clr.a);
    cairo_translate(ctx, location.x, location.y);
    cairo_rotate(ctx, rotation);

    if (!font.empty()) {
        cairo_select_font_face(ctx, font.c_str(), CAIRO_FONT_SLANT_NORMAL,
                               CAIRO_FONT_WEIGHT_NORMAL);
    }

    cairo_set_font_size(ctx, size);

    cairo_move_to(ctx, 0, 0);
    cairo_show_text(ctx, str.c_str());

    cairo_stroke(ctx);
    cairo_restore(ctx);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x54c0
movsd 0x20(%r14), %xmm0
movsd 0x28(%r14), %xmm1
movsd 0x30(%r14), %xmm2
movsd 0x38(%r14), %xmm3
movq %rbx, %rdi
callq 0x5330
movsd 0x40(%r14), %xmm0
movsd 0x48(%r14), %xmm1
movq %rbx, %rdi
callq 0x5180
movsd 0x58(%r14), %xmm0
movq %rbx, %rdi
callq 0x5490
cmpq $0x0, 0x88(%r14)
je 0x214ad
movq 0x80(%r14), %rsi
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x55f0
movsd 0x50(%r14), %xmm0
movq %rbx, %rdi
callq 0x5410
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
movq %rbx, %rdi
callq 0x5570
movq 0x60(%r14), %rsi
movq %rbx, %rdi
callq 0x5290
movq %rbx, %rdi
callq 0x5500
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x5610
// File: /workspace/github_c_makefile_star2_O1/algorithm-archivists[P]GathVL/src/encoders/video_encoder.cpp
// Function: video_encoder::encode(_cairo_surface*)
void video_encoder::encode(cairo_surface_t *image) {
    AVCodecContext *c = ostream.codec_ctx;
    AVFrame *frame = nullptr;

    cairo_surface_flush(image);
    uint8_t *data[1] = {(uint8_t*)cairo_image_surface_get_data(image)};
    int stride[1] = {cairo_image_surface_get_stride(image)};
    cairo_surface_mark_dirty(image);

    if (av_frame_make_writable(ostream.frame) < 0) {
        std::exit(1);
    }

    frame = ostream.frame;
    if (c->pix_fmt != AV_PIX_FMT_BGRA) {
        sws_scale(ostream.sws_ctx, data, stride, 0, c->height, frame->data,
                  frame->linesize);
    } else {
        av_image_fill_arrays(frame->data, frame->linesize, data[0], c->pix_fmt,
                             c->width, c->height, stride[0]);
    }

    ostream.frame->pts = ostream.next_pts++;

    write_frame(format_ctx, &ostream, ostream.frame);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x38(%rdi), %r15
movq %rsi, %rdi
callq 0x5740
movq %r14, %rdi
callq 0x5350
movq %rax, 0x18(%rsp)
movq %r14, %rdi
callq 0x5850
movl %eax, 0x14(%rsp)
movq %r14, %rdi
callq 0x55b0
movq 0x48(%rbx), %rdi
callq 0x56c0
testl %eax, %eax
js 0x21a1c
movq 0x48(%rbx), %rax
cmpl $0x1c, 0x88(%r15)
jne 0x219ca
leaq 0x40(%rax), %rsi
movq 0x18(%rsp), %rdx
movl 0x74(%r15), %r8d
movl 0x78(%r15), %r9d
movl 0x14(%rsp), %ecx
movl %ecx, (%rsp)
movq %rax, %rdi
movl $0x1c, %ecx
callq 0x55e0
jmp 0x219ee
movq 0x50(%rbx), %rdi
movl 0x78(%r15), %r8d
leaq 0x40(%rax), %rcx
movq %rcx, (%rsp)
leaq 0x18(%rsp), %rsi
leaq 0x14(%rsp), %rdx
xorl %ecx, %ecx
movq %rax, %r9
callq 0x5750
leaq 0x30(%rbx), %rsi
movq 0x40(%rbx), %rax
movq 0x48(%rbx), %rdx
leaq 0x1(%rax), %rcx
movq %rcx, 0x40(%rbx)
movq %rax, 0x88(%rdx)
movq 0x28(%rbx), %rdi
callq 0x21a26
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movl $0x1, %edi
callq 0x5530
// File: /workspace/github_c_makefile_star2_O1/algorithm-archivists[P]GathVL/src/encoders/video_encoder.cpp
// Function: write_frame(AVFormatContext*, output_stream*, AVFrame*)
static void write_frame(AVFormatContext *format_ctx, output_stream *ostream,
                        AVFrame *frame) {
    AVCodecContext *c = ostream->codec_ctx;
    AVPacket *pkt = nullptr;

    pkt = av_packet_alloc();
    if (!pkt) {
        std::cout << "Could not allocate a packet" << std::endl;
        std::exit(1);
    }

    int ret = avcodec_send_frame(c, frame);
    if (ret < 0) {
        std::cout << "Error encoding video frame." << std::endl;
        std::exit(1);
    }

    while (ret >= 0) {
        ret = avcodec_receive_packet(c, pkt);
        if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF)
            break;
        else if (ret < 0) {
            std::cout << "Error during encoding." << std::endl;
            std::exit(1);
        }

        av_packet_rescale_ts(pkt, c->time_base, ostream->stream->time_base);
        pkt->stream_index = ostream->stream->index;

        ret = av_interleaved_write_frame(format_ctx, pkt);
        av_packet_unref(pkt);
        if (ret < 0) {
            std::cout << "Error while writing video frame." << std::endl;
            std::exit(1);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r13
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rsi), %r15
callq 0x57f0
testq %rax, %rax
je 0x21af7
movq %rax, %r12
movq %r15, %rdi
movq %r13, %rsi
callq 0x5800
testl %eax, %eax
js 0x21b07
movq %r15, %rdi
movq %r12, %rsi
callq 0x54d0
cmpl $0xdfb9b0bb, %eax       # imm = 0xDFB9B0BB
je 0x21ac3
cmpl $-0xb, %eax
je 0x21ac3
testl %eax, %eax
js 0x21ad2
movq 0x64(%r15), %rsi
movq (%rbx), %rax
movq 0x18(%rax), %rdx
movq %r12, %rdi
callq 0x5190
movq (%rbx), %rax
movl (%rax), %eax
movl %eax, 0x24(%r12)
movq %r14, %rdi
movq %r12, %rsi
callq 0x5030
movl %eax, %ebp
movq %r12, %rdi
callq 0x5770
testl %ebp, %ebp
jns 0x21a62
movq 0xb4fe(%rip), %rdi      # 0x2cfb8
leaq 0x4288(%rip), %rsi      # 0x25d49
jmp 0x21ae0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xb4df(%rip), %rdi      # 0x2cfb8
leaq 0x4252(%rip), %rsi      # 0x25d32
callq 0x5480
movq %rax, %rdi
callq 0x57a0
movl $0x1, %edi
callq 0x5530
movq 0xb4ba(%rip), %rdi      # 0x2cfb8
leaq 0x41f5(%rip), %rsi      # 0x25cfa
jmp 0x21ae0
movq 0xb4aa(%rip), %rdi      # 0x2cfb8
leaq 0x4201(%rip), %rsi      # 0x25d16
jmp 0x21ae0
nop
// File: /workspace/github_c_makefile_star2_O1/algorithm-archivists[P]GathVL/src/encoders/video_encoder.cpp
// Function: video_encoder::~video_encoder()
video_encoder::~video_encoder() {
    write_frame(format_ctx, &ostream, NULL);

    av_write_trailer(format_ctx);

    avcodec_free_context(&ostream.codec_ctx);
    av_frame_free(&ostream.frame);
    sws_freeContext(ostream.sws_ctx);

    if (!(format_ctx->oformat->flags & AVFMT_NOFILE)) {
        avio_closep(&format_ctx->pb);
    }

    avformat_free_context(format_ctx);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0xab99(%rip), %rax      # 0x2ccf8
movq %rax, (%rdi)
movq 0x28(%rdi), %rdi
leaq 0x30(%rbx), %rsi
xorl %edx, %edx
callq 0x21a26
movq 0x28(%rbx), %rdi
callq 0x5220
leaq 0x38(%rbx), %rdi
callq 0x56e0
leaq 0x48(%rbx), %rdi
callq 0x5360
movq 0x50(%rbx), %rdi
callq 0x5790
movq 0x28(%rbx), %rdi
movq 0x10(%rdi), %rax
testb $0x1, 0x2c(%rax)
jne 0x221ac
addq $0x20, %rdi
callq 0x5230
movq 0x28(%rbx), %rdi
callq 0x5430
leaq 0xab14(%rip), %rax      # 0x2ccd0
movq %rax, (%rbx)
movq 0x8(%rbx), %rdi
addq $0x18, %rbx
cmpq %rbx, %rdi
je 0x221d8
movq (%rbx), %rsi
incq %rsi
popq %rbx
jmp 0x50c0
popq %rbx
retq
movq %rax, %rdi
callq 0x68f1
// File: /workspace/github_c_makefile_star2_O1/algorithm-archivists[P]GathVL/src/systems/system_unix.cpp
// Function: subprocess(char const*, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> const&)
int subprocess(const char *program, const std::vector<std::string>& args) {
    std::vector<char *> argv;

    for (auto& str : args) {
        argv.push_back(&(char&)str.front());
    }
    argv.push_back(NULL);

    pid_t pid = fork();
    int status = 0;

    if (pid == 0) {
        int fd = open("/dev/null", O_WRONLY);
        dup2(fd, 1);
        dup2(fd, 2);
        close(fd);

        execv(program, argv.data());
        std::exit(127);
    } else {
        waitpid(pid, &status, 0);
        if (WIFEXITED(status) && (WEXITSTATUS(status) == 0)) {
            return 0;
        }
    }

    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movq (%rsi), %r12
movq 0x8(%rsi), %r13
cmpq %r13, %r12
je 0x22251
leaq 0x10(%rsp), %r14
leaq 0x8(%rsp), %r15
movq (%r12), %rax
movq %rax, 0x8(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x2232e
addq $0x20, %r12
cmpq %r13, %r12
jne 0x22234
leaq 0x8(%rsp), %rsi
movq $0x0, (%rsi)
leaq 0x10(%rsp), %rdi
callq 0x2232e
callq 0x5780
movl $0x0, 0x8(%rsp)
testl %eax, %eax
je 0x222bb
leaq 0x8(%rsp), %rsi
movl %eax, %edi
xorl %edx, %edx
callq 0x5720
movl 0x8(%rsp), %ebx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x222a1
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x50c0
xorl %eax, %eax
testl $0xff7f, %ebx           # imm = 0xFF7F
setne %al
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3b91(%rip), %rdi      # 0x25e53
movl $0x1, %esi
xorl %eax, %eax
callq 0x5380
movl %eax, %ebp
movl %eax, %edi
movl $0x1, %esi
callq 0x5460
movl %ebp, %edi
movl $0x2, %esi
callq 0x5460
movl %ebp, %edi
callq 0x51b0
movq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x5710
movl $0x7f, %edi
callq 0x5530
jmp 0x2230c
jmp 0x2230c
jmp 0x2230c
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x22326
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x50c0
movq %rbx, %rdi
callq 0x5510
// File: /workspace/github_c_makefile_star2_O1/tylerneylon[P]APIsWithLua/ch6/eatyguy10.c
// Function: done
void done(const char *msg) {

  // Put the terminal back into a decent state.
  system("stty cooked echo");  // Undo init call to "stty raw".
  system("tput reset");        // Reset colors and clear screen.

  // Print the farewell message if there is one.
  if (msg) printf("%s\n", msg);

  exit(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x1b6f5(%rip), %rdi     # 0x2104a
callq 0x5170
leaq 0x1b6fa(%rip), %rdi     # 0x2105b
callq 0x5170
testq %rbx, %rbx
je 0x5973
movq %rbx, %rdi
callq 0x50d0
xorl %edi, %edi
callq 0x54a0
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/test/fieldarith.c
// Function: check
void check(const bam1_t *aln, const char *testname, const char *tag, int value)
{
    int32_t refvalue;
    uint8_t *aux = bam_aux_get(aln, tag);
    if (!aux) return;
    ntests++;
    refvalue = bam_aux2i(aux);
    if (value != refvalue) {
        fprintf(stderr, "%s FAIL for %s: computed %d != %d expected\n",
                testname, bam_get_qname(aln), value, refvalue);
        nfailures++;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %ecx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movq %rdx, %rsi
callq 0x1fa00
testq %rax, %rax
je 0x5de8
incl 0xab728(%rip)           # 0xb1504
movq %rax, %rdi
callq 0x2266b
cmpl %ebx, %eax
jne 0x5dee
popq %rbx
popq %r14
popq %r15
retq
movq 0xab1eb(%rip), %rcx     # 0xb0fe0
movq (%rcx), %rdi
movq 0x38(%r15), %rcx
leaq 0x8b201(%rip), %rsi     # 0x91004
movq %r14, %rdx
movl %ebx, %r8d
movl %eax, %r9d
xorl %eax, %eax
callq 0x46f0
incl 0xab6ef(%rip)           # 0xb1508
jmp 0x5de8
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/test/fieldarith.c
// Function: main
int main(int argc, char **argv)
{
    sam_hdr_t *header;
    bam1_t *aln = bam_init1();
    int i;

    for (i = 1; i < argc; i++) {
        samFile *in = sam_open(argv[i], "r");
        if (in == NULL) { perror(argv[1]); return 1; }

        header = sam_hdr_read(in);
        while (sam_read1(in, header, aln) >= 0) {
            check(aln, "cigar2qlen", "XQ",
                  bam_cigar2qlen(aln->core.n_cigar, bam_get_cigar(aln)));
            check(aln, "cigar2rlen", "XR",
                  bam_cigar2rlen(aln->core.n_cigar, bam_get_cigar(aln)));
            check(aln, "endpos", "XE", bam_endpos(aln));
        }

        sam_hdr_destroy(header);
        sam_close(in);
    }

    bam_destroy1(aln);

    return (nfailures > 0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, 0x10(%rsp)
movl %edi, %ebx
callq 0x16507
movq %rax, %r14
cmpl $0x2, %ebx
jl 0x5f78
movl %ebx, %eax
movq %rax, 0x18(%rsp)
movl $0x0, 0x4(%rsp)
movl $0x1, %ebp
leaq 0x8b1df(%rip), %rbx     # 0x9103b
leaq 0x8b1e6(%rip), %r13     # 0x91049
movq 0x10(%rsp), %rax
movq (%rax,%rbp,8), %rdi
leaq 0x8e0a3(%rip), %rsi     # 0x93f16
callq 0x9423
testq %rax, %rax
movq %rax, 0x8(%rsp)
je 0x5f60
movq %rax, %r12
movq %rbp, 0x20(%rsp)
movq %rax, %rdi
callq 0x192bd
movq %rax, %rbp
movq %r12, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x1d499
testl %eax, %eax
leaq 0x8b180(%rip), %r15     # 0x91030
leaq 0x8b19c(%rip), %r12     # 0x91053
js 0x5f31
movl 0x14(%r14), %edi
movzwl 0x12(%r14), %esi
addq 0x38(%r14), %rsi
callq 0x16b3a
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
movl %eax, %ecx
callq 0x5dbc
movl 0x14(%r14), %edi
movzwl 0x12(%r14), %esi
addq 0x38(%r14), %rsi
callq 0x16b71
movq %r14, %rdi
leaq 0x8b147(%rip), %rsi     # 0x9103e
movq %r13, %rdx
movl %eax, %ecx
callq 0x5dbc
movq %r14, %rdi
callq 0x16baa
movq %r14, %rdi
leaq 0x8b139(%rip), %rsi     # 0x9104c
movq %r12, %rdx
movl %eax, %ecx
callq 0x5dbc
movq 0x8(%rsp), %rdi
movq %rbp, %rsi
movq %r14, %rdx
callq 0x1d499
testl %eax, %eax
jns 0x5eb9
movq %rbp, %rdi
callq 0x15b86
movq 0x8(%rsp), %rdi
callq 0xa68d
movq 0x20(%rsp), %rbp
cmpq $0x0, 0x8(%rsp)
je 0x5f8e
incq %rbp
cmpq 0x18(%rsp), %rbp
jne 0x5e63
jmp 0x5f78
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x43c0
movl $0x1, 0x4(%rsp)
jmp 0x5f48
movq %r14, %rdi
callq 0x165e4
xorl %eax, %eax
cmpl $0x0, 0xab57f(%rip)     # 0xb1508
setg %al
jmp 0x5f92
movl 0x4(%rsp), %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/cirocosta[P]stress/src/tcp-client.c
// Function: send_chunks
void
send_chunks(int sock_fd)
{
	char buf[MAXLINE];
	char chunk[MAXLINE] = { 0 };

	memset(chunk, 65, MAXLINE);

	while (run) {
		_STRESS_MUST(stress_write_n(sock_fd, chunk, MAXLINE) >= 0,
		             "couldn't write contents to socket");
		_STRESS_MUST(stress_read_n(sock_fd, buf, MAXLINE) >= 0,
		             "unexpected error while reading");
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x2000, %rsp           # imm = 0x2000
movl %edi, %ebx
movq %rsp, %r14
movl $0x1000, %edx           # imm = 0x1000
movq %r14, %rdi
xorl %esi, %esi
callq 0x10b0
movl $0x1000, %edx           # imm = 0x1000
movq %r14, %rdi
movl $0x41, %esi
callq 0x10b0
leaq 0x1000(%rsp), %r15
cmpl $0x0, 0x266c(%rip)      # 0x40d8
je 0x1a9b
movl $0x1000, %edx           # imm = 0x1000
movl %ebx, %edi
movq %r14, %rsi
callq 0x197f
testq %rax, %rax
js 0x1aa8
movl $0x1000, %edx           # imm = 0x1000
movl %ebx, %edi
movq %r15, %rsi
callq 0x19d5
testq %rax, %rax
jns 0x1a65
callq 0x1482
addq $0x2000, %rsp           # imm = 0x2000
popq %rbx
popq %r14
popq %r15
retq
callq 0x13cc
// File: /workspace/github_c_makefile_star2_O1/cirocosta[P]stress/src/tcp-client.c
// Function: main
int
main(int argc, char** argv)
{
	stress_args_t args = { .b = 0 };

	int sock_fd;
	struct sockaddr_in server_addr;

	signal(SIGINT, terminate);
	setbuf(stdout, NULL);
	stress_parse_args(argc, argv, &args);

	_STRESS_MUST(args.n, "a port (n) must be specified");
	_STRESS_MUST(strlen(args.f), "an ip (f) must be specified");

	sock_fd = socket(AF_INET, SOCK_STREAM, 0);
	memset(&server_addr, sizeof(server_addr), 0);
	server_addr.sin_family = AF_INET;
	server_addr.sin_port = htons(args.n);

	inet_pton(AF_INET, args.f, &server_addr.sin_addr);
	connect(sock_fd, (struct sockaddr*)&server_addr, sizeof(server_addr));

	send_chunks(sock_fd);

	return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x2020, %rsp           # imm = 0x2020
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x18(%rsp), %r14
movl $0x2008, %edx           # imm = 0x2008
movq %r14, %rdi
xorl %esi, %esi
callq 0x10b0
leaq -0x36(%rip), %rsi       # 0x1aad
movl $0x2, %edi
callq 0x10e0
movq 0x24d4(%rip), %rax      # 0x3fc8
movq (%rax), %rdi
xorl %esi, %esi
callq 0x1090
movl %ebp, %edi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x17f9
cmpl $0x0, (%r14)
je 0x1b7a
cmpb $0x0, 0x1d(%rsp)
je 0x1b7f
leaq 0x1d(%rsp), %rbx
movl $0x2, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x1180
movl %eax, %ebp
leaq 0xc(%rsp), %rdx
movw $0x2, -0x4(%rdx)
movzwl -0x5(%rbx), %eax
rolw $0x8, %ax
movw %ax, -0x2(%rdx)
movl $0x2, %edi
movq %rbx, %rsi
callq 0x1100
leaq 0x8(%rsp), %rsi
movl %ebp, %edi
movl $0x10, %edx
callq 0x1140
movl %ebp, %edi
callq 0x1a2b
xorl %eax, %eax
addq $0x2020, %rsp           # imm = 0x2020
popq %rbx
popq %r14
popq %rbp
retq
callq 0x15ee
callq 0x1538
// File: /workspace/github_c_makefile_star2_O1/ryuichiueda[P]glueutils/src/ignerr.c
// Function: usage
void usage(void){
	fputs("ignerr: ignore exit status\n", stderr);
	fputs("usage: ignerr <command> [args]\n", stderr);
	fputs("\nCopyright (C) 2021 Ryuichi Ueda\n", stderr);
	fputs("Released under the MIT License.\n", stderr);
	fputs("https://github.com/ryuichiueda/glueutils\n", stderr);
}

// Assembly:
pushq %rbx
movq 0x2f60(%rip), %rbx      # 0x3ff8
movq (%rbx), %rsi
leaq 0xf62(%rip), %rdi       # 0x2004
callq 0x1030
movq (%rbx), %rsi
leaq 0xf6f(%rip), %rdi       # 0x2020
callq 0x1030
movq (%rbx), %rsi
leaq 0xf80(%rip), %rdi       # 0x2040
callq 0x1030
movq (%rbx), %rsi
leaq 0xf93(%rip), %rdi       # 0x2062
callq 0x1030
movq (%rbx), %rsi
leaq 0xfa5(%rip), %rdi       # 0x2083
popq %rbx
jmp 0x1030
// File: /workspace/github_c_makefile_star2_O1/ryuichiueda[P]glueutils/src/ignerr.c
// Function: main
int main(int argc, char * argv[])
{
	if(argc < 2){
		usage();
		exit(1);
	}

	int pid = fork();
	if(pid == 0)//child 
		return -execvp(argv[1], &argv[1]);

	waitpid(pid, NULL, 0);
	return 0;
}

// Assembly:
pushq %rbx
cmpl $0x1, %edi
jle 0x1225
movq %rsi, %rbx
callq 0x1070
testl %eax, %eax
je 0x120d
xorl %ebx, %ebx
movl %eax, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x1040
jmp 0x1221
movq 0x8(%rbx), %rdi
addq $0x8, %rbx
movq %rbx, %rsi
callq 0x1050
movl %eax, %ebx
negl %ebx
movl %ebx, %eax
popq %rbx
retq
callq 0x10e4
// File: /workspace/github_c_makefile_star2_O1/bloomsource[P]dns_update/dns.c
// Function: domain_node_swap
void domain_node_swap( rbnode* n1, rbnode* n2 )
{
    dns_node node, *node1, *node2;
    
    node1 = (dns_node*)n1;
    node2 = (dns_node*)n2;
    
    strcpy( node.domain, node1->domain );
    strcpy( node.ip, node1->ip );
    
    strcpy( node1->domain, node2->domain );
    strcpy( node1->ip, node2->ip );
    
    strcpy( node2->domain, node.domain );
    strcpy( node2->ip, node.ip );
    
    
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x28(%rsp), %rdi
leaq 0x20(%r15), %r12
movq %r12, %rsi
callq 0x2060
movl $0x120, %r14d           # imm = 0x120
leaq 0x8(%rsp), %r13
addq %r14, %r13
addq %r14, %r15
movq %r13, %rdi
movq %r15, %rsi
callq 0x2060
leaq 0x20(%rbx), %rbp
movq %r12, %rdi
movq %rbp, %rsi
callq 0x2060
addq %r14, %rbx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2060
movq %rbp, %rdi
leaq 0x28(%rsp), %rsi
callq 0x2060
movq %rbx, %rdi
movq %r13, %rsi
callq 0x2060
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/bloomsource[P]dns_update/dns.c
// Function: fill_binary_ip
void fill_binary_ip( unsigned char bin[], char* ip )
{
    char tmp[20];
    char *p, *p1;
    
    strcpy( tmp, ip );
    p1 = tmp;
    
    p = strchr( p1, '.' );
    p[0] = 0;
    bin[0] = atoi( p1 );
    p1 = p+1;
    
    p = strchr( p1, '.' );
    p[0] = 0;
    bin[1] = atoi( p1 );
    p1 = p+1;

    p = strchr( p1, '.' );
    p[0] = 0;
    bin[2] = atoi( p1 );
    p1 = p+1;
    
    bin[3] = atoi( p1 );
    
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq %rsp, %r14
movq %r14, %rdi
callq 0x2060
movq %r14, %rdi
movl $0x2e, %esi
callq 0x2110
movq %rax, %r15
xorl %ebp, %ebp
movb %bpl, (%rax)
movq %r14, %rdi
callq 0x2290
movb %al, (%rbx)
incq %r15
movq %r15, %rdi
movl $0x2e, %esi
callq 0x2110
movq %rax, %r14
movb %bpl, (%rax)
movq %r15, %rdi
callq 0x2290
movb %al, 0x1(%rbx)
incq %r14
movq %r14, %rdi
movl $0x2e, %esi
callq 0x2110
movq %rax, %r15
movb %bpl, (%rax)
movq %r14, %rdi
callq 0x2290
movb %al, 0x2(%rbx)
incq %r15
movq %r15, %rdi
callq 0x2290
movb %al, 0x3(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/bloomsource[P]dns_update/dns.c
// Function: dns_write_domain
int dns_write_domain( char* data, int size, char* domain, int* write_len )
{
    char* pdata;
    char* pdomain, *p;
    unsigned char *blen;
    int seclen;
    int left;
    
    left = size;
    if( strlen( domain ) > MAX_DOMAIN )
    {
        write_log( "[WRN] write domain failed, domain name too large." );
        return -1;
    }
    
    pdata = data;
    pdomain = domain;
    
    while( 1 )
    {
        if( pdomain[0] == 0 )
            break;
        
        p = strchr( pdomain, '.' );
        if( p )
        {
            seclen = p - pdomain;
            if( left <= seclen + 1 )
            {
                write_log( "[WRN] write domain failed, space not enough." );
                return 1;
            }
            
            blen = (unsigned char*)pdata;
            *blen = seclen;
            memcpy( pdata+1, pdomain, seclen );
            left -= ( seclen + 1 );
            pdata += ( seclen + 1 );
            pdomain = p+1;
        }
        else
        {
            seclen = strlen( pdomain );
            if( left < seclen + 2 )
            {
                write_log( "[WRN] write domain failed, space not enough." );
                return 1;
            }
            
            blen = (unsigned char*)pdata;
            *blen = seclen;
            memcpy( pdata+1, pdomain, seclen );
            blen = (unsigned char*)pdata + 1 + seclen;
            *blen = 0;
            left -= ( seclen + 2 );
            pdata += ( seclen + 2 );
            break;
        }
    }
    
    *write_len = size - left;
    
    return 0;
    
    
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r15
movl %esi, %ebp
movq %rdi, %r14
movq %rdx, %rdi
callq 0x2100
cmpq $0xff, %rax
jbe 0x3024
leaq 0x6347(%rip), %rdi      # 0x935a
xorl %eax, %eax
callq 0x32e8
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x30cb
movq %rbx, (%rsp)
cmpb $0x0, (%r15)
movl %ebp, %r13d
je 0x30c0
movl %ebp, %r13d
movq %r15, %rdi
movl $0x2e, %esi
callq 0x2110
testq %rax, %rax
je 0x3080
movq %rax, %r12
subq %r15, %rax
leal 0x1(%rax), %ebx
subl %ebx, %r13d
jle 0x3090
movb %al, (%r14)
leaq 0x1(%r14), %rdi
movslq %eax, %rdx
movq %r15, %rsi
callq 0x21e0
movslq %ebx, %rax
addq %rax, %r14
movq %r12, %r15
incq %r15
cmpb $0x0, 0x1(%r12)
jne 0x3038
jmp 0x30c0
movq %r15, %rdi
callq 0x2100
leal 0x2(%rax), %ecx
subl %ecx, %r13d
jge 0x30a5
leaq 0x62f5(%rip), %rdi      # 0x938c
xorl %eax, %eax
callq 0x32e8
movl $0x1, %eax
jmp 0x30cb
movb %al, (%r14)
leaq 0x1(%r14), %rdi
movslq %eax, %r12
movq %r15, %rsi
movq %r12, %rdx
callq 0x21e0
movb $0x0, 0x1(%r14,%r12)
subl %r13d, %ebp
movq (%rsp), %rax
movl %ebp, (%rax)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/bloomsource[P]dns_update/dns.c
// Function: check_domain_char
int check_domain_char( char* domain, int len )
{
    int i;
    
    for( i = 0; i < len; i++ )
    {
        if( isalnum( domain[i] ) )
            continue;
        
        switch( domain[i] )
        {
            case '_':
            case '-':
                break;
            
               default:
                return -1;
        }
    }
    
    return 0;
    
}

// Assembly:
testl %esi, %esi
jle 0x3117
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
callq 0x2300
movq (%rax), %rax
movl %ebp, %ecx
xorl %edx, %edx
movsbq (%rbx,%rdx), %rsi
testb $0x8, (%rax,%rsi,2)
jne 0x310b
movzbl %sil, %esi
cmpl $0x5f, %esi
je 0x310b
cmpl $0x2d, %esi
jne 0x311a
incq %rdx
cmpq %rdx, %rcx
jne 0x30f2
xorl %eax, %eax
jmp 0x311f
xorl %eax, %eax
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop