LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/albertito[P]libfiu/preload/posix/../../libfiu/hash.c
// Function: cache_get
bool cache_get(struct cache *c, const char *key, void **value)
{
	pthread_rwlock_rdlock(&c->lock);
	struct entry *e = entry_for_key(c, key);

	*value = NULL;

	if (e->in_use != IN_USE)
		goto miss;

	if (strcmp(key, e->key) == 0) {
		*value = e->value;
		goto hit;
	} else {
		goto miss;
	}

hit:
	pthread_rwlock_unlock(&c->lock);
	return true;

miss:
	pthread_rwlock_unlock(&c->lock);
	return false;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
leaq 0x10(%rdi), %rbx
movq %rbx, %rdi
callq 0x3100
movq %r15, %rdi
callq 0x30b0
movq %r15, %rdi
movq %rax, %rsi
callq 0x106f2
movl %eax, %eax
movq (%r12), %rcx
xorl %r12d, %r12d
xorl %edx, %edx
divq 0x8(%rcx)
movq (%rcx), %rax
leaq (%rdx,%rdx,2), %rcx
movq $0x0, (%r14)
cmpl $0x1, 0x10(%rax,%rcx,8)
jne 0x10cd7
leaq (%rax,%rcx,8), %r12
movq (%r12), %rsi
movq %r15, %rdi
callq 0x3130
testl %eax, %eax
je 0x10ccc
xorl %r12d, %r12d
jmp 0x10cd7
movq 0x8(%r12), %rax
movq %rax, (%r14)
movb $0x1, %r12b
movq %rbx, %rdi
callq 0x31a0
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/albertito[P]libfiu/preload/posix/../../libfiu/hash.c
// Function: cache_set
bool cache_set(struct cache *c, const char *key, void *value)
{
	pthread_rwlock_wrlock(&c->lock);
	struct entry *e = entry_for_key(c, key);

	if (e->in_use == IN_USE)
		free(e->key);

	e->in_use = IN_USE;

	e->key = strdup(key);
	e->value = value;

	pthread_rwlock_unlock(&c->lock);
	return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r12
leaq 0x10(%rdi), %r14
movq %r14, %rdi
callq 0x3070
movq %r15, %rdi
callq 0x30b0
movq %r15, %rdi
movq %rax, %rsi
callq 0x106f2
movl %eax, %eax
movq (%r12), %rcx
xorl %edx, %edx
divq 0x8(%rcx)
movq (%rcx), %rax
leaq (%rdx,%rdx,2), %rcx
leaq (%rax,%rcx,8), %r12
cmpl $0x1, 0x10(%r12)
jne 0x10d46
movq (%r12), %rdi
callq 0x3030
movl $0x1, 0x10(%r12)
movq %r15, %rdi
callq 0x31c0
movq %rax, (%r12)
movq %rbx, 0x8(%r12)
movq %r14, %rdi
callq 0x31a0
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/albertito[P]libfiu/preload/posix/../../libfiu/hash.c
// Function: cache_del
bool cache_del(struct cache *c, const char *key)
{
	pthread_rwlock_wrlock(&c->lock);
	struct entry *e = entry_for_key(c, key);

	if (e->in_use == IN_USE && strcmp(e->key, key) == 0) {
		free(e->key);
		e->key = NULL;
		e->value = NULL;
		e->in_use = NEVER;
		pthread_rwlock_unlock(&c->lock);
		return true;
	}

	pthread_rwlock_unlock(&c->lock);
	return false;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
leaq 0x10(%rdi), %rbx
movq %rbx, %rdi
callq 0x3070
movq %r14, %rdi
callq 0x30b0
movq %r14, %rdi
movq %rax, %rsi
callq 0x106f2
movl %eax, %eax
movq (%r15), %rcx
xorl %r15d, %r15d
xorl %edx, %edx
divq 0x8(%rcx)
movq (%rcx), %rax
leaq (%rdx,%rdx,2), %rcx
cmpl $0x1, 0x10(%rax,%rcx,8)
jne 0x10df7
leaq (%rax,%rcx,8), %r12
movq (%r12), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x3130
testl %eax, %eax
je 0x10ddb
xorl %r15d, %r15d
jmp 0x10df7
movq %r15, %rdi
callq 0x3030
xorps %xmm0, %xmm0
movups %xmm0, (%r12)
movl $0x0, 0x10(%r12)
movb $0x1, %r15b
movq %rbx, %rdi
callq 0x31a0
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/SequentMicrosystems[P]wdt-rpi/src/wdt.c
// Function: doDefault
static int doDefault(int argc, char *argv[])
{
	int dev = 0;
	int val = 0;
	u8 bType = 0;

	if (argc != 3)
	{
		printf("Invalid number of arguments\n");
		return FAIL;
	}

	dev = doBoardInit(WDT_HW_ADD, &bType);
	if (dev <= 0)
	{
		return FAIL;
	}
	val = atoi(argv[2]);
	if ( (WDT_DEFAULT_PERIOD_MIN <= val) && (val <= WDT_DEFAULT_PERIOD_MAX))
	{
		return writeReg16(dev, I2C_WDT_INIT_INTERVAL_SET_ADD, val);
	}
	return FAIL;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movb $0x0, 0xf(%rsp)
cmpl $0x3, %edi
jne 0x1bce
movq %rsi, %r14
leaq 0xf(%rsp), %rsi
movl $0x30, %edi
callq 0x28d3
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %eax, %eax
jle 0x1bdf
movl %eax, %ebp
movq 0x10(%r14), %rdi
callq 0x10b0
leal -0xb(%rax), %ecx
cmpl $0xfddc, %ecx           # imm = 0xFDDC
ja 0x1bdf
movl %ebp, %edi
movl $0x5, %esi
movl %eax, %edx
callq 0x2a61
movl %eax, %ebx
jmp 0x1bdf
leaq 0x2b6e(%rip), %rdi      # 0x4743
callq 0x1040
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/SequentMicrosystems[P]wdt-rpi/src/wdt.c
// Function: doPeriod
static int doPeriod(int argc, char *argv[])
{
	int dev = 0;
	int val = 0;
	u8 bType = 0;

	if (argc != 3)
	{
		printf("Invalid number of arguments\n");
		return FAIL;
	}

	dev = doBoardInit(WDT_HW_ADD, &bType);
	if (dev <= 0)
	{
		return FAIL;
	}
	val = atoi(argv[2]);
	if ( (0 < val) && (val <= WDT_PERIOD_MAX))
	{
		return writeReg16(dev, I2C_WDT_INTERVAL_SET_ADD, val);
	}
	else if (val == 0)
	{
		return writeReg16(dev, I2C_WDT_INTERVAL_SET_ADD, WDT_DISABLE_PERIOD);
	}
	return FAIL;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movb $0x0, 0xf(%rsp)
cmpl $0x3, %edi
jne 0x1c38
movq %rsi, %r14
leaq 0xf(%rsp), %rsi
movl $0x30, %edi
callq 0x28d3
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %eax, %eax
jle 0x1c62
movl %eax, %ebp
movq 0x10(%r14), %rdi
callq 0x10b0
leal -0x1(%rax), %ecx
cmpl $0xfffe, %ecx           # imm = 0xFFFE
ja 0x1c4b
movl %ebp, %edi
movl $0x1, %esi
movl %eax, %edx
jmp 0x1c5b
leaq 0x2b04(%rip), %rdi      # 0x4743
callq 0x1040
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x1c62
testl %eax, %eax
jne 0x1c62
movl %ebp, %edi
movl $0x1, %esi
movl $0xfde9, %edx           # imm = 0xFDE9
callq 0x2a61
movl %eax, %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/SequentMicrosystems[P]wdt-rpi/src/wdt.c
// Function: doSetOffTime
static int doSetOffTime(int argc, char *argv[])
{
	int dev = 0;
	int val = 0;
	u8 bType = 0;

	if (argc != 3)
	{
		printf("Invalid number of arguments\n");
		return FAIL;
	}

	dev = doBoardInit(WDT_HW_ADD, &bType);
	if (dev <= 0)
	{
		return FAIL;
	}
	val = atoi(argv[2]);
	if ( (WDT_MIN_POWER_OFF_INTERVAL < val)
		&& (val < WDT_MAX_POWER_OFF_INTERVAL))
	{
		return writeReg32(dev, I2C_POWER_OFF_INTERVAL_SET_ADD, val);
	}
	return FAIL;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movb $0x0, 0xf(%rsp)
cmpl $0x3, %edi
jne 0x1cc2
movq %rsi, %r14
leaq 0xf(%rsp), %rsi
movl $0x30, %edi
callq 0x28d3
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %eax, %eax
jle 0x1cd3
movl %eax, %ebp
movq 0x10(%r14), %rdi
callq 0x10b0
leal -0x3(%rax), %ecx
cmpl $0x28de7c, %ecx         # imm = 0x28DE7C
ja 0x1cd3
movl %ebp, %edi
movl $0xe, %esi
movl %eax, %edx
callq 0x2a9e
movl %eax, %ebx
jmp 0x1cd3
leaq 0x2a7a(%rip), %rdi      # 0x4743
callq 0x1040
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/SequentMicrosystems[P]wdt-rpi/src/wdt.c
// Function: doSetRepowerOnBattery
static int doSetRepowerOnBattery(int argc, char *argv[])
{
	int dev = 0;
	int val = 0;
	u8 bType = 0;
	u8 out = 0;

	if (argc != 3)
	{
		printf("Invalid number of arguments\n");
		return FAIL;
	}

	dev = doBoardInit(WDT_HW_ADD, &bType);
	if (dev <= 0)
	{
		return FAIL;
	}
	val = readReg8(dev, I2C_CHARGE_STAT_ADD);
	if ( (val & 0xf0) == 0)
	{
		printf("Not available on this firmware version!\n");
		return FAIL;
	}
	val = atoi(argv[2]);

	if (val == 0)
	{
		out = 1;
	}

	return writeReg8(dev, I2C_POWER_OFF_ON_BATTERY_ADD, out);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movb $0x0, 0xf(%rsp)
cmpl $0x3, %edi
jne 0x23a1
movq %rsi, %r14
leaq 0xf(%rsp), %rsi
movl $0x30, %edi
callq 0x28d3
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %eax, %eax
jle 0x23b2
movl %eax, %ebp
movl %eax, %edi
movl $0x1b, %esi
callq 0x2906
testb $-0x10, %al
je 0x23bd
movq 0x10(%r14), %rdi
callq 0x10b0
xorl %edx, %edx
testl %eax, %eax
sete %dl
movl %ebp, %edi
movl $0x1c, %esi
callq 0x2a25
movl %eax, %ebx
jmp 0x23b2
leaq 0x239b(%rip), %rdi      # 0x4743
callq 0x1040
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x2296(%rip), %rdi      # 0x465a
callq 0x1040
jmp 0x23b2
// File: /workspace/github_c_makefile_star2_O1/SequentMicrosystems[P]wdt-rpi/src/wdt.c
// Function: doSetPowerButtonEnable
static int doSetPowerButtonEnable(int argc, char *argv[])
{
	int dev = 0;
	int val = 0;
	u8 bType = 0;
	u8 out = 0;

	if (argc != 3)
	{
		printf("Invalid number of arguments\n");
		return FAIL;
	}

	dev = doBoardInit(WDT_HW_ADD, &bType);
	if (dev <= 0)
	{
		return FAIL;
	}
	val = readReg8(dev, I2C_CHARGE_STAT_ADD);
	if ( (val & 0xf0) <= 0x10)
	{
		printf("Not available on this firmware version!\n");
		return FAIL;
	}
	val = atoi(argv[2]);

	if (val > 0)
	{
		out = 1;
	}

	return writeReg8(dev, I2C_POWER_SW_USAGE_ADD, out);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movb $0x0, 0xf(%rsp)
cmpl $0x3, %edi
jne 0x241e
movq %rsi, %r14
leaq 0xf(%rsp), %rsi
movl $0x30, %edi
callq 0x28d3
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %eax, %eax
jle 0x244f
movl %eax, %ebp
movl %eax, %edi
movl $0x1b, %esi
callq 0x2906
andl $0xf0, %eax
cmpl $0x10, %eax
ja 0x2431
leaq 0x2243(%rip), %rdi      # 0x465a
callq 0x1040
jmp 0x244f
leaq 0x231e(%rip), %rdi      # 0x4743
callq 0x1040
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x244f
movq 0x10(%r14), %rdi
callq 0x10b0
xorl %edx, %edx
testl %eax, %eax
setg %dl
movl %ebp, %edi
movl $0x1d, %esi
callq 0x2a25
movl %eax, %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/SequentMicrosystems[P]wdt-rpi/src/wdt.c
// Function: doSetRtc
static int doSetRtc(int argc, char *argv[])
{
	int dev = 0;
	int val = 0;
	u8 bType = 0;
	int day, mon, year, hours, min, sec;
	uint8_t buff[8];

	if (argc != 8)
	{
		printf(
			"Invalid number of arguments usage: wdt -rtc mm dd yyyy hh mm ss\n");
		return FAIL;
	}
	dev = doBoardInit(WDT_HW_ADD, &bType);
	if (dev <= 0)
	{
		return FAIL;
	}
	val = readReg8(dev, I2C_CHARGE_STAT_ADD);
	if ( (val & 0xf0) <= 0x10)
	{
		printf("Not available on this firmware version!\n");
		return FAIL;
	}
	mon = atoi(argv[2]);
	day = atoi(argv[3]);
	year = atoi(argv[4]);
	hours = atoi(argv[5]);
	min = atoi(argv[6]);
	sec = atoi(argv[7]);
	if (year < 2000)
	{
		year += 2000;
	}
	if (mon < 1 || mon > 12 || day < 1 || day > 31 || year < 2000 || year > 2255
		|| hours < 0 || hours > 23 || min < 0 || min > 59 || sec < 0 || sec > 59)
	{
		printf("Invalid date/time usage: wdt -rtc mm dd yyyy hh mm ss\n");
		return FAIL;
	}
	buff[0] = (uint8_t) (year - 2000);
	buff[1] = (uint8_t)mon;
	buff[2] = (uint8_t)day;
	buff[3] = (uint8_t)hours;
	buff[4] = (uint8_t)min;
	buff[5] = (uint8_t)sec;
	buff[6] = RTC_SET_CMD;

	return writeBuff(dev, I2C_RTC_SET_YEAR_ADD, buff, 7);

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movb $0x0, 0xf(%rsp)
cmpl $0x8, %edi
jne 0x24b5
movq %rsi, %r14
leaq 0xf(%rsp), %rsi
movl $0x30, %edi
callq 0x28d3
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %eax, %eax
jle 0x25c5
movl %eax, %ebp
movl %eax, %edi
movl $0x1b, %esi
callq 0x2906
andl $0xf0, %eax
cmpl $0x10, %eax
ja 0x24cb
leaq 0x21aa(%rip), %rdi      # 0x465a
jmp 0x258a
leaq 0x20d1(%rip), %rdi      # 0x458d
callq 0x1040
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x25c5
movq 0x10(%r14), %rdi
callq 0x10b0
movq %rax, 0x18(%rsp)
movq 0x18(%r14), %rdi
callq 0x10b0
movq %rax, 0x10(%rsp)
movq 0x20(%r14), %rdi
callq 0x10b0
movl %eax, %r15d
movq 0x28(%r14), %rdi
callq 0x10b0
movl %eax, %r12d
movq 0x30(%r14), %rdi
callq 0x10b0
movl %eax, %r13d
movq 0x38(%r14), %rdi
callq 0x10b0
movl %r13d, %r9d
movl %r12d, %r8d
movq 0x10(%rsp), %r13
movq 0x18(%rsp), %r12
movl $0x7d0, %edx            # imm = 0x7D0
leal (%r15,%rdx), %ecx
cmpl %edx, %r15d
cmovgel %r15d, %ecx
leal -0xd(%r12), %edx
cmpl $-0xc, %edx
setb %dl
leal -0x20(%r13), %esi
cmpl $-0x1f, %esi
setb %sil
orb %dl, %sil
leal -0x8d0(%rcx), %edx
cmpl $0xffffff00, %edx       # imm = 0xFFFFFF00
setb %dl
cmpl $0x18, %r8d
setae %dil
orb %sil, %dil
cmpl $0x3c, %r9d
setae %sil
orb %dil, %sil
orb %dl, %sil
cmpl $0x3c, %eax
setae %dl
orb %sil, %dl
cmpb $0x1, %dl
jne 0x2591
leaq 0x1fcd(%rip), %rdi      # 0x4557
callq 0x1040
jmp 0x25c5
addb $0x30, %cl
leaq 0x20(%rsp), %rdx
movb %cl, (%rdx)
movb %r12b, 0x1(%rdx)
movb %r13b, 0x2(%rdx)
movb %r8b, 0x3(%rdx)
movb %r9b, 0x4(%rdx)
movb %al, 0x5(%rdx)
movb $-0x56, 0x6(%rdx)
movl %ebp, %edi
movl $0x25, %esi
movl $0x7, %ecx
callq 0x2c02
movl %eax, %ebx
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/SequentMicrosystems[P]wdt-rpi/src/wdt.c
// Function: doSetButtonInt
static int doSetButtonInt(int argc, char *argv[])
{
	int dev = 0;
	int val = 0;
	u8 bType = 0;
	uint8_t buff[8];

	if (argc != 3)
	{
		printf("Invalid number of arguments usage: wdt -bint <0/1>\n");
		return FAIL;
	}
	dev = doBoardInit(WDT_HW_ADD, &bType);
	if (dev <= 0)
	{
		return FAIL;
	}
	val = readReg8(dev, I2C_CHARGE_STAT_ADD);
	if ( (val & 0xf0) <= 0x10)
	{
		printf("Not available on this firmware version!\n");
		return FAIL;
	}
	val = readReg8(dev, I2C_MEM_REVISION_MAJOR_ADD);
	{
		if (val < 3)
		{
			printf("Not available on this firmware version!\n");
			return FAIL;
		}
	}
	val = atoi(argv[2]);
	if (val < 0 || val > 1)
	{
		printf("Invalid argument value usage: wdt -bint <0/1>\n");
		return FAIL;
	}
	buff[0] = (uint8_t)val;
	return writeBuff(dev, I2C_POWER_SW_INT_OUT, buff, 1);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movb $0x0, 0x7(%rsp)
cmpl $0x3, %edi
jne 0x263a
movq %rsi, %r14
leaq 0x7(%rsp), %rsi
movl $0x30, %edi
callq 0x28d3
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %eax, %eax
jle 0x264b
movl %eax, %ebp
movl %eax, %edi
movl $0x1b, %esi
callq 0x2906
andl $0xf0, %eax
cmpl $0x10, %eax
jbe 0x262c
movl %ebp, %edi
movl $0x2e, %esi
callq 0x2906
cmpl $0x2, %eax
jg 0x2656
leaq 0x2027(%rip), %rdi      # 0x465a
callq 0x1040
jmp 0x264b
leaq 0x1fba(%rip), %rdi      # 0x45fb
callq 0x1040
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq 0x10(%r14), %rdi
callq 0x10b0
cmpl $0x2, %eax
jb 0x266d
leaq 0x1f62(%rip), %rdi      # 0x45cd
jmp 0x2633
leaq 0x8(%rsp), %rdx
movb %al, (%rdx)
movl %ebp, %edi
movl $0x30, %esi
movl $0x1, %ecx
callq 0x2c02
movl %eax, %ebx
jmp 0x264b
// File: /workspace/github_c_makefile_star2_O1/SequentMicrosystems[P]wdt-rpi/src/wdt.c
// Function: doBlockCharge
static int doBlockCharge(int argc, char *argv[])
{
	int dev = 0;
	int val = 0;
	u8 bType = 0;
	uint8_t buff[8];

	if (argc != 3)
	{
		printf("Invalid number of arguments usage: wdt -bc <0/1>\n");
		return FAIL;
	}
	dev = doBoardInit(WDT_HW_ADD, &bType);
	if (dev <= 0)
	{
		return FAIL;
	}
	val = readReg8(dev, I2C_CHARGE_STAT_ADD);
	if ( (val & 0xf0) <= 0x10)
	{
		printf("Not available on this firmware version!\n");
		return FAIL;
	}
	val = readReg8(dev, I2C_MEM_REVISION_MAJOR_ADD);
	{
		if (val < 3)
		{
			printf("Not available on this firmware version!\n");
			return FAIL;
		}
	}
	val = atoi(argv[2]);
	if (val < 0 || val > 1)
	{
		printf("Invalid argument value usage: wdt -bc <0/1>\n");
		return FAIL;
	}
	buff[0] = (uint8_t)val;
	return writeBuff(dev, I2C_STOP_CHARGE, buff, 1);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movb $0x0, 0x7(%rsp)
cmpl $0x3, %edi
jne 0x26ed
movq %rsi, %r14
leaq 0x7(%rsp), %rsi
movl $0x30, %edi
callq 0x28d3
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %eax, %eax
jle 0x26fe
movl %eax, %ebp
movl %eax, %edi
movl $0x1b, %esi
callq 0x2906
andl $0xf0, %eax
cmpl $0x10, %eax
jbe 0x26df
movl %ebp, %edi
movl $0x2e, %esi
callq 0x2906
cmpl $0x2, %eax
jg 0x2709
leaq 0x1f74(%rip), %rdi      # 0x465a
callq 0x1040
jmp 0x26fe
leaq 0x1f8e(%rip), %rdi      # 0x4682
callq 0x1040
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq 0x10(%r14), %rdi
callq 0x10b0
cmpl $0x2, %eax
jb 0x2720
leaq 0x1f10(%rip), %rdi      # 0x462e
jmp 0x26e6
leaq 0x8(%rsp), %rdx
movb %al, (%rdx)
movl %ebp, %edi
movl $0x31, %esi
movl $0x1, %ecx
callq 0x2c02
movl %eax, %ebx
jmp 0x26fe
// File: /workspace/github_c_makefile_star2_O1/SequentMicrosystems[P]wdt-rpi/src/wdt.c
// Function: doUndervoltage
static int doUndervoltage(int argc, char *argv[])
{
	int dev = 0;
	int val = 0;
	u8 bType = 0;

	if (argc != 3)
	{
		printf("Invalid number of arguments\n");
		return FAIL;
	}

	dev = doBoardInit(WDT_HW_ADD, &bType);
	if (dev <= 0)
	{
		return FAIL;
	}
	val = atoi(argv[2]);
	if ( (500 < val) && (val <= 4000))
	{
		return writeReg16(dev, I2C_BATTERY_UVLO, val);
	}
	printf("Battery under voltage threshold must be from 500mV to 4V\n"); 
	
	return FAIL;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movb $0x0, 0xf(%rsp)
cmpl $0x3, %edi
jne 0x2794
movq %rsi, %r14
leaq 0xf(%rsp), %rsi
movl $0x30, %edi
callq 0x28d3
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %eax, %eax
jle 0x27b3
movl %eax, %ebp
movq 0x10(%r14), %rdi
callq 0x10b0
leal -0x1f5(%rax), %ecx
cmpl $0xdab, %ecx            # imm = 0xDAB
ja 0x27a7
movl %ebp, %edi
movl $0x36, %esi
movl %eax, %edx
callq 0x2a61
movl %eax, %ebx
jmp 0x27b3
leaq 0x1fa8(%rip), %rdi      # 0x4743
callq 0x1040
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x27b3
leaq 0x1f05(%rip), %rdi      # 0x46b3
callq 0x1040
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/SequentMicrosystems[P]wdt-rpi/src/wdt.c
// Function: doChemSel
static int doChemSel(int argc, char *argv[])
{
	int dev = 0;
	int val = 0;
	u8 bType = 0;
	u8 buff[2];

	if (argc != 3)
	{
		printf("Invalid number of arguments\n");
		return FAIL;
	}

	dev = doBoardInit(WDT_HW_ADD, &bType);
	if (dev <= 0)
	{
		return FAIL;
	}
	
	val = readBuff(dev, I2C_MULTI_CHEM_CARD, buff, 1);
	if (OK == val)
	{
		if (buff[0] < 1)
		{
			printf("Available for Multichemestry card only!\n");
			return FAIL;
		}
			
		val = atoi(argv[2]);
		if ( (val >= 0) && (val < 8))
		{
			return writeReg8(dev, I2C_SEL_CHEMESTRY, val);
		}
		printf("Chemestry type available from 0 to 7 including\n");
	}
	
	return FAIL;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movb $0x0, 0xd(%rsp)
cmpl $0x3, %edi
jne 0x282e
movq %rsi, %r14
leaq 0xd(%rsp), %rsi
movl $0x30, %edi
callq 0x28d3
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %eax, %eax
jle 0x283f
movl %eax, %ebp
leaq 0xe(%rsp), %rdx
movl %eax, %edi
movl $0x32, %esi
movl $0x1, %ecx
callq 0x2b87
testl %eax, %eax
jne 0x283f
cmpb $0x0, 0xe(%rsp)
je 0x284a
movq 0x10(%r14), %rdi
callq 0x10b0
cmpl $0x7, %eax
ja 0x2853
movl %ebp, %edi
movl $0x33, %esi
movl %eax, %edx
callq 0x2a25
movl %eax, %ebx
jmp 0x283f
leaq 0x1f0e(%rip), %rdi      # 0x4743
callq 0x1040
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x1eca(%rip), %rdi      # 0x471b
jmp 0x285a
leaq 0x1e92(%rip), %rdi      # 0x46ec
callq 0x1040
jmp 0x283f
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/SequentMicrosystems[P]wdt-rpi/src/comm.c
// Function: i2cSetup
int i2cSetup(int addr)
{
	int file;
	char filename[40];

	sprintf(filename, "/dev/i2c-1");

	if ( (file = open(filename, O_RDWR)) < 0)
	{
		printf("Failed to open the bus.");
		return FAIL;
	}
	if (ioctl(file, I2C_SLAVE, addr) < 0)
	{
		printf("Failed to acquire bus access and/or talk to slave.\n");
		return FAIL;
	}

	return file;
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x28, %rsp
movl %edi, %ebp
movabsq $0x6332692f7665642f, %rax # imm = 0x6332692F7665642F
movq %rsp, %rdi
movq %rax, (%rdi)
movl $0x312d63, 0x7(%rdi)    # imm = 0x312D63
movl $0x2, %esi
xorl %eax, %eax
callq 0x10a0
testl %eax, %eax
js 0x28b7
movl %eax, %ebx
movl $0x703, %esi            # imm = 0x703
movl %eax, %edi
movl %ebp, %edx
xorl %eax, %eax
callq 0x1070
testl %eax, %eax
jns 0x28ca
leaq 0x1ed3(%rip), %rdi      # 0x4783
callq 0x1040
jmp 0x28c5
leaq 0x1ead(%rip), %rdi      # 0x476b
xorl %eax, %eax
callq 0x1060
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/SequentMicrosystems[P]wdt-rpi/src/comm.c
// Function: doBoardInit
int doBoardInit(int hwAdd, u8 *bType)
{
	int dev, bV = -1;

	dev = i2cSetup(hwAdd);
	if (dev == FAIL)
	{
		return dev;
	}
	bV = readReg8(dev, I2C_WDT_RELOAD_ADD);
	if (bV == FAIL)
	{
		return bV;
	}
	*bType = bV;
	return dev;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
callq 0x2864
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpl $-0x1, %eax
je 0x28ff
movl %eax, %r14d
movl %eax, %edi
xorl %esi, %esi
callq 0x2906
cmpl $-0x1, %eax
je 0x28ff
movb %al, (%rbx)
movl %r14d, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/SequentMicrosystems[P]wdt-rpi/src/comm.c
// Function: readReg8
int readReg8(int dev, int add)
{

	int ret;
	char buf[10];

	buf[0] = 0xff & add;

	if (write(dev, buf, 1) != 1)
	{
		printf("Fail to select mem add\n");
		return -1;
	}

	if (read(dev, buf, 1) != 1)
	{
		printf("Fail to read reg\n");
		return -1;
	}
	ret = 0xff & buf[0];
	return ret;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movl %edi, %ebx
leaq 0x6(%rsp), %rax
movb %sil, (%rax)
movl $0x1, %edx
movq %rax, %rsi
callq 0x1050
cmpq $0x1, %rax
jne 0x2946
leaq 0x6(%rsp), %rsi
movl $0x1, %edx
movl %ebx, %edi
callq 0x1080
cmpq $0x1, %rax
jne 0x294f
movzbl 0x6(%rsp), %eax
jmp 0x2960
leaq 0x1e9d(%rip), %rdi      # 0x47ea
jmp 0x2956
leaq 0x1e83(%rip), %rdi      # 0x47d9
callq 0x1040
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/SequentMicrosystems[P]wdt-rpi/src/comm.c
// Function: readReg16
int readReg16(int dev, int add)
{
	int ret = 0;
	char buf[10];

	buf[0] = 0xff & add;

	if (write(dev, buf, 1) != 1)
	{
		printf("Fail to select mem add\n");
		return -1;
	}

	if (read(dev, buf, 2) != 2)
	{
		printf("Fail to read reg\n");
		return -1;
	}
	memcpy(&ret, buf, 2);

	return ret;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movl %edi, %ebx
leaq 0x6(%rsp), %rax
movb %sil, (%rax)
movl $0x1, %edx
movq %rax, %rsi
callq 0x1050
cmpq $0x1, %rax
jne 0x29a6
leaq 0x6(%rsp), %rsi
movl $0x2, %edx
movl %ebx, %edi
callq 0x1080
cmpq $0x2, %rax
jne 0x29af
movzwl 0x6(%rsp), %eax
jmp 0x29c0
leaq 0x1e3d(%rip), %rdi      # 0x47ea
jmp 0x29b6
leaq 0x1e23(%rip), %rdi      # 0x47d9
callq 0x1040
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/SequentMicrosystems[P]wdt-rpi/src/comm.c
// Function: readReg32
int readReg32(int dev, int add)
{
	uint32_t ret = 0;
	char buf[10];

	buf[0] = 0xff & add;

	if (write(dev, buf, 1) != 1)
	{
		printf("Fail to select mem add\n");
		return -1;
	}

	if (read(dev, buf, 4) != 4)
	{
		printf("Fail to read reg\n");
		return -1;
	}
	memcpy(&ret, buf, 4);

	return ret;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movl %edi, %ebx
leaq 0x4(%rsp), %rax
movb %sil, (%rax)
movl $0x1, %edx
movq %rax, %rsi
callq 0x1050
cmpq $0x1, %rax
jne 0x2a05
leaq 0x4(%rsp), %rsi
movl $0x4, %edx
movl %ebx, %edi
callq 0x1080
cmpq $0x4, %rax
jne 0x2a0e
movl 0x4(%rsp), %eax
jmp 0x2a1f
leaq 0x1dde(%rip), %rdi      # 0x47ea
jmp 0x2a15
leaq 0x1dc4(%rip), %rdi      # 0x47d9
callq 0x1040
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/SequentMicrosystems[P]wdt-rpi/src/comm.c
// Function: writeReg8
int writeReg8(int dev, int add, int val)
{
	char buf[10];

	buf[0] = 0xff & add;
	buf[1] = 0xff & val;

	if (write(dev, buf, 2) < 0)
	{
		printf("Fail to w8\n");
		return -1;
	}
	return OK;

}

// Assembly:
subq $0x18, %rsp
leaq 0xe(%rsp), %rax
movb %sil, (%rax)
movb %dl, 0x1(%rax)
movl $0x2, %edx
movq %rax, %rsi
callq 0x1050
movq %rax, %rcx
xorl %eax, %eax
testq %rcx, %rcx
jns 0x2a5c
leaq 0x1d64(%rip), %rdi      # 0x47b6
callq 0x1040
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x18, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/SequentMicrosystems[P]wdt-rpi/src/comm.c
// Function: writeReg16
int writeReg16(int dev, int add, int val)
{
	char buf[10];

	buf[0] = 0xff & add;
	memcpy(&buf[1], &val, 2);

	if (write(dev, buf, 3) < 0)
	{
		printf("Fail to w16\n");
		return FAIL;
	}
	return OK;
}

// Assembly:
subq $0x18, %rsp
leaq 0xe(%rsp), %rax
movb %sil, (%rax)
movw %dx, 0x1(%rax)
movl $0x3, %edx
movq %rax, %rsi
callq 0x1050
movq %rax, %rcx
xorl %eax, %eax
testq %rcx, %rcx
jns 0x2a99
leaq 0x1d32(%rip), %rdi      # 0x47c1
callq 0x1040
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x18, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/SequentMicrosystems[P]wdt-rpi/src/comm.c
// Function: writeReg32
int writeReg32(int dev, int add, int val)
{
	char buf[10];

	buf[0] = 0xff & add;
	memcpy(&buf[1], &val, 4);

	if (write(dev, buf, 5) < 0)
	{
		printf("Fail to w16\n");
		return FAIL;
	}
	return OK;
}

// Assembly:
subq $0x18, %rsp
leaq 0xe(%rsp), %rax
movb %sil, (%rax)
movl %edx, 0x1(%rax)
movl $0x5, %edx
movq %rax, %rsi
callq 0x1050
movq %rax, %rcx
xorl %eax, %eax
testq %rcx, %rcx
jns 0x2ad5
leaq 0x1cf6(%rip), %rdi      # 0x47c1
callq 0x1040
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x18, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/SequentMicrosystems[P]wdt-rpi/src/comm.c
// Function: readReg24
int readReg24(int dev, int add)
{
	int ret = 0;
	char buf[10];

	buf[0] = 0xff & add;

	if (write(dev, buf, 1) != 1)
	{
		printf("Fail to select mem add\n");
		return FAIL;
	}

	if (read(dev, buf, 3) != 2)
	{
		printf("Fail to read reg\n");
		return FAIL;
	}
	memcpy(&ret, buf, 3);

#ifdef DEBUG_I	
	printbits(ret);
	printf("\n");
	printf("%#08x\n", ret);
#endif
	return ret;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movl %edi, %ebx
leaq 0x4(%rsp), %rax
movb %sil, (%rax)
movl $0x1, %edx
movq %rax, %rsi
callq 0x1050
cmpq $0x1, %rax
jne 0x2b24
leaq 0x4(%rsp), %rsi
movl $0x3, %edx
movl %ebx, %edi
callq 0x1080
cmpq $0x2, %rax
jne 0x2b2d
movzbl 0x6(%rsp), %ecx
shll $0x10, %ecx
movzwl 0x4(%rsp), %eax
orl %ecx, %eax
jmp 0x2b3e
leaq 0x1cbf(%rip), %rdi      # 0x47ea
jmp 0x2b34
leaq 0x1ca5(%rip), %rdi      # 0x47d9
callq 0x1040
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/SequentMicrosystems[P]wdt-rpi/src/comm.c
// Function: writeReg24
int writeReg24(int dev, int add, int val)
{
	char buf[10];

	buf[0] = 0xff & add;
	memcpy(&buf[1], &val, 3);

	if (write(dev, buf, 4) < 0)
	{
		printf("Fail to w24\n");
		return FAIL;
	}
	return OK;

}

// Assembly:
subq $0x18, %rsp
leaq 0xe(%rsp), %rax
movb %sil, (%rax)
movw %dx, 0x1(%rax)
shrl $0x10, %edx
movb %dl, 0x3(%rax)
movl $0x4, %edx
movq %rax, %rsi
callq 0x1050
movq %rax, %rcx
xorl %eax, %eax
testq %rcx, %rcx
jns 0x2b82
leaq 0x1c55(%rip), %rdi      # 0x47cd
callq 0x1040
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x18, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/SequentMicrosystems[P]wdt-rpi/src/comm.c
// Function: readBuff
int readBuff(int dev, int add, uint8_t *data, int len)
{
	char buf[2];

	if (NULL == data || len > I2C_MAX_BUFFER_SIZE)
	{
		return FAIL;
	}

	buf[0] = 0xff & add;

	if (write(dev, buf, 1) != 1)
	{
		printf("Fail to select mem add\n");
		return FAIL;
	}

	if (read(dev, data, len) < 1)
	{
		printf("Fail to read reg\n");
		return FAIL;
	}
	return OK;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %ecx, %ebp
testq %rdx, %rdx
sete %al
cmpl $0x21, %ecx
setge %cl
orb %al, %cl
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jne 0x2bf9
movq %rdx, %rbx
movl %edi, %r14d
leaq 0xe(%rsp), %rax
movb %sil, (%rax)
movl $0x1, %edx
movq %rax, %rsi
callq 0x1050
cmpq $0x1, %rax
jne 0x2be8
movslq %ebp, %rdx
movl %r14d, %edi
movq %rbx, %rsi
callq 0x1080
movq %rax, %rcx
xorl %eax, %eax
testq %rcx, %rcx
jg 0x2bf9
leaq 0x1bf3(%rip), %rdi      # 0x47d9
jmp 0x2bef
leaq 0x1bfb(%rip), %rdi      # 0x47ea
callq 0x1040
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/SequentMicrosystems[P]wdt-rpi/src/comm.c
// Function: writeBuff
int writeBuff(int dev, int add, uint8_t *data, int len)
{
	char buf[I2C_MAX_BUFFER_SIZE];

	if (NULL == data || len > I2C_MAX_BUFFER_SIZE -1)
	{
		return FAIL;
	}

	buf[0] = 0xff & add;
	memcpy( buf + 1, data, len);

	if (write(dev, buf, len + 1) < 1)
	{
		printf("Fail to select mem add\n");
		return FAIL;
	}
	return OK;
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x28, %rsp
movl %ecx, %ebp
testq %rdx, %rdx
sete %al
cmpl $0x20, %ecx
setge %cl
orb %al, %cl
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jne 0x2c62
movl %edi, %ebx
leaq 0x1(%rsp), %rdi
movb %sil, -0x1(%rdi)
movslq %ebp, %rax
movq %rdx, %rsi
movq %rax, %rdx
callq 0x1090
incl %ebp
movslq %ebp, %rdx
movq %rsp, %rsi
movl %ebx, %edi
callq 0x1050
movq %rax, %rcx
xorl %eax, %eax
testq %rcx, %rcx
jg 0x2c62
leaq 0x1b92(%rip), %rdi      # 0x47ea
callq 0x1040
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x28, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/fm4dd[P]learn-ssl/certsignature.c
// Function: X509_signature_dump
int X509_signature_dump(BIO *bp, const ASN1_STRING *sig, int indent) {
  const unsigned char *s;
  int i, n;

  n=sig->length;
  s=sig->data;
  for (i=0; i<n; i++) {
    if ((i%18) == 0) {
      if (BIO_write(bp,"\n",1) <= 0) return 0;
      if (BIO_indent(bp, indent, indent) <= 0) return 0;
    }
    if (BIO_printf(bp,"%02x%s",s[i],
      ((i+1) == n)?"":":") <= 0) return 0;
  }

  if (BIO_write(bp,"\n",1) != 1) return 0;

  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, 0xc(%rsp)
movq %rdi, %rbx
movl (%rsi), %r13d
movq 0x8(%rsi), %rax
movq %rax, 0x10(%rsp)
xorl %ebp, %ebp
testl %r13d, %r13d
movl $0x0, %r15d
cmovgl %r13d, %r15d
decq %r13
cmpq %rbp, %r15
je 0x143f
movl %ebp, %eax
imulq $0x38e38e39, %rax, %rax # imm = 0x38E38E39
shrq $0x22, %rax
addl %eax, %eax
leal (%rax,%rax,8), %eax
negl %eax
addl %ebp, %eax
jne 0x13fc
movq %rbx, %rdi
leaq 0xcca(%rip), %rsi       # 0x20a3
movl $0x1, %edx
callq 0x1090
xorl %r12d, %r12d
testl %eax, %eax
jle 0x145d
movq %rbx, %rdi
movl 0xc(%rsp), %edx
movl %edx, %esi
callq 0x10f0
testl %eax, %eax
jle 0x145d
movq 0x10(%rsp), %rax
movzbl (%rax,%rbp), %edx
leaq 0x1(%rbp), %r14
cmpq %rbp, %r13
leaq 0xca0(%rip), %rcx       # 0x20b3
leaq 0xc8a(%rip), %rax       # 0x20a4
cmoveq %rax, %rcx
xorl %r12d, %r12d
movq %rbx, %rdi
leaq 0xcad(%rip), %rsi       # 0x20d8
xorl %eax, %eax
callq 0x1100
movq %r14, %rbp
testl %eax, %eax
jg 0x13ae
jmp 0x145d
leaq 0xc5d(%rip), %rsi       # 0x20a3
movq %rbx, %rdi
movl $0x1, %edx
callq 0x1090
xorl %r12d, %r12d
cmpl $0x1, %eax
sete %r12b
movl %r12d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/craigbarnes[P]lua-gumbo/lib/string_buffer.c
// Function: gumbo_string_buffer_append_codepoint
HOT void gumbo_string_buffer_append_codepoint (
  int c,
  GumboStringBuffer* output
) {
  // num_bytes is actually the number of continuation bytes, 1 less than the
  // total number of bytes. This is done to keep the loop below simple and
  // should probably change if we unroll it.
  int num_bytes;
  int prefix;
  if (c <= 0x7f) {
    num_bytes = 0;
    prefix = 0;
  } else if (c <= 0x7ff) {
    num_bytes = 1;
    prefix = 0xc0;
  } else if (c <= 0xffff) {
    num_bytes = 2;
    prefix = 0xe0;
  } else {
    num_bytes = 3;
    prefix = 0xf0;
  }
  maybe_resize_string_buffer(num_bytes + 1, output);
  output->data[output->length++] = prefix | (c >> (num_bytes * 6));
  for (int i = num_bytes - 1; i >= 0; --i) {
    output->data[output->length++] = 0x80 | (0x3f & (c >> (i * 6)));
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movl %edi, %ebp
xorl %r15d, %r15d
movl $0x0, %r12d
cmpl $0x80, %edi
jl 0x4376
cmpl $0x800, %ebp            # imm = 0x800
jge 0x4356
movl $0xc0, %r12d
movl $0x1, %r15d
jmp 0x4376
xorl %r12d, %r12d
xorl %r15d, %r15d
cmpl $0x10000, %ebp          # imm = 0x10000
setge %r12b
setl %r15b
xorl $0x3, %r15d
orl $0xe, %r12d
shll $0x4, %r12d
leal 0x1(%r15), %r14d
movq %r14, %rdi
movq %rbx, %rsi
callq 0x7835
leal (%r15,%r15), %eax
leal (%rax,%rax,2), %ecx
movl %ebp, %eax
sarl %cl, %eax
orl %r12d, %eax
movq (%rbx), %rcx
movq 0x8(%rbx), %rdx
leaq 0x1(%rdx), %rsi
movq %rsi, 0x8(%rbx)
movb %al, (%rcx,%rdx)
testl %r15d, %r15d
je 0x43db
leal (%r15,%r15,2), %eax
leal -0x6(,%rax,2), %ecx
movl %ebp, %eax
sarl %cl, %eax
andb $0x3f, %al
orb $-0x80, %al
movq (%rbx), %rdx
movq 0x8(%rbx), %rsi
leaq 0x1(%rsi), %rdi
movq %rdi, 0x8(%rbx)
movb %al, (%rdx,%rsi)
decl %r14d
addl $-0x6, %ecx
cmpl $0x1, %r14d
jg 0x43b5
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/craigbarnes[P]lua-gumbo/lib/utf8.c
// Function: utf8iterator_next
static void update_position(Utf8Iterator* iter) {
  iter->_pos.offset += iter->_width;
  switch (iter->_current) {
  case '\n':
    ++iter->_pos.line;
    iter->_pos.column = 1;
    break;
  case '\t': {
    int tab_stop = iter->_parser->_options->tab_stop;
    iter->_pos.column = ((iter->_pos.column / tab_stop) + 1) * tab_stop;
    break;
  }
  case -1:
    break;
  default:
    ++iter->_pos.column;
    break;
  }
}

// Assembly:
movq 0x20(%rdi), %rcx
addq %rcx, 0x38(%rdi)
movl 0x18(%rdi), %eax
cmpl $-0x1, %eax
je 0x4430
cmpl $0x9, %eax
je 0x440c
cmpl $0xa, %eax
jne 0x442c
incq 0x28(%rdi)
movq $0x1, 0x30(%rdi)
jmp 0x4430
movq 0x30(%rdi), %rax
movq 0x58(%rdi), %rdx
movq (%rdx), %rdx
movslq (%rdx), %rsi
xorl %edx, %edx
divq %rsi
incq %rax
imulq %rsi, %rax
movq %rax, 0x30(%rdi)
jmp 0x4430
incq 0x30(%rdi)
addq %rcx, (%rdi)
jmp 0x7be5
// File: /workspace/github_c_makefile_star2_O1/craigbarnes[P]lua-gumbo/lib/parser.c
// Function: handle_text
static HOT bool handle_text(GumboParser* parser, GumboToken* token) {
  if (
    token->type == GUMBO_TOKEN_CHARACTER
    || token->type == GUMBO_TOKEN_WHITESPACE
  ) {
    insert_text_token(parser, token);
  } else {
    // We provide only bare-bones script handling that doesn't involve any of
    // the parser-pause/already-started/script-nesting flags or re-entrant
    // invocations of the tokenizer. Because the intended usage of this library
    // is mostly for templating, refactoring, and static-analysis libraries, we
    // provide the script body as a text-node child of the <script> element.
    // This behavior doesn't support document.write of partial HTML elements,
    // but should be adequate for almost all other scripting support.
    if (token->type == GUMBO_TOKEN_EOF) {
      parser_add_parse_error(parser, token);
      parser->_parser_state->_reprocess_current_token = true;
    }
    pop_current_node(parser);
    set_insertion_mode(parser, parser->_parser_state->_original_insertion_mode);
  }
  return true;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl (%rsi), %eax
leal -0x4(%rax), %ecx
cmpl $0x2, %ecx
jae 0x6538
movq %rbx, %rdi
callq 0xb82b
jmp 0x655e
cmpl $0x8, %eax
jne 0x654d
movq %rbx, %rdi
callq 0x8171
movq 0x18(%rbx), %rax
movb $0x1, 0x50(%rax)
movq %rbx, %rdi
callq 0xb8b5
movq 0x18(%rbx), %rax
movl 0x4(%rax), %ecx
movl %ecx, (%rax)
movb $0x1, %al
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/craigbarnes[P]lua-gumbo/gumbo/parse.c
// Function: parse
static int parse(lua_State *L)
{
    GumboOptions options = kGumboDefaultOptions;
    options.max_errors = 0;
    size_t input_len;
    const char *input = luaL_checklstring(L, 1, &input_len);
    options.tab_stop = (int)luaL_optinteger(L, 2, 8);

    size_t tagname_len;
    const char *tagname = luaL_optlstring(L, 3, NULL, &tagname_len);
    if (tagname != NULL) {
        options.fragment_context = gumbo_tagn_enum(tagname, tagname_len);
    }

    static const char *namespaces[] = {"html", "svg", "math", NULL};
    options.fragment_namespace = luaL_checkoption(L, 4, "html", namespaces);

    for (int i = 1; i <= nupvalues; i++) {
        luaL_checktype(L, i + 4, LUA_TTABLE);
    }
    lua_pushcclosure(L, push_document, nupvalues);

    GumboOutput *output = gumbo_parse_with_options(&options, input, input_len);
    if (unlikely(output == NULL)) {
        lua_pushnil(L);
        lua_pushliteral(L, "gumbo_parse_with_options() returned NULL");
        return 2;
    }

    GumboOutputStatus status = output->status;
    if (unlikely(status != GUMBO_STATUS_OK)) {
        gumbo_destroy_output(output);
        lua_pushnil(L);
        lua_pushstring(L, gumbo_status_to_string(status));
        return 2;
    }

    lua_pushlightuserdata(L, &output->document->v.document);
    int err = lua_pcall(L, 1, 1, 0);
    gumbo_destroy_output(output);
    if (unlikely(err != 0)) { // LUA_OK
        lua_pushnil(L);
        lua_pushvalue(L, -2);
        return 2;
    }
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x14e8a(%rip), %rax     # 0x1b650
movups (%rax), %xmm0
movaps %xmm0, (%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
movl $0x0, 0xc(%rsp)
leaq 0x20(%rsp), %rdx
movl $0x1, %esi
callq 0x4140
movq %rax, %r14
movl $0x8, %edx
movq %rbx, %rdi
movl $0x2, %esi
callq 0x41a0
movl %eax, (%rsp)
leaq 0x18(%rsp), %rcx
movq %rbx, %rdi
movl $0x3, %esi
xorl %edx, %edx
callq 0x40d0
testq %rax, %rax
je 0x682f
movq 0x18(%rsp), %rsi
movq %rax, %rdi
callq 0x7b67
movl %eax, 0x10(%rsp)
leaq 0x17523(%rip), %rdx     # 0x1dd59
leaq 0x50923(%rip), %rcx     # 0x57160
movq %rbx, %rdi
movl $0x4, %esi
callq 0x4090
movl %eax, 0x14(%rsp)
movl $0x5, %ebp
movq %rbx, %rdi
movl %ebp, %esi
movl $0x5, %edx
callq 0x41e0
incl %ebp
cmpl $0xe, %ebp
jne 0x6853
leaq 0x9d(%rip), %rsi        # 0x690d
movq %rbx, %rdi
movl $0x9, %edx
callq 0x4070
movq 0x20(%rsp), %rdx
movq %rsp, %rdi
movq %r14, %rsi
callq 0x4438
testq %rax, %rax
je 0x68e7
movq %rax, %r14
movl 0x20(%rax), %edx
testl %edx, %edx
jne 0x68f1
movq (%r14), %rsi
addq $0x18, %rsi
movq %rbx, %rdi
callq 0x41f0
movl $0x1, %ebp
movq %rbx, %rdi
movl $0x1, %esi
movl $0x1, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x4280
movl %eax, %r15d
movq %r14, %rdi
callq 0x83c1
testl %r15d, %r15d
jne 0x68fe
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0x42e4
jmp 0x6906
movq %r14, %rdi
movq %rbx, %rsi
callq 0x42a0
jmp 0x6906
movq %rbx, %rdi
callq 0x42ce
movl $0x2, %ebp
jmp 0x68da
// File: /workspace/github_c_makefile_star2_O1/craigbarnes[P]lua-gumbo/gumbo/parse.c
// Function: push_document
static int push_document(lua_State *L)
{
    const GumboDocument *document = lua_touserdata(L, 1);
    lua_createtable(L, 0, 4);
    if (document->has_doctype) {
        set_integer(L, "quirksModeEnum", document->doc_type_quirks_mode);
        set_children(L, &document->children, 2);
        lua_getfield(L, -1, "childNodes");
        lua_createtable(L, 0, 3); // doctype
        set_string(L, "name", document->name);
        set_string(L, "publicId", document->public_identifier);
        set_string(L, "systemId", document->system_identifier);
        setmetatable(L, DocumentType);
        lua_rawseti(L, -2, 1); // childNodes[1] = doctype
        lua_pop(L, 1);
    } else {
        set_children(L, &document->children, 1);
    }
    setmetatable(L, Document);
    return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x1, %esi
callq 0x4060
movq %rax, %r14
movq %rbx, %rdi
xorl %esi, %esi
movl $0x4, %edx
callq 0x40a0
cmpb $0x1, 0x10(%r14)
jne 0x6a49
leaq 0x13724(%rip), %rsi     # 0x1a066
movq %rbx, %rdi
callq 0x4260
movl 0x30(%r14), %esi
movq %rbx, %rdi
callq 0x4130
movq %rbx, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x40c0
movq %rbx, %rdi
movq %r14, %rsi
movl $0x2, %edx
callq 0x6a80
leaq 0x136fb(%rip), %rdx     # 0x1a075
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x4270
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
callq 0x40a0
leaq 0x13ac8(%rip), %rsi     # 0x1a465
movq %rbx, %rdi
callq 0x4260
movq 0x18(%r14), %rsi
movq %rbx, %rdi
callq 0x4260
movq %rbx, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x40c0
leaq 0x136bb(%rip), %rsi     # 0x1a080
movq %rbx, %rdi
callq 0x4260
movq 0x20(%r14), %rsi
movq %rbx, %rdi
callq 0x4260
movq %rbx, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x40c0
leaq 0x1369c(%rip), %rsi     # 0x1a089
movq %rbx, %rdi
callq 0x4260
movq 0x28(%r14), %rsi
movq %rbx, %rdi
callq 0x4260
movq %rbx, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x40c0
movq %rbx, %rdi
movl $0xfff0b9d2, %esi       # imm = 0xFFF0B9D2
callq 0x4150
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x4170
movl $0x1, %edx
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x4180
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x4040
jmp 0x6a59
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x6a80
movq %rbx, %rdi
movl $0xfff0b9d3, %esi       # imm = 0xFFF0B9D3
callq 0x4150
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x4170
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/craigbarnes[P]lua-gumbo/gumbo/parse.c
// Function: set_tag
static void set_tag(lua_State *L, const GumboElement *element)
{
    if (element->tag_namespace == GUMBO_NAMESPACE_SVG) {
        set_literal(L, "namespace", "svg");
        GumboStringPiece original_tag = element->original_tag;
        gumbo_tag_from_original_text(&original_tag);
        const char *normalized = gumbo_normalize_svg_tagname(&original_tag);
        if (normalized) {
            set_string(L, "localName", normalized);
            return;
        }
    } else if (element->tag_namespace == GUMBO_NAMESPACE_MATHML) {
        set_literal(L, "namespace", "math");
    }
    if (element->tag == GUMBO_TAG_UNKNOWN) {
        GumboStringPiece original_tag = element->original_tag;
        gumbo_tag_from_original_text(&original_tag);
        pushstring_lower(L, original_tag.data, original_tag.length);
    } else {
        lua_pushstring(L, gumbo_normalized_tagname(element->tag));
    }
    lua_setfield(L, -2, "localName");
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x2030, %rsp           # imm = 0x2030
movq %rsi, %r14
movq %rdi, %rbx
movl 0x14(%rsi), %eax
cmpl $0x2, %eax
je 0x6e7f
cmpl $0x1, %eax
jne 0x6eaa
leaq 0x13314(%rip), %rsi     # 0x1a11d
movq %rbx, %rdi
callq 0x4260
leaq 0x18470(%rip), %rsi     # 0x1f288
movq %rbx, %rdi
callq 0x4260
movq %rbx, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x40c0
movups 0x18(%r14), %xmm0
leaq 0x10(%rsp), %r15
movaps %xmm0, (%r15)
movq %r15, %rdi
callq 0x7a69
movq %r15, %rdi
callq 0x80e8
testq %rax, %rax
je 0x6eaa
movq %rax, %r15
leaq 0x13271(%rip), %rsi     # 0x1a0cb
movq %rbx, %rdi
callq 0x4260
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4260
movq %rbx, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x40c0
jmp 0x6f3f
leaq 0x13297(%rip), %rsi     # 0x1a11d
movq %rbx, %rdi
callq 0x4260
leaq 0x131a3(%rip), %rsi     # 0x1a038
movq %rbx, %rdi
callq 0x4260
movq %rbx, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x40c0
movl 0x10(%r14), %edi
cmpl $0x96, %edi
jne 0x6f1b
movups 0x18(%r14), %xmm0
movq %rsp, %r14
movaps %xmm0, (%r14)
movq %r14, %rdi
callq 0x7a69
movq (%r14), %r15
movq 0x8(%r14), %r14
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x41d0
testq %r14, %r14
je 0x6f0b
xorl %ecx, %ecx
leaq 0x13261(%rip), %rdx     # 0x1a150
movzbl (%r15,%rcx), %esi
movb (%rdx,%rsi), %dil
andb $0x20, %dil
orb %sil, %dil
movb %dil, (%rax,%rcx)
incq %rcx
cmpq %rcx, %r14
jne 0x6eef
leaq 0x10(%rsp), %rdi
addq %r14, 0x10(%rdi)
callq 0x40e0
jmp 0x6f2b
callq 0x7a30
movq %rbx, %rdi
movq %rax, %rsi
callq 0x4260
leaq 0x13199(%rip), %rdx     # 0x1a0cb
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x4110
addq $0x2030, %rsp           # imm = 0x2030
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/craigbarnes[P]lua-gumbo/gumbo/parse.c
// Function: set_sourcepos
static void set_sourcepos(lua_State *L, const GumboSourcePosition pos)
{
    if (pos.line != 0) {
        set_integer(L, "line", pos.line);
        set_integer(L, "column", pos.column);
        set_integer(L, "offset", pos.offset);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0x20(%rsp), %r14
testq %r14, %r14
je 0x6fe0
movq %rdi, %rbx
leaq 0x20(%rsp), %r15
leaq 0x131b9(%rip), %rsi     # 0x1a127
callq 0x4260
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4130
movq %rbx, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x40c0
leaq 0x1319a(%rip), %rsi     # 0x1a12c
movq %rbx, %rdi
callq 0x4260
movq 0x8(%r15), %rsi
movq %rbx, %rdi
callq 0x4130
movq %rbx, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x40c0
leaq 0x488e7(%rip), %rsi     # 0x4f8a1
movq %rbx, %rdi
callq 0x4260
movq 0x10(%r15), %rsi
movq %rbx, %rdi
callq 0x4130
movq %rbx, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
popq %rbx
popq %r14
popq %r15
jmp 0x40c0
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/craigbarnes[P]lua-gumbo/gumbo/parse.c
// Function: create_text_node
static void create_text_node(lua_State *L, const GumboText *t, Upvalue i)
{
    lua_createtable(L, 0, 5);
    set_string(L, "data", t->text);
    set_sourcepos(L, t->start_pos);
    setmetatable(L, i);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
xorl %esi, %esi
movl $0x5, %edx
callq 0x40a0
leaq 0x1884b(%rip), %rsi     # 0x1fa03
movq %rbx, %rdi
callq 0x4260
movq (%r14), %rsi
movq %rbx, %rdi
callq 0x4260
movq %rbx, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x40c0
movq 0x28(%r14), %rax
movq %rax, 0x10(%rsp)
movups 0x18(%r14), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x6f4c
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
subl %ebp, %esi
movq %rbx, %rdi
callq 0x4150
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x4170
nop
// File: /workspace/github_c_makefile_star2_O1/craigbarnes[P]lua-gumbo/lib/attribute.c
// Function: gumbo_get_attribute
GumboAttribute* gumbo_get_attribute (
  const GumboVector* attrs,
  const char* name
) {
  for (unsigned int i = 0; i < attrs->length; ++i) {
    GumboAttribute* attr = attrs->data[i];
    if (ascii_streq_icase(attr->name, name)) {
      return attr;
    }
  }
  return NULL;
}

// Assembly:
movl 0x8(%rdi), %ecx
testq %rcx, %rcx
je 0x7281
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
movq (%rdi), %rdx
leaq 0x12f20(%rip), %rdi     # 0x1a150
xorl %r8d, %r8d
movq (%rdx,%r8,8), %r9
movq 0x8(%r9), %r10
xorl %r11d, %r11d
movzbl (%r10,%r11), %r14d
movb (%rdi,%r14), %bl
andb $0x20, %bl
movzbl (%rsi,%r11), %r15d
movb (%rdi,%r15), %bpl
andb $0x20, %bpl
orb %r15b, %bpl
orb %r14b, %bl
je 0x7267
incq %r11
cmpb %bpl, %bl
je 0x723e
cmpb %bpl, %bl
cmoveq %r9, %rax
je 0x727a
incq %r8
cmpq %rcx, %r8
jne 0x7233
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
retq