LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/ryancdotorg[P]bloomslice/bloomutl.c
// Function: bloom_pick_hash_wk
uint8_t bloom_pick_hash_wk(uint8_t width, uint8_t hashes) {
  if (hashes < 1 || width < 8 || width > 48) { // invalid parameters
    return 255;
  } else if (hashes <= hash1sN && width >= 8 && width <= 16) { // hash1s
    return BFS_TYPE_OFFSET + hashes;
  } else if (hashes <= hash2bN && width >  8 && width <= 16) { // hash2b
    return BFS_TYPE_OFFSET + hash1sN + hashes;
  } else if (hashes <= hash2sN && width > 16 && width <= 32) { // hash2s
    return BFS_TYPE_OFFSET + hash1sN + hash2bN + hashes;
  } else if (hashes <= hash3sN && width > 32 && width <= 48) { // hash3s
    return BFS_TYPE_OFFSET + hash1sN + hash2bN + hash2sN + hashes;
  } else { // no suitable hash found
    return 255;
  }
}

// Assembly:
testl %esi, %esi
sete %al
leal -0x31(%rdi), %ecx
cmpb $-0x29, %cl
setb %cl
orb %al, %cl
movb $-0x1, %al
je 0x5640
retq
leaq 0x3cb3(%rip), %rcx      # 0x92fa
movb (%rcx), %cl
cmpb %sil, %cl
setb %dl
cmpb $0x11, %dil
setae %r8b
orb %dl, %r8b
je 0x56aa
leaq 0x3ca2(%rip), %rdx      # 0x9305
movb (%rdx), %dl
cmpb %sil, %dl
setb %r8b
leal -0x9(%rdi), %r9d
cmpb $0x8, %r9b
setae %r9b
orb %r8b, %r9b
jne 0x5682
addb %cl, %sil
jmp 0x56aa
leaq 0x3c07(%rip), %r8       # 0x9290
movb (%r8), %r8b
cmpb %sil, %r8b
setb %r9b
leal -0x11(%rdi), %r10d
cmpb $0x10, %r10b
setae %r10b
orb %r9b, %r10b
jne 0x56b0
addb %cl, %sil
addb %dl, %sil
incb %sil
movl %esi, %eax
retq
cmpb $0x21, %dil
jb 0x563f
leaq 0x3aa3(%rip), %rdi      # 0x9160
cmpb %sil, (%rdi)
jb 0x563f
addb %cl, %sil
addb %r8b, %dl
addb %sil, %dl
incb %dl
movl %edx, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/ryancdotorg[P]bloomslice/bloomutl.c
// Function: bloom_pick_hash_wi
uint8_t bloom_pick_hash_wi(uint8_t width, uint64_t items, uint8_t *k) {
  double bits = 1ULL<<width;
  unsigned int opt = round((log(2.0) * bits) / (double)items);
  uint8_t kOpt = opt < 256 ? (opt > 0 ? opt : 1) : 255;

  if (width < 8 || width > 48) { // invalid parameters
    return 255;
  } else if (kOpt <= hash1sN && width >= 8 && width <= 16) { // hash1s
    *k = kOpt;
    return bloom_pick_hash_wk(width, kOpt);
  } else if (width == 8) {
    *k = hash1sN;
    return bloom_pick_hash_wk(width, hash1sN);
  } else if (kOpt <= hash2bN && width >  8 && width <= 16) { // hash2b
    *k = kOpt;
    return bloom_pick_hash_wk(width, kOpt);
  } else if (width <= 16) {
    *k = hash2bN;
    return bloom_pick_hash_wk(width, hash2bN);
  } else if (kOpt <= hash2sN && width > 16 && width <= 32) { // hash2s
    *k = kOpt;
    return bloom_pick_hash_wk(width, kOpt);
  } else if (width <= 32) {
    *k = hash2sN;
    return bloom_pick_hash_wk(width, hash2sN);
  } else if (kOpt <= hash3sN && width > 32 && width <= 48) { // hash3s
    *k = kOpt;
    return bloom_pick_hash_wk(width, kOpt);
  } else if (width <= 48) {
    *k = hash3sN;
    return bloom_pick_hash_wk(width, hash3sN);
  } else { // no suitable hash found
    return 255;
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movl %edi, %ebx
movq %rbx, %rax
shlq $0x34, %rax
movabsq $0x3fe62e42fefa39ef, %rcx # imm = 0x3FE62E42FEFA39EF
addq %rax, %rcx
movq %rcx, %xmm0
movq %rsi, %xmm1
punpckldq 0x92d(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x935(%rip), %xmm1      # 0x6040
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
callq 0x1050
cvttsd2si %xmm0, %rcx
cmpl $0x2, %ecx
pushq $0x1
popq %rax
cmovael %ecx, %eax
movl $0xff, %ecx
cmpl %ecx, %eax
cmovael %ecx, %eax
leal -0x31(%rbx), %ecx
cmpb $-0x29, %cl
jae 0x574a
movb $-0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x3ba9(%rip), %rcx      # 0x92fa
movb (%rcx), %dl
cmpb $0x10, %bl
ja 0x576a
movzbl %dl, %esi
cmpl %esi, %eax
ja 0x576a
movb %al, (%r14)
movzbl %bl, %edi
movzbl %al, %esi
jmp 0x579d
cmpb $0x8, %bl
jne 0x577a
movb %dl, (%r14)
movzbl (%rcx), %esi
pushq $0x8
popq %rdi
jmp 0x579d
leaq 0x3b84(%rip), %rcx      # 0x9305
movb (%rcx), %dl
cmpb $0x10, %bl
ja 0x578f
movzbl %dl, %esi
cmpl %esi, %eax
jbe 0x575f
cmpb $0x10, %bl
ja 0x57a9
movb %dl, (%r14)
movzbl (%rcx), %esi
movzbl %bl, %edi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x562b
leaq 0x3ae0(%rip), %rcx      # 0x9290
movb (%rcx), %dl
cmpb $0x20, %bl
ja 0x57be
movzbl %dl, %esi
cmpl %esi, %eax
jbe 0x575f
cmpb $0x20, %bl
jbe 0x5794
leaq 0x3996(%rip), %rcx      # 0x9160
movzbl (%rcx), %edx
cmpl %edx, %eax
jbe 0x575f
movb %dl, (%r14)
jmp 0x5797
// File: /workspace/github_c_makefile_star2_O2/ryancdotorg[P]bloomslice/hex.c
// Function: hex
unsigned char *
hex(unsigned char *buf, size_t buf_sz,
    unsigned char *hexed, size_t hexed_sz) {
  unsigned int i, j;
  --hexed_sz;
  for (i = j = 0; i < buf_sz && j < hexed_sz; ++i, j += 2) {
    snprintf(hexed+j, 3, "%02x", buf[i]);
  }
  hexed[j] = 0; // null terminate
  return hexed;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r12
decq %r14
xorl %eax, %eax
xorl %r13d, %r13d
movl %eax, %ebp
movl %r13d, %eax
leaq (%rbx,%rax), %rdi
cmpq %r15, %rbp
jae 0x59ed
cmpq %rax, %r14
jbe 0x59ed
movzbl (%r12,%rbp), %ecx
pushq $0x3
popq %rsi
leaq 0x16db(%rip), %rdx      # 0x70b8
xorl %eax, %eax
callq 0x10d0
leal 0x1(%rbp), %eax
addl $0x2, %r13d
jmp 0x59bb
movb $0x0, (%rdi)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/ryancdotorg[P]bloomslice/mmapf.c
// Function: _bloomslice_mmapf_strerror
char * mmapf_strerror(int errnum) {
  if (errnum < MMAPF_EXFIRST) {
    return strerror(errnum);
  } else if (errnum < MMAPF_EXLAST) {
    return errstr[errnum-MMAPF_EXFIRST];
  } else {
    return errstr[0];
  }
}

// Assembly:
cmpl $0x3e7, %edi            # imm = 0x3E7
jg 0x5a11
jmp 0x1270
cmpl $0x3ea, %edi            # imm = 0x3EA
ja 0x5a2e
addl $0xfffffc18, %edi       # imm = 0xFFFFFC18
leaq 0x169a(%rip), %rcx      # 0x70c0
movslq (%rcx,%rdi,4), %rax
addq %rcx, %rax
retq
leaq 0x169b(%rip), %rax      # 0x70d0
retq
// File: /workspace/github_c_makefile_star2_O2/ryancdotorg[P]bloomslice/mmapf.c
// Function: _bloomslice_munmapf
int munmapf(mmapf_ctx *ctx) {
  // TODO error checking
  if (ctx->fd >= 0) {
    msync(ctx->mem, ctx->file_sz, MS_SYNC);
    fsync(ctx->fd);
    close(ctx->fd);
  }
  if (ctx->mem != NULL) {
    munmap(ctx->mem, ctx->mmap_sz);
  }
  ctx->file_sz = 0;
  ctx->mmap_sz = 0;
  ctx->mem = NULL;
  ctx->fd = -1;
  return 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, 0x18(%rdi)
js 0x5a5f
movq (%rbx), %rdi
movq 0x10(%rbx), %rsi
pushq $0x4
popq %rdx
callq 0x10a0
movl 0x18(%rbx), %edi
callq 0x11e0
movl 0x18(%rbx), %edi
callq 0x1100
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x5a70
movq 0x8(%rbx), %rsi
callq 0x11b0
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
andq $0x0, 0x10(%rbx)
orl $-0x1, 0x18(%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/ikbenlike[P]nngutils/src/whoami.c
// Function: main
int main(int argc, char **argv){
    struct passwd *pw = getpwuid(geteuid());
    if(pw == NULL){
        fprintf(stderr, "%s: %s\n", argv[0], strerror(errno));
        return 1;
    }
    puts(pw->pw_name);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
callq 0x1060
movl %eax, %edi
callq 0x1050
testq %rax, %rax
je 0x11b6
movq (%rax), %rdi
callq 0x1040
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
movq 0x2e3b(%rip), %rax      # 0x3ff8
movq (%rax), %r14
movq (%rbx), %rbx
callq 0x1030
movl (%rax), %edi
callq 0x1080
leaq 0xe2e(%rip), %rsi       # 0x2004
movq %r14, %rdi
movq %rbx, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x1070
pushq $0x1
popq %rax
jmp 0x11b1
// File: /workspace/github_c_makefile_star2_O2/begriffs[P]pthread-test/alarm_cond.c
// Function: alarm_thread
void *alarm_thread(void *arg)
{
	struct alarm *a;
	struct timespec cond_time = {0};
	time_t now;
	bool expired;

	(void)arg;
	pthread_mutex_lock(&g_alarm_mutex);
	while (1)
	{
		g_current_alarm = 0;
		while (g_alarm_list == NULL)
			pthread_cond_wait(&g_alarm_cond, &g_alarm_mutex);

		a = g_alarm_list;
		g_alarm_list = a->link;
		now = time(NULL);
		expired = false;
		
		if (a->time > now)
		{
			cond_time.tv_sec = a->time;
			g_current_alarm = a->time;
			while (g_current_alarm == a->time)
			{
				int s = pthread_cond_timedwait(
					&g_alarm_cond, &g_alarm_mutex, &cond_time);
				if (s == ETIMEDOUT)
				{
					expired = true;
					break;
				}
			}
			if (!expired)
				alarm_insert(a);
		}
		else
			expired = true;

		if (expired)
		{
			printf("(%d) %s\n", a->seconds, a->message);
			free(a);
		}
	}
	return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
xorps %xmm0, %xmm0
movq %rsp, %rbx
movaps %xmm0, (%rbx)
leaq 0x2e22(%rip), %r14      # 0x40a8
movq %r14, %rdi
callq 0x1100
leaq 0x2e3b(%rip), %r15      # 0x40d0
leaq 0xd68(%rip), %r12       # 0x2004
andq $0x0, 0x2e5c(%rip)      # 0x4100
movq 0x2df5(%rip), %r13      # 0x40a0
testq %r13, %r13
jne 0x12bd
movq %r15, %rdi
movq %r14, %rsi
callq 0x1040
jmp 0x12a4
movq (%r13), %rax
movq %rax, 0x2dd8(%rip)      # 0x40a0
xorl %edi, %edi
callq 0x10a0
movq 0x8(%r13), %rcx
cmpq %rax, %rcx
jle 0x1303
movq %rcx, (%rsp)
movq %rcx, 0x2e1d(%rip)      # 0x4100
movq 0x2e16(%rip), %rax      # 0x4100
cmpq 0x8(%r13), %rax
jne 0x1322
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x10f0
cmpl $0x6e, %eax
jne 0x12e3
movl 0x10(%r13), %esi
leaq 0x14(%r13), %rdx
movq %r12, %rdi
xorl %eax, %eax
callq 0x1060
movq %r13, %rdi
callq 0x1030
jmp 0x129c
movq %r13, %rdi
callq 0x120c
jmp 0x129c
// File: /workspace/github_c_makefile_star2_O2/begriffs[P]pthread-test/alarm_cond.c
// Function: main
int main(void)
{
	int status;
	char line[128];
	struct alarm *a;
	pthread_t thread;

	status = pthread_create(&thread, NULL, alarm_thread, NULL);
	while (printf("Alarm> ") && fgets(line, sizeof(line), stdin))
	{
		if (strlen(line) <= 1)
			continue;

		if (!(a = malloc(sizeof(*a))))
		{
			fputs("Failed to allocate alarm\n", stderr);
			return EXIT_FAILURE;
		}
		if (sscanf(line, "%d %64[^\n]", &a->seconds, a->message) < 2)
		{
			fputs("Bad command\n", stderr);
			free(a);
		}
		else
		{
			pthread_mutex_lock(&g_alarm_mutex);
			a->time = time(NULL) + a->seconds;
			alarm_insert(a);
			pthread_mutex_unlock(&g_alarm_mutex);
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
leaq -0xde(%rip), %rdx       # 0x1269
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
xorl %ecx, %ecx
callq 0x10e0
leaq 0xcb1(%rip), %r14       # 0x200d
movq 0x2c75(%rip), %r12      # 0x3fd8
leaq 0x10(%rsp), %r15
leaq 0xcc0(%rip), %r13       # 0x202f
leaq 0x2d32(%rip), %rbp      # 0x40a8
movq %r14, %rdi
xorl %eax, %eax
callq 0x1060
testl %eax, %eax
je 0x1433
movq (%r12), %rdx
movq %r15, %rdi
movl $0x80, %esi
callq 0x1080
testq %rax, %rax
je 0x1433
movq %r15, %rdi
callq 0x1050
cmpq $0x2, %rax
jb 0x1376
pushq $0x58
popq %rdi
callq 0x10c0
testq %rax, %rax
je 0x1447
movq %rax, %rbx
leaq 0x10(%rax), %rdx
movq %rax, %rcx
addq $0x14, %rcx
movq %r15, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x10d0
cmpl $0x1, %eax
jle 0x1410
movq %rbp, %rdi
callq 0x1100
xorl %edi, %edi
callq 0x10a0
movslq 0x10(%rbx), %rcx
addq %rax, %rcx
movq %rcx, 0x8(%rbx)
movq %rbx, %rdi
callq 0x120c
movq %rbp, %rdi
callq 0x10b0
jmp 0x1376
movq 0x2be1(%rip), %rax      # 0x3ff8
movq (%rax), %rsi
leaq 0xc19(%rip), %rdi       # 0x203a
callq 0x1070
movq %rbx, %rdi
callq 0x1030
jmp 0x1376
xorl %eax, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x2baa(%rip), %rax      # 0x3ff8
movq (%rax), %rsi
leaq 0xbbd(%rip), %rdi       # 0x2015
callq 0x1070
pushq $0x1
popq %rax
jmp 0x1435
// File: /workspace/github_c_makefile_star2_O2/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_5/exercise_5_08/date_conversion.c
// Function: main
int main(void)
{
  int day = day_of_year(2020, 10, 30);
  printf("day of the year: %d\n", day);

  int month_invalid = day_of_year(2020, 13, 1);
  if (month_invalid == -1)
  {
    printf("Warning: invalid month detected.\n");
  }

  int day_invalid = day_of_year(202, 12, 32);
  if (day_invalid == -2)
  {
    printf("Warning: invalid day detected.\n");
  }

  int month;
  int day_month;

  month_day(2020, 304, &month, &day_month);
  printf("month: %d, day: %d\n", month, day_month);

  month_day(2020, 366, &month, &day_month);
  printf("month: %d, day: %d\n", month, day_month);

  month_day(2020, 367, &month, &day_month);
  printf("month: %d, day: %d\n", month, day_month);

  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
pushq $0xa
popq %rsi
pushq $0x1e
popq %rdx
movl $0x7e4, %edi            # imm = 0x7E4
callq 0x1240
leaq 0xe98(%rip), %rdi       # 0x2004
movl %eax, %esi
xorl %eax, %eax
callq 0x1040
pushq $0xd
popq %rsi
pushq $0x1
popq %rdx
movl $0x7e4, %edi            # imm = 0x7E4
callq 0x1240
cmpl $-0x1, %eax
jne 0x1196
leaq 0xee8(%rip), %rdi       # 0x2079
callq 0x1030
pushq $0xc
popq %rsi
pushq $0x20
popq %rdx
movl $0xca, %edi
callq 0x1240
cmpl $-0x2, %eax
jne 0x11b7
leaq 0xee8(%rip), %rdi       # 0x209a
callq 0x1030
leaq 0xc(%rsp), %rbx
leaq 0x8(%rsp), %r14
movl $0x7e4, %edi            # imm = 0x7E4
movl $0x130, %esi            # imm = 0x130
movq %rbx, %rdx
movq %r14, %rcx
callq 0x12cc
movl (%rbx), %esi
movl (%r14), %edx
leaq 0xe37(%rip), %r15       # 0x2019
movq %r15, %rdi
xorl %eax, %eax
callq 0x1040
movl $0x7e4, %edi            # imm = 0x7E4
movl $0x16e, %esi            # imm = 0x16E
movq %rbx, %rdx
movq %r14, %rcx
callq 0x12cc
movl (%rbx), %esi
movl (%r14), %edx
movq %r15, %rdi
xorl %eax, %eax
callq 0x1040
movl $0x7e4, %edi            # imm = 0x7E4
movl $0x16f, %esi            # imm = 0x16F
movq %rbx, %rdx
movq %r14, %rcx
callq 0x12cc
movl (%rbx), %esi
movl (%r14), %edx
movq %r15, %rdi
xorl %eax, %eax
callq 0x1040
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/paeq128/ref/encrypt.cpp
// Function: crypto_aead_encrypt_no_nonce(unsigned char*, unsigned long long*, unsigned char const*, unsigned long long, unsigned char const*, unsigned long long, unsigned char const*, unsigned char*, unsigned char const*)
int crypto_aead_encrypt_no_nonce(
		 unsigned char *c, unsigned long long *clen,
		 const unsigned char *m, unsigned long long mlen,
		 const unsigned char *ad, unsigned long long adlen,
		 const unsigned char *nsec,
		 unsigned char *npub,
		 const unsigned char *k
		 )
		 //Generates nonce out of plaintext and AD and put it into npub

	 {
		 Init();//Initializing GF(256) multiplication table for AES

		 if (clen == NULL)
			 return -1;
		 if ((mlen == 0) && (adlen == 0))
		 {
			 *clen = 0;
			 return 0;
		 }

		 //Assume that we do encryption and/or authentication so we need a key and a ciphertext pointer valid
		 if ((k == NULL) || (c == NULL))
			 return -2;

		 GenerateNonceRef(npub, m, mlen, ad, adlen, k);
		 return PAEQ128_ref_encrypt(c, clen, m, mlen, ad, adlen, npub, k);
	 }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %rbx
movq %r8, %r14
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbp
callq 0x1060
testq %r13, %r13
je 0x1b64
movq %rbx, %rax
orq %r15, %rax
je 0x1b69
movq 0x50(%rsp), %r9
testq %r9, %r9
sete %al
testq %rbp, %rbp
sete %cl
orb %al, %cl
je 0x1b7f
pushq $-0x2
jmp 0x1b66
pushq $-0x1
popq %rax
jmp 0x1b70
andq $0x0, (%r13)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x48(%rsp), %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
movq %rbx, %r8
callq 0x1040
movq %rbp, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r15, %rcx
movq %r14, %r8
movq %rbx, %r9
pushq 0x50(%rsp)
pushq 0x50(%rsp)
callq 0x1070
addq $0x18, %rsp
jmp 0x1b74
// File: /workspace/github_c_makefile_star2_O2/tylerneylon[P]APIsWithLua/ch5/lua_pcall.c
// Function: my_error_handler
int my_error_handler(lua_State *L) {
  // Push a stack trace string onto the stack.
  // This augmented string will effectively replace the simpler
  // error message that comes directly from the Lua error.
  luaL_traceback(L, L, lua_tostring(L, -1), 1);
  return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
pushq $-0x1
popq %rsi
xorl %edx, %edx
callq 0x4d4e
pushq $0x1
popq %r14
movq %rbx, %rdi
movq %rbx, %rsi
movq %rax, %rdx
movl %r14d, %ecx
callq 0x11598
movl %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/tylerneylon[P]APIsWithLua/ch5/lua_pcall.c
// Function: main
int main() {

  lua_State *L = luaL_newstate();
  luaL_openlibs(L);

  lua_register(L, "my_error_handler", my_error_handler);
  lua_register(L, "fn_that_throws",   fn_that_throws);
  lua_register(L, "middle_fn",        middle_fn);

  // Call middle_fn().
  lua_pushcfunction(L, my_error_handler);
  lua_getglobal(L, "middle_fn");
  int status = lua_pcall(L, 0, 0, -2);
  if (status != LUA_OK) {
    // Print the error.
    printf("Looks like lua_pcall() caught an error:\n%s\n",
           lua_tostring(L, -1));
    // Pop the error message from the stack.
    lua_pop(L, 1);
  }

  printf("Done!\n");

  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
callq 0x12c6e
movq %rax, %rbx
movq %rax, %rdi
callq 0x12e94
leaq -0xa8(%rip), %r14       # 0x460c
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x508e
leaq 0x1995d(%rip), %rsi     # 0x1e025
movq %rbx, %rdi
callq 0x54cd
leaq -0x9a(%rip), %rsi       # 0x463d
movq %rbx, %rdi
xorl %edx, %edx
callq 0x508e
leaq 0x1992e(%rip), %rsi     # 0x1e016
movq %rbx, %rdi
callq 0x54cd
leaq -0x93(%rip), %rsi       # 0x4664
movq %rbx, %rdi
xorl %edx, %edx
callq 0x508e
leaq 0x1992e(%rip), %r15     # 0x1e036
movq %rbx, %rdi
movq %r15, %rsi
callq 0x54cd
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x508e
movq %rbx, %rdi
movq %r15, %rsi
callq 0x515c
pushq $-0x2
popq %rcx
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x599c
testl %eax, %eax
je 0x476d
pushq $-0x1
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x4d4e
leaq 0x198e8(%rip), %rdi     # 0x1e040
movq %rax, %rsi
xorl %eax, %eax
callq 0x4170
pushq $-0x2
popq %rsi
movq %rbx, %rdi
callq 0x48b5
leaq 0x198f8(%rip), %rdi     # 0x1e06c
callq 0x40c0
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/keithnoguchi[P]pearls-in-action/0x2/sign_main.c
// Function: main
int main(void)
{
#define WORDMAX 100
	char word[WORDMAX], sig[WORDMAX];

	while (scanf("%s", word) != EOF) {
		sign(word, strlen(word), sig);
		printf("%s %s\n", sig, word);
	}
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xd8, %rsp
leaq 0xd7f(%rip), %rbx       # 0x2004
leaq 0x70(%rsp), %r14
movq %rsp, %r15
leaq 0xd73(%rip), %r12       # 0x2007
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x1080
cmpl $-0x1, %eax
je 0x12cd
movq %r14, %rdi
callq 0x1030
movq %r14, %rdi
movl %eax, %esi
movq %r15, %rdx
callq 0x119c
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x1040
jmp 0x1294
xorl %eax, %eax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/jtuu[P]quesler/src/chunk.c
// Function: init_chunk
void init_chunk(Chunk* chunk) {
    chunk->count = 0;
    chunk->capacity = 0;
    chunk->code = NULL;
    chunk->lines = NULL;
    init_value_array(&chunk->constants);
    chunk->labels = NULL;
    chunk->labels_count = 0;
    chunk->labels_capacity = 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
addq $0x20, %rdi
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
movups %xmm0, (%rbx)
callq 0x734c
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%rbx)
andq $0x0, 0x48(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/jtuu[P]quesler/src/chunk.c
// Function: write_chunk
void write_chunk(Chunk* chunk, size_t add_size, uint8_t* bytes, size_t line) {
    if (chunk->capacity < chunk->count + add_size) {
        size_t old_capacity = chunk->capacity;
        chunk->capacity = GROW_CAPACITY(old_capacity);
        chunk->code = GROW_ARRAY(uint8_t, chunk->code,
            old_capacity, chunk->capacity);
        chunk->lines = GROW_ARRAY(size_t, chunk->lines,
            old_capacity, chunk->capacity);
    }

    for (int i = (int) add_size - 1; i >= 0; i--) {
        chunk->lines[chunk->count] = line;
        chunk->code[chunk->count] = bytes[i];
        chunk->count++;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
movq 0x8(%rdi), %r13
movq (%rdi), %rax
addq %rsi, %rax
cmpq %rax, %r13
jae 0x4308
leaq (,%r13,2), %rax
cmpq $0x8, %r13
pushq $0x8
popq %rdx
cmovaeq %rax, %rdx
movq %rdx, 0x8(%r15)
movq 0x10(%r15), %rdi
movq %r13, %rsi
callq 0x62c0
movq %rax, 0x10(%r15)
movq 0x8(%r15), %rdx
movq 0x18(%r15), %rdi
shlq $0x3, %r13
shlq $0x3, %rdx
movq %r13, %rsi
callq 0x62c0
movq %rax, 0x18(%r15)
movl %r12d, %eax
testl %eax, %eax
jle 0x4331
movq (%r15), %rcx
movq 0x18(%r15), %rdx
movq %rbx, (%rdx,%rcx,8)
movb -0x1(%r14,%rax), %cl
decq %rax
movq (%r15), %rdx
movq 0x10(%r15), %rsi
movb %cl, (%rsi,%rdx)
incq (%r15)
jmp 0x430b
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/jtuu[P]quesler/src/chunk.c
// Function: free_chunk
void free_chunk(Chunk* chunk) {
    FREE_ARRAY(uint8_t, chunk->code, chunk->capacity);
    FREE_ARRAY(size_t, chunk->lines, chunk->capacity);
    free_value_array(&chunk->constants);
    init_chunk(chunk);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rsi
movq 0x10(%rdi), %rdi
xorl %edx, %edx
callq 0x62c0
movq 0x8(%rbx), %rsi
movq 0x18(%rbx), %rdi
shlq $0x3, %rsi
xorl %edx, %edx
callq 0x62c0
leaq 0x20(%rbx), %rdi
callq 0x73ba
movq %rbx, %rdi
popq %rbx
jmp 0x427c
// File: /workspace/github_c_makefile_star2_O2/jtuu[P]quesler/src/chunk.c
// Function: set_chunk_label_offset
void set_chunk_label_offset(Chunk* chunk, size_t label, int32_t offset) {
    if (label > UINT16_MAX) {
        fprintf(stderr, "Label too large\n");
    }

    while (chunk->labels_capacity < label + 1) {
        size_t old_capacity = chunk->labels_capacity;
        chunk->labels_capacity = GROW_CAPACITY(old_capacity);
        chunk->labels = GROW_ARRAY(int32_t, chunk->labels,
            old_capacity, chunk->labels_capacity);
    }

    chunk->labels[label] = offset;

    if (chunk->labels_count <= label) {
        chunk->labels_count = label + 1;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
cmpq $0x10000, %rsi          # imm = 0x10000
jae 0x43f5
leaq 0x1(%r14), %r15
pushq $0x8
popq %r12
movq 0x48(%rbx), %rsi
cmpq %r15, %rsi
jae 0x43da
leaq (%rsi,%rsi), %rdx
cmpq $0x8, %rsi
cmovbq %r12, %rdx
movq %rdx, 0x48(%rbx)
movq 0x38(%rbx), %rdi
shlq $0x2, %rsi
shlq $0x2, %rdx
callq 0x62c0
movq %rax, 0x38(%rbx)
jmp 0x43aa
movq 0x38(%rbx), %rax
movl %ebp, (%rax,%r14,4)
cmpq %r14, 0x40(%rbx)
ja 0x43ec
movq %r15, 0x40(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x10bf4(%rip), %rax     # 0x14ff0
movq (%rax), %rcx
leaq 0x3c1a(%rip), %rdi      # 0x8020
pushq $0x10
popq %rsi
pushq $0x1
popq %rdx
callq 0x4170
jmp 0x43a2
nop
// File: /workspace/github_c_makefile_star2_O2/jtuu[P]quesler/src/common.c
// Function: read_file_ex
size_t read_file_ex(const char* path, uint8_t** dst_buf, size_t dst_buf_size, size_t dst_buf_offset, bool binary) {
    FILE* fd = fopen(path, binary ? "rb" : "r");
    if (fd == NULL) {
        fprintf(stderr, "Failed to open file\n");
        return 0;
    }

    uint8_t* cursor = *dst_buf + dst_buf_offset;
    size_t read_target_size = 0x1000;
    size_t buf_size = dst_buf_size;
    size_t read_size = 0;

    do {
        buf_size += read_target_size;
        *dst_buf = realloc(*dst_buf, buf_size);
        cursor = *dst_buf + dst_buf_offset + buf_size - dst_buf_size - read_target_size;
        read_size = fread(cursor, 1, read_target_size, fd);
    } while (read_size == read_target_size);

    return buf_size - dst_buf_size - read_target_size + read_size;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
leaq 0x3c02(%rip), %rax      # 0x8031
leaq 0x4739(%rip), %rsi      # 0x8b6f
testl %r8d, %r8d
cmovneq %rax, %rsi
callq 0x4140
testq %rax, %rax
je 0x449f
movq %rax, %r12
addq $0x1000, %r14           # imm = 0x1000
xorl %ebp, %ebp
movl $0x1000, %r13d          # imm = 0x1000
leaq (%r14,%rbp), %rsi
movq (%r15), %rdi
callq 0x4130
movq %rax, (%r15)
leaq (%rbx,%rbp), %rdi
addq %rax, %rdi
movl $0x1000, %edx           # imm = 0x1000
pushq $0x1
popq %rsi
movq %r12, %rcx
callq 0x4080
addq %r13, %rbp
cmpq %r13, %rax
je 0x4459
addq %rbp, %rax
addq $-0x1000, %rax          # imm = 0xF000
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10b4a(%rip), %rax     # 0x14ff0
movq (%rax), %rcx
leaq 0x3b84(%rip), %rdi      # 0x8034
pushq $0x14
popq %rsi
pushq $0x1
popq %rdx
callq 0x4170
xorl %eax, %eax
jmp 0x4490
// File: /workspace/github_c_makefile_star2_O2/jtuu[P]quesler/src/common.c
// Function: write_file
size_t write_file(const char* path, uint8_t* src_buf, size_t src_buf_size, bool binary) {
    FILE* fd = fopen(path, binary ? "wb" : "w");
    if (fd == NULL) {
        fprintf(stderr, "Failed to open file\n");
        return 0;
    }

    uint8_t* cursor = src_buf;
    size_t write_block_size = 0x1000;
    size_t write_size = 0;

    if (src_buf_size < write_block_size) {
        write_block_size = src_buf_size;
    }

    do {
        cursor = src_buf + write_size;
        write_size = fwrite(cursor, write_block_size, 1, fd) * write_block_size;
    } while (write_size == write_block_size && (size_t) (cursor - src_buf) < src_buf_size);

    return (size_t) (cursor - src_buf);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
leaq 0x3b66(%rip), %rax      # 0x8049
leaq 0x5433(%rip), %rsi      # 0x991d
testl %ecx, %ecx
cmovneq %rax, %rsi
callq 0x4140
testq %rax, %rax
je 0x4547
movq %rax, %r15
movl $0x1000, %r12d          # imm = 0x1000
cmpq %r12, %rbx
cmovbq %rbx, %r12
xorl %ecx, %ecx
pushq $0x1
popq %rbp
movq %rcx, %r13
leaq (%r14,%rcx), %rdi
movq %r12, %rsi
movq %rbp, %rdx
movq %r15, %rcx
callq 0x4170
cmpq %rbx, %r13
jae 0x4535
imulq %r12, %rax
movq %r12, %rcx
cmpq %r12, %rax
je 0x450f
movq %r13, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10aa2(%rip), %rax     # 0x14ff0
movq (%rax), %rcx
leaq 0x3adc(%rip), %rdi      # 0x8034
pushq $0x14
popq %rsi
pushq $0x1
popq %rdx
callq 0x4170
xorl %r13d, %r13d
jmp 0x4535
// File: /workspace/github_c_makefile_star2_O2/jtuu[P]quesler/src/compiler.c
// Function: unary
static void unary(bool can_assign) {
    UNUSED(can_assign);

    TokenType operator_type = parser.previous.type;

    parse_precedence(PREC_UNARY);

    switch (operator_type) {
        case TOKEN_BANG: {
            int ret = alloc_register();
            uint8_t reg = (uint8_t) ret;

            if (ret < 0) {
                error_alloc_register();
            } else {
                emit_stack_pop(reg);
                emit_opcode(OP_REV);
                emit_register(reg);
                emit_stack_push(reg);

                free_register(reg);
            }
            break;
        }
        case TOKEN_MINUS: {
            int ret = alloc_register();
            uint8_t reg = (uint8_t) ret;
            
            if (ret < 0) {
                error_alloc_register();
            } else {
                emit_stack_pop(reg);
                emit_opcode(OP_MULI);
                emit_register(reg);
                emit_dword(-1);
                emit_stack_push(reg);

                free_register(reg);
            }
            break;
        }
        default:
            return;
    }
}

// Assembly:
pushq %rbx
movl 0x10d0a(%rip), %ebx     # 0x155d0
pushq $0x8
popq %rdi
callq 0x530a
cmpl $0x5, %ebx
je 0x48fc
cmpl $0xc, %ebx
jne 0x4935
callq 0x54e1
testl %eax, %eax
js 0x4937
movzbl %al, %ebx
movl %ebx, %edi
callq 0x5551
pushq $0x12
popq %rdi
callq 0x5561
movl %ebx, %edi
callq 0x55a9
jmp 0x4926
callq 0x54e1
testl %eax, %eax
js 0x4937
movzbl %al, %ebx
movl %ebx, %edi
callq 0x5551
pushq $0x1d
popq %rdi
callq 0x5561
movl %ebx, %edi
callq 0x55a9
pushq $-0x1
popq %rdi
callq 0x5613
movl %ebx, %edi
callq 0x54ce
movl %ebx, %edi
popq %rbx
jmp 0x551c
popq %rbx
retq
popq %rbx
jmp 0x5510
// File: /workspace/github_c_makefile_star2_O2/jtuu[P]quesler/src/compiler.c
// Function: and_
static void and_(bool can_assign) {
    UNUSED(can_assign);

    int ret = alloc_register();

    if (ret < 0) {
        error_alloc_register();
        return;
    }

    uint8_t reg = (uint8_t) ret;
    size_t label = take_label();

    emit_stack_pop(reg);

    emit_conditional_jump_ri(OP_JMPI_EQ, reg, CONSTANT_FALSE, label);

    parse_precedence(PREC_AND);

    set_label_here(label);

    free_register(reg);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
callq 0x54e1
testl %eax, %eax
js 0x4ba9
movl %eax, %ebx
callq 0x5654
movq %rax, %r14
movzbl %bl, %ebx
movl %ebx, %edi
callq 0x5551
pushq $0x2d
popq %rdi
movl %ebx, %esi
movq %r14, %rdx
callq 0x56d9
pushq $0x3
popq %rdi
callq 0x530a
movq %r14, %rdi
callq 0x56be
movl %ebx, %edi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x551c
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x5510
// File: /workspace/github_c_makefile_star2_O2/jtuu[P]quesler/src/compiler.c
// Function: or_
static void or_(bool can_assign) {
    UNUSED(can_assign);

    int ret = alloc_register();

    if (ret < 0) {
        error_alloc_register();
        return;
    }

    uint8_t reg = (uint8_t) ret;
    size_t label = take_label();

    emit_stack_peek(reg);

    emit_conditional_jump_ri(OP_JMPI_NEQ, reg, CONSTANT_FALSE, label);

    emit_stack_pop(reg);

    parse_precedence(PREC_OR);

    set_label_here(label);

    free_register(reg);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
callq 0x54e1
testl %eax, %eax
js 0x4c08
movl %eax, %ebx
callq 0x5654
movq %rax, %r14
movzbl %bl, %ebx
movl %ebx, %edi
callq 0x5702
pushq $0x2f
popq %rdi
movl %ebx, %esi
movq %r14, %rdx
callq 0x56d9
movl %ebx, %edi
callq 0x5551
pushq $0x2
popq %rdi
callq 0x530a
movq %r14, %rdi
callq 0x56be
movl %ebx, %edi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x551c
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x5510
// File: /workspace/github_c_makefile_star2_O2/jtuu[P]quesler/src/compiler.c
// Function: compile
bool compile(const char* source, Chunk* chunk) {
    init_scanner(source);

    Compiler compiler;
    init_compiler(&compiler);
    compiling_chunk = chunk;

    parser.had_error = false;
    parser.panic_mode = false;
    parser.entry_function_exists = false;
    parser.labels_count = 0;
    parser.functions = NULL;
    parser.functions_count = 0;
    parser.functions_capacity = 0;
    
    for (size_t i = 1; i < NUM_REGISTERS; i++) {
        parser.free_registers[i] = true;
    }

    emit_runtime();

    advance();
    
    while (!match(TOKEN_EOF)) {
        declaration();
    }

    end_compiler();

    if (!parser.entry_function_exists) {
        error("Missing entry function");
    }

    if (register_alloc_counter != 0) {
        fprintf(stderr, "%d unfreed register(s): [", register_alloc_counter);

        bool first = true;
        for (size_t i = 1; i < NUM_REGISTERS; i++) {
            if (!parser.free_registers[i]) {
                if (first) {
                    fprintf(stderr, "%lu", i);
                    first = false;
                } else {
                    fprintf(stderr, ", %lu", i);
                }
            }
        }

        fprintf(stderr, "]\n");
    }

    return !parser.had_error;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3018, %rsp           # imm = 0x3018
movq %rsi, %rbx
callq 0x6b64
leaq 0x8(%rsp), %rax
andq $0x0, 0x3000(%rax)
movl $0x1, 0x3008(%rax)
movq %rax, 0x10780(%rip)     # 0x15588
andw $0x0, 0x10810(%rip)     # 0x15620
movb $0x0, 0x10919(%rip)     # 0x15730
andq $0x0, 0x10909(%rip)     # 0x15728
movq %rbx, 0x1077a(%rip)     # 0x155a0
andq $0x0, 0x1091a(%rip)     # 0x15748
xorps %xmm0, %xmm0
movups %xmm0, 0x10900(%rip)    # 0x15738
movq $-0xff, %rax
leaq 0x10762(%rip), %r14     # 0x155a8
testq %rax, %rax
je 0x4e59
movb $0x1, 0x17a(%rax,%r14)
incq %rax
jmp 0x4e46
movb $0x0, 0x107c2(%rip)     # 0x15622
callq 0x4f3c
pushq $0x2a
popq %rbx
movl %ebx, %edi
callq 0x4fe3
testb %al, %al
jne 0x4e7a
callq 0x5003
jmp 0x4e68
cmpb $0x0, 0x108af(%rip)     # 0x15730
jne 0x4e8f
leaq 0x3207(%rip), %rdi      # 0x8091
callq 0x52e1
movl 0x10703(%rip), %edx     # 0x15598
testl %edx, %edx
jne 0x4eb3
movb 0x10781(%rip), %al      # 0x15620
xorb $0x1, %al
addq $0x3018, %rsp           # imm = 0x3018
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10136(%rip), %rax     # 0x14ff0
movq (%rax), %rdi
leaq 0x31e4(%rip), %rsi      # 0x80a8
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x40e0
movb $0x1, %bpl
leaq 0x31ed(%rip), %r12      # 0x80c4
leaq 0x31e4(%rip), %r13      # 0x80c2
cmpq $0xff, %rbx
je 0x4f1b
leaq 0x1(%rbx), %r15
cmpb $0x0, 0x7b(%rbx,%r14)
je 0x4ef8
movq %r15, %rbx
jmp 0x4ede
movq 0x100f1(%rip), %rax     # 0x14ff0
movq (%rax), %rdi
testb $0x1, %bpl
movq %r13, %rsi
cmovneq %r12, %rsi
xorl %ebp, %ebp
movq %r15, %rdx
xorl %eax, %eax
callq 0x40e0
jmp 0x4ef3
movq 0x100ce(%rip), %rax     # 0x14ff0
movq (%rax), %rcx
leaq 0x319c(%rip), %rdi      # 0x80c8
pushq $0x2
popq %rsi
pushq $0x1
popq %rdx
callq 0x4170
jmp 0x4e99
// File: /workspace/github_c_makefile_star2_O2/jtuu[P]quesler/src/compiler.c
// Function: advance
static void advance(void) {
    parser.previous2 = parser.previous;
    parser.previous = parser.current;

    while (true) {
        parser.current = scan_token();

        if (parser.current.type != TOKEN_ERROR) {
            break;
        }

        error_at_current(parser.current.start);
    }
}

// Assembly:
pushq %rbx
subq $0x30, %rsp
movq 0x106a8(%rip), %rax     # 0x155f0
movq %rax, 0x106c9(%rip)     # 0x15618
movups 0x1068a(%rip), %xmm0    # 0x155e0
movups %xmm0, 0x106ab(%rip)    # 0x15608
movups 0x1066c(%rip), %xmm0    # 0x155d0
movups %xmm0, 0x1068d(%rip)    # 0x155f8
movups 0x10636(%rip), %xmm0    # 0x155a8
movups %xmm0, 0x10657(%rip)    # 0x155d0
movups 0x10638(%rip), %xmm0    # 0x155b8
movups %xmm0, 0x10659(%rip)    # 0x155e0
movq 0x1063a(%rip), %rax     # 0x155c8
movq %rax, 0x1065b(%rip)     # 0x155f0
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x6b84
movq 0x28(%rsp), %rax
movq %rax, 0x1061a(%rip)     # 0x155c8
movups 0x8(%rsp), %xmm0
movups 0x18(%rsp), %xmm1
movups %xmm1, 0x105f9(%rip)    # 0x155b8
movups %xmm0, 0x105e2(%rip)    # 0x155a8
cmpl $0x29, 0x105db(%rip)    # 0x155a8
jne 0x4fdd
movq 0x105da(%rip), %rdi     # 0x155b0
callq 0x5396
jmp 0x4f9a
addq $0x30, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/jtuu[P]quesler/src/compiler.c
// Function: match
static bool match(TokenType type) {
    if (!check(type)) {
        return false;
    }

    advance();
    return true;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %edi, %ebx
movl 0x105ba(%rip), %ebp     # 0x155a8
cmpl %edi, %ebp
jne 0x4ff7
callq 0x4f3c
cmpl %ebx, %ebp
sete %al
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jtuu[P]quesler/src/compiler.c
// Function: parse_precedence
static void parse_precedence(Precedence precedence) {
    advance();
    ParseFn prefix_rule = get_rule(parser.previous.type)->prefix;
    if (prefix_rule == NULL) {
        error("Expected expression");
        return;
    }

    bool can_assign = precedence <= PREC_ASSIGNMENT;
    prefix_rule(can_assign);

    while (precedence <= get_rule(parser.current.type)->precedence) {
        advance();
        ParseFn infix_rule = get_rule(parser.previous.type)->infix;
        infix_rule(can_assign);
    }

    if (can_assign && match(TOKEN_EQUAL)) {
        error("Invalid target for assignment");
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
callq 0x4f3c
movl 0x102b5(%rip), %eax     # 0x155d0
imulq $0x18, %rax, %rax
leaq 0xfdba(%rip), %r14      # 0x150e0
movq (%rax,%r14), %rax
testq %rax, %rax
je 0x5383
xorl %edi, %edi
cmpl $0x2, %ebx
setb %dil
callq *%rax
movl 0x10268(%rip), %eax     # 0x155a8
imulq $0x18, %rax, %rax
cmpl %ebx, 0x10(%rax,%r14)
jb 0x5361
callq 0x4f3c
movl 0x1027a(%rip), %eax     # 0x155d0
imulq $0x18, %rax, %rax
movq 0x8(%rax,%r14), %rax
jmp 0x532f
cmpl $0x1, %ebx
ja 0x537b
pushq $0xe
popq %rdi
callq 0x4fe3
testb %al, %al
je 0x537b
leaq 0x2e59(%rip), %rdi      # 0x81d2
jmp 0x538a
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x2e34(%rip), %rdi      # 0x81be
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x52e1
// File: /workspace/github_c_makefile_star2_O2/jtuu[P]quesler/src/compiler.c
// Function: error_at
static void error_at(Token* token, const char* message) {
    if (parser.panic_mode) {
        return;
    }

    parser.panic_mode = true;

    fprintf(stderr, "[%lu:%lu] Error", token->line, token->column);

    if (token->type == TOKEN_EOF) {
        fprintf(stderr, " at end");
    } else if (token->type == TOKEN_ERROR) {
        // Nothing
    } else {
        fprintf(stderr, " at '%.*s'", (int) token->length, token->start);
    }

    fprintf(stderr, ": %s\n", message);
    parser.had_error = true;
}

// Assembly:
cmpb $0x0, 0x10278(%rip)     # 0x15621
je 0x53ac
retq
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movb $0x1, 0x10263(%rip)     # 0x15621
movq 0xfc2b(%rip), %r15      # 0x14ff0
movq (%r15), %rdi
movq 0x18(%r14), %rdx
movq 0x20(%r14), %rcx
leaq 0x2e19(%rip), %rsi      # 0x81f0
xorl %eax, %eax
callq 0x40e0
movl (%r14), %eax
cmpl $0x29, %eax
je 0x541b
cmpl $0x2a, %eax
jne 0x5402
movq (%r15), %rcx
leaq 0x2e0b(%rip), %rdi      # 0x8200
pushq $0x7
popq %rsi
pushq $0x1
popq %rdx
callq 0x4170
jmp 0x541b
movq (%r15), %rdi
movl 0x10(%r14), %edx
movq 0x8(%r14), %rcx
leaq 0x2df4(%rip), %rsi      # 0x8208
xorl %eax, %eax
callq 0x40e0
movq (%r15), %rdi
leaq 0x2dee(%rip), %rsi      # 0x8213
movq %rbx, %rdx
xorl %eax, %eax
callq 0x40e0
movb $0x1, 0x101ea(%rip)     # 0x15620
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/jtuu[P]quesler/src/compiler.c
// Function: get_opcode_definition_from_token
static const OpcodeDefinition* get_opcode_definition_from_token(Token* name) {
    char str[64];
    size_t len = name->length > 63 ? 63 : name->length;
    strncpy(str, name->start, len);
    str[len] = '\0';
    return get_opcode_definition_by_name(str);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq 0x8(%rdi), %rsi
movq 0x10(%rdi), %rax
cmpq $0x3f, %rax
pushq $0x3f
popq %rbx
cmovbq %rax, %rbx
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rdx
callq 0x4050
movb $0x0, (%rsp,%rbx)
movq %r14, %rdi
callq 0x63ca
addq $0x48, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/jtuu[P]quesler/src/compiler.c
// Function: resolve_function
static Function* resolve_function(Token* name) {
    for (size_t i = 0; i < parser.functions_count; i++) {
        if (parser.functions[i]->name.length == name->length) {
            if (!strncmp(parser.functions[i]->name.start, name->start, name->length)) {
                return parser.functions[i];
            }
        }
    }

    return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x102b5(%rip), %r15     # 0x15740
movq 0x102a6(%rip), %r12     # 0x15738
xorl %r13d, %r13d
cmpq %r15, %r13
jae 0x54be
movq (%r12,%r13,8), %r14
movq 0x10(%r14), %rdx
cmpq 0x10(%rbx), %rdx
jne 0x54b9
movq 0x8(%r14), %rdi
movq 0x8(%rbx), %rsi
callq 0x4060
testl %eax, %eax
je 0x54c1
incq %r13
jmp 0x5495
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/jtuu[P]quesler/src/compiler.c
// Function: alloc_register
static int alloc_register(void) {
    for (int i = 0; i < NUM_REGISTERS; i++) {
        if (parser.free_registers[i]) {
            parser.free_registers[i] = false;
            register_alloc_counter++;
            return i;
        }
    }

    return -1;
}

// Assembly:
xorl %ecx, %ecx
pushq $-0x1
popq %rax
leaq 0x100bb(%rip), %rdx     # 0x155a8
cmpq $0x100, %rcx            # imm = 0x100
je 0x550f
cmpb $0x1, 0x7a(%rcx,%rdx)
je 0x5502
incq %rcx
jmp 0x54ed
movb $0x0, 0x7a(%rcx,%rdx)
incl 0x1008b(%rip)           # 0x15598
movl %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/jtuu[P]quesler/src/compiler.c
// Function: free_register
static void free_register(uint8_t reg) {
    if (parser.free_registers[reg]) {
        error("Register double free");
    }

    parser.free_registers[reg] = true;
    register_alloc_counter--;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
leaq 0x1007f(%rip), %r14     # 0x155a8
cmpb $0x1, 0x7a(%rbx,%r14)
jne 0x553d
leaq 0x2dbc(%rip), %rdi      # 0x82f4
callq 0x52e1
movb $0x1, 0x7a(%rbx,%r14)
decl 0x1004f(%rip)           # 0x15598
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/jtuu[P]quesler/src/compiler.c
// Function: emit_opcode
static void emit_opcode(uint16_t opcode) {
    uint8_t first_byte = (uint8_t) (opcode >> 8);
    if (first_byte == EXTENDED_OPCODE_TABLE1 || first_byte == EXTENDED_OPCODE_TABLE2) {
        EMIT(uint16_t, opcode);
    } else {
        EMIT(uint8_t, (uint8_t) opcode);
    }
}

// Assembly:
pushq %rax
movl %edi, %eax
andl $0xfe00, %eax           # imm = 0xFE00
cmpw $0xf800, %ax            # imm = 0xF800
jne 0x5589
leaq 0x6(%rsp), %rdx
movw %di, (%rdx)
movq 0x10022(%rip), %rdi     # 0x155a0
movq 0x10063(%rip), %rcx     # 0x155e8
pushq $0x2
jmp 0x55a1
leaq 0x5(%rsp), %rdx
movb %dil, (%rdx)
movq 0x10008(%rip), %rdi     # 0x155a0
movq 0x10049(%rip), %rcx     # 0x155e8
pushq $0x1
popq %rsi
callq 0x42a1
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/jtuu[P]quesler/src/compiler.c
// Function: emit_stack_push_value
static void emit_stack_push_value(int32_t val) {
    int ret = alloc_register();

    if (ret < 0) {
        error_alloc_register();
        return;
    }

    uint8_t reg = (uint8_t) ret;

    emit_leti(reg, val);
    emit_stack_push(reg);

    free_register(reg);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %edi, %ebx
callq 0x54e1
testl %eax, %eax
js 0x5608
movl %eax, %ebp
pushq $0x9
popq %rdi
callq 0x5561
movzbl %bpl, %ebp
movl %ebp, %edi
callq 0x55a9
movl %ebx, %edi
callq 0x5613
movl %ebp, %edi
callq 0x54ce
movl %ebp, %edi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x551c
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x5510
// File: /workspace/github_c_makefile_star2_O2/jtuu[P]quesler/src/compiler.c
// Function: take_label
static size_t take_label(void) {
    size_t label = ++parser.labels_count;
    if (label > UINT16_MAX) {
        error("Too many labels");
    }
    return label;
}

// Assembly:
pushq %rbx
movq 0x100cc(%rip), %rbx     # 0x15728
incq %rbx
movq %rbx, 0x100c2(%rip)     # 0x15728
cmpq $0x10000, %rbx          # imm = 0x10000
jb 0x567b
leaq 0x2ca1(%rip), %rdi      # 0x8317
callq 0x52e1
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/jtuu[P]quesler/src/compiler.c
// Function: emit_conditional_jump_rr
static void emit_conditional_jump_rr(uint16_t opcode, uint8_t reg1, uint8_t reg2, size_t label) {
    emit_opcode(opcode);
    emit_register(reg1);
    emit_register(reg2);
    emit_word((int16_t) label);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rcx, %rbx
movl %edx, %ebp
movl %esi, %r14d
callq 0x5561
movl %r14d, %edi
callq 0x55a9
movl %ebp, %edi
callq 0x55a9
movswl %bx, %edi
popq %rbx
popq %r14
popq %rbp
jmp 0x5633
// File: /workspace/github_c_makefile_star2_O2/jtuu[P]quesler/src/compiler.c
// Function: emit_conditional_jump_ri
static void emit_conditional_jump_ri(uint16_t opcode, uint8_t reg, int32_t val, size_t label) {
    emit_opcode(opcode);
    emit_register(reg);
    emit_dword(val);
    emit_word((int16_t) label);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %ebp
callq 0x5561
movl %ebp, %edi
callq 0x55a9
xorl %edi, %edi
callq 0x5613
movswl %bx, %edi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x5633
// File: /workspace/github_c_makefile_star2_O2/jtuu[P]quesler/src/compiler.c
// Function: let_declaration
static void let_declaration(void) {
    int ret = parse_variable("Expected variable name");

    if (ret < 0) {
        error_alloc_register();
        return;
    }

    uint8_t reg = (uint8_t) ret;

    bool initialized = false;

    if (match(TOKEN_EQUAL)) {
        expression();
        initialized = true;
    } else {
        emit_stack_push_value(0);
    }

    consume(TOKEN_SEMICOLON, "Expected ';' after variable declaration");

    Local* local = &current->locals[current->local_count - 1];
    define_variable(reg, local);

    local->initialized = initialized;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
leaq 0x2dac(%rip), %rdi      # 0x84ee
callq 0x5c45
testl %eax, %eax
js 0x5762
movl %eax, %ebx
pushq $0xe
popq %rdi
callq 0x4fe3
movl %eax, %ebp
testb %al, %al
je 0x576b
callq 0x52f0
jmp 0x5772
popq %rbx
popq %r14
popq %rbp
jmp 0x5510
xorl %edi, %edi
callq 0x55ca
leaq 0x2d8c(%rip), %rsi      # 0x8505
pushq $0x7
popq %rdi
callq 0x52f5
movq 0xfe00(%rip), %rax      # 0x15588
imulq $0x30, 0x3000(%rax), %rcx
leaq (%rcx,%rax), %r14
addq $-0x30, %r14
movzbl %bl, %edi
movq %r14, %rsi
callq 0x5d6e
movb %bpl, 0x2c(%r14)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jtuu[P]quesler/src/compiler.c
// Function: parse_variable
static int parse_variable(const char* error) {
    consume(TOKEN_IDENTIFIER, error);

    declare_variable();
    if (current->scope_depth > 0) {
        return alloc_register();
    }

    return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rsi
pushq $0x1a
popq %rdi
callq 0x52f5
movq 0xf926(%rip), %r15      # 0x15588
cmpl $0x0, 0x3008(%r15)
je 0x5d3f
movl 0x3000(%r15), %r12d
leaq 0xf952(%rip), %rbx      # 0x155d0
leaq 0x280a(%rip), %r14      # 0x848f
leal 0x1(%r12), %ebp
imulq $0x30, %r12, %rax
leaq (%r15,%rax), %rsi
addq $-0x30, %rsi
decl %ebp
testl %ebp, %ebp
jle 0x5cd4
movl 0x28(%rsi), %eax
cmpl $-0x1, %eax
je 0x5cad
cmpl 0x3008(%r15), %eax
jl 0x5cd4
decq %r12
leaq -0x30(%rsi), %r13
movq %rbx, %rdi
callq 0x5712
movq %r13, %rsi
testb %al, %al
je 0x5c96
movq %r14, %rdi
callq 0x52e1
movq 0xf8b6(%rip), %r15      # 0x15588
jmp 0x5c85
movq 0x3000(%r15), %rax
cmpq $0x100, %rax            # imm = 0x100
jb 0x5cf8
leaq 0x27ca(%rip), %rdi      # 0x84b4
callq 0x52e1
movq 0xf892(%rip), %r15      # 0x15588
jmp 0x5d3f
leaq 0x1(%rax), %rcx
movq %rcx, 0x3000(%r15)
imulq $0x30, %rax, %rax
movups 0xf8c2(%rip), %xmm0     # 0x155d0
movups 0xf8cb(%rip), %xmm1     # 0x155e0
movq 0xf8d4(%rip), %rcx      # 0x155f0
movq %rcx, 0x20(%r15,%rax)
movups %xmm1, 0x10(%r15,%rax)
movups %xmm0, (%r15,%rax)
orl $-0x1, 0x28(%r15,%rax)
andw $0x0, 0x2c(%r15,%rax)
movb $0x0, 0x2e(%r15,%rax)
cmpl $0x0, 0x3008(%r15)
jle 0x5d5c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x54e1
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jtuu[P]quesler/src/compiler.c
// Function: define_variable
static void define_variable(uint8_t reg, Local* local) {
    if (current->scope_depth > 0) {
        local->allocated = true;
        local->reg = reg;
        mark_initialized(local);
        emit_stack_pop(reg);
        return;
    }
}

// Assembly:
movq 0xf813(%rip), %rax      # 0x15588
movl 0x3008(%rax), %eax
testl %eax, %eax
jle 0x5d93
movb $0x1, 0x2d(%rsi)
movb %dil, 0x2e(%rsi)
movl %eax, 0x28(%rsi)
movzbl %dil, %edi
jmp 0x5551
retq
// File: /workspace/github_c_makefile_star2_O2/jtuu[P]quesler/src/compiler.c
// Function: emit_void_return
static void emit_void_return(void) {
    emit_stack_push_value(0);

    if (parser.current_function_label != entry_point_label) {
        emit_stack_swap();
    }

    emit_opcode(OP_RET);
}

// Assembly:
pushq %rax
xorl %edi, %edi
callq 0x55ca
movq 0xf985(%rip), %rax      # 0x15750
cmpq 0xf7be(%rip), %rax      # 0x15590
je 0x5dd9
callq 0x5e38
pushq $0x1
popq %rdi
popq %rax
jmp 0x5561