LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/phoboslab[P]pl_mpeg/pl_mpeg_extract_frames.c
// Function: write_bmp
int write_bmp(const char *path, int width, int height, uint8_t *pixels) {
	FILE *fh = fopen(path, "wb");
	if (!fh) {
		return 0;
	}

	int padded_width = (width * 3 + 3) & (~3);
	int padding = padded_width - (width * 3);
	int data_size = padded_width * height;
	int file_size = 54 + data_size;

	fwrite("BM", 1, 2, fh);
	fwrite(&file_size, 1, 4, fh);
	fwrite("\x00\x00\x00\x00\x36\x00\x00\x00\x28\x00\x00\x00", 1, 12, fh);
	fwrite(&width, 1, 4, fh);
	fwrite(&height, 1, 4, fh);
	fwrite("\x01\x00\x18\x00\x00\x00\x00\x00", 1, 8, fh); // planes, bpp, compression
	fwrite(&data_size, 1, 4, fh);
	fwrite("\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 1, 16, fh);

	for (int y = height - 1; y >= 0; y--) {
		fwrite(pixels + y * width * 3, 3, width, fh);
		fwrite("\x00\x00\x00\x00", 1, padding, fh);
	}
	fclose(fh);
	return file_size;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbx
movl %edx, %ebp
movl %esi, %r15d
movl %esi, (%rsp)
movl %edx, 0xc(%rsp)
leaq 0x211e(%rip), %rsi      # 0x96eb
callq 0x1100
testq %rax, %rax
je 0x7740
movq %rax, %r14
leal (%r15,%r15,2), %r12d
addl $0x3, %r12d
andl $-0x4, %r12d
imull %r12d, %ebp
leaq 0x8(%rsp), %rax
movl %ebp, (%rax)
addl $0x36, %ebp
leaq 0x4(%rsp), %r13
movl %ebp, (%r13)
leaq 0x20e6(%rip), %rdi      # 0x96ee
movl $0x1, %esi
movl $0x2, %edx
movq %r14, %rcx
callq 0x1120
movl $0x1, %esi
movl $0x4, %edx
movq %r13, %rdi
movq %r14, %rcx
callq 0x1120
leaq 0x1e3a(%rip), %rdi      # 0x9470
movl $0x1, %esi
movl $0xc, %edx
movq %r14, %rcx
callq 0x1120
movq %rsp, %rdi
movl $0x1, %esi
movl $0x4, %edx
movq %r14, %rcx
callq 0x1120
leaq 0xc(%rsp), %r13
movl $0x1, %esi
movl $0x4, %edx
movq %r13, %rdi
movq %r14, %rcx
callq 0x1120
leaq 0x1dff(%rip), %rdi      # 0x947d
movl $0x1, %esi
movl $0x8, %edx
movq %r14, %rcx
callq 0x1120
movl $0x1, %esi
movl $0x4, %edx
leaq 0x8(%rsp), %rdi
movq %r14, %rcx
callq 0x1120
leaq 0x1dd8(%rip), %rdi      # 0x9486
movl $0x1, %esi
movl $0x10, %edx
movq %r14, %rcx
callq 0x1120
movslq (%r13), %rax
testq %rax, %rax
jle 0x7732
movq %rbx, %rdx
leal (%r15,%r15,2), %ecx
subl %ecx, %r12d
movslq (%rsp), %r15
movslq %r12d, %rcx
movq %rcx, 0x10(%rsp)
movq %rax, %rbp
incq %rbp
leal -0x1(%rax), %ebx
leal (%r15,%r15,2), %r13d
imull %r13d, %ebx
movslq %ebx, %rbx
leaq (%rdx,%rbx), %rdi
movl $0x3, %esi
movq %rdx, %r12
movq %r15, %rdx
movq %r14, %rcx
callq 0x1120
movl $0x1, %esi
leaq 0x1d81(%rip), %rdi      # 0x9497
movq 0x10(%rsp), %rdx
movq %r14, %rcx
callq 0x1120
movq %r12, %rdx
decq %rbp
subl %r13d, %ebx
cmpq $0x1, %rbp
ja 0x76f0
movq %r14, %rdi
callq 0x1060
movl 0x4(%rsp), %eax
jmp 0x7742
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/phoboslab[P]pl_mpeg/pl_mpeg_extract_frames.c
// Function: main
int main(int argc, char *argv[]) {
	if (argc < 2) {
		printf("Usage: pl_mpeg_extract_frames <file.mpg>\n");
		return 1;
	}

	plm_t *plm = plm_create_with_filename(argv[1]);
	if (!plm) {
		printf("Couldn't open file %s\n", argv[1]);
		return 1;
	}

	plm_set_audio_enabled(plm, FALSE);
	
	int w = plm_get_width(plm);
	int h = plm_get_height(plm);
	uint8_t *pixels = (uint8_t *)malloc(w * h * 3);
	
	char bmp_name[16];
	plm_frame_t *frame = NULL;

	for (int i = 1; frame = plm_decode_video(plm); i++) {
		plm_frame_to_bgr(frame, pixels, w * 3); // BMP expects BGR ordering

		sprintf(bmp_name, "%06d.bmp", i);
		printf("Writing %s\n", bmp_name);
		write_bmp(bmp_name, w, h, pixels);
	}
	
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
cmpl $0x1, %edi
jg 0x7775
leaq 0x1fb2(%rip), %rdi      # 0x971d
callq 0x1040
jmp 0x7845
movq %rsi, %rbx
movq 0x8(%rsi), %rdi
callq 0x122c
testq %rax, %rax
je 0x7833
movq %rax, %r14
xorl %eax, %eax
movl %eax, 0x38(%r14)
movl %eax, 0x40(%r14)
movq %r14, %rdi
callq 0x1c97
movl %eax, %ebx
movq %r14, %rdi
callq 0x1ce2
movl %eax, %ebp
movq %rbx, 0x8(%rsp)
leal (%rbx,%rbx,2), %r12d
movl %r12d, %eax
imull %ebp, %eax
movslq %eax, %rdi
callq 0x10c0
movq %rax, %r13
movq %r14, %rdi
callq 0x2451
testq %rax, %rax
je 0x782f
movl $0x1, %ebx
leaq 0x10(%rsp), %r15
movq %rax, %rdi
movq %r13, %rsi
movl %r12d, %edx
callq 0x5070
movq %r15, %rdi
leaq 0x1f14(%rip), %rsi      # 0x9708
movl %ebx, %edx
xorl %eax, %eax
callq 0x1110
leaq 0x1f0d(%rip), %rdi      # 0x9711
movq %r15, %rsi
xorl %eax, %eax
callq 0x1070
movq %r15, %rdi
movq 0x8(%rsp), %rsi
movl %ebp, %edx
movq %r13, %rcx
callq 0x75a9
incl %ebx
movq %r14, %rdi
callq 0x2451
testq %rax, %rax
jne 0x77dc
xorl %eax, %eax
jmp 0x784a
movq 0x8(%rbx), %rsi
leaq 0x1eb3(%rip), %rdi      # 0x96f1
xorl %eax, %eax
callq 0x1070
movl $0x1, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/nemequ[P]safe-math/munit/munit.c
// Function: munit_logf_exv
static void
munit_logf_exv(MunitLogLevel level, FILE* fp, const char* filename, int line, const char* format, va_list ap) {
  if (level < munit_log_level_visible)
    return;

  switch (level) {
    case MUNIT_LOG_DEBUG:
      fputs("Debug", fp);
      break;
    case MUNIT_LOG_INFO:
      fputs("Info", fp);
      break;
    case MUNIT_LOG_WARNING:
      fputs("Warning", fp);
      break;
    case MUNIT_LOG_ERROR:
      fputs("Error", fp);
      break;
    default:
      munit_logf_ex(MUNIT_LOG_ERROR, filename, line, "Invalid log level (%d)", level);
      return;
  }

  fputs(": ", fp);
  if (filename != NULL)
    fprintf(fp, "%s:%d: ", filename, line);
  vfprintf(fp, format, ap);
  fputc('\n', fp);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %r9, %r14
movq %r8, %r15
movl %ecx, %ebp
movq %rdx, %r12
movq %rsi, %rbx
movl %edi, %r8d
testl %edi, %edi
jne 0x381c
testb $0x1, 0x7eeb(%rip)      # 0xb6fc
jne 0x381c
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x4, %r8d
jae 0x3888
movl %r8d, %eax
leaq 0x3878(%rip), %rcx      # 0x70a4
movslq (%rcx,%rax,4), %rdi
addq %rcx, %rdi
movq %rbx, %rsi
callq 0x3120
leaq 0x30c0(%rip), %rdi      # 0x6902
movq %rbx, %rsi
callq 0x3120
testq %r12, %r12
je 0x3865
leaq 0x30a7(%rip), %rsi      # 0x68fd
movq %rbx, %rdi
movq %r12, %rdx
movl %ebp, %ecx
xorl %eax, %eax
callq 0x31d0
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x3270
movl $0xa, %edi
movq %rbx, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x3150
leaq 0x3057(%rip), %rcx      # 0x68e6
movl $0x3, %edi
movq %r12, %rsi
movl %ebp, %edx
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x3720
// File: /workspace/github_c_makefile_star2_O3/nemequ[P]safe-math/munit/munit.c
// Function: munit_malloc_ex
void*
munit_malloc_ex(const char* filename, int line, size_t size) {
  if (size == 0)
    return NULL;

  void* ptr = calloc(1, size);
  if (MUNIT_UNLIKELY(ptr == NULL)) {
    munit_logf_ex (MUNIT_LOG_ERROR, filename, line, "Failed to allocate %" MUNIT_SIZE_MODIFIER "u bytes.", size);
  }

  return ptr;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdx, %rdx
je 0x38f1
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r15
movl $0x1, %edi
movq %rdx, %rsi
callq 0x3190
movq %rax, %r14
testq %rax, %rax
jne 0x38f4
leaq 0x2e28(%rip), %rcx      # 0x6700
xorl %r14d, %r14d
movl $0x3, %edi
movq %r15, %rsi
movl %ebp, %edx
movq %rbx, %r8
xorl %eax, %eax
callq 0x3720
jmp 0x38f4
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/nemequ[P]safe-math/munit/munit.c
// Function: munit_rand_uint32
uint32_t
munit_rand_uint32(void) {
  uint32_t old, state;

  do {
    old = munit_atomic_load(&munit_rand_state);
    state = munit_rand_next_state(old);
  } while (!munit_atomic_cas(&munit_rand_state, &old, state));

  return munit_rand_from_state(old);
}

// Assembly:
movl 0x7dd6(%rip), %edx      # 0xb6f0
imull $0x2c9277b5, %edx, %ecx # imm = 0x2C9277B5
addl $0x6c1, %ecx            # imm = 0x6C1
movl %edx, %eax
lock
cmpxchgl %ecx, 0x7dc0(%rip)      # 0xb6f0
jne 0x3914
movl %edx, %ecx
shrl $0x1c, %ecx
addb $0x4, %cl
movl %edx, %eax
shrl %cl, %eax
xorl %edx, %eax
imull $0x108ef2d9, %eax, %ecx # imm = 0x108EF2D9
movl %ecx, %eax
shrl $0x16, %eax
xorl %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/nemequ[P]safe-math/munit/munit.c
// Function: munit_rand_memory
void
munit_rand_memory(size_t size, uint8_t data[MUNIT_ARRAY_PARAM(size)]) {
  uint32_t old, state;

  do {
    state = old = munit_atomic_load(&munit_rand_state);
    munit_rand_state_memory(&state, size, data);
  } while (!munit_atomic_cas(&munit_rand_state, &old, state));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl %r14d, %r15d
andl $0x3, %r15d
movq %rdi, %r13
shrq $0x2, %r13
movl 0x7d7d(%rip), %ebp      # 0xb6f0
movl %ebp, %edx
movq %rbx, %rdi
cmpq $0x4, %r14
jb 0x39c7
movl %ebp, %r8d
movq %rbx, %rsi
movq %r13, %rax
movl %r8d, %ecx
shrl $0x1c, %ecx
addb $0x4, %cl
movl %r8d, %edi
shrl %cl, %edi
imull $0x2c9277b5, %r8d, %edx # imm = 0x2C9277B5
addl $0x6c1, %edx            # imm = 0x6C1
xorl %r8d, %edi
imull $0x108ef2d9, %edi, %ecx # imm = 0x108EF2D9
movl %ecx, %r8d
shrl $0x16, %r8d
xorl %ecx, %r8d
leaq 0x4(%rsi), %rdi
movl %r8d, (%rsi)
movl %edx, %r8d
movq %rdi, %rsi
decq %rax
jne 0x3987
testq %r15, %r15
je 0x3a09
movl %edx, %ecx
shrl $0x1c, %ecx
addb $0x4, %cl
movl %edx, %eax
shrl %cl, %eax
imull $0x2c9277b5, %edx, %r12d # imm = 0x2C9277B5
addl $0x6c1, %r12d           # imm = 0x6C1
xorl %edx, %eax
imull $0x108ef2d9, %eax, %eax # imm = 0x108EF2D9
movl %eax, %ecx
shrl $0x16, %ecx
xorl %eax, %ecx
movl %ecx, 0x4(%rsp)
leaq 0x4(%rsp), %rsi
movq %r15, %rdx
callq 0x31e0
movl %r12d, %edx
movl %ebp, %eax
lock
cmpxchgl %edx, 0x7cdd(%rip)      # 0xb6f0
jne 0x396d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/nemequ[P]safe-math/munit/munit.c
// Function: munit_rand_int_range
int
munit_rand_int_range(int min, int max) {
  if (min > max)
    return munit_rand_int_range(max, min);

  uint64_t range = (((int64_t) max) - ((int64_t) min));
  if (range > INT32_MAX)
    range = INT32_MAX;

  return min + munit_rand_at_most(0, (int32_t) range);
}

// Assembly:
pushq %rbx
movl %esi, %ebx
movl %ebx, %eax
movl %edi, %ebx
movl %eax, %edi
cmpl %eax, %ebx
jg 0x3a2b
movslq %eax, %rsi
movslq %ebx, %rax
subq %rax, %rsi
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cmpq %rax, %rsi
cmovaeq %rax, %rsi
xorl %edi, %edi
callq 0x3a55
addl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/nemequ[P]safe-math/munit/munit.c
// Function: munit_rand_at_most
static int32_t
munit_rand_at_most(uint32_t salt, int32_t max) {
  uint32_t old, state;
  int32_t retval;

  do {
    state = old = munit_atomic_load(&munit_rand_state);
    retval = munit_rand_state_at_most(&state, salt, max);
  } while (!munit_atomic_cas(&munit_rand_state, &old, state));

  return retval;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movl %edi, %ebp
movslq %esi, %r13
incq %r13
leaq 0x2e94(%rip), %r14      # 0x6905
leaq 0x2e9b(%rip), %r15      # 0x6913
movl 0x7c71(%rip), %r12d     # 0xb6f0
testl %ebx, %ebx
jg 0x3aa0
movl $0x3, %edi
movq %r14, %rsi
movl $0x180, %edx            # imm = 0x180
movq %r15, %rcx
movl %ebx, %r8d
xorl %r9d, %r9d
xorl %eax, %eax
callq 0x3720
movl $0x80000000, %eax       # imm = 0x80000000
xorl %edx, %edx
divq %r13
movq %rax, %rsi
movl $0x80000000, %eax       # imm = 0x80000000
subq %rdx, %rax
movl %r12d, %edx
movl %edx, %ecx
shrl $0x1c, %ecx
addb $0x4, %cl
movl %edx, %edi
shrl %cl, %edi
xorl %edx, %edi
imull $0x2c9277b5, %edx, %edx # imm = 0x2C9277B5
addl $0x6c1, %edx            # imm = 0x6C1
imull $0x108ef2d9, %edi, %ecx # imm = 0x108EF2D9
movl %ebp, %edi
xorl %ecx, %edi
shrl $0x16, %ecx
xorl %edi, %ecx
cmpl %ecx, %eax
jbe 0x3ab8
movl %r12d, %eax
lock
cmpxchgl %edx, 0x7c00(%rip)      # 0xb6f0
jne 0x3a78
movl %ecx, %eax
xorl %edx, %edx
divl %esi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/nemequ[P]safe-math/munit/munit.c
// Function: munit_parameters_get
const char*
munit_parameters_get(const MunitParameter params[], const char* key) {
  for (const MunitParameter* param = params ; param != NULL && param->name != NULL ; param++)
    if (strcmp(param->name, key) == 0)
      return param->value;
  return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0x3b3f
movq %rdi, %r14
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x3b3f
movq %rsi, %r15
addq $0x10, %r14
xorl %ebx, %ebx
movq %r15, %rsi
callq 0x31b0
testl %eax, %eax
je 0x3b43
movq (%r14), %rdi
addq $0x10, %r14
testq %rdi, %rdi
jne 0x3b25
jmp 0x3b47
xorl %ebx, %ebx
jmp 0x3b47
movq -0x8(%r14), %rbx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/nemequ[P]safe-math/munit/munit.c
// Function: munit_suite_list_tests
static void
munit_suite_list_tests (const MunitSuite* suite, bool show_params, const char* prefix) {
  size_t pre_l;
  char* pre = munit_maybe_concat(&pre_l, (char*) prefix, (char*) suite->prefix);

  for (const MunitTest* test = suite->tests ;
       test != NULL && test->name != NULL ;
       test++) {
    if (pre != NULL)
      fputs(pre, stdout);
    puts(test->name);

    if (show_params) {
      for (const MunitParameterEnum* params = test->parameters ;
           params != NULL && params->name != NULL ;
           params++) {
        fprintf(stdout, " - %s: ", params->name);
        if (params->values == NULL) {
          puts("Any");
        } else {
          bool first = true;
          for (char** val = params->values ;
               *val != NULL ;
               val++ ) {
            if(!first) {
              fputs(", ", stdout);
            } else {
              first = false;
            }
            fputs(*val, stdout);
          }
          putc('\n', stdout);
        }
      }
    }
  }

  for (const MunitSuite* child_suite = suite->suites ; child_suite != NULL && child_suite->prefix != NULL ; child_suite++) {
    munit_suite_list_tests(child_suite, show_params, pre);
  }

  munit_maybe_free_concat(pre, prefix, suite->prefix);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rax
movl %esi, 0x4(%rsp)
movq %rdi, %rbx
movq (%rdi), %rdx
leaq 0x20(%rsp), %rdi
movq %rax, 0x8(%rsp)
movq %rax, %rsi
callq 0x4679
movq %rax, %r15
movq %rbx, 0x10(%rsp)
movq 0x8(%rbx), %rbx
testq %rbx, %rbx
je 0x461d
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x461d
movq 0x5a88(%rip), %rbp      # 0x9fd0
leaq 0x29bb(%rip), %r12      # 0x6f0a
leaq 0x29c0(%rip), %r14      # 0x6f16
movq %r15, 0x18(%rsp)
testq %r15, %r15
je 0x456f
movq (%rbp), %rsi
movq %r15, %rdi
callq 0x3120
movq (%rbx), %rdi
callq 0x3070
cmpb $0x0, 0x4(%rsp)
je 0x4607
movq 0x28(%rbx), %r13
testq %r13, %r13
je 0x4607
movq (%r13), %rdx
testq %rdx, %rdx
je 0x4607
movq (%rbp), %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x31d0
movq 0x8(%r13), %r15
testq %r15, %r15
je 0x45f1
movq (%r15), %rdi
testq %rdi, %rdi
je 0x45e1
addq $0x8, %r15
movb $0x1, %al
testb $0x1, %al
jne 0x45ca
movq (%rbp), %rsi
movq %r14, %rdi
callq 0x3120
movq -0x8(%r15), %rdi
movq (%rbp), %rsi
callq 0x3120
movq (%r15), %rdi
addq $0x8, %r15
xorl %eax, %eax
testq %rdi, %rdi
jne 0x45b6
movq (%rbp), %rsi
movl $0xa, %edi
callq 0x31c0
jmp 0x45fd
leaq 0x291a(%rip), %rdi      # 0x6f12
callq 0x3070
movq 0x10(%r13), %rdx
addq $0x10, %r13
jmp 0x458c
movq 0x30(%rbx), %rdi
addq $0x30, %rbx
testq %rdi, %rdi
movq 0x18(%rsp), %r15
jne 0x455b
movq 0x10(%rsp), %rbx
movq 0x10(%rbx), %r14
testq %r14, %r14
je 0x464e
cmpq $0x0, (%r14)
je 0x464e
movzbl 0x4(%rsp), %ebp
movq %r14, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0x44f3
cmpq $0x0, 0x20(%r14)
leaq 0x20(%r14), %r14
jne 0x4636
cmpq 0x8(%rsp), %r15
je 0x4662
cmpq %r15, (%rbx)
je 0x4662
movq %r15, %rdi
callq 0x3030
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/nemequ[P]safe-math/munit/munit.c
// Function: munit_maybe_concat
static char*
munit_maybe_concat(size_t* len, char* prefix, char* suffix) {
  char* res;
  size_t res_l;
  const size_t prefix_l = prefix != NULL ? strlen(prefix) : 0;
  const size_t suffix_l = suffix != NULL ? strlen(suffix) : 0;
  if (prefix_l == 0 && suffix_l == 0) {
    res = NULL;
    res_l = 0;
  } else if (prefix_l == 0 && suffix_l != 0) {
    res = suffix;
    res_l = suffix_l;
  } else if (prefix_l != 0 && suffix_l == 0) {
    res = prefix;
    res_l = prefix_l;
  } else {
    res_l = prefix_l + suffix_l;
    res = malloc(res_l + 1);
    memcpy(res, prefix, prefix_l);
    memcpy(res + prefix_l, suffix, suffix_l);
    res[res_l] = 0;
  }

  if (len != NULL)
    *len = res_l;

  return res;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, (%rsp)
testq %rsi, %rsi
je 0x46a0
movq %r15, %rdi
callq 0x30d0
movq %rax, %r12
jmp 0x46a3
xorl %r12d, %r12d
testq %r14, %r14
je 0x46b5
movq %r14, %rdi
callq 0x30d0
movq %rax, %r13
jmp 0x46b8
xorl %r13d, %r13d
xorl %ebx, %ebx
movq %r12, %rax
orq %r13, %rax
movl $0x0, %ebp
je 0x472e
testq %r12, %r12
sete %al
testq %r13, %r13
setne %cl
testb %cl, %al
je 0x46df
movq %r13, %rbx
movq %r14, %rbp
jmp 0x472e
testq %r13, %r13
sete %al
testq %r12, %r12
setne %cl
testb %al, %cl
je 0x46f7
movq %r12, %rbx
movq %r15, %rbp
jmp 0x472e
leaq (%r12,%r13), %rbx
leaq (%r12,%r13), %rdi
incq %rdi
callq 0x3210
movq %rax, %rbp
movq %rax, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x31e0
addq %rbp, %r12
movq %r12, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x31e0
movb $0x0, (%rbp,%rbx)
movq (%rsp), %rax
testq %rax, %rax
je 0x473a
movq %rbx, (%rax)
movq %rbp, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/nemequ[P]safe-math/munit/munit.c
// Function: munit_test_runner_run_test_wild
static void
munit_test_runner_run_test_wild(MunitTestRunner* runner,
                                const MunitTest* test,
                                const char* test_name,
                                MunitParameter* params,
                                MunitParameter* p) {
  const MunitParameterEnum* pe;
  for (pe = test->parameters ; pe != NULL && pe->name != NULL ; pe++) {
    if (p->name == pe->name)
      break;
  }

  if (pe == NULL)
    return;

  for (char** values = pe->values ; *values != NULL ; values++) {
    MunitParameter* next = p + 1;
    p->value = *values;
    if (next->name == NULL) {
      munit_test_runner_run_test_with_params(runner, test, params);
    } else {
      munit_test_runner_run_test_wild(runner, test, test_name, params, next);
    }
    if (runner->fatal_failures && (runner->report.failed != 0 || runner->report.errored != 0))
      break;
  }
}

// Assembly:
movq 0x28(%rsi), %rax
testq %rax, %rax
je 0x5476
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movq (%rax), %rcx
testq %rcx, %rcx
je 0x5402
movq (%rbx), %rdx
cmpq %rcx, %rdx
je 0x5402
movq 0x10(%rax), %rcx
addq $0x10, %rax
testq %rcx, %rcx
jne 0x53f0
movq 0x8(%rax), %rbp
movq (%rbp), %rax
testq %rax, %rax
je 0x5468
leaq 0x10(%rbx), %r13
addq $0x8, %rbp
movq %rax, 0x8(%rbx)
cmpq $0x0, 0x10(%rbx)
je 0x5435
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %r13, %rcx
callq 0x53c1
jmp 0x5443
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x4ce5
cmpb $0x1, 0x5b(%r12)
jne 0x545b
cmpl $0x0, 0x40(%r12)
jne 0x5468
cmpl $0x0, 0x44(%r12)
jne 0x5468
movq (%rbp), %rax
addq $0x8, %rbp
testq %rax, %rax
jne 0x5417
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/nemequ[P]safe-math/munit/munit.c
// Function: munit_replace_stderr
static int
munit_replace_stderr (FILE* stderr_buf) {
  if (stderr_buf != NULL) {
    const int orig_stderr = dup(STDERR_FILENO);

    int errfd = fileno(stderr_buf);
    if (MUNIT_UNLIKELY(errfd == -1)) {
      exit (EXIT_FAILURE);
      }

    dup2(errfd, STDERR_FILENO);

    return orig_stderr;
  }

  return -1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movl $0x2, %edi
callq 0x3110
movl %eax, %ebx
movq %r14, %rdi
callq 0x3200
cmpl $-0x1, %eax
je 0x54fe
movl %eax, %edi
movl $0x2, %esi
callq 0x30e0
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
callq 0x3313
// File: /workspace/github_c_makefile_star2_O3/nemequ[P]safe-math/munit/munit.c
// Function: munit_test_runner_print_color
static void
munit_test_runner_print_color(const MunitTestRunner* runner, const char* string, char color) {
  if (runner->colorize)
    fprintf(MUNIT_OUTPUT_FILE, "\x1b[3%cm%s\x1b[39m", color, string);
  else
    fputs(string, MUNIT_OUTPUT_FILE);
}

// Assembly:
movq %rsi, %rcx
movq 0x4933(%rip), %rax      # 0x9fd0
movq (%rax), %rax
testb $0x1, %dil
je 0x56ba
movzbl %dl, %edx
leaq 0x19de(%rip), %rsi      # 0x708e
movq %rax, %rdi
xorl %eax, %eax
jmp 0x31d0
movq %rcx, %rdi
movq %rax, %rsi
jmp 0x3120
// File: /workspace/github_c_makefile_star2_O3/pajlada[P]st/st.c
// Function: tlinelen
int
tlinelen(int y)
{
	int i = term.col;

	if (term.line[y][i - 1].mode & ATTR_WRAP)
		return i;

	while (i > 0 && term.line[y][i - 1].u == ' ')
		--i;

	return i;
}

// Assembly:
movslq 0xf120(%rip), %rax      # 0x15754
movq 0xf11d(%rip), %rcx      # 0x15758
movslq %edi, %rdx
movq (%rcx,%rdx,8), %rcx
movq %rax, %rdx
shlq $0x4, %rdx
testb $0x1, -0xb(%rcx,%rdx)
jne 0x6670
testl %eax, %eax
jle 0x6670
addq $-0x10, %rcx
movl %eax, %edx
shlq $0x4, %rdx
cmpl $0x20, (%rcx,%rdx)
jne 0x6670
leal -0x1(%rax), %edx
cmpl $0x1, %eax
movl %edx, %eax
jg 0x6658
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/pajlada[P]st/st.c
// Function: ttywrite
void
ttywrite(const char *s, size_t n, int may_echo)
{
	const char *next;

	if (may_echo && IS_SET(MODE_ECHO))
		twrite(s, n, 1);

	if (!IS_SET(MODE_CRLF)) {
		ttywriteraw(s, n);
		return;
	}

	/* This is similar to how the kernel handles ONLCR for ttys */
	while (n > 0) {
		if (*s == '\r') {
			next = s + 1;
			ttywriteraw("\r\n", 2);
		} else {
			next = memchr(s, '\r', n);
			DEFAULT(next, s + n);
			ttywriteraw(s, next - s);
		}
		n -= next - s;
		s = next;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
testl %edx, %edx
sete %cl
movl 0xea93(%rip), %eax      # 0x1579c
testb $0x10, %al
sete %dl
orb %cl, %dl
jne 0x6d27
movq %r14, %rdi
movl %ebx, %esi
movl $0x1, %edx
callq 0x6bf9
movl 0xea75(%rip), %eax      # 0x1579c
testb $0x8, %al
jne 0x6d3e
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x6da1
testq %rbx, %rbx
je 0x6d95
leaq 0x793a(%rip), %r15      # 0xe684
cmpb $0xd, (%r14)
jne 0x6d5e
leaq 0x1(%r14), %r12
movl $0x2, %esi
movq %r15, %rdi
jmp 0x6d82
movq %r14, %rdi
movl $0xd, %esi
movq %rbx, %rdx
callq 0x5120
leaq (%r14,%rbx), %r12
testq %rax, %rax
cmovneq %rax, %r12
movq %r12, %rsi
subq %r14, %rsi
movq %r14, %rdi
callq 0x6da1
movq %r14, %rax
movq %r12, %r14
addq %rax, %rbx
subq %r12, %rbx
jne 0x6d4a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/pajlada[P]st/st.c
// Function: tscrollup
void
tscrollup(int orig, int n)
{
	int i;
	Line temp;

	LIMIT(n, 0, term.bot-orig+1);

	tclearregion(0, orig, term.col-1, orig+n-1);
	tsetdirt(orig+n, term.bot);

	for (i = orig; i <= term.bot-n; i++) {
		temp = term.line[i];
		term.line[i] = term.line[i+n];
		term.line[i+n] = temp;
	}

	selscroll(orig, -n);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edi, %ebx
testl %esi, %esi
js 0x9c6b
movl 0xbb3c(%rip), %r14d     # 0x15798
subl %ebx, %r14d
incl %r14d
cmpl %esi, %r14d
cmovgel %esi, %r14d
jmp 0x9c6e
xorl %r14d, %r14d
movl 0xbae0(%rip), %edx      # 0x15754
decl %edx
leal (%r14,%rbx), %ebp
leal (%r14,%rbx), %ecx
decl %ecx
xorl %edi, %edi
movl %ebx, %esi
callq 0x773e
movl 0xbb09(%rip), %esi      # 0x15798
movl %ebp, %edi
callq 0x61eb
movl 0xbafc(%rip), %eax      # 0x15798
subl %r14d, %eax
subl %ebx, %eax
jl 0x9cd6
movslq %ebx, %rdx
movslq %r14d, %rcx
movq 0xbaa8(%rip), %rsi      # 0x15758
addq %rdx, %rcx
leaq (%rsi,%rcx,8), %rcx
leaq (%rsi,%rdx,8), %rdx
incl %eax
xorl %esi, %esi
movq (%rdx,%rsi,8), %rdi
movq (%rcx,%rsi,8), %r8
movq %r8, (%rdx,%rsi,8)
movq %rdi, (%rcx,%rsi,8)
incq %rsi
cmpl %esi, %eax
jne 0x9cbf
negl %r14d
movl %ebx, %edi
movl %r14d, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0xa312
// File: /workspace/github_c_makefile_star2_O3/pajlada[P]st/st.c
// Function: tscrolldown
void
tscrolldown(int orig, int n)
{
	int i;
	Line temp;

	LIMIT(n, 0, term.bot-orig+1);

	tsetdirt(orig, term.bot-n);
	tclearregion(0, term.bot-n+1, term.col-1, term.bot);

	for (i = term.bot; i >= orig+n; i--) {
		temp = term.line[i];
		term.line[i] = term.line[i-n];
		term.line[i-n] = temp;
	}

	selscroll(orig, n);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %eax
movl %edi, %ebx
movl 0xbaa3(%rip), %esi      # 0x15798
testl %eax, %eax
js 0x9d0b
movl %esi, %r14d
subl %ebx, %r14d
incl %r14d
cmpl %eax, %r14d
cmovgel %eax, %r14d
jmp 0x9d0e
xorl %r14d, %r14d
subl %r14d, %esi
movl %ebx, %edi
callq 0x61eb
movl 0xba7a(%rip), %ecx      # 0x15798
movl %ecx, %esi
subl %r14d, %esi
incl %esi
movl 0xba29(%rip), %edx      # 0x15754
decl %edx
xorl %edi, %edi
callq 0x773e
movslq 0xba5d(%rip), %rax      # 0x15798
leal (%r14,%rbx), %ecx
cmpl %ecx, %eax
jl 0x9d79
movslq %r14d, %rdi
movslq %ecx, %rcx
movq 0xba08(%rip), %rdx      # 0x15758
incq %rax
shlq $0x3, %rdi
movq %rdx, %rsi
subq %rdi, %rsi
movq -0x8(%rdx,%rax,8), %rdi
movq -0x8(%rsi,%rax,8), %r8
movq %r8, -0x8(%rdx,%rax,8)
movq %rdi, -0x8(%rsi,%rax,8)
decq %rax
cmpq %rcx, %rax
jg 0x9d5d
movl %ebx, %edi
movl %r14d, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xa312
// File: /workspace/github_c_makefile_star2_O3/pajlada[P]st/x.c
// Function: xloadcols
void
xloadcols(void)
{
	int i;
	static int loaded;
	Color *cp;

	if (loaded) {
		for (cp = dc.col; cp < &dc.col[dc.collen]; ++cp)
			XftColorFree(xw.dpy, xw.vis, xw.cmap, cp);
	} else {
		dc.collen = MAX(LEN(colorname), 256);
		dc.col = xmalloc(dc.collen * sizeof(Color));
	}

	for (i = 0; i < dc.collen; i++)
		if (!xloadcolor(i, NULL, &dc.col[i])) {
			if (colorname[i])
				die("could not allocate color '%s'\n", colorname[i]);
			else
				die("could not allocate color %d\n", i);
		}
	loaded = 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
cmpb $0x1, 0xd5b2(%rip)      # 0x17b2c
jne 0xa5cc
movq 0xd5b5(%rip), %rax      # 0x17b38
testq %rax, %rax
jle 0xa5ef
movq 0xd5a1(%rip), %rbx      # 0x17b30
movq 0xd692(%rip), %rdi      # 0x17c28
movq 0xd703(%rip), %rsi      # 0x17ca0
movq 0xd68c(%rip), %rdx      # 0x17c30
movq %rbx, %rcx
callq 0x55c0
addq $0x10, %rbx
movq 0xd581(%rip), %rax      # 0x17b38
movq %rax, %rcx
shlq $0x4, %rcx
addq 0xd56b(%rip), %rcx      # 0x17b30
cmpq %rcx, %rbx
jb 0xa58f
jmp 0xa5ef
movq $0x104, 0xd561(%rip) # imm = 0x104
movl $0x1040, %edi           # imm = 0x1040
callq 0x5e6c
movq %rax, 0xd548(%rip)      # 0x17b30
movq 0xd549(%rip), %rax      # 0x17b38
testq %rax, %rax
je 0xa664
leaq 0x8425(%rip), %r12      # 0x12a20
leaq 0x46d5(%rip), %rbx      # 0xecd7
leaq 0x46af(%rip), %r14      # 0xecb8
xorl %r13d, %r13d
xorl %r15d, %r15d
movq 0xd51a(%rip), %rdx      # 0x17b30
addq %r13, %rdx
movl %r15d, %edi
xorl %esi, %esi
callq 0xa675
testl %eax, %eax
jne 0xa650
leaq -0x10(%r15), %rax
cmpq $0xf0, %rax
jae 0xa642
movq %rbx, %rdi
movl %r15d, %esi
xorl %eax, %eax
callq 0x5e96
jmp 0xa650
movq (%r12), %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0x5e96
incq %r15
addq $0x8, %r12
addq $0x10, %r13
cmpq %r15, 0xd4d6(%rip)      # 0x17b38
ja 0xa60f
movb $0x1, 0xd4c1(%rip)      # 0x17b2c
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/pajlada[P]st/x.c
// Function: xgetcolor
int
xgetcolor(int x, unsigned char *r, unsigned char *g, unsigned char *b)
{
	if (!BETWEEN(x, 0, dc.collen))
		return 1;

	*r = dc.col[x].color.red >> 8;
	*g = dc.col[x].color.green >> 8;
	*b = dc.col[x].color.blue >> 8;

	return 0;
}

// Assembly:
movl $0x1, %eax
testl %edi, %edi
js 0xa7c1
movl %edi, %edi
cmpq %rdi, 0xd3a6(%rip)      # 0x17b38
jb 0xa7c1
movq 0xd395(%rip), %rax      # 0x17b30
shlq $0x4, %rdi
movb 0x9(%rax,%rdi), %al
movb %al, (%rsi)
movq 0xd384(%rip), %rax      # 0x17b30
movb 0xb(%rax,%rdi), %al
movb %al, (%rdx)
movq 0xd377(%rip), %rax      # 0x17b30
movb 0xd(%rax,%rdi), %al
movb %al, (%rcx)
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/bench/bulk_extract/main.c
// Function: callback_range
static int
callback_range(void * cookie,
    const struct kvldskey * key, const struct kvldskey * value)
{
	struct bulkextract_state * C = cookie;

	(void)key; /* UNUSED */
	(void)value; /* UNUSED */

	/* Notify the benchmarking code, and check if we should quit. */
	if (bench_tick(C->B, &C->done)) {
		warnp("bench_tick");
		goto err0;
	}

	/* Success! */
	return (0);

err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %rbx
movq 0x18(%rdi), %rax
leaq 0x14(%rdi), %rsi
movq %rax, %rdi
callq 0x5319
testl %eax, %eax
je 0x27b7
callq 0x2090
cmpl $0x0, (%rax)
je 0x27bb
movq %rax, %rbx
leaq 0x7903(%rip), %rdi      # 0xa0ab
xorl %eax, %eax
callq 0x4f2c
movl $0x0, (%rbx)
jmp 0x27c9
xorl %eax, %eax
jmp 0x27ce
leaq 0x78e9(%rip), %rdi      # 0xa0ab
xorl %eax, %eax
callq 0x504b
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/bench/bulk_extract/main.c
// Function: callback_done
static int
callback_done(void * cookie, int failed)
{
	struct bulkextract_state * C = cookie;
	int rc = 0;

	/* Did we fail? */
	if (failed) {
		C->failed = 1;
		C->done = 1;
	}

	/* Restart the RANGE requests. */
	if (!C->done)
		rc = startrange(C);

	return (rc);
}

// Assembly:
movq %rdi, %r9
testl %esi, %esi
je 0x27e7
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0x10(%r9)
jmp 0x27ee
cmpl $0x0, 0x14(%r9)
je 0x27f1
xorl %eax, %eax
retq
movq (%r9), %rdi
movq 0x8(%r9), %rdx
leaq -0x80(%rip), %rcx       # 0x277f
leaq -0x36(%rip), %r8        # 0x27d0
movq %rdx, %rsi
jmp 0x66d2
nop
// File: /workspace/github_c_makefile_star2_O3/wtarreau[P]httpterm/httpterm.c
// Function: strlcpy2
int strlcpy2(char *dst, const char *src, int size) {
    char *orig = dst;
    if (size) {
	while (--size && (*dst = *src)) {
	    src++; dst++;
	}
	*dst = 0;
    }
    return dst - orig;
}

// Assembly:
movq %rdi, %rax
testl %edx, %edx
je 0x29af
movq %rdi, %rax
decl %edx
je 0x29ac
movl %edx, %ecx
xorl %eax, %eax
movb (%rsi,%rax), %dl
movb %dl, (%rdi,%rax)
testb %dl, %dl
je 0x29a9
incq %rax
cmpl %eax, %ecx
jne 0x2998
addq %rdi, %rax
movb $0x0, (%rax)
subl %edi, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/wtarreau[P]httpterm/httpterm.c
// Function: Alert
void Alert(char *fmt, ...) {
    va_list argp;
    struct timeval tv;
    struct tm *tm;

    if (!(global.mode & MODE_QUIET) || (global.mode & (MODE_VERBOSE | MODE_STARTING))) {
	va_start(argp, fmt);

	gettimeofday(&tv, NULL);
	tm=localtime(&tv.tv_sec);
	fprintf(stderr, "[ALERT] %03d/%02d%02d%02d (%d) : ",
		tm->tm_yday, tm->tm_hour, tm->tm_min, tm->tm_sec, (int)getpid());
	vfprintf(stderr, fmt, argp);
	fflush(stderr);
	va_end(argp);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %rsi, 0x48(%rsp)
movq %rdx, 0x50(%rsp)
movq %rcx, 0x58(%rsp)
movq %r8, 0x60(%rsp)
movq %r9, 0x68(%rsp)
testb %al, %al
je 0x2a65
movaps %xmm0, 0x70(%rsp)
movaps %xmm1, 0x80(%rsp)
movaps %xmm2, 0x90(%rsp)
movaps %xmm3, 0xa0(%rsp)
movaps %xmm4, 0xb0(%rsp)
movaps %xmm5, 0xc0(%rsp)
movaps %xmm6, 0xd0(%rsp)
movaps %xmm7, 0xe0(%rsp)
movl $0xd0, %eax
andl 0xa958(%rip), %eax      # 0xd3c8
cmpl $0x10, %eax
jne 0x2a87
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rdi, %rbx
leaq 0x40(%rsp), %rax
leaq 0x10(%rsp), %rcx
movq %rax, 0x10(%rcx)
leaq 0x130(%rsp), %rax
movq %rax, 0x8(%rcx)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rcx)
leaq 0x30(%rsp), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x2190
movq %r15, %rdi
callq 0x2070
movq 0xa529(%rip), %rcx      # 0xcff8
movq (%rcx), %r15
movl 0x1c(%rax), %ebp
movl 0x8(%rax), %r12d
movl (%rax), %r13d
movl 0x4(%rax), %r14d
callq 0x2100
movl %eax, (%rsp)
leaq 0x7752(%rip), %rsi      # 0xa241
movq %r15, %rdi
movl %ebp, %edx
movl %r12d, %ecx
movl %r14d, %r8d
movl %r13d, %r9d
xorl %eax, %eax
callq 0x2230
movq 0xa4ed(%rip), %rax      # 0xcff8
movq (%rax), %rdi
movq %rbx, %rsi
leaq 0x10(%rsp), %rdx
callq 0x2350
movq 0xa4d6(%rip), %rax      # 0xcff8
movq (%rax), %rdi
callq 0x22b0
jmp 0x2a75
// File: /workspace/github_c_makefile_star2_O3/wtarreau[P]httpterm/httpterm.c
// Function: qfprintf
void qfprintf(FILE *out, char *fmt, ...) {
    va_list argp;

    if (!(global.mode & MODE_QUIET) || (global.mode & MODE_VERBOSE)) {
	va_start(argp, fmt);
	vfprintf(out, fmt, argp);
	fflush(out);
	va_end(argp);
    }
}

// Assembly:
pushq %rbx
subq $0xd0, %rsp
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testb %al, %al
je 0x2cbb
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)
movl 0xa707(%rip), %eax      # 0xd3c8
andl $0x50, %eax
cmpl $0x10, %eax
je 0x2cfe
movq %rdi, %rbx
leaq 0x20(%rsp), %rax
movq %rsp, %rdx
movq %rax, 0x10(%rdx)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rdx)
callq 0x2350
movq %rbx, %rdi
callq 0x22b0
addq $0xd0, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/wtarreau[P]httpterm/httpterm.c
// Function: str2sa
struct sockaddr_in *str2sa(char *str) {
    static struct sockaddr_in sa;
    char *c;
    int port;

    memset(&sa, 0, sizeof(sa));
    str=strdup(str);

    if ((c=strrchr(str,':')) != NULL) {
	*c++=0;
	port=atol(c);
    }
    else
	port=0;

    if (*str == '*' || *str == '\0') { /* INADDR_ANY */
	sa.sin_addr.s_addr = INADDR_ANY;
    }
    else if (!inet_pton(AF_INET, str, &sa.sin_addr)) {
	struct hostent *he;

	if ((he = gethostbyname(str)) == NULL) {
	    Alert("Invalid server name: '%s'\n", str);
	}
	else
	    sa.sin_addr = *(struct in_addr *) *(he->h_addr_list);
    }
    sa.sin_port=htons(port);
    sa.sin_family=AF_INET;

    free(str);
    return &sa;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
xorps %xmm0, %xmm0
movups %xmm0, 0xa6cf(%rip)     # 0xd3e4
callq 0x23e0
movq %rax, %rbx
movq %rax, %rdi
movl $0x3a, %esi
callq 0x2180
testq %rax, %rax
je 0x2d42
movq %rax, %rdi
incq %rdi
movb $0x0, (%rax)
callq 0x2320
movq %rax, %r14
jmp 0x2d45
xorl %r14d, %r14d
movzbl (%rbx), %eax
cmpl $0x2a, %eax
je 0x2d51
testl %eax, %eax
jne 0x2d5d
movl $0x0, 0xa68d(%rip)      # 0xd3e8
jmp 0x2da4
leaq 0xa684(%rip), %rdx      # 0xd3e8
movl $0x2, %edi
movq %rbx, %rsi
callq 0x2260
testl %eax, %eax
jne 0x2da4
movq %rbx, %rdi
callq 0x2220
testq %rax, %rax
je 0x2d93
movq 0x18(%rax), %rax
movq (%rax), %rax
movl (%rax), %eax
movl %eax, 0xa657(%rip)      # 0xd3e8
jmp 0x2da4
leaq 0x74ed(%rip), %rdi      # 0xa287
movq %rbx, %rsi
xorl %eax, %eax
callq 0x29fa
rolw $0x8, %r14w
movw %r14w, 0xa635(%rip)     # 0xd3e6
leaq 0xa62c(%rip), %r14      # 0xd3e4
movw $0x2, 0xa623(%rip)      # 0xd3e4
movq %rbx, %rdi
callq 0x2050
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/wtarreau[P]httpterm/httpterm.c
// Function: str2net
int str2net(char *str, struct in_addr *addr, struct in_addr *mask) {
    char *c;
    unsigned long len;

    memset(mask, 0, sizeof(*mask));
    memset(addr, 0, sizeof(*addr));
    str=strdup(str);

    if ((c = strrchr(str, '/')) != NULL) {
	*c++ = 0;
        /* c points to the mask */
	if (strchr(c, '.') != NULL) {	    /* dotted notation */
	    if (!inet_pton(AF_INET, c, mask))
		return 0;
	}
	else { /* mask length */
	    char *err;
	    len = strtol(c, &err, 10);
	    if (!*c || (err && *err) || (unsigned)len > 32)
		return 0;
	    if (len)
		mask->s_addr = htonl(0xFFFFFFFFUL << (32 - len));
	    else
		mask->s_addr = 0;
	}
    }
    else {
	mask->s_addr = 0xFFFFFFFF;
    }
    if (!inet_pton(AF_INET, str, addr)) {
	struct hostent *he;

	if ((he = gethostbyname(str)) == NULL) {
	    return 0;
	}
	else
	    *addr = *(struct in_addr *) *(he->h_addr_list);
    }
    free(str);
    return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %rbx
xorl %eax, %eax
movl %eax, (%rdx)
movl %eax, (%rsi)
callq 0x23e0
movq %rax, %r14
movq %rax, %rdi
movl $0x2f, %esi
callq 0x2180
testq %rax, %rax
je 0x2e36
movq %rax, %r12
incq %r12
movb $0x0, (%rax)
movq %r12, %rdi
movl $0x2e, %esi
callq 0x2160
testq %rax, %rax
je 0x2e78
movl $0x2, %edi
movq %r12, %rsi
movq %r15, %rdx
callq 0x2260
testl %eax, %eax
jne 0x2e3d
jmp 0x2ec3
movl $0xffffffff, (%r15)     # imm = 0xFFFFFFFF
movl $0x2, %edi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x2260
testl %eax, %eax
jne 0x2e69
movq %r14, %rdi
callq 0x2220
testq %rax, %rax
je 0x2ec3
movq 0x18(%rax), %rax
movq (%rax), %rax
movl (%rax), %eax
movl %eax, (%rbx)
movq %r14, %rdi
callq 0x2050
movl $0x1, %eax
jmp 0x2ec5
movq %rsp, %rsi
movq %r12, %rdi
movl $0xa, %edx
callq 0x2240
cmpb $0x0, (%r12)
je 0x2ec3
movq (%rsp), %rcx
testq %rcx, %rcx
je 0x2e9d
cmpb $0x0, (%rcx)
jne 0x2ec3
cmpl $0x20, %eax
ja 0x2ec3
leaq 0x20(%rax), %rcx
negq %rcx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
shlq %cl, %rdx
xorl %ecx, %ecx
testq %rax, %rax
bswapl %edx
cmovel %ecx, %edx
movl %edx, (%r15)
jmp 0x2e3d
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/wtarreau[P]httpterm/httpterm.c
// Function: tv_delta
unsigned long tv_delta(struct timeval *tv1, struct timeval *tv2) {
    int cmp;
    unsigned long ret;
  

    cmp = tv_cmp(tv1, tv2);
    if (!cmp)
	return 0; /* same dates, null diff */
    else if (cmp < 0) {
	struct timeval *tmp = tv1;
	tv1 = tv2;
	tv2 = tmp;
    }
    ret = (tv1->tv_sec - tv2->tv_sec) * 1000;
    if (tv1->tv_usec > tv2->tv_usec)
	ret += (tv1->tv_usec - tv2->tv_usec) / 1000;
    else
	ret -= (tv2->tv_usec - tv1->tv_usec) / 1000;
    return (unsigned long) ret;
}

// Assembly:
movq (%rsi), %rax
cmpq %rax, (%rdi)
jge 0x3138
movq %rdi, %rax
movq %rsi, %rdi
jmp 0x313d
jle 0x3191
movq %rsi, %rax
movq (%rdi), %rcx
movq 0x8(%rdi), %rdx
subq (%rax), %rcx
imulq $0x3e8, %rcx, %rsi      # imm = 0x3E8
movq 0x8(%rax), %rax
movq %rdx, %rcx
subq %rax, %rcx
jle 0x316c
movabsq $0x20c49ba5e353f7cf, %rdx # imm = 0x20C49BA5E353F7CF
movq %rcx, %rax
imulq %rdx
jmp 0x317c
subq %rdx, %rax
movabsq $-0x20c49ba5e353f7cf, %rcx # imm = 0xDF3B645A1CAC0831
imulq %rcx
movq %rdx, %rax
movq %rdx, %rcx
shrq $0x3f, %rcx
sarq $0x7, %rax
addq %rcx, %rax
addq %rsi, %rax
retq
movq 0x8(%rdi), %rax
movq 0x8(%rsi), %rcx
cmpq %rcx, %rax
jl 0x3130
movq %rsi, %rax
jg 0x313d
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/wtarreau[P]httpterm/httpterm.c
// Function: tv_cmp2
static int tv_cmp2(struct timeval *tv1, struct timeval *tv2) {
    if (tv_iseternity(tv1))
	if (tv_iseternity(tv2))
	    return 0; /* same */
	else
	    return 1; /* tv1 later than tv2 */
    else if (tv_iseternity(tv2))
	return -1; /* tv2 later than tv1 */
    
    if (tv1->tv_sec > tv2->tv_sec)
	return 1;
    else if (tv1->tv_sec < tv2->tv_sec)
	return -1;
    else if (tv1->tv_usec > tv2->tv_usec)
	return 1;
    else if (tv1->tv_usec < tv2->tv_usec)
	return -1;
    else
	return 0;
}

// Assembly:
movq (%rdi), %rcx
testq %rcx, %rcx
jne 0x3300
cmpq $0x0, 0x8(%rdi)
je 0x3338
movq (%rsi), %rdx
testq %rdx, %rdx
jne 0x330f
cmpq $0x0, 0x8(%rsi)
je 0x334b
movl $0x1, %eax
cmpq %rdx, %rcx
jg 0x3337
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jl 0x3337
movq 0x8(%rsi), %rcx
movl $0x1, %eax
cmpq %rcx, 0x8(%rdi)
jg 0x3337
setl %al
movzbl %al, %eax
negl %eax
retq
cmpq $0x0, (%rsi)
jne 0x3345
cmpq $0x0, 0x8(%rsi)
je 0x3351
movl $0x1, %eax
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/wtarreau[P]httpterm/httpterm.c
// Function: tv_delayfrom
static struct timeval *tv_delayfrom(struct timeval *tv, struct timeval *from, int ms) {
    if (!tv || !from)
	return NULL;
    tv->tv_usec = from->tv_usec + (ms%1000)*1000;
    tv->tv_sec  = from->tv_sec  + (ms/1000);
    while (tv->tv_usec >= 1000000) {
	tv->tv_usec -= 1000000;
	tv->tv_sec++;
    }
    return tv;
}

// Assembly:
testq %rdi, %rdi
je 0x35e4
movslq %esi, %rax
imulq $0x10624dd3, %rax, %rdx # imm = 0x10624DD3
movq %rdx, %rcx
shrq $0x3f, %rcx
sarq $0x26, %rdx
addl %ecx, %edx
imull $0x3e8, %edx, %ecx      # imm = 0x3E8
subl %ecx, %eax
imull $0x3e8, %eax, %eax      # imm = 0x3E8
movslq %eax, %r8
addq 0x9e8b(%rip), %r8       # 0xd408
movq %r8, 0x8(%rdi)
movq 0x9e78(%rip), %rcx      # 0xd400
movslq %edx, %rsi
cmpq $0xf4240, %r8           # imm = 0xF4240
jl 0x35de
xorl %eax, %eax
movq %r8, %rdx
subq $0x1e847f, %rdx         # imm = 0x1E847F
cmovaeq %rdx, %rax
addq $0xf423f, %rax          # imm = 0xF423F
movabsq $0x431bde82d7b634db, %rdx # imm = 0x431BDE82D7B634DB
mulq %rdx
shrq $0x12, %rdx
imulq $-0xf4240, %rdx, %rax   # imm = 0xFFF0BDC0
addq %rdx, %rcx
movq $-0xf4240, %rdx         # imm = 0xFFF0BDC0
addq %r8, %rdx
addq %rax, %rdx
addq %rsi, %rcx
incq %rcx
movq %rdx, 0x8(%rdi)
jmp 0x35e1
addq %rsi, %rcx
movq %rcx, (%rdi)
movq %rdi, %rax
retq
// File: /workspace/github_c_makefile_star2_O3/wtarreau[P]httpterm/httpterm.c
// Function: client_retnclose
void client_retnclose(struct session *s, int len, const char *msg) {
    my_fd_clr(s->cli_fd, StaticReadEvent);
    my_fd_set(s->cli_fd, StaticWriteEvent);
    tv_eternity(&s->crexpire);
    tv_delayfrom(&s->cwexpire, &now, s->proxy->clitimeout);
    shutdown(s->cli_fd, SHUT_RD);
    s->cli_state = CL_STDATA;
    strcpy(s->rep->data, msg);
    s->rep->l = len;
    s->rep->r = s->rep->h = s->rep->lr = s->rep->w = s->rep->data;
    s->rep->r += len;
    s->req->l = 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl 0x48(%rdi), %ecx
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
roll %cl, %eax
movq 0x9a3f(%rip), %rdi      # 0xd3f8
sarl $0x5, %ecx
movslq %ecx, %rcx
andl %eax, (%rdi,%rcx,4)
movq %rdx, %r14
movl 0x48(%rbx), %ecx
movl $0x1, %eax
shll %cl, %eax
movl %esi, %ebp
movq 0x29a48(%rip), %rdx     # 0x2d420
sarl $0x5, %ecx
movslq %ecx, %rcx
orl %eax, (%rdx,%rcx,4)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rbx)
leaq 0x18(%rbx), %rdi
movq 0x40(%rbx), %rax
movl 0x30(%rax), %esi
callq 0x3545
movl 0x48(%rbx), %edi
xorl %esi, %esi
callq 0x2120
movl $0x3, 0x4c(%rbx)
movq 0x60(%rbx), %rax
movq 0x30(%rax), %rdi
movq %r14, %rsi
callq 0x20a0
movq 0x60(%rbx), %rax
movl %ebp, (%rax)
movq 0x30(%rax), %rcx
movq %rcx, 0x10(%rax)
movq %rcx, 0x20(%rax)
movq %rcx, 0x18(%rax)
movslq %ebp, %rdx
addq %rcx, %rdx
movq %rdx, 0x8(%rax)
movq 0x58(%rbx), %rax
movl $0x0, (%rax)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/wtarreau[P]httpterm/httpterm.c
// Function: buffer_replace
int buffer_replace(struct buffer *b, char *pos, char *end, char *str) {
    int delta;
    int len;

    len = strlen(str);
    delta = len - (end - pos);

    if (delta + b->r >= b->data + BUFSIZE)
	return 0;  /* no space left */

    /* first, protect the end of the buffer */
    memmove(end + delta, end, b->data + b->l - end);

    /* now, copy str over pos */
    memcpy(pos, str,len);

    /* we only move data after the displaced zone */
    if (b->r  > pos) b->r  += delta;
    if (b->w  > pos) b->w  += delta;
    if (b->h  > pos) b->h  += delta;
    if (b->lr > pos) b->lr += delta;
    b->l += delta;

    return delta;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %rbx
movq %rcx, %rdi
callq 0x2130
movq %r14, %rbp
subq %r12, %rbp
addq %rax, %rbp
movslq %ebp, %r13
movq 0x8(%rbx), %rsi
addq %r13, %rsi
movq 0x30(%rbx), %rdx
leaq 0x1000(%rdx), %rdi
xorl %ecx, %ecx
cmpq %rdi, %rsi
jae 0x43a1
cltq
movq %rax, (%rsp)
leaq (%r12,%r13), %rdi
movl (%rbx), %eax
addq %rax, %rdx
subq %r12, %rdx
movq %r12, %rsi
callq 0x2300
movq %r14, %rdi
movq %r15, %rsi
movq (%rsp), %rdx
callq 0x2250
movq 0x8(%rbx), %rax
cmpq %r14, %rax
jbe 0x436d
addq %r13, %rax
movq %rax, 0x8(%rbx)
movq 0x10(%rbx), %rax
cmpq %r14, %rax
jbe 0x437d
addq %r13, %rax
movq %rax, 0x10(%rbx)
movq 0x18(%rbx), %rax
cmpq %r14, %rax
jbe 0x438d
addq %r13, %rax
movq %rax, 0x18(%rbx)
movq 0x20(%rbx), %rax
cmpq %r14, %rax
jbe 0x439d
addq %r13, %rax
movq %rax, 0x20(%rbx)
addl %ebp, (%rbx)
movl %ebp, %ecx
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/wtarreau[P]httpterm/httpterm.c
// Function: buffer_replace2
int buffer_replace2(struct buffer *b, char *pos, char *end, char *str, int len) {
    int delta;

    delta = len - (end - pos);

    if (delta + b->r >= b->data + BUFSIZE)
	return 0;  /* no space left */

    if (b->data + b->l < end)
	/* The data has been stolen, we could have crashed. Maybe we should abort() ? */
	return 0;

    /* first, protect the end of the buffer */
    memmove(end + delta, end, b->data + b->l - end);

    /* now, copy str over pos */
    if (len)
	memcpy(pos, str, len);

    /* we only move data after the displaced zone */
    if (b->r  > pos) b->r  += delta;
    if (b->w  > pos) b->w  += delta;
    if (b->h  > pos) b->h  += delta;
    if (b->lr > pos) b->lr += delta;
    b->l += delta;

    return delta;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movl %r14d, %r12d
subl %edx, %r12d
addl %r8d, %r12d
movslq %r12d, %r13
movq 0x8(%rdi), %rsi
addq %r13, %rsi
movq 0x30(%rdi), %rcx
leaq 0x1000(%rcx), %rdi
xorl %eax, %eax
cmpq %rdi, %rsi
jae 0x445f
movl (%rbx), %esi
addq %rsi, %rcx
subq %rdx, %rcx
jb 0x445f
movl %r8d, %ebp
leaq (%rdx,%r13), %rdi
movq %rdx, %rsi
movq %rcx, %rdx
callq 0x2300
testl %ebp, %ebp
je 0x4419
movslq %ebp, %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x2250
movq 0x8(%rbx), %rax
cmpq %r14, %rax
jbe 0x4429
addq %r13, %rax
movq %rax, 0x8(%rbx)
movq 0x10(%rbx), %rax
cmpq %r14, %rax
jbe 0x4439
addq %r13, %rax
movq %rax, 0x10(%rbx)
movq 0x18(%rbx), %rax
cmpq %r14, %rax
jbe 0x4449
addq %r13, %rax
movq %rax, 0x18(%rbx)
movq 0x20(%rbx), %rax
cmpq %r14, %rax
jbe 0x4459
addq %r13, %rax
movq %rax, 0x20(%rbx)
addl %r12d, (%rbx)
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq